From 83199132d97d644655fe016eceb69a43882ee257 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 3 Apr 2023 19:26:08 -0700 Subject: [PATCH 01/25] WIP: Massive modernization of the entire SDK --- .babelrc | 13 +- .eslintrc.js | 9 - .nvmrc | 1 - .tool-versions | 1 - README.md | 12 +- {src => cfg}/.eslintrc.js | 9 +- .jsdoc.json => cfg/.jsdoc.json | 4 +- .jshintrc => cfg/.jshintrc | 0 cfg/.nvmrc | 1 + cfg/.nycrc | 3 + .prettierignore => cfg/.prettierignore | 0 cfg/dist/stellar-base.js | 7 + cfg/dist/stellar-base.min.js | 0 .../karma-sauce.conf.js | 13 +- karma.conf.js => cfg/karma.conf.js | 11 +- prettier.config.js => cfg/prettier.config.js | 0 cfg/webpack.config.browser.js | 18 + cfg/webpack.config.js | 70 + gulpfile.js | 127 +- package.json | 101 +- src/index.js | 45 +- test/mocha.opts | 1 - test/test-helper.js | 10 +- test/unit/browser_test.js | 4 +- test/unit/hashing_test.js | 27 +- test/unit/memo_test.js | 108 +- test/unit/signing_test.js | 69 +- test/unit/strkey_test.js | 222 +- types/tslint.json | 2 +- webpack.config.browser.js | 20 - yarn.lock | 10121 +++++++--------- 31 files changed, 4861 insertions(+), 6168 deletions(-) delete mode 100644 .eslintrc.js delete mode 100644 .nvmrc delete mode 100644 .tool-versions rename {src => cfg}/.eslintrc.js (86%) rename .jsdoc.json => cfg/.jsdoc.json (83%) rename .jshintrc => cfg/.jshintrc (100%) create mode 100644 cfg/.nvmrc create mode 100644 cfg/.nycrc rename .prettierignore => cfg/.prettierignore (100%) create mode 100644 cfg/dist/stellar-base.js create mode 100644 cfg/dist/stellar-base.min.js rename karma-sauce.conf.js => cfg/karma-sauce.conf.js (79%) rename karma.conf.js => cfg/karma.conf.js (63%) rename prettier.config.js => cfg/prettier.config.js (100%) create mode 100644 cfg/webpack.config.browser.js create mode 100644 cfg/webpack.config.js delete mode 100644 test/mocha.opts delete mode 100644 webpack.config.browser.js diff --git a/.babelrc b/.babelrc index 01ed4f5c4..8b48a5976 100644 --- a/.babelrc +++ b/.babelrc @@ -1,9 +1,10 @@ { "presets": [ - ["env", { - "targets": { - "ie": "11" - } - }] - ] + "@babel/preset-env" + ], + "env": { + "test": { + "plugins": ["istanbul"] + } + } } diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 130bf240b..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - env: { - node: true - }, - extends: ['eslint:recommended', 'plugin:node/recommended'], - rules: { - 'node/no-unpublished-require': 0 - } -}; diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 9ddeebac8..000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -14.19.1 diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 1cab425cc..000000000 --- a/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -nodejs 14.19.1 diff --git a/README.md b/README.md index b2cae982b..5abfcd387 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ implementation in JavaScript that can be used on either Node.js or web browsers. > **Warning!** The Node version of this package uses the [`sodium-native`](https://www.npmjs.com/package/sodium-native) package, a native implementation of [Ed25519](https://ed25519.cr.yp.to/) in Node.js, as an [optional dependency](https://docs.npmjs.com/files/package.json#optionaldependencies). > This means that if for any reason installation of this package fails, `stellar-base` will fallback to the much slower implementation contained in [`tweetnacl`](https://www.npmjs.com/package/tweetnacl). -> +> > If you'd explicitly prefer **not** to install the `sodium-native` package, pass the appropriate flag to skip optional dependencies when installing this package (e.g. `--no-optional` if using `npm install` or `--without-optional` using `yarn install`). -> +> > If you are using `stellar-base` in a browser you can ignore this. However, for production backend deployments you should most likely be using `sodium-native`. > If `sodium-native` is successfully installed and working, > `StellarBase.FastSigning` variable will be equal `true`. Otherwise it will be @@ -102,11 +102,11 @@ Make sure that you are using the latest version number. They can be found on the 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. -If you work on several projects that use different Node versions, you might find helpful to install a nodejs version manager. +If you work on several projects that use different Node versions, you might find helpful to install a NodeJS version manager: -- https://github.com/creationix/nvm -- https://github.com/wbyoung/avn -- https://github.com/asdf-vm/asdf + - https://github.com/creationix/nvm + - https://github.com/wbyoung/avn + - https://github.com/asdf-vm/asdf 2. Install Yarn diff --git a/src/.eslintrc.js b/cfg/.eslintrc.js similarity index 86% rename from src/.eslintrc.js rename to cfg/.eslintrc.js index 8b5543335..5dc7805a3 100644 --- a/src/.eslintrc.js +++ b/cfg/.eslintrc.js @@ -5,6 +5,13 @@ module.exports = { extends: ['airbnb-base', 'prettier'], plugins: ['prettier', 'prefer-import'], rules: { + // DISABLED + 'import/no-import-module-exports': [ + 'error', + { + exceptions: ['index.js'] + } + ], // OFF 'import/prefer-default-export': 0, 'node/no-unsupported-features/es-syntax': 0, @@ -38,5 +45,5 @@ module.exports = { // ERROR 'no-unused-expressions': [2, { allowTaggedTemplates: true }] }, - parser: 'babel-eslint' + parser: '@babel/eslint-parser' }; diff --git a/.jsdoc.json b/cfg/.jsdoc.json similarity index 83% rename from .jsdoc.json rename to cfg/.jsdoc.json index 2a7b07e1c..650b8717c 100644 --- a/.jsdoc.json +++ b/cfg/.jsdoc.json @@ -9,7 +9,5 @@ "template": "node_modules/minami", "readme": "./README.md" }, - "plugins": [ - "plugins/markdown" - ] + "plugins": ["plugins/markdown"] } diff --git a/.jshintrc b/cfg/.jshintrc similarity index 100% rename from .jshintrc rename to cfg/.jshintrc diff --git a/cfg/.nvmrc b/cfg/.nvmrc new file mode 100644 index 000000000..a3eb5a03f --- /dev/null +++ b/cfg/.nvmrc @@ -0,0 +1 @@ +14.20.0 diff --git a/cfg/.nycrc b/cfg/.nycrc new file mode 100644 index 000000000..e1552dab7 --- /dev/null +++ b/cfg/.nycrc @@ -0,0 +1,3 @@ +{ + "extends": "@istanbuljs/nyc-config-babel" +} \ No newline at end of file diff --git a/.prettierignore b/cfg/.prettierignore similarity index 100% rename from .prettierignore rename to cfg/.prettierignore diff --git a/cfg/dist/stellar-base.js b/cfg/dist/stellar-base.js new file mode 100644 index 000000000..65e5d5e60 --- /dev/null +++ b/cfg/dist/stellar-base.js @@ -0,0 +1,7 @@ +/******/ (() => { + // webpackBootstrap + /******/ 'use strict'; + /******/ + /******/ + /******/ +})(); diff --git a/cfg/dist/stellar-base.min.js b/cfg/dist/stellar-base.min.js new file mode 100644 index 000000000..e69de29bb diff --git a/karma-sauce.conf.js b/cfg/karma-sauce.conf.js similarity index 79% rename from karma-sauce.conf.js rename to cfg/karma-sauce.conf.js index 9c45fccd8..9d8ebf6d1 100644 --- a/karma-sauce.conf.js +++ b/cfg/karma-sauce.conf.js @@ -1,6 +1,4 @@ var webpackConfig = require('./webpack.config.browser.js'); -delete webpackConfig.plugins; -delete webpackConfig.output; module.exports = function(config) { var customLaunchers = { @@ -21,6 +19,12 @@ module.exports = function(config) { browserName: 'internet explorer', platform: 'Windows 8.1', version: 'latest' + }, + sl_edge: { + base: 'SauceLabs', + browserName: 'microsoft edge', + platform: 'Windows 8.1', + version: 'latest' } }; @@ -34,14 +38,13 @@ module.exports = function(config) { customLaunchers: customLaunchers, browsers: Object.keys(customLaunchers), - files: ['dist/stellar-base.min.js', 'test/unit/**/*.js'], + files: ['../dist/stellar-base.min.js', '../test/unit/**/*.js'], preprocessors: { - 'test/unit/**/*.js': ['webpack'] + '../test/unit/**/*.js': ['webpack'] }, webpack: webpackConfig, - webpackMiddleware: { noInfo: true }, diff --git a/karma.conf.js b/cfg/karma.conf.js similarity index 63% rename from karma.conf.js rename to cfg/karma.conf.js index 049fb2018..027e0d434 100644 --- a/karma.conf.js +++ b/cfg/karma.conf.js @@ -1,24 +1,27 @@ var webpackConfig = require('./webpack.config.browser.js'); -delete webpackConfig.plugins; delete webpackConfig.output; +webpackConfig.entry = {}; // karma fills these in module.exports = function(config) { config.set({ frameworks: ['mocha', 'sinon-chai'], browsers: ['FirefoxHeadless', 'ChromeHeadless'], - files: ['dist/stellar-base.js', 'test/unit/**/*.js'], + files: [ + '../dist/stellar-base.js', // webpack should build this first + '../test/unit/**/*.js' + ], preprocessors: { - 'test/unit/**/*.js': ['webpack'] + '../test/unit/**/*.js': ['webpack'] }, webpack: webpackConfig, - webpackMiddleware: { noInfo: true }, + colors: true, singleRun: true, reporters: ['dots'] diff --git a/prettier.config.js b/cfg/prettier.config.js similarity index 100% rename from prettier.config.js rename to cfg/prettier.config.js diff --git a/cfg/webpack.config.browser.js b/cfg/webpack.config.browser.js new file mode 100644 index 000000000..5c7e88ebb --- /dev/null +++ b/cfg/webpack.config.browser.js @@ -0,0 +1,18 @@ +var webpack = require('webpack'); +var NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); + +var baseConfig = require('./webpack.config.js'); + +delete baseConfig.entry['stellar-base.min']; +baseConfig.output.clean = false; +baseConfig.optimization = {}; +baseConfig.plugins = [ + // Ignore native modules (sodium-native) + new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }), + new NodePolyfillPlugin(), + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'] + }) +]; + +module.exports = baseConfig; diff --git a/cfg/webpack.config.js b/cfg/webpack.config.js new file mode 100644 index 000000000..e229ff7ea --- /dev/null +++ b/cfg/webpack.config.js @@ -0,0 +1,70 @@ +var path = require('path'); +var webpack = require('webpack'); + +var ESLintPlugin = require('eslint-webpack-plugin'); +var TerserPlugin = require('terser-webpack-plugin'); +var NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); + +const config = { + entry: { + 'stellar-base': path.resolve(__dirname, '../src/index.js'), + 'stellar-base.min': path.resolve(__dirname, '../src/index.js') + }, + resolve: { + fallback: { + crypto: require.resolve('crypto-browserify'), + stream: require.resolve('stream-browserify'), + buffer: require.resolve('buffer') + } + }, + output: { + clean: true, + library: 'StellarBase', + path: path.resolve(__dirname, '../dist') + }, + mode: process.env.NODE_ENV, + devtool: process.env.NODE_ENV === 'production' ? null : 'inline-source-map', + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: ['babel-loader'] + }, + { + test: /\.js$/, + exclude: /node_modules\/(?!(crc)\/).*/, + loader: 'babel-loader' + } + ] + }, + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + include: /\.min\.js$/, + terserOptions: { + format: { + ascii_only: true + } + } + }) + ] + }, + plugins: [ + new ESLintPlugin({ + overrideConfigFile: path.resolve(__dirname, './.eslintrc.js') + }), + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'] + }), + // Ignore native modules (sodium-native) + new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }), + new NodePolyfillPlugin() + ], + watchOptions: { + ignored: /(node_modules|coverage)/ + } +}; + +module.exports = config; diff --git a/gulpfile.js b/gulpfile.js index 196e80bf2..e0f7a8ac3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,49 +1,47 @@ -'use strict'; - -var gulp = require('gulp'); -var isparta = require('isparta'); -var plugins = require('gulp-load-plugins')(); -var coveralls = require('@kollavarsham/gulp-coveralls'); -var clear = require('clear'); -var webpackConfigBrowser = require('./webpack.config.browser.js'); -var webpack = require('webpack-stream'); -var del = require('del'); - -gulp.task('lint:src', function lintSrc() { +"use strict"; + +var gulp = require("gulp"); +var plugins = require("gulp-load-plugins")(); +var clear = require("clear"); +var webpackConfigBrowser = require("./webpack.config.browser.js"); +var webpack = require("webpack-stream"); +var del = require("del"); + +gulp.task("lint:src", function lintSrc() { return gulp - .src(['src/**/*.js']) + .src(["src/**/*.js"]) .pipe(plugins.eslint()) .pipe(plugins.eslint.format()) .pipe(plugins.eslint.failAfterError()); }); // Lint our test code -gulp.task('lint:test', function lintTest() { +gulp.task("lint:test", function lintTest() { return gulp - .src(['test/unit/**/*.js']) + .src(["test/unit/**/*.js"]) .pipe(plugins.eslint()) .pipe(plugins.eslint.format()) .pipe(plugins.eslint.failAfterError()); }); gulp.task( - 'build:node', - gulp.series('lint:src', function buildNode() { + "build:node", + gulp.series("lint:src", function buildNode() { return gulp - .src('src/**/*.js') + .src("src/**/*.js") .pipe(plugins.babel()) - .pipe(gulp.dest('lib')); + .pipe(gulp.dest("lib")); }) ); gulp.task( - 'build:browser', - gulp.series('lint:src', function buildNode() { + "build:browser", + gulp.series("lint:src", function buildNode() { return gulp - .src('src/browser.js') + .src("src/browser.js") .pipe(webpack(webpackConfigBrowser)) - .pipe(plugins.rename('stellar-base.js')) - .pipe(gulp.dest('dist')) + .pipe(plugins.rename("stellar-base.js")) + .pipe(gulp.dest("dist")) .pipe( plugins.uglify({ output: { @@ -51,50 +49,46 @@ gulp.task( } }) ) - .pipe(plugins.rename('stellar-base.min.js')) - .pipe(gulp.dest('dist')); + .pipe(plugins.rename("stellar-base.min.js")) + .pipe(gulp.dest("dist")); }) ); -gulp.task('clean-coverage', function cleanCoverage() { - return del(['coverage/']); +gulp.task("clean-coverage", function cleanCoverage() { + return del(["coverage/"]); }); gulp.task( - 'test:init-istanbul', - gulp.series('clean-coverage', function testInitIstanbul() { + "test:init-nyc", + gulp.series("clean-coverage", function testInitNyc() { return gulp - .src(['src/**/*.js']) - .pipe( - plugins.istanbul({ - instrumenter: isparta.Instrumenter - }) - ) - .pipe(plugins.istanbul.hookRequire()); + .src(["src/**/*.js"]) + .pipe(plugins.nyc()) + .pipe(plugins.nyc.hookRequire()); }) ); gulp.task( - 'test:node', - gulp.series('build:node', 'test:init-istanbul', function testNode() { + "test:node", + gulp.series("build:node", "test:init-nyc", function testNode() { return gulp - .src(['test/test-helper.js', 'test/unit/**/*.js']) + .src(["test/test-helper.js", "test/unit/**/*.js"]) .pipe( plugins.mocha({ - reporter: ['dot'] + reporter: ["dot"] }) ) - .pipe(plugins.istanbul.writeReports()); + .pipe(plugins.nyc.writeReports()); }) ); gulp.task( - 'test:browser', - gulp.series('build:browser', function testBrowser(done) { - var Server = require('karma').Server; + "test:browser", + gulp.series("build:browser", function testBrowser(done) { + var Server = require("karma").Server; var server = new Server( - { configFile: __dirname + '/karma.conf.js' }, - (exitCode) => { + { configFile: __dirname + "/karma.conf.js" }, + exitCode => { if (exitCode !== 0) { done(new Error(`Bad exit code ${exitCode}`)); } else { @@ -106,17 +100,20 @@ gulp.task( }) ); -gulp.task('test:watch', function() { - return gulp.watch(['src/**/*', 'test/unit/**/*.js'], gulp.series(['clear-screen', 'test:node'])); +gulp.task("test:watch", function() { + return gulp.watch( + ["src/**/*", "test/unit/**/*.js"], + gulp.series(["clear-screen", "test:node"]) + ); }); gulp.task( - 'test:sauce', - gulp.series('build:browser', function testSauce(done) { - var Server = require('karma').Server; + "test:sauce", + gulp.series("build:browser", function testSauce(done) { + var Server = require("karma").Server; var server = new Server( - { configFile: __dirname + '/karma-sauce.conf.js' }, - (exitCode) => { + { configFile: __dirname + "/karma-sauce.conf.js" }, + exitCode => { if (exitCode !== 0) { done(new Error(`Bad exit code ${exitCode}`)); } else { @@ -128,28 +125,24 @@ gulp.task( }) ); -gulp.task('clear-screen', function clearScreen(cb) { +gulp.task("clear-screen", function clearScreen(cb) { clear(); cb(); }); -gulp.task('clean', function clean() { - return del(['dist/', 'lib/']); +gulp.task("clean", function clean() { + return del(["dist/", "lib/"]); }); -gulp.task('build', gulp.series('clean', 'build:node', 'build:browser')); +gulp.task("build", gulp.series("clean", "build:node", "build:browser")); -gulp.task('test', gulp.series('clean', 'test:node', 'test:browser')); +gulp.task("test", gulp.series("clean", "test:node", "test:browser")); -gulp.task('default', gulp.series('build')); +gulp.task("default", gulp.series("build")); gulp.task( - 'watch', - gulp.series('build', function watch() { - gulp.watch('src/**/*', ['clear-screen', 'build']); + "watch", + gulp.series("build", function watch() { + gulp.watch("src/**/*", ["clear-screen", "build"]); }) ); - -gulp.task('submit-coverage', function submitCoverage() { - return gulp.src('./coverage/**/lcov.info').pipe(coveralls()); -}); diff --git a/package.json b/package.json index 4ec1ea869..1335e17c1 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,29 @@ { "name": "stellar-base", - "version": "8.2.2", - "description": "Low level stellar support library", + "version": "9.0.0", + "description": "Low-level support library for the Stellar network.", "main": "./lib/index.js", "types": "./types/index.d.ts", "scripts": { - "test": "gulp test:node", - "test:watch": "gulp test:watch", - "docs": "jsdoc -c .jsdoc.json --verbose", - "dtslint": "dtslint types --localTs node_modules/typescript/lib", - "preversion": "gulp test", - "version": "gulp build", + "build": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.js", + "build:browser": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.browser.js", + "test": "yarn clean && yarn build && nyc mocha --recursive", + "test:browser": "yarn build:browser && karma start ./cfg/karma.conf.js && karma start ./cfg/karma-sauce.conf.js", + "test:all": "yarn test && yarn test:browser && yarn tslint", + "docs": "jsdoc -c ./cfg/.jsdoc.json --verbose", + "tslint": "dtslint --localTs node_modules/typescript/lib types/", + "preversion": "yarn test:all", + "version": "cross-env NODE_ENV=production yarn build", "postversion": "git push && git push --tags", - "prettier-all": "prettier --write **/*.js" + "pretty": "prettier --config ./cfg/prettier.config.js --write './**/*.js'", + "clean": "rm -rf dist/ coverage/" + }, + "mocha": { + "require": [ + "@babel/register", + "./test/test-helper.js" + ], + "reporter": "dot" }, "files": [ "/lib", @@ -40,79 +51,75 @@ "keywords": [ "stellar" ], - "author": "Scott Fleckenstein ", + "author": "George Kudrayvtsev ", "license": "Apache-2.0", "bugs": { "url": "https://github.com/stellar/js-stellar-base/issues" }, "homepage": "https://github.com/stellar/js-stellar-base", "devDependencies": { - "@kollavarsham/gulp-coveralls": "0.2.8", + "@babel/cli": "^7.21.0", + "@babel/core": "^7.12.0", + "@babel/eslint-parser": "^7.21.3", + "@babel/preset-env": "^7.21.4", + "@babel/preset-typescript": "^7.21.4", + "@babel/register": "^7.21.0", + "@definitelytyped/dtslint": "^0.0.159", + "@istanbuljs/nyc-config-babel": "3.0.0", "@types/node": "^11.13.0", - "babel-cli": "^6.26.0", - "babel-core": "~6.26.3", - "babel-eslint": "^10.0.1", - "babel-istanbul": "^0.12.2", - "babel-loader": "~7.0.0", - "babel-preset-env": "^1.7.0", - "babel-register": "^6.26.0", - "chai": "^2.2.0", + "babel-loader": "^9.1.2", + "babel-plugin-istanbul": "^6.1.1", + "chai": "^4.3.7", "clear": "^0.1.0", - "coveralls": "^3.0.2", "del": "^5.1.0", - "dtslint": "3.5.0", - "eslint": "^5.12.1", - "eslint-config-airbnb-base": "^13.1.0", + "eslint": "^8.37.0", + "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^3.6.0", - "eslint-plugin-import": "^2.15.0", + "eslint-plugin-import": "^2.25.2", "eslint-plugin-node": "^8.0.1", "eslint-plugin-prefer-import": "^0.0.1", "eslint-plugin-prettier": "^3.0.1", + "eslint-webpack-plugin": "^4.0.0", "ghooks": "^0.3.0", - "gulp": "^4.0.0", - "gulp-babel": "^6.1.3", - "gulp-eslint": "^5.0.0", - "gulp-istanbul": "^1.1.1", - "gulp-load-plugins": "^2.0.1", - "gulp-mocha": "^7.0.2", - "gulp-plumber": "^1.0.0", - "gulp-rename": "~1.2.0", - "gulp-uglify": "^3.0.1", "husky": "^1.3.1", - "isparta": "^4.1.1", - "istanbul": "^0.4.5", "jsdoc": "^3.5.5", - "karma": "^6.3.4", + "karma": "^6.4.1", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.1", "karma-mocha": "^2.0.0", - "karma-phantomjs-launcher": "^1.0.4", "karma-sauce-launcher": "2.0.2", "karma-sinon-chai": "^2.0.2", - "karma-webpack": "^4.0.2", - "lint-staged": "7.3.0", + "karma-webpack": "^5.0.0", + "lint-staged": "^13.2.0", "minami": "^1.1.1", "mocha": "^7.1.1", + "mocha-loader": "^5.1.5", + "nyc": "^15.1.0", "prettier": "^1.16.1", "randombytes": "^2.1.0", - "sinon": "^1.14.1", - "sinon-chai": "^2.7.0", - "webpack": "^v4.39.2", - "webpack-stream": "^5.2.1" + "sinon": "^15.0.3", + "sinon-chai": "^3.7.0", + "terser-webpack-plugin": "^5.3.7", + "ts-node": "^10.9.1", + "webpack": "^5.77.0", + "webpack-cli": "^5.0.1" }, "dependencies": { "base32.js": "^0.1.0", "bignumber.js": "^4.0.0", + "buffer": "^6.0.3", "crc": "^3.5.0", + "cross-env": "^7.0.3", + "crypto-browserify": "^3.12.0", + "debug": "^4.3.1", "js-xdr": "^1.1.3", "lodash": "^4.17.21", + "node-polyfill-webpack-plugin": "^2.0.1", "sha.js": "^2.3.6", - "tweetnacl": "^1.0.3" + "tweetnacl": "^1.0.3", + "typescript": "^5.0.3" }, "optionalDependencies": { "sodium-native": "^3.3.0" - }, - "resolutions": { - "**/ua-parser-js": "0.7.28" } } diff --git a/src/index.js b/src/index.js index a13c405c1..e1da16eda 100644 --- a/src/index.js +++ b/src/index.js @@ -1,44 +1,45 @@ -import xdr from './xdr'; +/* eslint-disable import/no-import-module-exports */ +import xdr from "./xdr"; export { xdr }; -export { hash } from './hashing'; -export { sign, verify, FastSigning } from './signing'; +export { hash } from "./hashing"; +export { sign, verify, FastSigning } from "./signing"; export { getLiquidityPoolId, LiquidityPoolFeeV18 -} from './get_liquidity_pool_id'; -export { Keypair } from './keypair'; -export { UnsignedHyper, Hyper } from 'js-xdr'; -export { TransactionBase } from './transaction_base'; -export { Transaction } from './transaction'; -export { FeeBumpTransaction } from './fee_bump_transaction'; +} from "./get_liquidity_pool_id"; +export { Keypair } from "./keypair"; +export { UnsignedHyper, Hyper } from "js-xdr"; +export { TransactionBase } from "./transaction_base"; +export { Transaction } from "./transaction"; +export { FeeBumpTransaction } from "./fee_bump_transaction"; export { TransactionBuilder, TimeoutInfinite, BASE_FEE -} from './transaction_builder'; -export { Asset } from './asset'; -export { LiquidityPoolAsset } from './liquidity_pool_asset'; -export { LiquidityPoolId } from './liquidity_pool_id'; +} from "./transaction_builder"; +export { Asset } from "./asset"; +export { LiquidityPoolAsset } from "./liquidity_pool_asset"; +export { LiquidityPoolId } from "./liquidity_pool_id"; export { Operation, AuthRequiredFlag, AuthRevocableFlag, AuthImmutableFlag, AuthClawbackEnabledFlag -} from './operation'; -export * from './memo'; -export { Account } from './account'; -export { MuxedAccount } from './muxed_account'; -export { Claimant } from './claimant'; -export { Networks } from './network'; -export { StrKey } from './strkey'; -export { SignerKey } from './signerkey'; +} from "./operation"; +export * from "./memo"; +export { Account } from "./account"; +export { MuxedAccount } from "./muxed_account"; +export { Claimant } from "./claimant"; +export { Networks } from "./network"; +export { StrKey } from "./strkey"; +export { SignerKey } from "./signerkey"; export { decodeAddressToMuxedAccount, encodeMuxedAccountToAddress, extractBaseAddress, encodeMuxedAccount -} from './util/decode_encode_muxed_account'; +} from "./util/decode_encode_muxed_account"; export default module.exports; diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index b3d3729d5..000000000 --- a/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ ---require ./test/test-helper.js diff --git a/test/test-helper.js b/test/test-helper.js index 995239a74..e03b4224a 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -1,7 +1,7 @@ -if (typeof window === 'undefined') { - require('babel-core/register'); - global.StellarBase = require('../src/index'); - global.chai = require('chai'); - global.sinon = require('sinon'); +if (typeof window === "undefined") { + require("@babel/register"); + global.StellarBase = require("../src/index"); + global.chai = require("chai"); + global.sinon = require("sinon"); global.expect = global.chai.expect; } diff --git a/test/unit/browser_test.js b/test/unit/browser_test.js index 684877a4c..081c67b95 100644 --- a/test/unit/browser_test.js +++ b/test/unit/browser_test.js @@ -1,5 +1,5 @@ -describe('Browser version tests', function() { - it("lodash is not exported globally", function () { +describe("Browser version tests", function() { + it("lodash is not exported globally", function() { if (typeof window !== "undefined") { expect(typeof _ === "undefined").to.be.true; } diff --git a/test/unit/hashing_test.js b/test/unit/hashing_test.js index 0779b4553..63d4e9338 100644 --- a/test/unit/hashing_test.js +++ b/test/unit/hashing_test.js @@ -1,29 +1,28 @@ - -describe('StellarBase#hash', function() { - +describe("StellarBase#hash", function() { it("hashes a string properly, using SHA256", function() { - let msg = "hello world"; - let expectedHex = "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - let actualHex = StellarBase.hash(msg).toString('hex'); + let msg = "hello world"; + let expectedHex = + "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; + let actualHex = StellarBase.hash(msg).toString("hex"); expect(actualHex).to.eql(expectedHex); }); - it("hashes a buffer properly, using SHA256", function() { - let msg = Buffer.from("hello world", 'utf8'); - let expectedHex = "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - let actualHex = StellarBase.hash(msg).toString('hex'); + let msg = Buffer.from("hello world", "utf8"); + let expectedHex = + "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; + let actualHex = StellarBase.hash(msg).toString("hex"); expect(actualHex).to.eql(expectedHex); }); it("hashes an array of bytes properly, using SHA256", function() { - let msg = [ 104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100 ]; - let expectedHex = "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - let actualHex = StellarBase.hash(msg).toString('hex'); + let msg = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; + let expectedHex = + "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; + let actualHex = StellarBase.hash(msg).toString("hex"); expect(actualHex).to.eql(expectedHex); }); - }); diff --git a/test/unit/memo_test.js b/test/unit/memo_test.js index 0f12b90e8..42c6bfe27 100644 --- a/test/unit/memo_test.js +++ b/test/unit/memo_test.js @@ -1,4 +1,3 @@ - describe("Memo.constructor()", function() { it("throws error when type is invalid", function() { expect(() => new StellarBase.Memo("test")).to.throw(/Invalid memo type/); @@ -17,10 +16,9 @@ describe("Memo.none()", function() { }); describe("Memo.text()", function() { - it("returns a value for a correct argument", function() { expect(() => StellarBase.Memo.text("test")).to.not.throw(); - let memoUtf8 = StellarBase.Memo.text("三代之時") + let memoUtf8 = StellarBase.Memo.text("三代之時"); let a = Buffer.from(memoUtf8.toXDRObject().value(), "utf8"); let b = Buffer.from("三代之時", "utf8"); @@ -28,35 +26,48 @@ describe("Memo.text()", function() { }); it("returns a value for a correct argument (utf8)", function() { - let memoText = StellarBase.Memo.text([0xd1]).toXDRObject().toXDR(); + let memoText = StellarBase.Memo.text([0xd1]) + .toXDRObject() + .toXDR(); let expected = Buffer.from([ // memo_text - 0x00, 0x00, 0x00, 0x01, + 0x00, + 0x00, + 0x00, + 0x01, // length - 0x00, 0x00, 0x00, 0x01, + 0x00, + 0x00, + 0x00, + 0x01, // value - 0xd1, 0x00, 0x00, 0x00 + 0xd1, + 0x00, + 0x00, + 0x00 ]); expect(memoText.equals(expected)).to.be.true; - memoText = StellarBase.Memo.text(Buffer.from([0xd1])).toXDRObject().toXDR(); + memoText = StellarBase.Memo.text(Buffer.from([0xd1])) + .toXDRObject() + .toXDR(); expect(memoText.equals(expected)).to.be.true; }); it("converts to/from xdr object", function() { let memo = StellarBase.Memo.text("test").toXDRObject(); - expect(memo.arm()).to.equal('text'); - expect(memo.text()).to.equal('test'); - expect(memo.value()).to.equal('test'); + expect(memo.arm()).to.equal("text"); + expect(memo.text()).to.equal("test"); + expect(memo.value()).to.equal("test"); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoText); - expect(baseMemo.value).to.be.equal('test'); + expect(baseMemo.value).to.be.equal("test"); }); it("converts to/from xdr object (array)", function() { let memo = StellarBase.Memo.text([0xd1]).toXDRObject(); - expect(memo.arm()).to.equal('text'); + expect(memo.arm()).to.equal("text"); expect(memo.text()).to.be.deep.equal([0xd1]); expect(memo.value()).to.be.deep.equal([0xd1]); @@ -69,7 +80,7 @@ describe("Memo.text()", function() { it("converts to/from xdr object (buffer)", function() { let buf = Buffer.from([0xd1]); let memo = StellarBase.Memo.text(buf).toXDRObject(); - expect(memo.arm()).to.equal('text'); + expect(memo.arm()).to.equal("text"); expect(memo.text().equals(buf)).to.be.true; expect(memo.value().equals(buf)).to.be.true; @@ -80,18 +91,31 @@ describe("Memo.text()", function() { }); it("throws an error when invalid argument was passed", function() { - expect(() => StellarBase.Memo.text()).to.throw(/Expects string, array or buffer, max 28 bytes/); - expect(() => StellarBase.Memo.text({})).to.throw(/Expects string, array or buffer, max 28 bytes/); - expect(() => StellarBase.Memo.text(10)).to.throw(/Expects string, array or buffer, max 28 bytes/); - expect(() => StellarBase.Memo.text(Infinity)).to.throw(/Expects string, array or buffer, max 28 bytes/); - expect(() => StellarBase.Memo.text(NaN)).to.throw(/Expects string, array or buffer, max 28 bytes/); + expect(() => StellarBase.Memo.text()).to.throw( + /Expects string, array or buffer, max 28 bytes/ + ); + expect(() => StellarBase.Memo.text({})).to.throw( + /Expects string, array or buffer, max 28 bytes/ + ); + expect(() => StellarBase.Memo.text(10)).to.throw( + /Expects string, array or buffer, max 28 bytes/ + ); + expect(() => StellarBase.Memo.text(Infinity)).to.throw( + /Expects string, array or buffer, max 28 bytes/ + ); + expect(() => StellarBase.Memo.text(NaN)).to.throw( + /Expects string, array or buffer, max 28 bytes/ + ); }); it("throws an error when string is longer than 28 bytes", function() { - expect(() => StellarBase.Memo.text("12345678901234567890123456789")).to.throw(/Expects string, array or buffer, max 28 bytes/); - expect(() => StellarBase.Memo.text("三代之時三代之時三代之時")).to.throw(/Expects string, array or buffer, max 28 bytes/); + expect(() => + StellarBase.Memo.text("12345678901234567890123456789") + ).to.throw(/Expects string, array or buffer, max 28 bytes/); + expect(() => StellarBase.Memo.text("三代之時三代之時三代之時")).to.throw( + /Expects string, array or buffer, max 28 bytes/ + ); }); - }); describe("Memo.id()", function() { @@ -102,12 +126,12 @@ describe("Memo.id()", function() { it("converts to/from xdr object", function() { let memo = StellarBase.Memo.id("1000").toXDRObject(); - expect(memo.arm()).to.equal('id'); - expect(memo.id().toString()).to.equal('1000'); + expect(memo.arm()).to.equal("id"); + expect(memo.id().toString()).to.equal("1000"); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoID); - expect(baseMemo.value).to.be.equal('1000'); + expect(baseMemo.value).to.be.equal("1000"); }); it("throws an error when invalid argument was passed", function() { @@ -124,14 +148,14 @@ describe("Memo.hash() & Memo.return()", function() { let buffer = Buffer.alloc(32, 10); let memo = StellarBase.Memo.hash(buffer).toXDRObject(); - expect(memo.arm()).to.equal('hash'); + expect(memo.arm()).to.equal("hash"); expect(memo.hash().length).to.equal(32); expect(memo.hash()).to.deep.equal(buffer); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoHash); expect(baseMemo.value.length).to.equal(32); - expect(baseMemo.value.toString('hex')).to.be.equal(buffer.toString('hex')); + expect(baseMemo.value.toString("hex")).to.be.equal(buffer.toString("hex")); }); it("return converts to/from xdr object", function() { @@ -139,15 +163,15 @@ describe("Memo.hash() & Memo.return()", function() { // Testing string hash let memo = StellarBase.Memo.return(buffer.toString("hex")).toXDRObject(); - expect(memo.arm()).to.equal('retHash'); + expect(memo.arm()).to.equal("retHash"); expect(memo.retHash().length).to.equal(32); - expect(memo.retHash().toString('hex')).to.equal(buffer.toString('hex')); + expect(memo.retHash().toString("hex")).to.equal(buffer.toString("hex")); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoReturn); expect(Buffer.isBuffer(baseMemo.value)).to.be.true; expect(baseMemo.value.length).to.equal(32); - expect(baseMemo.value.toString('hex')).to.be.equal(buffer.toString('hex')); + expect(baseMemo.value.toString("hex")).to.be.equal(buffer.toString("hex")); }); var methods = [StellarBase.Memo.hash, StellarBase.Memo.return]; @@ -156,7 +180,11 @@ describe("Memo.hash() & Memo.return()", function() { for (let i in methods) { let method = methods[i]; expect(() => method(Buffer.alloc(32))).to.not.throw(); - expect(() => method('0000000000000000000000000000000000000000000000000000000000000000')).to.not.throw(); + expect(() => + method( + "0000000000000000000000000000000000000000000000000000000000000000" + ) + ).to.not.throw(); } }); @@ -168,10 +196,20 @@ describe("Memo.hash() & Memo.return()", function() { expect(() => method(Infinity)).to.throw(/Expects a 32 byte hash value/); expect(() => method(NaN)).to.throw(/Expects a 32 byte hash value/); expect(() => method("test")).to.throw(/Expects a 32 byte hash value/); - expect(() => method([0, 10, 20])).to.throw(/Expects a 32 byte hash value/); - expect(() => method(Buffer.alloc(33))).to.throw(/Expects a 32 byte hash value/); - expect(() => method('00000000000000000000000000000000000000000000000000000000000000')).to.throw(/Expects a 32 byte hash value/); - expect(() => method('000000000000000000000000000000000000000000000000000000000000000000')).to.throw(/Expects a 32 byte hash value/); + expect(() => method([0, 10, 20])).to.throw( + /Expects a 32 byte hash value/ + ); + expect(() => method(Buffer.alloc(33))).to.throw( + /Expects a 32 byte hash value/ + ); + expect(() => + method("00000000000000000000000000000000000000000000000000000000000000") + ).to.throw(/Expects a 32 byte hash value/); + expect(() => + method( + "000000000000000000000000000000000000000000000000000000000000000000" + ) + ).to.throw(/Expects a 32 byte hash value/); } }); }); diff --git a/test/unit/signing_test.js b/test/unit/signing_test.js index 1fbd06102..045d75287 100644 --- a/test/unit/signing_test.js +++ b/test/unit/signing_test.js @@ -1,53 +1,68 @@ - // NOTE: key and signature constants were generated using rbnacl -let seed = Buffer.from("1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4", 'hex'); -let publicKey = Buffer.from("ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437", 'hex'); -let secretKey = Buffer.from("1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437", 'hex'); - -describe('StellarBase#sign', function() { - let expectedSig = "587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309"; +let seed = Buffer.from( + "1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4", + "hex" +); +let publicKey = Buffer.from( + "ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437", + "hex" +); +let secretKey = Buffer.from( + "1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437", + "hex" +); + +describe("StellarBase#sign", function() { + let expectedSig = + "587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309"; it("can sign an string properly", function() { - let data = "hello world"; - let actualSig = StellarBase.sign(data, secretKey).toString('hex'); + let data = "hello world"; + let actualSig = StellarBase.sign(data, secretKey).toString("hex"); expect(actualSig).to.eql(expectedSig); }); it("can sign an buffer properly", function() { - let data = Buffer.from("hello world", 'utf8'); - let actualSig = StellarBase.sign(data, secretKey).toString('hex'); + let data = Buffer.from("hello world", "utf8"); + let actualSig = StellarBase.sign(data, secretKey).toString("hex"); expect(actualSig).to.eql(expectedSig); }); it("can sign an array of bytes properly", function() { - let data = [ 104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100 ]; - let actualSig = StellarBase.sign(data, secretKey).toString('hex'); + let data = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; + let actualSig = StellarBase.sign(data, secretKey).toString("hex"); expect(actualSig).to.eql(expectedSig); }); }); -describe('StellarBase#verify', function() { - let sig = Buffer.from("587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309", 'hex'); - let badSig = Buffer.from("687d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309", 'hex'); +describe("StellarBase#verify", function() { + let sig = Buffer.from( + "587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309", + "hex" + ); + let badSig = Buffer.from( + "687d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309", + "hex" + ); it("can verify an string properly", function() { let data = "hello world"; - expect(StellarBase.verify(data, sig, publicKey)).to.be.truthy; - expect(StellarBase.verify("corrupted", sig, publicKey)).to.be.falsey; - expect(StellarBase.verify(data, badSig, publicKey)).to.be.falsey; + expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; + expect(StellarBase.verify("corrupted", sig, publicKey)).to.not.be.ok; + expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); it("can verify an buffer properly", function() { - let data = Buffer.from("hello world", 'utf8'); - expect(StellarBase.verify(data, sig, publicKey)).to.be.truthy; - expect(StellarBase.verify("corrupted", sig, publicKey)).to.be.falsey; - expect(StellarBase.verify(data, badSig, publicKey)).to.be.falsey; + let data = Buffer.from("hello world", "utf8"); + expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; + expect(StellarBase.verify("corrupted", sig, publicKey)).to.not.be.ok; + expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); it("can verify an array of bytes properly", function() { - let data = [ 104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100 ]; - expect(StellarBase.verify(data, sig, publicKey)).to.be.truthy; - expect(StellarBase.verify("corrupted", sig, publicKey)).to.be.falsey; - expect(StellarBase.verify(data, badSig, publicKey)).to.be.falsey; + let data = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; + expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; + expect(StellarBase.verify("corrupted", sig, publicKey)).to.not.be.ok; + expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); }); diff --git a/test/unit/strkey_test.js b/test/unit/strkey_test.js index 03f6d0454..ee90aeec8 100644 --- a/test/unit/strkey_test.js +++ b/test/unit/strkey_test.js @@ -1,9 +1,7 @@ -const { ENGINE_METHOD_PKEY_METHS } = require('constants'); - -describe('StrKey', function() { +describe("StrKey", function() { beforeEach(function() { var keypair = StellarBase.Keypair.master( - 'Test SDF Network ; September 2015' + "Test SDF Network ; September 2015" ); this.unencodedBuffer = keypair.rawPublicKey(); this.unencoded = this.unencodedBuffer.toString(); @@ -12,8 +10,8 @@ describe('StrKey', function() { this.unencodedBuffer ); }); - describe('#decodeCheck', function() { - it('decodes correctly', function() { + describe("#decodeCheck", function() { + it("decodes correctly", function() { expect( StellarBase.StrKey.decodeEd25519PublicKey(this.accountIdEncoded) ).to.eql(this.unencodedBuffer); @@ -22,90 +20,90 @@ describe('StrKey', function() { ).to.eql(this.unencodedBuffer); }); - it('throws an error when the version byte is wrong', function() { + it("throws an error when the version byte is wrong", function() { expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - 'GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL' + "GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL" ) ).to.throw(/invalid version/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - 'SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU' + "SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU" ) ).to.throw(/invalid version/); }); - it('throws an error when decoded data encodes to other string', function() { + it("throws an error when decoded data encodes to other string", function() { // accountId expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - 'GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL' + "GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - 'GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++' + "GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - 'GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA' + "GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2' + "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T' + "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T" ) ).to.throw(/invalid encoded string/); // seed expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - 'SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYW' + "SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYW" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - 'SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2' + "SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - 'SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2T' + "SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2T" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - 'SCMB30FQCIQAWZ4WQTS6SVK37LGMAFJGXOZIHTH2PY6EXLP37G46H6DT' + "SCMB30FQCIQAWZ4WQTS6SVK37LGMAFJGXOZIHTH2PY6EXLP37G46H6DT" ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - 'SAYC2LQ322EEHZYWNSKBEW6N66IRTDREEBUXXU5HPVZGMAXKLIZNM45H++' + "SAYC2LQ322EEHZYWNSKBEW6N66IRTDREEBUXXU5HPVZGMAXKLIZNM45H++" ) ).to.throw(/invalid encoded string/); }); - it('throws an error when the checksum is wrong', function() { + it("throws an error when the checksum is wrong", function() { expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - 'GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVT' + "GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVT" ) ).to.throw(/invalid checksum/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - 'SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCX' + "SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCX" ) ).to.throw(/invalid checksum/); }); }); - describe('#encodeCheck', function() { - it('encodes a buffer correctly', function() { + describe("#encodeCheck", function() { + it("encodes a buffer correctly", function() { expect( StellarBase.StrKey.encodeEd25519PublicKey(this.unencodedBuffer) ).to.eql(this.accountIdEncoded); @@ -134,7 +132,7 @@ describe('StrKey', function() { ); }); - it('encodes a buffer correctly', function() { + it("encodes a buffer correctly", function() { expect( StellarBase.StrKey.encodeEd25519PublicKey(this.unencodedBuffer) ).to.eql(this.accountIdEncoded); @@ -143,7 +141,7 @@ describe('StrKey', function() { ).to.eql(this.seedEncoded); }); - it('throws an error when the data is null', function() { + it("throws an error when the data is null", function() { expect(() => StellarBase.StrKey.encodeEd25519SecretSeed(null)).to.throw( /null data/ ); @@ -153,19 +151,19 @@ describe('StrKey', function() { }); }); - describe('#isValidEd25519PublicKey', function() { - it('returns true for valid public key', function() { + describe("#isValidEd25519PublicKey", function() { + it("returns true for valid public key", function() { var keys = [ - 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', - 'GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT', - 'GD6WVYRVID442Y4JVWFWKWCZKB45UGHJAABBJRS22TUSTWGJYXIUR7N2', - 'GBCG42WTVWPO4Q6OZCYI3D6ZSTFSJIXIS6INCIUF23L6VN3ADE4337AP', - 'GDFX463YPLCO2EY7NGFMI7SXWWDQAMASGYZXCG2LATOF3PP5NQIUKBPT', - 'GBXEODUMM3SJ3QSX2VYUWFU3NRP7BQRC2ERWS7E2LZXDJXL2N66ZQ5PT', - 'GAJHORKJKDDEPYCD6URDFODV7CVLJ5AAOJKR6PG2VQOLWFQOF3X7XLOG', - 'GACXQEAXYBEZLBMQ2XETOBRO4P66FZAJENDHOQRYPUIXZIIXLKMZEXBJ', - 'GDD3XRXU3G4DXHVRUDH7LJM4CD4PDZTVP4QHOO4Q6DELKXUATR657OZV', - 'GDTYVCTAUQVPKEDZIBWEJGKBQHB4UGGXI2SXXUEW7LXMD4B7MK37CWLJ' + "GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB", + "GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT", + "GD6WVYRVID442Y4JVWFWKWCZKB45UGHJAABBJRS22TUSTWGJYXIUR7N2", + "GBCG42WTVWPO4Q6OZCYI3D6ZSTFSJIXIS6INCIUF23L6VN3ADE4337AP", + "GDFX463YPLCO2EY7NGFMI7SXWWDQAMASGYZXCG2LATOF3PP5NQIUKBPT", + "GBXEODUMM3SJ3QSX2VYUWFU3NRP7BQRC2ERWS7E2LZXDJXL2N66ZQ5PT", + "GAJHORKJKDDEPYCD6URDFODV7CVLJ5AAOJKR6PG2VQOLWFQOF3X7XLOG", + "GACXQEAXYBEZLBMQ2XETOBRO4P66FZAJENDHOQRYPUIXZIIXLKMZEXBJ", + "GDD3XRXU3G4DXHVRUDH7LJM4CD4PDZTVP4QHOO4Q6DELKXUATR657OZV", + "GDTYVCTAUQVPKEDZIBWEJGKBQHB4UGGXI2SXXUEW7LXMD4B7MK37CWLJ" ]; for (var i in keys) { @@ -173,19 +171,19 @@ describe('StrKey', function() { } }); - it('returns false for invalid public key', function() { + it("returns false for invalid public key", function() { var keys = [ - 'GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', - 'GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++', - 'GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA', - 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2', - 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T', - 'GDXIIZTKTLVYCBHURXL2UPMTYXOVNI7BRAEFQCP6EZCY4JLKY4VKFNLT', - 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', - 'gWRYUerEKuz53tstxEuR3NCkiQDcV4wzFHmvLnZmj7PUqxW2wt', - 'test', + "GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL", + "GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++", + "GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA", + "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2", + "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T", + "GDXIIZTKTLVYCBHURXL2UPMTYXOVNI7BRAEFQCP6EZCY4JLKY4VKFNLT", + "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY", + "gWRYUerEKuz53tstxEuR3NCkiQDcV4wzFHmvLnZmj7PUqxW2wt", + "test", null, - 'g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk' // Old network key + "g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk" // Old network key ]; for (var i in keys) { @@ -194,15 +192,15 @@ describe('StrKey', function() { }); }); - describe('#isValidSecretKey', function() { - it('returns true for valid secret key', function() { + describe("#isValidSecretKey", function() { + it("returns true for valid secret key", function() { var keys = [ - 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', - 'SCZTUEKSEH2VYZQC6VLOTOM4ZDLMAGV4LUMH4AASZ4ORF27V2X64F2S2', - 'SCGNLQKTZ4XCDUGVIADRVOD4DEVNYZ5A7PGLIIZQGH7QEHK6DYODTFEH', - 'SDH6R7PMU4WIUEXSM66LFE4JCUHGYRTLTOXVUV5GUEPITQEO3INRLHER', - 'SC2RDTRNSHXJNCWEUVO7VGUSPNRAWFCQDPP6BGN4JFMWDSEZBRAPANYW', - 'SCEMFYOSFZ5MUXDKTLZ2GC5RTOJO6FGTAJCF3CCPZXSLXA2GX6QUYOA7' + "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY", + "SCZTUEKSEH2VYZQC6VLOTOM4ZDLMAGV4LUMH4AASZ4ORF27V2X64F2S2", + "SCGNLQKTZ4XCDUGVIADRVOD4DEVNYZ5A7PGLIIZQGH7QEHK6DYODTFEH", + "SDH6R7PMU4WIUEXSM66LFE4JCUHGYRTLTOXVUV5GUEPITQEO3INRLHER", + "SC2RDTRNSHXJNCWEUVO7VGUSPNRAWFCQDPP6BGN4JFMWDSEZBRAPANYW", + "SCEMFYOSFZ5MUXDKTLZ2GC5RTOJO6FGTAJCF3CCPZXSLXA2GX6QUYOA7" ]; for (var i in keys) { @@ -210,13 +208,13 @@ describe('StrKey', function() { } }); - it('returns false for invalid secret key', function() { + it("returns false for invalid secret key", function() { var keys = [ - 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', - 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDYT', // Too long - 'SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEV', // To short - 'SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEVIT', // Checksum - 'test', + "GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB", + "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDYT", // Too long + "SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEV", // To short + "SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEVIT", // Checksum + "test", null ]; @@ -227,16 +225,16 @@ describe('StrKey', function() { }); }); - const PUBKEY = 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ'; + const PUBKEY = "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ"; const MPUBKEY = - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK'; + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK"; const RAW_MPUBKEY = Buffer.from( - '3f0c34bf93ad0d9971d04ccc90f705511c838aad9734a4a2fb0d7a03fc7fe89a8000000000000000', - 'hex' + "3f0c34bf93ad0d9971d04ccc90f705511c838aad9734a4a2fb0d7a03fc7fe89a8000000000000000", + "hex" ); - describe('#muxedAccounts', function() { - it('encodes & decodes M... addresses correctly', function() { + describe("#muxedAccounts", function() { + it("encodes & decodes M... addresses correctly", function() { expect(StellarBase.StrKey.encodeMed25519PublicKey(RAW_MPUBKEY)).to.equal( MPUBKEY ); @@ -245,7 +243,7 @@ describe('StrKey', function() { ).to.be.true; }); - it('lets G... accounts pass through (unmuxed)', function() { + it("lets G... accounts pass through (unmuxed)", function() { const unmuxed = StellarBase.decodeAddressToMuxedAccount(PUBKEY); expect(StellarBase.xdr.MuxedAccount.isValid(unmuxed)).to.be.true; @@ -260,7 +258,7 @@ describe('StrKey', function() { expect(StellarBase.encodeMuxedAccountToAddress(unmuxed)).to.equal(PUBKEY); }); - it('decodes underlying G... address correctly', function() { + it("decodes underlying G... address correctly", function() { expect(StellarBase.extractBaseAddress(MPUBKEY)).to.equal(PUBKEY); expect(StellarBase.extractBaseAddress(PUBKEY)).to.equal(PUBKEY); }); @@ -268,7 +266,7 @@ describe('StrKey', function() { const RAW_PUBKEY = StellarBase.StrKey.decodeEd25519PublicKey(PUBKEY); const unmuxed = StellarBase.xdr.MuxedAccount.keyTypeEd25519(RAW_PUBKEY); - it('encodes & decodes unmuxed keys', function() { + it("encodes & decodes unmuxed keys", function() { expect(StellarBase.xdr.MuxedAccount.isValid(unmuxed)).to.be.true; expect(unmuxed.switch()).to.equal( StellarBase.xdr.CryptoKeyType.keyTypeEd25519() @@ -282,27 +280,27 @@ describe('StrKey', function() { const CASES = [ { strkey: - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK', - id: '9223372036854775808' // 0x8000... + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK", + id: "9223372036854775808" // 0x8000... }, { strkey: - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAFB4CJJBRKA', - id: '1357924680' + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAFB4CJJBRKA", + id: "1357924680" }, { strkey: - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAE2JUG6', - id: '1234' + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAE2JUG6", + id: "1234" }, { strkey: - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ', - id: '0' + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ", + id: "0" } ]; - CASES.forEach((testCase) => { + CASES.forEach(testCase => { it(`encodes & decodes muxed key w/ ID=${testCase.id}`, function() { const muxed = StellarBase.decodeAddressToMuxedAccount(testCase.strkey); expect(StellarBase.xdr.MuxedAccount.isValid(muxed)).to.be.true; @@ -321,97 +319,97 @@ describe('StrKey', function() { }); }); - describe('#signedPayloads', function() { + describe("#signedPayloads", function() { const HAPPY_PATHS = [ { - desc: 'valid w/ 32-byte payload', + desc: "valid w/ 32-byte payload", strkey: - 'PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAQACAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUPB6IBZGM', - ed25519: 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ', + "PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAQACAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUPB6IBZGM", + ed25519: "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ", payload: - '0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20' + "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20" }, { - desc: 'valid w/ 29-byte payload', + desc: "valid w/ 29-byte payload", strkey: - 'PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAOQCAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUAAAAFGBU', - ed25519: 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ', - payload: '0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d' + "PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAOQCAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUAAAAFGBU", + ed25519: "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ", + payload: "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d" } ]; - HAPPY_PATHS.forEach((testCase) => { + HAPPY_PATHS.forEach(testCase => { it(testCase.desc, function() { const spBuf = StellarBase.StrKey.decodeSignedPayload(testCase.strkey); const sp = StellarBase.xdr.SignerKeyEd25519SignedPayload.fromXDR( spBuf, - 'raw' + "raw" ); const signer = StellarBase.StrKey.encodeEd25519PublicKey(sp.ed25519()); expect(signer).to.equal(testCase.ed25519); - const payload = sp.payload().toString('hex'); + const payload = sp.payload().toString("hex"); expect(payload).to.equal(testCase.payload); - const str = StellarBase.StrKey.encodeSignedPayload(sp.toXDR('raw')); + const str = StellarBase.StrKey.encodeSignedPayload(sp.toXDR("raw")); expect(str).to.equal(testCase.strkey); }); }); - describe('payload bounds', function() { + describe("payload bounds", function() { let sp = new StellarBase.xdr.SignerKeyEd25519SignedPayload({ ed25519: StellarBase.StrKey.decodeEd25519PublicKey( - 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ' + "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ" ), payload: Buffer.alloc(0) }); - const isValid = (sp) => { + const isValid = sp => { return StellarBase.StrKey.isValidSignedPayload( - StellarBase.StrKey.encodeSignedPayload(sp.toXDR('raw')) + StellarBase.StrKey.encodeSignedPayload(sp.toXDR("raw")) ); }; - it('invalid with no payload', function() { + it("invalid with no payload", function() { sp.payload(Buffer.alloc(0)); expect(isValid(sp)).to.be.false; }); - it('valid with 1-byte payload', function() { + it("valid with 1-byte payload", function() { sp.payload(Buffer.alloc(1)); expect(isValid(sp)).to.be.true; }); - it('throws with 65-byte payload', function() { + it("throws with 65-byte payload", function() { sp.payload(Buffer.alloc(65)); expect(() => isValid(sp)).to.throw(/XDR Write Error/); }); - it('valid with 64-byte payload (max)', function() { + it("valid with 64-byte payload (max)", function() { sp.payload(Buffer.alloc(64)); expect(isValid(sp)).to.be.true; }); }); }); - describe('#invalidStrKeys', function() { + describe("#invalidStrKeys", function() { // From https://stellar.org/protocol/sep-23#invalid-test-cases const BAD_STRKEYS = [ // The unused trailing bit must be zero in the encoding of the last three // bytes (24 bits) as five base-32 symbols (25 bits) - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUR', + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUR", // Invalid length (congruent to 1 mod 8) - 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZA', + "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZA", // Invalid algorithm (low 3 bits of version byte are 7) - 'G47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVP2I', + "G47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVP2I", // Invalid length (congruent to 6 mod 8) - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLKA', + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLKA", // Invalid algorithm (low 3 bits of version byte are 7) - 'M47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ', + "M47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ", // Padding bytes are not allowed - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUK===', + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUK===", // Invalid checksum - 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUO' + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUO" // // FIXME: The following test cases don't pass (i.e. don't throw). @@ -439,7 +437,7 @@ describe('StrKey', function() { // 'PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAOQCAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DXFH6' ]; - BAD_STRKEYS.forEach((address) => { + BAD_STRKEYS.forEach(address => { it(`fails in expected case ${address}`, function() { const vb = StellarBase.StrKey.getVersionByteForPrefix(address); expect(() => StellarBase.StrKey.decodeCheck(vb, address)).to.throw(); diff --git a/types/tslint.json b/types/tslint.json index b730d81d4..f57aca3ff 100644 --- a/types/tslint.json +++ b/types/tslint.json @@ -1,5 +1,5 @@ { - "extends": "dtslint/dtslint.json", + "extends": "@definitelytyped/dtslint/dtslint.json", "rules": { "indent": [true, "spaces"], "trailing-comma": [true, "always"], diff --git a/webpack.config.browser.js b/webpack.config.browser.js deleted file mode 100644 index 1a9912b44..000000000 --- a/webpack.config.browser.js +++ /dev/null @@ -1,20 +0,0 @@ -const webpack = require('webpack'); - -module.exports = { - output: { library: 'StellarBase' }, - mode: 'development', - module: { - rules: [ - { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, - { - test: /\.js$/, - exclude: /node_modules\/(?!(crc)\/).*/, - loader: 'babel-loader' - } - ] - }, - plugins: [ - // Ignore native modules (sodium-native) - new webpack.IgnorePlugin(/sodium-native/) - ] -}; diff --git a/yarn.lock b/yarn.lock index 52fa4f04b..8ed046fb9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,196 +2,1326 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3": +"@ampproject/remapping@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" + integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== + dependencies: + "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@babel/cli@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.21.0.tgz#1868eb70e9824b427fc607610cce8e9e7889e7e1" + integrity sha512-xi7CxyS8XjSyiwUGCfwf+brtJxjW1/ZTcBUkP10xawIEXLX5HzLn+3aXkgxozcP2UhRhtKTmQurw9Uaes7jZrA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.17" + commander "^4.0.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.1.0" + glob "^7.2.0" + make-dir "^2.1.0" + slash "^2.0.0" + optionalDependencies: + "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" + chokidar "^3.4.0" + +"@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" + integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.4.tgz#457ffe647c480dff59c2be092fc3acf71195c87f" + integrity sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g== + +"@babel/core@^7.12.0", "@babel/core@^7.12.3", "@babel/core@^7.7.5": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz#c6dc73242507b8e2a27fd13a9c1814f9fa34a659" + integrity sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.4" + "@babel/helper-compilation-targets" "^7.21.4" + "@babel/helper-module-transforms" "^7.21.2" + "@babel/helpers" "^7.21.0" + "@babel/parser" "^7.21.4" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.21.4" + "@babel/types" "^7.21.4" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.2" + semver "^6.3.0" + +"@babel/eslint-parser@^7.21.3": + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.21.3.tgz#d79e822050f2de65d7f368a076846e7184234af7" + integrity sha512-kfhmPimwo6k4P8zxNs8+T7yR44q1LdpsZdE1NkCsVlfiuTPRfnGgjaF8Qgug9q9Pou17u6wneYF0lDCZJATMFg== + dependencies: + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + +"@babel/generator@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" + integrity sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA== + dependencies: + "@babel/types" "^7.21.4" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" + integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" + integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== + dependencies: + "@babel/helper-explode-assignable-expression" "^7.18.6" + "@babel/types" "^7.18.9" + +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.4.tgz#770cd1ce0889097ceacb99418ee6934ef0572656" + integrity sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg== + dependencies: + "@babel/compat-data" "^7.21.4" + "@babel/helper-validator-option" "^7.21.0" + browserslist "^4.21.3" + lru-cache "^5.1.1" + semver "^6.3.0" + +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.4.tgz#3a017163dc3c2ba7deb9a7950849a9586ea24c18" + integrity sha512-46QrX2CQlaFRF4TkwfTt6nJD7IHq8539cCL7SDpqWSDeJKY1xylKKY5F/33mJhLZ3mFvKv2gGrVS6NkyF6qs+Q== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.21.0" + "@babel/helper-member-expression-to-functions" "^7.21.0" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-replace-supers" "^7.20.7" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/helper-split-export-declaration" "^7.18.6" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.21.4.tgz#40411a8ab134258ad2cf3a3d987ec6aa0723cee5" + integrity sha512-M00OuhU+0GyZ5iBBN9czjugzWrEq2vDpf/zCYHxxf93ul/Q5rv+a5h+/+0WnI1AebHNVtl5bFV0qsJoH23DbfA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + regexpu-core "^5.3.1" + +"@babel/helper-define-polyfill-provider@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" + integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== + dependencies: + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + semver "^6.1.2" + +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== + +"@babel/helper-explode-assignable-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" + integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0", "@babel/helper-function-name@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" + integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== + dependencies: + "@babel/template" "^7.20.7" + "@babel/types" "^7.21.0" + +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-member-expression-to-functions@^7.20.7", "@babel/helper-member-expression-to-functions@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz#319c6a940431a133897148515877d2f3269c3ba5" + integrity sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q== + dependencies: + "@babel/types" "^7.21.0" + +"@babel/helper-module-imports@^7.18.6": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz#ac88b2f76093637489e718a90cec6cf8a9b029af" + integrity sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg== + dependencies: + "@babel/types" "^7.21.4" + +"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.20.11", "@babel/helper-module-transforms@^7.21.2": + version "7.21.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz#160caafa4978ac8c00ac66636cb0fa37b024e2d2" + integrity sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.21.2" + "@babel/types" "^7.21.2" + +"@babel/helper-optimise-call-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" + integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== + dependencies: + "@babel/types" "^7.18.6" + +"@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.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + +"@babel/helper-remap-async-to-generator@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" + integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-wrap-function" "^7.18.9" + "@babel/types" "^7.18.9" + +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331" + integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-member-expression-to-functions" "^7.20.7" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== + dependencies: + "@babel/types" "^7.20.2" + +"@babel/helper-skip-transparent-expression-wrappers@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684" + integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== + dependencies: + "@babel/types" "^7.20.0" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/helper-validator-option@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" + integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== + +"@babel/helper-wrap-function@^7.18.9": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" + integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== + dependencies: + "@babel/helper-function-name" "^7.19.0" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.5" + "@babel/types" "^7.20.5" + +"@babel/helpers@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e" + integrity sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA== + dependencies: + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.21.0" + "@babel/types" "^7.21.0" + +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.4", "@babel/parser@^7.9.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17" + integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw== + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": + version "7.18.6" + 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.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" + integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz#d9c85589258539a22a901033853101a6198d4ef1" + integrity sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/plugin-proposal-optional-chaining" "^7.20.7" + +"@babel/plugin-proposal-async-generator-functions@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" + integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-remap-async-to-generator" "^7.18.9" + "@babel/plugin-syntax-async-generators" "^7.8.4" + +"@babel/plugin-proposal-class-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" + integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-class-static-block@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz#77bdd66fb7b605f3a61302d224bdfacf5547977d" + integrity sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.21.0" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-proposal-dynamic-import@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" + integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + +"@babel/plugin-proposal-export-namespace-from@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" + integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + +"@babel/plugin-proposal-json-strings@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" + integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-json-strings" "^7.8.3" + +"@babel/plugin-proposal-logical-assignment-operators@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" + integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + +"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" + integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + +"@babel/plugin-proposal-numeric-separator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" + integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + +"@babel/plugin-proposal-object-rest-spread@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" + integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.20.7" + +"@babel/plugin-proposal-optional-catch-binding@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" + integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + +"@babel/plugin-proposal-optional-chaining@^7.20.7", "@babel/plugin-proposal-optional-chaining@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" + integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +"@babel/plugin-proposal-private-methods@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" + integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-private-property-in-object@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0.tgz#19496bd9883dd83c23c7d7fc45dcd9ad02dfa1dc" + integrity sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.21.0" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@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" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" - integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== dependencies: - "@babel/highlight" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/generator@^7.9.5": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.5.tgz#27f0917741acc41e6eaaced6d68f96c3fa9afaf9" - integrity sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ== +"@babel/plugin-syntax-export-namespace-from@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" + integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== dependencies: - "@babel/types" "^7.9.5" - jsesc "^2.5.1" - lodash "^4.17.13" - source-map "^0.5.0" + "@babel/helper-plugin-utils" "^7.8.3" + +"@babel/plugin-syntax-import-assertions@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" + integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-jsx@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz#f264ed7bf40ffc9ec239edabc17a50c4f5b6fea2" + integrity sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/helper-function-name@^7.9.5": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz#2b53820d35275120e1874a82e5aabe1376920a5c" - integrity sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw== +"@babel/plugin-syntax-numeric-separator@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== dependencies: - "@babel/helper-get-function-arity" "^7.8.3" - "@babel/template" "^7.8.3" - "@babel/types" "^7.9.5" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/helper-get-function-arity@^7.8.3": +"@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" - integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: - "@babel/types" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/helper-split-export-declaration@^7.8.3": +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" - integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: - "@babel/types" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/helper-validator-identifier@^7.9.0", "@babel/helper-validator-identifier@^7.9.5": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" - integrity sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g== +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/highlight@^7.8.3": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.9.0.tgz#4e9b45ccb82b79607271b2979ad82c7b68163079" - integrity sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ== +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== dependencies: - "@babel/helper-validator-identifier" "^7.9.0" - chalk "^2.0.0" - js-tokens "^4.0.0" + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-typescript@^7.20.0": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz#2751948e9b7c6d771a8efa59340c15d4a2891ff8" + integrity sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-arrow-functions@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" + integrity sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-async-to-generator@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz#dfee18623c8cb31deb796aa3ca84dda9cea94354" + integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q== + dependencies: + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-remap-async-to-generator" "^7.18.9" + +"@babel/plugin-transform-block-scoped-functions@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" + integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-block-scoping@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.21.0.tgz#e737b91037e5186ee16b76e7ae093358a5634f02" + integrity sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-classes@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.21.0.tgz#f469d0b07a4c5a7dbb21afad9e27e57b47031665" + integrity sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.21.0" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-replace-supers" "^7.20.7" + "@babel/helper-split-export-declaration" "^7.18.6" + globals "^11.1.0" -"@babel/parser@^7.7.0", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": - version "7.9.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" - integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== - -"@babel/parser@^7.9.4": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.0.tgz#f0ac33eddbe214e4105363bb17c3341c5ffcc43c" - integrity sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw== - -"@babel/template@^7.8.3": - version "7.8.6" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" - integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== - dependencies: - "@babel/code-frame" "^7.8.3" - "@babel/parser" "^7.8.6" - "@babel/types" "^7.8.6" - -"@babel/traverse@^7.7.0": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.5.tgz#6e7c56b44e2ac7011a948c21e283ddd9d9db97a2" - integrity sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ== - dependencies: - "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.9.5" - "@babel/helper-function-name" "^7.9.5" - "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.9.0" - "@babel/types" "^7.9.5" +"@babel/plugin-transform-computed-properties@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz#704cc2fd155d1c996551db8276d55b9d46e4d0aa" + integrity sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/template" "^7.20.7" + +"@babel/plugin-transform-destructuring@^7.21.3": + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.21.3.tgz#73b46d0fd11cd6ef57dea8a381b1215f4959d401" + integrity sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" + integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-duplicate-keys@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" + integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-exponentiation-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" + integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-for-of@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.0.tgz#964108c9988de1a60b4be2354a7d7e245f36e86e" + integrity sha512-LlUYlydgDkKpIY7mcBWvyPPmMcOphEyYA27Ef4xpbh1IiDNLr0kZsos2nf92vz3IccvJI25QUwp86Eo5s6HmBQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-function-name@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" + integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== + dependencies: + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" + integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-member-expression-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" + integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-modules-amd@^7.20.11": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz#3daccca8e4cc309f03c3a0c4b41dc4b26f55214a" + integrity sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g== + dependencies: + "@babel/helper-module-transforms" "^7.20.11" + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-modules-commonjs@^7.21.2": + version "7.21.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.2.tgz#6ff5070e71e3192ef2b7e39820a06fb78e3058e7" + integrity sha512-Cln+Yy04Gxua7iPdj6nOV96smLGjpElir5YwzF0LBPKoPlLDNJePNlrGGaybAJkd0zKRnOVXOgizSqPYMNYkzA== + dependencies: + "@babel/helper-module-transforms" "^7.21.2" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-simple-access" "^7.20.2" + +"@babel/plugin-transform-modules-systemjs@^7.20.11": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz#467ec6bba6b6a50634eea61c9c232654d8a4696e" + integrity sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw== + dependencies: + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-module-transforms" "^7.20.11" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-validator-identifier" "^7.19.1" + +"@babel/plugin-transform-modules-umd@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" + integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== + dependencies: + "@babel/helper-module-transforms" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" + integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.20.5" + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-new-target@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" + integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-object-super@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" + integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-replace-supers" "^7.18.6" + +"@babel/plugin-transform-parameters@^7.20.7", "@babel/plugin-transform-parameters@^7.21.3": + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.21.3.tgz#18fc4e797cf6d6d972cb8c411dbe8a809fa157db" + integrity sha512-Wxc+TvppQG9xWFYatvCGPvZ6+SIUxQ2ZdiBP+PHYMIjnPXD+uThCshaz4NZOnODAtBjjcVQQ/3OKs9LW28purQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-property-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" + integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-regenerator@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" + integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + regenerator-transform "^0.15.1" + +"@babel/plugin-transform-reserved-words@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" + integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-shorthand-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" + integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-spread@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz#c2d83e0b99d3bf83e07b11995ee24bf7ca09401e" + integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + +"@babel/plugin-transform-sticky-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" + integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-template-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" + integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-typeof-symbol@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" + integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-typescript@^7.21.3": + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.21.3.tgz#316c5be579856ea890a57ebc5116c5d064658f2b" + integrity sha512-RQxPz6Iqt8T0uw/WsJNReuBpWpBqs/n7mNo18sKLoTbMp+UrEekhH+pKSVC7gWz+DNjo9gryfV8YzCiT45RgMw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.21.0" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-typescript" "^7.20.0" + +"@babel/plugin-transform-unicode-escapes@^7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" + integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-unicode-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" + integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/preset-env@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.21.4.tgz#a952482e634a8dd8271a3fe5459a16eb10739c58" + integrity sha512-2W57zHs2yDLm6GD5ZpvNn71lZ0B/iypSdIeq25OurDKji6AdzV07qp4s3n1/x5BqtiGaTrPN3nerlSCaC5qNTw== + dependencies: + "@babel/compat-data" "^7.21.4" + "@babel/helper-compilation-targets" "^7.21.4" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-validator-option" "^7.21.0" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.20.7" + "@babel/plugin-proposal-async-generator-functions" "^7.20.7" + "@babel/plugin-proposal-class-properties" "^7.18.6" + "@babel/plugin-proposal-class-static-block" "^7.21.0" + "@babel/plugin-proposal-dynamic-import" "^7.18.6" + "@babel/plugin-proposal-export-namespace-from" "^7.18.9" + "@babel/plugin-proposal-json-strings" "^7.18.6" + "@babel/plugin-proposal-logical-assignment-operators" "^7.20.7" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" + "@babel/plugin-proposal-numeric-separator" "^7.18.6" + "@babel/plugin-proposal-object-rest-spread" "^7.20.7" + "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" + "@babel/plugin-proposal-optional-chaining" "^7.21.0" + "@babel/plugin-proposal-private-methods" "^7.18.6" + "@babel/plugin-proposal-private-property-in-object" "^7.21.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/plugin-syntax-import-assertions" "^7.20.0" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-transform-arrow-functions" "^7.20.7" + "@babel/plugin-transform-async-to-generator" "^7.20.7" + "@babel/plugin-transform-block-scoped-functions" "^7.18.6" + "@babel/plugin-transform-block-scoping" "^7.21.0" + "@babel/plugin-transform-classes" "^7.21.0" + "@babel/plugin-transform-computed-properties" "^7.20.7" + "@babel/plugin-transform-destructuring" "^7.21.3" + "@babel/plugin-transform-dotall-regex" "^7.18.6" + "@babel/plugin-transform-duplicate-keys" "^7.18.9" + "@babel/plugin-transform-exponentiation-operator" "^7.18.6" + "@babel/plugin-transform-for-of" "^7.21.0" + "@babel/plugin-transform-function-name" "^7.18.9" + "@babel/plugin-transform-literals" "^7.18.9" + "@babel/plugin-transform-member-expression-literals" "^7.18.6" + "@babel/plugin-transform-modules-amd" "^7.20.11" + "@babel/plugin-transform-modules-commonjs" "^7.21.2" + "@babel/plugin-transform-modules-systemjs" "^7.20.11" + "@babel/plugin-transform-modules-umd" "^7.18.6" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.20.5" + "@babel/plugin-transform-new-target" "^7.18.6" + "@babel/plugin-transform-object-super" "^7.18.6" + "@babel/plugin-transform-parameters" "^7.21.3" + "@babel/plugin-transform-property-literals" "^7.18.6" + "@babel/plugin-transform-regenerator" "^7.20.5" + "@babel/plugin-transform-reserved-words" "^7.18.6" + "@babel/plugin-transform-shorthand-properties" "^7.18.6" + "@babel/plugin-transform-spread" "^7.20.7" + "@babel/plugin-transform-sticky-regex" "^7.18.6" + "@babel/plugin-transform-template-literals" "^7.18.9" + "@babel/plugin-transform-typeof-symbol" "^7.18.9" + "@babel/plugin-transform-unicode-escapes" "^7.18.10" + "@babel/plugin-transform-unicode-regex" "^7.18.6" + "@babel/preset-modules" "^0.1.5" + "@babel/types" "^7.21.4" + babel-plugin-polyfill-corejs2 "^0.3.3" + babel-plugin-polyfill-corejs3 "^0.6.0" + babel-plugin-polyfill-regenerator "^0.4.1" + core-js-compat "^3.25.1" + 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== + 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/preset-typescript@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.21.4.tgz#b913ac8e6aa8932e47c21b01b4368d8aa239a529" + integrity sha512-sMLNWY37TCdRH/bJ6ZeeOH1nPuanED7Ai9Y/vH31IPqalioJ6ZNFUWONsakhv4r4n+I6gm5lmoE0olkgib/j/A== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-validator-option" "^7.21.0" + "@babel/plugin-syntax-jsx" "^7.21.4" + "@babel/plugin-transform-modules-commonjs" "^7.21.2" + "@babel/plugin-transform-typescript" "^7.21.3" + +"@babel/register@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.21.0.tgz#c97bf56c2472e063774f31d344c592ebdcefa132" + integrity sha512-9nKsPmYDi5DidAqJaQooxIhsLJiNMkGr8ypQ8Uic7cIox7UCDsM7HuUGxdGT7mSDTYbqzIdsOWzfBton/YJrMw== + dependencies: + clone-deep "^4.0.1" + find-cache-dir "^2.0.0" + make-dir "^2.1.0" + pirates "^4.0.5" + source-map-support "^0.5.16" + +"@babel/regjsgen@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" + integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== + +"@babel/runtime@^7.8.4": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" + integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== + dependencies: + regenerator-runtime "^0.13.11" + +"@babel/template@^7.18.10", "@babel/template@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" + integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" + integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== + dependencies: + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.4" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.21.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.21.4" + "@babel/types" "^7.21.4" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.13" -"@babel/types@^7.7.0", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.5": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" - integrity sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg== +"@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.21.4", "@babel/types@^7.4.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.4.tgz#2d5d6bb7908699b3b416409ffd3b5daa25b030d4" + integrity sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA== dependencies: - "@babel/helper-validator-identifier" "^7.9.5" - lodash "^4.17.13" + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" -"@definitelytyped/header-parser@0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@definitelytyped/header-parser/-/header-parser-0.0.29.tgz#81e72279f16ffb7d2c5b2ae7a19982b40544b52d" - integrity sha512-d6FgX8LhSY75fa6cpjsTkLsbFuRKxT4k9EV2oc38wznndlkaWLjP9FW1GT24AMg5hkRuA9AJUbKRO1QhSqvSpA== +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: - "@definitelytyped/typescript-versions" "^0.0.29" - "@types/parsimmon" "^1.10.1" - parsimmon "^1.13.0" + "@jridgewell/trace-mapping" "0.3.9" -"@definitelytyped/header-parser@latest": - version "0.0.57" - resolved "https://registry.yarnpkg.com/@definitelytyped/header-parser/-/header-parser-0.0.57.tgz#6d087772d0bfe7959ca7015cf31449b9a27ca5bc" - integrity sha512-0CNcUUANv93072vleKkXKT8xUNk9JLhaHVMZbBYP/km55T+V8eGCP6BS0pS80MPhvZouq2FmR/r8B5jlR+MQ8w== +"@definitelytyped/dts-critic@^0.0.159": + version "0.0.159" + resolved "https://registry.yarnpkg.com/@definitelytyped/dts-critic/-/dts-critic-0.0.159.tgz#fa9c4129e56fab515c8eb1dab56d484726412239" + integrity sha512-osA3azPNxnszAEQ0RvDY07vtPDeis8+8ey+nBtfqQ7TMPa+4tFgvSxMhBRrGpdYHIfmnSfJtopN/AbMwVdcnpw== dependencies: - "@definitelytyped/typescript-versions" "^0.0.57" + "@definitelytyped/header-parser" "^0.0.159" + command-exists "^1.2.8" + rimraf "^3.0.2" + semver "^6.2.0" + tmp "^0.2.1" + yargs "^15.3.1" + +"@definitelytyped/dtslint@^0.0.159": + version "0.0.159" + resolved "https://registry.yarnpkg.com/@definitelytyped/dtslint/-/dtslint-0.0.159.tgz#1cf480f62e2ff233e3cc75c9582b81bff0c86186" + integrity sha512-Ta07FoW/ziyy9cDhqaBj8MbvuFg6ZPibP7m4CY8Ut5yLO3gB963lk61EhdVm2mgDs6jLjKrtLdeWmvqq+2/L1w== + dependencies: + "@definitelytyped/dts-critic" "^0.0.159" + "@definitelytyped/header-parser" "^0.0.159" + "@definitelytyped/typescript-versions" "^0.0.159" + "@definitelytyped/utils" "^0.0.159" + "@typescript-eslint/eslint-plugin" "^5.55.0" + "@typescript-eslint/parser" "^5.55.0" + "@typescript-eslint/types" "^5.56.0" + "@typescript-eslint/typescript-estree" "^5.55.0" + "@typescript-eslint/utils" "^5.55.0" + eslint "^8.17.0" + fs-extra "^6.0.1" + json-stable-stringify "^1.0.1" + strip-json-comments "^2.0.1" + tslint "5.14.0" + yargs "^15.1.0" + +"@definitelytyped/header-parser@^0.0.159": + version "0.0.159" + resolved "https://registry.yarnpkg.com/@definitelytyped/header-parser/-/header-parser-0.0.159.tgz#92b845a6cb1f4d8c7412620c777b6af61bcc5d4d" + integrity sha512-y+zr9ahjiFz7BLW1HeMWrx7xNxfBTDU0loJqzRh9WPHVdSrMsk+JQBSlubed/EZ1hgFZ6m93FRzBRCGIj8kBYg== + dependencies: + "@definitelytyped/typescript-versions" "^0.0.159" "@types/parsimmon" "^1.10.1" parsimmon "^1.13.0" -"@definitelytyped/typescript-versions@0.0.29", "@definitelytyped/typescript-versions@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@definitelytyped/typescript-versions/-/typescript-versions-0.0.29.tgz#1f1a3bb35e2a8d31ce83763481f6e5530f0f92a0" - integrity sha512-jMWqu0U5MiEVuTBtAbLwxKoF1ZWzbrcFrmX6nuzPzwxNHzUJlACq9RnIH93//bU7JOxkW6UrZy/8V8W5jxmiFA== - -"@definitelytyped/typescript-versions@^0.0.57": - version "0.0.57" - resolved "https://registry.yarnpkg.com/@definitelytyped/typescript-versions/-/typescript-versions-0.0.57.tgz#067f705f5fe7f6af846281b66e03da7ef6127580" - integrity sha512-PpA1dLjH//4fvZ6P5RVR10n+it0lBp/so3dgSAHdFmtHU42kPFc2TlwIYSDL0P5DcNVYViAwIvIIVbYF9hbD+Q== +"@definitelytyped/typescript-versions@^0.0.159": + version "0.0.159" + resolved "https://registry.yarnpkg.com/@definitelytyped/typescript-versions/-/typescript-versions-0.0.159.tgz#fa8ac5808364506b94746fa0003bc4d7b11cc15b" + integrity sha512-9TWRPpOo3CWYUyS3QCu8goJbAhS3qAE/LWFc+Qy6Wb8vsUAwMTioCtPPsYyqrPDbatXvPFrOr182hE1OFvEFSA== -"@definitelytyped/utils@0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@definitelytyped/utils/-/utils-0.0.29.tgz#dfa642cbec49e6f44789083ff24c182e0da0fb0b" - integrity sha512-cqUjvXijj9PgEbVH+DwS5kLHjB700CmeQhFjfRlxn9CeRzSUoa5D0uOdz9b5Hl4XKDQfo1A1lY04nc6z486Nqw== +"@definitelytyped/utils@^0.0.159": + version "0.0.159" + resolved "https://registry.yarnpkg.com/@definitelytyped/utils/-/utils-0.0.159.tgz#e18d114462dba703a9f75316e2b668048ad103a5" + integrity sha512-zm+Gsw39sD2EANlJmmNXgtpIzXO3QmBq5nZx6Y95RD/s2AypDaBw0eauO1wWji6I45tJOAgPZEvfmjjaxfoyhA== dependencies: - "@definitelytyped/typescript-versions" "^0.0.29" - "@types/node" "^12.12.29" + "@definitelytyped/typescript-versions" "^0.0.159" + "@qiwi/npm-registry-client" "^8.9.1" + "@types/node" "^14.14.35" charm "^1.0.2" fs-extra "^8.1.0" fstream "^1.0.12" - npm-registry-client "^8.6.0" - tar "^2.2.2" - tar-stream "1.6.2" + tar "^6.1.11" + tar-stream "^2.1.4" + +"@discoveryjs/json-ext@^0.5.0": + version "0.5.7" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@kollavarsham/gulp-coveralls@0.2.8": - version "0.2.8" - resolved "https://registry.yarnpkg.com/@kollavarsham/gulp-coveralls/-/gulp-coveralls-0.2.8.tgz#a79eb3c8cf3c0b132eaf1befd3433e32ffe080d5" - integrity sha512-VgA+uVdrTct1Xny23XSnvHNftM6N5pmrtBn8IKpQ4OAceQwoILghFZ9Y2qPDAYTucFsB1bJYaKVRR5V/Awm6FA== +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: - coveralls "^3.0.2" - plugin-error "^1.0.1" - through2 "^3.0.0" + eslint-visitor-keys "^3.3.0" -"@nodelib/fs.scandir@2.1.3": - version "2.1.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" - integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== +"@eslint-community/regexpp@^4.4.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.0.tgz#f6f729b02feee2c749f57e334b7a1b5f40a81724" + integrity sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ== + +"@eslint/eslintrc@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" + integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.5.1" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@8.37.0": + version "8.37.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" + integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== + +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/nyc-config-babel@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/nyc-config-babel/-/nyc-config-babel-3.0.0.tgz#56d0a5250d92b9455c7507775fcb5cb7215fee29" + integrity sha512-mPnSPXfTRWCzYsT64PnuPlce6/hGMCdVVMgU2FenXipbUd+FDwUlqlTihXxpxWzcNVOp8M+L1t/kIcgoC8A7hg== + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + 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== + dependencies: + "@sinclair/typebox" "^0.25.16" + +"@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== + dependencies: + "@jest/schemas" "^29.4.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + +"@jridgewell/gen-mapping@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" + integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== + dependencies: + "@jridgewell/set-array" "^1.0.0" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": + 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/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/source-map@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" + integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": + 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/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + +"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": + version "2.1.8-no-fsevents.3" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" + integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== + +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: - "@nodelib/fs.stat" "2.0.3" + "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" - integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" - integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: - "@nodelib/fs.scandir" "2.1.3" + "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@samverschueren/stream-to-observable@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" - integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== +"@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" + integrity sha512-rZF+mG+NfijR0SHphhTLHRr4aM4gtfdwoAMY6we2VGQam8vkN1cxGG1Lg/Llrj8Dd0Mu6VjdFQRyMMRZxtZR2A== dependencies: - any-observable "^0.3.0" + concat-stream "^2.0.0" + graceful-fs "^4.2.4" + normalize-package-data "~1.0.1 || ^2.0.0 || ^3.0.0" + npm-package-arg "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^8.0.0" + once "^1.4.0" + request "^2.88.2" + retry "^0.12.0" + safe-buffer "^5.2.1" + semver "2 >=2.2.1 || 3.x || 4 || 5 || 7" + slide "^1.1.6" + ssri "^8.0.0" + optionalDependencies: + npmlog "2 || ^3.1.0 || ^4.0.0" -"@socket.io/base64-arraybuffer@~1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#568d9beae00b0d835f4f8c53fd55714986492e61" - integrity sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ== +"@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== -"@types/color-name@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@sinonjs/commons@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" + integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== + dependencies: + type-detect "4.0.8" + +"@sinonjs/commons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" + integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== + dependencies: + "@sinonjs/commons" "^2.0.0" + +"@sinonjs/samsam@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.0.tgz#0d488c91efb3fa1442e26abea81759dfc8b5ac60" + integrity sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew== + dependencies: + "@sinonjs/commons" "^2.0.0" + lodash.get "^4.4.2" + type-detect "^4.0.8" -"@types/component-emitter@^1.2.10": - version "1.2.10" - resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.10.tgz#ef5b1589b9f16544642e473db5ea5639107ef3ea" - integrity sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg== +"@sinonjs/text-encoding@^0.7.1": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" + integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ== + +"@socket.io/component-emitter@~3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" + integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg== + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== "@types/cookie@^0.4.1": version "0.4.1" @@ -199,28 +1329,74 @@ integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== "@types/cors@^2.8.12": - version "2.8.12" - resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" - integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== + version "2.8.13" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.13.tgz#b8ade22ba455a1b8cb3b5d3f35910fd204f84f94" + integrity sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA== + dependencies: + "@types/node" "*" -"@types/events@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" - integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== +"@types/eslint-scope@^3.7.3": + version "3.7.4" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" + integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*", "@types/eslint@^8.4.10": + version "8.37.0" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.37.0.tgz#29cebc6c2a3ac7fea7113207bf5a828fdf4d7ef1" + integrity sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" + integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== + +"@types/estree@^0.0.51": + version "0.0.51" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" + integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== "@types/glob@^7.1.1": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" - integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" + integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== dependencies: - "@types/events" "*" "@types/minimatch" "*" "@types/node" "*" +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + +"@types/istanbul-lib-report@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" + integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" + integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== "@types/linkify-it@*": version "3.0.2" @@ -241,180 +1417,267 @@ integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== "@types/minimatch@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" - integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== - -"@types/node@*": - version "13.13.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.0.tgz#30d2d09f623fe32cde9cb582c7a6eda2788ce4a8" - integrity sha512-WE4IOAC6r/yBZss1oQGM5zs2D7RuKR6Q+w+X2SouPofnWn+LbCqClRyhO3ZE7Ix8nmFgo/oVuuE01cJT2XB13A== + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" + integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/node@>=10.0.0": - version "16.7.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.1.tgz#c6b9198178da504dfca1fd0be9b2e1002f1586f0" - integrity sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A== +"@types/node@*", "@types/node@>=10.0.0": + version "18.15.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" + integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== "@types/node@^11.13.0": - version "11.15.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.15.11.tgz#c428d8327dcbd2106d559433728ba261e27bf7c0" - integrity sha512-TyWPoOfqHw3zu61/+2nNuUPhk3XUZnw271ot5K5dhcdSPeO35AjMHU+oBXfvsqdrA+Owwa2Z1999E4m2ENtdrg== + version "11.15.54" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.15.54.tgz#59ed60e7b0d56905a654292e8d73275034eb6283" + integrity sha512-1RWYiq+5UfozGsU6MwJyFX6BtktcT10XRjvcAQmskCtMcW3tPske88lM/nHv7BQG1w9KBXI1zPGuu5PnNCX14g== -"@types/node@^12.12.29": - version "12.20.20" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.20.tgz#ce3d6c13c15c5e622a85efcd3a1cb2d9c7fa43a6" - integrity sha512-kqmxiJg4AT7rsSPIhO6eoBIx9mNwwpeH42yjtgQh6X2ANSpLpvToMXv+LMFdfxpwG1FZXZ41OGZMiUAtbBLEvg== +"@types/node@^14.14.35": + version "14.18.42" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.42.tgz#fa39b2dc8e0eba61bdf51c66502f84e23b66e114" + integrity sha512-xefu+RBie4xWlK8hwAzGh3npDz/4VhF6icY/shU+zv/1fNn+ZVG7T7CRwe9LId9sAYRPxI+59QBPuKL3WpyGRg== "@types/parsimmon@^1.10.1": - version "1.10.3" - resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.3.tgz#a8fbbf75a622628f555a10c47bd5c75c1eaf3ab7" - integrity sha512-BbCYdfYC/XFsVkjWJCeCaUaeYlMHNJ2HmZYaCbsZ14k6qO/mX6n3u2sgtJxSeJLiDPaxb1LESgGA/qGP+AHSCQ== + version "1.10.6" + resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.6.tgz#8fcf95990514d2a7624aa5f630c13bf2427f9cdd" + integrity sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA== + +"@types/semver@^7.3.12": + version "7.3.13" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" + integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + +"@types/yargs-parser@*": + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + +"@types/yargs@^17.0.8": + version "17.0.24" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" + integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + dependencies: + "@types/yargs-parser" "*" + +"@typescript-eslint/eslint-plugin@^5.55.0": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz#d1ab162a3cd2671b8a1c9ddf6e2db73b14439735" + integrity sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ== + dependencies: + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/type-utils" "5.57.1" + "@typescript-eslint/utils" "5.57.1" + debug "^4.3.4" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/parser@^5.55.0": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.1.tgz#af911234bd4401d09668c5faf708a0570a17a748" + integrity sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA== + dependencies: + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/typescript-estree" "5.57.1" + debug "^4.3.4" -"@webassemblyjs/ast@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" - integrity sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA== +"@typescript-eslint/scope-manager@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz#5d28799c0fc8b501a29ba1749d827800ef22d710" + integrity sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw== dependencies: - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/wast-parser" "1.9.0" - -"@webassemblyjs/floating-point-hex-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz#3c3d3b271bddfc84deb00f71344438311d52ffb4" - integrity sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA== + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/visitor-keys" "5.57.1" -"@webassemblyjs/helper-api-error@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz#203f676e333b96c9da2eeab3ccef33c45928b6a2" - integrity sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw== +"@typescript-eslint/type-utils@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz#235daba621d3f882b8488040597b33777c74bbe9" + integrity sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw== + dependencies: + "@typescript-eslint/typescript-estree" "5.57.1" + "@typescript-eslint/utils" "5.57.1" + debug "^4.3.4" + tsutils "^3.21.0" -"@webassemblyjs/helper-buffer@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz#a1442d269c5feb23fcbc9ef759dac3547f29de00" - integrity sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA== +"@typescript-eslint/types@5.57.1", "@typescript-eslint/types@^5.56.0": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.1.tgz#d9989c7a9025897ea6f0550b7036027f69e8a603" + integrity sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA== -"@webassemblyjs/helper-code-frame@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz#647f8892cd2043a82ac0c8c5e75c36f1d9159f27" - integrity sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA== +"@typescript-eslint/typescript-estree@5.57.1", "@typescript-eslint/typescript-estree@^5.55.0": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz#10d9643e503afc1ca4f5553d9bbe672ea4050b71" + integrity sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw== dependencies: - "@webassemblyjs/wast-printer" "1.9.0" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/visitor-keys" "5.57.1" + 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.57.1", "@typescript-eslint/utils@^5.55.0": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.57.1.tgz#0f97b0bbd88c2d5e2036869f26466be5f4c69475" + integrity sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/typescript-estree" "5.57.1" + eslint-scope "^5.1.1" + semver "^7.3.7" + +"@typescript-eslint/visitor-keys@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz#585e5fa42a9bbcd9065f334fd7c8a4ddfa7d905e" + integrity sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA== + dependencies: + "@typescript-eslint/types" "5.57.1" + eslint-visitor-keys "^3.3.0" + +"@webassemblyjs/ast@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" -"@webassemblyjs/helper-fsm@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz#c05256b71244214671f4b08ec108ad63b70eddb8" - integrity sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw== +"@webassemblyjs/floating-point-hex-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== -"@webassemblyjs/helper-module-context@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz#25d8884b76839871a08a6c6f806c3979ef712f07" - integrity sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g== +"@webassemblyjs/helper-api-error@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== + +"@webassemblyjs/helper-buffer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== + +"@webassemblyjs/helper-numbers@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== dependencies: - "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/floating-point-hex-parser" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz#4fed8beac9b8c14f8c58b70d124d549dd1fe5790" - integrity sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw== +"@webassemblyjs/helper-wasm-bytecode@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== -"@webassemblyjs/helper-wasm-section@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz#5a4138d5a6292ba18b04c5ae49717e4167965346" - integrity sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw== +"@webassemblyjs/helper-wasm-section@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" -"@webassemblyjs/ieee754@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz#15c7a0fbaae83fb26143bbacf6d6df1702ad39e4" - integrity sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg== +"@webassemblyjs/ieee754@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.9.0.tgz#f19ca0b76a6dc55623a09cffa769e838fa1e1c95" - integrity sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw== +"@webassemblyjs/leb128@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.9.0.tgz#04d33b636f78e6a6813227e82402f7637b6229ab" - integrity sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w== +"@webassemblyjs/utf8@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== -"@webassemblyjs/wasm-edit@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz#3fe6d79d3f0f922183aa86002c42dd256cfee9cf" - integrity sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/helper-wasm-section" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" - "@webassemblyjs/wasm-opt" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - "@webassemblyjs/wast-printer" "1.9.0" - -"@webassemblyjs/wasm-gen@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz#50bc70ec68ded8e2763b01a1418bf43491a7a49c" - integrity sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA== +"@webassemblyjs/wasm-edit@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-wasm-section" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-opt" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + "@webassemblyjs/wast-printer" "1.11.1" + +"@webassemblyjs/wasm-gen@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/ieee754" "1.9.0" - "@webassemblyjs/leb128" "1.9.0" - "@webassemblyjs/utf8" "1.9.0" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" -"@webassemblyjs/wasm-opt@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz#2211181e5b31326443cc8112eb9f0b9028721a61" - integrity sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A== +"@webassemblyjs/wasm-opt@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-buffer" "1.9.0" - "@webassemblyjs/wasm-gen" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" -"@webassemblyjs/wasm-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz#9d48e44826df4a6598294aa6c87469d642fff65e" - integrity sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA== +"@webassemblyjs/wasm-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-api-error" "1.9.0" - "@webassemblyjs/helper-wasm-bytecode" "1.9.0" - "@webassemblyjs/ieee754" "1.9.0" - "@webassemblyjs/leb128" "1.9.0" - "@webassemblyjs/utf8" "1.9.0" - -"@webassemblyjs/wast-parser@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz#3031115d79ac5bd261556cecc3fa90a3ef451914" - integrity sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/floating-point-hex-parser" "1.9.0" - "@webassemblyjs/helper-api-error" "1.9.0" - "@webassemblyjs/helper-code-frame" "1.9.0" - "@webassemblyjs/helper-fsm" "1.9.0" - "@xtuc/long" "4.2.2" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" -"@webassemblyjs/wast-printer@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz#4935d54c85fef637b00ce9f52377451d00d47899" - integrity sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA== +"@webassemblyjs/wast-printer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/wast-parser" "1.9.0" + "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" +"@webpack-cli/configtest@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.0.1.tgz#a69720f6c9bad6aef54a8fa6ba9c3533e7ef4c7f" + integrity sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A== + +"@webpack-cli/info@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.1.tgz#eed745799c910d20081e06e5177c2b2569f166c0" + integrity sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA== + +"@webpack-cli/serve@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.1.tgz#34bdc31727a1889198855913db2f270ace6d7bf8" + integrity sha512-0G7tNyS+yW8TdgHwZKlDWYXFA6OJQnoLCQvYKkQP0Q2X205PSQ6RNUj0M+1OB/9gRQaUZ/ccYfaxd0nhaWKfjw== + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -425,38 +1688,52 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" accepts@~1.3.4: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" + mime-types "~2.1.34" + negotiator "0.6.3" -acorn-jsx@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" - integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== +acorn-import-assertions@^1.7.6: + version "1.8.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" + integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== -acorn@^6.0.7, acorn@^6.2.1, acorn@^6.4.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" - integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn-walk@^8.1.1: + version "8.2.0" + 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.5.0, acorn@^8.7.1, acorn@^8.8.0: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== adm-zip@~0.4.3: - version "0.4.14" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.14.tgz#2cf312bcc9f8875df835b0f6040bd89be0a727a9" - integrity sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g== + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" agent-base@^4.3.0: version "4.3.0" @@ -466,24 +1743,33 @@ agent-base@^4.3.0: es6-promisify "^5.0.0" aggregate-error@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" - integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== dependencies: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv-errors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" - integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== +ajv-formats@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== + dependencies: + ajv "^8.0.0" -ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: +ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.1.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.9.1: +ajv-keywords@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + +ajv@^6.10.0, 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== @@ -493,78 +1779,57 @@ ajv@^6.1.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.9.1: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= +ajv@^8.0.0, ajv@^8.8.0: + version "8.12.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" + integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" ansi-colors@3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== -ansi-colors@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" - integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== - dependencies: - ansi-wrap "^0.1.0" - -ansi-colors@^3.0.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" - integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== - -ansi-cyan@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-cyan/-/ansi-cyan-0.1.1.tgz#538ae528af8982f28ae30d86f2f17456d2609873" - integrity sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM= - dependencies: - ansi-wrap "0.1.0" - -ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-gray@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" - integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= +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== dependencies: - ansi-wrap "0.1.0" - -ansi-red@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-red/-/ansi-red-0.1.1.tgz#8c638f9d1080800a353c9c28c8a81ca4705d946c" - integrity sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw= - dependencies: - ansi-wrap "0.1.0" + type-fest "^0.21.3" ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" + integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" + integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" @@ -573,69 +1838,34 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" - integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: - "@types/color-name" "^1.1.1" color-convert "^2.0.1" -ansi-styles@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" - integrity sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg= - -ansi-wrap@0.1.0, ansi-wrap@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" - integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= - -any-observable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" - integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" +ansi-styles@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== -anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== +anymatch@~3.1.1, anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" -append-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" - integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= +append-transform@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-2.0.0.tgz#99d9d29c7b38391e6f428d28ce136551f0b77e12" + integrity sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg== dependencies: - buffer-equal "^1.0.0" + default-require-extensions "^3.0.0" -aproba@^1.0.3, aproba@^1.1.1: +aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== @@ -643,16 +1873,21 @@ aproba@^1.0.3, aproba@^1.1.1: archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw== are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + version "1.1.7" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" + integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -665,125 +1900,60 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -arr-diff@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-1.1.0.tgz#687c32758163588fef7de7b36fabe495eb1a399a" - integrity sha1-aHwydYFjWI/vfeezb6vklesaOZo= - dependencies: - arr-flatten "^1.0.1" - array-slice "^0.2.3" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-filter@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" - integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= - dependencies: - make-iterator "^1.0.0" - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-map@^2.0.0, arr-map@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" - integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= - dependencies: - make-iterator "^1.0.0" - -arr-union@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-2.1.0.tgz#20f9eab5ec70f5c7d215b1077b1c39161d292c7d" - integrity sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0= - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-each@^1.0.0, array-each@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" - integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= - -array-includes@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348" - integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0" - is-string "^1.0.5" - -array-initial@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" - integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= - dependencies: - array-slice "^1.0.0" - is-number "^4.0.0" - -array-last@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" - integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== dependencies: - is-number "^4.0.0" + call-bind "^1.0.2" + is-array-buffer "^3.0.1" -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= - -array-slice@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" - integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== - -array-sort@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" - integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== +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== dependencies: - default-compare "^1.0.0" - get-value "^2.0.6" - kind-of "^5.0.2" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" + is-string "^1.0.7" array-union@^2.1.0: version "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-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= +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== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +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== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" -array.prototype.flat@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz#0de82b426b0318dbfdb940089e38b043d37f6c7b" - integrity sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ== +array.prototype.reduce@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" + integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-array-method-boxes-properly "^1.0.0" + is-string "^1.0.7" asn1.js@^5.2.0: version "5.4.1" @@ -796,693 +1966,115 @@ asn1.js@^5.2.0: safer-buffer "^2.1.0" asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assert@^1.1.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" - integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== - dependencies: - object-assign "^4.1.1" - util "0.10.3" - -assertion-error@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.0.tgz#c7f85438fdd466bc7ca16ab90c81513797a5d23b" - integrity sha1-x/hUOP3UZrx8oWq5DIFRN5el0js= - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -async-done@^1.2.0, async-done@^1.2.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" - integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== +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== dependencies: - end-of-stream "^1.1.0" - once "^1.3.2" - process-nextick-args "^2.0.0" - stream-exhaust "^1.0.1" - -async-each@^1.0.0, async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + es6-object-assign "^1.1.0" + is-nan "^1.2.1" + object-is "^1.0.1" + util "^0.12.0" -async-settle@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" - integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= - dependencies: - async-done "^1.2.2" +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== -async@1.x: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= +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== async@^2.1.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + version "2.6.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== dependencies: lodash "^4.17.14" asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.1.tgz#e1e82e4f3e999e2cfd61b161280d16a111f86428" - integrity sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA== - -babel-cli@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" - integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= - dependencies: - babel-core "^6.26.0" - babel-polyfill "^6.26.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - commander "^2.11.0" - convert-source-map "^1.5.0" - fs-readdir-recursive "^1.0.0" - glob "^7.1.2" - lodash "^4.17.4" - output-file-sync "^1.1.2" - path-is-absolute "^1.0.1" - slash "^1.0.0" - source-map "^0.5.6" - v8flags "^2.1.1" - optionalDependencies: - chokidar "^1.6.1" - -babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== -babel-core@^6.1.4, babel-core@^6.23.1, babel-core@^6.26.0, babel-core@~6.26.3: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-eslint@^10.0.1: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - -babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-istanbul@^0.12.2: - version "0.12.2" - resolved "https://registry.yarnpkg.com/babel-istanbul/-/babel-istanbul-0.12.2.tgz#e723f07c9a2432d88055520bc22e75f5c239161c" - integrity sha1-5yPwfJokMtiAVVILwi519cI5Fhw= - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - multi-glob "^1.0.1" - nopt "3.x" - object-assign "^4.0.1" - once "1.x" - resolve "^1.1.0" - source-map "0.4.x" - supports-color "3.1.x" - which "1.2.x" - wordwrap "1.0.x" - -babel-loader@~7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.0.0.tgz#2e43a66bee1fff4470533d0402c8a4532fafbaf7" - integrity sha1-LkOma+4f/0RwUz0EAsikUy+vuvc= - dependencies: - find-cache-dir "^0.1.1" - loader-utils "^1.0.2" - mkdirp "^0.5.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= - -babel-plugin-transform-async-to-generator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.23.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.23.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.22.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-regenerator@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-polyfill@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" - integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= - dependencies: - babel-runtime "^6.26.0" - core-js "^2.5.0" - regenerator-runtime "^0.10.5" - -babel-preset-env@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.23.0" - babel-plugin-transform-es2015-classes "^6.23.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.23.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.23.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.23.0" - babel-plugin-transform-es2015-modules-systemjs "^6.23.0" - babel-plugin-transform-es2015-modules-umd "^6.23.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.23.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.23.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - browserslist "^3.2.6" - invariant "^2.2.2" - semver "^5.3.0" +aws4@^1.8.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" + integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -babel-register@^6.26.0: +babel-code-frame@^6.22.0: version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g== + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= +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== dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" + find-cache-dir "^3.3.2" + schema-utils "^4.0.0" -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" -babel-traverse@^6.24.1, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= +babel-plugin-polyfill-corejs2@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" + integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" + "@babel/compat-data" "^7.17.7" + "@babel/helper-define-polyfill-provider" "^0.3.3" + semver "^6.1.1" -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== +babel-plugin-polyfill-corejs3@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" + integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.3.3" + core-js-compat "^3.25.1" -bach@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" - integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= - dependencies: - arr-filter "^1.1.1" - arr-flatten "^1.0.1" - arr-map "^2.0.0" - array-each "^1.0.0" - array-initial "^1.0.0" - array-last "^1.1.1" - async-done "^1.2.2" - async-settle "^1.0.0" - now-and-later "^2.0.0" +babel-plugin-polyfill-regenerator@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" + integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.3.3" balanced-match@^1.0.0: version "1.0.2" @@ -1492,35 +2084,22 @@ balanced-match@^1.0.0: base32.js@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/base32.js/-/base32.js-0.1.0.tgz#b582dec693c2f11e893cf064ee6ac5b6131a2202" - integrity sha1-tYLexpPC8R6JPPBk7mrFthMaIgI= + integrity sha512-n3TkB02ixgBOhTvANakDb4xaMXnYUVkNoRFJjQflcqMQhyEKxEHdj3E6N8t8sUQ0mjH/3/JxzlXuz3ul/J90pQ== -base64-js@^1.0.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" - integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== base64id@2.0.0, base64id@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== dependencies: tweetnacl "^0.14.3" @@ -1534,39 +2113,21 @@ bignumber.js@^4.0.0: resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" integrity sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA== -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bl@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" - integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= +bl@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== dependencies: - inherits "~2.0.0" + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" -bluebird@^3.5.5, bluebird@^3.7.2: +bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -1576,26 +2137,28 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.1.1: - version "5.1.3" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" - integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ== +bn.js@^5.0.0, bn.js@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== body-parser@^1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== dependencies: - bytes "3.1.0" - content-type "~1.0.4" + bytes "3.1.2" + content-type "~1.0.5" debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" brace-expansion@^1.1.7: version "1.1.11" @@ -1605,32 +2168,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1, braces@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: +braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -1640,7 +2178,7 @@ braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browser-stdout@1.3.1: version "1.3.1" @@ -1679,11 +2217,11 @@ browserify-des@^1.0.0: safe-buffer "^5.1.2" browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= + version "4.1.0" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" + integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== dependencies: - bn.js "^4.1.0" + bn.js "^5.0.0" randombytes "^2.0.1" browserify-sign@^4.0.0: @@ -1708,41 +2246,15 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^3.2.6: - version "3.2.8" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== +browserslist@^4.14.5, browserslist@^4.21.3, browserslist@^4.21.5: + version "4.21.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" + integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== dependencies: - caniuse-lite "^1.0.30000844" - electron-to-chromium "^1.3.47" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - -buffer-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" - integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= + caniuse-lite "^1.0.30001449" + electron-to-chromium "^1.4.284" + node-releases "^2.0.8" + update-browserslist-db "^1.0.10" buffer-from@^1.0.0: version "1.1.2" @@ -1752,124 +2264,100 @@ buffer-from@^1.0.0: buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -buffer@^4.3.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" - integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== +buffer@^5.1.0, buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" + base64-js "^1.3.1" + ieee754 "^1.1.13" -buffer@^5.1.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" - integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" + base64-js "^1.3.1" + ieee754 "^1.2.1" builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + integrity sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ== builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" - integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= + integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -cacache@^12.0.2: - version "12.0.4" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" - integrity sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ== +caching-transform@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-4.0.0.tgz#00d297a4206d71e2163c39eaffa8157ac0651f0f" + integrity sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA== dependencies: - bluebird "^3.5.5" - chownr "^1.1.1" - figgy-pudding "^3.5.1" - glob "^7.1.4" - graceful-fs "^4.1.15" - infer-owner "^1.0.3" - lru-cache "^5.1.1" - mississippi "^3.0.0" - mkdirp "^0.5.1" - move-concurrently "^1.0.1" - promise-inflight "^1.0.1" - rimraf "^2.6.3" - ssri "^6.0.1" - unique-filename "^1.1.1" - y18n "^4.0.0" + hasha "^5.0.0" + make-dir "^3.0.0" + package-hash "^4.0.0" + write-file-atomic "^3.0.0" -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" + function-bind "^1.1.1" + get-intrinsic "^1.0.2" caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= + integrity sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ== dependencies: callsites "^2.0.0" caller-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= + integrity sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A== dependencies: caller-callsite "^2.0.0" callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + integrity sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ== callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= - -camelcase@^5.0.0: +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000844: - version "1.0.30001043" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001043.tgz#1b561de27aefbe6ff99e41866b8d7d87840c513b" - integrity sha512-MrBDRPJPDBYwACtSQvxg9+fkna5jPXhJlKmuxenl/ml9uf8LHKlDmLpElu+zTW/bEz7lC1m0wTDD7jiIB+hgFg== +caniuse-lite@^1.0.30001449: + version "1.0.30001473" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001473.tgz#3859898b3cab65fc8905bb923df36ad35058153c" + integrity sha512-ewDad7+D2vlyy+E4UJuVfiBsU69IL+8oVmTuZnH5Q6CIUbxNfI50uVpRHbUPDD6SUaN2o0Lh4DhTrvLG/Tn1yg== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== catharsis@^0.9.0: version "0.9.0" @@ -1878,18 +2366,28 @@ catharsis@^0.9.0: dependencies: lodash "^4.17.15" -chai@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-2.3.0.tgz#8a2f6a34748da801090fd73287b2aa739a4e909a" - integrity sha1-ii9qNHSNqAEJD9cyh7Kqc5pOkJo= +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== dependencies: - assertion-error "1.0.0" - deep-eql "0.1.3" + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^4.1.2" + get-func-name "^2.0.0" + loupe "^2.3.1" + 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@^1.0.0, chalk@^1.1.3: +chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A== dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -1897,7 +2395,7 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.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== @@ -1906,27 +2404,26 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4 escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" - integrity sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8= +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: - ansi-styles "~1.0.0" - has-color "~0.1.0" - strip-ansi "~0.1.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + ansi-styles "^4.1.0" + supports-color "^7.1.0" charm@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/charm/-/charm-1.0.2.tgz#8add367153a6d9a581331052c4090991da995e35" - integrity sha1-it02cVOm2aWBMxBSxAkJkdqZXjU= + integrity sha512-wqW3VdPnlSWT4eRiYX+hcs+C6ViBPUWk1qTCd+37qw9kEm/a5n2qcyQDMBWvSYKN/ctqZzeXNQaeBjOetJJUkw== dependencies: inherits "^2.0.1" +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== + chokidar@3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" @@ -1942,45 +2439,10 @@ chokidar@3.3.0: optionalDependencies: fsevents "~2.1.1" -chokidar@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -chokidar@^2.0.0, chokidar@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - -chokidar@^3.4.1, chokidar@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== +chokidar@^3.4.0, chokidar@^3.5.1: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -1992,23 +2454,26 @@ chokidar@^3.4.1, chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.2" -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== chrome-trace-event@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" - integrity sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ== - dependencies: - tslib "^1.9.0" + version "1.0.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +ci-info@^3.2.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" + integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -2017,16 +2482,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -2037,34 +2492,28 @@ clear@^0.1.0: resolved "https://registry.yarnpkg.com/clear/-/clear-0.1.0.tgz#b81b1e03437a716984fd7ac97c87d73bdfe7048a" integrity sha512-qMjRnoL+JDPJHeLePZJuao6+8orzHMGP04A8CdwCNsKhRbOnKRjefxONR7bwILT3MHecxKBjHkKL/tkZ8r4Uzw== -cli-cursor@^2.0.0, cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= +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 "^2.0.0" + restore-cursor "^3.1.0" -cli-truncate@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" - integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= +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== dependencies: - slice-ansi "0.0.4" - string-width "^1.0.1" - -cli-width@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" - integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== + slice-ansi "^3.0.0" + string-width "^4.2.0" -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= +cli-truncate@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-3.1.0.tgz#3f23ab12535e3d73e839bb43e73c9de487db1389" + integrity sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA== dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" + slice-ansi "^5.0.0" + string-width "^5.0.0" cliui@^5.0.0: version "5.0.0" @@ -2093,11 +2542,6 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -clone-buffer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" - integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= - clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -2107,46 +2551,10 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" -clone-stats@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" - integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= - -clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -cloneable-readable@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" - integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== - dependencies: - inherits "^2.0.1" - process-nextick-args "^2.0.0" - readable-stream "^2.3.5" - code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-map@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" - integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= - dependencies: - arr-map "^2.0.2" - for-own "^1.0.0" - make-iterator "^1.0.0" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" + integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== color-convert@^1.9.0: version "1.9.3" @@ -2165,22 +2573,17 @@ color-convert@^2.0.1: color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - -colors@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== +colorette@^2.0.14, colorette@^2.0.19: + version "2.0.19" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" + integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" @@ -2194,40 +2597,50 @@ 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@^2.11.0, commander@^2.12.1, commander@^2.14.1, commander@^2.20.0, commander@^2.9.0, commander@~2.20.3: +commander@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.0.tgz#71797971162cd3cf65f0b9d24eb28f8d303acdf1" + integrity sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA== + +commander@^2.12.1, commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + +commander@^9.4.1: + version "9.5.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" + integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - -component-emitter@^1.2.1, component-emitter@~1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concat-stream@^1.5.0, concat-stream@^1.5.2, concat-stream@^1.6.0, concat-stream@^1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== +concat-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1" + integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" - readable-stream "^2.2.2" + readable-stream "^3.0.2" typedarray "^0.0.6" -confusing-browser-globals@^1.0.5: - version "1.0.9" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz#72bc13b483c0276801681871d4898516f8f54fdd" - integrity sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw== +confusing-browser-globals@^1.0.10: + version "1.0.11" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" + integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== connect@^3.7.0: version "3.7.0" @@ -2239,7 +2652,7 @@ connect@^3.7.0: parseurl "~1.3.3" utils-merge "1.0.1" -console-browserify@^1.1.0: +console-browserify@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== @@ -2247,74 +2660,39 @@ console-browserify@^1.1.0: console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= - -contains-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== -convert-source-map@^1.5.0, convert-source-map@^1.5.1: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" +convert-source-map@^1.1.0, convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== cookie@~0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== - -copy-concurrently@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" - integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== - dependencies: - aproba "^1.1.1" - fs-write-stream-atomic "^1.0.8" - iferr "^0.1.5" - mkdirp "^0.5.1" - rimraf "^2.5.4" - run-queue "^1.0.0" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== -copy-props@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.5.tgz#03cf9ae328d4ebb36f8f1d804448a6af9ee3f2d2" - integrity sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw== +core-js-compat@^3.25.1: + version "3.30.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.0.tgz#99aa2789f6ed2debfa1df3232784126ee97f4d80" + integrity sha512-P5A2h/9mRYZFIAP+5Ab8ns6083IyVpSclU74UNvbGVQ8VM7n3n3/g2yF3AkKQ9NXz2O+ioxLbEWKnDtgsFamhg== dependencies: - each-props "^1.3.2" - is-plain-object "^5.0.0" - -core-js@^2.4.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - -core-js@^2.5.0: - version "2.6.11" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" - integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== + browserslist "^4.21.5" core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== core-util-is@~1.0.0: version "1.0.3" @@ -2329,7 +2707,7 @@ cors@~2.8.5: object-assign "^4" vary "^1" -cosmiconfig@^5.0.2, cosmiconfig@^5.0.7: +cosmiconfig@^5.0.7: version "5.2.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== @@ -2339,17 +2717,6 @@ cosmiconfig@^5.0.2, cosmiconfig@^5.0.7: js-yaml "^3.13.1" parse-json "^4.0.0" -coveralls@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.0.tgz#13c754d5e7a2dd8b44fe5269e21ca394fb4d615b" - integrity sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ== - dependencies: - js-yaml "^3.13.1" - lcov-parse "^1.0.0" - log-driver "^1.2.7" - minimist "^1.2.5" - request "^2.88.2" - crc@^3.5.0: version "3.8.0" resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6" @@ -2388,16 +2755,19 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" + cross-spawn "^7.0.1" -cross-spawn@^6.0.0, cross-spawn@^6.0.5: +cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== @@ -2408,16 +2778,16 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.2.tgz#d0d7dcfa74e89115c7619f4f721a94e1fdb716d6" - integrity sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw== +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" which "^2.0.1" -crypto-browserify@^3.11.0: +crypto-browserify@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== @@ -2434,146 +2804,103 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -cursor@^0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/cursor/-/cursor-0.1.5.tgz#ea778c2b09d33c2e564fd92147076750483ebb2c" - integrity sha1-6neMKwnTPC5WT9khRwdnUEg+uyw= +css-loader@^5.0.0: + version "5.2.7" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-5.2.7.tgz#9b9f111edf6fb2be5dc62525644cbc9c232064ae" + integrity sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg== + dependencies: + icss-utils "^5.1.0" + loader-utils "^2.0.0" + postcss "^8.2.15" + postcss-modules-extract-imports "^3.0.0" + postcss-modules-local-by-default "^4.0.0" + postcss-modules-scope "^3.0.0" + postcss-modules-values "^4.0.0" + postcss-value-parser "^4.1.0" + schema-utils "^3.0.0" + semver "^7.3.5" + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== custom-event@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - -cyclist@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" - integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= - -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -dargs@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" - integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== + integrity sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg== dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== dependencies: assert-plus "^1.0.0" -date-fns@^1.27.2: - version "1.30.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" - integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== +date-format@^4.0.14: + version "4.0.14" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.14.tgz#7a8e584434fb169a521c8b7aa481f355810d9400" + integrity sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg== -date-format@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.6.tgz#f6138b8f17968df9815b3d101fc06b0523f066c5" - integrity sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw== - -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@3.2.6, debug@^3.1.0: +debug@3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0, debug@~4.3.1: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - -debug@^4.3.4, debug@~4.3.2: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -decamelize@^1.1.1, decamelize@^1.2.0: +debug@^3.1.0, debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -deep-eql@0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" - integrity sha1-71WKyrjeJSBs1xOQbXTlaTDrafI= +deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== dependencies: - type-detect "0.1.1" + type-detect "^4.0.0" -deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.4" 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-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" - integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== - dependencies: - kind-of "^5.0.2" - -default-resolution@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" - integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= - -define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= +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" + integrity sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw== dependencies: - is-descriptor "^1.0.0" + strip-bom "^4.0.0" -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== +define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" del@^5.1.0: version "5.1.0" @@ -2592,17 +2919,17 @@ del@^5.1.0: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== des.js@^1.0.0: version "1.0.1" @@ -2612,28 +2939,31 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -detect-file@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" - integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= - dependencies: - repeating "^2.0.0" +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== di@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= + integrity sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA== diff@3.5.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +diff@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -2650,13 +2980,12 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -doctrine@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== dependencies: esutils "^2.0.2" - isarray "^1.0.0" doctrine@^3.0.0: version "3.0.0" @@ -2665,71 +2994,30 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-serialize@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -domain-browser@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== - -dts-critic@^3.0.2: - version "3.3.9" - resolved "https://registry.yarnpkg.com/dts-critic/-/dts-critic-3.3.9.tgz#e669275d98a23029ad50e5a9c573414e71afd0bc" - integrity sha512-kI8QE+gvvWP9r/57KtSzJ78jBKAccOkSBQLqcif/8K7LbM+zlpJPDKAE0fI436fYej9/aL9ILsoKMc5hE0lwSg== - dependencies: - "@definitelytyped/header-parser" latest - command-exists "^1.2.8" - rimraf "^3.0.2" - semver "^6.2.0" - tmp "^0.2.1" - yargs "^15.3.1" - -dtslint@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/dtslint/-/dtslint-3.5.0.tgz#c8dc2d9d309228f5654ff57d0cbf7874cc721bf4" - integrity sha512-ajY1/5ZCl7xd03TTSe2qdLCj/+lia2ZSk9r8bxNrQhZDx11fQH/YTCV2Elb5tmFCONBrqMmkYzuuraVc9RODew== - dependencies: - "@definitelytyped/header-parser" "0.0.29" - "@definitelytyped/typescript-versions" "0.0.29" - "@definitelytyped/utils" "0.0.29" - dts-critic "^3.0.2" - fs-extra "^6.0.1" - json-stable-stringify "^1.0.1" - strip-json-comments "^2.0.1" - tslint "5.14.0" - typescript next - yargs "^15.1.0" - -duplexify@^3.4.2, duplexify@^3.6.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" - integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" - -each-props@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" - integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== +dom-serialize@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" + integrity sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ== dependencies: - is-plain-object "^2.0.1" - object.defaults "^1.1.0" + custom-event "~1.0.0" + ent "~2.2.0" + extend "^3.0.0" + void-elements "^2.0.0" + +domain-browser@^4.22.0: + version "4.22.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-4.22.0.tgz#6ddd34220ec281f9a65d3386d267ddd35c491f9f" + integrity sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw== + +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" @@ -2737,17 +3025,12 @@ ecc-jsbn@~0.1.1: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.3.47: - version "1.3.413" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.413.tgz#9c457a4165c7b42e59d66dff841063eb9bfe5614" - integrity sha512-Jm1Rrd3siqYHO3jftZwDljL2LYQafj3Kki5r+udqE58d0i91SkjItVJ5RwlJn9yko8i7MOcoidVKjQlgSdd1hg== + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -elegant-spinner@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" - integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= +electron-to-chromium@^1.4.284: + version "1.4.349" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.349.tgz#c65a4378cea805accfe6f585730ce2a3afe07f1d" + integrity sha512-34LBfVDiL6byWorSmQOPwq4gD5wpN8Mhh5yPGQr67FbcxsfUS0BDJP9y6RykSgeWVUfSkN/2dChywnsrmKVyUg== elliptic@^6.5.3: version "6.5.4" @@ -2772,6 +3055,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" @@ -2780,9 +3068,9 @@ emojis-list@^3.0.0: encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== -end-of-stream@^1.0.0, end-of-stream@^1.1.0: +end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== @@ -2790,16 +3078,14 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: once "^1.4.0" engine.io-parser@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.0.3.tgz#ca1f0d7b11e290b4bfda251803baea765ed89c09" - integrity sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg== - dependencies: - "@socket.io/base64-arraybuffer" "~1.0.2" + version "5.0.6" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.0.6.tgz#7811244af173e157295dec9b2718dfe42a64ef45" + integrity sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw== -engine.io@~6.1.0: - version "6.1.3" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.1.3.tgz#f156293d011d99a3df5691ac29d63737c3302e6f" - integrity sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA== +engine.io@~6.4.1: + version "6.4.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.4.1.tgz#8056b4526a88e779f9c280d820422d4e3eeaaae5" + integrity sha512-JFYQurD/nbsA5BSPmbaOSLa3tSVj8L6o4srSwXXY3NqE+gGUNmmPTbhn8tjzcCtSqhFgIeqef81ngny8JM25hw== dependencies: "@types/cookie" "^0.4.1" "@types/cors" "^2.8.12" @@ -2810,75 +3096,103 @@ engine.io@~6.1.0: cors "~2.8.5" debug "~4.3.1" engine.io-parser "~5.0.3" - ws "~8.2.3" + ws "~8.11.0" -enhanced-resolve@^4.1.0, enhanced-resolve@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126" - integrity sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ== +enhanced-resolve@^5.10.0: + version "5.12.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" + integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.5.0" - tapable "^1.0.0" + graceful-fs "^4.2.4" + tapable "^2.2.0" ent@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= + integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA== entities@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== -errno@^0.1.3, errno@~0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== - dependencies: - prr "~1.0.1" +envinfo@^7.7.3: + version "7.8.1" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" + integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -error-ex@^1.2.0, error-ex@^1.3.1: +error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: - version "1.17.6" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.6.tgz#9142071707857b2cacc7b89ecb670316c3e2d52a" - integrity sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw== +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== dependencies: + array-buffer-byte-length "^1.0.0" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" - function-bind "^1.1.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.2.0" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.0" - is-regex "^1.1.0" - object-inspect "^1.7.0" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.3" object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + 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-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.9" + +es-array-method-boxes-properly@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" + integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== + +es-module-lexer@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== -es-abstract@^1.18.0-next.0: - version "1.18.0-next.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.0.tgz#b302834927e624d8e5837ed48224291f2c66e6fc" - integrity sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ== +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.0" - is-negative-zero "^2.0.0" - is-regex "^1.1.1" - object-inspect "^1.8.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" es-to-primitive@^1.2.1: version "1.2.1" @@ -2889,23 +3203,15 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50: - version "0.10.53" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" - integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.3" - next-tick "~1.0.0" +es6-error@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" + integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" +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== es6-promise@^4.0.3: version "4.2.8" @@ -2915,28 +3221,10 @@ es6-promise@^4.0.3: es6-promisify@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + integrity sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ== dependencies: es6-promise "^4.0.3" -es6-symbol@^3.1.1, es6-symbol@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -es6-weak-map@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" - integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== - dependencies: - d "1" - es5-ext "^0.10.46" - es6-iterator "^2.0.3" - es6-symbol "^3.1.1" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -2945,50 +3233,32 @@ escalade@^3.1.1: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== escape-string-regexp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escodegen@1.8.x: - version "1.8.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= - dependencies: - esprima "^2.7.1" - estraverse "^1.9.1" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.2.0" - -escodegen@^1.6.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-airbnb-base@^13.1.0: - version "13.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz#f6ea81459ff4dec2dda200c35f1d8f7419d57943" - integrity sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w== +eslint-config-airbnb-base@^15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236" + integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig== dependencies: - confusing-browser-globals "^1.0.5" - object.assign "^4.1.0" - object.entries "^1.1.0" + confusing-browser-globals "^1.0.10" + object.assign "^4.1.2" + object.entries "^1.1.5" + semver "^6.3.0" eslint-config-prettier@^3.6.0: version "3.6.0" @@ -2997,21 +3267,21 @@ eslint-config-prettier@^3.6.0: dependencies: get-stdin "^6.0.0" -eslint-import-resolver-node@^0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717" - integrity sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA== +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== dependencies: - debug "^2.6.9" - resolve "^1.13.1" + debug "^3.2.7" + is-core-module "^2.11.0" + resolve "^1.22.1" -eslint-module-utils@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz#579ebd094f56af7797d19c9866c9c9486629bfa6" - integrity sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA== +eslint-module-utils@^2.7.4: + version "2.7.4" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974" + integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== dependencies: - debug "^2.6.9" - pkg-dir "^2.0.0" + debug "^3.2.7" eslint-plugin-es@^1.3.1: version "1.4.1" @@ -3021,24 +3291,26 @@ eslint-plugin-es@^1.3.1: eslint-utils "^1.4.2" regexpp "^2.0.1" -eslint-plugin-import@^2.15.0: - version "2.22.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz#0896c7e6a0cf44109a2d97b95903c2bb689d7702" - integrity sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw== - dependencies: - array-includes "^3.1.1" - array.prototype.flat "^1.2.3" - contains-path "^0.1.0" - debug "^2.6.9" - doctrine "1.5.0" - eslint-import-resolver-node "^0.3.4" - eslint-module-utils "^2.6.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== + dependencies: + array-includes "^3.1.6" + 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" has "^1.0.3" - minimatch "^3.0.4" - object.values "^1.1.1" - read-pkg-up "^2.0.0" - resolve "^1.17.0" - tsconfig-paths "^3.9.0" + is-core-module "^2.11.0" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.values "^1.1.6" + resolve "^1.22.1" + semver "^6.3.0" + tsconfig-paths "^3.14.1" eslint-plugin-node@^8.0.1: version "8.0.1" @@ -3055,23 +3327,31 @@ eslint-plugin-node@^8.0.1: eslint-plugin-prefer-import@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-import/-/eslint-plugin-prefer-import-0.0.1.tgz#0df4e117da29109ef561d355ec19f41df0ada6f6" - integrity sha1-DfThF9opEJ71YdNV7Bn0HfCtpvY= + integrity sha512-2OKD3Bjgqkn0BvEGRwpEDhjXPSXvT3CXmWIrIavwafOkQE8FLTvFybEBT9dm7P0kHnjlNGv1AfNsL/i/GNDNHA== eslint-plugin-prettier@^3.0.1: - version "3.1.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2" - integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg== + version "3.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" + integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== +eslint-scope@5.1.1, eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== dependencies: - esrecurse "^4.1.0" + esrecurse "^4.3.0" estraverse "^4.1.1" +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + eslint-utils@^1.3.1, eslint-utils@^1.4.2: version "1.4.3" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" @@ -3079,120 +3359,135 @@ eslint-utils@^1.3.1, eslint-utils@^1.4.2: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== - -eslint@^5.0.1, eslint@^5.12.1: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" +eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.1.0: + version "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.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" + integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== + +eslint-webpack-plugin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-4.0.0.tgz#f77f37b2bbb8ad5c4197b5e55f5f2a49365a1a81" + integrity sha512-eM9ccGRWkU+btBSVfABRn8CjT7jZ2Q+UV/RfErMDVCFXpihEbvajNrLltZpwTAcEoXSqESGlEPIUxl7PoDlLWw== + dependencies: + "@types/eslint" "^8.4.10" + jest-worker "^29.4.1" + micromatch "^4.0.5" + normalize-path "^3.0.0" + schema-utils "^4.0.0" + +eslint@^8.17.0, eslint@^8.37.0: + version "8.37.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" + integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.4.0" + "@eslint/eslintrc" "^2.0.2" + "@eslint/js" "8.37.0" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^5.0.1" - esquery "^1.0.1" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-visitor-keys "^3.4.0" + espree "^9.5.1" + esquery "^1.4.2" esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.6" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.11" - minimatch "^3.0.4" - mkdirp "^0.5.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^5.2.3" + optionator "^0.9.1" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== +espree@^9.5.1: + version "9.5.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" + integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.0" -esprima@2.7.x, esprima@^2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= - -esprima@^4.0.0, esprima@^4.0.1: +esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" - integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" -esrecurse@^4.1.0: +esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== dependencies: estraverse "^5.2.0" -estraverse@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= - -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642" - integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw== - -estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" - integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== +events@^3.2.0, events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" @@ -3202,19 +3497,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" - integrity sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA== - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" @@ -3228,150 +3510,37 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-2.1.0.tgz#e5d3ecd837d2a60ec50f3da78fd39767747bbe99" - integrity sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw== +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== dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - is-stream "^2.0.0" + cross-spawn "^7.0.3" + get-stream "^6.0.1" + human-signals "^4.3.0" + is-stream "^3.0.0" merge-stream "^2.0.0" - npm-run-path "^3.0.0" - onetime "^5.1.0" - p-finally "^2.0.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -expand-tilde@^2.0.0, expand-tilde@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" - integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= - dependencies: - homedir-polyfill "^1.0.1" - -ext@^1.1.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" - integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== - dependencies: - type "^2.0.0" - -extend-shallow@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-1.1.4.tgz#19d6bf94dfc09d76ba711f39b872d21ff4dd9071" - integrity sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE= - dependencies: - kind-of "^1.1.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^3.0.7" + strip-final-newline "^3.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" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extract-zip@^1.6.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927" - integrity sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA== - dependencies: - concat-stream "^1.6.2" - debug "^2.6.9" - mkdirp "^0.5.4" - yauzl "^2.10.0" - extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fancy-log@^1.2.0, fancy-log@^1.3.2, fancy-log@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" - integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== - dependencies: - ansi-gray "^0.1.1" - color-support "^1.1.3" - parse-node-version "^1.0.0" - time-stamp "^1.0.0" + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== -fast-deep-equal@^3.1.1: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== @@ -3381,104 +3550,45 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-glob@^3.0.3: - version "3.2.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.2.tgz#ade1a9d91148965d4bf7c51f72e1ca662d32e63d" - integrity sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A== +fast-glob@^3.0.3, 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== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" - integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= - -fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastest-levenshtein@^1.0.12: + version "1.0.16" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" + integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== fastq@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.7.0.tgz#fcd79a08c5bd7ec5b55cd3f5c4720db551929801" - integrity sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ== + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== dependencies: reusify "^1.0.4" -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - -figgy-pudding@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" - integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== - -figures@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" + flat-cache "^3.0.4" fill-range@^7.0.1: version "7.0.1" @@ -3487,6 +3597,11 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +filter-obj@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-2.0.2.tgz#fff662368e505d69826abb113f0f6a98f56e9d5f" + integrity sha512-lO3ttPjHZRfjMcxWKb1j1eDhTFsu4meeR3lnMcnBFhk6RuLhvEiuALu2TlfL310ph4lCYYwgF/ElIjdP739tdg== + finalhandler@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" @@ -3500,16 +3615,7 @@ finalhandler@1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - integrity sha1-yN765XyKUqinhPnjHFfHQumToLk= - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" - -find-cache-dir@^2.1.0: +find-cache-dir@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== @@ -3518,10 +3624,14 @@ find-cache-dir@^2.1.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= +find-cache-dir@^3.2.0, find-cache-dir@^3.3.2: + 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== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" find-up@3.0.0, find-up@^3.0.0: version "3.0.0" @@ -3530,22 +3640,7 @@ find-up@3.0.0, find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.0.0, find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -find-up@^4.1.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3553,114 +3648,58 @@ find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -findup-sync@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" - integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= - dependencies: - detect-file "^1.0.0" - is-glob "^3.1.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -findup-sync@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" - integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== - dependencies: - detect-file "^1.0.0" - is-glob "^4.0.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -findup-sync@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-4.0.0.tgz#956c9cdde804052b881b428512905c4a5f2cdef0" - integrity sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ== - dependencies: - detect-file "^1.0.0" - is-glob "^4.0.0" - micromatch "^4.0.2" - resolve-dir "^1.0.1" - -fined@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b" - integrity sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng== +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: - expand-tilde "^2.0.2" - is-plain-object "^2.0.3" - object.defaults "^1.1.0" - object.pick "^1.2.0" - parse-filepath "^1.0.1" - -flagged-respawn@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" - integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== + locate-path "^6.0.0" + path-exists "^4.0.0" -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== +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== dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" + flatted "^3.1.0" + rimraf "^3.0.2" flat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" - integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== + version "4.1.1" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" + integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== dependencies: is-buffer "~2.0.3" -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - -flatted@^3.2.5: - version "3.2.5" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" - integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== - -flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" - integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== - dependencies: - inherits "^2.0.3" - readable-stream "^2.3.6" +flatted@^3.1.0, 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== follow-redirects@^1.0.0: - version "1.14.8" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" - integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== dependencies: - for-in "^1.0.1" + is-callable "^1.1.3" -for-own@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" - integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= +foreground-child@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" + integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== dependencies: - for-in "^1.0.1" + cross-spawn "^7.0.0" + signal-exit "^3.0.2" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== form-data@~2.3.2: version "2.3.3" @@ -3671,51 +3710,16 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -formatio@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.1.1.tgz#5ed3ccd636551097383465d996199100e86161e9" - integrity sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek= - dependencies: - samsam "~1.1" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -from2@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" - integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.0" +fromentries@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" + integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" - integrity sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - -fs-extra@^10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8" - integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b" @@ -3734,49 +3738,22 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-mkdirp-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" - integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= +fs-minipass@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== dependencies: - graceful-fs "^4.1.11" - through2 "^2.0.3" + minipass "^3.0.0" -fs-readdir-recursive@^1.0.0: +fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== -fs-write-stream-atomic@^1.0.8: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" - integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= - dependencies: - graceful-fs "^4.1.2" - iferr "^0.1.5" - imurmurhash "^0.1.4" - readable-stream "1 || 2" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.0.0: - version "1.2.12" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.12.tgz#db7e0d8ec3b0b45724fd4d83d43554a8f1f0de5c" - integrity sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@^1.2.7: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.1.1: version "2.1.3" @@ -3803,15 +3780,25 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +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== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +functions-have-names@^1.2.2: + 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== gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg== dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -3822,31 +3809,40 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-own-enumerable-property-symbols@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" - integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== +get-func-name@^2.0.0: + version "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: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" + integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== get-stdin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -3854,108 +3850,51 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" -get-stream@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" - integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== - dependencies: - pump "^3.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== -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== dependencies: assert-plus "^1.0.0" ghooks@^0.3.0: version "0.3.2" resolved "https://registry.yarnpkg.com/ghooks/-/ghooks-0.3.2.tgz#a1fa85dede71eecc19faca9ee163c3cdfc1b94d0" - integrity sha1-ofqF3t5x7swZ+sqe4WPDzfwblNA= + integrity sha512-cS/MAstTJ4x3jDWZtNc/EDrd45nNbuqQEjLQXkqCHFWyLJxrG4n05yA9heBxEhnsrg04RxAHiS51WtwJNMPIDw== dependencies: spawn-command "^0.0.2" -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-parent@^5.1.0, glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - -glob-parent@~5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob-stream@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" - integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== dependencies: - extend "^3.0.0" - glob "^7.1.1" - glob-parent "^3.1.0" - is-negated-glob "^1.0.0" - ordered-read-streams "^1.0.0" - pumpify "^1.3.5" - readable-stream "^2.1.5" - remove-trailing-separator "^1.0.1" - to-absolute-glob "^2.0.0" - unique-stream "^2.0.2" - -glob-watcher@^5.0.3: - version "5.0.5" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.5.tgz#aa6bce648332924d9a8489be41e3e5c52d4186dc" - integrity sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw== - dependencies: - anymatch "^2.0.0" - async-done "^1.2.0" - chokidar "^2.0.0" - is-negated-glob "^1.0.0" - just-debounce "^1.0.0" - normalize-path "^3.0.0" - object.defaults "^1.1.0" + is-glob "^4.0.3" -glob@5.x, glob@^5.0.15: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== glob@7.1.3: version "7.1.3" @@ -3969,47 +3908,36 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.7: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== +glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.4" + minimatch "^3.1.1" once "^1.3.0" path-is-absolute "^1.0.0" -global-modules@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" - integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== - dependencies: - global-prefix "^1.0.1" - is-windows "^1.0.1" - resolve-dir "^1.0.0" - -global-prefix@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" - integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= - dependencies: - expand-tilde "^2.0.2" - homedir-polyfill "^1.0.1" - ini "^1.3.4" - is-windows "^1.0.1" - which "^1.2.14" - -globals@^11.1.0, globals@^11.7.0: +globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== +globals@^13.19.0: + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + dependencies: + type-fest "^0.20.2" + +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" globby@^10.0.1: version "10.0.2" @@ -4025,169 +3953,44 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" -glogg@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" - integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== dependencies: - sparkles "^1.0.0" + get-intrinsic "^1.1.3" -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.6: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +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== growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -gulp-babel@^6.1.3: - version "6.1.3" - resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-6.1.3.tgz#5aad8acb0db6b7f2f0be19eeee9528f2064df631" - integrity sha512-tm15R3rt4gO59WXCuqrwf4QXJM9VIJC+0J2NPYSC6xZn+cZRD5y5RPGAiHaDxCJq7Rz5BDljlrk3cEjWADF+wQ== - dependencies: - babel-core "^6.23.1" - object-assign "^4.0.1" - plugin-error "^1.0.1" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl-sourcemaps-apply "^0.2.0" - -gulp-cli@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.3.0.tgz#ec0d380e29e52aa45e47977f0d32e18fd161122f" - integrity sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A== - dependencies: - ansi-colors "^1.0.1" - archy "^1.0.0" - array-sort "^1.0.0" - color-support "^1.1.3" - concat-stream "^1.6.0" - copy-props "^2.0.1" - fancy-log "^1.3.2" - gulplog "^1.0.0" - interpret "^1.4.0" - isobject "^3.0.1" - liftoff "^3.1.0" - matchdep "^2.0.0" - mute-stdout "^1.0.0" - pretty-hrtime "^1.0.0" - replace-homedir "^1.0.0" - semver-greatest-satisfied-range "^1.1.0" - v8flags "^3.2.0" - yargs "^7.1.0" - -gulp-eslint@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/gulp-eslint/-/gulp-eslint-5.0.0.tgz#2a2684095f774b2cf79310262078c56cc7a12b52" - integrity sha512-9GUqCqh85C7rP9120cpxXuZz2ayq3BZc85pCTuPJS03VQYxne0aWPIXWx6LSvsGPa3uRqtSO537vaugOh+5cXg== - dependencies: - eslint "^5.0.1" - fancy-log "^1.3.2" - plugin-error "^1.0.1" - -gulp-istanbul@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/gulp-istanbul/-/gulp-istanbul-1.1.3.tgz#669a21516adb2540de798be26faee843ade8f20f" - integrity sha512-uMLSdqPDnBAV/B9rNyOgVMgrVC1tPbe+5GH6P13UOyxbRDT/w4sKYHWftPMA8j9om+NFvfeRlqpDXL2fixFWNA== - dependencies: - istanbul "^0.4.0" - istanbul-threshold-checker "^0.2.1" - lodash "^4.0.0" - plugin-error "^0.1.2" - through2 "^2.0.0" - vinyl-sourcemaps-apply "^0.2.1" - -gulp-load-plugins@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/gulp-load-plugins/-/gulp-load-plugins-2.0.4.tgz#e045c1af5238b31fb3e049abceae0d304f658132" - integrity sha512-pMvplJGBY0ej4q1yGTUUWY6CHd1cwOsf+0E+lsvR941CTASofYyrdJ3q8EgXY0wLHACWPrO0COsr1DFWJ7zzhg== - dependencies: - array-unique "^0.3.2" - fancy-log "^1.2.0" - findup-sync "^4.0.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - micromatch "^4.0.2" - resolve "^1.17.0" - -gulp-mocha@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/gulp-mocha/-/gulp-mocha-7.0.2.tgz#c7e13d133b3fde96d777e877f90b46225255e408" - integrity sha512-ZXBGN60TXYnFhttr19mfZBOtlHYGx9SvCSc+Kr/m2cMIGloUe176HBPwvPqlakPuQgeTGVRS47NmcdZUereKMQ== - dependencies: - dargs "^7.0.0" - execa "^2.0.4" - mocha "^6.2.0" - plugin-error "^1.0.1" - supports-color "^7.0.0" - through2 "^3.0.1" - -gulp-plumber@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/gulp-plumber/-/gulp-plumber-1.2.1.tgz#d38700755a300b9d372318e4ffb5ff7ced0b2c84" - integrity sha512-mctAi9msEAG7XzW5ytDVZ9PxWMzzi1pS2rBH7lA095DhMa6KEXjm+St0GOCc567pJKJ/oCvosVAZEpAey0q2eQ== - dependencies: - chalk "^1.1.3" - fancy-log "^1.3.2" - plugin-error "^0.1.2" - through2 "^2.0.3" - -gulp-rename@~1.2.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.2.3.tgz#37b75298e9d3e6c0fe9ac4eac13ce3be5434646b" - integrity sha512-CmdPM0BjJ105QCX1fk+j7NGhiN/1rCl9HLGss+KllBS/tdYadpjTxqdKyh/5fNV+M3yjT1MFz5z93bXdrTyzAw== - -gulp-uglify@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/gulp-uglify/-/gulp-uglify-3.0.2.tgz#5f5b2e8337f879ca9dec971feb1b82a5a87850b0" - integrity sha512-gk1dhB74AkV2kzqPMQBLA3jPoIAPd/nlNzP2XMDSG8XZrqnlCiDGAqC+rZOumzFvB5zOphlFh6yr3lgcAb/OOg== - dependencies: - array-each "^1.0.1" - extend-shallow "^3.0.2" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - isobject "^3.0.1" - make-error-cause "^1.1.1" - safe-buffer "^5.1.2" - through2 "^2.0.0" - uglify-js "^3.0.5" - vinyl-sourcemaps-apply "^0.2.0" - -gulp@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" - integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== - dependencies: - glob-watcher "^5.0.3" - gulp-cli "^2.2.0" - undertaker "^1.2.1" - vinyl-fs "^3.0.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= - dependencies: - glogg "^1.0.0" - -handlebars@^4.0.1: - version "4.7.7" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== har-validator@~5.1.3: version "5.1.5" @@ -4200,77 +4003,53 @@ har-validator@~5.1.3: has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== dependencies: ansi-regex "^2.0.0" -has-color@~0.1.0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" - integrity sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8= - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - integrity sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4= +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== dependencies: - sparkles "^1.0.0" + get-intrinsic "^1.1.1" -has-symbols@^1.0.0, has-symbols@^1.0.1: +has-proto@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" +has-symbols@^1.0.0, has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-value@^1.0.0: +has-tostringtag@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + has-symbols "^1.0.2" -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== has@^1.0.3: version "1.0.3" @@ -4296,13 +4075,13 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hasha@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/hasha/-/hasha-2.2.0.tgz#78d7cbfc1e6d66303fe79837365984517b2f6ee1" - integrity sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE= +hasha@^5.0.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/hasha/-/hasha-5.2.2.tgz#a48477989b3b327aea3c04f53096d816d97522a1" + integrity sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ== dependencies: - is-stream "^1.0.1" - pinkie-promise "^2.0.0" + is-stream "^2.0.0" + type-fest "^0.8.0" he@1.2.0: version "1.2.0" @@ -4312,42 +4091,39 @@ he@1.2.0: hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - -homedir-polyfill@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" - integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== - dependencies: - parse-passwd "^1.0.0" - -hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: +hosted-git-info@^2.1.4: version "2.8.9" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== +hosted-git-info@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== + dependencies: + lru-cache "^6.0.0" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" http-proxy@^1.18.1: version "1.18.1" @@ -4361,7 +4137,7 @@ http-proxy@^1.18.1: http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -4370,7 +4146,7 @@ http-signature@~1.2.0: https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== https-proxy-agent@^2.2.1: version "2.2.4" @@ -4380,13 +4156,18 @@ https-proxy-agent@^2.2.1: agent-base "^4.3.0" debug "^3.1.0" -https-proxy-agent@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz#b8c286433e87602311b01c8ea34413d856a4af81" - integrity sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg== +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== dependencies: - agent-base "^4.3.0" - debug "^3.1.0" + agent-base "6" + debug "4" + +human-signals@^4.3.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" + integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== husky@^1.3.1: version "1.3.1" @@ -4404,176 +4185,122 @@ husky@^1.3.1: run-node "^1.0.0" slash "^2.0.0" -iconv-lite@0.4.24, iconv-lite@^0.4.24: +iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - -iferr@^0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" - integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= +icss-utils@^5.0.0, icss-utils@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" + integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ieee754@^1.1.13, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.0.2, ignore@^5.1.1: - version "5.1.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" - integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== +ignore@^5.0.2, ignore@^5.1.1, ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== immediate@~3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= + integrity sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg== dependencies: caller-path "^2.0.0" resolve-from "^3.0.0" -import-fresh@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" - integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== +import-fresh@^3.0.0, 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== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" +import-local@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== indent-string@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== -infer-owner@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" - integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.0, inherits@~2.0.3, inherits@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@^1.3.4: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" - integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== - -inquirer@^6.2.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" - integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - -interpret@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== +internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== dependencies: - loose-envify "^1.0.0" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + get-intrinsic "^1.2.0" + has "^1.0.3" + side-channel "^1.0.4" -is-absolute@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" - integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== - dependencies: - is-relative "^1.0.0" - is-windows "^1.0.1" +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= +is-arguments@^1.0.4: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== dependencies: - kind-of "^3.0.2" + call-bind "^1.0.2" + has-tostringtag "^1.0.0" -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== dependencies: - kind-of "^6.0.0" - -is-arguments@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3" - integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA== + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== dependencies: - binary-extensions "^1.0.0" + has-bigints "^1.0.1" is-binary-path@~2.1.0: version "2.1.0" @@ -4582,20 +4309,23 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" is-buffer@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623" - integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A== + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.4, is-callable@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" - integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-ci@^2.0.0: version "2.0.0" @@ -4604,291 +4334,185 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== +is-core-module@^2.11.0, is-core-module@^2.5.0, is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== dependencies: - kind-of "^6.0.0" + has "^1.0.3" is-date-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" - integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" + has-tostringtag "^1.0.0" is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= + integrity sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw== is-docker@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-extglob@^2.1.0, is-extglob@^2.1.1: +is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-generator-function@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.7.tgz#d2132e529bb0000a7f80794d4bdf5cd5e5813522" - integrity sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw== - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" +is-fullwidth-code-point@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz#fae3167c729e7463f8461ce512b080a49268aa88" + integrity sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ== -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= +is-generator-function@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== dependencies: - is-extglob "^2.1.0" + has-tostringtag "^1.0.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" -is-negated-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" - integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= - -is-negative-zero@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" - integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= +is-nan@^1.2.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" + integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== dependencies: - kind-of "^3.0.2" + call-bind "^1.0.0" + define-properties "^1.1.3" -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= - -is-observable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" - integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== - dependencies: - symbol-observable "^1.1.0" - is-path-cwd@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== -is-path-inside@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" - integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= +is-path-inside@^3.0.1, is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== -is-regex@^1.1.0, is-regex@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" - integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: - has-symbols "^1.0.1" + isobject "^3.0.1" -is-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" - integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" -is-relative@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" - integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== dependencies: - is-unc-path "^1.0.0" + call-bind "^1.0.2" -is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" - integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== +is-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" + integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== -is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== dependencies: - has-symbols "^1.0.1" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + has-tostringtag "^1.0.0" -is-unc-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" - integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== dependencies: - unc-path-regex "^0.1.2" + has-symbols "^1.0.2" -is-utf8@^0.2.0, is-utf8@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= +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== + 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-valid-glob@^1.0.0: +is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" - integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" -is-windows@^1.0.1, is-windows@^1.0.2: +is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= - is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" @@ -4896,116 +4520,162 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@0.0.1: + version "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@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isbinaryfile@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.8.tgz#5d34b94865bd4946633ecc78a026fc76c5b11fcf" - integrity sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w== + version "4.0.10" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" + integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isobject@^3.0.0, isobject@^3.0.1: +isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isparta@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/isparta/-/isparta-4.1.1.tgz#c92e49672946914ec5407c801160f3374e0b7cb4" - integrity sha512-kGwkNqmALQzdfGhgo5o8kOA88p14R3Lwg0nfQ/qzv4IhB4rXarT9maPMaYbo6cms4poWbeulrlFlURLUR6rDwQ== - dependencies: - babel-core "^6.1.4" - escodegen "^1.6.1" - esprima "^4.0.0" - istanbul "0.4.5" - mkdirp "^0.5.0" - nomnomnomnom "^2.0.0" - object-assign "^4.0.1" - source-map "^0.5.0" - which "^1.0.9" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== -istanbul-threshold-checker@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/istanbul-threshold-checker/-/istanbul-threshold-checker-0.2.1.tgz#c5dc94e8f2cc5cd3ffd335452f84b553c4248331" - integrity sha1-xdyU6PLMXNP/0zVFL4S1U8QkgzE= - dependencies: - istanbul "~0.4.5" - lodash "~4.17.2" - -istanbul@0.4.5, istanbul@^0.4.0, istanbul@^0.4.5, istanbul@~0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" - -jest-get-type@^22.1.0: - version "22.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" - integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== - -jest-validate@^23.5.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" - integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== - dependencies: - chalk "^2.0.1" - jest-get-type "^22.1.0" - leven "^2.1.0" - pretty-format "^23.6.0" - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + +istanbul-lib-hook@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz#8f84c9434888cc6b1d0a9d7092a76d239ebf0cc6" + integrity sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ== + dependencies: + append-transform "^2.0.0" + +istanbul-lib-instrument@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" + integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== + dependencies: + "@babel/core" "^7.7.5" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" + +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +istanbul-lib-processinfo@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz#366d454cd0dcb7eb6e0e419378e60072c8626169" + integrity sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg== + dependencies: + archy "^1.0.0" + cross-spawn "^7.0.3" + istanbul-lib-coverage "^3.2.0" + p-map "^3.0.0" + rimraf "^3.0.0" + 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== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^3.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.0.2: + version "3.1.5" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" + integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + 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== + dependencies: + "@jest/types" "^29.5.0" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest-worker@^29.4.1: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" + integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== + dependencies: + "@types/node" "*" + jest-util "^29.5.0" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +js-sdsl@^4.1.4: + version "4.4.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.0.tgz#8b437dbe642daa95760400b602378ed8ffea8430" + integrity sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg== js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-xdr@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-1.1.4.tgz#678df4c6f8c7960de85bdf3bfa02b89df2730777" - integrity sha512-Xhwys9hyDZQDisxCKZi2nDhvGg6fKhsEgAUaJlzjwo32mZ2gZVIQl3+w4Le5SX5dsKDsboFdM2gnu5JALWetTg== + version "1.3.0" + resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-1.3.0.tgz#e72e77c00bbdae62689062b95fe35ae2bd90df32" + integrity sha512-fjLTm2uBtFvWsE3l2J14VjTuuB8vJfeTtYuNS7LiLHDWIX2kt0l1pqq9334F8kODUkKPMuULjEcbGbkFFwhx5g== dependencies: - cursor "^0.1.5" lodash "^4.17.5" long "^2.2.3" -js-yaml@3.13.1, js-yaml@^3.13.0, js-yaml@^3.7.0: +js-yaml@3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -5013,7 +4683,7 @@ js-yaml@3.13.1, js-yaml@^3.13.0, js-yaml@^3.7.0: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@3.x: +js-yaml@^3.13.1, js-yaml@^3.7.0: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -5021,13 +4691,12 @@ js-yaml@3.x: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.13.1: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: - argparse "^1.0.7" - esprima "^4.0.0" + argparse "^2.0.1" js2xmlparser@^4.0.2: version "4.0.2" @@ -5039,12 +4708,12 @@ js2xmlparser@^4.0.2: jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== jsdoc@^3.5.5: - version "3.6.10" - resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.10.tgz#dc903c44763b78afa7d94d63da475d20bc224cc4" - integrity sha512-IdQ8ppSo5LKZ9o3M+LKIIK8i00DIe5msDvG3G81Km+1dhy0XrOWD0Ji8H61ElgyEj/O9KRLokgKbAM9XX9CJAg== + version "3.6.11" + resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.11.tgz#8bbb5747e6f579f141a5238cbad4e95e004458ce" + integrity sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg== dependencies: "@babel/parser" "^7.9.4" "@types/markdown-it" "^12.2.3" @@ -5052,7 +4721,7 @@ jsdoc@^3.5.5: catharsis "^0.9.0" escape-string-regexp "^2.0.0" js2xmlparser "^4.0.2" - klaw "^4.0.1" + klaw "^3.0.0" markdown-it "^12.3.2" markdown-it-anchor "^8.4.1" marked "^4.0.10" @@ -5062,11 +4731,6 @@ jsdoc@^3.5.5: taffydb "2.6.2" underscore "~1.13.2" -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -5075,116 +4739,110 @@ jsesc@^2.5.1: jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: +json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== +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" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz#e06f23128e0bbe342dc996ed5a19e28b57b580e0" + integrity sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g== dependencies: - jsonify "~0.0.0" + jsonify "^0.0.1" json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" +json5@^2.1.2, json5@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== optionalDependencies: graceful-fs "^4.1.6" -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= +jsonify@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" + integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== dependencies: assert-plus "1.0.0" extsprintf "1.3.0" - json-schema "0.2.3" + json-schema "0.4.0" verror "1.10.0" -jszip@^3.2.2: - version "3.7.1" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.7.1.tgz#bd63401221c15625a1228c556ca8a68da6fda3d9" - integrity sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg== +jszip@^3.10.0: + version "3.10.1" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2" + integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g== dependencies: lie "~3.3.0" pako "~1.0.2" readable-stream "~2.3.6" - set-immediate-shim "~1.0.1" + setimmediate "^1.0.5" -just-debounce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea" - integrity sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= +just-extend@^4.0.2: + version "4.2.1" + resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744" + integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg== karma-chrome-launcher@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz#805a586799a4d05f4e54f72a204979f3f3066738" - integrity sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg== + version "3.1.1" + resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz#baca9cc071b1562a1db241827257bfe5cab597ea" + integrity sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ== dependencies: which "^1.2.1" karma-firefox-launcher@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-2.1.1.tgz#6457226f8e4f091b664cef79bb5d39bf1e008765" - integrity sha512-VzDMgPseXak9DtfyE1O5bB2BwsMy1zzO1kUxVW1rP0yhC4tDNJ0p3JoFdzvrK4QqVzdqUMa9Rx9YzkdFp8hz3Q== + version "2.1.2" + resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-2.1.2.tgz#9a38cc783c579a50f3ed2a82b7386186385cfc2d" + integrity sha512-VV9xDQU1QIboTrjtGVD4NCfzIH7n01ZXqy/qpBhnOeGVOkG5JYPEm8kuSd7psHE6WouZaQ9Ool92g8LFweSNMA== dependencies: is-wsl "^2.2.0" which "^2.0.1" @@ -5196,14 +4854,6 @@ karma-mocha@^2.0.0: dependencies: minimist "^1.2.3" -karma-phantomjs-launcher@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz#d23ca34801bda9863ad318e3bb4bd4062b13acd2" - integrity sha1-0jyjSAG9qYY60xjju0vUBisTrNI= - dependencies: - lodash "^4.0.1" - phantomjs-prebuilt "^2.1.7" - karma-sauce-launcher@2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" @@ -5218,27 +4868,24 @@ karma-sinon-chai@^2.0.2: resolved "https://registry.yarnpkg.com/karma-sinon-chai/-/karma-sinon-chai-2.0.2.tgz#e28c109b989973abafc28a7c9f09ef24a05e07c2" integrity sha512-SDgh6V0CUd+7ruL1d3yG6lFzmJNGRNQuEuCYXLaorruNP9nwQfA7hpsp4clx4CbOo5Gsajh3qUOT7CrVStUKMw== -karma-webpack@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/karma-webpack/-/karma-webpack-4.0.2.tgz#23219bd95bdda853e3073d3874d34447c77bced0" - integrity sha512-970/okAsdUOmiMOCY8sb17A2I8neS25Ad9uhyK3GHgmRSIFJbDcNEFE8dqqUhNe9OHiCC9k3DMrSmtd/0ymP1A== +karma-webpack@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/karma-webpack/-/karma-webpack-5.0.0.tgz#2a2c7b80163fe7ffd1010f83f5507f95ef39f840" + integrity sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA== dependencies: - clone-deep "^4.0.1" - loader-utils "^1.1.0" - neo-async "^2.6.1" - schema-utils "^1.0.0" - source-map "^0.7.3" - webpack-dev-middleware "^3.7.0" + glob "^7.1.3" + minimatch "^3.0.4" + webpack-merge "^4.1.5" -karma@^6.3.4: - version "6.3.16" - resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.16.tgz#76d1a705fd1cf864ee5ed85270b572641e0958ef" - integrity sha512-nEU50jLvDe5yvXqkEJRf8IuvddUkOY2x5Xc4WXHz6dxINgGDrgD2uqQWeVrJs4hbfNaotn+HQ1LZJ4yOXrL7xQ== +karma@^6.4.1: + version "6.4.1" + resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.1.tgz#f2253716dd3a41aaa813fa9f54b6ee047e1127d9" + integrity sha512-Cj57NKOskK7wtFWSlMvZf459iX+kpYIPXmkNUzP2WAFcA7nhr/ALn5R7sw3w+1udFDcpMx/tuB8d5amgm3ijaA== dependencies: + "@colors/colors" "1.5.0" body-parser "^1.19.0" braces "^3.0.2" chokidar "^3.5.1" - colors "1.4.0" connect "^3.7.0" di "^0.0.1" dom-serialize "^2.2.1" @@ -5254,104 +4901,31 @@ karma@^6.3.4: qjobs "^1.2.0" range-parser "^1.2.1" rimraf "^3.0.2" - socket.io "^4.2.0" + socket.io "^4.4.1" source-map "^0.6.1" tmp "^0.2.1" ua-parser-js "^0.7.30" yargs "^16.1.1" -kew@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b" - integrity sha1-edk9LTM2PW/dKXCzNdkUGtWR15s= - -kind-of@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-1.1.0.tgz#140a3d2d41a36d2efcfa9377b62c24f8495a5c44" - integrity sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ= - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0, kind-of@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: +kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - -klaw@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-4.0.1.tgz#8dc6f5723f05894e8e931b516a8ff15c2976d368" - integrity sha512-pgsE40/SvC7st04AHiISNewaIMUbY5V/K8b21ekiPiFoYs/EYSdsGa+FJArB1d441uq4Q8zZyIxvAzkGNlBdRw== - -last-run@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" - integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= - dependencies: - default-resolution "^2.0.0" - es6-weak-map "^2.0.1" - -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= - dependencies: - readable-stream "^2.0.5" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lcov-parse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" - integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= - -lead@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" - integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= +klaw@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-3.0.0.tgz#b11bec9cf2492f06756d6e809ab73a2910259146" + integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== dependencies: - flush-write-stream "^1.0.2" - -leven@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" - integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + graceful-fs "^4.1.9" -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" + prelude-ls "^1.2.1" + type-check "~0.4.0" lie@~3.3.0: version "3.3.0" @@ -5360,19 +4934,10 @@ lie@~3.3.0: dependencies: immediate "~3.0.5" -liftoff@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" - integrity sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog== - dependencies: - extend "^3.0.0" - findup-sync "^3.0.0" - fined "^1.0.1" - flagged-respawn "^1.0.0" - is-plain-object "^2.0.4" - object.map "^1.0.0" - rechoir "^0.6.2" - resolve "^1.1.7" +lilconfig@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" + integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== linkify-it@^3.0.1: version "3.0.3" @@ -5381,120 +4946,52 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -lint-staged@7.3.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.3.0.tgz#90ff33e5ca61ed3dbac35b6f6502dbefdc0db58d" - integrity sha512-AXk40M9DAiPi7f4tdJggwuKIViUplYtVj1os1MVEteW7qOkU50EOehayCfO9TsoGK24o/EsWb41yrEgfJDDjCw== - dependencies: - chalk "^2.3.1" - commander "^2.14.1" - cosmiconfig "^5.0.2" - debug "^3.1.0" - dedent "^0.7.0" - execa "^0.9.0" - find-parent-dir "^0.3.0" - is-glob "^4.0.0" - is-windows "^1.0.2" - jest-validate "^23.5.0" - listr "^0.14.1" - lodash "^4.17.5" - log-symbols "^2.2.0" - micromatch "^3.1.8" - npm-which "^3.0.1" - p-map "^1.1.1" - path-is-inside "^1.0.2" - pify "^3.0.0" - please-upgrade-node "^3.0.2" - staged-git-files "1.1.1" - string-argv "^0.0.2" - stringify-object "^3.2.2" - -listr-silent-renderer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" - integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= - -listr-update-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" - integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== - dependencies: - chalk "^1.1.3" - cli-truncate "^0.2.1" - elegant-spinner "^1.0.1" - figures "^1.7.0" - indent-string "^3.0.0" - log-symbols "^1.0.2" - log-update "^2.3.0" - strip-ansi "^3.0.1" - -listr-verbose-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" - integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== - dependencies: - chalk "^2.4.1" - cli-cursor "^2.1.0" - date-fns "^1.27.2" - figures "^2.0.0" - -listr@^0.14.1: - version "0.14.3" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" - integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== - dependencies: - "@samverschueren/stream-to-observable" "^0.3.0" - is-observable "^1.1.0" - is-promise "^2.1.0" - is-stream "^1.1.0" - listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.5.0" - listr-verbose-renderer "^0.5.0" - p-map "^2.0.0" - rxjs "^6.3.3" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= +lint-staged@^13.2.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.2.0.tgz#b7abaf79c91cd36d824f17b23a4ce5209206126a" + integrity sha512-GbyK5iWinax5Dfw5obm2g2ccUiZXNGtAS4mCbJ0Lv4rq6iEtfBSjOYdcbOtAIFtM114t0vdpViDDetjVTSd8Vw== dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" + chalk "5.2.0" + cli-truncate "^3.1.0" + commander "^10.0.0" + debug "^4.3.4" + execa "^7.0.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.1" -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= +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== dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" + cli-truncate "^2.1.0" + colorette "^2.0.19" + log-update "^4.0.0" + p-map "^4.0.0" + rfdc "^1.3.0" + rxjs "^7.8.0" + through "^2.3.8" + wrap-ansi "^7.0.0" -loader-runner@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" - integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== +loader-runner@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== -loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== +loader-utils@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" - json5 "^1.0.1" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" + json5 "^2.1.2" locate-path@^3.0.0: version "3.0.0" @@ -5511,33 +5008,38 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.clone@^4.3.2: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" - integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" -lodash.some@^4.2.2: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" - integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== + +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ== + +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.0.0, lodash@^4.0.1, lodash@^4.16.6, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.2: +lodash@^4.16.6, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-driver@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" - integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== - -log-symbols@2.2.0, log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - log-symbols@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" @@ -5545,57 +5047,38 @@ log-symbols@3.0.0: dependencies: chalk "^2.4.2" -log-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" - integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= - dependencies: - chalk "^1.0.0" - -log-update@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" - integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= +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== dependencies: - ansi-escapes "^3.0.0" - cli-cursor "^2.0.0" - wrap-ansi "^3.0.1" + ansi-escapes "^4.3.0" + cli-cursor "^3.1.0" + slice-ansi "^4.0.0" + wrap-ansi "^6.2.0" log4js@^6.4.1: - version "6.4.4" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.4.tgz#c9bc75569f3f40bba22fe1bd0677afa7a6a13bac" - integrity sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw== + version "6.9.1" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.9.1.tgz#aba5a3ff4e7872ae34f8b4c533706753709e38b6" + integrity sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g== dependencies: - date-format "^4.0.6" + date-format "^4.0.14" debug "^4.3.4" - flatted "^3.2.5" + flatted "^3.2.7" rfdc "^1.3.0" - streamroller "^3.0.6" - -lolex@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.3.2.tgz#7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31" - integrity sha1-fD2mL/yzDw9agKJWbKJORdigHzE= + streamroller "^3.1.5" long@^2.2.3: version "2.4.0" resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f" - integrity sha1-n6GAux2VAM3CnEFWdmoZleH0Uk8= - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" + integrity sha512-ijUtjmO/n2A5PaosNG9ZGDsQ3vxJg7ZW8vsY8Kp0f2yIZWhSJvjmegV7t+9RPQKxKrvj8yKGehhS+po14hPLGQ== -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== +loupe@^2.3.1: + version "2.3.6" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" + integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" + get-func-name "^2.0.0" lru-cache@^5.1.1: version "5.1.1" @@ -5604,7 +5087,14 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -make-dir@^2.0.0: +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== @@ -5612,41 +5102,22 @@ make-dir@^2.0.0: pify "^4.0.1" semver "^5.6.0" -make-error-cause@^1.1.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/make-error-cause/-/make-error-cause-1.2.2.tgz#df0388fcd0b37816dff0a5fb8108939777dcbc9d" - integrity sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0= +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: - make-error "^1.2.0" + semver "^6.0.0" -make-error@^1.2.0: +make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-iterator@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" - integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== - dependencies: - kind-of "^6.0.2" - -map-cache@^0.2.0, map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - markdown-it-anchor@^8.4.1: - version "8.4.1" - resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.4.1.tgz#29e560593f5edb80b25fdab8b23f93ef8a91b31e" - integrity sha512-sLODeRetZ/61KkKLJElaU3NuU2z7MhXf12Ml1WJMSdwpngeofneCRF+JBbat8HiSqhniOMuTemXMrsI7hA6XyA== + version "8.6.7" + resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz#ee6926daf3ad1ed5e4e3968b1740eef1c6399634" + integrity sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA== markdown-it@^12.3.2: version "12.3.2" @@ -5660,24 +5131,9 @@ markdown-it@^12.3.2: uc.micro "^1.0.5" marked@^4.0.10: - version "4.0.12" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.12.tgz#2262a4e6fd1afd2f13557726238b69a48b982f7d" - integrity sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ== - -matchdep@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" - integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= - dependencies: - findup-sync "^2.0.0" - micromatch "^3.0.4" - resolve "^1.4.0" - stack-trace "0.0.10" - -math-random@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" - integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== + version "4.3.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" + integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== md5.js@^1.3.4: version "1.3.5" @@ -5691,84 +5147,30 @@ md5.js@^1.3.4: mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -memory-fs@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - -memory-fs@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c" - integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" + integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" - integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" +merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== +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== dependencies: - braces "^3.0.1" - picomatch "^2.0.5" + braces "^3.0.2" + picomatch "^2.3.1" miller-rabin@^4.0.0: version "4.0.1" @@ -5778,49 +5180,37 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@~2.1.24: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== +mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" -mime@^2.4.4, mime@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" - integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== +mime@^2.5.2: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" + integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== + minami@^1.1.1: version "1.2.3" resolved "https://registry.yarnpkg.com/minami/-/minami-1.2.3.tgz#99b6dcdfb2f0a54da1c9c8f7aa3a327787aaf9f8" - integrity sha1-mbbc37LwpU2hycj3qjoyd4eq+fg= + integrity sha512-3f2QqqbUC1usVux0FkQMFYB73yd9JIxmHSn1dWQacizL6hOUaNu6mA3KxZ9SfiCc4qgcgq+5XP59+hP7URa1Dw== minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" @@ -5830,50 +5220,46 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.4: +minimatch@3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -mississippi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" - integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== +minipass@^3.0.0, minipass@^3.1.1: + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== dependencies: - concat-stream "^1.5.0" - duplexify "^3.4.2" - end-of-stream "^1.1.0" - flush-write-stream "^1.0.0" - from2 "^2.1.0" - parallel-transform "^1.1.0" - pump "^3.0.0" - pumpify "^1.3.3" - stream-each "^1.1.0" - through2 "^2.0.0" + yallist "^4.0.0" -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" +minipass@^4.0.0: + version "4.2.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.5.tgz#9e0e5256f1e3513f8c34691dd68549e85b2c8ceb" + integrity sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q== -mkdirp@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" - integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== +minizlib@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== dependencies: - minimist "^1.2.5" + minipass "^3.0.0" + yallist "^4.0.0" mkdirp@0.5.5: version "0.5.5" @@ -5882,46 +5268,27 @@ mkdirp@0.5.5: dependencies: minimist "^1.2.5" -mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5: +"mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@^0.5.5: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== dependencies: minimist "^1.2.6" -mkdirp@^1.0.4: +mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mocha@^6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" - integrity sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg== +mocha-loader@^5.1.5: + version "5.1.5" + resolved "https://registry.yarnpkg.com/mocha-loader/-/mocha-loader-5.1.5.tgz#40e9163a17e4662e5d8851de93dca509fe4b5455" + integrity sha512-NfcFycKc9uAWmkLos/azir6XQknrzebY5qjEEyFhd423bVNkCoAbgaRmiV75j0nufmkZTCDBhm8NJ8WlTNbAQQ== dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.4" - ms "2.1.1" - node-environment-flags "1.0.5" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" + css-loader "^5.0.0" + loader-utils "^2.0.0" + schema-utils "^3.0.0" + style-loader "^2.0.0" mocha@^7.1.1: version "7.2.0" @@ -5953,104 +5320,66 @@ mocha@^7.1.1: yargs-parser "13.1.2" yargs-unparser "1.6.0" -move-concurrently@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" - integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= - dependencies: - aproba "^1.1.1" - copy-concurrently "^1.0.0" - fs-write-stream-atomic "^1.0.8" - mkdirp "^0.5.1" - rimraf "^2.5.4" - run-queue "^1.0.3" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== ms@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -ms@2.1.2, ms@^2.1.1: +ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -multi-glob@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/multi-glob/-/multi-glob-1.0.2.tgz#95cb3bbdd6275f115bb012842eb191cbb8b55e38" - integrity sha512-sUBlFqEARG0FhuI7dELtmLmC+vGHz0supHIMntXazUjzV7hV34dK7LXWtpgD/L29tHsWoui91pLD+vjRnk6PVw== - dependencies: - glob "5.x" +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -mute-stdout@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" - integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -nan@^2.12.1: - version "2.14.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" - integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" +nanoid@^3.3.4: + version "3.3.6" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" + integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== + +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== -neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1: +neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -next-tick@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-environment-flags@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== +nise@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.4.tgz#491ce7e7307d4ec546f5a659b2efe94a18b4bbc0" + integrity sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg== dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" + "@sinonjs/commons" "^2.0.0" + "@sinonjs/fake-timers" "^10.0.2" + "@sinonjs/text-encoding" "^0.7.1" + just-extend "^4.0.2" + path-to-regexp "^1.7.0" node-environment-flags@1.0.6: version "1.0.6" @@ -6061,55 +5390,54 @@ node-environment-flags@1.0.6: semver "^5.7.0" node-gyp-build@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" - integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== + 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== -node-libs-browser@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" - integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== +node-polyfill-webpack-plugin@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz#141d86f177103a8517c71d99b7c6a46edbb1bb58" + integrity sha512-ZUMiCnZkP1LF0Th2caY6J/eKKoA0TefpoVa68m/LQU1I/mE8rGt4fNYGgNuCcK+aG8P8P43nbeJ2RqJMOL/Y1A== dependencies: - assert "^1.1.1" + assert "^2.0.0" browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" + buffer "^6.0.3" + console-browserify "^1.2.0" constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" + crypto-browserify "^3.12.0" + domain-browser "^4.22.0" + events "^3.3.0" + filter-obj "^2.0.2" https-browserify "^1.0.0" os-browserify "^0.3.0" - path-browserify "0.0.1" + path-browserify "^1.0.1" process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" + punycode "^2.1.1" + querystring-es3 "^0.2.1" + readable-stream "^4.0.0" + stream-browserify "^3.0.0" + stream-http "^3.2.0" + string_decoder "^1.3.0" + timers-browserify "^2.0.12" + tty-browserify "^0.0.1" + type-fest "^2.14.0" url "^0.11.0" - util "^0.11.0" - vm-browserify "^1.0.1" + util "^0.12.4" + vm-browserify "^1.1.2" -nomnomnomnom@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/nomnomnomnom/-/nomnomnomnom-2.0.1.tgz#b2239f031c8d04da67e32836e1e3199e12f7a8e2" - integrity sha1-siOfAxyNBNpn4yg24eMZnhL3qOI= +node-preload@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301" + integrity sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ== dependencies: - chalk "~0.4.0" - underscore "~1.6.0" + process-on-spawn "^1.0.0" -nopt@3.x: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= - dependencies: - abbrev "1" +node-releases@^2.0.8: + version "2.0.10" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" + integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== -normalize-package-data@^2.3.2, "normalize-package-data@~1.0.1 || ^2.0.0": +normalize-package-data@^2.3.2: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -6119,83 +5447,43 @@ normalize-package-data@^2.3.2, "normalize-package-data@~1.0.1 || ^2.0.0": semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= +"normalize-package-data@~1.0.1 || ^2.0.0 || ^3.0.0": + version "3.0.3" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" + integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== dependencies: - remove-trailing-separator "^1.0.1" + hosted-git-info "^4.0.1" + is-core-module "^2.5.0" + semver "^7.3.4" + validate-npm-package-license "^3.0.1" normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -now-and-later@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" - integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== - dependencies: - once "^1.3.2" - -"npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0": - version "6.1.1" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.1.tgz#02168cb0a49a2b75bf988a28698de7b529df5cb7" - integrity sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg== +"npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^8.0.0": + version "8.1.5" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" + integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== dependencies: - hosted-git-info "^2.7.1" - osenv "^0.1.5" - semver "^5.6.0" + hosted-git-info "^4.0.1" + semver "^7.3.4" validate-npm-package-name "^3.0.0" -npm-path@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" - integrity sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw== - dependencies: - which "^1.2.10" - -npm-registry-client@^8.6.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-8.6.0.tgz#7f1529f91450732e89f8518e0f21459deea3e4c4" - integrity sha512-Qs6P6nnopig+Y8gbzpeN/dkt+n7IyVd8f45NTMotGk6Qo7GfBmzwYx6jRLoOOgKiMnaQfYxsuyQlD8Mc3guBhg== - dependencies: - concat-stream "^1.5.2" - graceful-fs "^4.1.6" - normalize-package-data "~1.0.1 || ^2.0.0" - npm-package-arg "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" - once "^1.3.3" - request "^2.74.0" - retry "^0.10.0" - safe-buffer "^5.1.1" - semver "2 >=2.2.1 || 3.x || 4 || 5" - slide "^1.1.3" - ssri "^5.2.4" - optionalDependencies: - npmlog "2 || ^3.1.0 || ^4.0.0" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== dependencies: path-key "^2.0.0" -npm-run-path@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-3.1.0.tgz#7f91be317f6a466efed3c9f2980ad8a4ee8b0fa5" - integrity sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg== - dependencies: - path-key "^3.0.0" - -npm-which@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" - integrity sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo= +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" + integrity sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q== dependencies: - commander "^2.9.0" - npm-path "^2.0.2" - which "^1.2.10" + path-key "^4.0.0" "npmlog@2 || ^3.1.0 || ^4.0.0": version "4.1.2" @@ -6210,44 +5498,69 @@ npm-which@^3.0.1: number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== + +nyc@^15.1.0: + version "15.1.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-15.1.0.tgz#1335dae12ddc87b6e249d5a1994ca4bdaea75f02" + integrity sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A== + dependencies: + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + caching-transform "^4.0.0" + convert-source-map "^1.7.0" + decamelize "^1.2.0" + find-cache-dir "^3.2.0" + find-up "^4.1.0" + foreground-child "^2.0.0" + get-package-type "^0.1.0" + glob "^7.1.6" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-hook "^3.0.0" + istanbul-lib-instrument "^4.0.0" + istanbul-lib-processinfo "^2.0.2" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + make-dir "^3.0.0" + node-preload "^0.2.1" + p-map "^3.0.0" + process-on-spawn "^1.0.0" + resolve-from "^5.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + spawn-wrap "^2.0.0" + test-exclude "^6.0.0" + yargs "^15.0.2" oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" +object-inspect@^1.12.3, object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -object-inspect@^1.7.0, object-inspect@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" - integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== +object-is@^1.0.1: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.0.11, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - object.assign@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" @@ -6258,187 +5571,100 @@ object.assign@4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" -object.assign@^4.0.4, object.assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.1.tgz#303867a666cdd41936ecdedfb1f8f3e32a478cdd" - integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== +object.assign@^4.1.2, object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== dependencies: - define-properties "^1.1.3" - es-abstract "^1.18.0-next.0" - has-symbols "^1.0.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" object-keys "^1.1.1" -object.defaults@^1.0.0, object.defaults@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" - integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= - dependencies: - array-each "^1.0.1" - array-slice "^1.0.0" - for-own "^1.0.0" - isobject "^3.0.0" - -object.entries@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.1.tgz#ee1cf04153de02bb093fec33683900f57ce5399b" - integrity sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ== +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== dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - function-bind "^1.1.1" - has "^1.0.3" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" object.getownpropertydescriptors@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" - integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - -object.map@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" - integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.2.0, object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + version "2.1.5" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz#db5a9002489b64eef903df81d6623c07e5b4b4d3" + integrity sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw== dependencies: - isobject "^3.0.1" + array.prototype.reduce "^1.0.5" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" -object.reduce@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" - integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= +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== dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" -object.values@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" - integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - function-bind "^1.1.1" - has "^1.0.3" + ee-first "1.1.1" on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww== dependencies: ee-first "1.1.1" -once@1.x, once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.3.3, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - onetime@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" - integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" -optionator@^0.8.1, optionator@^0.8.2: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== +onetime@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" + integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" + mimic-fn "^4.0.0" -ordered-read-streams@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" - integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== dependencies: - readable-stream "^2.0.1" + 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" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -osenv@^0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -output-file-sync@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" + integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-finally@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" - integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" + integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" @@ -6447,12 +5673,12 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: - p-limit "^1.1.0" + yocto-queue "^0.1.0" p-locate@^3.0.0: version "3.0.0" @@ -6468,15 +5694,12 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-map@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" - integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== - -p-map@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" - integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" p-map@^3.0.0: version "3.0.0" @@ -6485,30 +5708,33 @@ p-map@^3.0.0: dependencies: aggregate-error "^3.0.0" -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= +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" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-hash@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-4.0.0.tgz#3537f654665ec3cc38827387fc904c163c54f506" + integrity sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ== + dependencies: + graceful-fs "^4.1.15" + hasha "^5.0.0" + lodash.flattendeep "^4.4.0" + release-zalgo "^1.0.0" + pako@~1.0.2, pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== -parallel-transform@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.2.0.tgz#9049ca37d6cb2182c3b1d2c720be94d14a5814fc" - integrity sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg== - dependencies: - cyclist "^1.0.1" - inherits "^2.0.3" - readable-stream "^2.1.5" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -6527,154 +5753,85 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-filepath@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" - integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= - dependencies: - is-absolute "^1.0.0" - map-cache "^0.2.0" - path-root "^0.1.1" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= - dependencies: - error-ex "^1.2.0" - parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== dependencies: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" -parse-node-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" - integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== - -parse-passwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" - integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= - parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== parsimmon@^1.13.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/parsimmon/-/parsimmon-1.16.0.tgz#2834e3db645b6a855ab2ea14fbaad10d82867e0f" - integrity sha512-tekGDz2Lny27SQ/5DzJdIK0lqsWwZ667SCLFIDCxaZM7VNgQjyKLbaL7FYPKpbjdxNAXFV/mSxkq5D2fnkW4pA== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" - integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + version "1.18.1" + resolved "https://registry.yarnpkg.com/parsimmon/-/parsimmon-1.18.1.tgz#d8dd9c28745647d02fc6566f217690897eed7709" + integrity sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw== -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= - dependencies: - pinkie-promise "^2.0.0" +path-browserify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: +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 sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== -path-key@^3.0.0, path-key@^3.1.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== -path-parse@^1.0.6: +path-key@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" + integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== + +path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-root-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" - integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= - -path-root@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" - integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= - dependencies: - path-root-regex "^0.1.0" - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -path-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= +path-to-regexp@^1.7.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" + integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== dependencies: - pify "^2.0.0" + isarray "0.0.1" path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + pbkdf2@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" - integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -6682,126 +5839,116 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== -phantomjs-prebuilt@^2.1.7: - version "2.1.16" - resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz#efd212a4a3966d3647684ea8ba788549be2aefef" - integrity sha1-79ISpKOWbTZHaE6ouniFSb4q7+8= - dependencies: - es6-promise "^4.0.3" - extract-zip "^1.6.5" - fs-extra "^1.0.0" - hasha "^2.2.0" - kew "^0.7.0" - progress "^1.1.8" - request "^2.81.0" - request-progress "^2.0.1" - which "^1.2.10" - -picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +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== pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== pify@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= - dependencies: - find-up "^1.0.0" - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" +pirates@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== dependencies: - find-up "^3.0.0" + find-up "^3.0.0" + +pkg-dir@^4.1.0, pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" -please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: +please-upgrade-node@^3.1.1: version "3.2.0" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== dependencies: semver-compare "^1.0.0" -plugin-error@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-0.1.2.tgz#3b9bb3335ccf00f425e07437e19276967da47ace" - integrity sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4= +postcss-modules-extract-imports@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" + integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== + +postcss-modules-local-by-default@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" + integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== dependencies: - ansi-cyan "^0.1.1" - ansi-red "^0.1.1" - arr-diff "^1.0.1" - arr-union "^2.0.1" - extend-shallow "^1.1.2" + icss-utils "^5.0.0" + postcss-selector-parser "^6.0.2" + postcss-value-parser "^4.1.0" -plugin-error@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" - integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA== +postcss-modules-scope@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" + integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== dependencies: - ansi-colors "^1.0.1" - arr-diff "^4.0.0" - arr-union "^3.1.0" - extend-shallow "^3.0.2" + postcss-selector-parser "^6.0.4" -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= +postcss-modules-values@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" + integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== + dependencies: + icss-utils "^5.0.0" -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= +postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: + version "6.0.11" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" + integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= +postcss-value-parser@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + +postcss@^8.2.15: + version "8.4.21" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" + integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier-linter-helpers@^1.0.0: version "1.0.0" @@ -6815,63 +5962,27 @@ prettier@^1.16.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== -pretty-format@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" - integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" - -pretty-hrtime@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= - -private@^0.1.6, private@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: +process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== +process-on-spawn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/process-on-spawn/-/process-on-spawn-1.0.0.tgz#95b05a23073d30a17acfdc92a440efd2baefdc93" + integrity sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg== + dependencies: + fromentries "^1.2.0" + process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" - integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -promise-inflight@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== public-encrypt@^4.0.0: version "4.0.3" @@ -6885,14 +5996,6 @@ public-encrypt@^4.0.0: randombytes "^2.0.1" safe-buffer "^5.1.2" -pump@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" - integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" @@ -6901,63 +6004,47 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -pumpify@^1.3.3, pumpify@^1.3.5: - version "1.5.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" - integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== - dependencies: - duplexify "^3.6.0" - inherits "^2.0.3" - pump "^2.0.0" - punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@^1.2.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== qjobs@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== -querystring-es3@^0.2.0: +querystring-es3@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= + integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" @@ -6979,63 +6066,29 @@ range-parser@^1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: - bytes "3.1.0" - http-errors "1.7.2" + bytes "3.1.2" + http-errors "2.0.0" iconv-lite "0.4.24" unpipe "1.0.0" -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= - dependencies: - find-up "^2.0.0" - read-pkg "^2.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= - dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" - read-pkg@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" - integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= + integrity sha512-+UBirHHDm5J+3WDmLBZYSklRYg82nMlz+enn+GMZ22nSR2f4bzxmhso6rzQW/3mT2PVzpzDTiYIZahk8UmZ44w== dependencies: normalize-package-data "^2.3.2" parse-json "^4.0.0" pify "^3.0.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== +readable-stream@^2.0.6, readable-stream@~2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -7045,23 +6098,24 @@ read-pkg@^4.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== +readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" util-deprecate "^1.0.1" -readdirp@^2.0.0, readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== +readable-stream@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.3.0.tgz#0914d0c72db03b316c9733bb3461d64a3cc50cba" + integrity sha512-MuEnA0lbSi7JS8XM+WNJlWZkHAAdm7gETHdFK//Q/mChGyj2akEFtdLZh32jSdkWGbRwCW9pn6g3LWDdDeZnBQ== dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" + abort-controller "^3.0.0" + buffer "^6.0.3" + events "^3.3.0" + process "^0.11.10" readdirp@~3.2.0: version "3.2.0" @@ -7077,144 +6131,78 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== dependencies: - resolve "^1.1.6" - -regenerate@^1.2.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" - integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== + resolve "^1.20.0" -regenerator-runtime@^0.10.5: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= +regenerate-unicode-properties@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" + integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== + dependencies: + regenerate "^1.4.2" -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== +regenerate@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" +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== -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== +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== dependencies: - is-equal-shallow "^0.1.3" + "@babel/runtime" "^7.8.4" -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== +regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= +regexpu-core@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" + integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= + "@babel/regjsgen" "^0.8.0" + regenerate "^1.4.2" + regenerate-unicode-properties "^10.1.0" + regjsparser "^0.9.1" + unicode-match-property-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= +regjsparser@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" + integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== dependencies: jsesc "~0.5.0" -remove-bom-buffer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" - integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== - dependencies: - is-buffer "^1.1.5" - is-utf8 "^0.2.1" - -remove-bom-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" - integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= - dependencies: - remove-bom-buffer "^3.0.0" - safe-buffer "^5.1.0" - through2 "^2.0.3" - -remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - -replace-ext@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" - integrity sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ= - -replace-ext@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" - integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= - -replace-homedir@^1.0.0: +release-zalgo@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" - integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= - dependencies: - homedir-polyfill "^1.0.1" - is-absolute "^1.0.0" - remove-trailing-separator "^1.1.0" - -request-progress@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-2.0.1.tgz#5d36bb57961c673aa5b788dbc8141fdf23b44e08" - integrity sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg= + resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" + integrity sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA== dependencies: - throttleit "^1.0.0" + es6-error "^4.0.1" -request@^2.74.0, request@^2.81.0, request@^2.88.2: +request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -7243,12 +6231,12 @@ request@^2.74.0, request@^2.81.0, request@^2.88.2: require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== require-main-filename@^2.0.0: version "2.0.0" @@ -7258,81 +6246,58 @@ require-main-filename@^2.0.0: requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== requizzle@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.3.tgz#4675c90aacafb2c036bd39ba2daa4a1cb777fded" - integrity sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ== + version "0.2.4" + resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.4.tgz#319eb658b28c370f0c20f968fa8ceab98c13d27c" + integrity sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw== dependencies: - lodash "^4.17.14" + lodash "^4.17.21" -resolve-dir@^1.0.0, resolve-dir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" - integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== dependencies: - expand-tilde "^2.0.0" - global-modules "^1.0.0" + resolve-from "^5.0.0" resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= + integrity sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw== resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve-options@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" - integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= - dependencies: - value-or-function "^3.0.0" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.x: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - -resolve@^1.1.0, resolve@^1.3.2, resolve@^1.8.1: - version "1.16.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.16.1.tgz#49fac5d8bacf1fd53f200fa51247ae736175832c" - integrity sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig== - dependencies: - path-parse "^1.0.6" +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.4.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== +resolve@^1.10.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.3.2, resolve@^1.8.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== dependencies: - path-parse "^1.0.6" + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= +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== dependencies: - onetime "^2.0.0" + onetime "^5.1.0" signal-exit "^3.0.2" -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -retry@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" - integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== reusify@^1.0.4: version "1.0.4" @@ -7344,20 +6309,13 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== -rimraf@2, rimraf@^2.5.4, rimraf@^2.6.3, rimraf@^2.7.1: +rimraf@2, rimraf@^2.5.4: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -7373,38 +6331,26 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -run-async@^2.2.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.0.tgz#e59054a5b86876cfae07f431d18cbaddc594f1e8" - integrity sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg== - dependencies: - is-promise "^2.1.0" - run-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A== run-parallel@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" - integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== - -run-queue@^1.0.0, run-queue@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" - integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== dependencies: - aproba "^1.1.1" + queue-microtask "^1.2.2" -rxjs@^6.3.3, rxjs@^6.4.0: - version "6.5.5" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" - integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== +rxjs@^7.8.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" + integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== dependencies: - tslib "^1.9.0" + tslib "^2.1.0" -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.0: +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" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -7414,36 +6360,28 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== dependencies: - ret "~0.1.10" + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -samsam@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.2.tgz#bec11fdc83a9fda063401210e40176c3024d1567" - integrity sha1-vsEf3IOp/aBjQBIQ5AF2wwJNFWc= - -samsam@~1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.3.tgz#9f5087419b4d091f232571e7fa52e90b0f552621" - integrity sha1-n1CHQZtNCR8jJXHn+lLpCw9VJiE= - sauce-connect-launcher@^1.2.4: - version "1.3.1" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.3.1.tgz#31137f57b0f7176e1c0525b7fb09c6da746647cf" - integrity sha512-vIf9qDol3q2FlYzrKt0dr3kvec6LSjX2WS+/mVnAJIhqh1evSkPKCR2AzcJrnSmx9Xt9PtV0tLY7jYh0wsQi8A== + version "1.3.2" + resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.3.2.tgz#dfc675a258550809a8eaf457eb9162b943ddbaf0" + integrity sha512-wf0coUlidJ7rmeClgVVBh6Kw55/yalZCY/Un5RgjSnTXRAeGqagnTsTYpZaqC4dCtrY4myuYpOAZXCdbO7lHfQ== dependencies: adm-zip "~0.4.3" async "^2.1.2" - https-proxy-agent "^3.0.0" + https-proxy-agent "^5.0.0" lodash "^4.16.6" rimraf "^2.5.4" @@ -7454,82 +6392,77 @@ saucelabs@^1.5.0: dependencies: https-proxy-agent "^2.2.1" -schema-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" - integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== +schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +schema-utils@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7" + integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== dependencies: - ajv "^6.1.0" - ajv-errors "^1.0.0" - ajv-keywords "^3.1.0" + "@types/json-schema" "^7.0.9" + ajv "^8.8.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.0.0" selenium-webdriver@^4.0.0-alpha.1: - version "4.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.7.tgz#e3879d8457fd7ad8e4424094b7dc0540d99e6797" - integrity sha512-D4qnTsyTr91jT8f7MfN+OwY0IlU5+5FmlO5xlgRUV6hDEV8JyYx2NerdTEqDDkNq7RZDYc4VoPALk8l578RBHw== + version "4.8.2" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.8.2.tgz#2e7cb452133f7a6859879575852ef29f0ab4668c" + integrity sha512-d2dcpDLPcXlBy5qcPtB1B8RYTtj1N+JiHQLViFx3OP+i5hqkAuqTfJEYUh4qNX11S4NvbxjteiwN3OPwK3vPVw== dependencies: - jszip "^3.2.2" - rimraf "^2.7.1" - tmp "0.0.30" + jszip "^3.10.0" + tmp "^0.2.1" + ws ">=8.11.0" semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== -semver-greatest-satisfied-range@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" - integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= +"semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: - sver-compat "^1.5.0" + lru-cache "^6.0.0" -"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.2.0: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== +serialize-javascript@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" + integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== dependencies: randombytes "^2.1.0" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-immediate-shim@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -setimmediate@^1.0.4: +setimmediate@^1.0.4, setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== sha.js@^2.3.6, sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" @@ -7549,7 +6482,7 @@ shallow-clone@^3.0.0: shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== dependencies: shebang-regex "^1.0.0" @@ -7563,37 +6496,43 @@ shebang-command@^2.0.0: shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" -sinon-chai@^2.7.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-2.14.0.tgz#da7dd4cc83cd6a260b67cca0f7a9fdae26a1205d" - integrity sha512-9stIF1utB0ywNHNT7RgiXbdmen8QDCRsrTjw+G9TgKt1Yexjiv8TOWZ6WHsTPz57Yky3DIswZvEqX8fpuHNDtQ== +signal-exit@^3.0.0, signal-exit@^3.0.2, 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== -sinon@^1.14.1: - version "1.17.7" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-1.17.7.tgz#4542a4f49ba0c45c05eb2e9dd9d203e2b8efe0bf" - integrity sha1-RUKk9JugxFwF6y6d2dID4rjv4L8= - dependencies: - formatio "1.1.1" - lolex "1.3.2" - samsam "1.1.2" - util ">=0.10.3 <1" +sinon-chai@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-3.7.0.tgz#cfb7dec1c50990ed18c153f1840721cf13139783" + integrity sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g== -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= +sinon@^15.0.3: + version "15.0.3" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-15.0.3.tgz#38005fcd80827177b6aa0245f82401d9ec88994b" + integrity sha512-si3geiRkeovP7Iel2O+qGL4NrO9vbMf3KsrJEi0ghP1l5aBkB5UxARea5j0FUsSqH3HLBh0dQPAyQ8fObRUqHw== + dependencies: + "@sinonjs/commons" "^3.0.0" + "@sinonjs/fake-timers" "^10.0.2" + "@sinonjs/samsam" "^8.0.0" + diff "^5.1.0" + nise "^5.1.4" + supports-color "^7.2.0" slash@^2.0.0: version "2.0.0" @@ -7605,112 +6544,77 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= +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@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== +slice-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" + integrity sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" + ansi-styles "^6.0.0" + is-fullwidth-code-point "^4.0.0" -slide@^1.1.3: +slide@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" - integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + integrity sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw== -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== +socket.io-adapter@~2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz#5de9477c9182fdc171cd8c8364b9a8894ec75d12" + integrity sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA== dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -socket.io-adapter@~2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz#4d6111e4d42e9f7646e365b4f578269821f13486" - integrity sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ== + ws "~8.11.0" -socket.io-parser@~4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.0.4.tgz#9ea21b0d61508d18196ef04a2c6b9ab630f4c2b0" - integrity sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g== +socket.io-parser@~4.2.1: + version "4.2.2" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.2.tgz#1dd384019e25b7a3d374877f492ab34f2ad0d206" + integrity sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw== dependencies: - "@types/component-emitter" "^1.2.10" - component-emitter "~1.3.0" + "@socket.io/component-emitter" "~3.1.0" debug "~4.3.1" -socket.io@^4.2.0: - version "4.4.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.4.1.tgz#cd6de29e277a161d176832bb24f64ee045c56ab8" - integrity sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg== +socket.io@^4.4.1: + version "4.6.1" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.6.1.tgz#62ec117e5fce0692fa50498da9347cfb52c3bc70" + integrity sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA== dependencies: accepts "~1.3.4" base64id "~2.0.0" debug "~4.3.2" - engine.io "~6.1.0" - socket.io-adapter "~2.3.3" - socket.io-parser "~4.0.4" + engine.io "~6.4.1" + socket.io-adapter "~2.5.2" + socket.io-parser "~4.2.1" sodium-native@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-3.3.0.tgz#50ee52ac843315866cce3d0c08ab03eb78f22361" - integrity sha512-rg6lCDM/qa3p07YGqaVD+ciAbUqm6SoO4xmlcfkbU5r1zIGrguXztLiEtaLYTV5U6k8KSIUFmnU3yQUSKmf6DA== + version "3.4.1" + resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-3.4.1.tgz#44616c07ccecea15195f553af88b3e574b659741" + integrity sha512-PaNN/roiFWzVVTL6OqjzYct38NSXewdl2wz8SRB51Br/MLIJPrbM3XexhVWkq7D3UWMysfrhKVf1v1phZq6MeQ== dependencies: node-gyp-build "^4.3.0" -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map-support@~0.5.12: +source-map-support@^0.5.16, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -7718,54 +6622,32 @@ source-map-support@~0.5.12: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@0.4.x: - version "0.4.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" - integrity sha1-66T12pwNyZneaAMti092FzZSA2s= - dependencies: - amdefine ">=0.0.4" - -source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.6, source-map@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -source-map@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= - dependencies: - amdefine ">=0.0.4" - -sparkles@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" - integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== - spawn-command@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" - integrity sha1-lUThpDygRfhTGqwaSMspva5iM44= + integrity sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ== + +spawn-wrap@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" + integrity sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg== + dependencies: + foreground-child "^2.0.0" + is-windows "^1.0.2" + make-dir "^3.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + which "^2.0.1" spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + version "3.2.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" @@ -7784,26 +6666,19 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.6" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz#c80757383c28abf7296744998cbc106ae8b854ce" - integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" + version "3.0.13" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" + integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -7815,104 +6690,65 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" -ssri@^5.2.4: - version "5.3.0" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.3.0.tgz#ba3872c9c6d33a0704a7d71ff045e5ec48999d06" - integrity sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ== - dependencies: - safe-buffer "^5.1.1" - -ssri@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5" - integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q== +ssri@^8.0.0: + version "8.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" + integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== dependencies: - figgy-pudding "^3.5.1" - -stack-trace@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= + minipass "^3.1.1" -staged-git-files@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" - integrity sha512-H89UNKr1rQJvI1c/PIR3kiAMBV23yvR7LItZiV74HWZwzt7f3YHuujJ9nJZlt58WlFox7XQsOahexwk7nTe69A== - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: +statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -stream-browserify@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" - integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== -stream-each@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" - integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== +stream-browserify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" + integrity sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA== dependencies: - end-of-stream "^1.1.0" - stream-shift "^1.0.0" - -stream-exhaust@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" - integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== + inherits "~2.0.4" + readable-stream "^3.5.0" -stream-http@^2.7.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== +stream-http@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" + integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== dependencies: builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== + inherits "^2.0.4" + readable-stream "^3.6.0" + xtend "^4.0.2" -streamroller@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.6.tgz#52823415800ded79a49aa3f7712f50a422b97493" - integrity sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg== +streamroller@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.1.5.tgz#1263182329a45def1ffaef58d31b15d13d2ee7ff" + integrity sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw== dependencies: - date-format "^4.0.6" + date-format "^4.0.14" debug "^4.3.4" - fs-extra "^10.0.1" + fs-extra "^8.1.0" -string-argv@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" - integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= +string-argv@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== -string-width@^1.0.1, string-width@^1.0.2: +string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2": version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -7920,6 +6756,15 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -7929,32 +6774,43 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== +string-width@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" -string.prototype.trimend@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" - integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== +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== dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" -string.prototype.trimstart@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" - integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== +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== dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +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== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" -string_decoder@^1.0.0, string_decoder@^1.1.1: +string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -7968,26 +6824,17 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringify-object@^3.2.2: - version "3.3.0" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" - integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== - dependencies: - get-own-enumerable-property-symbols "^3.0.0" - is-obj "^1.0.1" - is-regexp "^1.0.0" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== dependencies: ansi-regex "^3.0.0" @@ -7998,56 +6845,57 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" - -strip-ansi@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" - integrity sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE= + ansi-regex "^5.0.1" -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= +strip-ansi@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" + integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== dependencies: - is-utf8 "^0.2.0" + ansi-regex "^6.0.1" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== -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" + integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== strip-json-comments@2.0.1, strip-json-comments@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== -strip-json-comments@^3.1.0: +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@3.1.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" - integrity sha1-cqJiiU2dQIuVbKBf83su2KbiotU= +style-loader@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-2.0.0.tgz#9669602fd4690740eaaec137799a03addbbc393c" + integrity sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ== dependencies: - has-flag "^1.0.0" + loader-utils "^2.0.0" + schema-utils "^3.0.0" supports-color@6.0.0: version "6.0.0" @@ -8059,172 +6907,114 @@ supports-color@6.0.0: supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== -supports-color@^3.1.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= - dependencies: - has-flag "^1.0.0" - -supports-color@^5.3.0, supports-color@^5.5.0: +supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" -supports-color@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" - integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== +supports-color@^7.1.0, supports-color@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" -sver-compat@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" - integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -symbol-observable@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" - integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== + has-flag "^4.0.0" -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "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== taffydb@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" - integrity sha1-fLy2S1oUG2ou/CxdLGe04VCyomg= + integrity sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA== -tapable@^1.0.0, tapable@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" - integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -tar-stream@1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== +tar-stream@^2.1.4: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" + integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== dependencies: - bl "^1.0.0" - buffer-alloc "^1.2.0" - end-of-stream "^1.0.0" + bl "^4.0.3" + end-of-stream "^1.4.1" fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.1" - xtend "^4.0.0" - -tar@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40" - integrity sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA== - dependencies: - block-stream "*" - fstream "^1.0.12" - inherits "2" - -terser-webpack-plugin@^1.4.3: - version "1.4.5" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b" - integrity sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw== - dependencies: - cacache "^12.0.2" - find-cache-dir "^2.1.0" - is-wsl "^1.1.0" - schema-utils "^1.0.0" - serialize-javascript "^4.0.0" - source-map "^0.6.1" - terser "^4.1.2" - webpack-sources "^1.4.0" - worker-farm "^1.7.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +tar@^6.1.11: + version "6.1.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b" + integrity sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^4.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + +terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.3.7: + version "5.3.7" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz#ef760632d24991760f339fe9290deb936ad1ffc7" + integrity sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.17" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.1" + terser "^5.16.5" + +terser@^5.16.5: + version "5.16.8" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.8.tgz#ccde583dabe71df3f4ed02b65eb6532e0fae15d5" + integrity sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA== + dependencies: + "@jridgewell/source-map" "^0.3.2" + acorn "^8.5.0" + commander "^2.20.0" + source-map-support "~0.5.20" -terser@^4.1.2: - version "4.8.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" - integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== dependencies: - commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -throttleit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" - integrity sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw= - -through2-filter@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" - integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== - dependencies: - through2 "~2.0.0" - xtend "~4.0.0" - -through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through2@^3.0.0, through2@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.1.tgz#39276e713c3302edf9e388dd9c812dd3b825bd5a" - integrity sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww== - dependencies: - readable-stream "2 || 3" - -through@^2.3.6, through@^2.3.8: +through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -time-stamp@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" - integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= - -timers-browserify@^2.0.4: - version "2.0.11" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.11.tgz#800b1f3eee272e5bc53ee465a04d0e804c31211f" - integrity sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ== +timers-browserify@^2.0.12: + version "2.0.12" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" + integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== dependencies: setimmediate "^1.0.4" -tmp@0.0.30: - version "0.0.30" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= - dependencies: - os-tmpdir "~1.0.1" - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - tmp@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" @@ -8232,48 +7022,10 @@ tmp@^0.2.1: dependencies: rimraf "^3.0.0" -to-absolute-glob@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" - integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= - dependencies: - is-absolute "^1.0.0" - is-negated-glob "^1.0.0" - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= - -to-buffer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== to-regex-range@^5.0.1: version "5.0.1" @@ -8282,27 +7034,10 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -to-through@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" - integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= - dependencies: - through2 "^2.0.3" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== tough-cookie@~2.5.0: version "2.5.0" @@ -8312,30 +7047,44 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -tsconfig-paths@^3.9.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" - integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tsconfig-paths@^3.14.1: + 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== dependencies: "@types/json5" "^0.0.29" - json5 "^1.0.1" - minimist "^1.2.0" + json5 "^1.0.2" + minimist "^1.2.6" strip-bom "^3.0.0" tslib@^1.8.0, tslib@^1.8.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" - integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^1.9.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" - integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== +tslib@^2.1.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== tslint@5.14.0: version "5.14.0" @@ -8363,41 +7112,68 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +tty-browserify@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== dependencies: safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: - prelude-ls "~1.1.2" - -type-detect@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" - integrity sha1-C6XsKohWQORw6k6FBZcZANrFiCI= + prelude-ls "^1.2.1" -type-is@~1.6.17: +type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.20.2: + version "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@^2.14.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" + integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== + +type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -8405,143 +7181,97 @@ type-is@~1.6.17: media-typer "0.3.0" mime-types "~2.1.24" -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== +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" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" -type@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.1.0.tgz#9bdc22c648cf8cf86dd23d32336a41cfb6475e3f" - integrity sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA== +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@next: - version "3.9.0-dev.20200420" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.0-dev.20200420.tgz#99c2bc0936dbf4479b0b5260d80475ed494b1532" - integrity sha512-36MW6V+oXNnsSgliSjUWvtOkO21g9+iFGHPFv+O06HsCl3dcuqzBac17m8xuOuWo1LUlEgS6yAnD9fiVgvmCfg== +typescript@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.3.tgz#fe976f0c826a88d0a382007681cbb2da44afdedf" + integrity sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA== -ua-parser-js@0.7.28, ua-parser-js@^0.7.30: - version "0.7.28" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.28.tgz#8ba04e653f35ce210239c64661685bf9121dec31" - integrity sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g== +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== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== -uglify-js@^3.0.5: - version "3.9.1" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.9.1.tgz#a56a71c8caa2d36b5556cc1fd57df01ae3491539" - integrity sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA== +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== dependencies: - commander "~2.20.3" - -uglify-js@^3.1.4: - version "3.15.0" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.0.tgz#2d6a689d94783cab43975721977a13c2afec28f1" - integrity sha512-x+xdeDWq7FiORDvyIJ0q/waWd4PhjBNOm5dQUOq2AKC0IEjxOS66Ha9tctiVDGcRQuh69K7fgU5oRuTK4cysSg== - -unc-path-regex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" - integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" underscore@~1.13.2: - version "1.13.2" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.2.tgz#276cea1e8b9722a8dbed0100a407dda572125881" - integrity sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g== - -underscore@~1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" - integrity sha1-izixDKze9jM3uLJOT/htRa6lKag= - -undertaker-registry@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" - integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= + version "1.13.6" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" + integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== -undertaker@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18" - integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg== - dependencies: - arr-flatten "^1.0.1" - arr-map "^2.0.0" - bach "^1.0.0" - collection-map "^1.0.0" - es6-weak-map "^2.0.1" - fast-levenshtein "^1.0.0" - last-run "^1.1.0" - object.defaults "^1.0.0" - object.reduce "^1.0.0" - undertaker-registry "^1.0.0" - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" +unicode-canonical-property-names-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" + integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== -unique-filename@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" - integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== +unicode-match-property-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" + integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== dependencies: - unique-slug "^2.0.0" + unicode-canonical-property-names-ecmascript "^2.0.0" + unicode-property-aliases-ecmascript "^2.0.0" -unique-slug@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" - integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== - dependencies: - imurmurhash "^0.1.4" +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== -unique-stream@^2.0.2: - version "2.3.1" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" - integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== - dependencies: - json-stable-stringify-without-jsonify "^1.0.1" - through2-filter "^3.0.0" +unicode-property-aliases-ecmascript@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= +update-browserslist-db@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" + integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== + escalade "^3.1.1" + picocolors "^1.0.0" uri-js@^4.2.2: version "4.4.1" @@ -8550,81 +7280,49 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== dependencies: punycode "1.3.2" querystring "0.2.0" -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= - dependencies: - inherits "2.0.1" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -"util@>=0.10.3 <1": - version "0.12.2" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.2.tgz#54adb634c9e7c748707af2bf5a8c7ab640cbba2b" - integrity sha512-XE+MkWQvglYa+IOfBt5UFG93EmncEMP23UqpgDvVZVFBPxwmkK10QRp6pgU4xICPnWRf/t0zPv4noYSUq9gqUQ== +util@^0.12.0, util@^0.12.4: + version "0.12.5" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== dependencies: inherits "^2.0.3" is-arguments "^1.0.4" is-generator-function "^1.0.7" - safe-buffer "^5.1.2" - -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" + is-typed-array "^1.1.3" + which-typed-array "^1.1.2" utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -v8flags@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= - dependencies: - user-home "^1.1.1" +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8flags@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656" - integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg== - dependencies: - homedir-polyfill "^1.0.1" +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== validate-npm-package-license@^3.0.1: version "3.0.4" @@ -8637,97 +7335,25 @@ validate-npm-package-license@^3.0.1: validate-npm-package-name@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" - integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= + integrity sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw== dependencies: builtins "^1.0.3" -value-or-function@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" - integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= - vary@^1: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" extsprintf "^1.2.0" -vinyl-fs@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" - integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== - dependencies: - fs-mkdirp-stream "^1.0.0" - glob-stream "^6.1.0" - graceful-fs "^4.0.0" - is-valid-glob "^1.0.0" - lazystream "^1.0.0" - lead "^1.0.0" - object.assign "^4.0.4" - pumpify "^1.3.5" - readable-stream "^2.3.3" - remove-bom-buffer "^3.0.0" - remove-bom-stream "^1.2.0" - resolve-options "^1.1.0" - through2 "^2.0.0" - to-through "^2.0.0" - value-or-function "^3.0.0" - vinyl "^2.0.0" - vinyl-sourcemap "^1.1.0" - -vinyl-sourcemap@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" - integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= - dependencies: - append-buffer "^1.0.2" - convert-source-map "^1.5.0" - graceful-fs "^4.1.6" - normalize-path "^2.1.1" - now-and-later "^2.0.0" - remove-bom-buffer "^3.0.0" - vinyl "^2.0.0" - -vinyl-sourcemaps-apply@^0.2.0, vinyl-sourcemaps-apply@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz#ab6549d61d172c2b1b87be5c508d239c8ef87705" - integrity sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU= - dependencies: - source-map "^0.5.1" - -vinyl@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" - integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== - dependencies: - clone "^2.1.1" - clone-buffer "^1.0.0" - clone-stats "^1.0.0" - cloneable-readable "^1.0.0" - remove-trailing-separator "^1.0.1" - replace-ext "^1.0.0" - -vinyl@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.0.tgz#d85b07da96e458d25b2ffe19fece9f2caa13ed86" - integrity sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg== - dependencies: - clone "^2.1.1" - clone-buffer "^1.0.0" - clone-stats "^1.0.0" - cloneable-readable "^1.0.0" - remove-trailing-separator "^1.0.1" - replace-ext "^1.0.0" - -vm-browserify@^1.0.1: +vm-browserify@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== @@ -8735,144 +7361,114 @@ vm-browserify@^1.0.1: void-elements@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= + integrity sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung== -watchpack-chokidar2@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz#9948a1866cbbd6cb824dea13a7ed691f6c8ddff0" - integrity sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA== - dependencies: - chokidar "^2.1.8" - -watchpack@^1.6.0, watchpack@^1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.7.4.tgz#6e9da53b3c80bb2d6508188f5b200410866cd30b" - integrity sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg== +watchpack@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== dependencies: + glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" - neo-async "^2.5.0" - optionalDependencies: - chokidar "^3.4.1" - watchpack-chokidar2 "^2.0.0" - -webpack-dev-middleware@^3.7.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz#0019c3db716e3fa5cecbf64f2ab88a74bab331f3" - integrity sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw== - dependencies: - memory-fs "^0.4.1" - mime "^2.4.4" - mkdirp "^0.5.1" - range-parser "^1.2.1" - webpack-log "^2.0.0" -webpack-log@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" - integrity sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg== +webpack-cli@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.0.1.tgz#95fc0495ac4065e9423a722dec9175560b6f2d9a" + integrity sha512-S3KVAyfwUqr0Mo/ur3NzIp6jnerNpo7GUO6so51mxLi1spqsA17YcMXy0WOIJtBSnj748lthxC6XLbNKh/ZC+A== + dependencies: + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^2.0.1" + "@webpack-cli/info" "^2.0.1" + "@webpack-cli/serve" "^2.0.1" + colorette "^2.0.14" + commander "^9.4.1" + cross-spawn "^7.0.3" + envinfo "^7.7.3" + fastest-levenshtein "^1.0.12" + import-local "^3.0.2" + interpret "^3.1.1" + rechoir "^0.8.0" + webpack-merge "^5.7.3" + +webpack-merge@^4.1.5: + version "4.2.2" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.2.2.tgz#a27c52ea783d1398afd2087f547d7b9d2f43634d" + integrity sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g== dependencies: - ansi-colors "^3.0.0" - uuid "^3.3.2" + lodash "^4.17.15" -webpack-sources@^1.4.0, webpack-sources@^1.4.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" - integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== +webpack-merge@^5.7.3: + version "5.8.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" + integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" + clone-deep "^4.0.1" + wildcard "^2.0.0" -webpack-stream@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-5.2.1.tgz#35c992161399fe8cad9c10d4a5c258f022629b39" - integrity sha512-WvyVU0K1/VB1NZ7JfsaemVdG0PXAQUqbjUNW4A58th4pULvKMQxG+y33HXTL02JvD56ko2Cub+E2NyPwrLBT/A== - dependencies: - fancy-log "^1.3.3" - lodash.clone "^4.3.2" - lodash.some "^4.2.2" - memory-fs "^0.4.1" - plugin-error "^1.0.1" - supports-color "^5.5.0" - through "^2.3.8" - vinyl "^2.1.0" - webpack "^4.26.1" - -webpack@^4.26.1: - version "4.42.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.42.1.tgz#ae707baf091f5ca3ef9c38b884287cfe8f1983ef" - integrity sha512-SGfYMigqEfdGchGhFFJ9KyRpQKnipvEvjc1TwrXEPCM6H5Wywu10ka8o3KGrMzSMxMQKt8aCHUFh5DaQ9UmyRg== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/wasm-edit" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - acorn "^6.2.1" - ajv "^6.10.2" - ajv-keywords "^3.4.1" - chrome-trace-event "^1.0.2" - enhanced-resolve "^4.1.0" - eslint-scope "^4.0.3" - json-parse-better-errors "^1.0.2" - loader-runner "^2.4.0" - loader-utils "^1.2.3" - memory-fs "^0.4.1" - micromatch "^3.1.10" - mkdirp "^0.5.3" - neo-async "^2.6.1" - node-libs-browser "^2.2.1" - schema-utils "^1.0.0" - tapable "^1.1.3" - terser-webpack-plugin "^1.4.3" - watchpack "^1.6.0" - webpack-sources "^1.4.1" - -webpack@^v4.39.2: - version "4.44.2" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.44.2.tgz#6bfe2b0af055c8b2d1e90ed2cd9363f841266b72" - integrity sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q== - dependencies: - "@webassemblyjs/ast" "1.9.0" - "@webassemblyjs/helper-module-context" "1.9.0" - "@webassemblyjs/wasm-edit" "1.9.0" - "@webassemblyjs/wasm-parser" "1.9.0" - acorn "^6.4.1" - ajv "^6.10.2" - ajv-keywords "^3.4.1" +webpack-sources@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== + +webpack@^5.77.0: + version "5.77.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.77.0.tgz#dea3ad16d7ea6b84aa55fa42f4eac9f30e7eb9b4" + integrity sha512-sbGNjBr5Ya5ss91yzjeJTLKyfiwo5C628AFjEa6WSXcZa4E+F57om3Cc8xLb1Jh0b243AWuSYRf3dn7HVeFQ9Q== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.7.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^4.3.0" - eslint-scope "^4.0.3" - json-parse-better-errors "^1.0.2" - loader-runner "^2.4.0" - loader-utils "^1.2.3" - memory-fs "^0.4.1" - micromatch "^3.1.10" - mkdirp "^0.5.3" - neo-async "^2.6.1" - node-libs-browser "^2.2.1" - schema-utils "^1.0.0" - tapable "^1.1.3" - terser-webpack-plugin "^1.4.3" - watchpack "^1.7.4" - webpack-sources "^1.4.1" - -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= + enhanced-resolve "^5.10.0" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.4.0" + webpack-sources "^3.2.3" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== -which@1.2.x: - version "1.2.14" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" - integrity sha1-mofEN48D6CfOyvGs31bHNsAcFOU= +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== dependencies: - isexe "^2.0.0" + 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.3.1, which@^1.0.9, which@^1.1.1, which@^1.2.1, which@^1.2.10, which@^1.2.14, which@^1.2.9: +which@1.3.1, which@^1.2.1, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -8886,45 +7482,29 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@1.1.3, wide-align@^1.1.0: +wide-align@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wordwrap@1.0.x, wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -worker-farm@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" - integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== +wide-align@^1.1.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" + integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== dependencies: - errno "~0.1.7" + string-width "^1.0.2 || 2 || 3 || 4" -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" +wildcard@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" + integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== -wrap-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" - integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== wrap-ansi@^5.1.0: version "5.1.0" @@ -8956,55 +7536,63 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== dependencies: - mkdirp "^0.5.1" + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" -ws@~8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba" - integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA== +ws@>=8.11.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + +ws@~8.11.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" + integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== xmlcreate@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== -xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: +xtend@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== -y18n@^3.2.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" - integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== - y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yaml@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.1.tgz#3014bf0482dcd15147aa8e56109ce8632cd60ce4" + integrity sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw== + yargs-parser@13.1.2, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" @@ -9013,14 +7601,6 @@ yargs-parser@13.1.2, yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@5.0.0-security.0: - version "5.0.0-security.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz#4ff7271d25f90ac15643b86076a2ab499ec9ee24" - integrity sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ== - dependencies: - camelcase "^3.0.0" - object.assign "^4.1.0" - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -9059,7 +7639,7 @@ yargs@13.3.2, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@^15.1.0, yargs@^15.3.1: +yargs@^15.0.2, yargs@^15.1.0, yargs@^15.3.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== @@ -9089,29 +7669,12 @@ yargs@^16.1.1: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^7.1.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.1.tgz#67f0ef52e228d4ee0d6311acede8850f53464df6" - integrity sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g== - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "5.0.0-security.0" - -yauzl@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +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== From 2dbcc2536d0544fa487bc189b2d0cbd0e5a41a44 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 3 Apr 2023 19:30:17 -0700 Subject: [PATCH 02/25] Remove unnecessary files + changes --- .gitignore | 1 + cfg/.eslintrc.js | 7 -- cfg/.nvmrc | 1 - cfg/dist/stellar-base.js | 7 -- cfg/dist/stellar-base.min.js | 0 cfg/karma-sauce.conf.js | 8 +- gulpfile.js | 148 ----------------------------------- 7 files changed, 3 insertions(+), 169 deletions(-) delete mode 100644 cfg/.nvmrc delete mode 100644 cfg/dist/stellar-base.js delete mode 100644 cfg/dist/stellar-base.min.js delete mode 100644 gulpfile.js diff --git a/.gitignore b/.gitignore index f4be18b7e..2d31f36b8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /tmp/ /lib/ /dist/ +/cfg/dist/ /coverage/ /jsdoc/ .DS_Store diff --git a/cfg/.eslintrc.js b/cfg/.eslintrc.js index 5dc7805a3..740139d9c 100644 --- a/cfg/.eslintrc.js +++ b/cfg/.eslintrc.js @@ -5,13 +5,6 @@ module.exports = { extends: ['airbnb-base', 'prettier'], plugins: ['prettier', 'prefer-import'], rules: { - // DISABLED - 'import/no-import-module-exports': [ - 'error', - { - exceptions: ['index.js'] - } - ], // OFF 'import/prefer-default-export': 0, 'node/no-unsupported-features/es-syntax': 0, diff --git a/cfg/.nvmrc b/cfg/.nvmrc deleted file mode 100644 index a3eb5a03f..000000000 --- a/cfg/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -14.20.0 diff --git a/cfg/dist/stellar-base.js b/cfg/dist/stellar-base.js deleted file mode 100644 index 65e5d5e60..000000000 --- a/cfg/dist/stellar-base.js +++ /dev/null @@ -1,7 +0,0 @@ -/******/ (() => { - // webpackBootstrap - /******/ 'use strict'; - /******/ - /******/ - /******/ -})(); diff --git a/cfg/dist/stellar-base.min.js b/cfg/dist/stellar-base.min.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/cfg/karma-sauce.conf.js b/cfg/karma-sauce.conf.js index 9d8ebf6d1..82392c538 100644 --- a/cfg/karma-sauce.conf.js +++ b/cfg/karma-sauce.conf.js @@ -1,4 +1,6 @@ var webpackConfig = require('./webpack.config.browser.js'); +delete webpackConfig.output; +webpackConfig.entry = {}; // karma fills these in module.exports = function(config) { var customLaunchers = { @@ -19,12 +21,6 @@ module.exports = function(config) { browserName: 'internet explorer', platform: 'Windows 8.1', version: 'latest' - }, - sl_edge: { - base: 'SauceLabs', - browserName: 'microsoft edge', - platform: 'Windows 8.1', - version: 'latest' } }; diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index e0f7a8ac3..000000000 --- a/gulpfile.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; - -var gulp = require("gulp"); -var plugins = require("gulp-load-plugins")(); -var clear = require("clear"); -var webpackConfigBrowser = require("./webpack.config.browser.js"); -var webpack = require("webpack-stream"); -var del = require("del"); - -gulp.task("lint:src", function lintSrc() { - return gulp - .src(["src/**/*.js"]) - .pipe(plugins.eslint()) - .pipe(plugins.eslint.format()) - .pipe(plugins.eslint.failAfterError()); -}); - -// Lint our test code -gulp.task("lint:test", function lintTest() { - return gulp - .src(["test/unit/**/*.js"]) - .pipe(plugins.eslint()) - .pipe(plugins.eslint.format()) - .pipe(plugins.eslint.failAfterError()); -}); - -gulp.task( - "build:node", - gulp.series("lint:src", function buildNode() { - return gulp - .src("src/**/*.js") - .pipe(plugins.babel()) - .pipe(gulp.dest("lib")); - }) -); - -gulp.task( - "build:browser", - gulp.series("lint:src", function buildNode() { - return gulp - .src("src/browser.js") - .pipe(webpack(webpackConfigBrowser)) - .pipe(plugins.rename("stellar-base.js")) - .pipe(gulp.dest("dist")) - .pipe( - plugins.uglify({ - output: { - ascii_only: true - } - }) - ) - .pipe(plugins.rename("stellar-base.min.js")) - .pipe(gulp.dest("dist")); - }) -); - -gulp.task("clean-coverage", function cleanCoverage() { - return del(["coverage/"]); -}); - -gulp.task( - "test:init-nyc", - gulp.series("clean-coverage", function testInitNyc() { - return gulp - .src(["src/**/*.js"]) - .pipe(plugins.nyc()) - .pipe(plugins.nyc.hookRequire()); - }) -); - -gulp.task( - "test:node", - gulp.series("build:node", "test:init-nyc", function testNode() { - return gulp - .src(["test/test-helper.js", "test/unit/**/*.js"]) - .pipe( - plugins.mocha({ - reporter: ["dot"] - }) - ) - .pipe(plugins.nyc.writeReports()); - }) -); - -gulp.task( - "test:browser", - gulp.series("build:browser", function testBrowser(done) { - var Server = require("karma").Server; - var server = new Server( - { configFile: __dirname + "/karma.conf.js" }, - exitCode => { - if (exitCode !== 0) { - done(new Error(`Bad exit code ${exitCode}`)); - } else { - done(); - } - } - ); - server.start(); - }) -); - -gulp.task("test:watch", function() { - return gulp.watch( - ["src/**/*", "test/unit/**/*.js"], - gulp.series(["clear-screen", "test:node"]) - ); -}); - -gulp.task( - "test:sauce", - gulp.series("build:browser", function testSauce(done) { - var Server = require("karma").Server; - var server = new Server( - { configFile: __dirname + "/karma-sauce.conf.js" }, - exitCode => { - if (exitCode !== 0) { - done(new Error(`Bad exit code ${exitCode}`)); - } else { - done(); - } - } - ); - server.start(); - }) -); - -gulp.task("clear-screen", function clearScreen(cb) { - clear(); - cb(); -}); - -gulp.task("clean", function clean() { - return del(["dist/", "lib/"]); -}); - -gulp.task("build", gulp.series("clean", "build:node", "build:browser")); - -gulp.task("test", gulp.series("clean", "test:node", "test:browser")); - -gulp.task("default", gulp.series("build")); - -gulp.task( - "watch", - gulp.series("build", function watch() { - gulp.watch("src/**/*", ["clear-screen", "build"]); - }) -); From 000ffdf35b969750fca4319068c833de6459e441 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 3 Apr 2023 19:32:14 -0700 Subject: [PATCH 03/25] Universal prettier-ification --- cfg/.prettierignore => .prettierignore | 0 package.json | 3 +- src/generated/curr_generated.js | 14086 ++++++++++--------- src/generated/next_generated.js | 16616 +++++++++++------------ src/index.js | 44 +- test/test-helper.js | 10 +- test/unit/browser_test.js | 8 +- test/unit/hashing_test.js | 24 +- test/unit/memo_test.js | 104 +- test/unit/signing_test.js | 58 +- test/unit/strkey_test.js | 220 +- 11 files changed, 15514 insertions(+), 15659 deletions(-) rename cfg/.prettierignore => .prettierignore (100%) diff --git a/cfg/.prettierignore b/.prettierignore similarity index 100% rename from cfg/.prettierignore rename to .prettierignore diff --git a/package.json b/package.json index 1335e17c1..a3ce0c426 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,7 @@ }, "lint-staged": { "**/*.{js,json}": [ - "prettier --write", - "git add" + "prettier --config ./cfg/prettier.config.js --write" ] }, "browser": { diff --git a/src/generated/curr_generated.js b/src/generated/curr_generated.js index 26852ebb8..9d1a67970 100644 --- a/src/generated/curr_generated.js +++ b/src/generated/curr_generated.js @@ -6,7081 +6,7015 @@ 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 ============================================================ -// -// struct Auth -// { -// // Empty message, just to confirm -// // establishment of MAC keys. -// int unused; -// }; -// -// =========================================================================== -xdr.struct("Auth", [ - ["unused", 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 -// }; -// -// =========================================================================== -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, -}); - -// === 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 ============================================================ -// -// 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; -// }; -// -// =========================================================================== -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"], - ], - 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"), - }, -}); - -// === 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)], -]); - +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 ============================================================ + // + // struct Auth + // { + // // Empty message, just to confirm + // // establishment of MAC keys. + // int unused; + // }; + // + // =========================================================================== + xdr.struct('Auth', [['unused', 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 + // }; + // + // =========================================================================== + 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 + }); + + // === 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 ============================================================ + // + // 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; + // }; + // + // =========================================================================== + 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'] + ], + 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') + } + }); + + // === 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)]]); }); export default types; diff --git a/src/generated/next_generated.js b/src/generated/next_generated.js index 6f91b4a3d..249dae10b 100644 --- a/src/generated/next_generated.js +++ b/src/generated/next_generated.js @@ -6,8352 +6,8274 @@ 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, -// CONTRACT_DATA = 6, -// CONFIG_SETTING = 7 -// }; -// -// =========================================================================== -xdr.enum("LedgerEntryType", { - account: 0, - trustline: 1, - offer: 2, - data: 3, - claimableBalance: 4, - liquidityPool: 5, - contractData: 6, - configSetting: 7, -}); - -// === 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 ============================================================ -// -// enum ConfigSettingType -// { -// CONFIG_SETTING_TYPE_UINT32 = 0 -// }; -// -// =========================================================================== -xdr.enum("ConfigSettingType", { - configSettingTypeUint32: 0, -}); - -// === xdr source ============================================================ -// -// union ConfigSetting switch (ConfigSettingType type) -// { -// case CONFIG_SETTING_TYPE_UINT32: -// uint32 uint32Val; -// }; -// -// =========================================================================== -xdr.union("ConfigSetting", { - switchOn: xdr.lookup("ConfigSettingType"), - switchName: "type", - switches: [ - ["configSettingTypeUint32", "uint32Val"], - ], - arms: { - uint32Val: xdr.lookup("Uint32"), - }, -}); - -// === xdr source ============================================================ -// -// enum ConfigSettingID -// { -// CONFIG_SETTING_CONTRACT_MAX_SIZE = 0 -// }; -// -// =========================================================================== -xdr.enum("ConfigSettingId", { - configSettingContractMaxSize: 0, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("ConfigSettingEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct ConfigSettingEntry -// { -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// -// ConfigSettingID configSettingID; -// ConfigSetting setting; -// }; -// -// =========================================================================== -xdr.struct("ConfigSettingEntry", [ - ["ext", xdr.lookup("ConfigSettingEntryExt")], - ["configSettingId", xdr.lookup("ConfigSettingId")], - ["setting", xdr.lookup("ConfigSetting")], -]); - -// === 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 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"], - ["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"), - 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 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 -// { -// 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 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"], - ["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"), - 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 -// }; -// -// =========================================================================== -xdr.enum("EnvelopeType", { - envelopeTypeTxV0: 0, - envelopeTypeScp: 1, - envelopeTypeTx: 2, - envelopeTypeAuth: 3, - envelopeTypeScpvalue: 4, - envelopeTypeTxFeeBump: 5, - envelopeTypeOpId: 6, - envelopeTypePoolRevokeOpId: 7, - envelopeTypeContractIdFromEd25519: 8, - envelopeTypeContractIdFromContract: 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 = 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 -// { -// ConfigSettingID id; // id to update -// ConfigSetting setting; // new value -// } -// -// =========================================================================== -xdr.struct("LedgerUpgradeConfigSetting", [ - ["id", xdr.lookup("ConfigSettingId")], - ["setting", xdr.lookup("ConfigSetting")], -]); - -// === 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: -// struct -// { -// ConfigSettingID id; // id to update -// ConfigSetting setting; // new value -// } configSetting; -// }; -// -// =========================================================================== -xdr.union("LedgerUpgrade", { - switchOn: xdr.lookup("LedgerUpgradeType"), - switchName: "type", - switches: [ - ["ledgerUpgradeVersion", "newLedgerVersion"], - ["ledgerUpgradeBaseFee", "newBaseFee"], - ["ledgerUpgradeMaxTxSetSize", "newMaxTxSetSize"], - ["ledgerUpgradeBaseReserve", "newBaseReserve"], - ["ledgerUpgradeFlags", "newFlags"], - ["ledgerUpgradeConfig", "configSetting"], - ], - arms: { - newLedgerVersion: xdr.lookup("Uint32"), - newBaseFee: xdr.lookup("Uint32"), - newMaxTxSetSize: xdr.lookup("Uint32"), - newBaseReserve: xdr.lookup("Uint32"), - newFlags: xdr.lookup("Uint32"), - configSetting: xdr.lookup("LedgerUpgradeConfigSetting"), - }, -}); - -// === 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 ============================================================ -// -// struct Auth -// { -// // Empty message, just to confirm -// // establishment of MAC keys. -// int unused; -// }; -// -// =========================================================================== -xdr.struct("Auth", [ - ["unused", 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 -// }; -// -// =========================================================================== -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, -}); - -// === 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 ============================================================ -// -// 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; -// }; -// -// =========================================================================== -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"], - ], - 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"), - }, -}); - -// === 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 HostFunction -// { -// HOST_FN_CALL = 0, -// HOST_FN_CREATE_CONTRACT = 1 -// }; -// -// =========================================================================== -xdr.enum("HostFunction", { - hostFnCall: 0, - hostFnCreateContract: 1, -}); - -// === xdr source ============================================================ -// -// struct InvokeHostFunctionOp -// { -// // The host function to invoke -// HostFunction function; -// -// // Parameters to the host function -// SCVec parameters; -// -// // The footprint for this invocation -// LedgerFootprint footprint; -// }; -// -// =========================================================================== -xdr.struct("InvokeHostFunctionOp", [ - ["function", xdr.lookup("HostFunction")], - ["parameters", xdr.lookup("ScVec")], - ["footprint", xdr.lookup("LedgerFootprint")], -]); - -// === 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 -// { -// uint256 ed25519; -// uint256 salt; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageEd25519ContractId", [ - ["ed25519", xdr.lookup("Uint256")], - ["salt", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash contractID; -// uint256 salt; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageContractId", [ - ["contractId", xdr.lookup("Hash")], - ["salt", xdr.lookup("Uint256")], -]); - -// === 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 -// { -// uint256 ed25519; -// uint256 salt; -// } ed25519ContractID; -// case ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT: -// struct -// { -// Hash contractID; -// uint256 salt; -// } contractID; -// }; -// -// =========================================================================== -xdr.union("HashIdPreimage", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeOpId", "operationId"], - ["envelopeTypePoolRevokeOpId", "revokeId"], - ["envelopeTypeContractIdFromEd25519", "ed25519ContractId"], - ["envelopeTypeContractIdFromContract", "contractId"], - ], - arms: { - operationId: xdr.lookup("HashIdPreimageOperationId"), - revokeId: xdr.lookup("HashIdPreimageRevokeId"), - ed25519ContractId: xdr.lookup("HashIdPreimageEd25519ContractId"), - contractId: xdr.lookup("HashIdPreimageContractId"), - }, -}); - -// === 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: -// void; -// case INVOKE_HOST_FUNCTION_MALFORMED: -// case INVOKE_HOST_FUNCTION_TRAPPED: -// void; -// }; -// -// =========================================================================== -xdr.union("InvokeHostFunctionResult", { - switchOn: xdr.lookup("InvokeHostFunctionResultCode"), - switchName: "code", - switches: [ - ["invokeHostFunctionSuccess", xdr.void()], - ["invokeHostFunctionMalformed", xdr.void()], - ["invokeHostFunctionTrapped", 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; -// } -// -// =========================================================================== -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 ============================================================ -// -// 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)], -]); - -// === xdr source ============================================================ -// -// typedef string SCSymbol<10>; -// -// =========================================================================== -xdr.typedef("ScSymbol", xdr.string(10)); - -// === xdr source ============================================================ -// -// enum SCValType -// { -// SCV_U63 = 0, -// SCV_U32 = 1, -// SCV_I32 = 2, -// SCV_STATIC = 3, -// SCV_OBJECT = 4, -// SCV_SYMBOL = 5, -// SCV_BITSET = 6, -// SCV_STATUS = 7 -// }; -// -// =========================================================================== -xdr.enum("ScValType", { - scvU63: 0, - scvU32: 1, - scvI32: 2, - scvStatic: 3, - scvObject: 4, - scvSymbol: 5, - scvBitset: 6, - scvStatus: 7, -}); - -// === xdr source ============================================================ -// -// enum SCStatic -// { -// SCS_VOID = 0, -// SCS_TRUE = 1, -// SCS_FALSE = 2, -// SCS_LEDGER_KEY_CONTRACT_CODE = 3 -// }; -// -// =========================================================================== -xdr.enum("ScStatic", { - scsVoid: 0, - scsTrue: 1, - scsFalse: 2, - scsLedgerKeyContractCode: 3, -}); - -// === 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 -// // TODO: add more -// }; -// -// =========================================================================== -xdr.enum("ScStatusType", { - sstOk: 0, - sstUnknownError: 1, - sstHostValueError: 2, - sstHostObjectError: 3, - sstHostFunctionError: 4, - sstHostStorageError: 5, - sstHostContextError: 6, - sstVmError: 7, -}); - -// === 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 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 errorCode; -// case SST_HOST_OBJECT_ERROR: -// SCHostObjErrorCode errorCode; -// case SST_HOST_FUNCTION_ERROR: -// SCHostFnErrorCode errorCode; -// case SST_HOST_STORAGE_ERROR: -// SCHostStorageErrorCode errorCode; -// case SST_HOST_CONTEXT_ERROR: -// SCHostContextErrorCode errorCode; -// case SST_VM_ERROR: -// SCVmErrorCode errorCode; -// }; -// -// =========================================================================== -xdr.union("ScStatus", { - switchOn: xdr.lookup("ScStatusType"), - switchName: "type", - switches: [ - ["sstOk", xdr.void()], - ["sstUnknownError", "unknownCode"], - ["sstHostValueError", "errorCode"], - ["sstHostObjectError", "errorCode"], - ["sstHostFunctionError", "errorCode"], - ["sstHostStorageError", "errorCode"], - ["sstHostContextError", "errorCode"], - ["sstVmError", "errorCode"], - ], - arms: { - unknownCode: xdr.lookup("ScUnknownErrorCode"), - errorCode: xdr.lookup("ScHostValErrorCode"), - errorCode: xdr.lookup("ScHostObjErrorCode"), - errorCode: xdr.lookup("ScHostFnErrorCode"), - errorCode: xdr.lookup("ScHostStorageErrorCode"), - errorCode: xdr.lookup("ScHostContextErrorCode"), - errorCode: xdr.lookup("ScVmErrorCode"), - }, -}); - -// === xdr source ============================================================ -// -// union SCVal switch (SCValType type) -// { -// case SCV_U63: -// int64 u63; -// case SCV_U32: -// uint32 u32; -// case SCV_I32: -// int32 i32; -// case SCV_STATIC: -// SCStatic ic; -// case SCV_OBJECT: -// SCObject* obj; -// case SCV_SYMBOL: -// SCSymbol sym; -// case SCV_BITSET: -// uint64 bits; -// case SCV_STATUS: -// SCStatus status; -// }; -// -// =========================================================================== -xdr.union("ScVal", { - switchOn: xdr.lookup("ScValType"), - switchName: "type", - switches: [ - ["scvU63", "u63"], - ["scvU32", "u32"], - ["scvI32", "i32"], - ["scvStatic", "ic"], - ["scvObject", "obj"], - ["scvSymbol", "sym"], - ["scvBitset", "bits"], - ["scvStatus", "status"], - ], - arms: { - u63: xdr.lookup("Int64"), - u32: xdr.lookup("Uint32"), - i32: xdr.lookup("Int32"), - ic: xdr.lookup("ScStatic"), - obj: xdr.option(xdr.lookup("ScObject")), - sym: xdr.lookup("ScSymbol"), - bits: xdr.lookup("Uint64"), - status: xdr.lookup("ScStatus"), - }, -}); - -// === xdr source ============================================================ -// -// enum SCObjectType -// { -// // We have a few objects that represent non-stellar-specific concepts -// // like general-purpose maps, vectors, numbers, blobs. -// -// SCO_VEC = 0, -// SCO_MAP = 1, -// SCO_U64 = 2, -// SCO_I64 = 3, -// SCO_BYTES = 4, -// SCO_BIG_INT = 5, -// SCO_HASH = 6, -// SCO_PUBLIC_KEY = 7, -// SCO_CONTRACT_CODE = 8 -// -// // TODO: add more -// }; -// -// =========================================================================== -xdr.enum("ScObjectType", { - scoVec: 0, - scoMap: 1, - scoU64: 2, - scoI64: 3, - scoBytes: 4, - scoBigInt: 5, - scoHash: 6, - scoPublicKey: 7, - scoContractCode: 8, -}); - -// === xdr source ============================================================ -// -// struct SCMapEntry -// { -// SCVal key; -// SCVal val; -// }; -// -// =========================================================================== -xdr.struct("ScMapEntry", [ - ["key", xdr.lookup("ScVal")], - ["val", xdr.lookup("ScVal")], -]); - -// === xdr source ============================================================ -// -// const SCVAL_LIMIT = 256000; -// -// =========================================================================== -xdr.const("SCVAL_LIMIT", 256000); - -// === 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 ============================================================ -// -// enum SCNumSign -// { -// NEGATIVE = -1, -// ZERO = 0, -// POSITIVE = 1 -// }; -// -// =========================================================================== -xdr.enum("ScNumSign", { - negative: -1, - zero: 0, - positive: 1, -}); - -// === xdr source ============================================================ -// -// union SCBigInt switch (SCNumSign sign) -// { -// case ZERO: -// void; -// case POSITIVE: -// case NEGATIVE: -// opaque magnitude<256000>; -// }; -// -// =========================================================================== -xdr.union("ScBigInt", { - switchOn: xdr.lookup("ScNumSign"), - switchName: "sign", - switches: [ - ["zero", xdr.void()], - ["positive", "magnitude"], - ["negative", "magnitude"], - ], - arms: { - magnitude: xdr.varOpaque(256000), - }, -}); - -// === xdr source ============================================================ -// -// enum SCHashType -// { -// SCHASH_SHA256 = 0 -// }; -// -// =========================================================================== -xdr.enum("ScHashType", { - schashSha256: 0, -}); - -// === xdr source ============================================================ -// -// union SCHash switch (SCHashType type) -// { -// case SCHASH_SHA256: -// Hash sha256; -// }; -// -// =========================================================================== -xdr.union("ScHash", { - switchOn: xdr.lookup("ScHashType"), - switchName: "type", - switches: [ - ["schashSha256", "sha256"], - ], - arms: { - sha256: xdr.lookup("Hash"), - }, -}); - -// === xdr source ============================================================ -// -// enum SCContractCodeType -// { -// SCCONTRACT_CODE_WASM = 0, -// SCCONTRACT_CODE_TOKEN = 1 -// }; -// -// =========================================================================== -xdr.enum("ScContractCodeType", { - sccontractCodeWasm: 0, - sccontractCodeToken: 1, -}); - -// === xdr source ============================================================ -// -// union SCContractCode switch (SCContractCodeType type) -// { -// case SCCONTRACT_CODE_WASM: -// opaque wasm; -// case SCCONTRACT_CODE_TOKEN: -// void; -// }; -// -// =========================================================================== -xdr.union("ScContractCode", { - switchOn: xdr.lookup("ScContractCodeType"), - switchName: "type", - switches: [ - ["sccontractCodeWasm", "wasm"], - ["sccontractCodeToken", xdr.void()], - ], - arms: { - wasm: xdr.varOpaque(SCVAL_LIMIT), - }, -}); - -// === xdr source ============================================================ -// -// union SCObject switch (SCObjectType type) -// { -// case SCO_VEC: -// SCVec vec; -// case SCO_MAP: -// SCMap map; -// case SCO_U64: -// uint64 u64; -// case SCO_I64: -// int64 i64; -// case SCO_BYTES: -// opaque bin; -// case SCO_BIG_INT: -// SCBigInt bigInt; -// case SCO_HASH: -// SCHash hash; -// case SCO_PUBLIC_KEY: -// PublicKey publicKey; -// case SCO_CONTRACT_CODE: -// SCContractCode contractCode; -// }; -// -// =========================================================================== -xdr.union("ScObject", { - switchOn: xdr.lookup("ScObjectType"), - switchName: "type", - switches: [ - ["scoVec", "vec"], - ["scoMap", "map"], - ["scoU64", "u64"], - ["scoI64", "i64"], - ["scoBytes", "bin"], - ["scoBigInt", "bigInt"], - ["scoHash", "hash"], - ["scoPublicKey", "publicKey"], - ["scoContractCode", "contractCode"], - ], - arms: { - vec: xdr.lookup("ScVec"), - map: xdr.lookup("ScMap"), - u64: xdr.lookup("Uint64"), - i64: xdr.lookup("Int64"), - bin: xdr.varOpaque(SCVAL_LIMIT), - bigInt: xdr.lookup("ScBigInt"), - hash: xdr.lookup("ScHash"), - publicKey: xdr.lookup("PublicKey"), - contractCode: xdr.lookup("ScContractCode"), - }, -}); - -// === 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 ============================================================ -// -// enum SCSpecType -// { -// // Types with no parameters. -// SC_SPEC_TYPE_U32 = 1, -// SC_SPEC_TYPE_I32 = 2, -// SC_SPEC_TYPE_U64 = 3, -// SC_SPEC_TYPE_I64 = 4, -// SC_SPEC_TYPE_BOOL = 5, -// SC_SPEC_TYPE_SYMBOL = 6, -// SC_SPEC_TYPE_BITSET = 7, -// SC_SPEC_TYPE_STATUS = 8, -// SC_SPEC_TYPE_BYTES = 9, -// SC_SPEC_TYPE_BIG_INT = 10, -// -// // 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, -// -// // User defined types. -// SC_SPEC_TYPE_UDT = 2000 -// }; -// -// =========================================================================== -xdr.enum("ScSpecType", { - scSpecTypeU32: 1, - scSpecTypeI32: 2, - scSpecTypeU64: 3, - scSpecTypeI64: 4, - scSpecTypeBool: 5, - scSpecTypeSymbol: 6, - scSpecTypeBitset: 7, - scSpecTypeStatus: 8, - scSpecTypeBytes: 9, - scSpecTypeBigInt: 10, - scSpecTypeOption: 1000, - scSpecTypeResult: 1001, - scSpecTypeVec: 1002, - scSpecTypeSet: 1003, - scSpecTypeMap: 1004, - scSpecTypeTuple: 1005, - 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 SCSpecTypeUDT -// { -// string name<60>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeUdt", [ - ["name", xdr.string(60)], -]); - -// === xdr source ============================================================ -// -// union SCSpecTypeDef switch (SCSpecType type) -// { -// case SC_SPEC_TYPE_U64: -// case SC_SPEC_TYPE_I64: -// case SC_SPEC_TYPE_U32: -// case SC_SPEC_TYPE_I32: -// case SC_SPEC_TYPE_BOOL: -// case SC_SPEC_TYPE_SYMBOL: -// case SC_SPEC_TYPE_BITSET: -// case SC_SPEC_TYPE_STATUS: -// case SC_SPEC_TYPE_BYTES: -// case SC_SPEC_TYPE_BIG_INT: -// 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_UDT: -// SCSpecTypeUDT udt; -// }; -// -// =========================================================================== -xdr.union("ScSpecTypeDef", { - switchOn: xdr.lookup("ScSpecType"), - switchName: "type", - switches: [ - ["scSpecTypeU64", xdr.void()], - ["scSpecTypeI64", xdr.void()], - ["scSpecTypeU32", xdr.void()], - ["scSpecTypeI32", xdr.void()], - ["scSpecTypeBool", xdr.void()], - ["scSpecTypeSymbol", xdr.void()], - ["scSpecTypeBitset", xdr.void()], - ["scSpecTypeStatus", xdr.void()], - ["scSpecTypeBytes", xdr.void()], - ["scSpecTypeBigInt", xdr.void()], - ["scSpecTypeOption", "option"], - ["scSpecTypeResult", "result"], - ["scSpecTypeVec", "vec"], - ["scSpecTypeMap", "map"], - ["scSpecTypeSet", "set"], - ["scSpecTypeTuple", "tuple"], - ["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"), - udt: xdr.lookup("ScSpecTypeUdt"), - }, -}); - -// === xdr source ============================================================ -// -// struct SCSpecUDTStructFieldV0 -// { -// string name<30>; -// SCSpecTypeDef type; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtStructFieldV0", [ - ["name", xdr.string(30)], - ["type", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTStructV0 -// { -// string name<60>; -// SCSpecUDTStructFieldV0 fields<40>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtStructV0", [ - ["name", xdr.string(60)], - ["fields", xdr.varArray(xdr.lookup("ScSpecUdtStructFieldV0"), 40)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTUnionCaseV0 -// { -// string name<60>; -// SCSpecTypeDef *type; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtUnionCaseV0", [ - ["name", xdr.string(60)], - ["type", xdr.option(xdr.lookup("ScSpecTypeDef"))], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTUnionV0 -// { -// string name<60>; -// SCSpecUDTUnionCaseV0 cases<50>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtUnionV0", [ - ["name", xdr.string(60)], - ["cases", xdr.varArray(xdr.lookup("ScSpecUdtUnionCaseV0"), 50)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecFunctionV0 -// { -// SCSymbol name; -// SCSpecTypeDef inputTypes<10>; -// SCSpecTypeDef outputTypes<1>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecFunctionV0", [ - ["name", xdr.lookup("ScSymbol")], - ["inputTypes", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 10)], - ["outputTypes", 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 -// }; -// -// =========================================================================== -xdr.enum("ScSpecEntryKind", { - scSpecEntryFunctionV0: 0, - scSpecEntryUdtStructV0: 1, - scSpecEntryUdtUnionV0: 2, -}); - -// === 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; -// }; -// -// =========================================================================== -xdr.union("ScSpecEntry", { - switchOn: xdr.lookup("ScSpecEntryKind"), - switchName: "kind", - switches: [ - ["scSpecEntryFunctionV0", "functionV0"], - ["scSpecEntryUdtStructV0", "udtStructV0"], - ["scSpecEntryUdtUnionV0", "udtUnionV0"], - ], - arms: { - functionV0: xdr.lookup("ScSpecFunctionV0"), - udtStructV0: xdr.lookup("ScSpecUdtStructV0"), - udtUnionV0: xdr.lookup("ScSpecUdtUnionV0"), - }, -}); - +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, + // CONTRACT_DATA = 6, + // CONFIG_SETTING = 7 + // }; + // + // =========================================================================== + xdr.enum('LedgerEntryType', { + account: 0, + trustline: 1, + offer: 2, + data: 3, + claimableBalance: 4, + liquidityPool: 5, + contractData: 6, + configSetting: 7 + }); + + // === 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 ============================================================ + // + // enum ConfigSettingType + // { + // CONFIG_SETTING_TYPE_UINT32 = 0 + // }; + // + // =========================================================================== + xdr.enum('ConfigSettingType', { + configSettingTypeUint32: 0 + }); + + // === xdr source ============================================================ + // + // union ConfigSetting switch (ConfigSettingType type) + // { + // case CONFIG_SETTING_TYPE_UINT32: + // uint32 uint32Val; + // }; + // + // =========================================================================== + xdr.union('ConfigSetting', { + switchOn: xdr.lookup('ConfigSettingType'), + switchName: 'type', + switches: [['configSettingTypeUint32', 'uint32Val']], + arms: { + uint32Val: xdr.lookup('Uint32') + } + }); + + // === xdr source ============================================================ + // + // enum ConfigSettingID + // { + // CONFIG_SETTING_CONTRACT_MAX_SIZE = 0 + // }; + // + // =========================================================================== + xdr.enum('ConfigSettingId', { + configSettingContractMaxSize: 0 + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union('ConfigSettingEntryExt', { + switchOn: xdr.int(), + switchName: 'v', + switches: [[0, xdr.void()]], + arms: {} + }); + + // === xdr source ============================================================ + // + // struct ConfigSettingEntry + // { + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // + // ConfigSettingID configSettingID; + // ConfigSetting setting; + // }; + // + // =========================================================================== + xdr.struct('ConfigSettingEntry', [ + ['ext', xdr.lookup('ConfigSettingEntryExt')], + ['configSettingId', xdr.lookup('ConfigSettingId')], + ['setting', xdr.lookup('ConfigSetting')] + ]); + + // === 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 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'], + ['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'), + 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 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 + // { + // 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 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'], + ['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'), + 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 + // }; + // + // =========================================================================== + xdr.enum('EnvelopeType', { + envelopeTypeTxV0: 0, + envelopeTypeScp: 1, + envelopeTypeTx: 2, + envelopeTypeAuth: 3, + envelopeTypeScpvalue: 4, + envelopeTypeTxFeeBump: 5, + envelopeTypeOpId: 6, + envelopeTypePoolRevokeOpId: 7, + envelopeTypeContractIdFromEd25519: 8, + envelopeTypeContractIdFromContract: 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 = 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 + // { + // ConfigSettingID id; // id to update + // ConfigSetting setting; // new value + // } + // + // =========================================================================== + xdr.struct('LedgerUpgradeConfigSetting', [ + ['id', xdr.lookup('ConfigSettingId')], + ['setting', xdr.lookup('ConfigSetting')] + ]); + + // === 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: + // struct + // { + // ConfigSettingID id; // id to update + // ConfigSetting setting; // new value + // } configSetting; + // }; + // + // =========================================================================== + xdr.union('LedgerUpgrade', { + switchOn: xdr.lookup('LedgerUpgradeType'), + switchName: 'type', + switches: [ + ['ledgerUpgradeVersion', 'newLedgerVersion'], + ['ledgerUpgradeBaseFee', 'newBaseFee'], + ['ledgerUpgradeMaxTxSetSize', 'newMaxTxSetSize'], + ['ledgerUpgradeBaseReserve', 'newBaseReserve'], + ['ledgerUpgradeFlags', 'newFlags'], + ['ledgerUpgradeConfig', 'configSetting'] + ], + arms: { + newLedgerVersion: xdr.lookup('Uint32'), + newBaseFee: xdr.lookup('Uint32'), + newMaxTxSetSize: xdr.lookup('Uint32'), + newBaseReserve: xdr.lookup('Uint32'), + newFlags: xdr.lookup('Uint32'), + configSetting: xdr.lookup('LedgerUpgradeConfigSetting') + } + }); + + // === 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 ============================================================ + // + // struct Auth + // { + // // Empty message, just to confirm + // // establishment of MAC keys. + // int unused; + // }; + // + // =========================================================================== + xdr.struct('Auth', [['unused', 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 + // }; + // + // =========================================================================== + 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 + }); + + // === 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 ============================================================ + // + // 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; + // }; + // + // =========================================================================== + 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'] + ], + 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') + } + }); + + // === 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 HostFunction + // { + // HOST_FN_CALL = 0, + // HOST_FN_CREATE_CONTRACT = 1 + // }; + // + // =========================================================================== + xdr.enum('HostFunction', { + hostFnCall: 0, + hostFnCreateContract: 1 + }); + + // === xdr source ============================================================ + // + // struct InvokeHostFunctionOp + // { + // // The host function to invoke + // HostFunction function; + // + // // Parameters to the host function + // SCVec parameters; + // + // // The footprint for this invocation + // LedgerFootprint footprint; + // }; + // + // =========================================================================== + xdr.struct('InvokeHostFunctionOp', [ + ['function', xdr.lookup('HostFunction')], + ['parameters', xdr.lookup('ScVec')], + ['footprint', xdr.lookup('LedgerFootprint')] + ]); + + // === 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 + // { + // uint256 ed25519; + // uint256 salt; + // } + // + // =========================================================================== + xdr.struct('HashIdPreimageEd25519ContractId', [ + ['ed25519', xdr.lookup('Uint256')], + ['salt', xdr.lookup('Uint256')] + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash contractID; + // uint256 salt; + // } + // + // =========================================================================== + xdr.struct('HashIdPreimageContractId', [ + ['contractId', xdr.lookup('Hash')], + ['salt', xdr.lookup('Uint256')] + ]); + + // === 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 + // { + // uint256 ed25519; + // uint256 salt; + // } ed25519ContractID; + // case ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT: + // struct + // { + // Hash contractID; + // uint256 salt; + // } contractID; + // }; + // + // =========================================================================== + xdr.union('HashIdPreimage', { + switchOn: xdr.lookup('EnvelopeType'), + switchName: 'type', + switches: [ + ['envelopeTypeOpId', 'operationId'], + ['envelopeTypePoolRevokeOpId', 'revokeId'], + ['envelopeTypeContractIdFromEd25519', 'ed25519ContractId'], + ['envelopeTypeContractIdFromContract', 'contractId'] + ], + arms: { + operationId: xdr.lookup('HashIdPreimageOperationId'), + revokeId: xdr.lookup('HashIdPreimageRevokeId'), + ed25519ContractId: xdr.lookup('HashIdPreimageEd25519ContractId'), + contractId: xdr.lookup('HashIdPreimageContractId') + } + }); + + // === 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: + // void; + // case INVOKE_HOST_FUNCTION_MALFORMED: + // case INVOKE_HOST_FUNCTION_TRAPPED: + // void; + // }; + // + // =========================================================================== + xdr.union('InvokeHostFunctionResult', { + switchOn: xdr.lookup('InvokeHostFunctionResultCode'), + switchName: 'code', + switches: [ + ['invokeHostFunctionSuccess', xdr.void()], + ['invokeHostFunctionMalformed', xdr.void()], + ['invokeHostFunctionTrapped', 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; + // } + // + // =========================================================================== + 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 ============================================================ + // + // 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)]]); + + // === xdr source ============================================================ + // + // typedef string SCSymbol<10>; + // + // =========================================================================== + xdr.typedef('ScSymbol', xdr.string(10)); + + // === xdr source ============================================================ + // + // enum SCValType + // { + // SCV_U63 = 0, + // SCV_U32 = 1, + // SCV_I32 = 2, + // SCV_STATIC = 3, + // SCV_OBJECT = 4, + // SCV_SYMBOL = 5, + // SCV_BITSET = 6, + // SCV_STATUS = 7 + // }; + // + // =========================================================================== + xdr.enum('ScValType', { + scvU63: 0, + scvU32: 1, + scvI32: 2, + scvStatic: 3, + scvObject: 4, + scvSymbol: 5, + scvBitset: 6, + scvStatus: 7 + }); + + // === xdr source ============================================================ + // + // enum SCStatic + // { + // SCS_VOID = 0, + // SCS_TRUE = 1, + // SCS_FALSE = 2, + // SCS_LEDGER_KEY_CONTRACT_CODE = 3 + // }; + // + // =========================================================================== + xdr.enum('ScStatic', { + scsVoid: 0, + scsTrue: 1, + scsFalse: 2, + scsLedgerKeyContractCode: 3 + }); + + // === 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 + // // TODO: add more + // }; + // + // =========================================================================== + xdr.enum('ScStatusType', { + sstOk: 0, + sstUnknownError: 1, + sstHostValueError: 2, + sstHostObjectError: 3, + sstHostFunctionError: 4, + sstHostStorageError: 5, + sstHostContextError: 6, + sstVmError: 7 + }); + + // === 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 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 errorCode; + // case SST_HOST_OBJECT_ERROR: + // SCHostObjErrorCode errorCode; + // case SST_HOST_FUNCTION_ERROR: + // SCHostFnErrorCode errorCode; + // case SST_HOST_STORAGE_ERROR: + // SCHostStorageErrorCode errorCode; + // case SST_HOST_CONTEXT_ERROR: + // SCHostContextErrorCode errorCode; + // case SST_VM_ERROR: + // SCVmErrorCode errorCode; + // }; + // + // =========================================================================== + xdr.union('ScStatus', { + switchOn: xdr.lookup('ScStatusType'), + switchName: 'type', + switches: [ + ['sstOk', xdr.void()], + ['sstUnknownError', 'unknownCode'], + ['sstHostValueError', 'errorCode'], + ['sstHostObjectError', 'errorCode'], + ['sstHostFunctionError', 'errorCode'], + ['sstHostStorageError', 'errorCode'], + ['sstHostContextError', 'errorCode'], + ['sstVmError', 'errorCode'] + ], + arms: { + unknownCode: xdr.lookup('ScUnknownErrorCode'), + errorCode: xdr.lookup('ScHostValErrorCode'), + errorCode: xdr.lookup('ScHostObjErrorCode'), + errorCode: xdr.lookup('ScHostFnErrorCode'), + errorCode: xdr.lookup('ScHostStorageErrorCode'), + errorCode: xdr.lookup('ScHostContextErrorCode'), + errorCode: xdr.lookup('ScVmErrorCode') + } + }); + + // === xdr source ============================================================ + // + // union SCVal switch (SCValType type) + // { + // case SCV_U63: + // int64 u63; + // case SCV_U32: + // uint32 u32; + // case SCV_I32: + // int32 i32; + // case SCV_STATIC: + // SCStatic ic; + // case SCV_OBJECT: + // SCObject* obj; + // case SCV_SYMBOL: + // SCSymbol sym; + // case SCV_BITSET: + // uint64 bits; + // case SCV_STATUS: + // SCStatus status; + // }; + // + // =========================================================================== + xdr.union('ScVal', { + switchOn: xdr.lookup('ScValType'), + switchName: 'type', + switches: [ + ['scvU63', 'u63'], + ['scvU32', 'u32'], + ['scvI32', 'i32'], + ['scvStatic', 'ic'], + ['scvObject', 'obj'], + ['scvSymbol', 'sym'], + ['scvBitset', 'bits'], + ['scvStatus', 'status'] + ], + arms: { + u63: xdr.lookup('Int64'), + u32: xdr.lookup('Uint32'), + i32: xdr.lookup('Int32'), + ic: xdr.lookup('ScStatic'), + obj: xdr.option(xdr.lookup('ScObject')), + sym: xdr.lookup('ScSymbol'), + bits: xdr.lookup('Uint64'), + status: xdr.lookup('ScStatus') + } + }); + + // === xdr source ============================================================ + // + // enum SCObjectType + // { + // // We have a few objects that represent non-stellar-specific concepts + // // like general-purpose maps, vectors, numbers, blobs. + // + // SCO_VEC = 0, + // SCO_MAP = 1, + // SCO_U64 = 2, + // SCO_I64 = 3, + // SCO_BYTES = 4, + // SCO_BIG_INT = 5, + // SCO_HASH = 6, + // SCO_PUBLIC_KEY = 7, + // SCO_CONTRACT_CODE = 8 + // + // // TODO: add more + // }; + // + // =========================================================================== + xdr.enum('ScObjectType', { + scoVec: 0, + scoMap: 1, + scoU64: 2, + scoI64: 3, + scoBytes: 4, + scoBigInt: 5, + scoHash: 6, + scoPublicKey: 7, + scoContractCode: 8 + }); + + // === xdr source ============================================================ + // + // struct SCMapEntry + // { + // SCVal key; + // SCVal val; + // }; + // + // =========================================================================== + xdr.struct('ScMapEntry', [ + ['key', xdr.lookup('ScVal')], + ['val', xdr.lookup('ScVal')] + ]); + + // === xdr source ============================================================ + // + // const SCVAL_LIMIT = 256000; + // + // =========================================================================== + xdr.const('SCVAL_LIMIT', 256000); + + // === 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 ============================================================ + // + // enum SCNumSign + // { + // NEGATIVE = -1, + // ZERO = 0, + // POSITIVE = 1 + // }; + // + // =========================================================================== + xdr.enum('ScNumSign', { + negative: -1, + zero: 0, + positive: 1 + }); + + // === xdr source ============================================================ + // + // union SCBigInt switch (SCNumSign sign) + // { + // case ZERO: + // void; + // case POSITIVE: + // case NEGATIVE: + // opaque magnitude<256000>; + // }; + // + // =========================================================================== + xdr.union('ScBigInt', { + switchOn: xdr.lookup('ScNumSign'), + switchName: 'sign', + switches: [ + ['zero', xdr.void()], + ['positive', 'magnitude'], + ['negative', 'magnitude'] + ], + arms: { + magnitude: xdr.varOpaque(256000) + } + }); + + // === xdr source ============================================================ + // + // enum SCHashType + // { + // SCHASH_SHA256 = 0 + // }; + // + // =========================================================================== + xdr.enum('ScHashType', { + schashSha256: 0 + }); + + // === xdr source ============================================================ + // + // union SCHash switch (SCHashType type) + // { + // case SCHASH_SHA256: + // Hash sha256; + // }; + // + // =========================================================================== + xdr.union('ScHash', { + switchOn: xdr.lookup('ScHashType'), + switchName: 'type', + switches: [['schashSha256', 'sha256']], + arms: { + sha256: xdr.lookup('Hash') + } + }); + + // === xdr source ============================================================ + // + // enum SCContractCodeType + // { + // SCCONTRACT_CODE_WASM = 0, + // SCCONTRACT_CODE_TOKEN = 1 + // }; + // + // =========================================================================== + xdr.enum('ScContractCodeType', { + sccontractCodeWasm: 0, + sccontractCodeToken: 1 + }); + + // === xdr source ============================================================ + // + // union SCContractCode switch (SCContractCodeType type) + // { + // case SCCONTRACT_CODE_WASM: + // opaque wasm; + // case SCCONTRACT_CODE_TOKEN: + // void; + // }; + // + // =========================================================================== + xdr.union('ScContractCode', { + switchOn: xdr.lookup('ScContractCodeType'), + switchName: 'type', + switches: [ + ['sccontractCodeWasm', 'wasm'], + ['sccontractCodeToken', xdr.void()] + ], + arms: { + wasm: xdr.varOpaque(SCVAL_LIMIT) + } + }); + + // === xdr source ============================================================ + // + // union SCObject switch (SCObjectType type) + // { + // case SCO_VEC: + // SCVec vec; + // case SCO_MAP: + // SCMap map; + // case SCO_U64: + // uint64 u64; + // case SCO_I64: + // int64 i64; + // case SCO_BYTES: + // opaque bin; + // case SCO_BIG_INT: + // SCBigInt bigInt; + // case SCO_HASH: + // SCHash hash; + // case SCO_PUBLIC_KEY: + // PublicKey publicKey; + // case SCO_CONTRACT_CODE: + // SCContractCode contractCode; + // }; + // + // =========================================================================== + xdr.union('ScObject', { + switchOn: xdr.lookup('ScObjectType'), + switchName: 'type', + switches: [ + ['scoVec', 'vec'], + ['scoMap', 'map'], + ['scoU64', 'u64'], + ['scoI64', 'i64'], + ['scoBytes', 'bin'], + ['scoBigInt', 'bigInt'], + ['scoHash', 'hash'], + ['scoPublicKey', 'publicKey'], + ['scoContractCode', 'contractCode'] + ], + arms: { + vec: xdr.lookup('ScVec'), + map: xdr.lookup('ScMap'), + u64: xdr.lookup('Uint64'), + i64: xdr.lookup('Int64'), + bin: xdr.varOpaque(SCVAL_LIMIT), + bigInt: xdr.lookup('ScBigInt'), + hash: xdr.lookup('ScHash'), + publicKey: xdr.lookup('PublicKey'), + contractCode: xdr.lookup('ScContractCode') + } + }); + + // === 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 ============================================================ + // + // enum SCSpecType + // { + // // Types with no parameters. + // SC_SPEC_TYPE_U32 = 1, + // SC_SPEC_TYPE_I32 = 2, + // SC_SPEC_TYPE_U64 = 3, + // SC_SPEC_TYPE_I64 = 4, + // SC_SPEC_TYPE_BOOL = 5, + // SC_SPEC_TYPE_SYMBOL = 6, + // SC_SPEC_TYPE_BITSET = 7, + // SC_SPEC_TYPE_STATUS = 8, + // SC_SPEC_TYPE_BYTES = 9, + // SC_SPEC_TYPE_BIG_INT = 10, + // + // // 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, + // + // // User defined types. + // SC_SPEC_TYPE_UDT = 2000 + // }; + // + // =========================================================================== + xdr.enum('ScSpecType', { + scSpecTypeU32: 1, + scSpecTypeI32: 2, + scSpecTypeU64: 3, + scSpecTypeI64: 4, + scSpecTypeBool: 5, + scSpecTypeSymbol: 6, + scSpecTypeBitset: 7, + scSpecTypeStatus: 8, + scSpecTypeBytes: 9, + scSpecTypeBigInt: 10, + scSpecTypeOption: 1000, + scSpecTypeResult: 1001, + scSpecTypeVec: 1002, + scSpecTypeSet: 1003, + scSpecTypeMap: 1004, + scSpecTypeTuple: 1005, + 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 SCSpecTypeUDT + // { + // string name<60>; + // }; + // + // =========================================================================== + xdr.struct('ScSpecTypeUdt', [['name', xdr.string(60)]]); + + // === xdr source ============================================================ + // + // union SCSpecTypeDef switch (SCSpecType type) + // { + // case SC_SPEC_TYPE_U64: + // case SC_SPEC_TYPE_I64: + // case SC_SPEC_TYPE_U32: + // case SC_SPEC_TYPE_I32: + // case SC_SPEC_TYPE_BOOL: + // case SC_SPEC_TYPE_SYMBOL: + // case SC_SPEC_TYPE_BITSET: + // case SC_SPEC_TYPE_STATUS: + // case SC_SPEC_TYPE_BYTES: + // case SC_SPEC_TYPE_BIG_INT: + // 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_UDT: + // SCSpecTypeUDT udt; + // }; + // + // =========================================================================== + xdr.union('ScSpecTypeDef', { + switchOn: xdr.lookup('ScSpecType'), + switchName: 'type', + switches: [ + ['scSpecTypeU64', xdr.void()], + ['scSpecTypeI64', xdr.void()], + ['scSpecTypeU32', xdr.void()], + ['scSpecTypeI32', xdr.void()], + ['scSpecTypeBool', xdr.void()], + ['scSpecTypeSymbol', xdr.void()], + ['scSpecTypeBitset', xdr.void()], + ['scSpecTypeStatus', xdr.void()], + ['scSpecTypeBytes', xdr.void()], + ['scSpecTypeBigInt', xdr.void()], + ['scSpecTypeOption', 'option'], + ['scSpecTypeResult', 'result'], + ['scSpecTypeVec', 'vec'], + ['scSpecTypeMap', 'map'], + ['scSpecTypeSet', 'set'], + ['scSpecTypeTuple', 'tuple'], + ['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'), + udt: xdr.lookup('ScSpecTypeUdt') + } + }); + + // === xdr source ============================================================ + // + // struct SCSpecUDTStructFieldV0 + // { + // string name<30>; + // SCSpecTypeDef type; + // }; + // + // =========================================================================== + xdr.struct('ScSpecUdtStructFieldV0', [ + ['name', xdr.string(30)], + ['type', xdr.lookup('ScSpecTypeDef')] + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTStructV0 + // { + // string name<60>; + // SCSpecUDTStructFieldV0 fields<40>; + // }; + // + // =========================================================================== + xdr.struct('ScSpecUdtStructV0', [ + ['name', xdr.string(60)], + ['fields', xdr.varArray(xdr.lookup('ScSpecUdtStructFieldV0'), 40)] + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionCaseV0 + // { + // string name<60>; + // SCSpecTypeDef *type; + // }; + // + // =========================================================================== + xdr.struct('ScSpecUdtUnionCaseV0', [ + ['name', xdr.string(60)], + ['type', xdr.option(xdr.lookup('ScSpecTypeDef'))] + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionV0 + // { + // string name<60>; + // SCSpecUDTUnionCaseV0 cases<50>; + // }; + // + // =========================================================================== + xdr.struct('ScSpecUdtUnionV0', [ + ['name', xdr.string(60)], + ['cases', xdr.varArray(xdr.lookup('ScSpecUdtUnionCaseV0'), 50)] + ]); + + // === xdr source ============================================================ + // + // struct SCSpecFunctionV0 + // { + // SCSymbol name; + // SCSpecTypeDef inputTypes<10>; + // SCSpecTypeDef outputTypes<1>; + // }; + // + // =========================================================================== + xdr.struct('ScSpecFunctionV0', [ + ['name', xdr.lookup('ScSymbol')], + ['inputTypes', xdr.varArray(xdr.lookup('ScSpecTypeDef'), 10)], + ['outputTypes', 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 + // }; + // + // =========================================================================== + xdr.enum('ScSpecEntryKind', { + scSpecEntryFunctionV0: 0, + scSpecEntryUdtStructV0: 1, + scSpecEntryUdtUnionV0: 2 + }); + + // === 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; + // }; + // + // =========================================================================== + xdr.union('ScSpecEntry', { + switchOn: xdr.lookup('ScSpecEntryKind'), + switchName: 'kind', + switches: [ + ['scSpecEntryFunctionV0', 'functionV0'], + ['scSpecEntryUdtStructV0', 'udtStructV0'], + ['scSpecEntryUdtUnionV0', 'udtUnionV0'] + ], + arms: { + functionV0: xdr.lookup('ScSpecFunctionV0'), + udtStructV0: xdr.lookup('ScSpecUdtStructV0'), + udtUnionV0: xdr.lookup('ScSpecUdtUnionV0') + } + }); }); export default types; diff --git a/src/index.js b/src/index.js index e1da16eda..e6197c9fb 100644 --- a/src/index.js +++ b/src/index.js @@ -1,45 +1,45 @@ /* eslint-disable import/no-import-module-exports */ -import xdr from "./xdr"; +import xdr from './xdr'; export { xdr }; -export { hash } from "./hashing"; -export { sign, verify, FastSigning } from "./signing"; +export { hash } from './hashing'; +export { sign, verify, FastSigning } from './signing'; export { getLiquidityPoolId, LiquidityPoolFeeV18 -} from "./get_liquidity_pool_id"; -export { Keypair } from "./keypair"; -export { UnsignedHyper, Hyper } from "js-xdr"; -export { TransactionBase } from "./transaction_base"; -export { Transaction } from "./transaction"; -export { FeeBumpTransaction } from "./fee_bump_transaction"; +} from './get_liquidity_pool_id'; +export { Keypair } from './keypair'; +export { UnsignedHyper, Hyper } from 'js-xdr'; +export { TransactionBase } from './transaction_base'; +export { Transaction } from './transaction'; +export { FeeBumpTransaction } from './fee_bump_transaction'; export { TransactionBuilder, TimeoutInfinite, BASE_FEE -} from "./transaction_builder"; -export { Asset } from "./asset"; -export { LiquidityPoolAsset } from "./liquidity_pool_asset"; -export { LiquidityPoolId } from "./liquidity_pool_id"; +} from './transaction_builder'; +export { Asset } from './asset'; +export { LiquidityPoolAsset } from './liquidity_pool_asset'; +export { LiquidityPoolId } from './liquidity_pool_id'; export { Operation, AuthRequiredFlag, AuthRevocableFlag, AuthImmutableFlag, AuthClawbackEnabledFlag -} from "./operation"; -export * from "./memo"; -export { Account } from "./account"; -export { MuxedAccount } from "./muxed_account"; -export { Claimant } from "./claimant"; -export { Networks } from "./network"; -export { StrKey } from "./strkey"; -export { SignerKey } from "./signerkey"; +} from './operation'; +export * from './memo'; +export { Account } from './account'; +export { MuxedAccount } from './muxed_account'; +export { Claimant } from './claimant'; +export { Networks } from './network'; +export { StrKey } from './strkey'; +export { SignerKey } from './signerkey'; export { decodeAddressToMuxedAccount, encodeMuxedAccountToAddress, extractBaseAddress, encodeMuxedAccount -} from "./util/decode_encode_muxed_account"; +} from './util/decode_encode_muxed_account'; export default module.exports; diff --git a/test/test-helper.js b/test/test-helper.js index e03b4224a..8f4bb937d 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -1,7 +1,7 @@ -if (typeof window === "undefined") { - require("@babel/register"); - global.StellarBase = require("../src/index"); - global.chai = require("chai"); - global.sinon = require("sinon"); +if (typeof window === 'undefined') { + require('@babel/register'); + global.StellarBase = require('../src/index'); + global.chai = require('chai'); + global.sinon = require('sinon'); global.expect = global.chai.expect; } diff --git a/test/unit/browser_test.js b/test/unit/browser_test.js index 081c67b95..2dc1d3ef8 100644 --- a/test/unit/browser_test.js +++ b/test/unit/browser_test.js @@ -1,7 +1,7 @@ -describe("Browser version tests", function() { - it("lodash is not exported globally", function() { - if (typeof window !== "undefined") { - expect(typeof _ === "undefined").to.be.true; +describe('Browser version tests', function() { + it('lodash is not exported globally', function() { + if (typeof window !== 'undefined') { + expect(typeof _ === 'undefined').to.be.true; } }); }); diff --git a/test/unit/hashing_test.js b/test/unit/hashing_test.js index 63d4e9338..545d2fd70 100644 --- a/test/unit/hashing_test.js +++ b/test/unit/hashing_test.js @@ -1,27 +1,27 @@ -describe("StellarBase#hash", function() { - it("hashes a string properly, using SHA256", function() { - let msg = "hello world"; +describe('StellarBase#hash', function() { + it('hashes a string properly, using SHA256', function() { + let msg = 'hello world'; let expectedHex = - "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - let actualHex = StellarBase.hash(msg).toString("hex"); + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'; + let actualHex = StellarBase.hash(msg).toString('hex'); expect(actualHex).to.eql(expectedHex); }); - it("hashes a buffer properly, using SHA256", function() { - let msg = Buffer.from("hello world", "utf8"); + it('hashes a buffer properly, using SHA256', function() { + let msg = Buffer.from('hello world', 'utf8'); let expectedHex = - "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - let actualHex = StellarBase.hash(msg).toString("hex"); + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'; + let actualHex = StellarBase.hash(msg).toString('hex'); expect(actualHex).to.eql(expectedHex); }); - it("hashes an array of bytes properly, using SHA256", function() { + it('hashes an array of bytes properly, using SHA256', function() { let msg = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; let expectedHex = - "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - let actualHex = StellarBase.hash(msg).toString("hex"); + 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'; + let actualHex = StellarBase.hash(msg).toString('hex'); expect(actualHex).to.eql(expectedHex); }); diff --git a/test/unit/memo_test.js b/test/unit/memo_test.js index 42c6bfe27..91e56c2d7 100644 --- a/test/unit/memo_test.js +++ b/test/unit/memo_test.js @@ -1,11 +1,11 @@ -describe("Memo.constructor()", function() { - it("throws error when type is invalid", function() { - expect(() => new StellarBase.Memo("test")).to.throw(/Invalid memo type/); +describe('Memo.constructor()', function() { + it('throws error when type is invalid', function() { + expect(() => new StellarBase.Memo('test')).to.throw(/Invalid memo type/); }); }); -describe("Memo.none()", function() { - it("converts to/from xdr object", function() { +describe('Memo.none()', function() { + it('converts to/from xdr object', function() { let memo = StellarBase.Memo.none().toXDRObject(); expect(memo.value()).to.be.undefined; @@ -15,17 +15,17 @@ describe("Memo.none()", function() { }); }); -describe("Memo.text()", function() { - it("returns a value for a correct argument", function() { - expect(() => StellarBase.Memo.text("test")).to.not.throw(); - let memoUtf8 = StellarBase.Memo.text("三代之時"); +describe('Memo.text()', function() { + it('returns a value for a correct argument', function() { + expect(() => StellarBase.Memo.text('test')).to.not.throw(); + let memoUtf8 = StellarBase.Memo.text('三代之時'); - let a = Buffer.from(memoUtf8.toXDRObject().value(), "utf8"); - let b = Buffer.from("三代之時", "utf8"); + let a = Buffer.from(memoUtf8.toXDRObject().value(), 'utf8'); + let b = Buffer.from('三代之時', 'utf8'); expect(a).to.be.deep.equal(b); }); - it("returns a value for a correct argument (utf8)", function() { + it('returns a value for a correct argument (utf8)', function() { let memoText = StellarBase.Memo.text([0xd1]) .toXDRObject() .toXDR(); @@ -54,20 +54,20 @@ describe("Memo.text()", function() { expect(memoText.equals(expected)).to.be.true; }); - it("converts to/from xdr object", function() { - let memo = StellarBase.Memo.text("test").toXDRObject(); - expect(memo.arm()).to.equal("text"); - expect(memo.text()).to.equal("test"); - expect(memo.value()).to.equal("test"); + it('converts to/from xdr object', function() { + let memo = StellarBase.Memo.text('test').toXDRObject(); + expect(memo.arm()).to.equal('text'); + expect(memo.text()).to.equal('test'); + expect(memo.value()).to.equal('test'); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoText); - expect(baseMemo.value).to.be.equal("test"); + expect(baseMemo.value).to.be.equal('test'); }); - it("converts to/from xdr object (array)", function() { + it('converts to/from xdr object (array)', function() { let memo = StellarBase.Memo.text([0xd1]).toXDRObject(); - expect(memo.arm()).to.equal("text"); + expect(memo.arm()).to.equal('text'); expect(memo.text()).to.be.deep.equal([0xd1]); expect(memo.value()).to.be.deep.equal([0xd1]); @@ -77,10 +77,10 @@ describe("Memo.text()", function() { expect(baseMemo.value).to.be.deep.equal([0xd1]); }); - it("converts to/from xdr object (buffer)", function() { + it('converts to/from xdr object (buffer)', function() { let buf = Buffer.from([0xd1]); let memo = StellarBase.Memo.text(buf).toXDRObject(); - expect(memo.arm()).to.equal("text"); + expect(memo.arm()).to.equal('text'); expect(memo.text().equals(buf)).to.be.true; expect(memo.value().equals(buf)).to.be.true; @@ -90,7 +90,7 @@ describe("Memo.text()", function() { expect(baseMemo.value.equals(buf)).to.be.true; }); - it("throws an error when invalid argument was passed", function() { + it('throws an error when invalid argument was passed', function() { expect(() => StellarBase.Memo.text()).to.throw( /Expects string, array or buffer, max 28 bytes/ ); @@ -108,94 +108,94 @@ describe("Memo.text()", function() { ); }); - it("throws an error when string is longer than 28 bytes", function() { + it('throws an error when string is longer than 28 bytes', function() { expect(() => - StellarBase.Memo.text("12345678901234567890123456789") + StellarBase.Memo.text('12345678901234567890123456789') ).to.throw(/Expects string, array or buffer, max 28 bytes/); - expect(() => StellarBase.Memo.text("三代之時三代之時三代之時")).to.throw( + expect(() => StellarBase.Memo.text('三代之時三代之時三代之時')).to.throw( /Expects string, array or buffer, max 28 bytes/ ); }); }); -describe("Memo.id()", function() { - it("returns a value for a correct argument", function() { - expect(() => StellarBase.Memo.id("1000")).to.not.throw(); - expect(() => StellarBase.Memo.id("0")).to.not.throw(); +describe('Memo.id()', function() { + it('returns a value for a correct argument', function() { + expect(() => StellarBase.Memo.id('1000')).to.not.throw(); + expect(() => StellarBase.Memo.id('0')).to.not.throw(); }); - it("converts to/from xdr object", function() { - let memo = StellarBase.Memo.id("1000").toXDRObject(); - expect(memo.arm()).to.equal("id"); - expect(memo.id().toString()).to.equal("1000"); + it('converts to/from xdr object', function() { + let memo = StellarBase.Memo.id('1000').toXDRObject(); + expect(memo.arm()).to.equal('id'); + expect(memo.id().toString()).to.equal('1000'); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoID); - expect(baseMemo.value).to.be.equal("1000"); + expect(baseMemo.value).to.be.equal('1000'); }); - it("throws an error when invalid argument was passed", function() { + it('throws an error when invalid argument was passed', function() { expect(() => StellarBase.Memo.id()).to.throw(/Expects a int64/); expect(() => StellarBase.Memo.id({})).to.throw(/Expects a int64/); expect(() => StellarBase.Memo.id(Infinity)).to.throw(/Expects a int64/); expect(() => StellarBase.Memo.id(NaN)).to.throw(/Expects a int64/); - expect(() => StellarBase.Memo.id("test")).to.throw(/Expects a int64/); + expect(() => StellarBase.Memo.id('test')).to.throw(/Expects a int64/); }); }); -describe("Memo.hash() & Memo.return()", function() { - it("hash converts to/from xdr object", function() { +describe('Memo.hash() & Memo.return()', function() { + it('hash converts to/from xdr object', function() { let buffer = Buffer.alloc(32, 10); let memo = StellarBase.Memo.hash(buffer).toXDRObject(); - expect(memo.arm()).to.equal("hash"); + expect(memo.arm()).to.equal('hash'); expect(memo.hash().length).to.equal(32); expect(memo.hash()).to.deep.equal(buffer); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoHash); expect(baseMemo.value.length).to.equal(32); - expect(baseMemo.value.toString("hex")).to.be.equal(buffer.toString("hex")); + expect(baseMemo.value.toString('hex')).to.be.equal(buffer.toString('hex')); }); - it("return converts to/from xdr object", function() { + it('return converts to/from xdr object', function() { let buffer = Buffer.alloc(32, 10); // Testing string hash - let memo = StellarBase.Memo.return(buffer.toString("hex")).toXDRObject(); - expect(memo.arm()).to.equal("retHash"); + let memo = StellarBase.Memo.return(buffer.toString('hex')).toXDRObject(); + expect(memo.arm()).to.equal('retHash'); expect(memo.retHash().length).to.equal(32); - expect(memo.retHash().toString("hex")).to.equal(buffer.toString("hex")); + expect(memo.retHash().toString('hex')).to.equal(buffer.toString('hex')); let baseMemo = StellarBase.Memo.fromXDRObject(memo); expect(baseMemo.type).to.be.equal(StellarBase.MemoReturn); expect(Buffer.isBuffer(baseMemo.value)).to.be.true; expect(baseMemo.value.length).to.equal(32); - expect(baseMemo.value.toString("hex")).to.be.equal(buffer.toString("hex")); + expect(baseMemo.value.toString('hex')).to.be.equal(buffer.toString('hex')); }); var methods = [StellarBase.Memo.hash, StellarBase.Memo.return]; - it("returns a value for a correct argument", function() { + it('returns a value for a correct argument', function() { for (let i in methods) { let method = methods[i]; expect(() => method(Buffer.alloc(32))).to.not.throw(); expect(() => method( - "0000000000000000000000000000000000000000000000000000000000000000" + '0000000000000000000000000000000000000000000000000000000000000000' ) ).to.not.throw(); } }); - it("throws an error when invalid argument was passed", function() { + it('throws an error when invalid argument was passed', function() { for (let i in methods) { let method = methods[i]; expect(() => method()).to.throw(/Expects a 32 byte hash value/); expect(() => method({})).to.throw(/Expects a 32 byte hash value/); expect(() => method(Infinity)).to.throw(/Expects a 32 byte hash value/); expect(() => method(NaN)).to.throw(/Expects a 32 byte hash value/); - expect(() => method("test")).to.throw(/Expects a 32 byte hash value/); + expect(() => method('test')).to.throw(/Expects a 32 byte hash value/); expect(() => method([0, 10, 20])).to.throw( /Expects a 32 byte hash value/ ); @@ -203,11 +203,11 @@ describe("Memo.hash() & Memo.return()", function() { /Expects a 32 byte hash value/ ); expect(() => - method("00000000000000000000000000000000000000000000000000000000000000") + method('00000000000000000000000000000000000000000000000000000000000000') ).to.throw(/Expects a 32 byte hash value/); expect(() => method( - "000000000000000000000000000000000000000000000000000000000000000000" + '000000000000000000000000000000000000000000000000000000000000000000' ) ).to.throw(/Expects a 32 byte hash value/); } diff --git a/test/unit/signing_test.js b/test/unit/signing_test.js index 045d75287..2f1f859c1 100644 --- a/test/unit/signing_test.js +++ b/test/unit/signing_test.js @@ -1,68 +1,68 @@ // NOTE: key and signature constants were generated using rbnacl let seed = Buffer.from( - "1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4", - "hex" + '1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4', + 'hex' ); let publicKey = Buffer.from( - "ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437", - "hex" + 'ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437', + 'hex' ); let secretKey = Buffer.from( - "1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437", - "hex" + '1123740522f11bfef6b3671f51e159ccf589ccf8965262dd5f97d1721d383dd4ffbdd7ef9933fe7249dc5ca1e7120b6d7b7b99a7a367e1a2fc6cb062fe420437', + 'hex' ); -describe("StellarBase#sign", function() { +describe('StellarBase#sign', function() { let expectedSig = - "587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309"; + '587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309'; - it("can sign an string properly", function() { - let data = "hello world"; - let actualSig = StellarBase.sign(data, secretKey).toString("hex"); + it('can sign an string properly', function() { + let data = 'hello world'; + let actualSig = StellarBase.sign(data, secretKey).toString('hex'); expect(actualSig).to.eql(expectedSig); }); - it("can sign an buffer properly", function() { - let data = Buffer.from("hello world", "utf8"); - let actualSig = StellarBase.sign(data, secretKey).toString("hex"); + it('can sign an buffer properly', function() { + let data = Buffer.from('hello world', 'utf8'); + let actualSig = StellarBase.sign(data, secretKey).toString('hex'); expect(actualSig).to.eql(expectedSig); }); - it("can sign an array of bytes properly", function() { + it('can sign an array of bytes properly', function() { let data = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; - let actualSig = StellarBase.sign(data, secretKey).toString("hex"); + let actualSig = StellarBase.sign(data, secretKey).toString('hex'); expect(actualSig).to.eql(expectedSig); }); }); -describe("StellarBase#verify", function() { +describe('StellarBase#verify', function() { let sig = Buffer.from( - "587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309", - "hex" + '587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309', + 'hex' ); let badSig = Buffer.from( - "687d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309", - "hex" + '687d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309', + 'hex' ); - it("can verify an string properly", function() { - let data = "hello world"; + it('can verify an string properly', function() { + let data = 'hello world'; expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; - expect(StellarBase.verify("corrupted", sig, publicKey)).to.not.be.ok; + expect(StellarBase.verify('corrupted', sig, publicKey)).to.not.be.ok; expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); - it("can verify an buffer properly", function() { - let data = Buffer.from("hello world", "utf8"); + it('can verify an buffer properly', function() { + let data = Buffer.from('hello world', 'utf8'); expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; - expect(StellarBase.verify("corrupted", sig, publicKey)).to.not.be.ok; + expect(StellarBase.verify('corrupted', sig, publicKey)).to.not.be.ok; expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); - it("can verify an array of bytes properly", function() { + it('can verify an array of bytes properly', function() { let data = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; - expect(StellarBase.verify("corrupted", sig, publicKey)).to.not.be.ok; + expect(StellarBase.verify('corrupted', sig, publicKey)).to.not.be.ok; expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); }); diff --git a/test/unit/strkey_test.js b/test/unit/strkey_test.js index ee90aeec8..a891c120b 100644 --- a/test/unit/strkey_test.js +++ b/test/unit/strkey_test.js @@ -1,7 +1,7 @@ -describe("StrKey", function() { +describe('StrKey', function() { beforeEach(function() { var keypair = StellarBase.Keypair.master( - "Test SDF Network ; September 2015" + 'Test SDF Network ; September 2015' ); this.unencodedBuffer = keypair.rawPublicKey(); this.unencoded = this.unencodedBuffer.toString(); @@ -10,8 +10,8 @@ describe("StrKey", function() { this.unencodedBuffer ); }); - describe("#decodeCheck", function() { - it("decodes correctly", function() { + describe('#decodeCheck', function() { + it('decodes correctly', function() { expect( StellarBase.StrKey.decodeEd25519PublicKey(this.accountIdEncoded) ).to.eql(this.unencodedBuffer); @@ -20,90 +20,90 @@ describe("StrKey", function() { ).to.eql(this.unencodedBuffer); }); - it("throws an error when the version byte is wrong", function() { + it('throws an error when the version byte is wrong', function() { expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - "GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL" + 'GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL' ) ).to.throw(/invalid version/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - "SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU" + 'SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCU' ) ).to.throw(/invalid version/); }); - it("throws an error when decoded data encodes to other string", function() { + it('throws an error when decoded data encodes to other string', function() { // accountId expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - "GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL" + 'GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - "GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++" + 'GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - "GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA" + 'GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2" + 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T" + 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T' ) ).to.throw(/invalid encoded string/); // seed expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - "SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYW" + 'SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYW' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - "SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2" + 'SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - "SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2T" + 'SB7OJNF5727F3RJUG5ASQJ3LUM44ELLNKW35ZZQDHMVUUQNGYWMEGB2W2T' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - "SCMB30FQCIQAWZ4WQTS6SVK37LGMAFJGXOZIHTH2PY6EXLP37G46H6DT" + 'SCMB30FQCIQAWZ4WQTS6SVK37LGMAFJGXOZIHTH2PY6EXLP37G46H6DT' ) ).to.throw(/invalid encoded string/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - "SAYC2LQ322EEHZYWNSKBEW6N66IRTDREEBUXXU5HPVZGMAXKLIZNM45H++" + 'SAYC2LQ322EEHZYWNSKBEW6N66IRTDREEBUXXU5HPVZGMAXKLIZNM45H++' ) ).to.throw(/invalid encoded string/); }); - it("throws an error when the checksum is wrong", function() { + it('throws an error when the checksum is wrong', function() { expect(() => StellarBase.StrKey.decodeEd25519PublicKey( - "GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVT" + 'GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVT' ) ).to.throw(/invalid checksum/); expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( - "SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCX" + 'SBGWKM3CD4IL47QN6X54N6Y33T3JDNVI6AIJ6CD5IM47HG3IG4O36XCX' ) ).to.throw(/invalid checksum/); }); }); - describe("#encodeCheck", function() { - it("encodes a buffer correctly", function() { + describe('#encodeCheck', function() { + it('encodes a buffer correctly', function() { expect( StellarBase.StrKey.encodeEd25519PublicKey(this.unencodedBuffer) ).to.eql(this.accountIdEncoded); @@ -132,7 +132,7 @@ describe("StrKey", function() { ); }); - it("encodes a buffer correctly", function() { + it('encodes a buffer correctly', function() { expect( StellarBase.StrKey.encodeEd25519PublicKey(this.unencodedBuffer) ).to.eql(this.accountIdEncoded); @@ -141,7 +141,7 @@ describe("StrKey", function() { ).to.eql(this.seedEncoded); }); - it("throws an error when the data is null", function() { + it('throws an error when the data is null', function() { expect(() => StellarBase.StrKey.encodeEd25519SecretSeed(null)).to.throw( /null data/ ); @@ -151,19 +151,19 @@ describe("StrKey", function() { }); }); - describe("#isValidEd25519PublicKey", function() { - it("returns true for valid public key", function() { + describe('#isValidEd25519PublicKey', function() { + it('returns true for valid public key', function() { var keys = [ - "GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB", - "GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT", - "GD6WVYRVID442Y4JVWFWKWCZKB45UGHJAABBJRS22TUSTWGJYXIUR7N2", - "GBCG42WTVWPO4Q6OZCYI3D6ZSTFSJIXIS6INCIUF23L6VN3ADE4337AP", - "GDFX463YPLCO2EY7NGFMI7SXWWDQAMASGYZXCG2LATOF3PP5NQIUKBPT", - "GBXEODUMM3SJ3QSX2VYUWFU3NRP7BQRC2ERWS7E2LZXDJXL2N66ZQ5PT", - "GAJHORKJKDDEPYCD6URDFODV7CVLJ5AAOJKR6PG2VQOLWFQOF3X7XLOG", - "GACXQEAXYBEZLBMQ2XETOBRO4P66FZAJENDHOQRYPUIXZIIXLKMZEXBJ", - "GDD3XRXU3G4DXHVRUDH7LJM4CD4PDZTVP4QHOO4Q6DELKXUATR657OZV", - "GDTYVCTAUQVPKEDZIBWEJGKBQHB4UGGXI2SXXUEW7LXMD4B7MK37CWLJ" + 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', + 'GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT', + 'GD6WVYRVID442Y4JVWFWKWCZKB45UGHJAABBJRS22TUSTWGJYXIUR7N2', + 'GBCG42WTVWPO4Q6OZCYI3D6ZSTFSJIXIS6INCIUF23L6VN3ADE4337AP', + 'GDFX463YPLCO2EY7NGFMI7SXWWDQAMASGYZXCG2LATOF3PP5NQIUKBPT', + 'GBXEODUMM3SJ3QSX2VYUWFU3NRP7BQRC2ERWS7E2LZXDJXL2N66ZQ5PT', + 'GAJHORKJKDDEPYCD6URDFODV7CVLJ5AAOJKR6PG2VQOLWFQOF3X7XLOG', + 'GACXQEAXYBEZLBMQ2XETOBRO4P66FZAJENDHOQRYPUIXZIIXLKMZEXBJ', + 'GDD3XRXU3G4DXHVRUDH7LJM4CD4PDZTVP4QHOO4Q6DELKXUATR657OZV', + 'GDTYVCTAUQVPKEDZIBWEJGKBQHB4UGGXI2SXXUEW7LXMD4B7MK37CWLJ' ]; for (var i in keys) { @@ -171,19 +171,19 @@ describe("StrKey", function() { } }); - it("returns false for invalid public key", function() { + it('returns false for invalid public key', function() { var keys = [ - "GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL", - "GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++", - "GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA", - "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2", - "GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T", - "GDXIIZTKTLVYCBHURXL2UPMTYXOVNI7BRAEFQCP6EZCY4JLKY4VKFNLT", - "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY", - "gWRYUerEKuz53tstxEuR3NCkiQDcV4wzFHmvLnZmj7PUqxW2wt", - "test", + 'GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', + 'GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++', + 'GADE5QJ2TY7S5ZB65Q43DFGWYWCPHIYDJ2326KZGAGBN7AE5UY6JVDRRA', + 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2', + 'GB6OWYST45X57HCJY5XWOHDEBULB6XUROWPIKW77L5DSNANBEQGUPADT2T', + 'GDXIIZTKTLVYCBHURXL2UPMTYXOVNI7BRAEFQCP6EZCY4JLKY4VKFNLT', + 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', + 'gWRYUerEKuz53tstxEuR3NCkiQDcV4wzFHmvLnZmj7PUqxW2wt', + 'test', null, - "g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk" // Old network key + 'g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk' // Old network key ]; for (var i in keys) { @@ -192,15 +192,15 @@ describe("StrKey", function() { }); }); - describe("#isValidSecretKey", function() { - it("returns true for valid secret key", function() { + describe('#isValidSecretKey', function() { + it('returns true for valid secret key', function() { var keys = [ - "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY", - "SCZTUEKSEH2VYZQC6VLOTOM4ZDLMAGV4LUMH4AASZ4ORF27V2X64F2S2", - "SCGNLQKTZ4XCDUGVIADRVOD4DEVNYZ5A7PGLIIZQGH7QEHK6DYODTFEH", - "SDH6R7PMU4WIUEXSM66LFE4JCUHGYRTLTOXVUV5GUEPITQEO3INRLHER", - "SC2RDTRNSHXJNCWEUVO7VGUSPNRAWFCQDPP6BGN4JFMWDSEZBRAPANYW", - "SCEMFYOSFZ5MUXDKTLZ2GC5RTOJO6FGTAJCF3CCPZXSLXA2GX6QUYOA7" + 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', + 'SCZTUEKSEH2VYZQC6VLOTOM4ZDLMAGV4LUMH4AASZ4ORF27V2X64F2S2', + 'SCGNLQKTZ4XCDUGVIADRVOD4DEVNYZ5A7PGLIIZQGH7QEHK6DYODTFEH', + 'SDH6R7PMU4WIUEXSM66LFE4JCUHGYRTLTOXVUV5GUEPITQEO3INRLHER', + 'SC2RDTRNSHXJNCWEUVO7VGUSPNRAWFCQDPP6BGN4JFMWDSEZBRAPANYW', + 'SCEMFYOSFZ5MUXDKTLZ2GC5RTOJO6FGTAJCF3CCPZXSLXA2GX6QUYOA7' ]; for (var i in keys) { @@ -208,13 +208,13 @@ describe("StrKey", function() { } }); - it("returns false for invalid secret key", function() { + it('returns false for invalid secret key', function() { var keys = [ - "GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB", - "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDYT", // Too long - "SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEV", // To short - "SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEVIT", // Checksum - "test", + 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', + 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDYT', // Too long + 'SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEV', // To short + 'SAFGAMN5Z6IHVI3IVEPIILS7ITZDYSCEPLN4FN5Z3IY63DRH4CIYEVIT', // Checksum + 'test', null ]; @@ -225,16 +225,16 @@ describe("StrKey", function() { }); }); - const PUBKEY = "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ"; + const PUBKEY = 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ'; const MPUBKEY = - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK"; + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK'; const RAW_MPUBKEY = Buffer.from( - "3f0c34bf93ad0d9971d04ccc90f705511c838aad9734a4a2fb0d7a03fc7fe89a8000000000000000", - "hex" + '3f0c34bf93ad0d9971d04ccc90f705511c838aad9734a4a2fb0d7a03fc7fe89a8000000000000000', + 'hex' ); - describe("#muxedAccounts", function() { - it("encodes & decodes M... addresses correctly", function() { + describe('#muxedAccounts', function() { + it('encodes & decodes M... addresses correctly', function() { expect(StellarBase.StrKey.encodeMed25519PublicKey(RAW_MPUBKEY)).to.equal( MPUBKEY ); @@ -243,7 +243,7 @@ describe("StrKey", function() { ).to.be.true; }); - it("lets G... accounts pass through (unmuxed)", function() { + it('lets G... accounts pass through (unmuxed)', function() { const unmuxed = StellarBase.decodeAddressToMuxedAccount(PUBKEY); expect(StellarBase.xdr.MuxedAccount.isValid(unmuxed)).to.be.true; @@ -258,7 +258,7 @@ describe("StrKey", function() { expect(StellarBase.encodeMuxedAccountToAddress(unmuxed)).to.equal(PUBKEY); }); - it("decodes underlying G... address correctly", function() { + it('decodes underlying G... address correctly', function() { expect(StellarBase.extractBaseAddress(MPUBKEY)).to.equal(PUBKEY); expect(StellarBase.extractBaseAddress(PUBKEY)).to.equal(PUBKEY); }); @@ -266,7 +266,7 @@ describe("StrKey", function() { const RAW_PUBKEY = StellarBase.StrKey.decodeEd25519PublicKey(PUBKEY); const unmuxed = StellarBase.xdr.MuxedAccount.keyTypeEd25519(RAW_PUBKEY); - it("encodes & decodes unmuxed keys", function() { + it('encodes & decodes unmuxed keys', function() { expect(StellarBase.xdr.MuxedAccount.isValid(unmuxed)).to.be.true; expect(unmuxed.switch()).to.equal( StellarBase.xdr.CryptoKeyType.keyTypeEd25519() @@ -280,27 +280,27 @@ describe("StrKey", function() { const CASES = [ { strkey: - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK", - id: "9223372036854775808" // 0x8000... + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK', + id: '9223372036854775808' // 0x8000... }, { strkey: - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAFB4CJJBRKA", - id: "1357924680" + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAFB4CJJBRKA', + id: '1357924680' }, { strkey: - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAE2JUG6", - id: "1234" + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAE2JUG6', + id: '1234' }, { strkey: - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ", - id: "0" + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ', + id: '0' } ]; - CASES.forEach(testCase => { + CASES.forEach((testCase) => { it(`encodes & decodes muxed key w/ ID=${testCase.id}`, function() { const muxed = StellarBase.decodeAddressToMuxedAccount(testCase.strkey); expect(StellarBase.xdr.MuxedAccount.isValid(muxed)).to.be.true; @@ -319,97 +319,97 @@ describe("StrKey", function() { }); }); - describe("#signedPayloads", function() { + describe('#signedPayloads', function() { const HAPPY_PATHS = [ { - desc: "valid w/ 32-byte payload", + desc: 'valid w/ 32-byte payload', strkey: - "PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAQACAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUPB6IBZGM", - ed25519: "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ", + 'PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAQACAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUPB6IBZGM', + ed25519: 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ', payload: - "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20" + '0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20' }, { - desc: "valid w/ 29-byte payload", + desc: 'valid w/ 29-byte payload', strkey: - "PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAOQCAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUAAAAFGBU", - ed25519: "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ", - payload: "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d" + 'PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAOQCAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUAAAAFGBU', + ed25519: 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ', + payload: '0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d' } ]; - HAPPY_PATHS.forEach(testCase => { + HAPPY_PATHS.forEach((testCase) => { it(testCase.desc, function() { const spBuf = StellarBase.StrKey.decodeSignedPayload(testCase.strkey); const sp = StellarBase.xdr.SignerKeyEd25519SignedPayload.fromXDR( spBuf, - "raw" + 'raw' ); const signer = StellarBase.StrKey.encodeEd25519PublicKey(sp.ed25519()); expect(signer).to.equal(testCase.ed25519); - const payload = sp.payload().toString("hex"); + const payload = sp.payload().toString('hex'); expect(payload).to.equal(testCase.payload); - const str = StellarBase.StrKey.encodeSignedPayload(sp.toXDR("raw")); + const str = StellarBase.StrKey.encodeSignedPayload(sp.toXDR('raw')); expect(str).to.equal(testCase.strkey); }); }); - describe("payload bounds", function() { + describe('payload bounds', function() { let sp = new StellarBase.xdr.SignerKeyEd25519SignedPayload({ ed25519: StellarBase.StrKey.decodeEd25519PublicKey( - "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ" + 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ' ), payload: Buffer.alloc(0) }); - const isValid = sp => { + const isValid = (sp) => { return StellarBase.StrKey.isValidSignedPayload( - StellarBase.StrKey.encodeSignedPayload(sp.toXDR("raw")) + StellarBase.StrKey.encodeSignedPayload(sp.toXDR('raw')) ); }; - it("invalid with no payload", function() { + it('invalid with no payload', function() { sp.payload(Buffer.alloc(0)); expect(isValid(sp)).to.be.false; }); - it("valid with 1-byte payload", function() { + it('valid with 1-byte payload', function() { sp.payload(Buffer.alloc(1)); expect(isValid(sp)).to.be.true; }); - it("throws with 65-byte payload", function() { + it('throws with 65-byte payload', function() { sp.payload(Buffer.alloc(65)); expect(() => isValid(sp)).to.throw(/XDR Write Error/); }); - it("valid with 64-byte payload (max)", function() { + it('valid with 64-byte payload (max)', function() { sp.payload(Buffer.alloc(64)); expect(isValid(sp)).to.be.true; }); }); }); - describe("#invalidStrKeys", function() { + describe('#invalidStrKeys', function() { // From https://stellar.org/protocol/sep-23#invalid-test-cases const BAD_STRKEYS = [ // The unused trailing bit must be zero in the encoding of the last three // bytes (24 bits) as five base-32 symbols (25 bits) - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUR", + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUR', // Invalid length (congruent to 1 mod 8) - "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZA", + 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZA', // Invalid algorithm (low 3 bits of version byte are 7) - "G47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVP2I", + 'G47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVP2I', // Invalid length (congruent to 6 mod 8) - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLKA", + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLKA', // Invalid algorithm (low 3 bits of version byte are 7) - "M47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ", + 'M47QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ', // Padding bytes are not allowed - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUK===", + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUK===', // Invalid checksum - "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUO" + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUO' // // FIXME: The following test cases don't pass (i.e. don't throw). @@ -437,7 +437,7 @@ describe("StrKey", function() { // 'PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAOQCAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DXFH6' ]; - BAD_STRKEYS.forEach(address => { + BAD_STRKEYS.forEach((address) => { it(`fails in expected case ${address}`, function() { const vb = StellarBase.StrKey.getVersionByteForPrefix(address); expect(() => StellarBase.StrKey.decodeCheck(vb, address)).to.throw(); From 9d5e339ce01f7b93e233f323af2fa3f4ce910ae5 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 3 Apr 2023 19:34:10 -0700 Subject: [PATCH 04/25] Update GHA to new commands --- .github/workflows/gh_pages.yml | 2 +- .github/workflows/npm_publish.yml | 2 +- .github/workflows/tests.yml | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index b94519c7e..53f7aa2c2 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -21,7 +21,7 @@ jobs: run: yarn install - name: Build - run: gulp + run: yarn run version - name: Checkout GH pages uses: actions/checkout@v2 diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 9896aa535..8ce068fd8 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -20,7 +20,7 @@ jobs: run: yarn - name: Build - run: gulp + run: yarn run version - name: Publish npm package run: yarn publish diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d4b251796..e469b590f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,14 +26,11 @@ jobs: - name: Install Dependencies run: yarn install - - name: Build - run: gulp - - name: Run Node Tests run: yarn test - name: Run Browser Tests - run: gulp test:browser + run: yarn test:browser - name: Run Linter - run: yarn dtslint + run: yarn tslint From 947a699b8b9070ed42caa067a0c07d06c7077fc4 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 3 Apr 2023 20:36:13 -0700 Subject: [PATCH 05/25] Upgrade *all* the things, drop unused sauce --- .github/workflows/npm_publish.yml | 4 +- .github/workflows/tests.yml | 2 +- .gitignore | 2 + CONTRIBUTING.md | 6 +- cfg/karma-sauce.conf.js | 52 -- cfg/karma.conf.js | 5 +- cfg/webpack.config.js | 2 +- package.json | 48 +- yarn.lock | 1263 ++++++++--------------------- 9 files changed, 356 insertions(+), 1028 deletions(-) delete mode 100644 cfg/karma-sauce.conf.js diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 8ce068fd8..d0b6f5489 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -19,8 +19,8 @@ jobs: - name: Install Depencencies run: yarn - - name: Build - run: yarn run version + - name: Test & Build + run: yarn preversion - name: Publish npm package run: yarn publish diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e469b590f..3ef5a0e92 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: run: yarn install - name: Run Node Tests - run: yarn test + run: yarn test:node - name: Run Browser Tests run: yarn test:browser diff --git a/.gitignore b/.gitignore index 2d31f36b8..4cfd5da72 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.nvmrc +.nyc_output/ /node_modules/ /tmp/ /lib/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 593aee725..608febe14 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ Then please [sign the Contributor License Agreement](https://docs.google.com/for # Releasing -SDK maintainers should follow [semantic versioning](https://semver.org/) best practices for releasing the SDK. +SDK maintainers should follow [semantic versioning](https://semver.org/) best practices for releasing the SDK. Use your best judgement when deciding on when to craft a release: maybe enough changes have accumulated to warrant a release, maybe there's a high-urgency fix that needs to be published immediately, or maybe you can put it off for a particular feature. It's all dependent on what else is going on. @@ -22,9 +22,9 @@ Once all of the PRs for a particular release are in, it's time to actually publi - [ ] Ensure that all of the PRs in this delta are accurately reflected in the [CHANGELOG](./CHANGELOG.md), broken down by impact and linking to the corresponding PRs. Update the file if necessary. - - [ ] Update the top-level `"version"` field in the [package.json](./package.json) file to reflect the new version. + - [ ] Run `yarn preversion` to build and test an optimized bundle and ensure Typescript compatibility (one of the most common sources of bugs, since this library is written purely in JS but must be usable from TS). - - [ ] Run the final sanity check to ensure the builds pass: `yarn dtslint && yarn test && yarn preversion`. The first command checks that you have Typescript compatibility (one of the most common sources of bugs, since this library is written purely in JS but must be usable from TS). + - [ ] Run `yarn version` to update the version number in the package.json (or modify the `"version"` field manually). - [ ] Commit & push your branch, then [create a PR](https://github.com/stellar/js-stellar-base/compare). diff --git a/cfg/karma-sauce.conf.js b/cfg/karma-sauce.conf.js deleted file mode 100644 index 82392c538..000000000 --- a/cfg/karma-sauce.conf.js +++ /dev/null @@ -1,52 +0,0 @@ -var webpackConfig = require('./webpack.config.browser.js'); -delete webpackConfig.output; -webpackConfig.entry = {}; // karma fills these in - -module.exports = function(config) { - var customLaunchers = { - sl_chrome: { - base: 'SauceLabs', - browserName: 'chrome', - platform: 'Windows 8.1', - version: '49' - }, - sl_firefox: { - base: 'SauceLabs', - browserName: 'firefox', - platform: 'Windows 8.1', - version: '44' - }, - sl_ie_11: { - base: 'SauceLabs', - browserName: 'internet explorer', - platform: 'Windows 8.1', - version: 'latest' - } - }; - - config.set({ - sauceLabs: { - testName: 'js-stellar-base', - recordScreenshots: false, - recordVideo: false - }, - frameworks: ['mocha', 'sinon-chai'], - customLaunchers: customLaunchers, - browsers: Object.keys(customLaunchers), - - files: ['../dist/stellar-base.min.js', '../test/unit/**/*.js'], - - preprocessors: { - '../test/unit/**/*.js': ['webpack'] - }, - - webpack: webpackConfig, - webpackMiddleware: { - noInfo: true - }, - - singleRun: true, - - reporters: ['dots', 'saucelabs'] - }); -}; diff --git a/cfg/karma.conf.js b/cfg/karma.conf.js index 027e0d434..741040ed3 100644 --- a/cfg/karma.conf.js +++ b/cfg/karma.conf.js @@ -5,7 +5,10 @@ webpackConfig.entry = {}; // karma fills these in module.exports = function(config) { config.set({ frameworks: ['mocha', 'sinon-chai'], - browsers: ['FirefoxHeadless', 'ChromeHeadless'], + browsers: [ + 'FirefoxHeadless', + 'ChromeHeadless', + ], files: [ '../dist/stellar-base.js', // webpack should build this first diff --git a/cfg/webpack.config.js b/cfg/webpack.config.js index e229ff7ea..c34c6e23c 100644 --- a/cfg/webpack.config.js +++ b/cfg/webpack.config.js @@ -23,7 +23,7 @@ const config = { path: path.resolve(__dirname, '../dist') }, mode: process.env.NODE_ENV, - devtool: process.env.NODE_ENV === 'production' ? null : 'inline-source-map', + devtool: process.env.NODE_ENV === 'production' ? false : 'inline-source-map', module: { rules: [ { diff --git a/package.json b/package.json index a3ce0c426..77b0d3493 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,13 @@ "types": "./types/index.d.ts", "scripts": { "build": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.js", - "build:browser": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.browser.js", - "test": "yarn clean && yarn build && nyc mocha --recursive", - "test:browser": "yarn build:browser && karma start ./cfg/karma.conf.js && karma start ./cfg/karma-sauce.conf.js", - "test:all": "yarn test && yarn test:browser && yarn tslint", + "test": "yarn build && yarn test:node", + "test:node": "nyc mocha --recursive", + "test:browser": "yarn build && karma start ./cfg/karma.conf.js", + "test:all": "yarn test:node && yarn test:browser && yarn tslint", "docs": "jsdoc -c ./cfg/.jsdoc.json --verbose", "tslint": "dtslint --localTs node_modules/typescript/lib types/", - "preversion": "yarn test:all", - "version": "cross-env NODE_ENV=production yarn build", - "postversion": "git push && git push --tags", + "preversion": "yarn clean && yarn cross-env NODE_ENV=production webpack -c ./cfg/webpack.config.js && yarn test:all", "pretty": "prettier --config ./cfg/prettier.config.js --write './**/*.js'", "clean": "rm -rf dist/ coverage/" }, @@ -23,7 +21,8 @@ "@babel/register", "./test/test-helper.js" ], - "reporter": "dot" + "reporter": "dot", + "timeout": 5000 }, "files": [ "/lib", @@ -65,36 +64,35 @@ "@babel/register": "^7.21.0", "@definitelytyped/dtslint": "^0.0.159", "@istanbuljs/nyc-config-babel": "3.0.0", - "@types/node": "^11.13.0", + "@types/node": "^18.15.11", "babel-loader": "^9.1.2", "babel-plugin-istanbul": "^6.1.1", + "buffer": "^6.0.3", "chai": "^4.3.7", - "clear": "^0.1.0", - "del": "^5.1.0", + "cross-env": "^7.0.3", "eslint": "^8.37.0", "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-prettier": "^3.6.0", + "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.25.2", - "eslint-plugin-node": "^8.0.1", + "eslint-plugin-node": "^11.1.0", "eslint-plugin-prefer-import": "^0.0.1", - "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-prettier": "^4.2.1", "eslint-webpack-plugin": "^4.0.0", - "ghooks": "^0.3.0", - "husky": "^1.3.1", - "jsdoc": "^3.5.5", + "ghooks": "^2.0.4", + "husky": "^8.0.3", + "jsdoc": "^4.0.2", "karma": "^6.4.1", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.1", "karma-mocha": "^2.0.0", - "karma-sauce-launcher": "2.0.2", "karma-sinon-chai": "^2.0.2", "karma-webpack": "^5.0.0", "lint-staged": "^13.2.0", "minami": "^1.1.1", - "mocha": "^7.1.1", - "mocha-loader": "^5.1.5", + "mocha": "^10.2.0", + "node-polyfill-webpack-plugin": "^2.0.1", "nyc": "^15.1.0", - "prettier": "^1.16.1", + "prettier": "^2.8.7", "randombytes": "^2.1.0", "sinon": "^15.0.3", "sinon-chai": "^3.7.0", @@ -105,15 +103,11 @@ }, "dependencies": { "base32.js": "^0.1.0", - "bignumber.js": "^4.0.0", - "buffer": "^6.0.3", - "crc": "^3.5.0", - "cross-env": "^7.0.3", + "bignumber.js": "^9.1.1", + "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "debug": "^4.3.1", "js-xdr": "^1.1.3", "lodash": "^4.17.21", - "node-polyfill-webpack-plugin": "^2.0.1", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3", "typescript": "^5.0.3" diff --git a/yarn.lock b/yarn.lock index 8ed046fb9..2e953160b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -291,7 +291,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.4", "@babel/parser@^7.9.4": +"@babel/parser@^7.14.7", "@babel/parser@^7.20.15", "@babel/parser@^7.20.7", "@babel/parser@^7.21.4": version "7.21.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17" integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw== @@ -1206,6 +1206,13 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@jsdoc/salty@^0.2.1": + version "0.2.5" + resolved "https://registry.yarnpkg.com/@jsdoc/salty/-/salty-0.2.5.tgz#1b2fa5bb8c66485b536d86eee877c263d322f692" + integrity sha512-TfRP53RqunNe2HBobVBJ0VLhK1HbfvBYeTC1ahnN64PWvyYyGebmMiPkuwvD9fpw2ZbkoPb8Q7mwy0aR8Z9rvw== + dependencies: + lodash "^4.17.21" + "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": version "2.1.8-no-fsevents.3" resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" @@ -1361,14 +1368,6 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== -"@types/glob@^7.1.1": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" - integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== - dependencies: - "@types/minimatch" "*" - "@types/node" "*" - "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.4" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" @@ -1416,21 +1415,11 @@ resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== -"@types/minimatch@*": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" - integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== - -"@types/node@*", "@types/node@>=10.0.0": +"@types/node@*", "@types/node@>=10.0.0", "@types/node@^18.15.11": version "18.15.11" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== -"@types/node@^11.13.0": - version "11.15.54" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.15.54.tgz#59ed60e7b0d56905a654292e8d73275034eb6283" - integrity sha512-1RWYiq+5UfozGsU6MwJyFX6BtktcT10XRjvcAQmskCtMcW3tPske88lM/nHv7BQG1w9KBXI1zPGuu5PnNCX14g== - "@types/node@^14.14.35": version "14.18.42" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.42.tgz#fa39b2dc8e0eba61bdf51c66502f84e23b66e114" @@ -1723,25 +1712,6 @@ acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== -adm-zip@~0.4.3: - version "0.4.16" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" - integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -agent-base@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" - integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== - dependencies: - es6-promisify "^5.0.0" - aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" @@ -1789,10 +1759,10 @@ ajv@^8.0.0, ajv@^8.8.0: require-from-string "^2.0.2" uri-js "^4.2.2" -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== +ansi-colors@4.1.1: + version "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" @@ -1806,16 +1776,6 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== -ansi-regex@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" - integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== - -ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -1831,7 +1791,7 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -1850,7 +1810,7 @@ ansi-styles@^6.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== -anymatch@~3.1.1, anymatch@~3.1.2: +anymatch@~3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== @@ -1944,17 +1904,6 @@ array.prototype.flatmap@^1.3.1: es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" -array.prototype.reduce@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" - integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.7" - asn1.js@^5.2.0: version "5.4.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" @@ -1997,13 +1946,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async@^2.1.2: - version "2.6.4" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" - integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== - dependencies: - lodash "^4.17.14" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -2103,15 +2045,10 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -bignumber.js@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" - integrity sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA== +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== binary-extensions@^2.0.0: version "2.2.0" @@ -2168,6 +2105,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -2266,7 +2210,7 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -buffer@^5.1.0, buffer@^5.5.0: +buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -2320,25 +2264,6 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ== - dependencies: - callsites "^2.0.0" - -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A== - dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ== - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2349,10 +2274,15 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +camelcase@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + caniuse-lite@^1.0.30001449: - version "1.0.30001473" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001473.tgz#3859898b3cab65fc8905bb923df36ad35058153c" - integrity sha512-ewDad7+D2vlyy+E4UJuVfiBsU69IL+8oVmTuZnH5Q6CIUbxNfI50uVpRHbUPDD6SUaN2o0Lh4DhTrvLG/Tn1yg== + version "1.0.30001474" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz#13b6fe301a831fe666cce8ca4ef89352334133d5" + integrity sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q== caseless@~0.12.0: version "0.12.0" @@ -2395,7 +2325,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.4.2: +chalk@^2.0.0, chalk@^2.3.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2404,7 +2334,7 @@ chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0: +chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2424,22 +2354,7 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.2.0" - optionalDependencies: - fsevents "~2.1.1" - -chokidar@^3.4.0, chokidar@^3.5.1: +chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.5.1: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -2464,11 +2379,6 @@ chrome-trace-event@^1.0.2: resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - ci-info@^3.2.0: version "3.8.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" @@ -2487,11 +2397,6 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -clear@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/clear/-/clear-0.1.0.tgz#b81b1e03437a716984fd7ac97c87d73bdfe7048a" - integrity sha512-qMjRnoL+JDPJHeLePZJuao6+8orzHMGP04A8CdwCNsKhRbOnKRjefxONR7bwILT3MHecxKBjHkKL/tkZ8r4Uzw== - cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -2515,15 +2420,6 @@ cli-truncate@^3.1.0: slice-ansi "^5.0.0" string-width "^5.0.0" -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -2585,6 +2481,11 @@ colorette@^2.0.14, colorette@^2.0.19: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== +colors@~0.6.0-1: + version "0.6.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" + integrity sha512-OsSVtHK8Ir8r3+Fxw/b4jS1ZLPXkV6ZxDRJQzeD7qo0SqMXWrHDM71DgYzPMHY8SFJ0Ao+nNU2p1MmwdzKqPrw== + combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -2597,6 +2498,13 @@ 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@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + integrity sha512-bmkUukX8wAOjHdN26xj5c4ctEV22TQ7dQYhSmuckKhToXrkUn0iIaolHdIxYYqD55nhpSPA9zPQ1yP57GdXP2A== + dependencies: + graceful-readlink ">= 1.0.0" + commander@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.0.tgz#71797971162cd3cf65f0b9d24eb28f8d303acdf1" @@ -2617,6 +2525,11 @@ commander@^9.4.1: resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== +commander@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781" + integrity sha512-J2wnb6TKniXNOtoHS8TSrG9IOQluPrsmyAJ8oCUJOBmv+uLBCyPYAZkD2jFvw2DCzIXNnISIM01NIvr35TkBMQ== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -2707,22 +2620,10 @@ cors@~2.8.5: object-assign "^4" vary "^1" -cosmiconfig@^5.0.7: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - -crc@^3.5.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6" - integrity sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ== - dependencies: - buffer "^5.1.0" +crc@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/crc/-/crc-4.3.2.tgz#49b7821cbf2cf61dfd079ed93863bbebd5469b9a" + integrity sha512-uGDHf4KLLh2zsHa8D8hIQ1H/HtFQhyHrc0uhHBcoKGol/Xnb+MPYfUMw7cvON6ze/GUESTudKayDcJC5HnJv1A== create-ecdh@^4.0.0: version "4.0.4" @@ -2767,17 +2668,6 @@ cross-env@^7.0.3: dependencies: cross-spawn "^7.0.1" -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2804,27 +2694,6 @@ crypto-browserify@^3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -css-loader@^5.0.0: - version "5.2.7" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-5.2.7.tgz#9b9f111edf6fb2be5dc62525644cbc9c232064ae" - integrity sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg== - dependencies: - icss-utils "^5.1.0" - loader-utils "^2.0.0" - postcss "^8.2.15" - postcss-modules-extract-imports "^3.0.0" - postcss-modules-local-by-default "^4.0.0" - postcss-modules-scope "^3.0.0" - postcss-modules-values "^4.0.0" - postcss-value-parser "^4.1.0" - schema-utils "^3.0.0" - semver "^7.3.5" - -cssesc@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" - integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== - custom-event@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" @@ -2849,21 +2718,14 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: +debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -debug@^3.1.0, debug@^3.2.7: +debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -2875,6 +2737,11 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + deep-eql@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" @@ -2894,7 +2761,7 @@ default-require-extensions@^3.0.0: dependencies: strip-bom "^4.0.0" -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: +define-properties@^1.1.3, define-properties@^1.1.4: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== @@ -2902,20 +2769,6 @@ define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" -del@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/del/-/del-5.1.0.tgz#d9487c94e367410e6eff2925ee58c0c84a75b3a7" - integrity sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA== - dependencies: - globby "^10.0.1" - graceful-fs "^4.2.2" - is-glob "^4.0.1" - is-path-cwd "^2.2.0" - is-path-inside "^3.0.1" - p-map "^3.0.0" - rimraf "^3.0.0" - slash "^3.0.0" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -2949,7 +2802,12 @@ di@^0.0.1: resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" integrity sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA== -diff@3.5.0, diff@^3.2.0: +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== @@ -3045,11 +2903,6 @@ elliptic@^6.5.3: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -3060,17 +2913,12 @@ emoji-regex@^9.2.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== -emojis-list@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" - integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== - encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== -end-of-stream@^1.1.0, end-of-stream@^1.4.1: +end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== @@ -3121,13 +2969,6 @@ envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - 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" @@ -3168,11 +3009,6 @@ es-abstract@^1.19.0, es-abstract@^1.20.4: unbox-primitive "^1.0.2" which-typed-array "^1.1.9" -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== - es-module-lexer@^0.9.0: version "0.9.3" resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" @@ -3213,18 +3049,6 @@ es6-object-assign@^1.1.0: resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c" integrity sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw== -es6-promise@^4.0.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ== - dependencies: - es6-promise "^4.0.3" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -3235,7 +3059,12 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== @@ -3245,11 +3074,6 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - eslint-config-airbnb-base@^15.0.0: version "15.0.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236" @@ -3260,12 +3084,10 @@ eslint-config-airbnb-base@^15.0.0: object.entries "^1.1.5" semver "^6.3.0" -eslint-config-prettier@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.6.0.tgz#8ca3ffac4bd6eeef623a0651f9d754900e3ec217" - integrity sha512-ixJ4U3uTLXwJts4rmSVW/lMXjlGwCijhBJHk8iVqKKSifeI0qgFEfWl8L63isfc8Od7EiBALF6BX3jKLluf/jQ== - dependencies: - get-stdin "^6.0.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-import-resolver-node@^0.3.7: version "0.3.7" @@ -3283,13 +3105,13 @@ eslint-module-utils@^2.7.4: dependencies: debug "^3.2.7" -eslint-plugin-es@^1.3.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-1.4.1.tgz#12acae0f4953e76ba444bfd1b2271081ac620998" - integrity sha512-5fa/gR2yR3NxQf+UXkeLeP8FBBl6tSgdrAz1+cF84v1FMM4twGwQoqTnn+QxFLcPOrF4pdKEJKDB/q9GoyJrCA== +eslint-plugin-es@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" + integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== dependencies: - eslint-utils "^1.4.2" - regexpp "^2.0.1" + eslint-utils "^2.0.0" + regexpp "^3.0.0" eslint-plugin-import@^2.25.2: version "2.27.5" @@ -3312,27 +3134,27 @@ eslint-plugin-import@^2.25.2: semver "^6.3.0" tsconfig-paths "^3.14.1" -eslint-plugin-node@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-8.0.1.tgz#55ae3560022863d141fa7a11799532340a685964" - integrity sha512-ZjOjbjEi6jd82rIpFSgagv4CHWzG9xsQAVp1ZPlhRnnYxcTgENUVBvhYmkQ7GvT1QFijUSo69RaiOJKhMu6i8w== +eslint-plugin-node@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" + integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== dependencies: - eslint-plugin-es "^1.3.1" - eslint-utils "^1.3.1" - ignore "^5.0.2" + eslint-plugin-es "^3.0.0" + eslint-utils "^2.0.0" + ignore "^5.1.1" minimatch "^3.0.4" - resolve "^1.8.1" - semver "^5.5.0" + resolve "^1.10.1" + semver "^6.1.0" eslint-plugin-prefer-import@^0.0.1: version "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@^3.0.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5" - integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g== +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== dependencies: prettier-linter-helpers "^1.0.0" @@ -3352,10 +3174,10 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^1.3.1, eslint-utils@^1.4.2: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== +eslint-utils@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" @@ -3497,19 +3319,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^7.0.0: version "7.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-7.1.1.tgz#3eb3c83d239488e7b409d48e8813b76bb55c9c43" @@ -3550,7 +3359,7 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-glob@^3.0.3, fast-glob@^3.2.9: +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== @@ -3633,7 +3442,15 @@ find-cache-dir@^3.2.0, find-cache-dir@^3.3.2: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@3.0.0, find-up@^3.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" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== @@ -3648,13 +3465,13 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.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" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== +findup@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/findup/-/findup-0.1.5.tgz#8ad929a3393bac627957a7e5de4623b06b0e2ceb" + integrity sha512-Udxo3C9A6alt2GZ2MNsgnIvX7De0V3VGxeP/x98NSVgSlizcDHdmJza61LI7zJy4OEtSiJyE72s0/+tBl5/ZxA== dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" + colors "~0.6.0-1" + commander "~2.1.0" flat-cache@^3.0.4: version "3.0.4" @@ -3664,12 +3481,10 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" -flat@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" - integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== - dependencies: - is-buffer "~2.0.3" +flat@^5.0.2: + version "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: version "3.2.7" @@ -3755,11 +3570,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" @@ -3838,18 +3648,6 @@ 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-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.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" @@ -3870,14 +3668,19 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -ghooks@^0.3.0: - version "0.3.2" - resolved "https://registry.yarnpkg.com/ghooks/-/ghooks-0.3.2.tgz#a1fa85dede71eecc19faca9ee163c3cdfc1b94d0" - integrity sha512-cS/MAstTJ4x3jDWZtNc/EDrd45nNbuqQEjLQXkqCHFWyLJxrG4n05yA9heBxEhnsrg04RxAHiS51WtwJNMPIDw== +ghooks@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/ghooks/-/ghooks-2.0.4.tgz#fd50e040ff548906ae42cb51793a01bfe24567b9" + integrity sha512-Ey6PSgelTufntLJBUQZsSHHeRg1PjsjM1oOS+0lpExHqXGjrL5uyQVQdOIlf2WR5EBJVdJbJlCdSHAVt+uZmNA== dependencies: - spawn-command "^0.0.2" + findup "0.1.5" + lodash.clone "4.5.0" + manage-path "2.0.0" + opt-cli "1.5.1" + path-exists "3.0.0" + spawn-command "0.0.2" -glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -3896,10 +3699,10 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3939,20 +3742,6 @@ globalthis@^1.0.3: dependencies: define-properties "^1.1.3" -globby@^10.0.1: - version "10.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.2.tgz#277593e745acaa4646c3ab411289ec47a0392543" - integrity sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg== - dependencies: - "@types/glob" "^7.1.1" - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.0.3" - glob "^7.1.3" - ignore "^5.1.1" - merge2 "^1.2.3" - slash "^3.0.0" - globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" @@ -3972,21 +3761,21 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== +"graceful-readlink@>= 1.0.0": + version "1.0.1" + 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== -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -4034,7 +3823,7 @@ has-proto@^1.0.1: resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== -has-symbols@^1.0.0, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -4097,11 +3886,6 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - hosted-git-info@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" @@ -4148,42 +3932,15 @@ 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== -https-proxy-agent@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" - integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== - dependencies: - agent-base "^4.3.0" - debug "^3.1.0" - -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - human-signals@^4.3.0: version "4.3.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== -husky@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-1.3.1.tgz#26823e399300388ca2afff11cfa8a86b0033fae0" - integrity sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg== - dependencies: - cosmiconfig "^5.0.7" - execa "^1.0.0" - find-up "^3.0.0" - get-stdin "^6.0.0" - is-ci "^2.0.0" - pkg-dir "^3.0.0" - please-upgrade-node "^3.1.1" - read-pkg "^4.0.1" - run-node "^1.0.0" - slash "^2.0.0" +husky@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" + integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== iconv-lite@0.4.24: version "0.4.24" @@ -4192,34 +3949,16 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -icss-utils@^5.0.0, icss-utils@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" - integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== - ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.0.2, ignore@^5.1.1, ignore@^5.2.0: +ignore@^5.1.1, ignore@^5.2.0: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== - -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg== - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -4290,11 +4029,6 @@ is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: get-intrinsic "^1.2.0" is-typed-array "^1.1.10" -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" @@ -4317,23 +4051,11 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-buffer@~2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - is-core-module@^2.11.0, is-core-module@^2.5.0, is-core-module@^2.9.0: version "2.11.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" @@ -4348,11 +4070,6 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw== - is-docker@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" @@ -4370,11 +4087,6 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -4424,16 +4136,16 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-path-cwd@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" - integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== - -is-path-inside@^3.0.1, is-path-inside@^3.0.3: +is-path-inside@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -4456,11 +4168,6 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== - is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -4501,6 +4208,11 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" @@ -4675,13 +4387,12 @@ js-xdr@^1.1.3: lodash "^4.17.5" long "^2.2.3" -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== +js-yaml@4.1.0, js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: - argparse "^1.0.7" - esprima "^4.0.0" + argparse "^2.0.1" js-yaml@^3.13.1, js-yaml@^3.7.0: version "3.14.1" @@ -4691,13 +4402,6 @@ js-yaml@^3.13.1, js-yaml@^3.7.0: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - js2xmlparser@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" @@ -4710,12 +4414,13 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== -jsdoc@^3.5.5: - version "3.6.11" - resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.11.tgz#8bbb5747e6f579f141a5238cbad4e95e004458ce" - integrity sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg== +jsdoc@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-4.0.2.tgz#a1273beba964cf433ddf7a70c23fd02c3c60296e" + integrity sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg== dependencies: - "@babel/parser" "^7.9.4" + "@babel/parser" "^7.20.15" + "@jsdoc/salty" "^0.2.1" "@types/markdown-it" "^12.2.3" bluebird "^3.7.2" catharsis "^0.9.0" @@ -4728,7 +4433,6 @@ jsdoc@^3.5.5: mkdirp "^1.0.4" requizzle "^0.2.3" strip-json-comments "^3.1.0" - taffydb "2.6.2" underscore "~1.13.2" jsesc@^2.5.1: @@ -4741,11 +4445,6 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - 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" @@ -4790,7 +4489,7 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.2.2: +json5@^2.2.2: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -4817,16 +4516,6 @@ jsprim@^1.2.2: json-schema "0.4.0" verror "1.10.0" -jszip@^3.10.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2" - integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g== - dependencies: - lie "~3.3.0" - pako "~1.0.2" - readable-stream "~2.3.6" - setimmediate "^1.0.5" - just-extend@^4.0.2: version "4.2.1" resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744" @@ -4854,15 +4543,6 @@ karma-mocha@^2.0.0: dependencies: minimist "^1.2.3" -karma-sauce-launcher@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" - integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== - dependencies: - sauce-connect-launcher "^1.2.4" - saucelabs "^1.5.0" - selenium-webdriver "^4.0.0-alpha.1" - karma-sinon-chai@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/karma-sinon-chai/-/karma-sinon-chai-2.0.2.tgz#e28c109b989973abafc28a7c9f09ef24a05e07c2" @@ -4927,13 +4607,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lie@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" - integrity sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ== - dependencies: - immediate "~3.0.5" - lilconfig@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" @@ -4984,15 +4657,6 @@ loader-runner@^4.2.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== -loader-utils@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" - integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -5015,6 +4679,23 @@ locate-path@^6.0.0: dependencies: p-locate "^5.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" + integrity sha512-nOtLg6tdIdD+TehqBv0WI7jbkLaohHhKSwLmS/UXSFWMWWUxdJc9EVtAfD4L0mV15vV+lZVfF4LEo363VdrMBw== + +lodash.clone@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.3.2.tgz#e56b176b6823a7dde38f7f2bf58de7d5971200e9" + integrity sha512-Yc/0UmZvWkFsbx7NB4feSX5bSX03SR0ft8CTkI8RCb3w/TzT71HXew2iNDm0aml93P49tIR/NJHOIoE+XEKz9A== + dependencies: + lodash._baseclone "~4.5.0" + +lodash.clone@4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" + integrity sha512-GhrVeweiTD6uTmmn5hV/lzgCQhccwReIVRLHp7LT4SopOjqEZ5BbX8b5WWEtAKasjmy8hR7ZPwsYlxRCku5odg== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -5035,17 +4716,18 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.16.6, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.5: +lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: - chalk "^2.4.2" + chalk "^4.1.0" + is-unicode-supported "^0.1.0" log-update@^4.0.0: version "4.0.0" @@ -5114,6 +4796,11 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +manage-path@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/manage-path/-/manage-path-2.0.0.tgz#f4cf8457b926eeee2a83b173501414bc76eb9597" + integrity sha512-NJhyB+PJYTpxhxZJ3lecIGgh4kwIY2RAh44XvAz9UlqthlQwtPBf62uBVR8XaD8CRuSjQ6TnZH2lNJkbLPZM2A== + markdown-it-anchor@^8.4.1: version "8.6.7" resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz#ee6926daf3ad1ed5e4e3968b1740eef1c6399634" @@ -5159,7 +4846,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -5222,12 +4909,12 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -minimatch@3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== dependencies: - brace-expansion "^1.1.7" + brace-expansion "^2.0.1" minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" @@ -5236,7 +4923,7 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -5261,13 +4948,6 @@ minizlib@^2.1.1: minipass "^3.0.0" yallist "^4.0.0" -mkdirp@0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@^0.5.5: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" @@ -5280,70 +4960,52 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mocha-loader@^5.1.5: - version "5.1.5" - resolved "https://registry.yarnpkg.com/mocha-loader/-/mocha-loader-5.1.5.tgz#40e9163a17e4662e5d8851de93dca509fe4b5455" - integrity sha512-NfcFycKc9uAWmkLos/azir6XQknrzebY5qjEEyFhd423bVNkCoAbgaRmiV75j0nufmkZTCDBhm8NJ8WlTNbAQQ== +mocha@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" + integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== dependencies: - css-loader "^5.0.0" - loader-utils "^2.0.0" - schema-utils "^3.0.0" - style-loader "^2.0.0" - -mocha@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" - integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== - dependencies: - ansi-colors "3.2.3" + ansi-colors "4.1.1" browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.1.1: +ms@2.1.3, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@^3.3.4: - version "3.3.6" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" - integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== natural-compare-lite@^1.4.0: version "1.4.0" @@ -5365,11 +5027,6 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - nise@^5.1.4: version "5.1.4" resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.4.tgz#491ce7e7307d4ec546f5a659b2efe94a18b4bbc0" @@ -5381,14 +5038,6 @@ nise@^5.1.4: just-extend "^4.0.2" path-to-regexp "^1.7.0" -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - node-gyp-build@^4.3.0: version "4.6.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" @@ -5437,16 +5086,6 @@ node-releases@^2.0.8: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - "normalize-package-data@~1.0.1 || ^2.0.0 || ^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" @@ -5471,13 +5110,6 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: semver "^7.3.4" validate-npm-package-name "^3.0.0" -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== - dependencies: - path-key "^2.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" @@ -5556,21 +5188,11 @@ object-is@^1.0.1: call-bind "^1.0.2" define-properties "^1.1.3" -object-keys@^1.0.11, object-keys@^1.1.1: +object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - object.assign@^4.1.2, object.assign@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" @@ -5590,16 +5212,6 @@ object.entries@^1.1.5: define-properties "^1.1.4" es-abstract "^1.20.4" -object.getownpropertydescriptors@^2.0.3: - version "2.1.5" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz#db5a9002489b64eef903df81d6623c07e5b4b4d3" - integrity sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw== - dependencies: - array.prototype.reduce "^1.0.5" - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - object.values@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" @@ -5623,7 +5235,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== @@ -5644,6 +5256,16 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" +opt-cli@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/opt-cli/-/opt-cli-1.5.1.tgz#04db447b13c96b992eb31685266f4ed0d9736dc2" + integrity sha512-iRFQBiQjXZ+LX/8pis04prUhS6FOYcJiZRouofN3rUJEB282b/e0s3jp9vT7aHgXY6TUpgPwu12f0i+qF40Kjw== + dependencies: + commander "2.9.0" + lodash.clone "4.3.2" + 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" @@ -5661,11 +5283,6 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -5730,7 +5347,7 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" -pako@~1.0.2, pako@~1.0.5: +pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== @@ -5753,14 +5370,6 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -5776,7 +5385,7 @@ path-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== -path-exists@^3.0.0: +path-exists@3.0.0, path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== @@ -5791,11 +5400,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== - path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -5859,11 +5463,6 @@ pidtree@^0.6.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== - pify@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" @@ -5888,63 +5487,6 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -please-upgrade-node@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - -postcss-modules-extract-imports@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" - integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== - -postcss-modules-local-by-default@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" - integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== - dependencies: - icss-utils "^5.0.0" - postcss-selector-parser "^6.0.2" - postcss-value-parser "^4.1.0" - -postcss-modules-scope@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" - integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== - dependencies: - postcss-selector-parser "^6.0.4" - -postcss-modules-values@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" - integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== - dependencies: - icss-utils "^5.0.0" - -postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: - version "6.0.11" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" - integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g== - dependencies: - cssesc "^3.0.0" - util-deprecate "^1.0.2" - -postcss-value-parser@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" - integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== - -postcss@^8.2.15: - version "8.4.21" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" - integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -5957,10 +5499,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^1.16.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@^2.8.7: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== process-nextick-args@~2.0.0: version "2.0.1" @@ -5996,14 +5538,6 @@ public-encrypt@^4.0.0: randombytes "^2.0.1" safe-buffer "^5.1.2" -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" @@ -6076,16 +5610,7 @@ raw-body@2.5.2: iconv-lite "0.4.24" unpipe "1.0.0" -read-pkg@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" - integrity sha512-+UBirHHDm5J+3WDmLBZYSklRYg82nMlz+enn+GMZ22nSR2f4bzxmhso6rzQW/3mT2PVzpzDTiYIZahk8UmZ44w== - dependencies: - normalize-package-data "^2.3.2" - parse-json "^4.0.0" - pify "^3.0.0" - -readable-stream@^2.0.6, readable-stream@~2.3.6: +readable-stream@^2.0.6: version "2.3.8" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== @@ -6117,13 +5642,6 @@ readable-stream@^4.0.0: events "^3.3.0" process "^0.11.10" -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -6171,10 +5689,10 @@ regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== +regexpp@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== regexpu-core@^5.3.1: version "5.3.2" @@ -6262,11 +5780,6 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -6277,7 +5790,7 @@ 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.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.10.1, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.3.2: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -6309,7 +5822,7 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== -rimraf@2, rimraf@^2.5.4: +rimraf@2: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -6331,11 +5844,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -run-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" - integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A== - run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -6374,25 +5882,7 @@ safe-regex-test@^1.0.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sauce-connect-launcher@^1.2.4: - version "1.3.2" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.3.2.tgz#dfc675a258550809a8eaf457eb9162b943ddbaf0" - integrity sha512-wf0coUlidJ7rmeClgVVBh6Kw55/yalZCY/Un5RgjSnTXRAeGqagnTsTYpZaqC4dCtrY4myuYpOAZXCdbO7lHfQ== - dependencies: - adm-zip "~0.4.3" - async "^2.1.2" - https-proxy-agent "^5.0.0" - lodash "^4.16.6" - rimraf "^2.5.4" - -saucelabs@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== - dependencies: - https-proxy-agent "^2.2.1" - -schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: +schema-utils@^3.1.0, schema-utils@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== @@ -6411,37 +5901,30 @@ schema-utils@^4.0.0: ajv-formats "^2.1.1" ajv-keywords "^5.0.0" -selenium-webdriver@^4.0.0-alpha.1: - version "4.8.2" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.8.2.tgz#2e7cb452133f7a6859879575852ef29f0ab4668c" - integrity sha512-d2dcpDLPcXlBy5qcPtB1B8RYTtj1N+JiHQLViFx3OP+i5hqkAuqTfJEYUh4qNX11S4NvbxjteiwN3OPwK3vPVw== - dependencies: - jszip "^3.10.0" - tmp "^0.2.1" - ws ">=8.11.0" - -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== - -"semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: +"semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.4, semver@^7.3.7: version "7.3.8" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: +semver@^5.3.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.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.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + serialize-javascript@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" @@ -6454,7 +5937,7 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -setimmediate@^1.0.4, setimmediate@^1.0.5: +setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== @@ -6479,13 +5962,6 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -6493,11 +5969,6 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" @@ -6609,11 +6080,6 @@ sodium-native@^3.3.0: dependencies: node-gyp-build "^4.3.0" -source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - source-map-support@^0.5.16, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -6627,11 +6093,16 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -spawn-command@^0.0.2: +spawn-command@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" integrity sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ== +spawn-command@0.0.2-1: + version "0.0.2-1" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg== + spawn-wrap@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" @@ -6748,14 +6219,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -6765,15 +6228,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -6831,20 +6285,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -6869,40 +6309,27 @@ 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-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== - 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" integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== -strip-json-comments@2.0.1, strip-json-comments@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== - -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -style-loader@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-2.0.0.tgz#9669602fd4690740eaaec137799a03addbbc393c" - integrity sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ== - dependencies: - loader-utils "^2.0.0" - schema-utils "^3.0.0" +strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== +supports-color@8.1.1, supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: - has-flag "^3.0.0" + has-flag "^4.0.0" supports-color@^2.0.0: version "2.0.0" @@ -6923,23 +6350,11 @@ supports-color@^7.1.0, supports-color@^7.2.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-preserve-symlinks-flag@^1.0.0: version "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== -taffydb@2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" - integrity sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA== - tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" @@ -7288,7 +6703,7 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: +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== @@ -7468,7 +6883,7 @@ which-typed-array@^1.1.2, which-typed-array@^1.1.9: has-tostringtag "^1.0.0" is-typed-array "^1.1.10" -which@1.3.1, which@^1.2.1, which@^1.2.9: +which@^1.2.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -7482,13 +6897,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - wide-align@^1.1.0: version "1.1.5" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" @@ -7506,14 +6914,10 @@ word-wrap@^1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== wrap-ansi@^6.2.0: version "6.2.0" @@ -7548,11 +6952,6 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@>=8.11.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== - ws@~8.11.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" @@ -7593,13 +6992,10 @@ yaml@^2.2.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.1.tgz#3014bf0482dcd15147aa8e56109ce8632cd60ce4" integrity sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw== -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== yargs-parser@^18.1.2: version "18.1.3" @@ -7614,30 +7010,28 @@ yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== +yargs@16.2.0, yargs@^16.1.1: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" yargs@^15.0.2, yargs@^15.1.0, yargs@^15.3.1: version "15.4.1" @@ -7656,19 +7050,6 @@ yargs@^15.0.2, yargs@^15.1.0, yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.1.1: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" From 82315bd92b2e5720b338dccb68f0b2242bd4ebc9 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 3 Apr 2023 20:36:24 -0700 Subject: [PATCH 06/25] Update library to conform to the new BigNumber API --- src/account.js | 5 ++++- src/operation.js | 5 ++--- src/transaction_builder.js | 10 +++++----- src/util/continued_fraction.js | 10 ++++++---- test/unit/operation_test.js | 4 ++-- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/account.js b/src/account.js index 67e60f8a3..fcf759860 100644 --- a/src/account.js +++ b/src/account.js @@ -35,6 +35,9 @@ export class Account { this._accountId = accountId; this.sequence = new BigNumber(sequence); + if (this.sequence.isNaN()) { + throw new Error(`sequence number '${sequence}' is not valid`); + } } /** @@ -58,6 +61,6 @@ export class Account { * @returns {void} */ incrementSequenceNumber() { - this.sequence = this.sequence.add(1); + this.sequence = this.sequence.plus(1); } } diff --git a/src/operation.js b/src/operation.js index 1aa38bc17..a399a9a1c 100644 --- a/src/operation.js +++ b/src/operation.js @@ -412,7 +412,7 @@ export class Operation { // < 0 amount.isNegative() || // > Max value - amount.times(ONE).greaterThan(new BigNumber(MAX_INT64).toString()) || + amount.times(ONE).isGreaterThan(new BigNumber(MAX_INT64).toString()) || // Decimal places (max 7) amount.decimalPlaces() > 7 || // NaN or Infinity @@ -466,7 +466,7 @@ export class Operation { * @returns {Hyper} XDR amount */ static _toXDRAmount(value) { - const amount = new BigNumber(value).mul(ONE); + const amount = new BigNumber(value).times(ONE); return Hyper.fromString(amount.toString()); } @@ -503,7 +503,6 @@ export class Operation { if (price.n && price.d) { xdrObject = new xdr.Price(price); } else { - price = new BigNumber(price); const approx = best_r(price); xdrObject = new xdr.Price({ n: parseInt(approx[0], 10), diff --git a/src/transaction_builder.js b/src/transaction_builder.js index cf0b9064c..ed54d3d32 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -444,9 +444,9 @@ export class TransactionBuilder { * @returns {Transaction} This method will return the built {@link Transaction}. */ build() { - const sequenceNumber = new BigNumber(this.source.sequenceNumber()).add(1); + const sequenceNumber = new BigNumber(this.source.sequenceNumber()).plus(1); const fee = new BigNumber(this.baseFee) - .mul(this.operations.length) + .times(this.operations.length) .toNumber(); const attrs = { fee, @@ -577,7 +577,7 @@ export class TransactionBuilder { const base = new BigNumber(baseFee); // The fee rate for fee bump is at least the fee rate of the inner transaction - if (base.lessThan(innerBaseFeeRate)) { + if (base.isLessThan(innerBaseFeeRate)) { throw new Error( `Invalid baseFee, it should be at least ${innerBaseFeeRate} stroops.` ); @@ -586,7 +586,7 @@ export class TransactionBuilder { const minBaseFee = new BigNumber(BASE_FEE); // The fee rate is at least the minimum fee - if (base.lessThan(minBaseFee)) { + if (base.isLessThan(minBaseFee)) { throw new Error( `Invalid baseFee, it should be at least ${minBaseFee} stroops.` ); @@ -623,7 +623,7 @@ export class TransactionBuilder { const tx = new xdr.FeeBumpTransaction({ feeSource: feeSourceAccount, - fee: xdr.Int64.fromString(base.mul(innerOps + 1).toString()), + fee: xdr.Int64.fromString(base.times(innerOps + 1).toString()), innerTx: xdr.FeeBumpTransactionInnerTx.envelopeTypeTx( innerTxEnvelope.v1() ), diff --git a/src/util/continued_fraction.js b/src/util/continued_fraction.js index f936931e1..308c29f20 100644 --- a/src/util/continued_fraction.js +++ b/src/util/continued_fraction.js @@ -11,6 +11,8 @@ const MAX_INT = ((1 << 31) >>> 0) - 1; * @returns {array} first element is n (numerator), second element is d (denominator) */ export function best_r(rawNumber) { + BigNumber.DEBUG = true; + let number = new BigNumber(rawNumber); let a; let f; @@ -25,10 +27,10 @@ export function best_r(rawNumber) { if (number.gt(MAX_INT)) { break; } - a = number.floor(); - f = number.sub(a); - const h = a.mul(fractions[i - 1][0]).add(fractions[i - 2][0]); - const k = a.mul(fractions[i - 1][1]).add(fractions[i - 2][1]); + a = number.integerValue(BigNumber.ROUND_FLOOR); + f = number.minus(a); + const h = a.times(fractions[i - 1][0]).plus(fractions[i - 2][0]); + const k = a.times(fractions[i - 1][1]).plus(fractions[i - 2][1]); if (h.gt(MAX_INT) || k.gt(MAX_INT)) { break; } diff --git a/test/unit/operation_test.js b/test/unit/operation_test.js index c9fb4685c..d408e1f0c 100644 --- a/test/unit/operation_test.js +++ b/test/unit/operation_test.js @@ -1214,7 +1214,7 @@ describe('Operation', function() { ) }; expect(() => StellarBase.Operation.manageSellOffer(opts)).to.throw( - /not a number/ + /not a number/i ); }); }); @@ -1482,7 +1482,7 @@ describe('Operation', function() { ) }; expect(() => StellarBase.Operation.manageBuyOffer(opts)).to.throw( - /not a number/ + /not a number/i ); }); }); From f56571781ac463a26e93e9adb524d554cd93df16 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 3 Apr 2023 20:40:28 -0700 Subject: [PATCH 07/25] Fixups: JSDoc generating, CI testing steps, unused libs, etc. --- .github/workflows/tests.yml | 3 +++ cfg/.jsdoc.json | 2 +- package.json | 6 +++--- src/index.js | 1 - src/operation.js | 2 +- src/transaction_builder.js | 4 ++-- src/util/continued_fraction.js | 2 +- yarn.lock | 5 +++++ 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ef5a0e92..600b3ac6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,6 +26,9 @@ jobs: - name: Install Dependencies run: yarn install + - name: Build + run: yarn build + - name: Run Node Tests run: yarn test:node diff --git a/cfg/.jsdoc.json b/cfg/.jsdoc.json index 650b8717c..2de38e068 100644 --- a/cfg/.jsdoc.json +++ b/cfg/.jsdoc.json @@ -7,7 +7,7 @@ "destination": "./jsdoc/", "recurse": true, "template": "node_modules/minami", - "readme": "./README.md" + "readme": "README.md" }, "plugins": ["plugins/markdown"] } diff --git a/package.json b/package.json index 77b0d3493..bc95ba718 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,13 @@ "name": "stellar-base", "version": "9.0.0", "description": "Low-level support library for the Stellar network.", - "main": "./lib/index.js", + "main": "./src/index.js", "types": "./types/index.d.ts", "scripts": { "build": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.js", "test": "yarn build && yarn test:node", "test:node": "nyc mocha --recursive", - "test:browser": "yarn build && karma start ./cfg/karma.conf.js", + "test:browser": "karma start ./cfg/karma.conf.js", "test:all": "yarn test:node && yarn test:browser && yarn tslint", "docs": "jsdoc -c ./cfg/.jsdoc.json --verbose", "tslint": "dtslint --localTs node_modules/typescript/lib types/", @@ -25,7 +25,6 @@ "timeout": 5000 }, "files": [ - "/lib", "/dist", "/types/*.d.ts" ], @@ -96,6 +95,7 @@ "randombytes": "^2.1.0", "sinon": "^15.0.3", "sinon-chai": "^3.7.0", + "taffydb": "^2.7.3", "terser-webpack-plugin": "^5.3.7", "ts-node": "^10.9.1", "webpack": "^5.77.0", diff --git a/src/index.js b/src/index.js index e6197c9fb..a13c405c1 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,3 @@ -/* eslint-disable import/no-import-module-exports */ import xdr from './xdr'; export { xdr }; diff --git a/src/operation.js b/src/operation.js index a399a9a1c..1e7240f39 100644 --- a/src/operation.js +++ b/src/operation.js @@ -412,7 +412,7 @@ export class Operation { // < 0 amount.isNegative() || // > Max value - amount.times(ONE).isGreaterThan(new BigNumber(MAX_INT64).toString()) || + amount.times(ONE).gt(new BigNumber(MAX_INT64).toString()) || // Decimal places (max 7) amount.decimalPlaces() > 7 || // NaN or Infinity diff --git a/src/transaction_builder.js b/src/transaction_builder.js index ed54d3d32..25fec6e56 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -577,7 +577,7 @@ export class TransactionBuilder { const base = new BigNumber(baseFee); // The fee rate for fee bump is at least the fee rate of the inner transaction - if (base.isLessThan(innerBaseFeeRate)) { + if (base.lt(innerBaseFeeRate)) { throw new Error( `Invalid baseFee, it should be at least ${innerBaseFeeRate} stroops.` ); @@ -586,7 +586,7 @@ export class TransactionBuilder { const minBaseFee = new BigNumber(BASE_FEE); // The fee rate is at least the minimum fee - if (base.isLessThan(minBaseFee)) { + if (base.lt(minBaseFee)) { throw new Error( `Invalid baseFee, it should be at least ${minBaseFee} stroops.` ); diff --git a/src/util/continued_fraction.js b/src/util/continued_fraction.js index 308c29f20..b3877cb42 100644 --- a/src/util/continued_fraction.js +++ b/src/util/continued_fraction.js @@ -11,7 +11,7 @@ const MAX_INT = ((1 << 31) >>> 0) - 1; * @returns {array} first element is n (numerator), second element is d (denominator) */ export function best_r(rawNumber) { - BigNumber.DEBUG = true; + BigNumber.DEBUG = true; // throws on bad number values let number = new BigNumber(rawNumber); let a; diff --git a/yarn.lock b/yarn.lock index 2e953160b..38f03e4d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6355,6 +6355,11 @@ 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== +taffydb@^2.7.3: + version "2.7.3" + resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.7.3.tgz#2ad37169629498fca5bc84243096d3cde0ec3a34" + integrity sha512-GQ3gtYFSOAxSMN/apGtDKKkbJf+8izz5YfbGqIsUc7AMiQOapARZ76dhilRY2h39cynYxBFdafQo5HUL5vgkrg== + tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" From 6d687b9ccefb21f5fdbab29959b3ca6bb9a3041b Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 10:40:27 -0700 Subject: [PATCH 08/25] Add typescript+linter 'fixes' --- test/.eslintrc.js | 3 ++- types/test.ts | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/.eslintrc.js b/test/.eslintrc.js index a7c6773bf..d4dee9557 100644 --- a/test/.eslintrc.js +++ b/test/.eslintrc.js @@ -10,5 +10,6 @@ module.exports = { }, rules: { 'no-unused-vars': 0 - } + }, + 'parser': '@babel/eslint-parser' }; diff --git a/types/test.ts b/types/test.ts index 72a1c6982..f54672625 100644 --- a/types/test.ts +++ b/types/test.ts @@ -154,8 +154,8 @@ const transactionFromXDR = new StellarSdk.Transaction(transaction.toEnvelope(), transactionFromXDR.networkPassphrase; // $ExpectType string transactionFromXDR.networkPassphrase = "SDF"; -StellarSdk.TransactionBuilder.fromXDR(transaction.toXDR(), StellarSdk.Networks.TESTNET); // $ExpectType Transaction, Operation[]> | FeeBumpTransaction -StellarSdk.TransactionBuilder.fromXDR(transaction.toEnvelope(), StellarSdk.Networks.TESTNET); // $ExpectType Transaction, Operation[]> | FeeBumpTransaction +StellarSdk.TransactionBuilder.fromXDR(transaction.toXDR(), StellarSdk.Networks.TESTNET); // $ExpectType FeeBumpTransaction | Transaction, Operation[]> +StellarSdk.TransactionBuilder.fromXDR(transaction.toEnvelope(), StellarSdk.Networks.TESTNET); // $ExpectType FeeBumpTransaction | Transaction, Operation[]> const sig = StellarSdk.xdr.DecoratedSignature.fromXDR(Buffer.of(1, 2)); // $ExpectType DecoratedSignature sig.hint(); // $ExpectType Buffer @@ -181,8 +181,8 @@ feeBumptransaction.toXDR(); // $ExpectType string feeBumptransaction.toEnvelope(); // $ExpectType TransactionEnvelope feeBumptransaction.hash(); // $ExpectType Buffer -StellarSdk.TransactionBuilder.fromXDR(feeBumptransaction.toXDR(), StellarSdk.Networks.TESTNET); // $ExpectType Transaction, Operation[]> | FeeBumpTransaction -StellarSdk.TransactionBuilder.fromXDR(feeBumptransaction.toEnvelope(), StellarSdk.Networks.TESTNET); // $ExpectType Transaction, Operation[]> | FeeBumpTransaction +StellarSdk.TransactionBuilder.fromXDR(feeBumptransaction.toXDR(), StellarSdk.Networks.TESTNET); // $ExpectType FeeBumpTransaction | Transaction, Operation[]> +StellarSdk.TransactionBuilder.fromXDR(feeBumptransaction.toEnvelope(), StellarSdk.Networks.TESTNET); // $ExpectType FeeBumpTransaction | Transaction, Operation[]> // P.S. You shouldn't be using the Memo constructor // From fe9a525412d594cfe20532d523084969a1b4645d Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 10:46:13 -0700 Subject: [PATCH 09/25] Fix linting parser --- package.json | 3 ++- types/.eslintrc.js | 3 +++ yarn.lock | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 types/.eslintrc.js diff --git a/package.json b/package.json index bc95ba718..1d6589e07 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@definitelytyped/dtslint": "^0.0.159", "@istanbuljs/nyc-config-babel": "3.0.0", "@types/node": "^18.15.11", + "@typescript-eslint/parser": "^5.57.1", "babel-loader": "^9.1.2", "babel-plugin-istanbul": "^6.1.1", "buffer": "^6.0.3", @@ -77,7 +78,6 @@ "eslint-plugin-prefer-import": "^0.0.1", "eslint-plugin-prettier": "^4.2.1", "eslint-webpack-plugin": "^4.0.0", - "ghooks": "^2.0.4", "husky": "^8.0.3", "jsdoc": "^4.0.2", "karma": "^6.4.1", @@ -106,6 +106,7 @@ "bignumber.js": "^9.1.1", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", + "ghooks": "^2.0.4", "js-xdr": "^1.1.3", "lodash": "^4.17.21", "sha.js": "^2.3.6", diff --git a/types/.eslintrc.js b/types/.eslintrc.js new file mode 100644 index 000000000..17fed142c --- /dev/null +++ b/types/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + 'parser': '@typescript-eslint/parser' +}; diff --git a/yarn.lock b/yarn.lock index 38f03e4d9..d04f7c39f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1463,7 +1463,7 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.55.0": +"@typescript-eslint/parser@^5.55.0", "@typescript-eslint/parser@^5.57.1": version "5.57.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.1.tgz#af911234bd4401d09668c5faf708a0570a17a748" integrity sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA== @@ -2886,9 +2886,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.284: - version "1.4.349" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.349.tgz#c65a4378cea805accfe6f585730ce2a3afe07f1d" - integrity sha512-34LBfVDiL6byWorSmQOPwq4gD5wpN8Mhh5yPGQr67FbcxsfUS0BDJP9y6RykSgeWVUfSkN/2dChywnsrmKVyUg== + version "1.4.350" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.350.tgz#11aae65e0d8b49626c7f298ac577b7b350b007ae" + integrity sha512-XnXcWpVnOfHZ4C3NPiL+SubeoGV8zc/pg8GEubRtc1dPA/9jKS2vsOPmtClJHhWxUb2RSGC1OBLCbgNUJMtZPw== elliptic@^6.5.3: version "6.5.4" From 7197fc5d7c63a685828a4fa39f8029c890f9d4ff Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 11:29:12 -0700 Subject: [PATCH 10/25] Add proper code coverage to node/browser --- .babelrc | 6 +----- cfg/karma.conf.js | 11 +++++++++-- cfg/webpack.config.browser.js | 18 ------------------ cfg/webpack.config.js | 9 +++++---- package.json | 12 +++++++++--- yarn.lock | 24 ++++++++++++++++++------ 6 files changed, 42 insertions(+), 38 deletions(-) delete mode 100644 cfg/webpack.config.browser.js diff --git a/.babelrc b/.babelrc index 8b48a5976..57297730d 100644 --- a/.babelrc +++ b/.babelrc @@ -2,9 +2,5 @@ "presets": [ "@babel/preset-env" ], - "env": { - "test": { - "plugins": ["istanbul"] - } - } + "plugins": ["istanbul"] } diff --git a/cfg/karma.conf.js b/cfg/karma.conf.js index 741040ed3..e3c6861a3 100644 --- a/cfg/karma.conf.js +++ b/cfg/karma.conf.js @@ -1,6 +1,7 @@ -var webpackConfig = require('./webpack.config.browser.js'); +var webpackConfig = require('./webpack.config.js'); delete webpackConfig.output; webpackConfig.entry = {}; // karma fills these in +webpackConfig.plugins.shift(); // drop eslinter plugin module.exports = function(config) { config.set({ @@ -27,6 +28,12 @@ module.exports = function(config) { colors: true, singleRun: true, - reporters: ['dots'] + reporters: ['dots', 'coverage'], + coverageReporter: { + type: 'text-summary', + instrumenterOptions: { + istanbul: { noCompact: true } + } + } }); }; diff --git a/cfg/webpack.config.browser.js b/cfg/webpack.config.browser.js deleted file mode 100644 index 5c7e88ebb..000000000 --- a/cfg/webpack.config.browser.js +++ /dev/null @@ -1,18 +0,0 @@ -var webpack = require('webpack'); -var NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); - -var baseConfig = require('./webpack.config.js'); - -delete baseConfig.entry['stellar-base.min']; -baseConfig.output.clean = false; -baseConfig.optimization = {}; -baseConfig.plugins = [ - // Ignore native modules (sodium-native) - new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }), - new NodePolyfillPlugin(), - new webpack.ProvidePlugin({ - Buffer: ['buffer', 'Buffer'] - }) -]; - -module.exports = baseConfig; diff --git a/cfg/webpack.config.js b/cfg/webpack.config.js index c34c6e23c..b221a0fd5 100644 --- a/cfg/webpack.config.js +++ b/cfg/webpack.config.js @@ -52,15 +52,16 @@ const config = { ] }, plugins: [ + // this must be first for karma to work (see line 5 of karma.conf.js) new ESLintPlugin({ overrideConfigFile: path.resolve(__dirname, './.eslintrc.js') }), - new webpack.ProvidePlugin({ - Buffer: ['buffer', 'Buffer'] - }), // Ignore native modules (sodium-native) new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }), - new NodePolyfillPlugin() + new NodePolyfillPlugin(), + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'] + }) ], watchOptions: { ignored: /(node_modules|coverage)/ diff --git a/package.json b/package.json index 1d6589e07..83dbd7904 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,14 @@ "scripts": { "build": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.js", "test": "yarn build && yarn test:node", - "test:node": "nyc mocha --recursive", + "test:node": "nyc --nycrc-path ./cfg/.nycrc mocha --recursive", "test:browser": "karma start ./cfg/karma.conf.js", "test:all": "yarn test:node && yarn test:browser && yarn tslint", "docs": "jsdoc -c ./cfg/.jsdoc.json --verbose", "tslint": "dtslint --localTs node_modules/typescript/lib types/", "preversion": "yarn clean && yarn cross-env NODE_ENV=production webpack -c ./cfg/webpack.config.js && yarn test:all", "pretty": "prettier --config ./cfg/prettier.config.js --write './**/*.js'", - "clean": "rm -rf dist/ coverage/" + "clean": "rm -rf dist/ coverage/ .nyc_output/" }, "mocha": { "require": [ @@ -24,8 +24,13 @@ "reporter": "dot", "timeout": 5000 }, + "nyc": { + "sourceMap": false, + "instrument": false, + "reporter": "text-summary" + }, "files": [ - "/dist", + "/dist/*.js", "/types/*.d.ts" ], "husky": { @@ -108,6 +113,7 @@ "crypto-browserify": "^3.12.0", "ghooks": "^2.0.4", "js-xdr": "^1.1.3", + "karma-coverage": "^2.2.0", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3", diff --git a/yarn.lock b/yarn.lock index d04f7c39f..dd3209572 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2886,9 +2886,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.284: - version "1.4.350" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.350.tgz#11aae65e0d8b49626c7f298ac577b7b350b007ae" - integrity sha512-XnXcWpVnOfHZ4C3NPiL+SubeoGV8zc/pg8GEubRtc1dPA/9jKS2vsOPmtClJHhWxUb2RSGC1OBLCbgNUJMtZPw== + version "1.4.351" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.351.tgz#949144993f3ed5c18601e37c786bb72540dbf9e9" + integrity sha512-W35n4jAsyj6OZGxeWe+gA6+2Md4jDO19fzfsRKEt3DBwIdlVTT8O9Uv8ojgUAoQeXASdgG9zMU+8n8Xg/W6dRQ== elliptic@^6.5.3: version "6.5.4" @@ -4284,7 +4284,7 @@ istanbul-lib-instrument@^4.0.0: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" -istanbul-lib-instrument@^5.0.4: +istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.2.1" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== @@ -4316,7 +4316,7 @@ istanbul-lib-report@^3.0.0: make-dir "^3.0.0" supports-color "^7.1.0" -istanbul-lib-source-maps@^4.0.0: +istanbul-lib-source-maps@^4.0.0, istanbul-lib-source-maps@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== @@ -4325,7 +4325,7 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^3.0.2: +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== @@ -4528,6 +4528,18 @@ 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== + dependencies: + istanbul-lib-coverage "^3.2.0" + istanbul-lib-instrument "^5.1.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.1" + istanbul-reports "^3.0.5" + minimatch "^3.0.4" + karma-firefox-launcher@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-2.1.2.tgz#9a38cc783c579a50f3ed2a82b7386186385cfc2d" From 67d10adace6b1771d4f86fd6bb60cea0cbfbfb37 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 12:10:52 -0700 Subject: [PATCH 11/25] Fixup the prettier support/workflow --- .prettierignore => cfg/.prettierignore | 0 cfg/karma.conf.js | 7 ++----- cfg/prettier.config.js | 3 ++- package.json | 6 +++--- types/.eslintrc.js | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) rename .prettierignore => cfg/.prettierignore (100%) diff --git a/.prettierignore b/cfg/.prettierignore similarity index 100% rename from .prettierignore rename to cfg/.prettierignore diff --git a/cfg/karma.conf.js b/cfg/karma.conf.js index e3c6861a3..55ff0bd12 100644 --- a/cfg/karma.conf.js +++ b/cfg/karma.conf.js @@ -3,13 +3,10 @@ delete webpackConfig.output; webpackConfig.entry = {}; // karma fills these in webpackConfig.plugins.shift(); // drop eslinter plugin -module.exports = function(config) { +module.exports = function (config) { config.set({ frameworks: ['mocha', 'sinon-chai'], - browsers: [ - 'FirefoxHeadless', - 'ChromeHeadless', - ], + browsers: ['FirefoxHeadless', 'ChromeHeadless'], files: [ '../dist/stellar-base.js', // webpack should build this first diff --git a/cfg/prettier.config.js b/cfg/prettier.config.js index a87a3ac31..40f1444de 100644 --- a/cfg/prettier.config.js +++ b/cfg/prettier.config.js @@ -1,12 +1,13 @@ module.exports = { arrowParens: 'always', bracketSpacing: true, - jsxBracketSameLine: false, + bracketSameLine: false, printWidth: 80, proseWrap: 'always', semi: true, singleQuote: true, tabWidth: 2, + parser: 'babel', trailingComma: 'none', useTabs: false }; diff --git a/package.json b/package.json index 83dbd7904..64da959dc 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "test:all": "yarn test:node && yarn test:browser && yarn tslint", "docs": "jsdoc -c ./cfg/.jsdoc.json --verbose", "tslint": "dtslint --localTs node_modules/typescript/lib types/", - "preversion": "yarn clean && yarn cross-env NODE_ENV=production webpack -c ./cfg/webpack.config.js && yarn test:all", - "pretty": "prettier --config ./cfg/prettier.config.js --write './**/*.js'", + "preversion": "yarn clean && yarn pretty && yarn cross-env NODE_ENV=production webpack -c ./cfg/webpack.config.js && yarn test:all", + "pretty": "prettier --config ./cfg/prettier.config.js --ignore-path ./cfg/.prettierignore --write './**/*.js'", "clean": "rm -rf dist/ coverage/ .nyc_output/" }, "mocha": { @@ -40,7 +40,7 @@ }, "lint-staged": { "**/*.{js,json}": [ - "prettier --config ./cfg/prettier.config.js --write" + "prettier --config ./cfg/prettier.config.js --ignore-path ./cfg/.prettierignore --write" ] }, "browser": { diff --git a/types/.eslintrc.js b/types/.eslintrc.js index 17fed142c..616584470 100644 --- a/types/.eslintrc.js +++ b/types/.eslintrc.js @@ -1,3 +1,3 @@ module.exports = { - 'parser': '@typescript-eslint/parser' + parser: '@typescript-eslint/parser' }; From b413b53778208d0fedee6886d9b6aa84424d9fca Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 12:11:04 -0700 Subject: [PATCH 12/25] Run prettier on the whole codebase --- src/fee_bump_transaction.js | 7 +- src/get_liquidity_pool_id.js | 3 +- src/liquidity_pool_asset.js | 7 +- src/muxed_account.js | 5 +- src/operation.js | 38 +- src/operations/set_options.js | 5 +- src/operations/set_trustline_flags.js | 3 +- src/transaction.js | 5 +- src/transaction_base.js | 4 +- src/transaction_builder.js | 2 +- test/.eslintrc.js | 2 +- test/unit/account_test.js | 14 +- test/unit/asset_test.js | 68 +-- test/unit/browser_test.js | 4 +- test/unit/claimant_test.js | 54 +- test/unit/crypto_test.js | 5 +- test/unit/fee_bump_transation_test.js | 83 +-- test/unit/get_liquidity_pool_id_test.js | 28 +- test/unit/hashing_test.js | 8 +- test/unit/keypair_test.js | 44 +- test/unit/liquidity_pool_asset_test.js | 55 +- test/unit/liquidity_pool_id_test.js | 40 +- test/unit/memo_test.js | 61 +-- test/unit/muxed_account_test.js | 10 +- test/unit/operation_test.js | 633 +++++++++------------- test/unit/signerkey_test.js | 12 +- test/unit/signing_test.js | 16 +- test/unit/strkey_test.js | 64 +-- test/unit/transaction_builder_test.js | 122 +++-- test/unit/transaction_envelope_test.js | 6 +- test/unit/transaction_test.js | 169 ++---- test/unit/util/continued_fraction_test.js | 6 +- 32 files changed, 665 insertions(+), 918 deletions(-) diff --git a/src/fee_bump_transaction.js b/src/fee_bump_transaction.js index 3b164e8ec..e070d366a 100644 --- a/src/fee_bump_transaction.js +++ b/src/fee_bump_transaction.js @@ -79,9 +79,10 @@ export class FeeBumpTransaction extends TransactionBase { * @returns {Buffer} */ signatureBase() { - const taggedTransaction = new xdr.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTxFeeBump( - this.tx - ); + const taggedTransaction = + new xdr.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTxFeeBump( + this.tx + ); const txSignature = new xdr.TransactionSignaturePayload({ networkId: xdr.Hash.fromXDR(hash(this.networkPassphrase)), diff --git a/src/get_liquidity_pool_id.js b/src/get_liquidity_pool_id.js index 62b16f341..de0871fde 100644 --- a/src/get_liquidity_pool_id.js +++ b/src/get_liquidity_pool_id.js @@ -42,7 +42,8 @@ export function getLiquidityPoolId( throw new Error('Assets are not in lexicographic order'); } - const lpTypeData = xdr.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(); + const lpTypeData = + xdr.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(); const lpParamsData = new xdr.LiquidityPoolConstantProductParameters({ assetA: assetA.toXDRObject(), assetB: assetB.toXDRObject(), diff --git a/src/liquidity_pool_asset.js b/src/liquidity_pool_asset.js index a7b791890..152260fa3 100644 --- a/src/liquidity_pool_asset.js +++ b/src/liquidity_pool_asset.js @@ -66,13 +66,12 @@ export class LiquidityPoolAsset { * @returns {xdr.ChangeTrustAsset} XDR ChangeTrustAsset object. */ toXDRObject() { - const lpConstantProductParamsXdr = new xdr.LiquidityPoolConstantProductParameters( - { + const lpConstantProductParamsXdr = + new xdr.LiquidityPoolConstantProductParameters({ assetA: this.assetA.toXDRObject(), assetB: this.assetB.toXDRObject(), fee: this.fee - } - ); + }); const lpParamsXdr = new xdr.LiquidityPoolParameters( 'liquidityPoolConstantProduct', lpConstantProductParamsXdr diff --git a/src/muxed_account.js b/src/muxed_account.js index e3bb0c0f4..0c44e7773 100644 --- a/src/muxed_account.js +++ b/src/muxed_account.js @@ -74,10 +74,7 @@ export class MuxedAccount { static fromAddress(mAddress, sequenceNum) { const muxedAccount = decodeAddressToMuxedAccount(mAddress); const gAddress = extractBaseAddress(mAddress); - const id = muxedAccount - .med25519() - .id() - .toString(); + const id = muxedAccount.med25519().id().toString(); return new MuxedAccount(new Account(gAddress, sequenceNum), id); } diff --git a/src/operation.js b/src/operation.js index 1e7240f39..fdb62e0cb 100644 --- a/src/operation.js +++ b/src/operation.js @@ -186,10 +186,7 @@ export class Operation { case 'allowTrust': { result.type = 'allowTrust'; result.trustor = accountIdtoAddress(attrs.trustor()); - result.assetCode = attrs - .asset() - .value() - .toString(); + result.assetCode = attrs.asset().value().toString(); result.assetCode = trimEnd(result.assetCode, '\0'); result.authorize = attrs.authorize(); break; @@ -214,27 +211,15 @@ export class Operation { if (attrs.signer()) { const signer = {}; - const arm = attrs - .signer() - .key() - .arm(); + const arm = attrs.signer().key().arm(); if (arm === 'ed25519') { signer.ed25519PublicKey = accountIdtoAddress(attrs.signer().key()); } else if (arm === 'preAuthTx') { - signer.preAuthTx = attrs - .signer() - .key() - .preAuthTx(); + signer.preAuthTx = attrs.signer().key().preAuthTx(); } else if (arm === 'hashX') { - signer.sha256Hash = attrs - .signer() - .key() - .hashX(); + signer.sha256Hash = attrs.signer().key().hashX(); } else if (arm === 'ed25519SignedPayload') { - const signedPayload = attrs - .signer() - .key() - .ed25519SignedPayload(); + const signedPayload = attrs.signer().key().ed25519SignedPayload(); signer.ed25519SignedPayload = StrKey.encodeSignedPayload( signedPayload.toXDR() ); @@ -348,7 +333,8 @@ export class Operation { const mapping = { authorized: xdr.TrustLineFlags.authorizedFlag(), - authorizedToMaintainLiabilities: xdr.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(), + authorizedToMaintainLiabilities: + xdr.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(), clawbackEnabled: xdr.TrustLineFlags.trustlineClawbackEnabledFlag() }; @@ -547,19 +533,13 @@ function extractRevokeSponshipDetails(attrs, result) { case xdr.LedgerEntryType.offer().name: { result.type = 'revokeOfferSponsorship'; result.seller = accountIdtoAddress(ledgerKey.offer().sellerId()); - result.offerId = ledgerKey - .offer() - .offerId() - .toString(); + result.offerId = ledgerKey.offer().offerId().toString(); break; } case xdr.LedgerEntryType.data().name: { result.type = 'revokeDataSponsorship'; result.account = accountIdtoAddress(ledgerKey.data().accountId()); - result.name = ledgerKey - .data() - .dataName() - .toString('ascii'); + result.name = ledgerKey.data().dataName().toString('ascii'); break; } case xdr.LedgerEntryType.claimableBalance().name: { diff --git a/src/operations/set_options.js b/src/operations/set_options.js index 54e94fce3..beedf8eec 100644 --- a/src/operations/set_options.js +++ b/src/operations/set_options.js @@ -160,9 +160,8 @@ export function setOptions(opts) { const rawKey = StrKey.decodeSignedPayload( opts.signer.ed25519SignedPayload ); - const signedPayloadXdr = xdr.SignerKeyEd25519SignedPayload.fromXDR( - rawKey - ); + const signedPayloadXdr = + xdr.SignerKeyEd25519SignedPayload.fromXDR(rawKey); // eslint-disable-next-line new-cap key = xdr.SignerKey.signerKeyTypeEd25519SignedPayload(signedPayloadXdr); diff --git a/src/operations/set_trustline_flags.js b/src/operations/set_trustline_flags.js index fe9effd74..21fd84318 100644 --- a/src/operations/set_trustline_flags.js +++ b/src/operations/set_trustline_flags.js @@ -47,7 +47,8 @@ export function setTrustLineFlags(opts = {}) { const mapping = { authorized: xdr.TrustLineFlags.authorizedFlag(), - authorizedToMaintainLiabilities: xdr.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(), + authorizedToMaintainLiabilities: + xdr.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(), clawbackEnabled: xdr.TrustLineFlags.trustlineClawbackEnabledFlag() }; diff --git a/src/transaction.js b/src/transaction.js index 3b6f6b1ff..76acc2972 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -273,9 +273,8 @@ export class Transaction extends TransactionBase { ); } - const taggedTransaction = new xdr.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTx( - tx - ); + const taggedTransaction = + new xdr.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTx(tx); const txSignature = new xdr.TransactionSignaturePayload({ networkId: xdr.Hash.fromXDR(hash(this.networkPassphrase)), diff --git a/src/transaction_base.js b/src/transaction_base.js index 59caa0544..7ba4339e7 100644 --- a/src/transaction_base.js +++ b/src/transaction_base.js @@ -212,8 +212,6 @@ export class TransactionBase { * @returns {string} XDR string */ toXDR() { - return this.toEnvelope() - .toXDR() - .toString('base64'); + return this.toEnvelope().toXDR().toString('base64'); } } diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 25fec6e56..d8d6bccc4 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -586,7 +586,7 @@ export class TransactionBuilder { const minBaseFee = new BigNumber(BASE_FEE); // The fee rate is at least the minimum fee - if (base.lt(minBaseFee)) { + if (base.lt(minBaseFee)) { throw new Error( `Invalid baseFee, it should be at least ${minBaseFee} stroops.` ); diff --git a/test/.eslintrc.js b/test/.eslintrc.js index d4dee9557..3683919c5 100644 --- a/test/.eslintrc.js +++ b/test/.eslintrc.js @@ -11,5 +11,5 @@ module.exports = { rules: { 'no-unused-vars': 0 }, - 'parser': '@babel/eslint-parser' + parser: '@babel/eslint-parser' }; diff --git a/test/unit/account_test.js b/test/unit/account_test.js index e33b54ae4..9558c6272 100644 --- a/test/unit/account_test.js +++ b/test/unit/account_test.js @@ -1,17 +1,17 @@ -describe('Account.constructor', function() { +describe('Account.constructor', function () { const ACCOUNT = 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'; const MUXED_ADDRESS = 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK'; const UNDERLYING_ACCOUNT = 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ'; - it('fails to create Account object from an invalid address', function() { + it('fails to create Account object from an invalid address', function () { expect(() => new StellarBase.Account('GBBB')).to.throw( /accountId is invalid/ ); }); - it('fails to create Account object from an invalid sequence number', function() { + it('fails to create Account object from an invalid sequence number', function () { expect(() => new StellarBase.Account(ACCOUNT, 100)).to.throw( /sequence must be of type string/ ); @@ -20,21 +20,21 @@ describe('Account.constructor', function() { ); }); - it('creates an Account object', function() { + it('creates an Account object', function () { let account = new StellarBase.Account(ACCOUNT, '100'); expect(account.accountId()).to.equal(ACCOUNT); expect(account.sequenceNumber()).to.equal('100'); }); - it('wont create Account objects from muxed account strings', function() { + it('wont create Account objects from muxed account strings', function () { expect(() => { new StellarBase.Account(MUXED_ADDRESS, '123'); }).to.throw(/MuxedAccount/); }); }); -describe('Account.incrementSequenceNumber', function() { - it('correctly increments the sequence number', function() { +describe('Account.incrementSequenceNumber', function () { + it('correctly increments the sequence number', function () { let account = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '100' diff --git a/test/unit/asset_test.js b/test/unit/asset_test.js index 101d6de2d..e03a7b765 100644 --- a/test/unit/asset_test.js +++ b/test/unit/asset_test.js @@ -1,12 +1,12 @@ -describe('Asset', function() { - describe('constructor', function() { - it("throws an error when there's no issuer for non XLM type asset", function() { +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/ ); }); - it('throws an error when code is invalid', function() { + it('throws an error when code is invalid', function () { expect( () => new StellarBase.Asset( @@ -30,20 +30,20 @@ describe('Asset', function() { ).to.throw(/Asset code is invalid/); }); - it('throws an error when issuer is invalid', function() { + it('throws an error when issuer is invalid', function () { expect(() => new StellarBase.Asset('USD', 'GCEZWKCA5')).to.throw( /Issuer is invalid/ ); }); }); - describe('getCode()', function() { - it('returns a code for a native asset object', function() { + describe('getCode()', function () { + it('returns a code for a native asset object', function () { var asset = new StellarBase.Asset.native(); expect(asset.getCode()).to.be.equal('XLM'); }); - it('returns a code for a non-native asset', function() { + it('returns a code for a non-native asset', function () { var asset = new StellarBase.Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -52,13 +52,13 @@ describe('Asset', function() { }); }); - describe('getIssuer()', function() { - it('returns a code for a native asset object', function() { + describe('getIssuer()', function () { + it('returns a code for a native asset object', function () { var asset = new StellarBase.Asset.native(); expect(asset.getIssuer()).to.be.undefined; }); - it('returns a code for a non-native asset', function() { + it('returns a code for a non-native asset', function () { var asset = new StellarBase.Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -69,13 +69,13 @@ describe('Asset', function() { }); }); - describe('getAssetType()', function() { - it('returns native for native assets', function() { + describe('getAssetType()', function () { + it('returns native for native assets', function () { var asset = StellarBase.Asset.native(); expect(asset.getAssetType()).to.eq('native'); }); - it('returns credit_alphanum4 if the asset code length is between 1 and 4', function() { + it('returns credit_alphanum4 if the asset code length is between 1 and 4', function () { var asset = new StellarBase.Asset( 'ABCD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -83,7 +83,7 @@ describe('Asset', function() { expect(asset.getAssetType()).to.eq('credit_alphanum4'); }); - it('returns credit_alphanum12 if the asset code length is between 5 and 12', function() { + it('returns credit_alphanum12 if the asset code length is between 5 and 12', function () { var asset = new StellarBase.Asset( 'ABCDEF', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -92,8 +92,8 @@ describe('Asset', function() { }); }); - describe('toXDRObject(), toChangeTrustXDRObject(), toTrustLineXDRObject', function() { - it('parses a native asset object', function() { + describe('toXDRObject(), toChangeTrustXDRObject(), toTrustLineXDRObject', function () { + it('parses a native asset object', function () { const asset = new StellarBase.Asset.native(); let xdr = asset.toXDRObject(); @@ -115,7 +115,7 @@ describe('Asset', function() { ); }); - it('parses a 3-alphanum asset object', function() { + it('parses a 3-alphanum asset object', function () { const asset = new StellarBase.Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -140,7 +140,7 @@ describe('Asset', function() { expect(xdr.value().assetCode()).to.equal('USD\0'); }); - it('parses a 4-alphanum asset object', function() { + it('parses a 4-alphanum asset object', function () { const asset = new StellarBase.Asset( 'BART', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -164,7 +164,7 @@ describe('Asset', function() { expect(xdr.value().assetCode()).to.equal('BART'); }); - it('parses a 5-alphanum asset object', function() { + it('parses a 5-alphanum asset object', function () { const asset = new StellarBase.Asset( '12345', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -188,7 +188,7 @@ describe('Asset', function() { expect(xdr.value().assetCode()).to.equal('12345\0\0\0\0\0\0\0'); }); - it('parses a 12-alphanum asset object', function() { + it('parses a 12-alphanum asset object', function () { const asset = new StellarBase.Asset( '123456789012', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -213,8 +213,8 @@ describe('Asset', function() { }); }); - describe('fromOperation()', function() { - it('parses a native asset XDR', function() { + describe('fromOperation()', function () { + it('parses a native asset XDR', function () { var xdr = new StellarBase.xdr.Asset.assetTypeNative(); var asset = StellarBase.Asset.fromOperation(xdr); @@ -222,7 +222,7 @@ describe('Asset', function() { expect(asset.isNative()).to.equal(true); }); - it('parses a 4-alphanum asset XDR', function() { + it('parses a 4-alphanum asset XDR', function () { var issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; var assetCode = 'KHL'; var assetType = new StellarBase.xdr.AlphaNum4({ @@ -241,7 +241,7 @@ describe('Asset', function() { expect(asset.getIssuer()).to.equal(issuer); }); - it('parses a 12-alphanum asset XDR', function() { + it('parses a 12-alphanum asset XDR', function () { var issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; var assetCode = 'KHLTOKEN'; var assetType = new StellarBase.xdr.AlphaNum12({ @@ -261,13 +261,13 @@ describe('Asset', function() { }); }); - describe('toString()', function() { - it("returns 'native' for native asset", function() { + describe('toString()', function () { + it("returns 'native' for native asset", function () { var asset = StellarBase.Asset.native(); expect(asset.toString()).to.be.equal('native'); }); - it("returns 'code:issuer' for non-native asset", function() { + it("returns 'code:issuer' for non-native asset", function () { var asset = new StellarBase.Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -278,7 +278,7 @@ describe('Asset', function() { }); }); - describe('compare()', function() { + describe('compare()', function () { const assetA = new StellarBase.Asset( 'ARST', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' @@ -288,7 +288,7 @@ describe('Asset', function() { 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); - it('throws an error if the input assets are invalid', function() { + it('throws an error if the input assets are invalid', function () { expect(() => StellarBase.Asset.compare()).to.throw(/assetA is invalid/); expect(() => StellarBase.Asset.compare(assetA)).to.throw( @@ -298,14 +298,14 @@ describe('Asset', function() { expect(() => StellarBase.Asset.compare(assetA, assetB)).to.not.throw; }); - it('returns false if assets are equal', function() { + 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); }); - it('test if asset types are being validated as native < anum4 < anum12', function() { + it('test if asset types are being validated as native < anum4 < anum12', function () { const XLM = new StellarBase.Asset.native(); const anum4 = new StellarBase.Asset( 'ARST', @@ -329,7 +329,7 @@ describe('Asset', function() { expect(StellarBase.Asset.compare(anum12, anum12)).to.eq(0); }); - it('test if asset codes are being validated as assetCodeA < assetCodeB', function() { + it('test if asset codes are being validated as assetCodeA < assetCodeB', function () { const assetARST = new StellarBase.Asset( 'ARST', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' @@ -348,7 +348,7 @@ describe('Asset', function() { expect(StellarBase.Asset.compare(assetLower, assetA)).to.eq(1); }); - it('test if asset issuers are being validated as assetIssuerA < assetIssuerB', function() { + it('test if asset issuers are being validated as assetIssuerA < assetIssuerB', function () { const assetIssuerA = new StellarBase.Asset( 'ARST', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' diff --git a/test/unit/browser_test.js b/test/unit/browser_test.js index 2dc1d3ef8..426573f4a 100644 --- a/test/unit/browser_test.js +++ b/test/unit/browser_test.js @@ -1,5 +1,5 @@ -describe('Browser version tests', function() { - it('lodash is not exported globally', function() { +describe('Browser version tests', function () { + it('lodash is not exported globally', function () { if (typeof window !== 'undefined') { expect(typeof _ === 'undefined').to.be.true; } diff --git a/test/unit/claimant_test.js b/test/unit/claimant_test.js index 9b99c45d2..eda18674a 100644 --- a/test/unit/claimant_test.js +++ b/test/unit/claimant_test.js @@ -1,13 +1,13 @@ const { expect } = require('chai'); -describe('Claimant', function() { - describe('constructor', function() { - it('throws an error when destination is invalid', function() { +describe('Claimant', function () { + describe('constructor', function () { + it('throws an error when destination is invalid', function () { expect(() => new StellarBase.Claimant('GCEZWKCA5', null)).to.throw( /Destination is invalid/ ); }); - it('defaults to unconditional if predicate is undefined', function() { + it('defaults to unconditional if predicate is undefined', function () { const claimant = new StellarBase.Claimant( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -15,7 +15,7 @@ describe('Claimant', function() { StellarBase.xdr.ClaimPredicateType.claimPredicateUnconditional() ); }); - it('throws an error if predicate is not an xdr.ClaimPredicate', function() { + it('throws an error if predicate is not an xdr.ClaimPredicate', function () { expect( () => new StellarBase.Claimant( @@ -25,16 +25,16 @@ describe('Claimant', function() { ).to.throw(/Predicate should be an xdr.ClaimPredicate/); }); }); - describe('predicateUnconditional()', function() { - it('returns an `unconditional` claim predicate', function() { + describe('predicateUnconditional()', function () { + it('returns an `unconditional` claim predicate', function () { const predicate = StellarBase.Claimant.predicateUnconditional(); expect(predicate.switch()).to.equal( StellarBase.xdr.ClaimPredicateType.claimPredicateUnconditional() ); }); }); - describe('predicateBeforeAbsoluteTime()', function() { - it('returns a `beforeAbsoluteTime` claim predicate', function() { + describe('predicateBeforeAbsoluteTime()', function () { + it('returns a `beforeAbsoluteTime` claim predicate', function () { const time = '4102444800000'; const predicate = StellarBase.Claimant.predicateBeforeAbsoluteTime(time); expect(predicate.switch()).to.equal( @@ -44,8 +44,8 @@ describe('Claimant', function() { expect(value.toString()).to.equal(time); }); }); - describe('predicateBeforeRelativeTime()', function() { - it('returns a `beforeRelativeTime` claim predicate', function() { + describe('predicateBeforeRelativeTime()', function () { + it('returns a `beforeRelativeTime` claim predicate', function () { const time = '86400'; const predicate = StellarBase.Claimant.predicateBeforeRelativeTime(time); expect(predicate.switch()).to.equal( @@ -55,8 +55,8 @@ describe('Claimant', function() { expect(value.toString()).to.equal(time); }); }); - describe('predicateNot()', function() { - it('returns a `not` claim predicate', function() { + describe('predicateNot()', function () { + it('returns a `not` claim predicate', function () { const time = '86400'; const beforeRel = StellarBase.Claimant.predicateBeforeRelativeTime(time); const predicate = StellarBase.Claimant.predicateNot(beforeRel); @@ -68,8 +68,8 @@ describe('Claimant', function() { expect(value.toString()).to.equal(time); }); }); - describe('predicateOr()', function() { - it('returns an `or` claim predicate', function() { + describe('predicateOr()', function () { + it('returns an `or` claim predicate', function () { const left = StellarBase.Claimant.predicateBeforeRelativeTime('800'); const right = StellarBase.Claimant.predicateBeforeRelativeTime('1200'); const predicate = StellarBase.Claimant.predicateOr(left, right); @@ -81,8 +81,8 @@ describe('Claimant', function() { expect(predicates[1].value().toString()).to.equal('1200'); }); }); - describe('predicateAnd()', function() { - it('returns an `and` predicate claim predicate', function() { + describe('predicateAnd()', function () { + it('returns an `and` predicate claim predicate', function () { const left = StellarBase.Claimant.predicateBeforeRelativeTime('800'); const right = StellarBase.Claimant.predicateBeforeRelativeTime('1200'); const predicate = StellarBase.Claimant.predicateAnd(left, right); @@ -94,14 +94,14 @@ describe('Claimant', function() { expect(predicates[1].value().toString()).to.equal('1200'); }); }); - describe('destination()', function() { - it('returns the destination accountID', function() { + describe('destination()', function () { + it('returns the destination accountID', function () { const destination = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const claimant = new StellarBase.Claimant(destination); expect(claimant.destination).to.equal(destination); }); - it('does not allow changes in accountID', function() { + it('does not allow changes in accountID', function () { const destination = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const claimant = new StellarBase.Claimant(destination); @@ -110,8 +110,8 @@ describe('Claimant', function() { ); }); }); - describe('predicate()', function() { - it('returns the predicate', function() { + describe('predicate()', function () { + it('returns the predicate', function () { const claimant = new StellarBase.Claimant( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -119,7 +119,7 @@ describe('Claimant', function() { StellarBase.Claimant.predicateUnconditional().switch() ); }); - it('does not allow changes in predicate', function() { + it('does not allow changes in predicate', function () { const destination = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const claimant = new StellarBase.Claimant(destination); @@ -128,8 +128,8 @@ describe('Claimant', function() { ); }); }); - describe('toXDRObject()', function() { - it('returns a xdr.Claimant', function() { + describe('toXDRObject()', function () { + it('returns a xdr.Claimant', function () { const destination = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const claimant = new StellarBase.Claimant(destination); @@ -149,8 +149,8 @@ describe('Claimant', function() { expect(() => xdrClaimant.toXDR()).to.not.throw(); }); }); - describe('fromXDR()', function() { - it('returns a Claimant', function() { + describe('fromXDR()', function () { + it('returns a Claimant', function () { const destination = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const claimant = new StellarBase.Claimant(destination); diff --git a/test/unit/crypto_test.js b/test/unit/crypto_test.js index d008c0099..18f0a10c0 100644 --- a/test/unit/crypto_test.js +++ b/test/unit/crypto_test.js @@ -17,10 +17,7 @@ function expectBuffersToBeEqual(left, right) { it('new hashing function behaves like crypto', () => { const input = 'I really hope this works'; - const cryptoHash = crypto - .createHash('sha256') - .update(input) - .digest(); + const cryptoHash = crypto.createHash('sha256').update(input).digest(); const newHash = StellarBase.hash(input); diff --git a/test/unit/fee_bump_transation_test.js b/test/unit/fee_bump_transation_test.js index c462991ca..b1d53ca77 100644 --- a/test/unit/fee_bump_transation_test.js +++ b/test/unit/fee_bump_transation_test.js @@ -1,8 +1,8 @@ import randomBytes from 'randombytes'; import { encodeMuxedAccountToAddress } from '../../src/util/decode_encode_muxed_account'; -describe('FeeBumpTransaction', function() { - beforeEach(function() { +describe('FeeBumpTransaction', function () { + beforeEach(function () { this.baseFee = '100'; this.networkPassphrase = 'Standalone Network ; February 2017'; this.innerSource = StellarBase.Keypair.master(this.networkPassphrase); @@ -44,7 +44,7 @@ describe('FeeBumpTransaction', function() { ); }); - it('constructs a FeeBumpTransaction object from a TransactionEnvelope', function() { + it('constructs a FeeBumpTransaction object from a TransactionEnvelope', function () { const transaction = this.transaction; transaction.sign(this.feeSource); @@ -68,12 +68,9 @@ describe('FeeBumpTransaction', function() { const expectedXDR = 'AAAABQAAAADgSJG2GOUMy/H9lHyjYZOwyuyytH8y0wWaoc596L+bEgAAAAAAAADIAAAAAgAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1gAAAGQAAAAAAAAACAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAA9IYXBweSBiaXJ0aGRheSEAAAAAAQAAAAAAAAABAAAAAOBIkbYY5QzL8f2UfKNhk7DK7LK0fzLTBZqhzn3ov5sSAAAAAAAAAASoF8gAAAAAAAAAAAERuUbWAAAAQK933Dnt1pxXlsf1B5CYn81PLxeYsx+MiV9EGbMdUfEcdDWUySyIkdzJefjpR5ejdXVp/KXosGmNUQ+DrIBlzg0AAAAAAAAAAei/mxIAAABAijIIQpL6KlFefiL4FP8UWQktWEz4wFgGNSaXe7mZdVMuiREntehi1b7MRqZ1h+W+Y0y+Z2HtMunsilT2yS5mAA=='; - expect( - transaction - .toEnvelope() - .toXDR() - .toString('base64') - ).to.be.equal(expectedXDR); + expect(transaction.toEnvelope().toXDR().toString('base64')).to.be.equal( + expectedXDR + ); const expectedTxEnvelope = StellarBase.xdr.TransactionEnvelope.fromXDR( expectedXDR, 'base64' @@ -81,39 +78,19 @@ describe('FeeBumpTransaction', function() { expect(innerTransaction.source).to.equal( StellarBase.StrKey.encodeEd25519PublicKey( - expectedTxEnvelope - .tx() - .innerTx() - .value() - .tx() - .sourceAccount() - .ed25519() + expectedTxEnvelope.tx().innerTx().value().tx().sourceAccount().ed25519() ) ); expect(transaction.feeSource).to.equal( StellarBase.StrKey.encodeEd25519PublicKey( - expectedTxEnvelope - .tx() - .feeSource() - .ed25519() + expectedTxEnvelope.tx().feeSource().ed25519() ) ); expect(transaction.innerTransaction.fee).to.equal( - expectedTxEnvelope - .tx() - .innerTx() - .value() - .tx() - .fee() - .toString() - ); - expect(transaction.fee).to.equal( - expectedTxEnvelope - .tx() - .fee() - .toString() + expectedTxEnvelope.tx().innerTx().value().tx().fee().toString() ); + expect(transaction.fee).to.equal(expectedTxEnvelope.tx().fee().toString()); expect(innerTransaction.signatures.length).to.equal(1); expect(innerTransaction.signatures[0].toXDR().toString('base64')).to.equal( @@ -128,14 +105,11 @@ describe('FeeBumpTransaction', function() { expect(transaction.signatures.length).to.equal(1); expect(transaction.signatures[0].toXDR().toString('base64')).to.equal( - expectedTxEnvelope - .signatures()[0] - .toXDR() - .toString('base64') + expectedTxEnvelope.signatures()[0].toXDR().toString('base64') ); }); - it('throws when a garbage Network is selected', function() { + it('throws when a garbage Network is selected', function () { const input = this.transaction.toEnvelope(); expect(() => { @@ -147,18 +121,14 @@ describe('FeeBumpTransaction', function() { }).to.throw(/expected a string/); }); - it('signs correctly', function() { + it('signs correctly', function () { const tx = this.transaction; tx.sign(this.feeSource); - const rawSig = tx - .toEnvelope() - .feeBump() - .signatures()[0] - .signature(); + const rawSig = tx.toEnvelope().feeBump().signatures()[0].signature(); expect(this.feeSource.verify(tx.hash(), rawSig)).to.equal(true); }); - it('signs using hash preimage', function() { + it('signs using hash preimage', function () { let preimage = randomBytes(64); let hash = StellarBase.hash(preimage); let tx = this.transaction; @@ -171,7 +141,7 @@ describe('FeeBumpTransaction', function() { ); }); - it('returns error when signing using hash preimage that is too long', function() { + it('returns error when signing using hash preimage that is too long', function () { let preimage = randomBytes(2 * 64); let tx = this.transaction; expect(() => tx.signHashX(preimage)).to.throw( @@ -179,15 +149,15 @@ describe('FeeBumpTransaction', function() { ); }); - describe('toEnvelope', function() { - it('does not return a reference to source signatures', function() { + describe('toEnvelope', function () { + it('does not return a reference to source signatures', function () { const transaction = this.transaction; const envelope = transaction.toEnvelope().value(); envelope.signatures().push({}); expect(transaction.signatures.length).to.equal(0); }); - it('does not return a reference to the source transaction', function() { + it('does not return a reference to the source transaction', function () { const transaction = this.transaction; const envelope = transaction.toEnvelope().value(); envelope.tx().fee(StellarBase.xdr.Int64.fromString('300')); @@ -196,7 +166,7 @@ describe('FeeBumpTransaction', function() { }); }); - it('adds signature correctly', function() { + it('adds signature correctly', function () { const transaction = this.transaction; const signer = this.feeSource; const presignHash = transaction.hash(); @@ -235,7 +205,7 @@ describe('FeeBumpTransaction', function() { expectBuffersToBeEqual(addedSignatureTx.hash(), transaction.hash()); }); - it('adds signature generated by getKeypairSignature', function() { + it('adds signature generated by getKeypairSignature', function () { const transaction = this.transaction; const presignHash = transaction.hash(); const signer = this.feeSource; @@ -281,7 +251,7 @@ describe('FeeBumpTransaction', function() { expectBuffersToBeEqual(addedSignatureTx.hash(), transaction.hash()); }); - it('does not add invalid signature', function() { + it('does not add invalid signature', function () { const transaction = this.transaction; const signer = this.feeSource; @@ -302,7 +272,7 @@ describe('FeeBumpTransaction', function() { }).to.throw('Invalid signature'); }); - it('outputs xdr as a string', function() { + it('outputs xdr as a string', function () { const xdrString = 'AAAABQAAAADgSJG2GOUMy/H9lHyjYZOwyuyytH8y0wWaoc596L+bEgAAAAAAAADIAAAAAgAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1gAAAGQAAAAAAAAACAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAA9IYXBweSBiaXJ0aGRheSEAAAAAAQAAAAAAAAABAAAAAOBIkbYY5QzL8f2UfKNhk7DK7LK0fzLTBZqhzn3ov5sSAAAAAAAAAASoF8gAAAAAAAAAAAERuUbWAAAAQK933Dnt1pxXlsf1B5CYn81PLxeYsx+MiV9EGbMdUfEcdDWUySyIkdzJefjpR5ejdXVp/KXosGmNUQ+DrIBlzg0AAAAAAAAAAei/mxIAAABAijIIQpL6KlFefiL4FP8UWQktWEz4wFgGNSaXe7mZdVMuiREntehi1b7MRqZ1h+W+Y0y+Z2HtMunsilT2yS5mAA=='; const transaction = new StellarBase.FeeBumpTransaction( @@ -313,15 +283,12 @@ describe('FeeBumpTransaction', function() { expect(transaction.toXDR()).to.be.equal(xdrString); }); - it('decodes muxed addresses correctly', function() { + it('decodes muxed addresses correctly', function () { const muxedFeeSource = this.feeSource.xdrMuxedAccount('0'); const muxedAddress = encodeMuxedAccountToAddress(muxedFeeSource); const envelope = this.transaction.toEnvelope(); - envelope - .feeBump() - .tx() - .feeSource(muxedFeeSource); + envelope.feeBump().tx().feeSource(muxedFeeSource); const txWithMuxedAccount = new StellarBase.FeeBumpTransaction( envelope, diff --git a/test/unit/get_liquidity_pool_id_test.js b/test/unit/get_liquidity_pool_id_test.js index de12d2a55..7eb6e66f6 100644 --- a/test/unit/get_liquidity_pool_id_test.js +++ b/test/unit/get_liquidity_pool_id_test.js @@ -8,8 +8,8 @@ const assetB = new StellarBase.Asset( ); const fee = StellarBase.LiquidityPoolFeeV18; -describe('StellarBase#getLiquidityPoolId()', function() { - it('throws an error if the liquidity pool type is not `constant_product`', function() { +describe('StellarBase#getLiquidityPoolId()', function () { + it('throws an error if the liquidity pool type is not `constant_product`', function () { expect(() => StellarBase.getLiquidityPoolId()).to.throw( /liquidityPoolType is invalid/ ); @@ -23,7 +23,7 @@ describe('StellarBase#getLiquidityPoolId()', function() { ); }); - it('throws an error if assetA is invalid', function() { + it('throws an error if assetA is invalid', function () { expect(() => StellarBase.getLiquidityPoolId('constant_product', {}) ).to.throw(/assetA is invalid/); @@ -33,7 +33,7 @@ describe('StellarBase#getLiquidityPoolId()', function() { ).to.throw(/assetA is invalid/); }); - it('throws an error if assetB is invalid', function() { + it('throws an error if assetB is invalid', function () { expect(() => StellarBase.getLiquidityPoolId('constant_product', { assetA @@ -48,7 +48,7 @@ describe('StellarBase#getLiquidityPoolId()', function() { ).to.throw(/assetB is invalid/); }); - it('throws an error if fee is invalid', function() { + it('throws an error if fee is invalid', function () { expect(() => StellarBase.getLiquidityPoolId('constant_product', { assetA, @@ -57,7 +57,7 @@ describe('StellarBase#getLiquidityPoolId()', function() { ).to.throw(/fee is invalid/); }); - it('returns poolId correctly', function() { + it('returns poolId correctly', function () { const poolId = StellarBase.getLiquidityPoolId('constant_product', { assetA, assetB, @@ -69,7 +69,7 @@ describe('StellarBase#getLiquidityPoolId()', function() { ); }); - it('throws an error if assets are not in lexicographic order', function() { + it('throws an error if assets are not in lexicographic order', function () { expect(() => StellarBase.getLiquidityPoolId('constant_product', { assetA: assetB, @@ -80,7 +80,7 @@ describe('StellarBase#getLiquidityPoolId()', function() { }); }); -describe('StellarBase#getLiquidityPoolId() mirror stellar-core getPoolID() tests', function() { +describe('StellarBase#getLiquidityPoolId() mirror stellar-core getPoolID() tests', function () { // The tests below were copied from https://github.com/stellar/stellar-core/blob/c5f6349b240818f716617ca6e0f08d295a6fad9a/src/transactions/test/LiquidityPoolTradeTests.cpp#L430-L526 const issuer1 = StellarBase.StrKey.encodeEd25519PublicKey( Buffer.from( @@ -95,7 +95,7 @@ describe('StellarBase#getLiquidityPoolId() mirror stellar-core getPoolID() tests ) ); - it('returns poolId correctly for native and alphaNum4 (short and full length)', function() { + it('returns poolId correctly for native and alphaNum4 (short and full length)', function () { let poolId = StellarBase.getLiquidityPoolId('constant_product', { assetA: new StellarBase.Asset.native(), assetB: new StellarBase.Asset('AbC', issuer1), @@ -115,7 +115,7 @@ describe('StellarBase#getLiquidityPoolId() mirror stellar-core getPoolID() tests ); }); - it('returns poolId correctly for native and alphaNum12 (short and full length)', function() { + it('returns poolId correctly for native and alphaNum12 (short and full length)', function () { let poolId = StellarBase.getLiquidityPoolId('constant_product', { assetA: new StellarBase.Asset.native(), assetB: new StellarBase.Asset('AbCdEfGhIjK', issuer1), @@ -134,7 +134,7 @@ describe('StellarBase#getLiquidityPoolId() mirror stellar-core getPoolID() tests ); }); - it('returns poolId correctly for alphaNum4 and alphaNum12, same code but different issuer', function() { + it('returns poolId correctly for alphaNum4 and alphaNum12, same code but different issuer', function () { let poolId = StellarBase.getLiquidityPoolId('constant_product', { assetA: new StellarBase.Asset('aBc', issuer1), assetB: new StellarBase.Asset('aBc', issuer2), @@ -154,7 +154,7 @@ describe('StellarBase#getLiquidityPoolId() mirror stellar-core getPoolID() tests ); }); - it('returns poolId correctly for alphaNum4 and alphaNum12 do not depend on issuer or code', function() { + it('returns poolId correctly for alphaNum4 and alphaNum12 do not depend on issuer or code', function () { const poolId = StellarBase.getLiquidityPoolId('constant_product', { assetA: new StellarBase.Asset('aBc', issuer1), assetB: new StellarBase.Asset('aBcDeFgHiJk', issuer2), @@ -166,8 +166,8 @@ describe('StellarBase#getLiquidityPoolId() mirror stellar-core getPoolID() tests }); }); -describe('StellarBase#LiquidityPoolFeeV18', function() { - it('throws an error if the input assets are invalid', function() { +describe('StellarBase#LiquidityPoolFeeV18', function () { + it('throws an error if the input assets are invalid', function () { expect(StellarBase.LiquidityPoolFeeV18).to.equal(30); }); }); diff --git a/test/unit/hashing_test.js b/test/unit/hashing_test.js index 545d2fd70..82498888d 100644 --- a/test/unit/hashing_test.js +++ b/test/unit/hashing_test.js @@ -1,5 +1,5 @@ -describe('StellarBase#hash', function() { - it('hashes a string properly, using SHA256', function() { +describe('StellarBase#hash', function () { + it('hashes a string properly, using SHA256', function () { let msg = 'hello world'; let expectedHex = 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'; @@ -8,7 +8,7 @@ describe('StellarBase#hash', function() { expect(actualHex).to.eql(expectedHex); }); - it('hashes a buffer properly, using SHA256', function() { + it('hashes a buffer properly, using SHA256', function () { let msg = Buffer.from('hello world', 'utf8'); let expectedHex = 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'; @@ -17,7 +17,7 @@ describe('StellarBase#hash', function() { expect(actualHex).to.eql(expectedHex); }); - it('hashes an array of bytes properly, using SHA256', function() { + it('hashes an array of bytes properly, using SHA256', function () { let msg = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; let expectedHex = 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'; diff --git a/test/unit/keypair_test.js b/test/unit/keypair_test.js index dbcbaec4e..3f9ebd955 100644 --- a/test/unit/keypair_test.js +++ b/test/unit/keypair_test.js @@ -1,5 +1,5 @@ -describe('Keypair.contructor', function() { - it('fails when passes secret key does not match public key', function() { +describe('Keypair.contructor', function () { + it('fails when passes secret key does not match public key', function () { let secret = 'SD7X7LEHBNMUIKQGKPARG5TDJNBHKC346OUARHGZL5ITC6IJPXHILY36'; let kp = StellarBase.Keypair.fromSecret(secret); @@ -12,14 +12,14 @@ describe('Keypair.contructor', function() { ).to.throw(/secretKey does not match publicKey/); }); - it('fails when secretKey length is invalid', function() { + it('fails when secretKey length is invalid', function () { let secretKey = Buffer.alloc(33); expect( () => new StellarBase.Keypair({ type: 'ed25519', secretKey }) ).to.throw(/secretKey length is invalid/); }); - it('fails when publicKey length is invalid', function() { + it('fails when publicKey length is invalid', function () { let publicKey = Buffer.alloc(33); expect( () => new StellarBase.Keypair({ type: 'ed25519', publicKey }) @@ -27,8 +27,8 @@ describe('Keypair.contructor', function() { }); }); -describe('Keypair.fromSecret', function() { - it('creates a keypair correctly', function() { +describe('Keypair.fromSecret', function () { + it('creates a keypair correctly', function () { let secret = 'SD7X7LEHBNMUIKQGKPARG5TDJNBHKC346OUARHGZL5ITC6IJPXHILY36'; let kp = StellarBase.Keypair.fromSecret(secret); @@ -39,7 +39,7 @@ describe('Keypair.fromSecret', function() { expect(kp.secret()).to.eql(secret); }); - it("throw an error if the arg isn't strkey encoded as a seed", function() { + it("throw an error if the arg isn't strkey encoded as a seed", function () { expect(() => StellarBase.Keypair.fromSecret('hel0')).to.throw(); expect(() => StellarBase.Keypair.fromSecret( @@ -57,8 +57,8 @@ describe('Keypair.fromSecret', function() { }); }); -describe('Keypair.fromRawEd25519Seed', function() { - it('creates a keypair correctly', function() { +describe('Keypair.fromRawEd25519Seed', function () { + it('creates a keypair correctly', function () { let seed = 'masterpassphrasemasterpassphrase'; let kp = StellarBase.Keypair.fromRawEd25519Seed(seed); @@ -74,7 +74,7 @@ describe('Keypair.fromRawEd25519Seed', function() { ); }); - it("throws an error if the arg isn't 32 bytes", function() { + it("throws an error if the arg isn't 32 bytes", function () { expect(() => StellarBase.Keypair.fromRawEd25519Seed('masterpassphrasemasterpassphras') ).to.throw(); @@ -88,8 +88,8 @@ describe('Keypair.fromRawEd25519Seed', function() { }); }); -describe('Keypair.fromPublicKey', function() { - it('creates a keypair correctly', function() { +describe('Keypair.fromPublicKey', function () { + it('creates a keypair correctly', function () { let kp = StellarBase.Keypair.fromPublicKey( 'GAXDYNIBA5E4DXR5TJN522RRYESFQ5UNUXHIPTFGVLLD5O5K552DF5ZH' ); @@ -102,7 +102,7 @@ describe('Keypair.fromPublicKey', function() { ); }); - it("throw an error if the arg isn't strkey encoded as a accountid", function() { + it("throw an error if the arg isn't strkey encoded as a accountid", function () { expect(() => StellarBase.Keypair.fromPublicKey('hel0')).to.throw(); expect(() => StellarBase.Keypair.fromPublicKey('masterpassphrasemasterpassphrase') @@ -114,7 +114,7 @@ describe('Keypair.fromPublicKey', function() { ).to.throw(); }); - it("throws an error if the address isn't 32 bytes", function() { + it("throws an error if the address isn't 32 bytes", function () { expect(() => StellarBase.Keypair.fromPublicKey('masterpassphrasemasterpassphrase') ).to.throw(); @@ -126,15 +126,15 @@ describe('Keypair.fromPublicKey', function() { }); }); -describe('Keypair.random', function() { - it('creates a keypair correctly', function() { +describe('Keypair.random', function () { + it('creates a keypair correctly', function () { let kp = StellarBase.Keypair.random(); expect(kp).to.be.instanceof(StellarBase.Keypair); }); }); -describe('Keypair.xdrMuxedAccount', function() { - it('returns a valid MuxedAccount with a Ed25519 key type', function() { +describe('Keypair.xdrMuxedAccount', function () { + it('returns a valid MuxedAccount with a Ed25519 key type', function () { const kp = StellarBase.Keypair.fromPublicKey( 'GAXDYNIBA5E4DXR5TJN522RRYESFQ5UNUXHIPTFGVLLD5O5K552DF5ZH' ); @@ -146,8 +146,8 @@ describe('Keypair.xdrMuxedAccount', function() { }); }); -describe('Keypair.sign*Decorated', function() { - describe('returning the correct hints', function() { +describe('Keypair.sign*Decorated', function () { + describe('returning the correct hints', function () { const secret = 'SDVSYBKP7ESCODJSNGVDNXAJB63NPS5GQXSBZXLNT2Y4YVUJCFZWODGJ'; const kp = StellarBase.Keypair.fromSecret(secret); @@ -174,7 +174,7 @@ describe('Keypair.sign*Decorated', function() { const data = testCase.data; const sig = kp.sign(data); - it(`signedPayloads#${data.length}`, function() { + it(`signedPayloads#${data.length}`, function () { const expectedXdr = new StellarBase.xdr.DecoratedSignature({ hint: testCase.payload, signature: sig @@ -184,7 +184,7 @@ describe('Keypair.sign*Decorated', function() { expect(decoSig.toXDR('hex')).to.eql(expectedXdr.toXDR('hex')); }); - it(`regular#${data.length}`, function() { + it(`regular#${data.length}`, function () { const expectedXdr = new StellarBase.xdr.DecoratedSignature({ hint: testCase.regular, signature: sig diff --git a/test/unit/liquidity_pool_asset_test.js b/test/unit/liquidity_pool_asset_test.js index c8c233106..16cbb7e27 100644 --- a/test/unit/liquidity_pool_asset_test.js +++ b/test/unit/liquidity_pool_asset_test.js @@ -8,9 +8,9 @@ const assetB = new StellarBase.Asset( ); const fee = StellarBase.LiquidityPoolFeeV18; -describe('LiquidityPoolAsset', function() { - describe('constructor', function() { - it('throws an error if assetA is invalid', function() { +describe('LiquidityPoolAsset', function () { + describe('constructor', function () { + it('throws an error if assetA is invalid', function () { expect(() => new StellarBase.LiquidityPoolAsset()).to.throw( /assetA is invalid/ ); @@ -20,7 +20,7 @@ describe('LiquidityPoolAsset', function() { ); }); - it('throws an error if assetB is invalid', function() { + it('throws an error if assetB is invalid', function () { expect(() => new StellarBase.LiquidityPoolAsset(assetA)).to.throw( /assetB is invalid/ ); @@ -30,26 +30,26 @@ describe('LiquidityPoolAsset', function() { ).to.throw(/assetB is invalid/); }); - it('throws an error if assets are not ordered', function() { + it('throws an error if assets are not ordered', function () { expect(() => new StellarBase.LiquidityPoolAsset(assetB, assetA)).to.throw( /Assets are not in lexicographic order/ ); }); - it('throws an error if fee is invalid', function() { + it('throws an error if fee is invalid', function () { expect(() => new StellarBase.LiquidityPoolAsset(assetA, assetB)).to.throw( /fee is invalid/ ); }); - it('does not throw when using the correct attributes', function() { + it('does not throw when using the correct attributes', function () { expect(() => new StellarBase.LiquidityPoolAsset(assetA, assetB, fee)).to .not.throw; }); }); - describe('getLiquidityPoolParameters()', function() { - it('returns liquidity pool parameters for a liquidity pool asset', function() { + describe('getLiquidityPoolParameters()', function () { + it('returns liquidity pool parameters for a liquidity pool asset', function () { const asset = new StellarBase.LiquidityPoolAsset(assetA, assetB, fee); const gotPoolParams = asset.getLiquidityPoolParameters(); expect(gotPoolParams.assetA).to.eq(assetA); @@ -58,15 +58,15 @@ describe('LiquidityPoolAsset', function() { }); }); - describe('getAssetType()', function() { - it('returns "liquidity_pool_shares" if the trustline asset is a liquidity pool ID', function() { + describe('getAssetType()', function () { + it('returns "liquidity_pool_shares" if the trustline asset is a liquidity pool ID', function () { const asset = new StellarBase.LiquidityPoolAsset(assetA, assetB, fee); expect(asset.getAssetType()).to.eq('liquidity_pool_shares'); }); }); - describe('toXDRObject()', function() { - it('parses a liquidity pool trustline asset object', function() { + describe('toXDRObject()', function () { + it('parses a liquidity pool trustline asset object', function () { const asset = new StellarBase.LiquidityPoolAsset(assetA, assetB, fee); const xdr = asset.toXDRObject(); @@ -80,15 +80,15 @@ describe('LiquidityPoolAsset', function() { }); }); - describe('fromOperation()', function() { - it('throws an error if asset type is "assetTypeNative"', function() { + describe('fromOperation()', function () { + it('throws an error if asset type is "assetTypeNative"', function () { const xdr = new StellarBase.xdr.ChangeTrustAsset.assetTypeNative(); expect(() => StellarBase.LiquidityPoolAsset.fromOperation(xdr)).to.throw( /Invalid asset type: assetTypeNative/ ); }); - it('throws an error if asset type is "assetTypeCreditAlphanum4"', function() { + it('throws an error if asset type is "assetTypeCreditAlphanum4"', function () { const issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const assetCode = 'KHL'; const assetXdr = new StellarBase.xdr.AlphaNum4({ @@ -104,7 +104,7 @@ describe('LiquidityPoolAsset', function() { ); }); - it('throws an error if asset type is "assetTypeCreditAlphanum4" (full)', function() { + it('throws an error if asset type is "assetTypeCreditAlphanum4" (full)', function () { const issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const assetCode = 'KHL'; const assetXdr = new StellarBase.xdr.AlphaNum4({ @@ -120,7 +120,7 @@ describe('LiquidityPoolAsset', function() { ); }); - it('throws an error if asset type is "assetTypeCreditAlphanum12"', function() { + it('throws an error if asset type is "assetTypeCreditAlphanum12"', function () { const issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const assetCode = 'KHLTOKEN'; const assetXdr = new StellarBase.xdr.AlphaNum12({ @@ -136,14 +136,13 @@ describe('LiquidityPoolAsset', function() { ); }); - it('parses a liquidityPool asset XDR', function() { - const lpConstantProductParamsXdr = new StellarBase.xdr.LiquidityPoolConstantProductParameters( - { + it('parses a liquidityPool asset XDR', function () { + const lpConstantProductParamsXdr = + new StellarBase.xdr.LiquidityPoolConstantProductParameters({ assetA: assetA.toXDRObject(), assetB: assetB.toXDRObject(), fee - } - ); + }); const lpParamsXdr = new StellarBase.xdr.LiquidityPoolParameters( 'liquidityPoolConstantProduct', lpConstantProductParamsXdr @@ -166,8 +165,8 @@ describe('LiquidityPoolAsset', function() { }); }); - describe('equals()', function() { - it('returns true when assetA and assetB are the same for both liquidity pools', function() { + describe('equals()', function () { + it('returns true when assetA and assetB are the same for both liquidity pools', function () { const lpAsset1 = new StellarBase.LiquidityPoolAsset(assetA, assetB, fee); const lpAsset2 = new StellarBase.LiquidityPoolAsset(assetA, assetB, fee); expect(lpAsset1.equals(lpAsset1)).to.true; @@ -176,7 +175,7 @@ describe('LiquidityPoolAsset', function() { expect(lpAsset1.equals(lpAsset2)).to.true; }); - it('returns false when assetA or assetB are different in the liquidity pools', function() { + it('returns false when assetA or assetB are different in the liquidity pools', function () { const lpAsset1 = new StellarBase.LiquidityPoolAsset(assetA, assetB, fee); const assetA2 = new StellarBase.Asset( @@ -196,8 +195,8 @@ describe('LiquidityPoolAsset', function() { }); }); - describe('toString()', function() { - it("returns 'liquidity_pool:' for liquidity pool assets", function() { + describe('toString()', function () { + it("returns 'liquidity_pool:' for liquidity pool assets", function () { const asset = new StellarBase.LiquidityPoolAsset(assetA, assetB, fee); expect(asset.toString()).to.eq( 'liquidity_pool:dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' diff --git a/test/unit/liquidity_pool_id_test.js b/test/unit/liquidity_pool_id_test.js index 2d3779872..72d0c30d9 100644 --- a/test/unit/liquidity_pool_id_test.js +++ b/test/unit/liquidity_pool_id_test.js @@ -1,18 +1,18 @@ -describe('LiquidityPoolId', function() { - describe('constructor', function() { - it('throws an error when no parameter is provided', function() { +describe('LiquidityPoolId', function () { + describe('constructor', function () { + it('throws an error when no parameter is provided', function () { expect(() => new StellarBase.LiquidityPoolId()).to.throw( /liquidityPoolId cannot be empty/ ); }); - it('throws an error when pool ID is not a valid hash', function() { + it('throws an error when pool ID is not a valid hash', function () { expect(() => new StellarBase.LiquidityPoolId('abc')).to.throw( /Liquidity pool ID is not a valid hash/ ); }); - it('throws an error when pool ID is not all lowercase', function() { + it('throws an error when pool ID is not all lowercase', function () { expect( () => new StellarBase.LiquidityPoolId( @@ -21,7 +21,7 @@ describe('LiquidityPoolId', function() { ).to.throw(/Liquidity pool ID is not a valid hash/); }); - it('does not throw an error when pool ID is a valid hash', function() { + it('does not throw an error when pool ID is a valid hash', function () { expect( () => new StellarBase.LiquidityPoolId( @@ -31,8 +31,8 @@ describe('LiquidityPoolId', function() { }); }); - describe('getLiquidityPoolId()', function() { - it('returns liquidity pool ID of liquidity pool asset', function() { + describe('getLiquidityPoolId()', function () { + it('returns liquidity pool ID of liquidity pool asset', function () { const asset = new StellarBase.LiquidityPoolId( 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' ); @@ -42,8 +42,8 @@ describe('LiquidityPoolId', function() { }); }); - describe('getAssetType()', function() { - it('returns "liquidity_pool_shares" if the trustline asset is a liquidity pool ID', function() { + describe('getAssetType()', function () { + it('returns "liquidity_pool_shares" if the trustline asset is a liquidity pool ID', function () { const asset = new StellarBase.LiquidityPoolId( 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' ); @@ -51,8 +51,8 @@ describe('LiquidityPoolId', function() { }); }); - describe('toXDRObject()', function() { - it('parses a liquidity pool trustline asset object', function() { + describe('toXDRObject()', function () { + it('parses a liquidity pool trustline asset object', function () { const asset = new StellarBase.LiquidityPoolId( 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' ); @@ -69,15 +69,15 @@ describe('LiquidityPoolId', function() { }); }); - describe('fromOperation()', function() { - it('throws an error if asset type is "assetTypeNative"', function() { + describe('fromOperation()', function () { + it('throws an error if asset type is "assetTypeNative"', function () { const xdr = new StellarBase.xdr.TrustLineAsset.assetTypeNative(); expect(() => StellarBase.LiquidityPoolAsset.fromOperation(xdr)).to.throw( /Invalid asset type: assetTypeNative/ ); }); - it('throws an error if asset type is "assetTypeCreditAlphanum4"', function() { + it('throws an error if asset type is "assetTypeCreditAlphanum4"', function () { const issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const assetCode = 'KHL'; const assetXdr = new StellarBase.xdr.AlphaNum4({ @@ -93,7 +93,7 @@ describe('LiquidityPoolId', function() { ); }); - it('throws an error if asset type is "assetTypeCreditAlphanum4" (full)', function() { + it('throws an error if asset type is "assetTypeCreditAlphanum4" (full)', function () { const issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const assetCode = 'KHL'; const assetXdr = new StellarBase.xdr.AlphaNum4({ @@ -109,7 +109,7 @@ describe('LiquidityPoolId', function() { ); }); - it('throws an error if asset type is "assetTypeCreditAlphanum12"', function() { + it('throws an error if asset type is "assetTypeCreditAlphanum12"', function () { const issuer = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; const assetCode = 'KHLTOKEN'; const assetXdr = new StellarBase.xdr.AlphaNum12({ @@ -125,7 +125,7 @@ describe('LiquidityPoolId', function() { ); }); - it('parses a liquidityPoolId asset XDR', function() { + it('parses a liquidityPoolId asset XDR', function () { const poolId = 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7'; const xdrPoolId = StellarBase.xdr.PoolId.fromXDR(poolId, 'hex'); @@ -141,8 +141,8 @@ describe('LiquidityPoolId', function() { }); }); - describe('toString()', function() { - it("returns 'liquidity_pool:' for liquidity pool assets", function() { + describe('toString()', function () { + it("returns 'liquidity_pool:' for liquidity pool assets", function () { const asset = new StellarBase.LiquidityPoolId( 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7' ); diff --git a/test/unit/memo_test.js b/test/unit/memo_test.js index 91e56c2d7..ed3432005 100644 --- a/test/unit/memo_test.js +++ b/test/unit/memo_test.js @@ -1,11 +1,11 @@ -describe('Memo.constructor()', function() { - it('throws error when type is invalid', function() { +describe('Memo.constructor()', function () { + it('throws error when type is invalid', function () { expect(() => new StellarBase.Memo('test')).to.throw(/Invalid memo type/); }); }); -describe('Memo.none()', function() { - it('converts to/from xdr object', function() { +describe('Memo.none()', function () { + it('converts to/from xdr object', function () { let memo = StellarBase.Memo.none().toXDRObject(); expect(memo.value()).to.be.undefined; @@ -15,8 +15,8 @@ describe('Memo.none()', function() { }); }); -describe('Memo.text()', function() { - it('returns a value for a correct argument', function() { +describe('Memo.text()', function () { + it('returns a value for a correct argument', function () { expect(() => StellarBase.Memo.text('test')).to.not.throw(); let memoUtf8 = StellarBase.Memo.text('三代之時'); @@ -25,26 +25,15 @@ describe('Memo.text()', function() { expect(a).to.be.deep.equal(b); }); - it('returns a value for a correct argument (utf8)', function() { - let memoText = StellarBase.Memo.text([0xd1]) - .toXDRObject() - .toXDR(); + it('returns a value for a correct argument (utf8)', function () { + let memoText = StellarBase.Memo.text([0xd1]).toXDRObject().toXDR(); let expected = Buffer.from([ // memo_text - 0x00, - 0x00, - 0x00, - 0x01, + 0x00, 0x00, 0x00, 0x01, // length - 0x00, - 0x00, - 0x00, - 0x01, + 0x00, 0x00, 0x00, 0x01, // value - 0xd1, - 0x00, - 0x00, - 0x00 + 0xd1, 0x00, 0x00, 0x00 ]); expect(memoText.equals(expected)).to.be.true; @@ -54,7 +43,7 @@ describe('Memo.text()', function() { expect(memoText.equals(expected)).to.be.true; }); - it('converts to/from xdr object', function() { + it('converts to/from xdr object', function () { let memo = StellarBase.Memo.text('test').toXDRObject(); expect(memo.arm()).to.equal('text'); expect(memo.text()).to.equal('test'); @@ -65,7 +54,7 @@ describe('Memo.text()', function() { expect(baseMemo.value).to.be.equal('test'); }); - it('converts to/from xdr object (array)', function() { + it('converts to/from xdr object (array)', function () { let memo = StellarBase.Memo.text([0xd1]).toXDRObject(); expect(memo.arm()).to.equal('text'); @@ -77,7 +66,7 @@ describe('Memo.text()', function() { expect(baseMemo.value).to.be.deep.equal([0xd1]); }); - it('converts to/from xdr object (buffer)', function() { + it('converts to/from xdr object (buffer)', function () { let buf = Buffer.from([0xd1]); let memo = StellarBase.Memo.text(buf).toXDRObject(); expect(memo.arm()).to.equal('text'); @@ -90,7 +79,7 @@ describe('Memo.text()', function() { expect(baseMemo.value.equals(buf)).to.be.true; }); - it('throws an error when invalid argument was passed', function() { + it('throws an error when invalid argument was passed', function () { expect(() => StellarBase.Memo.text()).to.throw( /Expects string, array or buffer, max 28 bytes/ ); @@ -108,7 +97,7 @@ describe('Memo.text()', function() { ); }); - it('throws an error when string is longer than 28 bytes', function() { + it('throws an error when string is longer than 28 bytes', function () { expect(() => StellarBase.Memo.text('12345678901234567890123456789') ).to.throw(/Expects string, array or buffer, max 28 bytes/); @@ -118,13 +107,13 @@ describe('Memo.text()', function() { }); }); -describe('Memo.id()', function() { - it('returns a value for a correct argument', function() { +describe('Memo.id()', function () { + it('returns a value for a correct argument', function () { expect(() => StellarBase.Memo.id('1000')).to.not.throw(); expect(() => StellarBase.Memo.id('0')).to.not.throw(); }); - it('converts to/from xdr object', function() { + it('converts to/from xdr object', function () { let memo = StellarBase.Memo.id('1000').toXDRObject(); expect(memo.arm()).to.equal('id'); expect(memo.id().toString()).to.equal('1000'); @@ -134,7 +123,7 @@ describe('Memo.id()', function() { expect(baseMemo.value).to.be.equal('1000'); }); - it('throws an error when invalid argument was passed', function() { + it('throws an error when invalid argument was passed', function () { expect(() => StellarBase.Memo.id()).to.throw(/Expects a int64/); expect(() => StellarBase.Memo.id({})).to.throw(/Expects a int64/); expect(() => StellarBase.Memo.id(Infinity)).to.throw(/Expects a int64/); @@ -143,8 +132,8 @@ describe('Memo.id()', function() { }); }); -describe('Memo.hash() & Memo.return()', function() { - it('hash converts to/from xdr object', function() { +describe('Memo.hash() & Memo.return()', function () { + it('hash converts to/from xdr object', function () { let buffer = Buffer.alloc(32, 10); let memo = StellarBase.Memo.hash(buffer).toXDRObject(); @@ -158,7 +147,7 @@ describe('Memo.hash() & Memo.return()', function() { expect(baseMemo.value.toString('hex')).to.be.equal(buffer.toString('hex')); }); - it('return converts to/from xdr object', function() { + it('return converts to/from xdr object', function () { let buffer = Buffer.alloc(32, 10); // Testing string hash @@ -176,7 +165,7 @@ describe('Memo.hash() & Memo.return()', function() { var methods = [StellarBase.Memo.hash, StellarBase.Memo.return]; - it('returns a value for a correct argument', function() { + it('returns a value for a correct argument', function () { for (let i in methods) { let method = methods[i]; expect(() => method(Buffer.alloc(32))).to.not.throw(); @@ -188,7 +177,7 @@ describe('Memo.hash() & Memo.return()', function() { } }); - it('throws an error when invalid argument was passed', function() { + it('throws an error when invalid argument was passed', function () { for (let i in methods) { let method = methods[i]; expect(() => method()).to.throw(/Expects a 32 byte hash value/); diff --git a/test/unit/muxed_account_test.js b/test/unit/muxed_account_test.js index dd7cb2999..16ea5b039 100644 --- a/test/unit/muxed_account_test.js +++ b/test/unit/muxed_account_test.js @@ -1,11 +1,11 @@ -describe('muxed account abstraction works', function() { +describe('muxed account abstraction works', function () { const PUBKEY = 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ'; const MPUBKEY_ZERO = 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ'; const MPUBKEY_ID = 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAABUTGI4'; - it('generates addresses correctly', function() { + it('generates addresses correctly', function () { let baseAccount = new StellarBase.Account(PUBKEY, '1'); const mux = new StellarBase.MuxedAccount(baseAccount, '0'); expect(mux.baseAccount().accountId()).to.equal(PUBKEY); @@ -33,7 +33,7 @@ describe('muxed account abstraction works', function() { ); }); - it('tracks sequence numbers correctly', function() { + it('tracks sequence numbers correctly', function () { let baseAccount = new StellarBase.Account(PUBKEY, '12345'); const mux1 = new StellarBase.MuxedAccount(baseAccount, '1'); const mux2 = new StellarBase.MuxedAccount(baseAccount, '2'); @@ -61,7 +61,7 @@ describe('muxed account abstraction works', function() { expect(mux2.sequenceNumber()).to.equal('12348'); }); - it('lets virtual accounts be created', function() { + it('lets virtual accounts be created', function () { let baseAccount = new StellarBase.Account(PUBKEY, '12345'); const mux1 = new StellarBase.MuxedAccount(baseAccount, '1'); @@ -78,7 +78,7 @@ describe('muxed account abstraction works', function() { expect(mux3.sequenceNumber()).to.equal('12346'); }); - it('parses M-addresses', function() { + it('parses M-addresses', function () { const mux1 = new StellarBase.MuxedAccount.fromAddress(MPUBKEY_ZERO, '123'); expect(mux1.id()).to.equal('0'); expect(mux1.accountId()).to.equal(MPUBKEY_ZERO); diff --git a/test/unit/operation_test.js b/test/unit/operation_test.js index d408e1f0c..ecba9e221 100644 --- a/test/unit/operation_test.js +++ b/test/unit/operation_test.js @@ -6,9 +6,9 @@ import { encodeMuxedAccount } from '../../src/util/decode_encode_muxed_account.js'; -describe('Operation', function() { - describe('.createAccount()', function() { - it('creates a createAccountOp', function() { +describe('Operation', function () { + describe('.createAccount()', function () { + it('creates a createAccountOp', function () { var destination = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; var startingBalance = '1000.0000000'; @@ -23,16 +23,12 @@ describe('Operation', function() { var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('createAccount'); expect(obj.destination).to.be.equal(destination); - expect( - operation - .body() - .value() - .startingBalance() - .toString() - ).to.be.equal('10000000000'); + expect(operation.body().value().startingBalance().toString()).to.be.equal( + '10000000000' + ); expect(obj.startingBalance).to.be.equal(startingBalance); }); - it('fails to create createAccount operation with an invalid destination address', function() { + it('fails to create createAccount operation with an invalid destination address', function () { let opts = { destination: 'GCEZW', startingBalance: '20', @@ -43,7 +39,7 @@ describe('Operation', function() { ); }); - it('creates a createAccount operation with startingBalance equal to 0', function() { + it('creates a createAccount operation with startingBalance equal to 0', function () { let opts = { destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', startingBalance: '0', @@ -54,7 +50,7 @@ describe('Operation', function() { ); }); - it('fails to create createAccount operation with an invalid startingBalance', function() { + it('fails to create createAccount operation with an invalid startingBalance', function () { let opts = { destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', startingBalance: 20, @@ -65,7 +61,7 @@ describe('Operation', function() { ); }); - it('fails to create createAccount operation with an invalid source address', function() { + it('fails to create createAccount operation with an invalid source address', function () { let opts = { destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', startingBalance: '20', @@ -77,8 +73,8 @@ describe('Operation', function() { }); }); - describe('.payment()', function() { - it('creates a paymentOp', function() { + describe('.payment()', function () { + it('creates a paymentOp', function () { var destination = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; var amount = '1000.0000000'; @@ -131,12 +127,12 @@ describe('Operation', function() { let opts = { destination, asset, amount, source }; - it('supports muxed accounts', function() { + it('supports muxed accounts', function () { opts.source = opts.destination = base; paymentPacksCorrectly(opts); }); - it('supports mixing muxed and unmuxed properties', function() { + it('supports mixing muxed and unmuxed properties', function () { opts.source = base; opts.destination = destination; paymentPacksCorrectly(opts); @@ -146,7 +142,7 @@ describe('Operation', function() { paymentPacksCorrectly(opts); }); - it('fails to create payment operation with an invalid destination address', function() { + it('fails to create payment operation with an invalid destination address', function () { let opts = { destination: 'GCEZW', asset: StellarBase.Asset.native(), @@ -157,7 +153,7 @@ describe('Operation', function() { ); }); - it('fails to create payment operation with an invalid amount', function() { + it('fails to create payment operation with an invalid amount', function () { let opts = { destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', asset: StellarBase.Asset.native(), @@ -169,8 +165,8 @@ describe('Operation', function() { }); }); - describe('.pathPaymentStrictReceive()', function() { - it('creates a pathPaymentStrictReceiveOp', function() { + describe('.pathPaymentStrictReceive()', function () { + it('creates a pathPaymentStrictReceiveOp', function () { var sendAsset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -208,23 +204,15 @@ describe('Operation', function() { var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('pathPaymentStrictReceive'); expect(obj.sendAsset.equals(sendAsset)).to.be.true; - expect( - operation - .body() - .value() - .sendMax() - .toString() - ).to.be.equal('30070000'); + expect(operation.body().value().sendMax().toString()).to.be.equal( + '30070000' + ); expect(obj.sendMax).to.be.equal(sendMax); expect(obj.destination).to.be.equal(destination); expect(obj.destAsset.equals(destAsset)).to.be.true; - expect( - operation - .body() - .value() - .destAmount() - .toString() - ).to.be.equal('31415000'); + expect(operation.body().value().destAmount().toString()).to.be.equal( + '31415000' + ); expect(obj.destAmount).to.be.equal(destAmount); expect(obj.path[0].getCode()).to.be.equal('USD'); expect(obj.path[0].getIssuer()).to.be.equal( @@ -269,7 +257,7 @@ describe('Operation', function() { source }; - it('supports muxed accounts', function() { + it('supports muxed accounts', function () { const packed = StellarBase.Operation.pathPaymentStrictReceive(opts); // Ensure we can convert to and from the raw XDR: @@ -284,21 +272,21 @@ describe('Operation', function() { expect(unpacked.destination).to.equal(opts.destination); }); - it('fails to create path payment operation with an invalid destination address', function() { + it('fails to create path payment operation with an invalid destination address', function () { opts.destination = 'GCEZW'; expect(() => StellarBase.Operation.pathPaymentStrictReceive(opts) ).to.throw(/destination is invalid/); }); - it('fails to create path payment operation with an invalid sendMax', function() { + it('fails to create path payment operation with an invalid sendMax', function () { opts.sendMax = 20; expect(() => StellarBase.Operation.pathPaymentStrictReceive(opts) ).to.throw(/sendMax argument must be of type String/); }); - it('fails to create path payment operation with an invalid destAmount', function() { + it('fails to create path payment operation with an invalid destAmount', function () { let opts = { destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', sendMax: '20', @@ -315,8 +303,8 @@ describe('Operation', function() { }); }); - describe('.pathPaymentStrictSend()', function() { - it('creates a pathPaymentStrictSendOp', function() { + describe('.pathPaymentStrictSend()', function () { + it('creates a pathPaymentStrictSendOp', function () { var sendAsset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -354,23 +342,15 @@ describe('Operation', function() { var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('pathPaymentStrictSend'); expect(obj.sendAsset.equals(sendAsset)).to.be.true; - expect( - operation - .body() - .value() - .sendAmount() - .toString() - ).to.be.equal('30070000'); + expect(operation.body().value().sendAmount().toString()).to.be.equal( + '30070000' + ); expect(obj.sendAmount).to.be.equal(sendAmount); expect(obj.destination).to.be.equal(destination); expect(obj.destAsset.equals(destAsset)).to.be.true; - expect( - operation - .body() - .value() - .destMin() - .toString() - ).to.be.equal('31415000'); + expect(operation.body().value().destMin().toString()).to.be.equal( + '31415000' + ); expect(obj.destMin).to.be.equal(destMin); expect(obj.path[0].getCode()).to.be.equal('USD'); expect(obj.path[0].getIssuer()).to.be.equal( @@ -402,7 +382,7 @@ describe('Operation', function() { ) ]; - it('supports muxed accounts', function() { + it('supports muxed accounts', function () { const packed = StellarBase.Operation.pathPaymentStrictSend(opts); // Ensure we can convert to and from the raw XDR: @@ -417,7 +397,7 @@ describe('Operation', function() { expect(unpacked.destination).to.equal(opts.destination); }); - it('fails to create path payment operation with an invalid destination address', function() { + it('fails to create path payment operation with an invalid destination address', function () { let opts = { destination: 'GCEZW', sendAmount: '20', @@ -433,7 +413,7 @@ describe('Operation', function() { ); }); - it('fails to create path payment operation with an invalid sendAmount', function() { + it('fails to create path payment operation with an invalid sendAmount', function () { let opts = { destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', sendAmount: 20, @@ -449,7 +429,7 @@ describe('Operation', function() { ); }); - it('fails to create path payment operation with an invalid destMin', function() { + it('fails to create path payment operation with an invalid destMin', function () { let opts = { destination: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', sendAmount: '20', @@ -466,8 +446,8 @@ describe('Operation', function() { }); }); - describe('.changeTrust()', function() { - it('creates a changeTrustOp with Asset', function() { + describe('.changeTrust()', function () { + it('creates a changeTrustOp with Asset', function () { let asset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -480,17 +460,13 @@ describe('Operation', function() { var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('changeTrust'); expect(obj.line).to.be.deep.equal(asset); - expect( - operation - .body() - .value() - .limit() - .toString() - ).to.be.equal('9223372036854775807'); // MAX_INT64 + expect(operation.body().value().limit().toString()).to.be.equal( + '9223372036854775807' + ); // MAX_INT64 expect(obj.limit).to.be.equal('922337203685.4775807'); }); - it('creates a changeTrustOp with Asset and limit', function() { + it('creates a changeTrustOp with Asset and limit', function () { let asset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -506,17 +482,13 @@ describe('Operation', function() { var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('changeTrust'); expect(obj.line).to.be.deep.equal(asset); - expect( - operation - .body() - .value() - .limit() - .toString() - ).to.be.equal('500000000'); + expect(operation.body().value().limit().toString()).to.be.equal( + '500000000' + ); expect(obj.limit).to.be.equal('50.0000000'); }); - it('creates a changeTrustOp to a liquidity pool', function() { + it('creates a changeTrustOp to a liquidity pool', function () { const assetA = new StellarBase.Asset( 'ARST', 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB' @@ -536,17 +508,13 @@ describe('Operation', function() { expect(operation.type).to.be.equal('changeTrust'); expect(operation.line).to.be.deep.equal(asset); - expect( - opXdrObj - .body() - .value() - .limit() - .toString() - ).to.be.equal('9223372036854775807'); // MAX_INT64 + expect(opXdrObj.body().value().limit().toString()).to.be.equal( + '9223372036854775807' + ); // MAX_INT64 expect(operation.limit).to.be.equal('922337203685.4775807'); }); - it('deletes an Asset trustline', function() { + it('deletes an Asset trustline', function () { let asset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -565,7 +533,7 @@ describe('Operation', function() { expect(obj.limit).to.be.equal('0.0000000'); }); - it('deletes a LiquidityPoolAsset trustline', function() { + it('deletes a LiquidityPoolAsset trustline', function () { const assetA = new StellarBase.Asset( 'ARST', 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB' @@ -590,7 +558,7 @@ describe('Operation', function() { expect(obj.limit).to.be.equal('0.0000000'); }); - it('throws TypeError for incorrect limit argument', function() { + it('throws TypeError for incorrect limit argument', function () { let asset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -601,8 +569,8 @@ describe('Operation', function() { }); }); - describe('.allowTrust()', function() { - it('creates an allowTrustOp', function() { + describe('.allowTrust()', function () { + it('creates an allowTrustOp', function () { let trustor = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; let assetCode = 'USD'; let authorize = true; @@ -622,7 +590,7 @@ describe('Operation', function() { expect(obj.authorize).to.be.equal(1); }); - it('fails to create allowTrust operation with an invalid trustor address', function() { + it('fails to create allowTrust operation with an invalid trustor address', function () { let opts = { trustor: 'GCEZW' }; @@ -632,15 +600,15 @@ describe('Operation', function() { }); }); - describe('.setOptions()', function() { - it('auth flags are set correctly', function() { + describe('.setOptions()', function () { + it('auth flags are set correctly', function () { expect(StellarBase.AuthRequiredFlag).to.be.equal(1); expect(StellarBase.AuthRevocableFlag).to.be.equal(2); expect(StellarBase.AuthImmutableFlag).to.be.equal(4); expect(StellarBase.AuthClawbackEnabledFlag).to.be.equal(8); }); - it('creates a setOptionsOp', function() { + it('creates a setOptionsOp', function () { var opts = {}; opts.inflationDest = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; @@ -682,7 +650,7 @@ describe('Operation', function() { expect(obj.homeDomain.toString()).to.be.equal(opts.homeDomain); }); - it('creates a setOptionsOp with preAuthTx signer', function() { + it('creates a setOptionsOp with preAuthTx signer', function () { var opts = {}; var hash = StellarBase.hash('Tx hash'); @@ -703,7 +671,7 @@ describe('Operation', function() { expect(obj.signer.weight).to.be.equal(opts.signer.weight); }); - it('creates a setOptionsOp with preAuthTx signer from a hex string', function() { + it('creates a setOptionsOp with preAuthTx signer from a hex string', function () { var opts = {}; var hash = StellarBase.hash('Tx hash').toString('hex'); @@ -725,7 +693,7 @@ describe('Operation', function() { expect(obj.signer.weight).to.be.equal(opts.signer.weight); }); - it('creates a setOptionsOp with hash signer', function() { + it('creates a setOptionsOp with hash signer', function () { var opts = {}; var hash = StellarBase.hash('Hash Preimage'); @@ -746,7 +714,7 @@ describe('Operation', function() { expect(obj.signer.weight).to.be.equal(opts.signer.weight); }); - it('creates a setOptionsOp with hash signer from a hex string', function() { + it('creates a setOptionsOp with hash signer from a hex string', function () { var opts = {}; var hash = StellarBase.hash('Hash Preimage').toString('hex'); @@ -768,7 +736,7 @@ describe('Operation', function() { expect(obj.signer.weight).to.be.equal(opts.signer.weight); }); - it('creates a setOptionsOp with signed payload signer', function() { + it('creates a setOptionsOp with signed payload signer', function () { var opts = {}; var pubkey = 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'; @@ -776,9 +744,10 @@ describe('Operation', function() { ed25519: StellarBase.StrKey.decodeEd25519PublicKey(pubkey), payload: Buffer.from('test') }); - var xdrSignerKey = StellarBase.xdr.SignerKey.signerKeyTypeEd25519SignedPayload( - signedPayload - ); + var xdrSignerKey = + StellarBase.xdr.SignerKey.signerKeyTypeEd25519SignedPayload( + signedPayload + ); var payloadKey = StellarBase.SignerKey.encodeSignerKey(xdrSignerKey); //var rawSignedPayload = Buffer.concat([StellarBase.StrKey.decodeEd25519PublicKey(pubkey), Buffer.from('test')]); @@ -800,7 +769,7 @@ describe('Operation', function() { expect(obj.signer.weight).to.be.equal(opts.signer.weight); }); - it('empty homeDomain is decoded correctly', function() { + it('empty homeDomain is decoded correctly', function () { const keypair = StellarBase.Keypair.random(); const account = new StellarBase.Account(keypair.publicKey(), '0'); @@ -826,7 +795,7 @@ describe('Operation', function() { expect(tx2.operations[0].homeDomain).to.be.equal(''); }); - it('string setFlags', function() { + it('string setFlags', function () { let opts = { setFlags: '4' }; @@ -841,14 +810,14 @@ describe('Operation', function() { expect(obj.setFlags).to.be.equal(4); }); - it('fails to create setOptions operation with an invalid setFlags', function() { + it('fails to create setOptions operation with an invalid setFlags', function () { let opts = { setFlags: {} }; expect(() => StellarBase.Operation.setOptions(opts)).to.throw(); }); - it('string clearFlags', function() { + it('string clearFlags', function () { let opts = { clearFlags: '4' }; @@ -863,14 +832,14 @@ describe('Operation', function() { expect(obj.clearFlags).to.be.equal(4); }); - it('fails to create setOptions operation with an invalid clearFlags', function() { + it('fails to create setOptions operation with an invalid clearFlags', function () { let opts = { clearFlags: {} }; expect(() => StellarBase.Operation.setOptions(opts)).to.throw(); }); - it('fails to create setOptions operation with an invalid inflationDest address', function() { + it('fails to create setOptions operation with an invalid inflationDest address', function () { let opts = { inflationDest: 'GCEZW' }; @@ -879,7 +848,7 @@ describe('Operation', function() { ); }); - it('fails to create setOptions operation with an invalid signer address', function() { + it('fails to create setOptions operation with an invalid signer address', function () { let opts = { signer: { ed25519PublicKey: 'GDGU5OAPHNPU5UCL', @@ -891,7 +860,7 @@ describe('Operation', function() { ); }); - it('fails to create setOptions operation with multiple signer values', function() { + it('fails to create setOptions operation with multiple signer values', function () { let opts = { signer: { ed25519PublicKey: @@ -905,7 +874,7 @@ describe('Operation', function() { ); }); - it('fails to create setOptions operation with an invalid masterWeight', function() { + it('fails to create setOptions operation with an invalid masterWeight', function () { let opts = { masterWeight: 400 }; @@ -914,7 +883,7 @@ describe('Operation', function() { ); }); - it('fails to create setOptions operation with an invalid lowThreshold', function() { + it('fails to create setOptions operation with an invalid lowThreshold', function () { let opts = { lowThreshold: 400 }; @@ -923,7 +892,7 @@ describe('Operation', function() { ); }); - it('fails to create setOptions operation with an invalid medThreshold', function() { + it('fails to create setOptions operation with an invalid medThreshold', function () { let opts = { medThreshold: 400 }; @@ -932,7 +901,7 @@ describe('Operation', function() { ); }); - it('fails to create setOptions operation with an invalid highThreshold', function() { + it('fails to create setOptions operation with an invalid highThreshold', function () { let opts = { highThreshold: 400 }; @@ -941,7 +910,7 @@ describe('Operation', function() { ); }); - it('fails to create setOptions operation with an invalid homeDomain', function() { + it('fails to create setOptions operation with an invalid homeDomain', function () { let opts = { homeDomain: 67238 }; @@ -951,8 +920,8 @@ describe('Operation', function() { }); }); - describe('.manageSellOffer', function() { - it('creates a manageSellOfferOp (string price)', function() { + describe('.manageSellOffer', function () { + it('creates a manageSellOfferOp (string price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -974,19 +943,15 @@ describe('Operation', function() { expect(obj.type).to.be.equal('manageSellOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .amount() - .toString() - ).to.be.equal('31234560'); + expect(operation.body().value().amount().toString()).to.be.equal( + '31234560' + ); expect(obj.amount).to.be.equal(opts.amount); expect(obj.price).to.be.equal(opts.price); expect(obj.offerId).to.be.equal(opts.offerId); }); - it('creates a manageSellOfferOp (price fraction)', function() { + it('creates a manageSellOfferOp (price fraction)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1013,7 +978,7 @@ describe('Operation', function() { ); }); - it('creates an invalid manageSellOfferOp (price fraction)', function() { + it('creates an invalid manageSellOfferOp (price fraction)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1034,7 +999,7 @@ describe('Operation', function() { ); }); - it('creates a manageSellOfferOp (number price)', function() { + it('creates a manageSellOfferOp (number price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1057,7 +1022,7 @@ describe('Operation', function() { expect(obj.price).to.be.equal(opts.price.toString()); }); - it('creates a manageSellOfferOp (BigNumber price)', function() { + it('creates a manageSellOfferOp (BigNumber price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1080,7 +1045,7 @@ describe('Operation', function() { expect(obj.price).to.be.equal('1.25'); }); - it('creates a manageSellOfferOp with no offerId', function() { + it('creates a manageSellOfferOp with no offerId', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1101,19 +1066,15 @@ describe('Operation', function() { expect(obj.type).to.be.equal('manageSellOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .amount() - .toString() - ).to.be.equal('10000000000'); + expect(operation.body().value().amount().toString()).to.be.equal( + '10000000000' + ); expect(obj.amount).to.be.equal(opts.amount); expect(obj.price).to.be.equal(opts.price); expect(obj.offerId).to.be.equal('0'); // 0=create a new offer, otherwise edit an existing offer }); - it('cancels offer', function() { + it('cancels offer', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1135,19 +1096,13 @@ describe('Operation', function() { expect(obj.type).to.be.equal('manageSellOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .amount() - .toString() - ).to.be.equal('0'); + expect(operation.body().value().amount().toString()).to.be.equal('0'); expect(obj.amount).to.be.equal(opts.amount); expect(obj.price).to.be.equal(opts.price); expect(obj.offerId).to.be.equal('1'); // 0=create a new offer, otherwise edit an existing offer }); - it('fails to create manageSellOffer operation with an invalid amount', function() { + it('fails to create manageSellOffer operation with an invalid amount', function () { let opts = { amount: 20, price: '10', @@ -1165,7 +1120,7 @@ describe('Operation', function() { ); }); - it('fails to create manageSellOffer operation with missing price', function() { + it('fails to create manageSellOffer operation with missing price', function () { let opts = { amount: '20', selling: new StellarBase.Asset( @@ -1182,7 +1137,7 @@ describe('Operation', function() { ); }); - it('fails to create manageSellOffer operation with negative price', function() { + it('fails to create manageSellOffer operation with negative price', function () { let opts = { amount: '20', price: '-1', @@ -1200,7 +1155,7 @@ describe('Operation', function() { ); }); - it('fails to create manageSellOffer operation with invalid price', function() { + it('fails to create manageSellOffer operation with invalid price', function () { let opts = { amount: '20', price: 'test', @@ -1219,8 +1174,8 @@ describe('Operation', function() { }); }); - describe('.manageBuyOffer', function() { - it('creates a manageBuyOfferOp (string price)', function() { + describe('.manageBuyOffer', function () { + it('creates a manageBuyOfferOp (string price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1242,19 +1197,15 @@ describe('Operation', function() { expect(obj.type).to.be.equal('manageBuyOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .buyAmount() - .toString() - ).to.be.equal('31234560'); + expect(operation.body().value().buyAmount().toString()).to.be.equal( + '31234560' + ); expect(obj.buyAmount).to.be.equal(opts.buyAmount); expect(obj.price).to.be.equal(opts.price); expect(obj.offerId).to.be.equal(opts.offerId); }); - it('creates a manageBuyOfferOp (price fraction)', function() { + it('creates a manageBuyOfferOp (price fraction)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1281,7 +1232,7 @@ describe('Operation', function() { ); }); - it('creates an invalid manageBuyOfferOp (price fraction)', function() { + it('creates an invalid manageBuyOfferOp (price fraction)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1302,7 +1253,7 @@ describe('Operation', function() { ); }); - it('creates a manageBuyOfferOp (number price)', function() { + it('creates a manageBuyOfferOp (number price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1325,7 +1276,7 @@ describe('Operation', function() { expect(obj.price).to.be.equal(opts.price.toString()); }); - it('creates a manageBuyOfferOp (BigNumber price)', function() { + it('creates a manageBuyOfferOp (BigNumber price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1348,7 +1299,7 @@ describe('Operation', function() { expect(obj.price).to.be.equal('1.25'); }); - it('creates a manageBuyOfferOp with no offerId', function() { + it('creates a manageBuyOfferOp with no offerId', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1369,19 +1320,15 @@ describe('Operation', function() { expect(obj.type).to.be.equal('manageBuyOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .buyAmount() - .toString() - ).to.be.equal('10000000000'); + expect(operation.body().value().buyAmount().toString()).to.be.equal( + '10000000000' + ); expect(obj.buyAmount).to.be.equal(opts.buyAmount); expect(obj.price).to.be.equal(opts.price); expect(obj.offerId).to.be.equal('0'); // 0=create a new offer, otherwise edit an existing offer }); - it('cancels offer', function() { + it('cancels offer', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1403,19 +1350,13 @@ describe('Operation', function() { expect(obj.type).to.be.equal('manageBuyOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .buyAmount() - .toString() - ).to.be.equal('0'); + expect(operation.body().value().buyAmount().toString()).to.be.equal('0'); expect(obj.buyAmount).to.be.equal(opts.buyAmount); expect(obj.price).to.be.equal(opts.price); expect(obj.offerId).to.be.equal('1'); // 0=create a new offer, otherwise edit an existing offer }); - it('fails to create manageBuyOffer operation with an invalid amount', function() { + it('fails to create manageBuyOffer operation with an invalid amount', function () { let opts = { buyAmount: 20, price: '10', @@ -1433,7 +1374,7 @@ describe('Operation', function() { ); }); - it('fails to create manageBuyOffer operation with missing price', function() { + it('fails to create manageBuyOffer operation with missing price', function () { let opts = { buyAmount: '20', selling: new StellarBase.Asset( @@ -1450,7 +1391,7 @@ describe('Operation', function() { ); }); - it('fails to create manageBuyOffer operation with negative price', function() { + it('fails to create manageBuyOffer operation with negative price', function () { let opts = { buyAmount: '20', price: '-1', @@ -1468,7 +1409,7 @@ describe('Operation', function() { ); }); - it('fails to create manageBuyOffer operation with invalid price', function() { + it('fails to create manageBuyOffer operation with invalid price', function () { let opts = { buyAmount: '20', price: 'test', @@ -1487,8 +1428,8 @@ describe('Operation', function() { }); }); - describe('.createPassiveSellOffer', function() { - it('creates a createPassiveSellOfferOp (string price)', function() { + describe('.createPassiveSellOffer', function () { + it('creates a createPassiveSellOfferOp (string price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1509,18 +1450,14 @@ describe('Operation', function() { expect(obj.type).to.be.equal('createPassiveSellOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .amount() - .toString() - ).to.be.equal('112782700'); + expect(operation.body().value().amount().toString()).to.be.equal( + '112782700' + ); expect(obj.amount).to.be.equal(opts.amount); expect(obj.price).to.be.equal(opts.price); }); - it('creates a createPassiveSellOfferOp (number price)', function() { + it('creates a createPassiveSellOfferOp (number price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1541,18 +1478,14 @@ describe('Operation', function() { expect(obj.type).to.be.equal('createPassiveSellOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .amount() - .toString() - ).to.be.equal('112782700'); + expect(operation.body().value().amount().toString()).to.be.equal( + '112782700' + ); expect(obj.amount).to.be.equal(opts.amount); expect(obj.price).to.be.equal(opts.price.toString()); }); - it('creates a createPassiveSellOfferOp (BigNumber price)', function() { + it('creates a createPassiveSellOfferOp (BigNumber price)', function () { var opts = {}; opts.selling = new StellarBase.Asset( 'USD', @@ -1573,18 +1506,14 @@ describe('Operation', function() { expect(obj.type).to.be.equal('createPassiveSellOffer'); expect(obj.selling.equals(opts.selling)).to.be.true; expect(obj.buying.equals(opts.buying)).to.be.true; - expect( - operation - .body() - .value() - .amount() - .toString() - ).to.be.equal('112782700'); + expect(operation.body().value().amount().toString()).to.be.equal( + '112782700' + ); expect(obj.amount).to.be.equal(opts.amount); expect(obj.price).to.be.equal('1.25'); }); - it('fails to create createPassiveSellOffer operation with an invalid amount', function() { + it('fails to create createPassiveSellOffer operation with an invalid amount', function () { let opts = { amount: 20, price: '10', @@ -1602,7 +1531,7 @@ describe('Operation', function() { ); }); - it('fails to create createPassiveSellOffer operation with missing price', function() { + it('fails to create createPassiveSellOffer operation with missing price', function () { let opts = { amount: '20', selling: new StellarBase.Asset( @@ -1619,7 +1548,7 @@ describe('Operation', function() { ); }); - it('fails to create createPassiveSellOffer operation with negative price', function() { + it('fails to create createPassiveSellOffer operation with negative price', function () { let opts = { amount: '20', price: '-2', @@ -1638,10 +1567,10 @@ describe('Operation', function() { }); }); - describe('.accountMerge', function() { + describe('.accountMerge', function () { const base = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; - const checkMergeOp = function(opts) { + const checkMergeOp = function (opts) { const xdr = StellarBase.Operation.accountMerge(opts).toXDR('hex'); const op = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); const obj = StellarBase.Operation.fromXDRObject(op); @@ -1651,12 +1580,12 @@ describe('Operation', function() { return obj; }; - it('creates an accountMergeOp', function() { + it('creates an accountMergeOp', function () { let opts = { destination: base }; checkMergeOp(opts); }); - it('supports muxed accounts', function() { + it('supports muxed accounts', function () { const dest = encodeMuxedAccountToAddress(encodeMuxedAccount(base, '1')); const source = encodeMuxedAccountToAddress(encodeMuxedAccount(base, '2')); @@ -1669,7 +1598,7 @@ describe('Operation', function() { expect(obj.source).to.equal(base); }); - it('fails to create accountMergeOp with invalid destination', function() { + it('fails to create accountMergeOp with invalid destination', function () { let opts = { destination: 'GCEZW' }; expect(() => StellarBase.Operation.accountMerge(opts)).to.throw( /destination is invalid/ @@ -1677,8 +1606,8 @@ describe('Operation', function() { }); }); - describe('.inflation', function() { - it('creates a inflationOp', function() { + describe('.inflation', function () { + it('creates a inflationOp', function () { let op = StellarBase.Operation.inflation(); var xdr = op.toXDR('hex'); var operation = StellarBase.xdr.Operation.fromXDR( @@ -1689,8 +1618,8 @@ describe('Operation', function() { }); }); - describe('.manageData', function() { - it('creates a manageDataOp with string value', function() { + describe('.manageData', function () { + it('creates a manageDataOp with string value', function () { var opts = { name: 'name', value: 'value' @@ -1706,7 +1635,7 @@ describe('Operation', function() { expect(obj.value.toString('ascii')).to.be.equal(opts.value); }); - it('creates a manageDataOp with Buffer value', function() { + it('creates a manageDataOp with Buffer value', function () { var opts = { name: 'name', value: Buffer.from('value') @@ -1722,7 +1651,7 @@ describe('Operation', function() { expect(obj.value.toString('hex')).to.be.equal(opts.value.toString('hex')); }); - it('creates a manageDataOp with null dataValue', function() { + it('creates a manageDataOp with null dataValue', function () { var opts = { name: 'name', value: null @@ -1738,20 +1667,20 @@ describe('Operation', function() { expect(obj.value).to.be.undefined; }); - describe('fails to create manageData operation', function() { - it('name is not a string', function() { + describe('fails to create manageData operation', function () { + it('name is not a string', function () { expect(() => StellarBase.Operation.manageData({ name: 123 }) ).to.throw(); }); - it('name is too long', function() { + it('name is too long', function () { expect(() => StellarBase.Operation.manageData({ name: 'a'.repeat(65) }) ).to.throw(); }); - it('value is too long', function() { + it('value is too long', function () { expect(() => StellarBase.Operation.manageData({ name: 'a', @@ -1762,8 +1691,8 @@ describe('Operation', function() { }); }); - describe('.bumpSequence', function() { - it('creates a bumpSequence', function() { + describe('.bumpSequence', function () { + it('creates a bumpSequence', function () { var opts = { bumpTo: '77833036561510299' }; @@ -1777,15 +1706,15 @@ describe('Operation', function() { expect(obj.bumpTo).to.be.equal(opts.bumpTo); }); - it('fails when `bumpTo` is not string', function() { + it('fails when `bumpTo` is not string', function () { expect(() => StellarBase.Operation.bumpSequence({ bumpTo: 1000 }) ).to.throw(); }); }); - describe('._checkUnsignedIntValue()', function() { - it('returns true for valid values', function() { + describe('._checkUnsignedIntValue()', function () { + it('returns true for valid values', function () { let values = [ { value: 0, expected: 0 }, { value: 10, expected: 10 }, @@ -1802,7 +1731,7 @@ describe('Operation', function() { } }); - it('throws error for invalid values', function() { + it('throws error for invalid values', function () { let values = [ {}, [], @@ -1825,7 +1754,7 @@ describe('Operation', function() { } }); - it('return correct values when isValidFunction is set', function() { + it('return correct values when isValidFunction is set', function () { expect( StellarBase.Operation._checkUnsignedIntValue( 'test', @@ -1866,8 +1795,8 @@ describe('Operation', function() { }); }); - describe('createClaimableBalance()', function() { - it('creates a CreateClaimableBalanceOp', function() { + describe('createClaimableBalance()', function () { + it('creates a CreateClaimableBalanceOp', function () { const asset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -1897,7 +1826,7 @@ describe('Operation', function() { claimants[0].toXDRObject().toXDR('hex') ); }); - it('throws an error when asset is not present', function() { + it('throws an error when asset is not present', function () { const amount = '100.0000000'; const claimants = [ new StellarBase.Claimant( @@ -1916,7 +1845,7 @@ describe('Operation', function() { /must provide an asset for create claimable balance operation/ ); }); - it('throws an error when amount is not present', function() { + it('throws an error when amount is not present', function () { const asset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -1938,7 +1867,7 @@ describe('Operation', function() { /amount argument must be of type String, represent a positive number and have at most 7 digits after the decimal/ ); }); - it('throws an error when claimants is empty or not present', function() { + it('throws an error when claimants is empty or not present', function () { const asset = new StellarBase.Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -1961,8 +1890,8 @@ describe('Operation', function() { }); }); - describe('claimClaimableBalance()', function() { - it('creates a claimClaimableBalanceOp', function() { + describe('claimClaimableBalance()', function () { + it('creates a claimClaimableBalanceOp', function () { const balanceId = '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be'; @@ -1975,12 +1904,12 @@ describe('Operation', function() { expect(obj.type).to.be.equal('claimClaimableBalance'); expect(obj.balanceId).to.equal(balanceId); }); - it('throws an error when balanceId is not present', function() { + it('throws an error when balanceId is not present', function () { expect(() => StellarBase.Operation.claimClaimableBalance({})).to.throw( /must provide a valid claimable balance id/ ); }); - it('throws an error for invalid balanceIds', function() { + it('throws an error for invalid balanceIds', function () { expect(() => StellarBase.Operation.claimClaimableBalance({ balanceId: 'badc0ffee' @@ -1989,8 +1918,8 @@ describe('Operation', function() { }); }); - describe('clawbackClaimableBalance()', function() { - it('creates a clawbackClaimableBalanceOp', function() { + describe('clawbackClaimableBalance()', function () { + it('creates a clawbackClaimableBalanceOp', function () { const balanceId = '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be'; @@ -2005,12 +1934,12 @@ describe('Operation', function() { expect(obj.type).to.be.equal('clawbackClaimableBalance'); expect(obj.balanceId).to.equal(balanceId); }); - it('throws an error when balanceId is not present', function() { + it('throws an error when balanceId is not present', function () { expect(() => StellarBase.Operation.clawbackClaimableBalance({})).to.throw( /must provide a valid claimable balance id/ ); }); - it('throws an error for invalid balanceIds', function() { + it('throws an error for invalid balanceIds', function () { expect(() => StellarBase.Operation.clawbackClaimableBalance({ balanceId: 'badc0ffee' @@ -2019,8 +1948,8 @@ describe('Operation', function() { }); }); - describe('beginSponsoringFutureReserves()', function() { - it('creates a beginSponsoringFutureReservesOp', function() { + describe('beginSponsoringFutureReserves()', function () { + it('creates a beginSponsoringFutureReservesOp', function () { const sponsoredId = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; @@ -2037,7 +1966,7 @@ describe('Operation', function() { expect(obj.type).to.be.equal('beginSponsoringFutureReserves'); expect(obj.sponsoredId).to.equal(sponsoredId); }); - it('throws an error when sponsoredId is invalid', function() { + it('throws an error when sponsoredId is invalid', function () { expect(() => StellarBase.Operation.beginSponsoringFutureReserves({}) ).to.throw(/sponsoredId is invalid/); @@ -2049,8 +1978,8 @@ describe('Operation', function() { }); }); - describe('endSponsoringFutureReserves()', function() { - it('creates a endSponsoringFutureReservesOp', function() { + describe('endSponsoringFutureReserves()', function () { + it('creates a endSponsoringFutureReservesOp', function () { const op = StellarBase.Operation.endSponsoringFutureReserves(); var xdr = op.toXDR('hex'); @@ -2063,8 +1992,8 @@ describe('Operation', function() { }); }); - describe('revokeAccountSponsorship()', function() { - it('creates a revokeAccountSponsorshipOp', function() { + describe('revokeAccountSponsorship()', function () { + it('creates a revokeAccountSponsorshipOp', function () { const account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; const op = StellarBase.Operation.revokeAccountSponsorship({ @@ -2078,7 +2007,7 @@ describe('Operation', function() { expect(obj.type).to.be.equal('revokeAccountSponsorship'); expect(obj.account).to.be.equal(account); }); - it('throws an error when account is invalid', function() { + it('throws an error when account is invalid', function () { expect(() => StellarBase.Operation.revokeAccountSponsorship({})).to.throw( /account is invalid/ ); @@ -2090,8 +2019,8 @@ describe('Operation', function() { }); }); - describe('revokeTrustlineSponsorship()', function() { - it('creates a revokeTrustlineSponsorship', function() { + describe('revokeTrustlineSponsorship()', function () { + it('creates a revokeTrustlineSponsorship', function () { const account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; var asset = new StellarBase.Asset( @@ -2109,7 +2038,7 @@ describe('Operation', function() { var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('revokeTrustlineSponsorship'); }); - it('creates a revokeTrustlineSponsorship for a liquidity pool', function() { + it('creates a revokeTrustlineSponsorship for a liquidity pool', function () { const account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; const asset = new StellarBase.LiquidityPoolId( @@ -2126,7 +2055,7 @@ describe('Operation', function() { const obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('revokeTrustlineSponsorship'); }); - it('throws an error when account is invalid', function() { + it('throws an error when account is invalid', function () { expect(() => StellarBase.Operation.revokeTrustlineSponsorship({}) ).to.throw(/account is invalid/); @@ -2136,7 +2065,7 @@ describe('Operation', function() { }) ).to.throw(/account is invalid/); }); - it('throws an error when asset is invalid', function() { + it('throws an error when asset is invalid', function () { expect(() => StellarBase.Operation.revokeTrustlineSponsorship({ account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -2145,8 +2074,8 @@ describe('Operation', function() { }); }); - describe('revokeOfferSponsorship()', function() { - it('creates a revokeOfferSponsorship', function() { + describe('revokeOfferSponsorship()', function () { + it('creates a revokeOfferSponsorship', function () { const seller = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; var offerId = '1234'; const op = StellarBase.Operation.revokeOfferSponsorship({ @@ -2162,7 +2091,7 @@ describe('Operation', function() { expect(obj.seller).to.be.equal(seller); expect(obj.offerId).to.be.equal(offerId); }); - it('throws an error when seller is invalid', function() { + it('throws an error when seller is invalid', function () { expect(() => StellarBase.Operation.revokeOfferSponsorship({})).to.throw( /seller is invalid/ ); @@ -2172,7 +2101,7 @@ describe('Operation', function() { }) ).to.throw(/seller is invalid/); }); - it('throws an error when asset offerId is not included', function() { + it('throws an error when asset offerId is not included', function () { expect(() => StellarBase.Operation.revokeOfferSponsorship({ seller: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -2181,8 +2110,8 @@ describe('Operation', function() { }); }); - describe('revokeDataSponsorship()', function() { - it('creates a revokeDataSponsorship', function() { + describe('revokeDataSponsorship()', function () { + it('creates a revokeDataSponsorship', function () { const account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; var name = 'foo'; @@ -2199,7 +2128,7 @@ describe('Operation', function() { expect(obj.account).to.be.equal(account); expect(obj.name).to.be.equal(name); }); - it('throws an error when account is invalid', function() { + it('throws an error when account is invalid', function () { expect(() => StellarBase.Operation.revokeDataSponsorship({})).to.throw( /account is invalid/ ); @@ -2209,7 +2138,7 @@ describe('Operation', function() { }) ).to.throw(/account is invalid/); }); - it('throws an error when data name is not included', function() { + it('throws an error when data name is not included', function () { expect(() => StellarBase.Operation.revokeDataSponsorship({ account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -2218,8 +2147,8 @@ describe('Operation', function() { }); }); - describe('revokeClaimableBalanceSponsorship()', function() { - it('creates a revokeClaimableBalanceSponsorship', function() { + describe('revokeClaimableBalanceSponsorship()', function () { + it('creates a revokeClaimableBalanceSponsorship', function () { const balanceId = '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be'; const op = StellarBase.Operation.revokeClaimableBalanceSponsorship({ @@ -2233,15 +2162,15 @@ describe('Operation', function() { expect(obj.type).to.be.equal('revokeClaimableBalanceSponsorship'); expect(obj.balanceId).to.be.equal(balanceId); }); - it('throws an error when balanceId is invalid', function() { + it('throws an error when balanceId is invalid', function () { expect(() => StellarBase.Operation.revokeClaimableBalanceSponsorship({}) ).to.throw(/balanceId is invalid/); }); }); - describe('revokeLiquidityPoolSponsorship()', function() { - it('creates a revokeLiquidityPoolSponsorship', function() { + describe('revokeLiquidityPoolSponsorship()', function () { + it('creates a revokeLiquidityPoolSponsorship', function () { const liquidityPoolId = 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7'; const op = StellarBase.Operation.revokeLiquidityPoolSponsorship({ @@ -2257,15 +2186,15 @@ describe('Operation', function() { expect(obj.liquidityPoolId).to.be.equal(liquidityPoolId); }); - it('throws an error when liquidityPoolId is invalid', function() { + it('throws an error when liquidityPoolId is invalid', function () { expect(() => StellarBase.Operation.revokeLiquidityPoolSponsorship({}) ).to.throw(/liquidityPoolId is invalid/); }); }); - describe('revokeSignerSponsorship()', function() { - it('creates a revokeSignerSponsorship', function() { + describe('revokeSignerSponsorship()', function () { + it('creates a revokeSignerSponsorship', function () { const account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; let signer = { @@ -2313,7 +2242,7 @@ describe('Operation', function() { expect(obj.account).to.be.equal(account); expect(obj.signer.sha256Hash).to.be.equal(signer.sha256Hash); }); - it('throws an error when account is invalid', function() { + it('throws an error when account is invalid', function () { const signer = { ed25519PublicKey: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' @@ -2326,8 +2255,8 @@ describe('Operation', function() { }); }); - describe('clawback()', function() { - it('requires asset, amount, account', function() { + describe('clawback()', function () { + it('requires asset, amount, account', function () { let asset = new StellarBase.Asset( 'GCOIN', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' @@ -2349,7 +2278,7 @@ describe('Operation', function() { StellarBase.Operation.clawback({}); }).to.throw(); }); - it('returns a clawback()', function() { + it('returns a clawback()', function () { let account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; let asset = new StellarBase.Asset('GCOIN', account); const amount = '100.0000000'; @@ -2370,8 +2299,8 @@ describe('Operation', function() { }); }); - describe('setTrustLineFlags()', function() { - it('creates a SetTrustLineFlagsOp', function() { + describe('setTrustLineFlags()', function () { + it('creates a SetTrustLineFlagsOp', function () { let account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; let asset = new StellarBase.Asset('GCOIN', account); @@ -2400,7 +2329,7 @@ describe('Operation', function() { expect(obj.flags.authorizedToMaintainLiabilities).to.be.true; expect(obj.flags.clawbackEnabled).to.be.false; }); - it('leaves unmodified flags as undefined', function() { + it('leaves unmodified flags as undefined', function () { let account = 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'; let asset = new StellarBase.Asset('GCOIN', account); @@ -2440,7 +2369,7 @@ describe('Operation', function() { expect(obj.flags.authorizedToMaintainLiabilities).to.be.undefined; expect(obj.flags.clawbackEnabled).to.be.undefined; }); - it('fails with invalid flags', function() { + it('fails with invalid flags', function () { expect(() => { StellarBase.Operation.setTrustLineFlags({ trustor: account, @@ -2452,15 +2381,15 @@ describe('Operation', function() { }); }).to.throw(); }); - it('should require parameters', function() { + it('should require parameters', function () { expect(() => { StellarBase.Operation.setTrustLineFlags({}); }).to.throw(); }); }); - describe('liquidityPoolDeposit()', function() { - it('throws an error if a required parameter is missing', function() { + describe('liquidityPoolDeposit()', function () { + it('throws an error if a required parameter is missing', function () { expect(() => StellarBase.Operation.liquidityPoolDeposit()).to.throw( /liquidityPoolId argument is required/ ); @@ -2496,7 +2425,7 @@ describe('Operation', function() { .throw; }); - it('throws an error if prices are negative', function() { + it('throws an error if prices are negative', function () { const opts = { liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', @@ -2510,7 +2439,7 @@ describe('Operation', function() { ); }); - it('creates a liquidityPoolDeposit (string prices)', function() { + it('creates a liquidityPoolDeposit (string prices)', function () { const opts = { liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', @@ -2524,20 +2453,12 @@ describe('Operation', function() { const xdrObj = StellarBase.xdr.Operation.fromXDR(Buffer.from(xdr, 'hex')); expect(xdrObj.body().switch().name).to.equal('liquidityPoolDeposit'); - expect( - xdrObj - .body() - .value() - .maxAmountA() - .toString() - ).to.equal('100000000'); - expect( - xdrObj - .body() - .value() - .maxAmountB() - .toString() - ).to.equal('200000000'); + expect(xdrObj.body().value().maxAmountA().toString()).to.equal( + '100000000' + ); + expect(xdrObj.body().value().maxAmountB().toString()).to.equal( + '200000000' + ); const operation = StellarBase.Operation.fromXDRObject(xdrObj); expect(operation.type).to.be.equal('liquidityPoolDeposit'); @@ -2548,7 +2469,7 @@ describe('Operation', function() { expect(operation.maxPrice).to.be.equals(opts.maxPrice); }); - it('creates a liquidityPoolDeposit (fraction prices)', function() { + it('creates a liquidityPoolDeposit (fraction prices)', function () { const opts = { liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', @@ -2568,20 +2489,12 @@ describe('Operation', function() { const xdrObj = StellarBase.xdr.Operation.fromXDR(Buffer.from(xdr, 'hex')); expect(xdrObj.body().switch().name).to.equal('liquidityPoolDeposit'); - expect( - xdrObj - .body() - .value() - .maxAmountA() - .toString() - ).to.equal('100000000'); - expect( - xdrObj - .body() - .value() - .maxAmountB() - .toString() - ).to.equal('200000000'); + expect(xdrObj.body().value().maxAmountA().toString()).to.equal( + '100000000' + ); + expect(xdrObj.body().value().maxAmountB().toString()).to.equal( + '200000000' + ); const operation = StellarBase.Operation.fromXDRObject(xdrObj); expect(operation.type).to.be.equal('liquidityPoolDeposit'); @@ -2596,7 +2509,7 @@ describe('Operation', function() { ); }); - it('creates a liquidityPoolDeposit (number prices)', function() { + it('creates a liquidityPoolDeposit (number prices)', function () { const opts = { liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', @@ -2610,20 +2523,12 @@ describe('Operation', function() { const xdrObj = StellarBase.xdr.Operation.fromXDR(Buffer.from(xdr, 'hex')); expect(xdrObj.body().switch().name).to.equal('liquidityPoolDeposit'); - expect( - xdrObj - .body() - .value() - .maxAmountA() - .toString() - ).to.equal('100000000'); - expect( - xdrObj - .body() - .value() - .maxAmountB() - .toString() - ).to.equal('200000000'); + expect(xdrObj.body().value().maxAmountA().toString()).to.equal( + '100000000' + ); + expect(xdrObj.body().value().maxAmountB().toString()).to.equal( + '200000000' + ); const operation = StellarBase.Operation.fromXDRObject(xdrObj); expect(operation.type).to.be.equal('liquidityPoolDeposit'); @@ -2634,7 +2539,7 @@ describe('Operation', function() { expect(operation.maxPrice).to.be.equals(opts.maxPrice.toString()); }); - it('creates a liquidityPoolDeposit (BigNumber prices)', function() { + it('creates a liquidityPoolDeposit (BigNumber prices)', function () { const opts = { liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', @@ -2648,20 +2553,12 @@ describe('Operation', function() { const xdrObj = StellarBase.xdr.Operation.fromXDR(Buffer.from(xdr, 'hex')); expect(xdrObj.body().switch().name).to.equal('liquidityPoolDeposit'); - expect( - xdrObj - .body() - .value() - .maxAmountA() - .toString() - ).to.equal('100000000'); - expect( - xdrObj - .body() - .value() - .maxAmountB() - .toString() - ).to.equal('200000000'); + expect(xdrObj.body().value().maxAmountA().toString()).to.equal( + '100000000' + ); + expect(xdrObj.body().value().maxAmountB().toString()).to.equal( + '200000000' + ); const operation = StellarBase.Operation.fromXDRObject(xdrObj); expect(operation.type).to.be.equal('liquidityPoolDeposit'); @@ -2673,8 +2570,8 @@ describe('Operation', function() { }); }); - describe('liquidityPoolWithdraw()', function() { - it('throws an error if a required parameter is missing', function() { + describe('liquidityPoolWithdraw()', function () { + it('throws an error if a required parameter is missing', function () { expect(() => StellarBase.Operation.liquidityPoolWithdraw()).to.throw( /liquidityPoolId argument is required/ ); @@ -2705,7 +2602,7 @@ describe('Operation', function() { .throw; }); - it('creates a liquidityPoolWithdraw', function() { + it('creates a liquidityPoolWithdraw', function () { const opts = { liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', @@ -2718,27 +2615,13 @@ describe('Operation', function() { const xdrObj = StellarBase.xdr.Operation.fromXDR(Buffer.from(xdr, 'hex')); expect(xdrObj.body().switch().name).to.equal('liquidityPoolWithdraw'); - expect( - xdrObj - .body() - .value() - .amount() - .toString() - ).to.equal('50000000'); - expect( - xdrObj - .body() - .value() - .minAmountA() - .toString() - ).to.equal('100000000'); - expect( - xdrObj - .body() - .value() - .minAmountB() - .toString() - ).to.equal('200000000'); + expect(xdrObj.body().value().amount().toString()).to.equal('50000000'); + expect(xdrObj.body().value().minAmountA().toString()).to.equal( + '100000000' + ); + expect(xdrObj.body().value().minAmountB().toString()).to.equal( + '200000000' + ); const operation = StellarBase.Operation.fromXDRObject(xdrObj); expect(operation.type).to.be.equal('liquidityPoolWithdraw'); @@ -2749,8 +2632,8 @@ describe('Operation', function() { }); }); - describe('.isValidAmount()', function() { - it('returns true for valid amounts', function() { + describe('.isValidAmount()', function () { + it('returns true for valid amounts', function () { let amounts = [ '10', '0.10', @@ -2763,7 +2646,7 @@ describe('Operation', function() { } }); - it('returns false for invalid amounts', function() { + it('returns false for invalid amounts', function () { let amounts = [ 100, // integer 100.5, // float @@ -2785,14 +2668,14 @@ describe('Operation', function() { } }); - it('allows 0 only if allowZero argument is set to true', function() { + it('allows 0 only if allowZero argument is set to true', function () { expect(StellarBase.Operation.isValidAmount('0')).to.be.false; expect(StellarBase.Operation.isValidAmount('0', true)).to.be.true; }); }); - describe('._fromXDRAmount()', function() { - it('correctly parses the amount', function() { + describe('._fromXDRAmount()', function () { + it('correctly parses the amount', function () { expect(StellarBase.Operation._fromXDRAmount(1)).to.be.equal('0.0000001'); expect(StellarBase.Operation._fromXDRAmount(10000000)).to.be.equal( '1.0000000' diff --git a/test/unit/signerkey_test.js b/test/unit/signerkey_test.js index a9d45e9c3..92e0672a3 100644 --- a/test/unit/signerkey_test.js +++ b/test/unit/signerkey_test.js @@ -1,5 +1,5 @@ -describe('SignerKey', function() { - describe('encode/decode roundtrip', function() { +describe('SignerKey', function () { + describe('encode/decode roundtrip', function () { const TEST_CASES = [ { strkey: 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ', @@ -21,7 +21,7 @@ describe('SignerKey', function() { ]; TEST_CASES.forEach((testCase) => { - it(`works for ${testCase.strkey.substring(0, 5)}...`, function() { + it(`works for ${testCase.strkey.substring(0, 5)}...`, function () { const skey = StellarBase.SignerKey.decodeAddress(testCase.strkey); expect(skey.switch()).to.eql(testCase.type); @@ -35,7 +35,7 @@ describe('SignerKey', function() { }); }); - describe('error cases', function() { + describe('error cases', function () { [ // these are valid strkeys, just not valid signers 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', @@ -43,14 +43,14 @@ describe('SignerKey', function() { // this is (literal) nonsense 'NONSENSE' ].forEach((strkey) => { - it(`fails on ${strkey.substring(0, 5)}...`, function() { + it(`fails on ${strkey.substring(0, 5)}...`, function () { expect(() => { StellarBase.SignerKey.decodeAddress(strkey); }).to.throw(/invalid signer key type/i); }); }); - it('fails on invalid strkey', function() { + it('fails on invalid strkey', function () { expect(() => // address taken from strkey_test.js#invalidStrKeys StellarBase.SignerKey.decodeAddress( diff --git a/test/unit/signing_test.js b/test/unit/signing_test.js index 2f1f859c1..f7c2205f8 100644 --- a/test/unit/signing_test.js +++ b/test/unit/signing_test.js @@ -12,30 +12,30 @@ let secretKey = Buffer.from( 'hex' ); -describe('StellarBase#sign', function() { +describe('StellarBase#sign', function () { let expectedSig = '587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309'; - it('can sign an string properly', function() { + it('can sign an string properly', function () { let data = 'hello world'; let actualSig = StellarBase.sign(data, secretKey).toString('hex'); expect(actualSig).to.eql(expectedSig); }); - it('can sign an buffer properly', function() { + it('can sign an buffer properly', function () { let data = Buffer.from('hello world', 'utf8'); let actualSig = StellarBase.sign(data, secretKey).toString('hex'); expect(actualSig).to.eql(expectedSig); }); - it('can sign an array of bytes properly', function() { + it('can sign an array of bytes properly', function () { let data = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; let actualSig = StellarBase.sign(data, secretKey).toString('hex'); expect(actualSig).to.eql(expectedSig); }); }); -describe('StellarBase#verify', function() { +describe('StellarBase#verify', function () { let sig = Buffer.from( '587d4b472eeef7d07aafcd0b049640b0bb3f39784118c2e2b73a04fa2f64c9c538b4b2d0f5335e968a480021fdc23e98c0ddf424cb15d8131df8cb6c4bb58309', 'hex' @@ -45,21 +45,21 @@ describe('StellarBase#verify', function() { 'hex' ); - it('can verify an string properly', function() { + it('can verify an string properly', function () { let data = 'hello world'; expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; expect(StellarBase.verify('corrupted', sig, publicKey)).to.not.be.ok; expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); - it('can verify an buffer properly', function() { + it('can verify an buffer properly', function () { let data = Buffer.from('hello world', 'utf8'); expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; expect(StellarBase.verify('corrupted', sig, publicKey)).to.not.be.ok; expect(StellarBase.verify(data, badSig, publicKey)).to.not.be.ok; }); - it('can verify an array of bytes properly', function() { + it('can verify an array of bytes properly', function () { let data = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]; expect(StellarBase.verify(data, sig, publicKey)).to.be.ok; expect(StellarBase.verify('corrupted', sig, publicKey)).to.not.be.ok; diff --git a/test/unit/strkey_test.js b/test/unit/strkey_test.js index a891c120b..f1734de3c 100644 --- a/test/unit/strkey_test.js +++ b/test/unit/strkey_test.js @@ -1,5 +1,5 @@ -describe('StrKey', function() { - beforeEach(function() { +describe('StrKey', function () { + beforeEach(function () { var keypair = StellarBase.Keypair.master( 'Test SDF Network ; September 2015' ); @@ -10,8 +10,8 @@ describe('StrKey', function() { this.unencodedBuffer ); }); - describe('#decodeCheck', function() { - it('decodes correctly', function() { + describe('#decodeCheck', function () { + it('decodes correctly', function () { expect( StellarBase.StrKey.decodeEd25519PublicKey(this.accountIdEncoded) ).to.eql(this.unencodedBuffer); @@ -20,7 +20,7 @@ describe('StrKey', function() { ).to.eql(this.unencodedBuffer); }); - it('throws an error when the version byte is wrong', function() { + it('throws an error when the version byte is wrong', function () { expect(() => StellarBase.StrKey.decodeEd25519SecretSeed( 'GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL' @@ -33,7 +33,7 @@ describe('StrKey', function() { ).to.throw(/invalid version/); }); - it('throws an error when decoded data encodes to other string', function() { + it('throws an error when decoded data encodes to other string', function () { // accountId expect(() => StellarBase.StrKey.decodeEd25519PublicKey( @@ -88,7 +88,7 @@ describe('StrKey', function() { ).to.throw(/invalid encoded string/); }); - it('throws an error when the checksum is wrong', function() { + it('throws an error when the checksum is wrong', function () { expect(() => StellarBase.StrKey.decodeEd25519PublicKey( 'GBPXXOA5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVT' @@ -102,8 +102,8 @@ describe('StrKey', function() { }); }); - describe('#encodeCheck', function() { - it('encodes a buffer correctly', function() { + describe('#encodeCheck', function () { + it('encodes a buffer correctly', function () { expect( StellarBase.StrKey.encodeEd25519PublicKey(this.unencodedBuffer) ).to.eql(this.accountIdEncoded); @@ -132,7 +132,7 @@ describe('StrKey', function() { ); }); - it('encodes a buffer correctly', function() { + it('encodes a buffer correctly', function () { expect( StellarBase.StrKey.encodeEd25519PublicKey(this.unencodedBuffer) ).to.eql(this.accountIdEncoded); @@ -141,7 +141,7 @@ describe('StrKey', function() { ).to.eql(this.seedEncoded); }); - it('throws an error when the data is null', function() { + it('throws an error when the data is null', function () { expect(() => StellarBase.StrKey.encodeEd25519SecretSeed(null)).to.throw( /null data/ ); @@ -151,8 +151,8 @@ describe('StrKey', function() { }); }); - describe('#isValidEd25519PublicKey', function() { - it('returns true for valid public key', function() { + describe('#isValidEd25519PublicKey', function () { + it('returns true for valid public key', function () { var keys = [ 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', 'GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT', @@ -171,7 +171,7 @@ describe('StrKey', function() { } }); - it('returns false for invalid public key', function() { + it('returns false for invalid public key', function () { var keys = [ 'GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL', 'GCFZB6L25D26RQFDWSSBDEYQ32JHLRMTT44ZYE3DZQUTYOL7WY43PLBG++', @@ -192,8 +192,8 @@ describe('StrKey', function() { }); }); - describe('#isValidSecretKey', function() { - it('returns true for valid secret key', function() { + describe('#isValidSecretKey', function () { + it('returns true for valid secret key', function () { var keys = [ 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY', 'SCZTUEKSEH2VYZQC6VLOTOM4ZDLMAGV4LUMH4AASZ4ORF27V2X64F2S2', @@ -208,7 +208,7 @@ describe('StrKey', function() { } }); - it('returns false for invalid secret key', function() { + it('returns false for invalid secret key', function () { var keys = [ 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', 'SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDYT', // Too long @@ -233,8 +233,8 @@ describe('StrKey', function() { 'hex' ); - describe('#muxedAccounts', function() { - it('encodes & decodes M... addresses correctly', function() { + describe('#muxedAccounts', function () { + it('encodes & decodes M... addresses correctly', function () { expect(StellarBase.StrKey.encodeMed25519PublicKey(RAW_MPUBKEY)).to.equal( MPUBKEY ); @@ -243,7 +243,7 @@ describe('StrKey', function() { ).to.be.true; }); - it('lets G... accounts pass through (unmuxed)', function() { + it('lets G... accounts pass through (unmuxed)', function () { const unmuxed = StellarBase.decodeAddressToMuxedAccount(PUBKEY); expect(StellarBase.xdr.MuxedAccount.isValid(unmuxed)).to.be.true; @@ -258,7 +258,7 @@ describe('StrKey', function() { expect(StellarBase.encodeMuxedAccountToAddress(unmuxed)).to.equal(PUBKEY); }); - it('decodes underlying G... address correctly', function() { + it('decodes underlying G... address correctly', function () { expect(StellarBase.extractBaseAddress(MPUBKEY)).to.equal(PUBKEY); expect(StellarBase.extractBaseAddress(PUBKEY)).to.equal(PUBKEY); }); @@ -266,7 +266,7 @@ describe('StrKey', function() { const RAW_PUBKEY = StellarBase.StrKey.decodeEd25519PublicKey(PUBKEY); const unmuxed = StellarBase.xdr.MuxedAccount.keyTypeEd25519(RAW_PUBKEY); - it('encodes & decodes unmuxed keys', function() { + it('encodes & decodes unmuxed keys', function () { expect(StellarBase.xdr.MuxedAccount.isValid(unmuxed)).to.be.true; expect(unmuxed.switch()).to.equal( StellarBase.xdr.CryptoKeyType.keyTypeEd25519() @@ -301,7 +301,7 @@ describe('StrKey', function() { ]; CASES.forEach((testCase) => { - it(`encodes & decodes muxed key w/ ID=${testCase.id}`, function() { + it(`encodes & decodes muxed key w/ ID=${testCase.id}`, function () { const muxed = StellarBase.decodeAddressToMuxedAccount(testCase.strkey); expect(StellarBase.xdr.MuxedAccount.isValid(muxed)).to.be.true; expect(muxed.switch()).to.equal( @@ -319,7 +319,7 @@ describe('StrKey', function() { }); }); - describe('#signedPayloads', function() { + describe('#signedPayloads', function () { const HAPPY_PATHS = [ { desc: 'valid w/ 32-byte payload', @@ -339,7 +339,7 @@ describe('StrKey', function() { ]; HAPPY_PATHS.forEach((testCase) => { - it(testCase.desc, function() { + it(testCase.desc, function () { const spBuf = StellarBase.StrKey.decodeSignedPayload(testCase.strkey); const sp = StellarBase.xdr.SignerKeyEd25519SignedPayload.fromXDR( spBuf, @@ -357,7 +357,7 @@ describe('StrKey', function() { }); }); - describe('payload bounds', function() { + describe('payload bounds', function () { let sp = new StellarBase.xdr.SignerKeyEd25519SignedPayload({ ed25519: StellarBase.StrKey.decodeEd25519PublicKey( 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ' @@ -370,29 +370,29 @@ describe('StrKey', function() { ); }; - it('invalid with no payload', function() { + it('invalid with no payload', function () { sp.payload(Buffer.alloc(0)); expect(isValid(sp)).to.be.false; }); - it('valid with 1-byte payload', function() { + it('valid with 1-byte payload', function () { sp.payload(Buffer.alloc(1)); expect(isValid(sp)).to.be.true; }); - it('throws with 65-byte payload', function() { + it('throws with 65-byte payload', function () { sp.payload(Buffer.alloc(65)); expect(() => isValid(sp)).to.throw(/XDR Write Error/); }); - it('valid with 64-byte payload (max)', function() { + it('valid with 64-byte payload (max)', function () { sp.payload(Buffer.alloc(64)); expect(isValid(sp)).to.be.true; }); }); }); - describe('#invalidStrKeys', function() { + describe('#invalidStrKeys', function () { // From https://stellar.org/protocol/sep-23#invalid-test-cases const BAD_STRKEYS = [ // The unused trailing bit must be zero in the encoding of the last three @@ -438,7 +438,7 @@ describe('StrKey', function() { ]; BAD_STRKEYS.forEach((address) => { - it(`fails in expected case ${address}`, function() { + it(`fails in expected case ${address}`, function () { const vb = StellarBase.StrKey.getVersionByteForPrefix(address); expect(() => StellarBase.StrKey.decodeCheck(vb, address)).to.throw(); }); diff --git a/test/unit/transaction_builder_test.js b/test/unit/transaction_builder_test.js index 7c83fff72..4419eb3de 100644 --- a/test/unit/transaction_builder_test.js +++ b/test/unit/transaction_builder_test.js @@ -1,15 +1,15 @@ import { isValidDate } from '../../src/transaction_builder.js'; import { encodeMuxedAccountToAddress } from '../../src/util/decode_encode_muxed_account.js'; -describe('TransactionBuilder', function() { - describe('constructs a native payment transaction with one operation', function() { +describe('TransactionBuilder', function () { + describe('constructs a native payment transaction with one operation', function () { var source; var destination; var amount; var asset; var transaction; var memo; - beforeEach(function() { + beforeEach(function () { source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -35,34 +35,34 @@ describe('TransactionBuilder', function() { .build(); }); - it('should have the same source account', function(done) { + it('should have the same source account', function (done) { expect(transaction.source).to.be.equal(source.accountId()); done(); }); - it('should have the incremented sequence number', function(done) { + it('should have the incremented sequence number', function (done) { expect(transaction.sequence).to.be.equal('1'); done(); }); - it("should increment the account's sequence number", function(done) { + it("should increment the account's sequence number", function (done) { expect(source.sequenceNumber()).to.be.equal('1'); done(); }); - it('should have one payment operation', function(done) { + it('should have one payment operation', function (done) { expect(transaction.operations.length).to.be.equal(1); expect(transaction.operations[0].type).to.be.equal('payment'); done(); }); - it('should have 100 stroops fee', function(done) { + it('should have 100 stroops fee', function (done) { expect(transaction.fee).to.be.equal('100'); done(); }); }); - describe('constructs a native payment transaction with two operations', function() { + describe('constructs a native payment transaction with two operations', function () { var source; var destination1; var amount1; @@ -70,7 +70,7 @@ describe('TransactionBuilder', function() { var amount2; var asset; var transaction; - beforeEach(function() { + beforeEach(function () { asset = StellarBase.Asset.native(); source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', @@ -104,35 +104,35 @@ describe('TransactionBuilder', function() { .build(); }); - it('should have the same source account', function(done) { + it('should have the same source account', function (done) { expect(transaction.source).to.be.equal(source.accountId()); done(); }); - it('should have the incremented sequence number', function(done) { + it('should have the incremented sequence number', function (done) { expect(transaction.sequence).to.be.equal('1'); done(); }); - it("should increment the account's sequence number", function(done) { + it("should increment the account's sequence number", function (done) { expect(source.sequenceNumber()).to.be.equal('1'); done(); }); - it('should have two payment operation', function(done) { + it('should have two payment operation', function (done) { expect(transaction.operations.length).to.be.equal(2); expect(transaction.operations[0].type).to.be.equal('payment'); expect(transaction.operations[1].type).to.be.equal('payment'); done(); }); - it('should have 200 stroops fee', function(done) { + it('should have 200 stroops fee', function (done) { expect(transaction.fee).to.be.equal('200'); done(); }); }); - describe('constructs a native payment transaction with custom base fee', function() { + describe('constructs a native payment transaction with custom base fee', function () { var source; var destination1; var amount1; @@ -140,7 +140,7 @@ describe('TransactionBuilder', function() { var amount2; var asset; var transaction; - beforeEach(function() { + beforeEach(function () { asset = StellarBase.Asset.native(); source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', @@ -174,14 +174,14 @@ describe('TransactionBuilder', function() { .build(); }); - it('should have 2000 stroops fee', function(done) { + it('should have 2000 stroops fee', function (done) { expect(transaction.fee).to.be.equal('2000'); done(); }); }); - describe('constructs a native payment transaction with integer timebounds', function() { - it('should have have timebounds', function(done) { + describe('constructs a native payment transaction with integer timebounds', function () { + it('should have have timebounds', function (done) { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -211,31 +211,31 @@ describe('TransactionBuilder', function() { }); }); - describe('distinguishes whether a provided Date is valid or invalid', function() { - it('should accept empty Date objects', function(done) { + describe('distinguishes whether a provided Date is valid or invalid', function () { + it('should accept empty Date objects', function (done) { let d = new Date(); expect(isValidDate(d)).to.be.true; done(); }); - it('should accept configured Date objects', function(done) { + it('should accept configured Date objects', function (done) { let d = new Date(1455287522000); expect(isValidDate(d)).to.be.true; done(); }); - it('should reject mis-configured Date objects', function(done) { + it('should reject mis-configured Date objects', function (done) { let d = new Date('bad string here'); expect(isValidDate(d)).to.be.false; done(); }); - it('should reject objects that are not Dates', function(done) { + it('should reject objects that are not Dates', function (done) { let d = [1455287522000]; expect(isValidDate(d)).to.be.false; done(); }); }); - describe('constructs a native payment transaction with date timebounds', function() { - it('should have expected timebounds', function(done) { + describe('constructs a native payment transaction with date timebounds', function () { + it('should have expected timebounds', function (done) { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -272,8 +272,8 @@ describe('TransactionBuilder', function() { done(); }); }); - describe('timebounds', function() { - it('requires maxTime', function() { + describe('timebounds', function () { + it('requires maxTime', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -289,7 +289,7 @@ describe('TransactionBuilder', function() { 'TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).' ); }); - it('requires minTime', function() { + it('requires minTime', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -305,7 +305,7 @@ describe('TransactionBuilder', function() { 'TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).' ); }); - it('works with timebounds defined', function() { + it('works with timebounds defined', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -321,7 +321,7 @@ describe('TransactionBuilder', function() { }).build(); }).to.not.throw(); }); - it('fails with empty timebounds', function() { + it('fails with empty timebounds', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -336,8 +336,8 @@ describe('TransactionBuilder', function() { ); }); }); - describe('setTimeout', function() { - it('not called', function() { + describe('setTimeout', function () { + it('not called', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -359,7 +359,7 @@ describe('TransactionBuilder', function() { expect(source.sequenceNumber()).to.be.equal('0'); }); - it('timeout negative', function() { + it('timeout negative', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -381,7 +381,7 @@ describe('TransactionBuilder', function() { expect(source.sequenceNumber()).to.be.equal('0'); }); - it('sets timebounds', function() { + it('sets timebounds', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -407,7 +407,7 @@ describe('TransactionBuilder', function() { ); }); - it('fails when maxTime already set', function() { + it('fails when maxTime already set', function () { let timebounds = { minTime: '1455287522', maxTime: '1455297545' @@ -433,7 +433,7 @@ describe('TransactionBuilder', function() { ); }); - it('sets timebounds.maxTime when minTime already set', function() { + it('sets timebounds.maxTime when minTime already set', function () { let timebounds = { minTime: '1455287522', maxTime: '0' @@ -463,7 +463,7 @@ describe('TransactionBuilder', function() { timeoutTimestamp.toString() ); }); - it('works with TimeoutInfinite', function() { + it('works with TimeoutInfinite', function () { let source = new StellarBase.Account( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', '0' @@ -478,8 +478,8 @@ describe('TransactionBuilder', function() { }).to.not.throw(); }); }); - describe('.buildFeeBumpTransaction', function() { - it('builds a fee bump transaction', function(done) { + describe('.buildFeeBumpTransaction', function () { + it('builds a fee bump transaction', function (done) { const networkPassphrase = 'Standalone Network ; February 2017'; const innerSource = StellarBase.Keypair.master(networkPassphrase); const innerAccount = new StellarBase.Account( @@ -606,20 +606,22 @@ describe('TransactionBuilder', function() { operations: v1Tx.operations(), ext: new StellarBase.xdr.TransactionV0Ext(0) }); - const innerV0TxEnvelope = new StellarBase.xdr.TransactionEnvelope.envelopeTypeTxV0( - new StellarBase.xdr.TransactionV0Envelope({ - tx: v0Tx, - signatures: innerTxEnvelope.v1().signatures() - }) - ); + const innerV0TxEnvelope = + new StellarBase.xdr.TransactionEnvelope.envelopeTypeTxV0( + new StellarBase.xdr.TransactionV0Envelope({ + tx: v0Tx, + signatures: innerTxEnvelope.v1().signatures() + }) + ); expect(innerV0TxEnvelope.v0().signatures()).to.have.length(1); - const feeBumpV0Tx = StellarBase.TransactionBuilder.buildFeeBumpTransaction( - feeSource, - '200', - new StellarBase.Transaction(innerV0TxEnvelope, networkPassphrase), - networkPassphrase - ); + const feeBumpV0Tx = + StellarBase.TransactionBuilder.buildFeeBumpTransaction( + feeSource, + '200', + new StellarBase.Transaction(innerV0TxEnvelope, networkPassphrase), + networkPassphrase + ); expect(feeBumpTx.toXDR()).to.equal(feeBumpV0Tx.toXDR()); @@ -627,8 +629,8 @@ describe('TransactionBuilder', function() { }); }); - describe('.fromXDR', function() { - it('builds a fee bump transaction', function() { + describe('.fromXDR', function () { + it('builds a fee bump transaction', function () { const xdr = 'AAAABQAAAADgSJG2GOUMy/H9lHyjYZOwyuyytH8y0wWaoc596L+bEgAAAAAAAADIAAAAAgAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1gAAAGQAAAAAAAAACAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAA9IYXBweSBiaXJ0aGRheSEAAAAAAQAAAAAAAAABAAAAAOBIkbYY5QzL8f2UfKNhk7DK7LK0fzLTBZqhzn3ov5sSAAAAAAAAAASoF8gAAAAAAAAAAAERuUbWAAAAQK933Dnt1pxXlsf1B5CYn81PLxeYsx+MiV9EGbMdUfEcdDWUySyIkdzJefjpR5ejdXVp/KXosGmNUQ+DrIBlzg0AAAAAAAAAAei/mxIAAABAijIIQpL6KlFefiL4FP8UWQktWEz4wFgGNSaXe7mZdVMuiREntehi1b7MRqZ1h+W+Y0y+Z2HtMunsilT2yS5mAA=='; let tx = StellarBase.TransactionBuilder.fromXDR( @@ -645,7 +647,7 @@ describe('TransactionBuilder', function() { expect(tx).to.be.an.instanceof(StellarBase.FeeBumpTransaction); expect(tx.toXDR()).to.equal(xdr); }); - it('builds a transaction', function() { + it('builds a transaction', function () { const xdr = 'AAAAAAW8Dk9idFR5Le+xi0/h/tU47bgC1YWjtPH1vIVO3BklAAAAZACoKlYAAAABAAAAAAAAAAEAAAALdmlhIGtleWJhc2UAAAAAAQAAAAAAAAAIAAAAAN7aGcXNPO36J1I8MR8S4QFhO79T5JGG2ZeS5Ka1m4mJAAAAAAAAAAFO3BklAAAAQP0ccCoeHdm3S7bOhMjXRMn3EbmETJ9glxpKUZjPSPIxpqZ7EkyTgl3FruieqpZd9LYOzdJrNik1GNBLhgTh/AU='; let tx = StellarBase.TransactionBuilder.fromXDR( @@ -664,7 +666,7 @@ describe('TransactionBuilder', function() { }); }); - describe('muxed account support', function() { + describe('muxed account support', function () { // Simultaneously, let's test some of the operations that should support // muxed accounts. const asset = StellarBase.Asset.native(); @@ -684,7 +686,7 @@ describe('TransactionBuilder', function() { const networkPassphrase = 'Standalone Network ; February 2017'; const signer = StellarBase.Keypair.master(StellarBase.Networks.TESTNET); - it('works with muxed accounts by default', function() { + it('works with muxed accounts by default', function () { const operations = [ StellarBase.Operation.payment({ source: source.accountId(), @@ -751,7 +753,7 @@ describe('TransactionBuilder', function() { expect(clawbackOp.from).to.equal(destination); }); - it('does not regress js-stellar-sdk#646', function() { + it('does not regress js-stellar-sdk#646', function () { expect(() => { StellarBase.TransactionBuilder.fromXDR( 'AAAAAgAAAABg/GhKJU5ut52ih6Klx0ymGvsac1FPJig1CHYqyesIHQAAJxACBmMCAAAADgAAAAAAAAABAAAAATMAAAAAAAABAAAAAQAAAABg/GhKJU5ut52ih6Klx0ymGvsac1FPJig1CHYqyesIHQAAAAAAAAAAqdkSiA5dzNXstOtkPkHd6dAMPMA+MSXwK8OlrAGCKasAAAAAAcnDgAAAAAAAAAAByesIHQAAAEAuLrTfW6D+HYlUD9y+JolF1qrb40hIRATzsQaQjchKJuhOZJjLO0d7oaTD3JZ4UL4vVKtV7TvV17rQgCQnuz8F', @@ -760,7 +762,7 @@ describe('TransactionBuilder', function() { }).to.not.throw(); }); - it('works with fee-bump transactions', function() { + it('works with fee-bump transactions', function () { // We create a non-muxed transaction, then fee-bump with a muxed source. let builder = new StellarBase.TransactionBuilder(source.baseAccount(), { fee: '100', diff --git a/test/unit/transaction_envelope_test.js b/test/unit/transaction_envelope_test.js index e08736145..a81050395 100644 --- a/test/unit/transaction_envelope_test.js +++ b/test/unit/transaction_envelope_test.js @@ -1,5 +1,5 @@ -describe('TransactionEnvelope', function() { - it('can successfully decode an envelope', function(done) { +describe('TransactionEnvelope', function () { + it('can successfully decode an envelope', function (done) { // from https://github.com/stellar/js-stellar-sdk/issues/73 let xdr = 'AAAAAPQQv+uPYrlCDnjgPyPRgIjB6T8Zb8ANmL8YGAXC2IAgAAAAZAAIteYAAAAHAAAAAAAAAAAAAAABAAAAAAAAAAMAAAAAAAAAAUVVUgAAAAAAUtYuFczBLlsXyEp3q8BbTBpEGINWahqkFbnTPd93YUUAAAAXSHboAAAAABEAACcQAAAAAAAAAKIAAAAAAAAAAcLYgCAAAABAo2tU6n0Bb7bbbpaXacVeaTVbxNMBtnrrXVk2QAOje2Flllk/ORlmQdFU/9c8z43eWh1RNMpI3PscY+yDCnJPBQ=='; @@ -14,7 +14,7 @@ describe('TransactionEnvelope', function() { done(); }); - it('calculates correct hash with non-utf8 strings', function(done) { + it('calculates correct hash with non-utf8 strings', function (done) { // a84d534b3742ad89413bdbf259e02fa4c5d039123769e9bcc63616f723a2bcd5 let xdr = 'AAAAAAtjwtJadppTmm0NtAU99BFxXXfzPO1N/SqR43Z8aXqXAAAAZAAIj6YAAAACAAAAAAAAAAEAAAAB0QAAAAAAAAEAAAAAAAAAAQAAAADLa6390PDAqg3qDLpshQxS+uVw3ytSgKRirQcInPWt1QAAAAAAAAAAA1Z+AAAAAAAAAAABfGl6lwAAAEBC655+8Izq54MIZrXTVF/E1ycHgQWpVcBD+LFkuOjjJd995u/7wM8sFqQqambL0/ME2FTOtxMO65B9i3eAIu4P'; diff --git a/test/unit/transaction_test.js b/test/unit/transaction_test.js index b1dcbd5eb..7f3c628bc 100644 --- a/test/unit/transaction_test.js +++ b/test/unit/transaction_test.js @@ -1,8 +1,8 @@ import { UnsignedHyper } from 'js-xdr'; import randomBytes from 'randombytes'; -describe('Transaction', function() { - it('constructs Transaction object from a TransactionEnvelope', function(done) { +describe('Transaction', function () { + it('constructs Transaction object from a TransactionEnvelope', function (done) { let source = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '0' @@ -44,8 +44,8 @@ describe('Transaction', function() { done(); }); - describe('toEnvelope', function() { - beforeEach(function() { + describe('toEnvelope', function () { + beforeEach(function () { let source = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '0' @@ -67,14 +67,14 @@ describe('Transaction', function() { .build(); }); - it('does not return a reference to source signatures', function() { + it('does not return a reference to source signatures', function () { const transaction = this.transaction; const envelope = transaction.toEnvelope().value(); envelope.signatures().push({}); expect(transaction.signatures.length).to.equal(0); }); - it('does not return a reference to the source transaction', function() { + it('does not return a reference to the source transaction', function () { const transaction = this.transaction; const envelope = transaction.toEnvelope().value(); envelope.tx().fee(StellarBase.xdr.Int64.fromString('300')); @@ -143,7 +143,7 @@ describe('Transaction', function() { }).to.throw(/expected a string/); }); - it('throws when no fee is provided', function() { + it('throws when no fee is provided', function () { let source = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '0' @@ -165,7 +165,7 @@ describe('Transaction', function() { ).to.throw(/must specify fee/); }); - it('signs correctly', function() { + it('signs correctly', function () { let source = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '0' @@ -194,7 +194,7 @@ describe('Transaction', function() { expect(verified).to.equal(true); }); - it('signs using hash preimage', function() { + it('signs using hash preimage', function () { let source = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '0' @@ -226,7 +226,7 @@ describe('Transaction', function() { ); }); - it('returns error when signing using hash preimage that is too long', function() { + it('returns error when signing using hash preimage that is too long', function () { let source = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '0' @@ -253,7 +253,7 @@ describe('Transaction', function() { ); }); - it('adds signature correctly', function() { + it('adds signature correctly', function () { const sourceKey = 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'; // make two sources so they have the same seq number @@ -325,7 +325,7 @@ describe('Transaction', function() { expectBuffersToBeEqual(addedSignatureTx.hash(), signedTx.hash()); }); - it('adds signature generated by getKeypairSignature', function() { + it('adds signature generated by getKeypairSignature', function () { const sourceKey = 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'; // make two sources so they have the same seq number @@ -402,7 +402,7 @@ describe('Transaction', function() { expectBuffersToBeEqual(addedSignatureTx.hash(), signedTx.hash()); }); - it('does not add invalid signature', function() { + it('does not add invalid signature', function () { const sourceKey = 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'; // make two sources so they have the same seq number @@ -460,7 +460,7 @@ describe('Transaction', function() { expect(addSignature).to.throw('Invalid signature'); }); - it('accepts 0 as a valid transaction fee', function(done) { + it('accepts 0 as a valid transaction fee', function (done) { let source = new StellarBase.Account( 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB', '0' @@ -506,8 +506,8 @@ describe('Transaction', function() { expect(transaction.toXDR()).to.be.equal(xdrString); }); - describe('TransactionEnvelope with MuxedAccount', function() { - it('handles muxed accounts', function() { + describe('TransactionEnvelope with MuxedAccount', function () { + it('handles muxed accounts', function () { let baseFee = '100'; const networkPassphrase = 'Standalone Network ; February 2017'; const source = StellarBase.Keypair.master(networkPassphrase); @@ -537,10 +537,7 @@ describe('Transaction', function() { // force the source to be muxed in the envelope const muxedSource = new StellarBase.MuxedAccount(account, '0'); const envelope = tx.toEnvelope(); - envelope - .v1() - .tx() - .sourceAccount(muxedSource.toXDRObject()); + envelope.v1().tx().sourceAccount(muxedSource.toXDRObject()); // force the payment destination to be muxed in the envelope const destinationMuxed = new StellarBase.MuxedAccount( @@ -565,10 +562,10 @@ describe('Transaction', function() { }); }); - describe('knows how to calculate claimable balance IDs', function() { + describe('knows how to calculate claimable balance IDs', function () { const address = 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ'; - const makeBuilder = function(source) { + const makeBuilder = function (source) { return new StellarBase.TransactionBuilder(source, { fee: StellarBase.BASE_FEE, networkPassphrase: StellarBase.Networks.TESTNET, @@ -576,7 +573,7 @@ describe('Transaction', function() { }).setTimeout(StellarBase.TimeoutInfinite); }; - const makeClaimableBalance = function() { + const makeClaimableBalance = function () { return StellarBase.Operation.createClaimableBalance({ asset: StellarBase.Asset.native(), amount: '100', @@ -595,7 +592,7 @@ describe('Transaction', function() { amount: '100' }); - it('calculates from transaction src', function() { + it('calculates from transaction src', function () { let gSource = new StellarBase.Account(address, '1234'); let tx = makeBuilder(gSource) @@ -608,7 +605,7 @@ describe('Transaction', function() { }); // See https://github.com/stellar/js-stellar-base/issues/529 - it('calculates from transaction src (big number sequence)', function() { + it('calculates from transaction src (big number sequence)', function () { let gSource = new StellarBase.Account(address, '114272277834498050'); let tx = makeBuilder(gSource) @@ -620,7 +617,7 @@ describe('Transaction', function() { ); }); - it('calculates from muxed transaction src as if unmuxed', function() { + it('calculates from muxed transaction src as if unmuxed', function () { let gSource = new StellarBase.Account(address, '1234'); let mSource = new StellarBase.MuxedAccount(gSource, '5678'); let tx = makeBuilder(mSource) @@ -633,7 +630,7 @@ describe('Transaction', function() { ); }); - it('throws on invalid operations', function() { + it('throws on invalid operations', function () { let gSource = new StellarBase.Account(address, '1234'); let tx = makeBuilder(gSource) .addOperation(paymentOp) @@ -649,11 +646,11 @@ describe('Transaction', function() { }); }); - describe('preconditions', function() { + describe('preconditions', function () { const address = 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ'; const source = new StellarBase.Account(address, '1234'); - const makeBuilder = function() { + const makeBuilder = function () { return new StellarBase.TransactionBuilder(source, { fee: StellarBase.BASE_FEE, networkPassphrase: StellarBase.Networks.TESTNET, @@ -661,151 +658,89 @@ describe('Transaction', function() { }); }; - describe('timebounds', function() { - it('Date', function() { + describe('timebounds', function () { + it('Date', function () { let now = new Date(); - let tx = makeBuilder() - .setTimebounds(now, now) - .build(); + let tx = makeBuilder().setTimebounds(now, now).build(); const expMin = `${Math.floor(now.valueOf() / 1000)}`; const expMax = `${Math.floor(now.valueOf() / 1000)}`; expect(tx.timeBounds.minTime).to.equal(expMin); expect(tx.timeBounds.maxTime).to.equal(expMax); - const tb = tx - .toEnvelope() - .v1() - .tx() - .cond() - .timeBounds(); + const tb = tx.toEnvelope().v1().tx().cond().timeBounds(); expect(tb.minTime().toString()).to.equal(expMin); expect(tb.maxTime().toString()).to.equal(expMax); }); - it('number', function() { - let tx = makeBuilder() - .setTimebounds(5, 10) - .build(); + it('number', function () { + let tx = makeBuilder().setTimebounds(5, 10).build(); expect(tx.timeBounds.minTime).to.eql('5'); expect(tx.timeBounds.maxTime).to.eql('10'); - const tb = tx - .toEnvelope() - .v1() - .tx() - .cond() - .timeBounds(); + const tb = tx.toEnvelope().v1().tx().cond().timeBounds(); expect(tb.minTime().toString()).to.equal('5'); expect(tb.maxTime().toString()).to.equal('10'); }); }); - it('ledgerbounds', function() { - let tx = makeBuilder() - .setTimeout(5) - .setLedgerbounds(5, 10) - .build(); + it('ledgerbounds', function () { + let tx = makeBuilder().setTimeout(5).setLedgerbounds(5, 10).build(); expect(tx.ledgerBounds.minLedger).to.equal(5); expect(tx.ledgerBounds.maxLedger).to.equal(10); - const lb = tx - .toEnvelope() - .v1() - .tx() - .cond() - .v2() - .ledgerBounds(); + const lb = tx.toEnvelope().v1().tx().cond().v2().ledgerBounds(); expect(lb.minLedger()).to.equal(5); expect(lb.maxLedger()).to.equal(10); }); - it('minAccountSequence', function() { - let tx = makeBuilder() - .setTimeout(5) - .setMinAccountSequence('5') - .build(); + it('minAccountSequence', function () { + let tx = makeBuilder().setTimeout(5).setMinAccountSequence('5').build(); expect(tx.minAccountSequence).to.eql('5'); - const val = tx - .toEnvelope() - .v1() - .tx() - .cond() - .v2() - .minSeqNum(); + const val = tx.toEnvelope().v1().tx().cond().v2().minSeqNum(); expect(val.toString()).to.equal('5'); }); - it('minAccountSequence (big number)', function() { + it('minAccountSequence (big number)', function () { let tx = makeBuilder() .setTimeout(5) .setMinAccountSequence('103420918407103888') .build(); expect(tx.minAccountSequence).to.eql('103420918407103888'); - const val = tx - .toEnvelope() - .v1() - .tx() - .cond() - .v2() - .minSeqNum(); + const val = tx.toEnvelope().v1().tx().cond().v2().minSeqNum(); expect(val.toString()).to.equal('103420918407103888'); }); - it('minAccountSequenceAge', function() { - let tx = makeBuilder() - .setTimeout(5) - .setMinAccountSequenceAge(5) - .build(); + it('minAccountSequenceAge', function () { + let tx = makeBuilder().setTimeout(5).setMinAccountSequenceAge(5).build(); expect(tx.minAccountSequenceAge.toString()).to.equal('5'); - const val = tx - .toEnvelope() - .v1() - .tx() - .cond() - .v2() - .minSeqAge(); + const val = tx.toEnvelope().v1().tx().cond().v2().minSeqAge(); expect(val.toString()).to.equal('5'); }); - it('minAccountSequenceLedgerGap', function() { + it('minAccountSequenceLedgerGap', function () { let tx = makeBuilder() .setTimeout(5) .setMinAccountSequenceLedgerGap(5) .build(); expect(tx.minAccountSequenceLedgerGap).to.equal(5); - const val = tx - .toEnvelope() - .v1() - .tx() - .cond() - .v2() - .minSeqLedgerGap(); + const val = tx.toEnvelope().v1().tx().cond().v2().minSeqLedgerGap(); expect(val.toString()).to.equal('5'); }); - it('extraSigners', function() { - let tx = makeBuilder() - .setTimeout(5) - .setExtraSigners([address]) - .build(); + it('extraSigners', function () { + let tx = makeBuilder().setTimeout(5).setExtraSigners([address]).build(); expect(tx.extraSigners).to.have.lengthOf(1); - expect( - tx.extraSigners.map(StellarBase.SignerKey.encodeSignerKey) - ).to.eql([address]); + expect(tx.extraSigners.map(StellarBase.SignerKey.encodeSignerKey)).to.eql( + [address] + ); - const signers = tx - .toEnvelope() - .v1() - .tx() - .cond() - .v2() - .extraSigners(); + const signers = tx.toEnvelope().v1().tx().cond().v2().extraSigners(); expect(signers).to.have.lengthOf(1); expect(signers[0]).to.eql(StellarBase.SignerKey.decodeAddress(address)); }); diff --git a/test/unit/util/continued_fraction_test.js b/test/unit/util/continued_fraction_test.js index 5786e357c..e6b964ee5 100644 --- a/test/unit/util/continued_fraction_test.js +++ b/test/unit/util/continued_fraction_test.js @@ -1,8 +1,8 @@ import { best_r } from '../../../src/util/continued_fraction.js'; import BigNumber from 'bignumber.js'; -describe('best_r', function() { - it('correctly calculates the best rational approximation', function() { +describe('best_r', function () { + it('correctly calculates the best rational approximation', function () { var tests = [ ['1,10', '0.1'], ['1,100', '0.01'], @@ -31,7 +31,7 @@ describe('best_r', function() { } }); - it('throws an error when best rational approximation cannot be found', function() { + it('throws an error when best rational approximation cannot be found', function () { expect(() => best_r('0.0000000003')).to.throw( /Couldn't find approximation/ ); From b6583c2f591076562a93a93cabb723ac6ac61312 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 12:18:08 -0700 Subject: [PATCH 13/25] Dropping unneeded rule till I learn why it was there --- cfg/webpack.config.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cfg/webpack.config.js b/cfg/webpack.config.js index b221a0fd5..634d46634 100644 --- a/cfg/webpack.config.js +++ b/cfg/webpack.config.js @@ -30,11 +30,6 @@ const config = { test: /\.js$/, exclude: /node_modules/, use: ['babel-loader'] - }, - { - test: /\.js$/, - exclude: /node_modules\/(?!(crc)\/).*/, - loader: 'babel-loader' } ] }, From 15fcb6d75af43b0e6659dcbb77dde1b36936282d Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 12:22:40 -0700 Subject: [PATCH 14/25] Add prod-specific build script --- .github/workflows/gh_pages.yml | 4 ++-- .github/workflows/npm_publish.yml | 2 +- .github/workflows/tests.yml | 2 +- cfg/webpack.config.js | 1 + package.json | 3 ++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index 53f7aa2c2..8ac645302 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -20,8 +20,8 @@ jobs: - name: Install Dependencies run: yarn install - - name: Build - run: yarn run version + - name: Build & Test + run: yarn preversion - name: Checkout GH pages uses: actions/checkout@v2 diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index d0b6f5489..7f9ba21ca 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -17,7 +17,7 @@ jobs: registry-url: 'https://registry.npmjs.org' - name: Install Depencencies - run: yarn + run: yarn install - name: Test & Build run: yarn preversion diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 600b3ac6a..77533aaba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: run: yarn install - name: Build - run: yarn build + run: yarn build:prod - name: Run Node Tests run: yarn test:node diff --git a/cfg/webpack.config.js b/cfg/webpack.config.js index 634d46634..5632c99db 100644 --- a/cfg/webpack.config.js +++ b/cfg/webpack.config.js @@ -6,6 +6,7 @@ var TerserPlugin = require('terser-webpack-plugin'); var NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const config = { + // https://stackoverflow.com/a/34018909 entry: { 'stellar-base': path.resolve(__dirname, '../src/index.js'), 'stellar-base.min': path.resolve(__dirname, '../src/index.js') diff --git a/package.json b/package.json index 64da959dc..313d1ce67 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,14 @@ "types": "./types/index.d.ts", "scripts": { "build": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.js", + "build:prod": "cross-env NODE_ENV=production webpack -c ./cfg/webpack.config.js", "test": "yarn build && yarn test:node", "test:node": "nyc --nycrc-path ./cfg/.nycrc mocha --recursive", "test:browser": "karma start ./cfg/karma.conf.js", "test:all": "yarn test:node && yarn test:browser && yarn tslint", "docs": "jsdoc -c ./cfg/.jsdoc.json --verbose", "tslint": "dtslint --localTs node_modules/typescript/lib types/", - "preversion": "yarn clean && yarn pretty && yarn cross-env NODE_ENV=production webpack -c ./cfg/webpack.config.js && yarn test:all", + "preversion": "yarn clean && yarn pretty && yarn build:prod && yarn test:all", "pretty": "prettier --config ./cfg/prettier.config.js --ignore-path ./cfg/.prettierignore --write './**/*.js'", "clean": "rm -rf dist/ coverage/ .nyc_output/" }, From 2b0108e279497d7ca442baae070f7e6d842b2ede Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 12:28:23 -0700 Subject: [PATCH 15/25] Undo version bump: there may be more PRs later --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 313d1ce67..94a510ade 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stellar-base", - "version": "9.0.0", + "version": "8.2.2", "description": "Low-level support library for the Stellar network.", "main": "./src/index.js", "types": "./types/index.d.ts", From 7a4d6dfe8f13e3732d37c6669f487f12c7bf7866 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 14:16:29 -0700 Subject: [PATCH 16/25] Generate the node package via Babel not Webpack --- .gitignore | 2 +- cfg/.jshintrc | 4 -- cfg/.prettierignore | 7 --- {cfg => config}/.eslintrc.js | 6 +-- {cfg => config}/.jsdoc.json | 0 {cfg => config}/.nycrc | 0 config/.prettierignore | 7 +++ {cfg => config}/karma.conf.js | 2 +- {cfg => config}/prettier.config.js | 0 .../webpack.config.browser.js | 13 +++-- package.json | 31 +++++++----- src/browser.js | 2 - src/generated/curr_generated.js | 3 -- src/generated/next_generated.js | 3 -- src/index.js | 1 + test/.eslintrc.js | 5 +- yarn.lock | 47 +++++-------------- 17 files changed, 56 insertions(+), 77 deletions(-) delete mode 100644 cfg/.jshintrc delete mode 100644 cfg/.prettierignore rename {cfg => config}/.eslintrc.js (91%) rename {cfg => config}/.jsdoc.json (100%) rename {cfg => config}/.nycrc (100%) create mode 100644 config/.prettierignore rename {cfg => config}/karma.conf.js (92%) rename {cfg => config}/prettier.config.js (100%) rename cfg/webpack.config.js => config/webpack.config.browser.js (86%) delete mode 100644 src/browser.js diff --git a/.gitignore b/.gitignore index 4cfd5da72..77530b753 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ /tmp/ /lib/ /dist/ -/cfg/dist/ +/config/dist/ /coverage/ /jsdoc/ .DS_Store diff --git a/cfg/.jshintrc b/cfg/.jshintrc deleted file mode 100644 index 9973736db..000000000 --- a/cfg/.jshintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "esnext": true, - "node": true -} \ No newline at end of file diff --git a/cfg/.prettierignore b/cfg/.prettierignore deleted file mode 100644 index 7d33ec83a..000000000 --- a/cfg/.prettierignore +++ /dev/null @@ -1,7 +0,0 @@ -/package.json -/node_modules -/lib -/dist -/src/generated -/src/vendor -/docs diff --git a/cfg/.eslintrc.js b/config/.eslintrc.js similarity index 91% rename from cfg/.eslintrc.js rename to config/.eslintrc.js index 740139d9c..c9bd0afc5 100644 --- a/cfg/.eslintrc.js +++ b/config/.eslintrc.js @@ -3,7 +3,8 @@ module.exports = { es6: true }, extends: ['airbnb-base', 'prettier'], - plugins: ['prettier', 'prefer-import'], + plugins: ['@babel', 'prettier', 'prefer-import'], + parser: '@babel/eslint-parser', rules: { // OFF 'import/prefer-default-export': 0, @@ -37,6 +38,5 @@ module.exports = { // ERROR 'no-unused-expressions': [2, { allowTaggedTemplates: true }] - }, - parser: '@babel/eslint-parser' + } }; diff --git a/cfg/.jsdoc.json b/config/.jsdoc.json similarity index 100% rename from cfg/.jsdoc.json rename to config/.jsdoc.json diff --git a/cfg/.nycrc b/config/.nycrc similarity index 100% rename from cfg/.nycrc rename to config/.nycrc diff --git a/config/.prettierignore b/config/.prettierignore new file mode 100644 index 000000000..a03a5f550 --- /dev/null +++ b/config/.prettierignore @@ -0,0 +1,7 @@ +../package.json +../node_modules +../lib +../dist +../src/generated +../src/vendor +../docs diff --git a/cfg/karma.conf.js b/config/karma.conf.js similarity index 92% rename from cfg/karma.conf.js rename to config/karma.conf.js index 55ff0bd12..7e2c4d1b0 100644 --- a/cfg/karma.conf.js +++ b/config/karma.conf.js @@ -1,4 +1,4 @@ -var webpackConfig = require('./webpack.config.js'); +var webpackConfig = require('./webpack.config.browser.js'); delete webpackConfig.output; webpackConfig.entry = {}; // karma fills these in webpackConfig.plugins.shift(); // drop eslinter plugin diff --git a/cfg/prettier.config.js b/config/prettier.config.js similarity index 100% rename from cfg/prettier.config.js rename to config/prettier.config.js diff --git a/cfg/webpack.config.js b/config/webpack.config.browser.js similarity index 86% rename from cfg/webpack.config.js rename to config/webpack.config.browser.js index 5632c99db..464823e1e 100644 --- a/cfg/webpack.config.js +++ b/config/webpack.config.browser.js @@ -6,6 +6,7 @@ var TerserPlugin = require('terser-webpack-plugin'); var NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const config = { + target: 'web', // https://stackoverflow.com/a/34018909 entry: { 'stellar-base': path.resolve(__dirname, '../src/index.js'), @@ -21,16 +22,22 @@ const config = { output: { clean: true, library: 'StellarBase', + compareBeforeEmit: true, path: path.resolve(__dirname, '../dist') }, - mode: process.env.NODE_ENV, + mode: process.env.NODE_ENV ?? 'development', devtool: process.env.NODE_ENV === 'production' ? false : 'inline-source-map', module: { rules: [ { - test: /\.js$/, + test: /\.m?js$/, exclude: /node_modules/, - use: ['babel-loader'] + use: { + loader: 'babel-loader', + options: { + cacheDirectory: true + } + } } ] }, diff --git a/package.json b/package.json index 94a510ade..d1ff7c600 100644 --- a/package.json +++ b/package.json @@ -2,20 +2,25 @@ "name": "stellar-base", "version": "8.2.2", "description": "Low-level support library for the Stellar network.", - "main": "./src/index.js", + "main": "./lib/index.js", "types": "./types/index.d.ts", "scripts": { - "build": "cross-env NODE_ENV=development webpack -c ./cfg/webpack.config.js", - "build:prod": "cross-env NODE_ENV=production webpack -c ./cfg/webpack.config.js", + "build": "yarn build:node", + "build:node": "babel --out-dir lib/ src/", + "build:browser": "webpack -c ./config/webpack.config.browser.js", + "build:prod": "cross-env NODE_ENV=production yarn build", + "build:browser:prod": "cross-env NODE_ENV=production yarn build:browser", + "build:all": "yarn build:node && yarn build:browser", + "build:all:prod": "yarn build:prod && yarn build:browser:prod", "test": "yarn build && yarn test:node", - "test:node": "nyc --nycrc-path ./cfg/.nycrc mocha --recursive", - "test:browser": "karma start ./cfg/karma.conf.js", - "test:all": "yarn test:node && yarn test:browser && yarn tslint", - "docs": "jsdoc -c ./cfg/.jsdoc.json --verbose", + "test:node": "nyc --nycrc-path ./config/.nycrc mocha --recursive", + "test:browser": "karma start ./config/karma.conf.js", + "test:all": "yarn test && yarn test:browser && yarn tslint", + "docs": "jsdoc -c ./config/.jsdoc.json --verbose", "tslint": "dtslint --localTs node_modules/typescript/lib types/", - "preversion": "yarn clean && yarn pretty && yarn build:prod && yarn test:all", - "pretty": "prettier --config ./cfg/prettier.config.js --ignore-path ./cfg/.prettierignore --write './**/*.js'", - "clean": "rm -rf dist/ coverage/ .nyc_output/" + "preversion": "yarn clean && yarn pretty && yarn build:all && yarn test:all", + "pretty": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'", + "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/" }, "mocha": { "require": [ @@ -41,7 +46,7 @@ }, "lint-staged": { "**/*.{js,json}": [ - "prettier --config ./cfg/prettier.config.js --ignore-path ./cfg/.prettierignore --write" + "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write" ] }, "browser": { @@ -64,8 +69,8 @@ "@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/preset-typescript": "^7.21.4", "@babel/register": "^7.21.0", "@definitelytyped/dtslint": "^0.0.159", "@istanbuljs/nyc-config-babel": "3.0.0", @@ -88,6 +93,7 @@ "jsdoc": "^4.0.2", "karma": "^6.4.1", "karma-chrome-launcher": "^3.1.0", + "karma-coverage": "^2.2.0", "karma-firefox-launcher": "^2.1.1", "karma-mocha": "^2.0.0", "karma-sinon-chai": "^2.0.2", @@ -114,7 +120,6 @@ "crypto-browserify": "^3.12.0", "ghooks": "^2.0.4", "js-xdr": "^1.1.3", - "karma-coverage": "^2.2.0", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3", diff --git a/src/browser.js b/src/browser.js deleted file mode 100644 index 13b47fb7d..000000000 --- a/src/browser.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line prefer-import/prefer-import-over-require -module.exports = require('./index'); diff --git a/src/generated/curr_generated.js b/src/generated/curr_generated.js index 9d1a67970..c76dd1676 100644 --- a/src/generated/curr_generated.js +++ b/src/generated/curr_generated.js @@ -1,9 +1,6 @@ // Automatically generated by xdrgen // DO NOT EDIT or your changes may be overwritten -/* jshint maxstatements:2147483647 */ -/* jshint esnext:true */ - import * as XDR from 'js-xdr'; var types = XDR.config((xdr) => { diff --git a/src/generated/next_generated.js b/src/generated/next_generated.js index 249dae10b..e5fffb660 100644 --- a/src/generated/next_generated.js +++ b/src/generated/next_generated.js @@ -1,9 +1,6 @@ // Automatically generated by xdrgen // DO NOT EDIT or your changes may be overwritten -/* jshint maxstatements:2147483647 */ -/* jshint esnext:true */ - import * as XDR from 'js-xdr'; var types = XDR.config((xdr) => { diff --git a/src/index.js b/src/index.js index a13c405c1..e6197c9fb 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +/* eslint-disable import/no-import-module-exports */ import xdr from './xdr'; export { xdr }; diff --git a/test/.eslintrc.js b/test/.eslintrc.js index 3683919c5..52cff7394 100644 --- a/test/.eslintrc.js +++ b/test/.eslintrc.js @@ -2,6 +2,8 @@ module.exports = { env: { mocha: true }, + parser: '@babel/eslint-parser', + plugins: ['@babel', 'prettier', 'prefer-import'], globals: { StellarBase: true, chai: true, @@ -10,6 +12,5 @@ module.exports = { }, rules: { 'no-unused-vars': 0 - }, - parser: '@babel/eslint-parser' + } }; diff --git a/yarn.lock b/yarn.lock index dd3209572..c55f12e76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -68,6 +68,13 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" +"@babel/eslint-plugin@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/eslint-plugin/-/eslint-plugin-7.19.1.tgz#8bfde4b6e4380ea038e7947a765fe536c3057a4c" + integrity sha512-ElGPkQPapKMa3zVqXHkZYzuL7I5LbRw9UWBUArgWsdWDDb9XcACqOpBib5tRPA9XvbVZYrFUkoQPbiJ4BFvu4w== + dependencies: + eslint-rule-composer "^0.3.0" + "@babel/generator@^7.21.4": version "7.21.4" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" @@ -490,13 +497,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz#f264ed7bf40ffc9ec239edabc17a50c4f5b6fea2" - integrity sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -553,13 +553,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.20.0": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz#2751948e9b7c6d771a8efa59340c15d4a2891ff8" - integrity sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-transform-arrow-functions@^7.20.7": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" @@ -796,16 +789,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-typescript@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.21.3.tgz#316c5be579856ea890a57ebc5116c5d064658f2b" - integrity sha512-RQxPz6Iqt8T0uw/WsJNReuBpWpBqs/n7mNo18sKLoTbMp+UrEekhH+pKSVC7gWz+DNjo9gryfV8YzCiT45RgMw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.21.0" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-typescript" "^7.20.0" - "@babel/plugin-transform-unicode-escapes@^7.18.10": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" @@ -913,17 +896,6 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-typescript@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.21.4.tgz#b913ac8e6aa8932e47c21b01b4368d8aa239a529" - integrity sha512-sMLNWY37TCdRH/bJ6ZeeOH1nPuanED7Ai9Y/vH31IPqalioJ6ZNFUWONsakhv4r4n+I6gm5lmoE0olkgib/j/A== - dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-option" "^7.21.0" - "@babel/plugin-syntax-jsx" "^7.21.4" - "@babel/plugin-transform-modules-commonjs" "^7.21.2" - "@babel/plugin-transform-typescript" "^7.21.3" - "@babel/register@^7.21.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.21.0.tgz#c97bf56c2472e063774f31d344c592ebdcefa132" @@ -3158,6 +3130,11 @@ eslint-plugin-prettier@^4.2.1: dependencies: prettier-linter-helpers "^1.0.0" +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" + integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== + eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" From 15f13d34c8d58920d67a7a733d71bfd287bd8c36 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 14:54:26 -0700 Subject: [PATCH 17/25] Add build scripts for proper CI --- .github/workflows/tests.yml | 10 +++++----- Makefile | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 77533aaba..25b1156d8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,9 +11,9 @@ jobs: strategy: fail-fast: false - max-parallel: 2 + max-parallel: 4 matrix: - node-version: [14, 16] + node-version: [14, 16, 18] steps: - uses: actions/checkout@v2 @@ -26,14 +26,14 @@ jobs: - name: Install Dependencies run: yarn install - - name: Build - run: yarn build:prod + - name: Build Node + run: yarn build && yarn build:prod - name: Run Node Tests run: yarn test:node - name: Run Browser Tests - run: yarn test:browser + run: yarn build:browser:prod && yarn test:browser - name: Run Linter run: yarn tslint diff --git a/Makefile b/Makefile index 9acd407ca..da7dda119 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -XDR_BASE_URL_CURR=https://github.com/stellar/stellar-core/raw/master/src/protocol-curr/xdr +XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/curr XDR_BASE_LOCAL_CURR=xdr/curr XDR_FILES_CURR= \ Stellar-SCP.x \ @@ -9,7 +9,7 @@ XDR_FILES_CURR= \ Stellar-types.x XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR)) -XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr-next/raw/main +XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/next XDR_BASE_LOCAL_NEXT=xdr/next XDR_FILES_NEXT= \ Stellar-SCP.x \ diff --git a/package.json b/package.json index d1ff7c600..471b83eb4 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "test:all": "yarn test && yarn test:browser && yarn tslint", "docs": "jsdoc -c ./config/.jsdoc.json --verbose", "tslint": "dtslint --localTs node_modules/typescript/lib types/", - "preversion": "yarn clean && yarn pretty && yarn build:all && yarn test:all", + "preversion": "yarn clean && yarn pretty && yarn build:all:prod && yarn test:all", "pretty": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'", "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/" }, From 738ccb86e9c87f7cf04a7b10c88bbec8a968d38c Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 16:26:21 -0700 Subject: [PATCH 18/25] Shuffle around dependencies --- .github/workflows/tests.yml | 2 +- config/karma.conf.js | 3 ++- config/webpack.config.browser.js | 5 +++-- package.json | 8 ++++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 25b1156d8..fe2cfcd70 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false - max-parallel: 4 + max-parallel: 2 matrix: node-version: [14, 16, 18] diff --git a/config/karma.conf.js b/config/karma.conf.js index 7e2c4d1b0..617c8177c 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -1,4 +1,5 @@ -var webpackConfig = require('./webpack.config.browser.js'); +const webpackConfig = require('./webpack.config.browser.js'); + delete webpackConfig.output; webpackConfig.entry = {}; // karma fills these in webpackConfig.plugins.shift(); // drop eslinter plugin diff --git a/config/webpack.config.browser.js b/config/webpack.config.browser.js index 464823e1e..5fd1585cb 100644 --- a/config/webpack.config.browser.js +++ b/config/webpack.config.browser.js @@ -17,7 +17,8 @@ const config = { crypto: require.resolve('crypto-browserify'), stream: require.resolve('stream-browserify'), buffer: require.resolve('buffer') - } + }, + extensions: ['.ts', '.js'] }, output: { clean: true, @@ -67,7 +68,7 @@ const config = { }) ], watchOptions: { - ignored: /(node_modules|coverage)/ + ignored: /(node_modules|coverage|lib|dist)/ } }; diff --git a/package.json b/package.json index 471b83eb4..f86031214 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "stellar-base", "version": "8.2.2", "description": "Low-level support library for the Stellar network.", - "main": "./lib/index.js", + "main": "./src/index.js", "types": "./types/index.d.ts", "scripts": { "build": "yarn build:node", @@ -111,6 +111,8 @@ "terser-webpack-plugin": "^5.3.7", "ts-node": "^10.9.1", "webpack": "^5.77.0", + "ghooks": "^2.0.4", + "typescript": "^5.0.3", "webpack-cli": "^5.0.1" }, "dependencies": { @@ -118,12 +120,10 @@ "bignumber.js": "^9.1.1", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "ghooks": "^2.0.4", "js-xdr": "^1.1.3", "lodash": "^4.17.21", "sha.js": "^2.3.6", - "tweetnacl": "^1.0.3", - "typescript": "^5.0.3" + "tweetnacl": "^1.0.3" }, "optionalDependencies": { "sodium-native": "^3.3.0" From 0860f74cb0c0256a85218403c672b4db643e6cd6 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 4 Apr 2023 16:33:14 -0700 Subject: [PATCH 19/25] Temporarily add lib folder Add 'prepare' script instead of lib/ folder --- .gitignore | 1 - package.json | 3 ++- src/{index.js => index.mjs} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{index.js => index.mjs} (100%) diff --git a/.gitignore b/.gitignore index 77530b753..77e8f70b7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ .nyc_output/ /node_modules/ /tmp/ -/lib/ /dist/ /config/dist/ /coverage/ diff --git a/package.json b/package.json index f86031214..bf464cc4f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "stellar-base", "version": "8.2.2", "description": "Low-level support library for the Stellar network.", - "main": "./src/index.js", + "main": "./lib/index.js", "types": "./types/index.d.ts", "scripts": { "build": "yarn build:node", @@ -20,6 +20,7 @@ "tslint": "dtslint --localTs node_modules/typescript/lib types/", "preversion": "yarn clean && yarn pretty && yarn build:all:prod && yarn test:all", "pretty": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'", + "prepare": "yarn build:all:prod", "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/" }, "mocha": { diff --git a/src/index.js b/src/index.mjs similarity index 100% rename from src/index.js rename to src/index.mjs From 0aa2cddb04b70d8d69495f28b8c826b27dee73fd Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 6 Apr 2023 10:20:20 -0700 Subject: [PATCH 20/25] Set BigNumber debugging globally --- src/account.js | 3 --- src/{index.mjs => index.js} | 3 +++ src/util/continued_fraction.js | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) rename src/{index.mjs => index.js} (92%) diff --git a/src/account.js b/src/account.js index fcf759860..5e20d27fe 100644 --- a/src/account.js +++ b/src/account.js @@ -35,9 +35,6 @@ export class Account { this._accountId = accountId; this.sequence = new BigNumber(sequence); - if (this.sequence.isNaN()) { - throw new Error(`sequence number '${sequence}' is not valid`); - } } /** diff --git a/src/index.mjs b/src/index.js similarity index 92% rename from src/index.mjs rename to src/index.js index e6197c9fb..78a147446 100644 --- a/src/index.mjs +++ b/src/index.js @@ -1,6 +1,9 @@ /* eslint-disable import/no-import-module-exports */ +import BigNumber from 'bignumber.js'; import xdr from './xdr'; +BigNumber.DEBUG = true; // gives us exceptions on bad constructor values + export { xdr }; export { hash } from './hashing'; export { sign, verify, FastSigning } from './signing'; diff --git a/src/util/continued_fraction.js b/src/util/continued_fraction.js index b3877cb42..51255f82e 100644 --- a/src/util/continued_fraction.js +++ b/src/util/continued_fraction.js @@ -11,8 +11,6 @@ const MAX_INT = ((1 << 31) >>> 0) - 1; * @returns {array} first element is n (numerator), second element is d (denominator) */ export function best_r(rawNumber) { - BigNumber.DEBUG = true; // throws on bad number values - let number = new BigNumber(rawNumber); let a; let f; From 3f894e2c1e51db6cd9fe879fcf559352a70562df Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 6 Apr 2023 14:56:12 -0700 Subject: [PATCH 21/25] Clean up yarn scripts to make more sense Fix GHAs to match build scripts --- .github/workflows/npm_publish.yml | 2 +- .github/workflows/tests.yml | 6 +++--- package.json | 19 +++++++++---------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 7f9ba21ca..d0b6f5489 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -17,7 +17,7 @@ jobs: registry-url: 'https://registry.npmjs.org' - name: Install Depencencies - run: yarn install + run: yarn - name: Test & Build run: yarn preversion diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fe2cfcd70..31f4bc699 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,8 +26,8 @@ jobs: - name: Install Dependencies run: yarn install - - name: Build Node - run: yarn build && yarn build:prod + - name: Build All + run: yarn build:prod - name: Run Node Tests run: yarn test:node @@ -36,4 +36,4 @@ jobs: run: yarn build:browser:prod && yarn test:browser - name: Run Linter - run: yarn tslint + run: yarn lint diff --git a/package.json b/package.json index bf464cc4f..a5f29085c 100644 --- a/package.json +++ b/package.json @@ -5,22 +5,20 @@ "main": "./lib/index.js", "types": "./types/index.d.ts", "scripts": { - "build": "yarn build:node", - "build:node": "babel --out-dir lib/ src/", + "build": "yarn build:node && yarn build:browser", + "build:node": "babel --out-dir ./lib/ ./src/", "build:browser": "webpack -c ./config/webpack.config.browser.js", - "build:prod": "cross-env NODE_ENV=production yarn build", + "build:node:prod": "cross-env NODE_ENV=production yarn build", "build:browser:prod": "cross-env NODE_ENV=production yarn build:browser", - "build:all": "yarn build:node && yarn build:browser", - "build:all:prod": "yarn build:prod && yarn build:browser:prod", - "test": "yarn build && yarn test:node", + "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 --recursive", "test:browser": "karma start ./config/karma.conf.js", - "test:all": "yarn test && yarn test:browser && yarn tslint", "docs": "jsdoc -c ./config/.jsdoc.json --verbose", - "tslint": "dtslint --localTs node_modules/typescript/lib types/", - "preversion": "yarn clean && yarn pretty && yarn build:all:prod && yarn test:all", + "lint": "eslint -c ./config/.eslintrc.js src/ && dtslint --localTs node_modules/typescript/lib types/", + "preversion": "yarn clean && yarn pretty && yarn lint && yarn build:prod && yarn test", "pretty": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'", - "prepare": "yarn build:all:prod", + "prepare": "yarn build:prod", "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/" }, "mocha": { @@ -38,6 +36,7 @@ }, "files": [ "/dist/*.js", + "/lib/**/*.js", "/types/*.d.ts" ], "husky": { From 7abe5259f1cfe865ec1fa6a5e2e7bc0b1a78fc9c Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 10 Apr 2023 14:26:51 -0700 Subject: [PATCH 22/25] Undo XDR changes as they should be irrelevant --- src/generated/curr_generated.js | 14089 ++++++++++++------------- src/generated/next_generated.js | 16619 +++++++++++++++--------------- 2 files changed, 15429 insertions(+), 15279 deletions(-) diff --git a/src/generated/curr_generated.js b/src/generated/curr_generated.js index c76dd1676..26852ebb8 100644 --- a/src/generated/curr_generated.js +++ b/src/generated/curr_generated.js @@ -1,7017 +1,7086 @@ // Automatically generated by xdrgen // DO NOT EDIT or your changes may be overwritten +/* 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 ============================================================ - // - // struct Auth - // { - // // Empty message, just to confirm - // // establishment of MAC keys. - // int unused; - // }; - // - // =========================================================================== - xdr.struct('Auth', [['unused', 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 - // }; - // - // =========================================================================== - 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 - }); - - // === 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 ============================================================ - // - // 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; - // }; - // - // =========================================================================== - 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'] - ], - 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') - } - }); - - // === 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)]]); + +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 ============================================================ +// +// struct Auth +// { +// // Empty message, just to confirm +// // establishment of MAC keys. +// int unused; +// }; +// +// =========================================================================== +xdr.struct("Auth", [ + ["unused", 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 +// }; +// +// =========================================================================== +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, +}); + +// === 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 ============================================================ +// +// 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; +// }; +// +// =========================================================================== +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"], + ], + 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"), + }, +}); + +// === 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)], +]); + }); export default types; diff --git a/src/generated/next_generated.js b/src/generated/next_generated.js index e5fffb660..6f91b4a3d 100644 --- a/src/generated/next_generated.js +++ b/src/generated/next_generated.js @@ -1,8276 +1,8357 @@ // Automatically generated by xdrgen // DO NOT EDIT or your changes may be overwritten +/* 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, - // CONTRACT_DATA = 6, - // CONFIG_SETTING = 7 - // }; - // - // =========================================================================== - xdr.enum('LedgerEntryType', { - account: 0, - trustline: 1, - offer: 2, - data: 3, - claimableBalance: 4, - liquidityPool: 5, - contractData: 6, - configSetting: 7 - }); - - // === 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 ============================================================ - // - // enum ConfigSettingType - // { - // CONFIG_SETTING_TYPE_UINT32 = 0 - // }; - // - // =========================================================================== - xdr.enum('ConfigSettingType', { - configSettingTypeUint32: 0 - }); - - // === xdr source ============================================================ - // - // union ConfigSetting switch (ConfigSettingType type) - // { - // case CONFIG_SETTING_TYPE_UINT32: - // uint32 uint32Val; - // }; - // - // =========================================================================== - xdr.union('ConfigSetting', { - switchOn: xdr.lookup('ConfigSettingType'), - switchName: 'type', - switches: [['configSettingTypeUint32', 'uint32Val']], - arms: { - uint32Val: xdr.lookup('Uint32') - } - }); - - // === xdr source ============================================================ - // - // enum ConfigSettingID - // { - // CONFIG_SETTING_CONTRACT_MAX_SIZE = 0 - // }; - // - // =========================================================================== - xdr.enum('ConfigSettingId', { - configSettingContractMaxSize: 0 - }); - - // === xdr source ============================================================ - // - // union switch (int v) - // { - // case 0: - // void; - // } - // - // =========================================================================== - xdr.union('ConfigSettingEntryExt', { - switchOn: xdr.int(), - switchName: 'v', - switches: [[0, xdr.void()]], - arms: {} - }); - - // === xdr source ============================================================ - // - // struct ConfigSettingEntry - // { - // union switch (int v) - // { - // case 0: - // void; - // } - // ext; - // - // ConfigSettingID configSettingID; - // ConfigSetting setting; - // }; - // - // =========================================================================== - xdr.struct('ConfigSettingEntry', [ - ['ext', xdr.lookup('ConfigSettingEntryExt')], - ['configSettingId', xdr.lookup('ConfigSettingId')], - ['setting', xdr.lookup('ConfigSetting')] - ]); - - // === 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 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'], - ['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'), - 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 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 - // { - // 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 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'], - ['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'), - 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 - // }; - // - // =========================================================================== - xdr.enum('EnvelopeType', { - envelopeTypeTxV0: 0, - envelopeTypeScp: 1, - envelopeTypeTx: 2, - envelopeTypeAuth: 3, - envelopeTypeScpvalue: 4, - envelopeTypeTxFeeBump: 5, - envelopeTypeOpId: 6, - envelopeTypePoolRevokeOpId: 7, - envelopeTypeContractIdFromEd25519: 8, - envelopeTypeContractIdFromContract: 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 = 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 - // { - // ConfigSettingID id; // id to update - // ConfigSetting setting; // new value - // } - // - // =========================================================================== - xdr.struct('LedgerUpgradeConfigSetting', [ - ['id', xdr.lookup('ConfigSettingId')], - ['setting', xdr.lookup('ConfigSetting')] - ]); - - // === 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: - // struct - // { - // ConfigSettingID id; // id to update - // ConfigSetting setting; // new value - // } configSetting; - // }; - // - // =========================================================================== - xdr.union('LedgerUpgrade', { - switchOn: xdr.lookup('LedgerUpgradeType'), - switchName: 'type', - switches: [ - ['ledgerUpgradeVersion', 'newLedgerVersion'], - ['ledgerUpgradeBaseFee', 'newBaseFee'], - ['ledgerUpgradeMaxTxSetSize', 'newMaxTxSetSize'], - ['ledgerUpgradeBaseReserve', 'newBaseReserve'], - ['ledgerUpgradeFlags', 'newFlags'], - ['ledgerUpgradeConfig', 'configSetting'] - ], - arms: { - newLedgerVersion: xdr.lookup('Uint32'), - newBaseFee: xdr.lookup('Uint32'), - newMaxTxSetSize: xdr.lookup('Uint32'), - newBaseReserve: xdr.lookup('Uint32'), - newFlags: xdr.lookup('Uint32'), - configSetting: xdr.lookup('LedgerUpgradeConfigSetting') - } - }); - - // === 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 ============================================================ - // - // struct Auth - // { - // // Empty message, just to confirm - // // establishment of MAC keys. - // int unused; - // }; - // - // =========================================================================== - xdr.struct('Auth', [['unused', 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 - // }; - // - // =========================================================================== - 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 - }); - - // === 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 ============================================================ - // - // 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; - // }; - // - // =========================================================================== - 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'] - ], - 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') - } - }); - - // === 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 HostFunction - // { - // HOST_FN_CALL = 0, - // HOST_FN_CREATE_CONTRACT = 1 - // }; - // - // =========================================================================== - xdr.enum('HostFunction', { - hostFnCall: 0, - hostFnCreateContract: 1 - }); - - // === xdr source ============================================================ - // - // struct InvokeHostFunctionOp - // { - // // The host function to invoke - // HostFunction function; - // - // // Parameters to the host function - // SCVec parameters; - // - // // The footprint for this invocation - // LedgerFootprint footprint; - // }; - // - // =========================================================================== - xdr.struct('InvokeHostFunctionOp', [ - ['function', xdr.lookup('HostFunction')], - ['parameters', xdr.lookup('ScVec')], - ['footprint', xdr.lookup('LedgerFootprint')] - ]); - - // === 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 - // { - // uint256 ed25519; - // uint256 salt; - // } - // - // =========================================================================== - xdr.struct('HashIdPreimageEd25519ContractId', [ - ['ed25519', xdr.lookup('Uint256')], - ['salt', xdr.lookup('Uint256')] - ]); - - // === xdr source ============================================================ - // - // struct - // { - // Hash contractID; - // uint256 salt; - // } - // - // =========================================================================== - xdr.struct('HashIdPreimageContractId', [ - ['contractId', xdr.lookup('Hash')], - ['salt', xdr.lookup('Uint256')] - ]); - - // === 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 - // { - // uint256 ed25519; - // uint256 salt; - // } ed25519ContractID; - // case ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT: - // struct - // { - // Hash contractID; - // uint256 salt; - // } contractID; - // }; - // - // =========================================================================== - xdr.union('HashIdPreimage', { - switchOn: xdr.lookup('EnvelopeType'), - switchName: 'type', - switches: [ - ['envelopeTypeOpId', 'operationId'], - ['envelopeTypePoolRevokeOpId', 'revokeId'], - ['envelopeTypeContractIdFromEd25519', 'ed25519ContractId'], - ['envelopeTypeContractIdFromContract', 'contractId'] - ], - arms: { - operationId: xdr.lookup('HashIdPreimageOperationId'), - revokeId: xdr.lookup('HashIdPreimageRevokeId'), - ed25519ContractId: xdr.lookup('HashIdPreimageEd25519ContractId'), - contractId: xdr.lookup('HashIdPreimageContractId') - } - }); - - // === 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: - // void; - // case INVOKE_HOST_FUNCTION_MALFORMED: - // case INVOKE_HOST_FUNCTION_TRAPPED: - // void; - // }; - // - // =========================================================================== - xdr.union('InvokeHostFunctionResult', { - switchOn: xdr.lookup('InvokeHostFunctionResultCode'), - switchName: 'code', - switches: [ - ['invokeHostFunctionSuccess', xdr.void()], - ['invokeHostFunctionMalformed', xdr.void()], - ['invokeHostFunctionTrapped', 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; - // } - // - // =========================================================================== - 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 ============================================================ - // - // 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)]]); - - // === xdr source ============================================================ - // - // typedef string SCSymbol<10>; - // - // =========================================================================== - xdr.typedef('ScSymbol', xdr.string(10)); - - // === xdr source ============================================================ - // - // enum SCValType - // { - // SCV_U63 = 0, - // SCV_U32 = 1, - // SCV_I32 = 2, - // SCV_STATIC = 3, - // SCV_OBJECT = 4, - // SCV_SYMBOL = 5, - // SCV_BITSET = 6, - // SCV_STATUS = 7 - // }; - // - // =========================================================================== - xdr.enum('ScValType', { - scvU63: 0, - scvU32: 1, - scvI32: 2, - scvStatic: 3, - scvObject: 4, - scvSymbol: 5, - scvBitset: 6, - scvStatus: 7 - }); - - // === xdr source ============================================================ - // - // enum SCStatic - // { - // SCS_VOID = 0, - // SCS_TRUE = 1, - // SCS_FALSE = 2, - // SCS_LEDGER_KEY_CONTRACT_CODE = 3 - // }; - // - // =========================================================================== - xdr.enum('ScStatic', { - scsVoid: 0, - scsTrue: 1, - scsFalse: 2, - scsLedgerKeyContractCode: 3 - }); - - // === 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 - // // TODO: add more - // }; - // - // =========================================================================== - xdr.enum('ScStatusType', { - sstOk: 0, - sstUnknownError: 1, - sstHostValueError: 2, - sstHostObjectError: 3, - sstHostFunctionError: 4, - sstHostStorageError: 5, - sstHostContextError: 6, - sstVmError: 7 - }); - - // === 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 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 errorCode; - // case SST_HOST_OBJECT_ERROR: - // SCHostObjErrorCode errorCode; - // case SST_HOST_FUNCTION_ERROR: - // SCHostFnErrorCode errorCode; - // case SST_HOST_STORAGE_ERROR: - // SCHostStorageErrorCode errorCode; - // case SST_HOST_CONTEXT_ERROR: - // SCHostContextErrorCode errorCode; - // case SST_VM_ERROR: - // SCVmErrorCode errorCode; - // }; - // - // =========================================================================== - xdr.union('ScStatus', { - switchOn: xdr.lookup('ScStatusType'), - switchName: 'type', - switches: [ - ['sstOk', xdr.void()], - ['sstUnknownError', 'unknownCode'], - ['sstHostValueError', 'errorCode'], - ['sstHostObjectError', 'errorCode'], - ['sstHostFunctionError', 'errorCode'], - ['sstHostStorageError', 'errorCode'], - ['sstHostContextError', 'errorCode'], - ['sstVmError', 'errorCode'] - ], - arms: { - unknownCode: xdr.lookup('ScUnknownErrorCode'), - errorCode: xdr.lookup('ScHostValErrorCode'), - errorCode: xdr.lookup('ScHostObjErrorCode'), - errorCode: xdr.lookup('ScHostFnErrorCode'), - errorCode: xdr.lookup('ScHostStorageErrorCode'), - errorCode: xdr.lookup('ScHostContextErrorCode'), - errorCode: xdr.lookup('ScVmErrorCode') - } - }); - - // === xdr source ============================================================ - // - // union SCVal switch (SCValType type) - // { - // case SCV_U63: - // int64 u63; - // case SCV_U32: - // uint32 u32; - // case SCV_I32: - // int32 i32; - // case SCV_STATIC: - // SCStatic ic; - // case SCV_OBJECT: - // SCObject* obj; - // case SCV_SYMBOL: - // SCSymbol sym; - // case SCV_BITSET: - // uint64 bits; - // case SCV_STATUS: - // SCStatus status; - // }; - // - // =========================================================================== - xdr.union('ScVal', { - switchOn: xdr.lookup('ScValType'), - switchName: 'type', - switches: [ - ['scvU63', 'u63'], - ['scvU32', 'u32'], - ['scvI32', 'i32'], - ['scvStatic', 'ic'], - ['scvObject', 'obj'], - ['scvSymbol', 'sym'], - ['scvBitset', 'bits'], - ['scvStatus', 'status'] - ], - arms: { - u63: xdr.lookup('Int64'), - u32: xdr.lookup('Uint32'), - i32: xdr.lookup('Int32'), - ic: xdr.lookup('ScStatic'), - obj: xdr.option(xdr.lookup('ScObject')), - sym: xdr.lookup('ScSymbol'), - bits: xdr.lookup('Uint64'), - status: xdr.lookup('ScStatus') - } - }); - - // === xdr source ============================================================ - // - // enum SCObjectType - // { - // // We have a few objects that represent non-stellar-specific concepts - // // like general-purpose maps, vectors, numbers, blobs. - // - // SCO_VEC = 0, - // SCO_MAP = 1, - // SCO_U64 = 2, - // SCO_I64 = 3, - // SCO_BYTES = 4, - // SCO_BIG_INT = 5, - // SCO_HASH = 6, - // SCO_PUBLIC_KEY = 7, - // SCO_CONTRACT_CODE = 8 - // - // // TODO: add more - // }; - // - // =========================================================================== - xdr.enum('ScObjectType', { - scoVec: 0, - scoMap: 1, - scoU64: 2, - scoI64: 3, - scoBytes: 4, - scoBigInt: 5, - scoHash: 6, - scoPublicKey: 7, - scoContractCode: 8 - }); - - // === xdr source ============================================================ - // - // struct SCMapEntry - // { - // SCVal key; - // SCVal val; - // }; - // - // =========================================================================== - xdr.struct('ScMapEntry', [ - ['key', xdr.lookup('ScVal')], - ['val', xdr.lookup('ScVal')] - ]); - - // === xdr source ============================================================ - // - // const SCVAL_LIMIT = 256000; - // - // =========================================================================== - xdr.const('SCVAL_LIMIT', 256000); - - // === 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 ============================================================ - // - // enum SCNumSign - // { - // NEGATIVE = -1, - // ZERO = 0, - // POSITIVE = 1 - // }; - // - // =========================================================================== - xdr.enum('ScNumSign', { - negative: -1, - zero: 0, - positive: 1 - }); - - // === xdr source ============================================================ - // - // union SCBigInt switch (SCNumSign sign) - // { - // case ZERO: - // void; - // case POSITIVE: - // case NEGATIVE: - // opaque magnitude<256000>; - // }; - // - // =========================================================================== - xdr.union('ScBigInt', { - switchOn: xdr.lookup('ScNumSign'), - switchName: 'sign', - switches: [ - ['zero', xdr.void()], - ['positive', 'magnitude'], - ['negative', 'magnitude'] - ], - arms: { - magnitude: xdr.varOpaque(256000) - } - }); - - // === xdr source ============================================================ - // - // enum SCHashType - // { - // SCHASH_SHA256 = 0 - // }; - // - // =========================================================================== - xdr.enum('ScHashType', { - schashSha256: 0 - }); - - // === xdr source ============================================================ - // - // union SCHash switch (SCHashType type) - // { - // case SCHASH_SHA256: - // Hash sha256; - // }; - // - // =========================================================================== - xdr.union('ScHash', { - switchOn: xdr.lookup('ScHashType'), - switchName: 'type', - switches: [['schashSha256', 'sha256']], - arms: { - sha256: xdr.lookup('Hash') - } - }); - - // === xdr source ============================================================ - // - // enum SCContractCodeType - // { - // SCCONTRACT_CODE_WASM = 0, - // SCCONTRACT_CODE_TOKEN = 1 - // }; - // - // =========================================================================== - xdr.enum('ScContractCodeType', { - sccontractCodeWasm: 0, - sccontractCodeToken: 1 - }); - - // === xdr source ============================================================ - // - // union SCContractCode switch (SCContractCodeType type) - // { - // case SCCONTRACT_CODE_WASM: - // opaque wasm; - // case SCCONTRACT_CODE_TOKEN: - // void; - // }; - // - // =========================================================================== - xdr.union('ScContractCode', { - switchOn: xdr.lookup('ScContractCodeType'), - switchName: 'type', - switches: [ - ['sccontractCodeWasm', 'wasm'], - ['sccontractCodeToken', xdr.void()] - ], - arms: { - wasm: xdr.varOpaque(SCVAL_LIMIT) - } - }); - - // === xdr source ============================================================ - // - // union SCObject switch (SCObjectType type) - // { - // case SCO_VEC: - // SCVec vec; - // case SCO_MAP: - // SCMap map; - // case SCO_U64: - // uint64 u64; - // case SCO_I64: - // int64 i64; - // case SCO_BYTES: - // opaque bin; - // case SCO_BIG_INT: - // SCBigInt bigInt; - // case SCO_HASH: - // SCHash hash; - // case SCO_PUBLIC_KEY: - // PublicKey publicKey; - // case SCO_CONTRACT_CODE: - // SCContractCode contractCode; - // }; - // - // =========================================================================== - xdr.union('ScObject', { - switchOn: xdr.lookup('ScObjectType'), - switchName: 'type', - switches: [ - ['scoVec', 'vec'], - ['scoMap', 'map'], - ['scoU64', 'u64'], - ['scoI64', 'i64'], - ['scoBytes', 'bin'], - ['scoBigInt', 'bigInt'], - ['scoHash', 'hash'], - ['scoPublicKey', 'publicKey'], - ['scoContractCode', 'contractCode'] - ], - arms: { - vec: xdr.lookup('ScVec'), - map: xdr.lookup('ScMap'), - u64: xdr.lookup('Uint64'), - i64: xdr.lookup('Int64'), - bin: xdr.varOpaque(SCVAL_LIMIT), - bigInt: xdr.lookup('ScBigInt'), - hash: xdr.lookup('ScHash'), - publicKey: xdr.lookup('PublicKey'), - contractCode: xdr.lookup('ScContractCode') - } - }); - - // === 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 ============================================================ - // - // enum SCSpecType - // { - // // Types with no parameters. - // SC_SPEC_TYPE_U32 = 1, - // SC_SPEC_TYPE_I32 = 2, - // SC_SPEC_TYPE_U64 = 3, - // SC_SPEC_TYPE_I64 = 4, - // SC_SPEC_TYPE_BOOL = 5, - // SC_SPEC_TYPE_SYMBOL = 6, - // SC_SPEC_TYPE_BITSET = 7, - // SC_SPEC_TYPE_STATUS = 8, - // SC_SPEC_TYPE_BYTES = 9, - // SC_SPEC_TYPE_BIG_INT = 10, - // - // // 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, - // - // // User defined types. - // SC_SPEC_TYPE_UDT = 2000 - // }; - // - // =========================================================================== - xdr.enum('ScSpecType', { - scSpecTypeU32: 1, - scSpecTypeI32: 2, - scSpecTypeU64: 3, - scSpecTypeI64: 4, - scSpecTypeBool: 5, - scSpecTypeSymbol: 6, - scSpecTypeBitset: 7, - scSpecTypeStatus: 8, - scSpecTypeBytes: 9, - scSpecTypeBigInt: 10, - scSpecTypeOption: 1000, - scSpecTypeResult: 1001, - scSpecTypeVec: 1002, - scSpecTypeSet: 1003, - scSpecTypeMap: 1004, - scSpecTypeTuple: 1005, - 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 SCSpecTypeUDT - // { - // string name<60>; - // }; - // - // =========================================================================== - xdr.struct('ScSpecTypeUdt', [['name', xdr.string(60)]]); - - // === xdr source ============================================================ - // - // union SCSpecTypeDef switch (SCSpecType type) - // { - // case SC_SPEC_TYPE_U64: - // case SC_SPEC_TYPE_I64: - // case SC_SPEC_TYPE_U32: - // case SC_SPEC_TYPE_I32: - // case SC_SPEC_TYPE_BOOL: - // case SC_SPEC_TYPE_SYMBOL: - // case SC_SPEC_TYPE_BITSET: - // case SC_SPEC_TYPE_STATUS: - // case SC_SPEC_TYPE_BYTES: - // case SC_SPEC_TYPE_BIG_INT: - // 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_UDT: - // SCSpecTypeUDT udt; - // }; - // - // =========================================================================== - xdr.union('ScSpecTypeDef', { - switchOn: xdr.lookup('ScSpecType'), - switchName: 'type', - switches: [ - ['scSpecTypeU64', xdr.void()], - ['scSpecTypeI64', xdr.void()], - ['scSpecTypeU32', xdr.void()], - ['scSpecTypeI32', xdr.void()], - ['scSpecTypeBool', xdr.void()], - ['scSpecTypeSymbol', xdr.void()], - ['scSpecTypeBitset', xdr.void()], - ['scSpecTypeStatus', xdr.void()], - ['scSpecTypeBytes', xdr.void()], - ['scSpecTypeBigInt', xdr.void()], - ['scSpecTypeOption', 'option'], - ['scSpecTypeResult', 'result'], - ['scSpecTypeVec', 'vec'], - ['scSpecTypeMap', 'map'], - ['scSpecTypeSet', 'set'], - ['scSpecTypeTuple', 'tuple'], - ['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'), - udt: xdr.lookup('ScSpecTypeUdt') - } - }); - - // === xdr source ============================================================ - // - // struct SCSpecUDTStructFieldV0 - // { - // string name<30>; - // SCSpecTypeDef type; - // }; - // - // =========================================================================== - xdr.struct('ScSpecUdtStructFieldV0', [ - ['name', xdr.string(30)], - ['type', xdr.lookup('ScSpecTypeDef')] - ]); - - // === xdr source ============================================================ - // - // struct SCSpecUDTStructV0 - // { - // string name<60>; - // SCSpecUDTStructFieldV0 fields<40>; - // }; - // - // =========================================================================== - xdr.struct('ScSpecUdtStructV0', [ - ['name', xdr.string(60)], - ['fields', xdr.varArray(xdr.lookup('ScSpecUdtStructFieldV0'), 40)] - ]); - - // === xdr source ============================================================ - // - // struct SCSpecUDTUnionCaseV0 - // { - // string name<60>; - // SCSpecTypeDef *type; - // }; - // - // =========================================================================== - xdr.struct('ScSpecUdtUnionCaseV0', [ - ['name', xdr.string(60)], - ['type', xdr.option(xdr.lookup('ScSpecTypeDef'))] - ]); - - // === xdr source ============================================================ - // - // struct SCSpecUDTUnionV0 - // { - // string name<60>; - // SCSpecUDTUnionCaseV0 cases<50>; - // }; - // - // =========================================================================== - xdr.struct('ScSpecUdtUnionV0', [ - ['name', xdr.string(60)], - ['cases', xdr.varArray(xdr.lookup('ScSpecUdtUnionCaseV0'), 50)] - ]); - - // === xdr source ============================================================ - // - // struct SCSpecFunctionV0 - // { - // SCSymbol name; - // SCSpecTypeDef inputTypes<10>; - // SCSpecTypeDef outputTypes<1>; - // }; - // - // =========================================================================== - xdr.struct('ScSpecFunctionV0', [ - ['name', xdr.lookup('ScSymbol')], - ['inputTypes', xdr.varArray(xdr.lookup('ScSpecTypeDef'), 10)], - ['outputTypes', 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 - // }; - // - // =========================================================================== - xdr.enum('ScSpecEntryKind', { - scSpecEntryFunctionV0: 0, - scSpecEntryUdtStructV0: 1, - scSpecEntryUdtUnionV0: 2 - }); - - // === 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; - // }; - // - // =========================================================================== - xdr.union('ScSpecEntry', { - switchOn: xdr.lookup('ScSpecEntryKind'), - switchName: 'kind', - switches: [ - ['scSpecEntryFunctionV0', 'functionV0'], - ['scSpecEntryUdtStructV0', 'udtStructV0'], - ['scSpecEntryUdtUnionV0', 'udtUnionV0'] - ], - arms: { - functionV0: xdr.lookup('ScSpecFunctionV0'), - udtStructV0: xdr.lookup('ScSpecUdtStructV0'), - udtUnionV0: xdr.lookup('ScSpecUdtUnionV0') - } - }); + +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, +// CONTRACT_DATA = 6, +// CONFIG_SETTING = 7 +// }; +// +// =========================================================================== +xdr.enum("LedgerEntryType", { + account: 0, + trustline: 1, + offer: 2, + data: 3, + claimableBalance: 4, + liquidityPool: 5, + contractData: 6, + configSetting: 7, +}); + +// === 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 ============================================================ +// +// enum ConfigSettingType +// { +// CONFIG_SETTING_TYPE_UINT32 = 0 +// }; +// +// =========================================================================== +xdr.enum("ConfigSettingType", { + configSettingTypeUint32: 0, +}); + +// === xdr source ============================================================ +// +// union ConfigSetting switch (ConfigSettingType type) +// { +// case CONFIG_SETTING_TYPE_UINT32: +// uint32 uint32Val; +// }; +// +// =========================================================================== +xdr.union("ConfigSetting", { + switchOn: xdr.lookup("ConfigSettingType"), + switchName: "type", + switches: [ + ["configSettingTypeUint32", "uint32Val"], + ], + arms: { + uint32Val: xdr.lookup("Uint32"), + }, +}); + +// === xdr source ============================================================ +// +// enum ConfigSettingID +// { +// CONFIG_SETTING_CONTRACT_MAX_SIZE = 0 +// }; +// +// =========================================================================== +xdr.enum("ConfigSettingId", { + configSettingContractMaxSize: 0, +}); + +// === xdr source ============================================================ +// +// union switch (int v) +// { +// case 0: +// void; +// } +// +// =========================================================================== +xdr.union("ConfigSettingEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + ], + arms: { + }, +}); + +// === xdr source ============================================================ +// +// struct ConfigSettingEntry +// { +// union switch (int v) +// { +// case 0: +// void; +// } +// ext; +// +// ConfigSettingID configSettingID; +// ConfigSetting setting; +// }; +// +// =========================================================================== +xdr.struct("ConfigSettingEntry", [ + ["ext", xdr.lookup("ConfigSettingEntryExt")], + ["configSettingId", xdr.lookup("ConfigSettingId")], + ["setting", xdr.lookup("ConfigSetting")], +]); + +// === 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 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"], + ["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"), + 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 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 +// { +// 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 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"], + ["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"), + 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 +// }; +// +// =========================================================================== +xdr.enum("EnvelopeType", { + envelopeTypeTxV0: 0, + envelopeTypeScp: 1, + envelopeTypeTx: 2, + envelopeTypeAuth: 3, + envelopeTypeScpvalue: 4, + envelopeTypeTxFeeBump: 5, + envelopeTypeOpId: 6, + envelopeTypePoolRevokeOpId: 7, + envelopeTypeContractIdFromEd25519: 8, + envelopeTypeContractIdFromContract: 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 = 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 +// { +// ConfigSettingID id; // id to update +// ConfigSetting setting; // new value +// } +// +// =========================================================================== +xdr.struct("LedgerUpgradeConfigSetting", [ + ["id", xdr.lookup("ConfigSettingId")], + ["setting", xdr.lookup("ConfigSetting")], +]); + +// === 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: +// struct +// { +// ConfigSettingID id; // id to update +// ConfigSetting setting; // new value +// } configSetting; +// }; +// +// =========================================================================== +xdr.union("LedgerUpgrade", { + switchOn: xdr.lookup("LedgerUpgradeType"), + switchName: "type", + switches: [ + ["ledgerUpgradeVersion", "newLedgerVersion"], + ["ledgerUpgradeBaseFee", "newBaseFee"], + ["ledgerUpgradeMaxTxSetSize", "newMaxTxSetSize"], + ["ledgerUpgradeBaseReserve", "newBaseReserve"], + ["ledgerUpgradeFlags", "newFlags"], + ["ledgerUpgradeConfig", "configSetting"], + ], + arms: { + newLedgerVersion: xdr.lookup("Uint32"), + newBaseFee: xdr.lookup("Uint32"), + newMaxTxSetSize: xdr.lookup("Uint32"), + newBaseReserve: xdr.lookup("Uint32"), + newFlags: xdr.lookup("Uint32"), + configSetting: xdr.lookup("LedgerUpgradeConfigSetting"), + }, +}); + +// === 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 ============================================================ +// +// struct Auth +// { +// // Empty message, just to confirm +// // establishment of MAC keys. +// int unused; +// }; +// +// =========================================================================== +xdr.struct("Auth", [ + ["unused", 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 +// }; +// +// =========================================================================== +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, +}); + +// === 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 ============================================================ +// +// 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; +// }; +// +// =========================================================================== +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"], + ], + 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"), + }, +}); + +// === 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 HostFunction +// { +// HOST_FN_CALL = 0, +// HOST_FN_CREATE_CONTRACT = 1 +// }; +// +// =========================================================================== +xdr.enum("HostFunction", { + hostFnCall: 0, + hostFnCreateContract: 1, +}); + +// === xdr source ============================================================ +// +// struct InvokeHostFunctionOp +// { +// // The host function to invoke +// HostFunction function; +// +// // Parameters to the host function +// SCVec parameters; +// +// // The footprint for this invocation +// LedgerFootprint footprint; +// }; +// +// =========================================================================== +xdr.struct("InvokeHostFunctionOp", [ + ["function", xdr.lookup("HostFunction")], + ["parameters", xdr.lookup("ScVec")], + ["footprint", xdr.lookup("LedgerFootprint")], +]); + +// === 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 +// { +// uint256 ed25519; +// uint256 salt; +// } +// +// =========================================================================== +xdr.struct("HashIdPreimageEd25519ContractId", [ + ["ed25519", xdr.lookup("Uint256")], + ["salt", xdr.lookup("Uint256")], +]); + +// === xdr source ============================================================ +// +// struct +// { +// Hash contractID; +// uint256 salt; +// } +// +// =========================================================================== +xdr.struct("HashIdPreimageContractId", [ + ["contractId", xdr.lookup("Hash")], + ["salt", xdr.lookup("Uint256")], +]); + +// === 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 +// { +// uint256 ed25519; +// uint256 salt; +// } ed25519ContractID; +// case ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT: +// struct +// { +// Hash contractID; +// uint256 salt; +// } contractID; +// }; +// +// =========================================================================== +xdr.union("HashIdPreimage", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [ + ["envelopeTypeOpId", "operationId"], + ["envelopeTypePoolRevokeOpId", "revokeId"], + ["envelopeTypeContractIdFromEd25519", "ed25519ContractId"], + ["envelopeTypeContractIdFromContract", "contractId"], + ], + arms: { + operationId: xdr.lookup("HashIdPreimageOperationId"), + revokeId: xdr.lookup("HashIdPreimageRevokeId"), + ed25519ContractId: xdr.lookup("HashIdPreimageEd25519ContractId"), + contractId: xdr.lookup("HashIdPreimageContractId"), + }, +}); + +// === 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: +// void; +// case INVOKE_HOST_FUNCTION_MALFORMED: +// case INVOKE_HOST_FUNCTION_TRAPPED: +// void; +// }; +// +// =========================================================================== +xdr.union("InvokeHostFunctionResult", { + switchOn: xdr.lookup("InvokeHostFunctionResultCode"), + switchName: "code", + switches: [ + ["invokeHostFunctionSuccess", xdr.void()], + ["invokeHostFunctionMalformed", xdr.void()], + ["invokeHostFunctionTrapped", 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; +// } +// +// =========================================================================== +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 ============================================================ +// +// 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)], +]); + +// === xdr source ============================================================ +// +// typedef string SCSymbol<10>; +// +// =========================================================================== +xdr.typedef("ScSymbol", xdr.string(10)); + +// === xdr source ============================================================ +// +// enum SCValType +// { +// SCV_U63 = 0, +// SCV_U32 = 1, +// SCV_I32 = 2, +// SCV_STATIC = 3, +// SCV_OBJECT = 4, +// SCV_SYMBOL = 5, +// SCV_BITSET = 6, +// SCV_STATUS = 7 +// }; +// +// =========================================================================== +xdr.enum("ScValType", { + scvU63: 0, + scvU32: 1, + scvI32: 2, + scvStatic: 3, + scvObject: 4, + scvSymbol: 5, + scvBitset: 6, + scvStatus: 7, +}); + +// === xdr source ============================================================ +// +// enum SCStatic +// { +// SCS_VOID = 0, +// SCS_TRUE = 1, +// SCS_FALSE = 2, +// SCS_LEDGER_KEY_CONTRACT_CODE = 3 +// }; +// +// =========================================================================== +xdr.enum("ScStatic", { + scsVoid: 0, + scsTrue: 1, + scsFalse: 2, + scsLedgerKeyContractCode: 3, +}); + +// === 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 +// // TODO: add more +// }; +// +// =========================================================================== +xdr.enum("ScStatusType", { + sstOk: 0, + sstUnknownError: 1, + sstHostValueError: 2, + sstHostObjectError: 3, + sstHostFunctionError: 4, + sstHostStorageError: 5, + sstHostContextError: 6, + sstVmError: 7, +}); + +// === 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 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 errorCode; +// case SST_HOST_OBJECT_ERROR: +// SCHostObjErrorCode errorCode; +// case SST_HOST_FUNCTION_ERROR: +// SCHostFnErrorCode errorCode; +// case SST_HOST_STORAGE_ERROR: +// SCHostStorageErrorCode errorCode; +// case SST_HOST_CONTEXT_ERROR: +// SCHostContextErrorCode errorCode; +// case SST_VM_ERROR: +// SCVmErrorCode errorCode; +// }; +// +// =========================================================================== +xdr.union("ScStatus", { + switchOn: xdr.lookup("ScStatusType"), + switchName: "type", + switches: [ + ["sstOk", xdr.void()], + ["sstUnknownError", "unknownCode"], + ["sstHostValueError", "errorCode"], + ["sstHostObjectError", "errorCode"], + ["sstHostFunctionError", "errorCode"], + ["sstHostStorageError", "errorCode"], + ["sstHostContextError", "errorCode"], + ["sstVmError", "errorCode"], + ], + arms: { + unknownCode: xdr.lookup("ScUnknownErrorCode"), + errorCode: xdr.lookup("ScHostValErrorCode"), + errorCode: xdr.lookup("ScHostObjErrorCode"), + errorCode: xdr.lookup("ScHostFnErrorCode"), + errorCode: xdr.lookup("ScHostStorageErrorCode"), + errorCode: xdr.lookup("ScHostContextErrorCode"), + errorCode: xdr.lookup("ScVmErrorCode"), + }, +}); + +// === xdr source ============================================================ +// +// union SCVal switch (SCValType type) +// { +// case SCV_U63: +// int64 u63; +// case SCV_U32: +// uint32 u32; +// case SCV_I32: +// int32 i32; +// case SCV_STATIC: +// SCStatic ic; +// case SCV_OBJECT: +// SCObject* obj; +// case SCV_SYMBOL: +// SCSymbol sym; +// case SCV_BITSET: +// uint64 bits; +// case SCV_STATUS: +// SCStatus status; +// }; +// +// =========================================================================== +xdr.union("ScVal", { + switchOn: xdr.lookup("ScValType"), + switchName: "type", + switches: [ + ["scvU63", "u63"], + ["scvU32", "u32"], + ["scvI32", "i32"], + ["scvStatic", "ic"], + ["scvObject", "obj"], + ["scvSymbol", "sym"], + ["scvBitset", "bits"], + ["scvStatus", "status"], + ], + arms: { + u63: xdr.lookup("Int64"), + u32: xdr.lookup("Uint32"), + i32: xdr.lookup("Int32"), + ic: xdr.lookup("ScStatic"), + obj: xdr.option(xdr.lookup("ScObject")), + sym: xdr.lookup("ScSymbol"), + bits: xdr.lookup("Uint64"), + status: xdr.lookup("ScStatus"), + }, +}); + +// === xdr source ============================================================ +// +// enum SCObjectType +// { +// // We have a few objects that represent non-stellar-specific concepts +// // like general-purpose maps, vectors, numbers, blobs. +// +// SCO_VEC = 0, +// SCO_MAP = 1, +// SCO_U64 = 2, +// SCO_I64 = 3, +// SCO_BYTES = 4, +// SCO_BIG_INT = 5, +// SCO_HASH = 6, +// SCO_PUBLIC_KEY = 7, +// SCO_CONTRACT_CODE = 8 +// +// // TODO: add more +// }; +// +// =========================================================================== +xdr.enum("ScObjectType", { + scoVec: 0, + scoMap: 1, + scoU64: 2, + scoI64: 3, + scoBytes: 4, + scoBigInt: 5, + scoHash: 6, + scoPublicKey: 7, + scoContractCode: 8, +}); + +// === xdr source ============================================================ +// +// struct SCMapEntry +// { +// SCVal key; +// SCVal val; +// }; +// +// =========================================================================== +xdr.struct("ScMapEntry", [ + ["key", xdr.lookup("ScVal")], + ["val", xdr.lookup("ScVal")], +]); + +// === xdr source ============================================================ +// +// const SCVAL_LIMIT = 256000; +// +// =========================================================================== +xdr.const("SCVAL_LIMIT", 256000); + +// === 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 ============================================================ +// +// enum SCNumSign +// { +// NEGATIVE = -1, +// ZERO = 0, +// POSITIVE = 1 +// }; +// +// =========================================================================== +xdr.enum("ScNumSign", { + negative: -1, + zero: 0, + positive: 1, +}); + +// === xdr source ============================================================ +// +// union SCBigInt switch (SCNumSign sign) +// { +// case ZERO: +// void; +// case POSITIVE: +// case NEGATIVE: +// opaque magnitude<256000>; +// }; +// +// =========================================================================== +xdr.union("ScBigInt", { + switchOn: xdr.lookup("ScNumSign"), + switchName: "sign", + switches: [ + ["zero", xdr.void()], + ["positive", "magnitude"], + ["negative", "magnitude"], + ], + arms: { + magnitude: xdr.varOpaque(256000), + }, +}); + +// === xdr source ============================================================ +// +// enum SCHashType +// { +// SCHASH_SHA256 = 0 +// }; +// +// =========================================================================== +xdr.enum("ScHashType", { + schashSha256: 0, +}); + +// === xdr source ============================================================ +// +// union SCHash switch (SCHashType type) +// { +// case SCHASH_SHA256: +// Hash sha256; +// }; +// +// =========================================================================== +xdr.union("ScHash", { + switchOn: xdr.lookup("ScHashType"), + switchName: "type", + switches: [ + ["schashSha256", "sha256"], + ], + arms: { + sha256: xdr.lookup("Hash"), + }, +}); + +// === xdr source ============================================================ +// +// enum SCContractCodeType +// { +// SCCONTRACT_CODE_WASM = 0, +// SCCONTRACT_CODE_TOKEN = 1 +// }; +// +// =========================================================================== +xdr.enum("ScContractCodeType", { + sccontractCodeWasm: 0, + sccontractCodeToken: 1, +}); + +// === xdr source ============================================================ +// +// union SCContractCode switch (SCContractCodeType type) +// { +// case SCCONTRACT_CODE_WASM: +// opaque wasm; +// case SCCONTRACT_CODE_TOKEN: +// void; +// }; +// +// =========================================================================== +xdr.union("ScContractCode", { + switchOn: xdr.lookup("ScContractCodeType"), + switchName: "type", + switches: [ + ["sccontractCodeWasm", "wasm"], + ["sccontractCodeToken", xdr.void()], + ], + arms: { + wasm: xdr.varOpaque(SCVAL_LIMIT), + }, +}); + +// === xdr source ============================================================ +// +// union SCObject switch (SCObjectType type) +// { +// case SCO_VEC: +// SCVec vec; +// case SCO_MAP: +// SCMap map; +// case SCO_U64: +// uint64 u64; +// case SCO_I64: +// int64 i64; +// case SCO_BYTES: +// opaque bin; +// case SCO_BIG_INT: +// SCBigInt bigInt; +// case SCO_HASH: +// SCHash hash; +// case SCO_PUBLIC_KEY: +// PublicKey publicKey; +// case SCO_CONTRACT_CODE: +// SCContractCode contractCode; +// }; +// +// =========================================================================== +xdr.union("ScObject", { + switchOn: xdr.lookup("ScObjectType"), + switchName: "type", + switches: [ + ["scoVec", "vec"], + ["scoMap", "map"], + ["scoU64", "u64"], + ["scoI64", "i64"], + ["scoBytes", "bin"], + ["scoBigInt", "bigInt"], + ["scoHash", "hash"], + ["scoPublicKey", "publicKey"], + ["scoContractCode", "contractCode"], + ], + arms: { + vec: xdr.lookup("ScVec"), + map: xdr.lookup("ScMap"), + u64: xdr.lookup("Uint64"), + i64: xdr.lookup("Int64"), + bin: xdr.varOpaque(SCVAL_LIMIT), + bigInt: xdr.lookup("ScBigInt"), + hash: xdr.lookup("ScHash"), + publicKey: xdr.lookup("PublicKey"), + contractCode: xdr.lookup("ScContractCode"), + }, +}); + +// === 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 ============================================================ +// +// enum SCSpecType +// { +// // Types with no parameters. +// SC_SPEC_TYPE_U32 = 1, +// SC_SPEC_TYPE_I32 = 2, +// SC_SPEC_TYPE_U64 = 3, +// SC_SPEC_TYPE_I64 = 4, +// SC_SPEC_TYPE_BOOL = 5, +// SC_SPEC_TYPE_SYMBOL = 6, +// SC_SPEC_TYPE_BITSET = 7, +// SC_SPEC_TYPE_STATUS = 8, +// SC_SPEC_TYPE_BYTES = 9, +// SC_SPEC_TYPE_BIG_INT = 10, +// +// // 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, +// +// // User defined types. +// SC_SPEC_TYPE_UDT = 2000 +// }; +// +// =========================================================================== +xdr.enum("ScSpecType", { + scSpecTypeU32: 1, + scSpecTypeI32: 2, + scSpecTypeU64: 3, + scSpecTypeI64: 4, + scSpecTypeBool: 5, + scSpecTypeSymbol: 6, + scSpecTypeBitset: 7, + scSpecTypeStatus: 8, + scSpecTypeBytes: 9, + scSpecTypeBigInt: 10, + scSpecTypeOption: 1000, + scSpecTypeResult: 1001, + scSpecTypeVec: 1002, + scSpecTypeSet: 1003, + scSpecTypeMap: 1004, + scSpecTypeTuple: 1005, + 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 SCSpecTypeUDT +// { +// string name<60>; +// }; +// +// =========================================================================== +xdr.struct("ScSpecTypeUdt", [ + ["name", xdr.string(60)], +]); + +// === xdr source ============================================================ +// +// union SCSpecTypeDef switch (SCSpecType type) +// { +// case SC_SPEC_TYPE_U64: +// case SC_SPEC_TYPE_I64: +// case SC_SPEC_TYPE_U32: +// case SC_SPEC_TYPE_I32: +// case SC_SPEC_TYPE_BOOL: +// case SC_SPEC_TYPE_SYMBOL: +// case SC_SPEC_TYPE_BITSET: +// case SC_SPEC_TYPE_STATUS: +// case SC_SPEC_TYPE_BYTES: +// case SC_SPEC_TYPE_BIG_INT: +// 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_UDT: +// SCSpecTypeUDT udt; +// }; +// +// =========================================================================== +xdr.union("ScSpecTypeDef", { + switchOn: xdr.lookup("ScSpecType"), + switchName: "type", + switches: [ + ["scSpecTypeU64", xdr.void()], + ["scSpecTypeI64", xdr.void()], + ["scSpecTypeU32", xdr.void()], + ["scSpecTypeI32", xdr.void()], + ["scSpecTypeBool", xdr.void()], + ["scSpecTypeSymbol", xdr.void()], + ["scSpecTypeBitset", xdr.void()], + ["scSpecTypeStatus", xdr.void()], + ["scSpecTypeBytes", xdr.void()], + ["scSpecTypeBigInt", xdr.void()], + ["scSpecTypeOption", "option"], + ["scSpecTypeResult", "result"], + ["scSpecTypeVec", "vec"], + ["scSpecTypeMap", "map"], + ["scSpecTypeSet", "set"], + ["scSpecTypeTuple", "tuple"], + ["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"), + udt: xdr.lookup("ScSpecTypeUdt"), + }, +}); + +// === xdr source ============================================================ +// +// struct SCSpecUDTStructFieldV0 +// { +// string name<30>; +// SCSpecTypeDef type; +// }; +// +// =========================================================================== +xdr.struct("ScSpecUdtStructFieldV0", [ + ["name", xdr.string(30)], + ["type", xdr.lookup("ScSpecTypeDef")], +]); + +// === xdr source ============================================================ +// +// struct SCSpecUDTStructV0 +// { +// string name<60>; +// SCSpecUDTStructFieldV0 fields<40>; +// }; +// +// =========================================================================== +xdr.struct("ScSpecUdtStructV0", [ + ["name", xdr.string(60)], + ["fields", xdr.varArray(xdr.lookup("ScSpecUdtStructFieldV0"), 40)], +]); + +// === xdr source ============================================================ +// +// struct SCSpecUDTUnionCaseV0 +// { +// string name<60>; +// SCSpecTypeDef *type; +// }; +// +// =========================================================================== +xdr.struct("ScSpecUdtUnionCaseV0", [ + ["name", xdr.string(60)], + ["type", xdr.option(xdr.lookup("ScSpecTypeDef"))], +]); + +// === xdr source ============================================================ +// +// struct SCSpecUDTUnionV0 +// { +// string name<60>; +// SCSpecUDTUnionCaseV0 cases<50>; +// }; +// +// =========================================================================== +xdr.struct("ScSpecUdtUnionV0", [ + ["name", xdr.string(60)], + ["cases", xdr.varArray(xdr.lookup("ScSpecUdtUnionCaseV0"), 50)], +]); + +// === xdr source ============================================================ +// +// struct SCSpecFunctionV0 +// { +// SCSymbol name; +// SCSpecTypeDef inputTypes<10>; +// SCSpecTypeDef outputTypes<1>; +// }; +// +// =========================================================================== +xdr.struct("ScSpecFunctionV0", [ + ["name", xdr.lookup("ScSymbol")], + ["inputTypes", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 10)], + ["outputTypes", 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 +// }; +// +// =========================================================================== +xdr.enum("ScSpecEntryKind", { + scSpecEntryFunctionV0: 0, + scSpecEntryUdtStructV0: 1, + scSpecEntryUdtUnionV0: 2, +}); + +// === 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; +// }; +// +// =========================================================================== +xdr.union("ScSpecEntry", { + switchOn: xdr.lookup("ScSpecEntryKind"), + switchName: "kind", + switches: [ + ["scSpecEntryFunctionV0", "functionV0"], + ["scSpecEntryUdtStructV0", "udtStructV0"], + ["scSpecEntryUdtUnionV0", "udtUnionV0"], + ], + arms: { + functionV0: xdr.lookup("ScSpecFunctionV0"), + udtStructV0: xdr.lookup("ScSpecUdtStructV0"), + udtUnionV0: xdr.lookup("ScSpecUdtUnionV0"), + }, +}); + }); export default types; From 8a8a7312e93bf3b7ea252a3c263e470398f64d37 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 11 Apr 2023 12:58:50 -0700 Subject: [PATCH 23/25] Only generate code coverage in dev mode --- .babelrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index 57297730d..75bbc23c8 100644 --- a/.babelrc +++ b/.babelrc @@ -2,5 +2,11 @@ "presets": [ "@babel/preset-env" ], - "plugins": ["istanbul"] + "env": { + "development": { + "plugins": [ + "istanbul" + ] + } + } } From b5ad4865253662bed93d2d59a78a5b78620d247b Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 11 Apr 2023 13:02:02 -0700 Subject: [PATCH 24/25] Update README with new yarn scripts --- README.md | 23 +++++++++++++---------- package.json | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5abfcd387..f8fa91ca8 100644 --- a/README.md +++ b/README.md @@ -127,17 +127,22 @@ yarn 5. Observe the project's code style -While you're making changes, make sure to run the linter-watcher to catch any +While you're making changes, make sure to regularly run the linter to catch any linting errors (in addition to making sure your text editor supports ESLint) ```shell -node_modules/.bin/gulp watch +yarn lint +``` + +as well as fixing any formatting errors with + +```shell +yarn fmt ``` If you're working on a file not in `src`, limit your code to Node 6.16 ES! See -what's supported here: https://node.green/ (The reason is that our npm library -must support earlier versions of Node, so the tests need to run on those -versions.) +what's supported here: https://node.green/. (Our npm library must support +earlier versions of Node, so the tests need to run on those versions.) #### Updating XDR definitions @@ -154,18 +159,16 @@ For information on how to use js-stellar-base, take a look at the docs in the To run all tests: ```shell -gulp test +yarn test ``` To run a specific set of tests: ```shell -gulp test:node -gulp test:browser +yarn test:node +yarn test:browser ``` -You can also run `yarn test` for a simpler subset of the test cases. - Tests are also run automatically in Github Actions for every master commit and pull request. diff --git a/package.json b/package.json index a5f29085c..988af5050 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "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 pretty && yarn lint && yarn build:prod && yarn test", - "pretty": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'", + "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/" }, From 95e8d255e16fff9dc72bcb991c997c2694b5bc37 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 12 Apr 2023 12:07:41 -0700 Subject: [PATCH 25/25] Fixup commit hook --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 988af5050..16cac02ba 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ }, "lint-staged": { "**/*.{js,json}": [ - "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write" + "yarn fmt", + "yarn lint" ] }, "browser": {