From d3f125f5c13d6ccf36e29bcbaf4d008c35d4012d Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 31 May 2023 13:21:39 -0700 Subject: [PATCH 01/34] Add moved files from js-xdr --- package.json | 4 ++-- src/numbers/i128.js | 17 +++++++++++++++++ src/numbers/i256.js | 17 +++++++++++++++++ src/numbers/u128.js | 17 +++++++++++++++++ src/numbers/u256.js | 17 +++++++++++++++++ yarn.lock | 5 ++--- 6 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 src/numbers/i128.js create mode 100644 src/numbers/i256.js create mode 100644 src/numbers/u128.js create mode 100644 src/numbers/u256.js diff --git a/package.json b/package.json index 2aaf3307..a2fbd587 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,6 @@ "@typescript-eslint/parser": "^5.59.5", "babel-loader": "^9.1.2", "babel-plugin-istanbul": "^6.1.1", - "buffer": "^6.0.3", "chai": "^4.3.7", "cross-env": "^7.0.3", "eslint": "^8.40.0", @@ -120,9 +119,10 @@ "dependencies": { "base32.js": "^0.1.0", "bignumber.js": "^9.1.1", + "buffer": "^6.0.3", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "js-xdr": "^2.0.0", + "js-xdr": "git+https://github.com/stellar/js-xdr#5749f38", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" diff --git a/src/numbers/i128.js b/src/numbers/i128.js new file mode 100644 index 00000000..7a5713ef --- /dev/null +++ b/src/numbers/i128.js @@ -0,0 +1,17 @@ +import { LargeInt } from './large-int'; + +export class I128 extends LargeInt { + constructor(...args) { + super(args); + } + + get unsigned() { + return false; + } + + get size() { + return 128; + } +} + +I128.defineIntBoundaries(); diff --git a/src/numbers/i256.js b/src/numbers/i256.js new file mode 100644 index 00000000..959aa3ab --- /dev/null +++ b/src/numbers/i256.js @@ -0,0 +1,17 @@ +import { LargeInt } from './large-int'; + +export class I256 extends LargeInt { + constructor(...args) { + super(args); + } + + get unsigned() { + return false; + } + + get size() { + return 256; + } +} + +I256.defineIntBoundaries(); diff --git a/src/numbers/u128.js b/src/numbers/u128.js new file mode 100644 index 00000000..3804a634 --- /dev/null +++ b/src/numbers/u128.js @@ -0,0 +1,17 @@ +import { LargeInt } from './large-int'; + +export class U128 extends LargeInt { + constructor(...args) { + super(args); + } + + get unsigned() { + return true; + } + + get size() { + return 128; + } +} + +U128.defineIntBoundaries(); diff --git a/src/numbers/u256.js b/src/numbers/u256.js new file mode 100644 index 00000000..1bab5430 --- /dev/null +++ b/src/numbers/u256.js @@ -0,0 +1,17 @@ +import { LargeInt } from './large-int'; + +export class U256 extends LargeInt { + constructor(...args) { + super(args); + } + + get unsigned() { + return true; + } + + get size() { + return 256; + } +} + +U256.defineIntBoundaries(); diff --git a/yarn.lock b/yarn.lock index cc25c2d6..332ca4b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4350,10 +4350,9 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-xdr@^2.0.0: +"js-xdr@git+https://github.com/stellar/js-xdr#5749f38": version "2.0.0" - resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-2.0.0.tgz#ef24ea27369ab60217c001fd0e27301f6981ba0a" - integrity sha512-4mctWHR47ejNcfpE8/Xl3l2wYqO1Qy09d1pveZRmarUz2BcuU/M8grzadxV6PoN/X0ywOb6cy6117qYUWkfeBA== + resolved "git+https://github.com/stellar/js-xdr#5749f3878512b474c232548c090e5ae5636ae379" js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" From 65d55544426b1122bab789547309e15d6e7dd288 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 1 Jun 2023 10:16:35 -0700 Subject: [PATCH 02/34] Add first draft of number-handling API --- package.json | 7 +- src/contract.js | 12 +- src/index.js | 2 + src/numbers/generic.js | 232 +++++++++++++++++++++++++ src/numbers/i128.js | 2 +- src/numbers/i256.js | 2 +- src/numbers/u128.js | 2 +- src/numbers/u256.js | 2 +- src/operations/invoke_host_function.js | 13 +- src/transaction_builder.js | 51 +++--- test/unit/i256_test.js | 130 ++++++++++++++ yarn.lock | 6 +- 12 files changed, 414 insertions(+), 47 deletions(-) create mode 100644 src/numbers/generic.js create mode 100644 test/unit/i256_test.js diff --git a/package.json b/package.json index a2fbd587..afb78dae 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,15 @@ "build:browser:prod": "cross-env NODE_ENV=production yarn build:browser", "build:prod": "cross-env NODE_ENV=production yarn build", "test": "yarn build && yarn test:node && yarn test:browser", - "test:node": "nyc --nycrc-path ./config/.nycrc mocha", + "test:node": "yarn _nyc mocha", "test:browser": "karma start ./config/karma.conf.js", "docs": "jsdoc -c ./config/.jsdoc.json --verbose", "lint": "eslint -c ./config/.eslintrc.js src/ && dtslint --localTs node_modules/typescript/lib types/", "preversion": "yarn clean && yarn fmt && yarn lint && yarn build:prod && yarn test", "fmt": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'", "prepare": "yarn build:prod", - "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/" + "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/", + "_nyc": "nyc --nycrc-path ./config/.nycrc" }, "mocha": { "require": [ @@ -122,7 +123,7 @@ "buffer": "^6.0.3", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "js-xdr": "git+https://github.com/stellar/js-xdr#5749f38", + "js-xdr": "git+https://github.com/stellar/js-xdr#a3eb0e6", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" diff --git a/src/contract.js b/src/contract.js index 0e97dddd..5318e221 100644 --- a/src/contract.js +++ b/src/contract.js @@ -43,12 +43,12 @@ export class Contract { */ contractId(format = 'strkey') { switch (format) { - case 'strkey': - return StrKey.encodeContract(this._id); - case 'hex': - return this._id.toString('hex'); - default: - throw new Error(`Invalid format: ${format}`); + case 'strkey': + return StrKey.encodeContract(this._id); + case 'hex': + return this._id.toString('hex'); + default: + throw new Error(`Invalid format: ${format}`); } } diff --git a/src/index.js b/src/index.js index 1b687f9e..d633c052 100644 --- a/src/index.js +++ b/src/index.js @@ -47,4 +47,6 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; +export { BigInteger } from './numbers/generic'; + export default module.exports; diff --git a/src/numbers/generic.js b/src/numbers/generic.js new file mode 100644 index 00000000..2173841d --- /dev/null +++ b/src/numbers/generic.js @@ -0,0 +1,232 @@ +/* eslint no-bitwise: 0 */ +import { Hyper, UnsignedHyper } from 'js-xdr'; + +import { U128 } from './u128'; +import { I128 } from './i128'; +import { I256 } from './i256'; +import { U256 } from './u256'; + +import xdr from '../xdr'; + +// const MAX_32 = (1n << 32) - 1; +const MAX_64 = (1n << 64n) - 1n; +const MAX_128 = (1n << 28n) - 1n; +// const MAX_256 = (1n << 56) - 1; + +/** + * Provides an easier way to manipulate large numbers for Stellar operations. + * + * @param {Array} parts - an arbitrary set of pieces of an + * integer to assemble into a single "big integer" value supported by Stellar + * (64, 128, or 256 bit values), where the later values represent higher bits + * of the final integer + * + * @param {object} [opts] - an object holding optional options for parsing + * @param {Boolean} [opts.unsigned] - whether or not the input should be + * treated as unsigned (default: false) + * @param {string} [opts.type] - force a specific data type, rather than + * relying on the input length to determine bit width. options are: i64, u64, + * i128, u128, i256, and u256 (default: determined by `parts.length`) + * + * @throws {RangeError} if the number of parts is too large (i.e. exceeds a + * 256-bit value), too small (i.e. a basic integer that doesn't need to be + * "large"), doesn't fit in the `opts.type`, or doesn't have an appropriate + * XDR type (e.g. 48 bits) + * + * @throws {TypeError} if the "signedness" of `opts` doesn't match the input + * value, e.g. passing `{unsigned: true}` yet including negative parts in the + * input + */ +export class BigInteger { + _value; // child class of a jsXdr.LargeInt + + /** + * Transforms an opaque {@link xdr.ScVal} into a {@link BigInteger}, if + * possible. To get the underlying native BigInt value, call {@link + * BigInteger.toBigInt} on the return value. + * + * @throws {TypeError} if the input value doesn't represent an integer. + */ + static fromScVal(scv) { + switch (scv.switch()) { + case 'scvU32': + case 'scvI32': + // FIXME: Should we handle 32-bit values, or is that not our job? + throw TypeError("FIXME"); + + case 'scvU64': + case 'scvI64': + case 'scvU128': + case 'scvI128': + case 'scvU256': + case 'scvI256': + return new BigInteger(scv.value().slice()); + + default: + throw TypeError(`expected integer type, got ${scv.switch()}`); + } + + return 0n; + } + + constructor(parts, opts = {}) { + parts = parts.map((i) => BigInt(i)); // normalize + const hasSignedParts = parts.some((i) => i < 0n); + const unsigned = opts.unsigned ?? !hasSignedParts; + const iType = opts.type ?? ''; + + if (unsigned && hasSignedParts) { + throw TypeError(`specified 'unsigned' yet has negative values: ${parts}`); + } + + if (iType.startsWith('u') && hasSignedParts) { + throw TypeError( + `specified unsigned type ${opts.type} yet has negative values: ${parts}` + ); + } + + switch (iType) { + case '': + break; + case 'i64': + this._value = new Hyper(parts); + break; + case 'i128': + this._value = new I128(parts); + break; + case 'i256': + this._value = new I256(parts); + break; + case 'u64': + this._value = new UnsignedHyper(parts); + break; + case 'u128': + this._value = new U128(parts); + break; + case 'u256': + this._value = new U256(parts); + break; + default: + throw TypeError(`invalid type: ${parts.type}`); + } + + switch (parts.length) { + case 2: // 64 bits + this._value = unsigned ? new UnsignedHyper(parts) : new Hyper(parts); + break; + + case 4: // 128 bits + this._value = unsigned ? new U128(parts) : new I128(parts); + break; + + case 8: // 256 bits + this._value = unsigned ? new U256(parts) : new I256(parts); + break; + + default: + throw RangeError(`${parts}`); + } + } + + /** + * @returns {Number} + * @throws {RangeError} if the value can't fit into a Number + */ + toNumber() { + const bi = this._value.toBigInt(); + if (bi > Number.MAX_SAFE_INTEGER || bi > Number.MIN_SAFE_INTEGER) { + throw RangeError(`value ${bi} is not in Number range`); + } + + return Number(bi); + } + + /** + * @returns {BigInt} + */ + toBigInt() { + return this._value.toBigInt(); + } + + toI64() { + this._sizeCheck(64); + } + + toU64() { + this._sizeCheck(64); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = I128` + * @throws {RangeError} if the value cannot fit in 128 bits + */ + toI128() { + this._sizeCheck(128); + + const v = this._value.toBigInt(); + const hi64 = v >> 64n; + const lo64 = v & MAX_64; + + return xdr.ScVal.scvI128( + new xdr.Int128Parts({ + hi: new xdr.Int64(hi64), + lo: new xdr.Uint64(lo64) + }) + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = U128` + * @throws {RangeError} if the value cannot fit in 128 bits + */ + toU128() { + this._sizeCheck(128); + + const v = this._value.toBigInt(); + const hi64 = v >> 64n; + const lo64 = v & MAX_64; + + return xdr.ScVal.scvU128( + new xdr.UInt128Parts({ + hi: xdr.UInt64(hi64), + lo: xdr.Uint64(lo64) + }) + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = I256` + * @throws {RangeError} if the value cannot fit in 256 bits + */ + toI256() { + this._sizeCheck(256); + + const v = this._value.toBigInt(); + const hi128 = v >> 128n; + const lo128 = v & MAX_128; + + // TODO + return; + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = U256` + * @throws {RangeError} if the value cannot fit in 256 bits + */ + toU256() { + this._sizeCheck(256); + + const v = this._value.toBigInt(); + const hi128 = v >>> 128n; + const lo128 = v & MAX_128; + + // TODO + return; + } + + _sizeCheck(bits) { + if (this._value.size > bits) { + throw RangeError(`value too large for ${bits} bits (${this._value})`); + } + } +} diff --git a/src/numbers/i128.js b/src/numbers/i128.js index 7a5713ef..69800d57 100644 --- a/src/numbers/i128.js +++ b/src/numbers/i128.js @@ -1,4 +1,4 @@ -import { LargeInt } from './large-int'; +import { LargeInt } from 'js-xdr'; export class I128 extends LargeInt { constructor(...args) { diff --git a/src/numbers/i256.js b/src/numbers/i256.js index 959aa3ab..81af5d13 100644 --- a/src/numbers/i256.js +++ b/src/numbers/i256.js @@ -1,4 +1,4 @@ -import { LargeInt } from './large-int'; +import { LargeInt } from 'js-xdr'; export class I256 extends LargeInt { constructor(...args) { diff --git a/src/numbers/u128.js b/src/numbers/u128.js index 3804a634..eb5825c1 100644 --- a/src/numbers/u128.js +++ b/src/numbers/u128.js @@ -1,4 +1,4 @@ -import { LargeInt } from './large-int'; +import { LargeInt } from 'js-xdr'; export class U128 extends LargeInt { constructor(...args) { diff --git a/src/numbers/u256.js b/src/numbers/u256.js index 1bab5430..b4f9b54d 100644 --- a/src/numbers/u256.js +++ b/src/numbers/u256.js @@ -1,4 +1,4 @@ -import { LargeInt } from './large-int'; +import { LargeInt } from 'js-xdr'; export class U256 extends LargeInt { constructor(...args) { diff --git a/src/operations/invoke_host_function.js b/src/operations/invoke_host_function.js index 71a6ab22..994f3089 100644 --- a/src/operations/invoke_host_function.js +++ b/src/operations/invoke_host_function.js @@ -22,7 +22,10 @@ export function invokeHostFunction(opts) { ); } - const hostFn = new xdr.HostFunction({args: opts.args, auth: opts.auth || []}); + const hostFn = new xdr.HostFunction({ + args: opts.args, + auth: opts.auth || [] + }); return this.invokeHostFunctions({ source: opts.source, functions: [hostFn] }); } @@ -34,17 +37,17 @@ export function invokeHostFunction(opts) { * * @param {object} opts - options for the operation * @param {xdr.HostFunction[]} opts.functions - a list of contract functions to - * invoke in this operation. + * invoke in this operation. * @param {string} [opts.source] - an optional source account * * @returns {xdr.Operation} an Invoke Host Function operation * (xdr.InvokeHostFunctionOp) with xdr.HostFunction instances corresponding * to each invocation - * */ export function invokeHostFunctions(opts) { - - const invokeHostFunctionOp = new xdr.InvokeHostFunctionOp({ functions: opts.functions }); + const invokeHostFunctionOp = new xdr.InvokeHostFunctionOp({ + functions: opts.functions + }); const opAttributes = { body: xdr.OperationBody.invokeHostFunction(invokeHostFunctionOp) }; diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 51d5894c..c923dd45 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -110,12 +110,12 @@ export const TimeoutInfinite = 0; * @param {string} [opts.networkPassphrase] passphrase of the * target Stellar network (e.g. "Public Global Stellar Network ; September * 2015" for the pubnet) - * @param {xdr.SorobanTransactionData | string} [opts.sorobanData] - an optional xdr instance of SorobanTransactionData + * @param {xdr.SorobanTransactionData | string} [opts.sorobanData] - an optional xdr instance of SorobanTransactionData * to be set as .Transaction.Ext.SorobanData. It can be xdr object or base64 string. - * For non-contract(non-Soroban) transactions, this has no effect. - * In the case of Soroban transactions, SorobanTransactionData can be obtained from a prior simulation of - * the transaction with a contract invocation and provides necessary resource estimations. - * + * For non-contract(non-Soroban) transactions, this has no effect. + * In the case of Soroban transactions, SorobanTransactionData can be obtained from a prior simulation of + * the transaction with a contract invocation and provides necessary resource estimations. + * */ export class TransactionBuilder { constructor(sourceAccount, opts = {}) { @@ -445,19 +445,19 @@ export class TransactionBuilder { return this; } - /** - * Set the {SorobanTransactionData}. For non-contract(non-Soroban) transactions, - * this setting has no effect. - * In the case of Soroban transactions, set to an instance of - * SorobanTransactionData. This can typically be obtained from the simulation - * response based on a transaction with a InvokeHostFunctionOp. - * It provides necessary resource estimations for contract invocation. - * - * @param {xdr.SorobanTransactionData | string} sorobanData the SorobanTransactionData as xdr object or base64 string - * to be set as Transaction.Ext.SorobanData. - * - * @returns {TransactionBuilder} - */ + /** + * Set the {SorobanTransactionData}. For non-contract(non-Soroban) transactions, + * this setting has no effect. + * In the case of Soroban transactions, set to an instance of + * SorobanTransactionData. This can typically be obtained from the simulation + * response based on a transaction with a InvokeHostFunctionOp. + * It provides necessary resource estimations for contract invocation. + * + * @param {xdr.SorobanTransactionData | string} sorobanData the SorobanTransactionData as xdr object or base64 string + * to be set as Transaction.Ext.SorobanData. + * + * @returns {TransactionBuilder} + */ setSorobanData(sorobanData) { this.sorobanData = unmarshalSorobanData(sorobanData); return this; @@ -542,8 +542,7 @@ export class TransactionBuilder { } attrs.sourceAccount = decodeAddressToMuxedAccount(this.source.accountId()); - - + // TODO - remove this workaround for TransactionExt ts constructor // and use the typescript generated static factory method once fixed // https://github.com/stellar/dts-xdr/issues/5 @@ -713,15 +712,15 @@ export function isValidDate(d) { } /** - * local helper function to convert SorobanTransactionData from + * local helper function to convert SorobanTransactionData from * base64 string or xdr object. * @param {string | xdr.SorobanTransactionData} sorobanData the soroban transaction data * @returns {xdr.SorobanTransactionData} */ function unmarshalSorobanData(sorobanData) { - if (typeof sorobanData === 'string') { - const buffer = Buffer.from(sorobanData, 'base64'); - sorobanData = xdr.SorobanTransactionData.fromXDR(buffer); - } - return sorobanData; + if (typeof sorobanData === 'string') { + const buffer = Buffer.from(sorobanData, 'base64'); + sorobanData = xdr.SorobanTransactionData.fromXDR(buffer); } + return sorobanData; +} diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js new file mode 100644 index 00000000..40ee043c --- /dev/null +++ b/test/unit/i256_test.js @@ -0,0 +1,130 @@ +describe('creating large integers', function () { + it('64 bits', function () { + const b = new StellarBase.BigInteger([1234n, -5678n]); + const expected = -(5678n << 32n) | 1234n; + + expect(b.toBigInt()).to.eql(expected); + expect(b.toI128().i128().lo()).to.eql(expected); + expect(b.toI128().i128().hi().toBigInt()).to.eql(0n); + + console.log(b.toU128()); + console.log(b.toU128().i128()); + + expect(b.toU128().u128().lo()).to.eql(-expected); + expect(b.toU128().u128().hi()).to.eql(0n); + }); + + it('128 bits', function () { + const b = new StellarBase.BigInteger([1234n, 5678n, 9012n, 3456n]); + expect(b.toBigInt()).to.eql( + (3456n << 96n) | (9012n << 64n) | (5678n << 32n) | 1234n + ); + }); + + describe('error handling', function () { + it('throws when signed parts and {unsigned: true}', function () { + expect( + () => new StellarBase.BigInteger([-1234n, 5678n], { unsigned: true }) + ).to.throw(/unsigned/i); + }); + + ['u64', 'u128', 'u256'].forEach((type) => { + it(`throws when signed parts and {type: '${type}'>}`, function () { + expect( + () => new StellarBase.BigInteger([-1234n, 5678n], { type }) + ).to.throw(/unsigned/i); + }); + }); + + it('throws when too many parts', function () { + expect(() => new StellarBase.BigInteger(new Array(8).fill(42n))); + }); + + it('throws when interpreting as a small value', function () { + const big = new StellarBase.BigInteger([1234n, 5678n]); + expect(() => big.toNumber()).to.throw(/range/i); + }); + + it('throws when there are inconsistent negative parts', function () { + expect(() => new StellarBase.BigInteger([1n, 2n, -3n, -4n, 5n])).to.throw( + /signed/i + ); + }); + }); +}); + +// import { XdrWriter, XdrReader } from 'js-xdr'; + +// let I256 = StellarBase.xdr.I256; + +// describe('I256.read', function () { +// it('decodes correctly', function () { +// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(0)); +// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])).to.eql(new I256(1)); +// expect(read([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(-1)); +// expect(read([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(I256.MAX_VALUE)); +// expect(read([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(I256.MIN_VALUE)); +// }); + +// function read(bytes) { +// let io = new XdrReader(bytes); +// return I256.read(io); +// } +// }); + +// describe('I256.write', function () { +// it('encodes correctly', function () { +// expect(write(new I256(0))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); +// expect(write(new I256(1))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]); +// expect(write(new I256(-1))).to.eql([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); +// expect(write(I256.MAX_VALUE)).to.eql([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); +// expect(write(I256.MIN_VALUE)).to.eql([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); +// }); + +// function write(value) { +// let io = new XdrWriter(8); +// I256.write(value, io); +// return io.toArray(); +// } +// }); + +// describe('I256.isValid', function () { +// it('returns true for I256 instances', function () { +// expect(I256.isValid(I256.MIN_VALUE)).to.be.true; +// expect(I256.isValid(I256.MAX_VALUE)).to.be.true; +// expect(I256.isValid(I256.fromString('0'))).to.be.true; +// expect(I256.isValid(I256.fromString('-1'))).to.be.true; +// expect(I256.isValid(5n)).to.be.true; +// }); + +// it('returns false for non I256', function () { +// expect(I256.isValid(null)).to.be.false; +// expect(I256.isValid(undefined)).to.be.false; +// expect(I256.isValid([])).to.be.false; +// expect(I256.isValid({})).to.be.false; +// expect(I256.isValid(1)).to.be.false; +// expect(I256.isValid(true)).to.be.false; +// }); +// }); + +// describe('I256.slice', function () { +// it('slices number to parts', function () { +// expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(32)).to.be.eql([1n, -2n, 3n, -4n, 5n, -6n, 7n, -8n]); +// expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(64)).to.be.eql([-0x1FFFFFFFFn, -0x3FFFFFFFDn, -0x5FFFFFFFBn, -0x7FFFFFFF9n]); +// expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(128)).to.be.eql([-0x3fffffffc00000001ffffffffn, -0x7fffffff800000005fffffffbn]); +// }); +// }); + +// describe('I256.fromString', function () { +// it('works for positive numbers', function () { +// expect(I256.fromString('1059').toString()).to.eql('1059'); +// }); + +// it('works for negative numbers', function () { +// expect(I256.fromString('-105909234885029834059234850234985028304085').toString()).to.eql('-105909234885029834059234850234985028304085'); +// }); + +// it('fails when providing a string with a decimal place', function () { +// expect(() => I256.fromString('105946095601.5')).to.throw(/Invalid/); +// }); +// }); diff --git a/yarn.lock b/yarn.lock index 332ca4b1..bfddd069 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4350,9 +4350,9 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -"js-xdr@git+https://github.com/stellar/js-xdr#5749f38": - version "2.0.0" - resolved "git+https://github.com/stellar/js-xdr#5749f3878512b474c232548c090e5ae5636ae379" +"js-xdr@git+https://github.com/stellar/js-xdr#a3eb0e6": + version "3.0.0" + resolved "git+https://github.com/stellar/js-xdr#a3eb0e6f2edd2ffe8099290978045a585b28066b" js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" From f4e9609de87293569512bd5fdf027daf4bb4ad11 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 1 Jun 2023 15:16:58 -0700 Subject: [PATCH 03/34] Clean up interface and add examples --- src/numbers/generic.js | 167 ++++++++++++++++++-------- test/unit/contract_test.js | 40 +++++- test/unit/i256_test.js | 96 ++++++++++----- test/unit/operation_test.js | 39 +++--- test/unit/transaction_builder_test.js | 53 ++++---- 5 files changed, 262 insertions(+), 133 deletions(-) diff --git a/src/numbers/generic.js b/src/numbers/generic.js index 2173841d..990f8607 100644 --- a/src/numbers/generic.js +++ b/src/numbers/generic.js @@ -16,17 +16,52 @@ const MAX_128 = (1n << 28n) - 1n; /** * Provides an easier way to manipulate large numbers for Stellar operations. * - * @param {Array} parts - an arbitrary set of pieces of an - * integer to assemble into a single "big integer" value supported by Stellar - * (64, 128, or 256 bit values), where the later values represent higher bits - * of the final integer + * @example + * ```js + * import * as sdk from "stellar-base"; + * + * // You have an ScVal from a contract and want to parse it into JS native. + * const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64"); + * let bigi = sdk.BigInteger.fromScVal(value); + * + * // You have a number and want to shove it into a contract. + * bigi = sdk.BigInteger([1234, 5678, 9012, 3456]); + * bigi.toBigInt() // returns (3456 << 96) | (9012 << 64) | + * bigi.toNumber() // will throw: too large + * + * // Pass any to e.g. a Contract.call(), conversion happens automatically. + * const scValU128 = bigi.toU128(); + * const scValI256 = bigi.toI256(); + * const scValU64 = bigi.toU64(); + * + * // Lots of ways to initialize: + * sdk.BigInteger("123456789123456789") + * sdk.BigInteger(123456789123456789n) + * sdk.BigInteger(["1234", "5678"]) + * sdk.BigInteger([1234, "5678", 9012n, -1]) + * + * // If you are confident in what you're doing and want to access `.raw` + * // directly (which is faster than conversions), you can specify the type + * // (otherwise, it's interpreted from the numbers you pass in): + * const i = sdk.BigInteger([1234, 5678, 9012, 3456], {type: "u256"}) + * + * i.raw // an sdk.U256, which can be converted to an ScVal directly + * i.raw.toScVal() // an xdr.ScVal with ScValType = "scvU256" + * ``` + * + * @param {Number|BigInt|String|Array} parts - either a + * single integer-like value, or an arbitrary set of "pieces" of an integer + * to assemble into a single "big integer" value supported by Stellar (64, + * 128, or 256 bit values), where the later values represent higher bits of + * the final integer. to use signed values, either pass a signed type to + * `opts.type`, or pass a negative value in ONLY as the last "piece" (to + * represent the top bits) * * @param {object} [opts] - an object holding optional options for parsing - * @param {Boolean} [opts.unsigned] - whether or not the input should be - * treated as unsigned (default: false) * @param {string} [opts.type] - force a specific data type, rather than * relying on the input length to determine bit width. options are: i64, u64, - * i128, u128, i256, and u256 (default: determined by `parts.length`) + * i128, u128, i256, and u256 (default: determined by the largest element of + * `parts` and the slice's length) * * @throws {RangeError} if the number of parts is too large (i.e. exceeds a * 256-bit value), too small (i.e. a basic integer that doesn't need to be @@ -34,11 +69,12 @@ const MAX_128 = (1n << 28n) - 1n; * XDR type (e.g. 48 bits) * * @throws {TypeError} if the "signedness" of `opts` doesn't match the input - * value, e.g. passing `{unsigned: true}` yet including negative parts in the + * value, e.g. passing `{type: 'u64'}` yet including negative parts in the * input */ export class BigInteger { - _value; // child class of a jsXdr.LargeInt + raw; // child class of a jsXdr.LargeInt + type; // string, one of i64, u64, i128, u128, i256, or u256 /** * Transforms an opaque {@link xdr.ScVal} into a {@link BigInteger}, if @@ -52,7 +88,7 @@ export class BigInteger { case 'scvU32': case 'scvI32': // FIXME: Should we handle 32-bit values, or is that not our job? - throw TypeError("FIXME"); + throw TypeError('FIXME'); case 'scvU64': case 'scvI64': @@ -65,67 +101,80 @@ export class BigInteger { default: throw TypeError(`expected integer type, got ${scv.switch()}`); } - - return 0n; } constructor(parts, opts = {}) { + // allow a single, non-array input parameter + if (!(parts instanceof Array)) { + parts = [parts]; + } + parts = parts.map((i) => BigInt(i)); // normalize const hasSignedParts = parts.some((i) => i < 0n); - const unsigned = opts.unsigned ?? !hasSignedParts; - const iType = opts.type ?? ''; + let iType = opts.type ?? ''; - if (unsigned && hasSignedParts) { - throw TypeError(`specified 'unsigned' yet has negative values: ${parts}`); + if (hasSignedParts && parts[parts.length - 1] > 0) { + throw TypeError(`only last chunk must be negative, got ${parts}`); } if (iType.startsWith('u') && hasSignedParts) { throw TypeError( - `specified unsigned type ${opts.type} yet has negative values: ${parts}` + `specified type ${opts.type} yet provided negative values: ${parts}` ); } + // If unspecified, we make a best guess at the type based on: + // + // - the bit length of each element in the slice + // - the number of elements in the slice + // + // the equation is: + // + // len(slice) * max(dwordSize(elem) for elem in slice) + // + // and this must be one of 64, 128, or 256 bits. + if (iType === '') { + iType = !hasSignedParts ? 'u' : 'i'; + const bitlen = parts.length * Math.max(...parts.map(nearestInt)); + + switch (bitlen) { + case 64: + case 128: + case 256: + iType += bitlen.toString(); + break; + + default: + throw RangeError( + `expected 64/128/256 bits for parts (${parts}), got ${bitlen}` + ); + } + } + switch (iType) { - case '': - break; case 'i64': - this._value = new Hyper(parts); + this.raw = new Hyper(parts); break; case 'i128': - this._value = new I128(parts); + this.raw = new I128(parts); break; case 'i256': - this._value = new I256(parts); + this.raw = new I256(parts); break; case 'u64': - this._value = new UnsignedHyper(parts); + this.raw = new UnsignedHyper(parts); break; case 'u128': - this._value = new U128(parts); + this.raw = new U128(parts); break; case 'u256': - this._value = new U256(parts); + this.raw = new U256(parts); break; default: throw TypeError(`invalid type: ${parts.type}`); } - switch (parts.length) { - case 2: // 64 bits - this._value = unsigned ? new UnsignedHyper(parts) : new Hyper(parts); - break; - - case 4: // 128 bits - this._value = unsigned ? new U128(parts) : new I128(parts); - break; - - case 8: // 256 bits - this._value = unsigned ? new U256(parts) : new I256(parts); - break; - - default: - throw RangeError(`${parts}`); - } + this.type = iType; } /** @@ -133,9 +182,9 @@ export class BigInteger { * @throws {RangeError} if the value can't fit into a Number */ toNumber() { - const bi = this._value.toBigInt(); + const bi = this.raw.toBigInt(); if (bi > Number.MAX_SAFE_INTEGER || bi > Number.MIN_SAFE_INTEGER) { - throw RangeError(`value ${bi} is not in Number range`); + throw RangeError(`value ${bi} too large for Number`); } return Number(bi); @@ -145,7 +194,7 @@ export class BigInteger { * @returns {BigInt} */ toBigInt() { - return this._value.toBigInt(); + return this.raw.toBigInt(); } toI64() { @@ -163,9 +212,18 @@ export class BigInteger { toI128() { this._sizeCheck(128); - const v = this._value.toBigInt(); - const hi64 = v >> 64n; - const lo64 = v & MAX_64; + const v = this.raw.toBigInt(); + const neg = v < 0n; + let hi64 = 0n, lo64 = 0n; + + if (this.raw.size < 128 && neg) { + hi64 |= (1n << 63n); // set top (sign) bit + lo64 = v ^ hi64; // keep all but unset sign + console.log(hi64, v, lo64) + } else { + hi64 = v >> 64n; // grab only top 64 + lo64 = v & MAX_64; // grab btm 64 + } return xdr.ScVal.scvI128( new xdr.Int128Parts({ @@ -182,7 +240,7 @@ export class BigInteger { toU128() { this._sizeCheck(128); - const v = this._value.toBigInt(); + const v = this.raw.toBigInt(); const hi64 = v >> 64n; const lo64 = v & MAX_64; @@ -201,7 +259,7 @@ export class BigInteger { toI256() { this._sizeCheck(256); - const v = this._value.toBigInt(); + const v = this.raw.toBigInt(); const hi128 = v >> 128n; const lo128 = v & MAX_128; @@ -216,7 +274,7 @@ export class BigInteger { toU256() { this._sizeCheck(256); - const v = this._value.toBigInt(); + const v = this.raw.toBigInt(); const hi128 = v >>> 128n; const lo128 = v & MAX_128; @@ -225,8 +283,13 @@ export class BigInteger { } _sizeCheck(bits) { - if (this._value.size > bits) { - throw RangeError(`value too large for ${bits} bits (${this._value})`); + if (this.raw.size > bits) { + throw RangeError(`value too large for ${bits} bits (${this.type})`); } } } + +function nearestInt(bigI) { + const bitlen = bigI.toString(2).length - 1; + return [32, 64, 128, 256].find((len) => bitlen <= len) ?? bitlen; +} diff --git a/test/unit/contract_test.js b/test/unit/contract_test.js index 9d0d9eac..08f8d8c4 100644 --- a/test/unit/contract_test.js +++ b/test/unit/contract_test.js @@ -1,7 +1,8 @@ describe('Contract', function () { describe('constructor', function () { it('parses strkeys', function () { - let contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + let contractId = + 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; let contract = new StellarBase.Contract(contractId); expect(contract.contractId('strkey')).to.equal(contractId); }); @@ -14,7 +15,7 @@ describe('Contract', function () { it('parses throws on invalid ids', function () { expect(() => { - new StellarBase.Contract('foobar') + new StellarBase.Contract('foobar'); }).to.throw(); }); }); @@ -23,14 +24,15 @@ describe('Contract', function () { it('returns the contract address', function () { let contractId = '0'.repeat(63) + '1'; let contract = new StellarBase.Contract(contractId); - expect(contract.address().toBuffer().toString('hex')).to.equal(contractId); + expect(contract.address().toBuffer().toString('hex')).to.equal( + contractId + ); }); }); describe('getFootprint', function () { it('includes the correct contract code footprint', function () { let contractId = '0'.repeat(63) + '1'; - let contract = new StellarBase.Contract(contractId); expect(contract.contractId('hex')).to.equal(contractId); @@ -47,4 +49,34 @@ describe('Contract', function () { expect(fp.toXDR().toString('base64')).to.equal(expected); }); }); + + // describe('call', function() { + // it('should create an XDR operation', function() { + // const kp = StellarBase.Keypair.random(); + // const account = new StellarBase.Account(kp.publicKey(), "1"); + // const contractId = '0'.repeat(63) + '1'; + + // let contract = new StellarBase.Contract(contractId); + + // const callOp = contract.call("balance", ...[ + // new StellarBase.Address(kp.publicKey()).toScVal() + // ]); + // console.log(callOp); + // console.log(callOp.toXDR()); + + // let builder = new StellarBase.TransactionBuilder(account, { + // fee: "1000", + // timebounds: { minTime: 0, maxTime: 0 }, + // networkPassphrase: StellarBase.Networks.FUTURENET, + // }); + + // const txXdr = builder.addOperation(callOp).build(); + // const txB64 = txXdr.toXDR(); + // console.log(txB64); + + // const txRt = StellarBase.TransactionBuilder.fromXDR(txB64, + // StellarBase.Networks.FUTURENET); + // console.log(txRt); + // }); + // }); }); diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js index 40ee043c..c28d771a 100644 --- a/test/unit/i256_test.js +++ b/test/unit/i256_test.js @@ -1,53 +1,87 @@ +import { BigInteger } from '../../src/numbers/generic'; + describe('creating large integers', function () { - it('64 bits', function () { - const b = new StellarBase.BigInteger([1234n, -5678n]); - const expected = -(5678n << 32n) | 1234n; + describe('picks the right types', function () { + [ + [[1, 1], 'u64'], + [[1, -1], 'i64'], + [[1, 1, 1, 1], 'u128'], + [[1, 1, 1, -1], 'i128'], + [[1, 1, 1, 1, 1, 1, 1, -1], 'i256'], + [[1, 1, 1, 1, 1, 1, 1, 1], 'u256'], + [[1n << 65n], 'u128'], + [[-(1n << 65n)], 'i128'], + [[1n << 65n, 1n << 65n], 'u256'], + [[1n << 129n], 'u256'], + [[-(1n << 129n)], 'i256'], + [new Array(8).fill(-1), 'i256'], + [new Array(8).fill(1), 'u256'], + ].forEach(([parts, type]) => { + it(`picks ${type} for ${parts}`, function () { + expect(new BigInteger(parts).type).to.equal(type); + }); + }); + }); - expect(b.toBigInt()).to.eql(expected); - expect(b.toI128().i128().lo()).to.eql(expected); - expect(b.toI128().i128().hi().toBigInt()).to.eql(0n); + it('handles 64 bits', function () { + const b = new StellarBase.BigInteger([1, -2]); + const expected = -(2n << 32n) | 1n; - console.log(b.toU128()); - console.log(b.toU128().i128()); + expect(b.toBigInt()).to.eql(expected); - expect(b.toU128().u128().lo()).to.eql(-expected); - expect(b.toU128().u128().hi()).to.eql(0n); - }); + const i128 = b.toI128().i128(); + console.log(i128.lo()) + expect(i128.lo().toBigInt()).to.equal(expected); + expect(i128.hi().toBigInt()).to.equal(0n); - it('128 bits', function () { - const b = new StellarBase.BigInteger([1234n, 5678n, 9012n, 3456n]); - expect(b.toBigInt()).to.eql( - (3456n << 96n) | (9012n << 64n) | (5678n << 32n) | 1234n - ); + const u128 = b.toU128().u128(); + expect(u128.hi().toBigInt()).to.equal(0n); + expect(u128.lo().toBigInt()).to.equal(-expected); }); describe('error handling', function () { - it('throws when signed parts and {unsigned: true}', function () { - expect( - () => new StellarBase.BigInteger([-1234n, 5678n], { unsigned: true }) - ).to.throw(/unsigned/i); - }); - ['u64', 'u128', 'u256'].forEach((type) => { - it(`throws when signed parts and {type: '${type}'>}`, function () { + it(`throws when signed parts and {type: '${type}'}`, function () { + expect( + () => new StellarBase.BigInteger([1n, -2n], { type }) + ).to.throw(/negative/i); expect( - () => new StellarBase.BigInteger([-1234n, 5678n], { type }) - ).to.throw(/unsigned/i); + () => new StellarBase.BigInteger([-1n, -2n], { type }) + ).to.throw(/negative/i); }); }); it('throws when too many parts', function () { - expect(() => new StellarBase.BigInteger(new Array(8).fill(42n))); + expect(() => new StellarBase.BigInteger(new Array(9).fill(42n))).to.throw( + /expected/i + ); }); - it('throws when interpreting as a small value', function () { - const big = new StellarBase.BigInteger([1234n, 5678n]); - expect(() => big.toNumber()).to.throw(/range/i); + it('throws when big interpreted as small', function () { + let big; + + big = new StellarBase.BigInteger([1, 2]); + expect(() => big.toNumber()).to.throw(/too large/i); + + big = new StellarBase.BigInteger([1n << 33n]); + expect(() => big.toNumber()).to.throw(/too large/i); + + big = new StellarBase.BigInteger([1], { type: 'i128' }); + expect(() => big.toNumber()).to.throw(/too large/i); + expect(() => big.toU64()).to.throw(/too large/i); + expect(() => big.toI64()).to.throw(/too large/i); + + big = new StellarBase.BigInteger([1], { type: 'i256' }); + expect(() => big.toNumber()).to.throw(/too large/i); + expect(() => big.toU64()).to.throw(/too large/i); + expect(() => big.toI64()).to.throw(/too large/i); + expect(() => big.toI128()).to.throw(/too large/i); + expect(() => big.toU128()).to.throw(/too large/i); }); it('throws when there are inconsistent negative parts', function () { - expect(() => new StellarBase.BigInteger([1n, 2n, -3n, -4n, 5n])).to.throw( - /signed/i + expect(() => new StellarBase.BigInteger([1n, -3n, -4n, 5n])).to.throw( + /negative/i ); }); }); diff --git a/test/unit/operation_test.js b/test/unit/operation_test.js index aa8fd10f..e7460e2d 100644 --- a/test/unit/operation_test.js +++ b/test/unit/operation_test.js @@ -2021,13 +2021,15 @@ describe('Operation', function () { describe('invokeHostFunction()', function () { it('creates single invokeHostFunction', function () { - const op = StellarBase.Operation.invokeHostFunction({ - args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract([]), - auth: [] + const op = StellarBase.Operation.invokeHostFunction({ + args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract( + [] + ), + auth: [] }); var xdr = op.toXDR('hex'); var operation = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); - + expect(operation.body().switch().name).to.equal('invokeHostFunction'); var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('invokeHostFunction'); @@ -2035,28 +2037,31 @@ describe('Operation', function () { }); it('throws when single invokeHostFunction and no args passed', function () { expect(() => - StellarBase.Operation.invokeHostFunction({ + StellarBase.Operation.invokeHostFunction({ auth: [] - })).to.throw(/function arguments \('args'\) required/); + }) + ).to.throw(/function arguments \('args'\) required/); }); it('creates multiple invokeHostFunctions', function () { const op = StellarBase.Operation.invokeHostFunctions({ functions: [ - new StellarBase.xdr.HostFunction( - { - args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract([]), - auth: [] - }), - new StellarBase.xdr.HostFunction( - { - args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract([]), - auth: [] - }) + new StellarBase.xdr.HostFunction({ + args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract( + [] + ), + auth: [] + }), + new StellarBase.xdr.HostFunction({ + args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract( + [] + ), + auth: [] + }) ] }); var xdr = op.toXDR('hex'); var operation = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); - + expect(operation.body().switch().name).to.equal('invokeHostFunction'); var obj = StellarBase.Operation.fromXDRObject(operation); expect(obj.type).to.be.equal('invokeHostFunction'); diff --git a/test/unit/transaction_builder_test.js b/test/unit/transaction_builder_test.js index a67ed14a..8c537bc7 100644 --- a/test/unit/transaction_builder_test.js +++ b/test/unit/transaction_builder_test.js @@ -75,15 +75,15 @@ describe('TransactionBuilder', function () { resources: new StellarBase.xdr.SorobanResources({ footprint: new StellarBase.xdr.LedgerFootprint({ readOnly: [], - readWrite: [], + readWrite: [] }), instructions: 0, readBytes: 5, writeBytes: 0, - extendedMetaDataSizeBytes: 0, + extendedMetaDataSizeBytes: 0 }), - refundableFee: StellarBase.xdr.Int64.fromString("1"), - ext: new StellarBase.xdr.ExtensionPoint(0), + refundableFee: StellarBase.xdr.Int64.fromString('1'), + ext: new StellarBase.xdr.ExtensionPoint(0) }); }); @@ -93,8 +93,10 @@ describe('TransactionBuilder', function () { networkPassphrase: StellarBase.Networks.TESTNET }) .addOperation( - StellarBase.Operation.invokeHostFunction({ - args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract([]), + StellarBase.Operation.invokeHostFunction({ + args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract( + [] + ), auth: [] }) ) @@ -102,12 +104,9 @@ describe('TransactionBuilder', function () { .setTimeout(StellarBase.TimeoutInfinite) .build(); - expect(transaction - .toEnvelope() - .v1() - .tx() - .ext() - .sorobanData()).to.deep.equal(sorobanTransactionData); + expect( + transaction.toEnvelope().v1().tx().ext().sorobanData() + ).to.deep.equal(sorobanTransactionData); done(); }); it('should set the soroban data from xdr string', function (done) { @@ -116,21 +115,20 @@ describe('TransactionBuilder', function () { networkPassphrase: StellarBase.Networks.TESTNET }) .addOperation( - StellarBase.Operation.invokeHostFunction({ - args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract([]), + StellarBase.Operation.invokeHostFunction({ + args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract( + [] + ), auth: [] }) ) - .setSorobanData(sorobanTransactionData.toXDR("base64")) + .setSorobanData(sorobanTransactionData.toXDR('base64')) .setTimeout(StellarBase.TimeoutInfinite) .build(); - expect(transaction - .toEnvelope() - .v1() - .tx() - .ext() - .sorobanData()).to.deep.equal(sorobanTransactionData); + expect( + transaction.toEnvelope().v1().tx().ext().sorobanData() + ).to.deep.equal(sorobanTransactionData); done(); }); it('should set the transaction Ext to default when soroban data present', function (done) { @@ -139,20 +137,17 @@ describe('TransactionBuilder', function () { networkPassphrase: StellarBase.Networks.TESTNET }) .addOperation( - StellarBase.Operation.invokeHostFunction({ - args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract([]), + StellarBase.Operation.invokeHostFunction({ + args: new StellarBase.xdr.HostFunctionArgs.hostFunctionTypeInvokeContract( + [] + ), auth: [] }) ) .setTimeout(StellarBase.TimeoutInfinite) .build(); - expect(transaction - .toEnvelope() - .v1() - .tx() - .ext() - .switch()).equal(0); + expect(transaction.toEnvelope().v1().tx().ext().switch()).equal(0); done(); }); }); From ad32f62a2b6df2367fa7e4e859d59dee18ebc679 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Fri, 2 Jun 2023 18:04:25 -0700 Subject: [PATCH 04/34] Simplify interface, add working i64 -> i128 upscale --- src/numbers/generic.js | 205 +++++++++++++++++++---------------------- test/unit/i256_test.js | 119 +++++++++++++++--------- 2 files changed, 169 insertions(+), 155 deletions(-) diff --git a/src/numbers/generic.js b/src/numbers/generic.js index 990f8607..187794db 100644 --- a/src/numbers/generic.js +++ b/src/numbers/generic.js @@ -8,14 +8,15 @@ import { U256 } from './u256'; import xdr from '../xdr'; -// const MAX_32 = (1n << 32) - 1; -const MAX_64 = (1n << 64n) - 1n; -const MAX_128 = (1n << 28n) - 1n; -// const MAX_256 = (1n << 56) - 1; +const MASK_64 = (1n << 64n) - 1n; /** * Provides an easier way to manipulate large numbers for Stellar operations. * + * You can instantiate this value either from bigints, strings, or numbers + * (whole numbers, or this will throw). Support for byte arrays may come in the + * future. + * * @example * ```js * import * as sdk from "stellar-base"; @@ -24,9 +25,13 @@ const MAX_128 = (1n << 28n) - 1n; * const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64"); * let bigi = sdk.BigInteger.fromScVal(value); * + * bigi.toNumber(); // gives native JS type (w/ size check) + * bigi.toBigInt(); // gives the native BigInt value + * bigi.toU64(); // gives ScValType-specific XDR constructs (with size checks) + * * // You have a number and want to shove it into a contract. - * bigi = sdk.BigInteger([1234, 5678, 9012, 3456]); - * bigi.toBigInt() // returns (3456 << 96) | (9012 << 64) | + * bigi = sdk.BigInteger(0xdeadcafebabe); + * bigi.toBigInt() // returns 244838016400062n * bigi.toNumber() // will throw: too large * * // Pass any to e.g. a Contract.call(), conversion happens automatically. @@ -36,59 +41,52 @@ const MAX_128 = (1n << 28n) - 1n; * * // Lots of ways to initialize: * sdk.BigInteger("123456789123456789") - * sdk.BigInteger(123456789123456789n) - * sdk.BigInteger(["1234", "5678"]) - * sdk.BigInteger([1234, "5678", 9012n, -1]) + * sdk.BigInteger(123456789123456789n); + * sdk.BigInteger(1n << 140n); + * sdk.BigInteger(-42); * * // If you are confident in what you're doing and want to access `.raw` * // directly (which is faster than conversions), you can specify the type * // (otherwise, it's interpreted from the numbers you pass in): - * const i = sdk.BigInteger([1234, 5678, 9012, 3456], {type: "u256"}) - * - * i.raw // an sdk.U256, which can be converted to an ScVal directly - * i.raw.toScVal() // an xdr.ScVal with ScValType = "scvU256" + * const i = sdk.BigInteger( + * 123456789123456789n, + * { type: "u256" } + * ); + * i.raw; // an sdk.U256, which can be converted to an ScVal directly + * i.raw.toScVal(); // an xdr.ScVal with ScValType = "scvU256" * ``` * - * @param {Number|BigInt|String|Array} parts - either a - * single integer-like value, or an arbitrary set of "pieces" of an integer - * to assemble into a single "big integer" value supported by Stellar (64, - * 128, or 256 bit values), where the later values represent higher bits of - * the final integer. to use signed values, either pass a signed type to - * `opts.type`, or pass a negative value in ONLY as the last "piece" (to - * represent the top bits) + * @param {Number|BigInt|String} value - a single, integer-like value which will + * be interpreted in the smallest appropriate XDR type supported by Stellar + * (32, 64, 128, or 256 bit integer values). signed values are supported, + * though they are sanity-checked against `opts.type` * * @param {object} [opts] - an object holding optional options for parsing - * @param {string} [opts.type] - force a specific data type, rather than - * relying on the input length to determine bit width. options are: i64, u64, - * i128, u128, i256, and u256 (default: determined by the largest element of - * `parts` and the slice's length) + * @param {string} [opts.type] - force a specific data type. options are: + * 'i32', u32', i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the + * smallest one that fits the `value`) * - * @throws {RangeError} if the number of parts is too large (i.e. exceeds a - * 256-bit value), too small (i.e. a basic integer that doesn't need to be - * "large"), doesn't fit in the `opts.type`, or doesn't have an appropriate - * XDR type (e.g. 48 bits) + * @throws {RangeError} if the `value` is invalid (e.g. floating point), too + * large (i.e. exceeds a 256-bit value), or doesn't fit in the `opts.type` * * @throws {TypeError} if the "signedness" of `opts` doesn't match the input - * value, e.g. passing `{type: 'u64'}` yet including negative parts in the - * input + * `value`, e.g. passing `{type: 'u64'}` yet passing -1n + * + * @throws {SyntaxError} if a string `value` can't be parsed as a big integer */ export class BigInteger { raw; // child class of a jsXdr.LargeInt type; // string, one of i64, u64, i128, u128, i256, or u256 /** - * Transforms an opaque {@link xdr.ScVal} into a {@link BigInteger}, if - * possible. To get the underlying native BigInt value, call {@link - * BigInteger.toBigInt} on the return value. - * - * @throws {TypeError} if the input value doesn't represent an integer. + * Transforms an opaque {@link xdr.ScVal} into a native BigInt, if possible. + * @throws {TypeError} if the input value doesn't represent an integer */ static fromScVal(scv) { switch (scv.switch()) { case 'scvU32': case 'scvI32': - // FIXME: Should we handle 32-bit values, or is that not our job? - throw TypeError('FIXME'); + return BigInt(scv.value()); case 'scvU64': case 'scvI64': @@ -96,46 +94,33 @@ export class BigInteger { case 'scvI128': case 'scvU256': case 'scvI256': - return new BigInteger(scv.value().slice()); + // FIXME: This isn't right, we need a "value to BigInteger" converter + // that breaks down the hiHi, loLo, etc. + return scv.value().toBigInt(); default: throw TypeError(`expected integer type, got ${scv.switch()}`); } } - constructor(parts, opts = {}) { - // allow a single, non-array input parameter - if (!(parts instanceof Array)) { - parts = [parts]; - } + static fromParts(...values) { + values.map(); + } - parts = parts.map((i) => BigInt(i)); // normalize - const hasSignedParts = parts.some((i) => i < 0n); + constructor(value, opts = {}) { + value = BigInt(value); // normalize + const signed = value < 0; let iType = opts.type ?? ''; - if (hasSignedParts && parts[parts.length - 1] > 0) { - throw TypeError(`only last chunk must be negative, got ${parts}`); - } - - if (iType.startsWith('u') && hasSignedParts) { - throw TypeError( - `specified type ${opts.type} yet provided negative values: ${parts}` - ); + if (iType.startsWith('u') && signed) { + throw TypeError(`specified type ${opts.type} yet negative (${value})`); } - // If unspecified, we make a best guess at the type based on: - // - // - the bit length of each element in the slice - // - the number of elements in the slice - // - // the equation is: - // - // len(slice) * max(dwordSize(elem) for elem in slice) - // - // and this must be one of 64, 128, or 256 bits. + // If unspecified, we make a best guess at the type based on the bit length + // of the value, treating 64 as a minimum and 256 as a maximum. if (iType === '') { - iType = !hasSignedParts ? 'u' : 'i'; - const bitlen = parts.length * Math.max(...parts.map(nearestInt)); + iType = signed ? 'i' : 'u'; + const bitlen = nearestBigIntSize(value); switch (bitlen) { case 64: @@ -146,32 +131,32 @@ export class BigInteger { default: throw RangeError( - `expected 64/128/256 bits for parts (${parts}), got ${bitlen}` + `expected 64/128/256 bits for parts (${value}), got ${bitlen}` ); } } switch (iType) { case 'i64': - this.raw = new Hyper(parts); + this.raw = new Hyper(value); break; case 'i128': - this.raw = new I128(parts); + this.raw = new I128(value); break; case 'i256': - this.raw = new I256(parts); + this.raw = new I256(value); break; case 'u64': - this.raw = new UnsignedHyper(parts); + this.raw = new UnsignedHyper(value); break; case 'u128': - this.raw = new U128(parts); + this.raw = new U128(value); break; case 'u256': - this.raw = new U256(parts); + this.raw = new U256(value); break; default: - throw TypeError(`invalid type: ${parts.type}`); + throw TypeError(`invalid type: ${iType}`); } this.type = iType; @@ -197,12 +182,20 @@ export class BigInteger { return this.raw.toBigInt(); } + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = I64` + */ toI64() { this._sizeCheck(64); + return xdr.ScVal.scvI64(new xdr.Int64(this.toBigInt())); } + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = U64` + */ toU64() { this._sizeCheck(64); + return xdr.ScVal.scvU64(new xdr.Uint64(this.toBigInt())); } /** @@ -213,17 +206,14 @@ export class BigInteger { this._sizeCheck(128); const v = this.raw.toBigInt(); - const neg = v < 0n; - let hi64 = 0n, lo64 = 0n; + let hi64 = 0n; - if (this.raw.size < 128 && neg) { - hi64 |= (1n << 63n); // set top (sign) bit - lo64 = v ^ hi64; // keep all but unset sign - console.log(hi64, v, lo64) + if (v < 0n && this.raw.size <= 64) { + hi64 = -1n; } else { - hi64 = v >> 64n; // grab only top 64 - lo64 = v & MAX_64; // grab btm 64 + hi64 = BigInt.asIntN(64, v >> 64n); } + const lo64 = BigInt.asUintN(64, v & MASK_64); // grab btm 64 return xdr.ScVal.scvI128( new xdr.Int128Parts({ @@ -239,17 +229,6 @@ export class BigInteger { */ toU128() { this._sizeCheck(128); - - const v = this.raw.toBigInt(); - const hi64 = v >> 64n; - const lo64 = v & MAX_64; - - return xdr.ScVal.scvU128( - new xdr.UInt128Parts({ - hi: xdr.UInt64(hi64), - lo: xdr.Uint64(lo64) - }) - ); } /** @@ -257,14 +236,20 @@ export class BigInteger { * @throws {RangeError} if the value cannot fit in 256 bits */ toI256() { - this._sizeCheck(256); - const v = this.raw.toBigInt(); - const hi128 = v >> 128n; - const lo128 = v & MAX_128; - - // TODO - return; + const hiHi64 = 0n; + const hiLo64 = 0n; + const loHi64 = 0n; + const loLo64 = 0n; + + return xdr.ScVal.scvI256( + new xdr.UInt256Parts({ + hiHi: new xdr.Int64(hiHi64), + hiLo: new xdr.Uint64(hiLo64), + loHi: new xdr.Uint64(loHi64), + loLo: new xdr.Uint64(loLo64) + }) + ); } /** @@ -273,13 +258,6 @@ export class BigInteger { */ toU256() { this._sizeCheck(256); - - const v = this.raw.toBigInt(); - const hi128 = v >>> 128n; - const lo128 = v & MAX_128; - - // TODO - return; } _sizeCheck(bits) { @@ -289,7 +267,16 @@ export class BigInteger { } } -function nearestInt(bigI) { - const bitlen = bigI.toString(2).length - 1; - return [32, 64, 128, 256].find((len) => bitlen <= len) ?? bitlen; +function nearestBigIntSize(bigI) { + // Note: Even though BigInt.toString(2) includes the negative sign for + // negative values (???), the following is still accurate, because the + // negative sign would be represented by a sign bit. + const bitlen = bigI.toString(2).length; + return [64, 128, 256].find((len) => bitlen <= len) ?? bitlen; } + +function makeMask(bits) { + return (1n << BigInt(bits)) - 1n; +} + +export { U128, I128, U256, I256 }; diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js index c28d771a..ccaac09e 100644 --- a/test/unit/i256_test.js +++ b/test/unit/i256_test.js @@ -1,58 +1,91 @@ import { BigInteger } from '../../src/numbers/generic'; +import { I128, U128 } from '../../src/numbers/generic'; describe('creating large integers', function () { describe('picks the right types', function () { - [ - [[1, 1], 'u64'], - [[1, -1], 'i64'], - [[1, 1, 1, 1], 'u128'], - [[1, 1, 1, -1], 'i128'], - [[1, 1, 1, 1, 1, 1, 1, -1], 'i256'], - [[1, 1, 1, 1, 1, 1, 1, 1], 'u256'], - [[1n << 65n], 'u128'], - [[-(1n << 65n)], 'i128'], - [[1n << 65n, 1n << 65n], 'u256'], - [[1n << 129n], 'u256'], - [[-(1n << 129n)], 'i256'], - [new Array(8).fill(-1), 'i256'], - [new Array(8).fill(1), 'u256'], - ].forEach(([parts, type]) => { - it(`picks ${type} for ${parts}`, function () { - expect(new BigInteger(parts).type).to.equal(type); + Object.entries({ + u64: [1, '1', 0xdeadbeef, (1n << 64n) - 1n], + u128: [1n << 64n, (1n << 128n) - 1n], + u256: [1n << 128n, (1n << 256n) - 1n] + }).forEach(([type, values]) => { + values.forEach((value) => { + it(`picks ${type} for ${value}`, function () { + const bi = new BigInteger(value); + expect(bi.type).to.equal(type); + expect(bi.toBigInt()).to.equal(BigInt(value)); + }); }); }); }); - it('handles 64 bits', function () { - const b = new StellarBase.BigInteger([1, -2]); - const expected = -(2n << 32n) | 1n; + describe('64 bit inputs', function () { + const sentinel = 85n; - expect(b.toBigInt()).to.eql(expected); + it('handles 64 bits', function () { + let b = new StellarBase.BigInteger(sentinel); + expect(b.toBigInt()).to.eql(sentinel); - const i128 = b.toI128().i128(); - console.log(i128.lo()) - expect(i128.lo().toBigInt()).to.equal(expected); - expect(i128.hi().toBigInt()).to.equal(0n); + b = new StellarBase.BigInteger(-sentinel); + expect(b.toBigInt()).to.eql(-sentinel); + }); + + it(`upscales + to 128`, function () { + const b = new StellarBase.BigInteger(sentinel); + const i128 = b.toI128().i128(); + expect(i128.lo().toBigInt()).to.equal(sentinel); + expect(i128.hi().toBigInt()).to.equal(0n); + }); + + it(`upscales - to 128`, function () { + const b = new StellarBase.BigInteger(-sentinel); + const i128 = b.toI128().i128(); + const hi = i128.hi().toBigInt(); + const lo = i128.lo().toBigInt(); + + const assembled = new I128([lo, hi]).toBigInt(); + expect(assembled).to.equal(-sentinel); + }); + + it(`upscales + to 256`, function () { + const b = new StellarBase.BigInteger(sentinel); + const i = b.toI256().i256(); + + const hiHi = i.hiHi().toBigInt(); + const hiLo = i.hiLo().toBigInt(); + const loHi = i.loHi().toBigInt(); + const loLo = i.loLo().toBigInt(); - const u128 = b.toU128().u128(); - expect(u128.hi().toBigInt()).to.equal(0n); - expect(u128.lo().toBigInt()).to.equal(-expected); + expect(hiHi).to.equal(0n); + expect(hiLo).to.equal(0n); + expect(loHi).to.equal(0n); + expect(loLo).to.equal(sentinel); + + const assembled = new I256([loLo, loHi, hiLo, hiHi]).toBigInt(); + expect(assembled).to.equal(sentinel); + }); + + it(`upscales - to 256`, function () { + const b = new StellarBase.BigInteger(-sentinel); + const i128 = b.toI128().i128(); + const hi = i128.hi().toBigInt(); + const lo = i128.lo().toBigInt(); + + const assembled = new I128([lo, hi]).toBigInt(); + expect(assembled).to.equal(-sentinel); + }); }); describe('error handling', function () { ['u64', 'u128', 'u256'].forEach((type) => { it(`throws when signed parts and {type: '${type}'}`, function () { - expect( - () => new StellarBase.BigInteger([1n, -2n], { type }) - ).to.throw(/negative/i); - expect( - () => new StellarBase.BigInteger([-1n, -2n], { type }) - ).to.throw(/negative/i); + expect(() => new StellarBase.BigInteger(-2, { type })).to.throw( + /negative/i + ); }); }); - it('throws when too many parts', function () { - expect(() => new StellarBase.BigInteger(new Array(9).fill(42n))).to.throw( + it('throws when too big', function () { + expect(() => new StellarBase.BigInteger(1n << 400n)).to.throw( /expected/i ); }); @@ -60,30 +93,24 @@ describe('creating large integers', function () { it('throws when big interpreted as small', function () { let big; - big = new StellarBase.BigInteger([1, 2]); + big = new StellarBase.BigInteger(1n << 64n); expect(() => big.toNumber()).to.throw(/too large/i); - big = new StellarBase.BigInteger([1n << 33n]); + big = new StellarBase.BigInteger(Number.MAX_SAFE_INTEGER + 1); expect(() => big.toNumber()).to.throw(/too large/i); - big = new StellarBase.BigInteger([1], { type: 'i128' }); + big = new StellarBase.BigInteger(1, { type: 'i128' }); expect(() => big.toNumber()).to.throw(/too large/i); expect(() => big.toU64()).to.throw(/too large/i); expect(() => big.toI64()).to.throw(/too large/i); - big = new StellarBase.BigInteger([1], { type: 'i256' }); + big = new StellarBase.BigInteger(1, { type: 'i256' }); expect(() => big.toNumber()).to.throw(/too large/i); expect(() => big.toU64()).to.throw(/too large/i); expect(() => big.toI64()).to.throw(/too large/i); expect(() => big.toI128()).to.throw(/too large/i); expect(() => big.toU128()).to.throw(/too large/i); }); - - it('throws when there are inconsistent negative parts', function () { - expect(() => new StellarBase.BigInteger([1n, -3n, -4n, 5n])).to.throw( - /negative/i - ); - }); }); }); From b1d8550af4aded53e99509b4a2ec8b7243a76656 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 13:42:57 -0700 Subject: [PATCH 05/34] Correctly upscale 64 -> 128, rename to ScInt --- config/.eslintrc.js | 3 +- src/index.js | 2 +- src/numbers/{generic.js => scint.js} | 80 +++++++++++++++-------- test/unit/{i256_test.js => scint_test.js} | 60 +++++++++-------- 4 files changed, 87 insertions(+), 58 deletions(-) rename src/numbers/{generic.js => scint.js} (77%) rename test/unit/{i256_test.js => scint_test.js} (83%) diff --git a/config/.eslintrc.js b/config/.eslintrc.js index c9bd0afc..1ed1e0a9 100644 --- a/config/.eslintrc.js +++ b/config/.eslintrc.js @@ -1,6 +1,7 @@ module.exports = { env: { - es6: true + es6: true, + es2020: true }, extends: ['airbnb-base', 'prettier'], plugins: ['@babel', 'prettier', 'prefer-import'], diff --git a/src/index.js b/src/index.js index d633c052..22c0b9f8 100644 --- a/src/index.js +++ b/src/index.js @@ -47,6 +47,6 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; -export { BigInteger } from './numbers/generic'; +export { ScInt } from './numbers/scint'; export default module.exports; diff --git a/src/numbers/generic.js b/src/numbers/scint.js similarity index 77% rename from src/numbers/generic.js rename to src/numbers/scint.js index 187794db..43dcc01d 100644 --- a/src/numbers/generic.js +++ b/src/numbers/scint.js @@ -8,8 +8,6 @@ import { U256 } from './u256'; import xdr from '../xdr'; -const MASK_64 = (1n << 64n) - 1n; - /** * Provides an easier way to manipulate large numbers for Stellar operations. * @@ -23,14 +21,14 @@ const MASK_64 = (1n << 64n) - 1n; * * // You have an ScVal from a contract and want to parse it into JS native. * const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64"); - * let bigi = sdk.BigInteger.fromScVal(value); + * let bigi = sdk.ScInt.fromScVal(value); * * bigi.toNumber(); // gives native JS type (w/ size check) * bigi.toBigInt(); // gives the native BigInt value * bigi.toU64(); // gives ScValType-specific XDR constructs (with size checks) * * // You have a number and want to shove it into a contract. - * bigi = sdk.BigInteger(0xdeadcafebabe); + * bigi = sdk.ScInt(0xdeadcafebabe); * bigi.toBigInt() // returns 244838016400062n * bigi.toNumber() // will throw: too large * @@ -40,15 +38,15 @@ const MASK_64 = (1n << 64n) - 1n; * const scValU64 = bigi.toU64(); * * // Lots of ways to initialize: - * sdk.BigInteger("123456789123456789") - * sdk.BigInteger(123456789123456789n); - * sdk.BigInteger(1n << 140n); - * sdk.BigInteger(-42); + * sdk.ScInt("123456789123456789") + * sdk.ScInt(123456789123456789n); + * sdk.ScInt(1n << 140n); + * sdk.ScInt(-42); * * // If you are confident in what you're doing and want to access `.raw` * // directly (which is faster than conversions), you can specify the type * // (otherwise, it's interpreted from the numbers you pass in): - * const i = sdk.BigInteger( + * const i = sdk.ScInt( * 123456789123456789n, * { type: "u256" } * ); @@ -56,10 +54,10 @@ const MASK_64 = (1n << 64n) - 1n; * i.raw.toScVal(); // an xdr.ScVal with ScValType = "scvU256" * ``` * - * @param {Number|BigInt|String} value - a single, integer-like value which will - * be interpreted in the smallest appropriate XDR type supported by Stellar - * (32, 64, 128, or 256 bit integer values). signed values are supported, - * though they are sanity-checked against `opts.type` + * @param {Number|BigInt|String|ScInt} value - a single, integer-like value + * which will be interpreted in the smallest appropriate XDR type supported + * by Stellar (32, 64, 128, or 256 bit integer values). signed values are + * supported, though they are sanity-checked against `opts.type` * * @param {object} [opts] - an object holding optional options for parsing * @param {string} [opts.type] - force a specific data type. options are: @@ -74,12 +72,15 @@ const MASK_64 = (1n << 64n) - 1n; * * @throws {SyntaxError} if a string `value` can't be parsed as a big integer */ -export class BigInteger { +export class ScInt { raw; // child class of a jsXdr.LargeInt type; // string, one of i64, u64, i128, u128, i256, or u256 /** * Transforms an opaque {@link xdr.ScVal} into a native BigInt, if possible. + * + * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer + * @returns {BigInt} the integer value, regardless of size (even 32-bit) * @throws {TypeError} if the input value doesn't represent an integer */ static fromScVal(scv) { @@ -94,9 +95,9 @@ export class BigInteger { case 'scvI128': case 'scvU256': case 'scvI256': - // FIXME: This isn't right, we need a "value to BigInteger" converter - // that breaks down the hiHi, loLo, etc. - return scv.value().toBigInt(); + return new ScInt(scv.value().toBigInt(), { + type: scv.switch().substr(3).toLowerCase() + }); default: throw TypeError(`expected integer type, got ${scv.switch()}`); @@ -104,10 +105,17 @@ export class BigInteger { } static fromParts(...values) { - values.map(); + let result = 0n; + values.forEach((v, _i) => { + result = (result << 32n) | v; + }); + return ScInt(result); } constructor(value, opts = {}) { + if (value instanceof ScInt) { + value = value.toBigInt(); + } value = BigInt(value); // normalize const signed = value < 0; let iType = opts.type ?? ''; @@ -168,7 +176,7 @@ export class BigInteger { */ toNumber() { const bi = this.raw.toBigInt(); - if (bi > Number.MAX_SAFE_INTEGER || bi > Number.MIN_SAFE_INTEGER) { + if (bi > Number.MAX_SAFE_INTEGER || bi < Number.MIN_SAFE_INTEGER) { throw RangeError(`value ${bi} too large for Number`); } @@ -187,7 +195,12 @@ export class BigInteger { */ toI64() { this._sizeCheck(64); - return xdr.ScVal.scvI64(new xdr.Int64(this.toBigInt())); + const v = this.toBigInt(); + if (BigInt.asIntN(64, v) !== v) { + throw RangeError(`value too large for i64: ${v}`); + } + + return xdr.ScVal.scvI64(new xdr.Int64(v)); } /** @@ -195,7 +208,9 @@ export class BigInteger { */ toU64() { this._sizeCheck(64); - return xdr.ScVal.scvU64(new xdr.Uint64(this.toBigInt())); + return xdr.ScVal.scvU64( + new xdr.Uint64(BigInt.asUintN(64, this.toBigInt())) // reiterpret as unsigned + ); } /** @@ -208,12 +223,14 @@ export class BigInteger { const v = this.raw.toBigInt(); let hi64 = 0n; + // special case: preserve the upper sign bits, since with a small value, we + // need to "manually" describe it as being negative if (v < 0n && this.raw.size <= 64) { hi64 = -1n; } else { - hi64 = BigInt.asIntN(64, v >> 64n); + hi64 = BigInt.asIntN(64, v >> 64n); // encode top 64 w/ sign bit } - const lo64 = BigInt.asUintN(64, v & MASK_64); // grab btm 64 + const lo64 = BigInt.asUintN(64, v); // grab btm 64 return xdr.ScVal.scvI128( new xdr.Int128Parts({ @@ -229,6 +246,17 @@ export class BigInteger { */ toU128() { this._sizeCheck(128); + + const v = this.raw.toBigInt(); + const hi64 = BigInt.asUintN(64, v >> 64n); + const lo64 = BigInt.asUintN(64, v); + + return xdr.ScVal.scvI128( + new xdr.Int128Parts({ + hi: new xdr.Int64(hi64), + lo: new xdr.Uint64(lo64) + }) + ); } /** @@ -240,7 +268,7 @@ export class BigInteger { const hiHi64 = 0n; const hiLo64 = 0n; const loHi64 = 0n; - const loLo64 = 0n; + const loLo64 = BigInt.asUintN(64, v); return xdr.ScVal.scvI256( new xdr.UInt256Parts({ @@ -275,8 +303,4 @@ function nearestBigIntSize(bigI) { return [64, 128, 256].find((len) => bitlen <= len) ?? bitlen; } -function makeMask(bits) { - return (1n << BigInt(bits)) - 1n; -} - export { U128, I128, U256, I256 }; diff --git a/test/unit/i256_test.js b/test/unit/scint_test.js similarity index 83% rename from test/unit/i256_test.js rename to test/unit/scint_test.js index ccaac09e..180859d3 100644 --- a/test/unit/i256_test.js +++ b/test/unit/scint_test.js @@ -1,5 +1,5 @@ -import { BigInteger } from '../../src/numbers/generic'; -import { I128, U128 } from '../../src/numbers/generic'; +import { ScInt } from '../../src/numbers/scint'; +import { I128, U128, I256, U256 } from '../../src/numbers/scint'; describe('creating large integers', function () { describe('picks the right types', function () { @@ -10,7 +10,7 @@ describe('creating large integers', function () { }).forEach(([type, values]) => { values.forEach((value) => { it(`picks ${type} for ${value}`, function () { - const bi = new BigInteger(value); + const bi = new ScInt(value); expect(bi.type).to.equal(type); expect(bi.toBigInt()).to.equal(BigInt(value)); }); @@ -22,22 +22,30 @@ describe('creating large integers', function () { const sentinel = 85n; it('handles 64 bits', function () { - let b = new StellarBase.BigInteger(sentinel); - expect(b.toBigInt()).to.eql(sentinel); - - b = new StellarBase.BigInteger(-sentinel); - expect(b.toBigInt()).to.eql(-sentinel); + let b = new StellarBase.ScInt(sentinel); + expect(b.toBigInt()).to.equal(sentinel); + expect(b.toNumber()).to.equal(Number(sentinel)); + let u64 = b.toU64().u64(); + expect(u64.low).to.equal(Number(sentinel)); + expect(u64.high).to.equal(0); + + b = new StellarBase.ScInt(-sentinel); + expect(b.toBigInt()).to.equal(-sentinel); + expect(b.toNumber()).to.equal(Number(-sentinel)); + u64 = b.toU64().u64(); + expect(u64.low).to.equal(-85); + expect(u64.high).to.equal(-1); }); it(`upscales + to 128`, function () { - const b = new StellarBase.BigInteger(sentinel); + const b = new StellarBase.ScInt(sentinel); const i128 = b.toI128().i128(); expect(i128.lo().toBigInt()).to.equal(sentinel); expect(i128.hi().toBigInt()).to.equal(0n); }); it(`upscales - to 128`, function () { - const b = new StellarBase.BigInteger(-sentinel); + const b = new StellarBase.ScInt(-sentinel); const i128 = b.toI128().i128(); const hi = i128.hi().toBigInt(); const lo = i128.lo().toBigInt(); @@ -47,13 +55,15 @@ describe('creating large integers', function () { }); it(`upscales + to 256`, function () { - const b = new StellarBase.BigInteger(sentinel); + const b = new StellarBase.ScInt(sentinel); const i = b.toI256().i256(); - const hiHi = i.hiHi().toBigInt(); - const hiLo = i.hiLo().toBigInt(); - const loHi = i.loHi().toBigInt(); - const loLo = i.loLo().toBigInt(); + const [hiHi, hiLo, loHi, loLo] = [ + i.hiHi(), + i.hiLo(), + i.loHi(), + i.loLo() + ].map((i) => i.toBigInt()); expect(hiHi).to.equal(0n); expect(hiLo).to.equal(0n); @@ -65,7 +75,7 @@ describe('creating large integers', function () { }); it(`upscales - to 256`, function () { - const b = new StellarBase.BigInteger(-sentinel); + const b = new StellarBase.ScInt(-sentinel); const i128 = b.toI128().i128(); const hi = i128.hi().toBigInt(); const lo = i128.lo().toBigInt(); @@ -78,34 +88,28 @@ describe('creating large integers', function () { describe('error handling', function () { ['u64', 'u128', 'u256'].forEach((type) => { it(`throws when signed parts and {type: '${type}'}`, function () { - expect(() => new StellarBase.BigInteger(-2, { type })).to.throw( - /negative/i - ); + expect(() => new StellarBase.ScInt(-2, { type })).to.throw(/negative/i); }); }); it('throws when too big', function () { - expect(() => new StellarBase.BigInteger(1n << 400n)).to.throw( - /expected/i - ); + expect(() => new StellarBase.ScInt(1n << 400n)).to.throw(/expected/i); }); it('throws when big interpreted as small', function () { let big; - big = new StellarBase.BigInteger(1n << 64n); + big = new StellarBase.ScInt(1n << 64n); expect(() => big.toNumber()).to.throw(/too large/i); - big = new StellarBase.BigInteger(Number.MAX_SAFE_INTEGER + 1); + big = new StellarBase.ScInt(Number.MAX_SAFE_INTEGER + 1); expect(() => big.toNumber()).to.throw(/too large/i); - big = new StellarBase.BigInteger(1, { type: 'i128' }); - expect(() => big.toNumber()).to.throw(/too large/i); + big = new StellarBase.ScInt(1, { type: 'i128' }); expect(() => big.toU64()).to.throw(/too large/i); expect(() => big.toI64()).to.throw(/too large/i); - big = new StellarBase.BigInteger(1, { type: 'i256' }); - expect(() => big.toNumber()).to.throw(/too large/i); + big = new StellarBase.ScInt(1, { type: 'i256' }); expect(() => big.toU64()).to.throw(/too large/i); expect(() => big.toI64()).to.throw(/too large/i); expect(() => big.toI128()).to.throw(/too large/i); From d604e62682b78071567c467200e394b9f81b5fe4 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 14:28:24 -0700 Subject: [PATCH 06/34] Add utility methods --- src/numbers/scint.js | 24 +++++++++++++++++++++--- test/unit/scint_test.js | 12 ++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 43dcc01d..72bc5b20 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -96,7 +96,7 @@ export class ScInt { case 'scvU256': case 'scvI256': return new ScInt(scv.value().toBigInt(), { - type: scv.switch().substr(3).toLowerCase() + type: scv.switch().substr(3).toLowerCase() }); default: @@ -113,10 +113,13 @@ export class ScInt { } constructor(value, opts = {}) { - if (value instanceof ScInt) { + if (value === undefined) { + throw TypeError(`expected integer-like value, got ${value}`); + } else if (value instanceof ScInt) { value = value.toBigInt(); + } else { + value = BigInt(value); // normalize } - value = BigInt(value); // normalize const signed = value < 0; let iType = opts.type ?? ''; @@ -288,6 +291,21 @@ export class ScInt { this._sizeCheck(256); } + valueOf() { + return this.raw.valueOf(); + } + + toString() { + return this.raw.toString(); + } + + toJSON() { + return { + value: this.toBigInt().toString(), + type: this.type + }; + } + _sizeCheck(bits) { if (this.raw.size > bits) { throw RangeError(`value too large for ${bits} bits (${this.type})`); diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index 180859d3..fc4f9e1b 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -18,8 +18,16 @@ describe('creating large integers', function () { }); }); + it('has correct utility methods', function () { + const v = 123456789123456789123456789123456789123456789123456789123456789123456789n; + const i = new ScInt(v); + expect(i.valueOf()).to.be.eql(new U256(v)); + expect(i.toString()).to.be.equal('123456789123456789123456789123456789123456789123456789123456789123456789'); + expect(i.toJSON()).to.be.eql({ value: v.toString(), type: 'u256' }); + }); + describe('64 bit inputs', function () { - const sentinel = 85n; + const sentinel = 800000085n; it('handles 64 bits', function () { let b = new StellarBase.ScInt(sentinel); @@ -33,7 +41,7 @@ describe('creating large integers', function () { expect(b.toBigInt()).to.equal(-sentinel); expect(b.toNumber()).to.equal(Number(-sentinel)); u64 = b.toU64().u64(); - expect(u64.low).to.equal(-85); + expect(u64.low).to.equal(b.toNumber()); expect(u64.high).to.equal(-1); }); From 203ec70981504c6e2a112feaf4db755e235a0e23 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 14:40:41 -0700 Subject: [PATCH 07/34] Add upscaling from 64 -> anything --- src/numbers/scint.js | 18 +++++------------- test/unit/scint_test.js | 41 ++++++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 72bc5b20..08990bc9 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -224,16 +224,8 @@ export class ScInt { this._sizeCheck(128); const v = this.raw.toBigInt(); - let hi64 = 0n; - - // special case: preserve the upper sign bits, since with a small value, we - // need to "manually" describe it as being negative - if (v < 0n && this.raw.size <= 64) { - hi64 = -1n; - } else { - hi64 = BigInt.asIntN(64, v >> 64n); // encode top 64 w/ sign bit - } - const lo64 = BigInt.asUintN(64, v); // grab btm 64 + const hi64 = BigInt.asIntN(64, v >> 64n); // encode top 64 w/ sign bit + const lo64 = BigInt.asUintN(64, v); // grab btm 64, encode sign return xdr.ScVal.scvI128( new xdr.Int128Parts({ @@ -268,9 +260,9 @@ export class ScInt { */ toI256() { const v = this.raw.toBigInt(); - const hiHi64 = 0n; - const hiLo64 = 0n; - const loHi64 = 0n; + const hiHi64 = BigInt.asIntN(64, v >> 192n); // keep sign bit + const hiLo64 = BigInt.asUintN(64, v >> 128n); + const loHi64 = BigInt.asUintN(64, v >> 64n); const loLo64 = BigInt.asUintN(64, v); return xdr.ScVal.scvI256( diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index fc4f9e1b..d8452740 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -19,10 +19,13 @@ describe('creating large integers', function () { }); it('has correct utility methods', function () { - const v = 123456789123456789123456789123456789123456789123456789123456789123456789n; + const v = + 123456789123456789123456789123456789123456789123456789123456789123456789n; const i = new ScInt(v); expect(i.valueOf()).to.be.eql(new U256(v)); - expect(i.toString()).to.be.equal('123456789123456789123456789123456789123456789123456789123456789123456789'); + expect(i.toString()).to.be.equal( + '123456789123456789123456789123456789123456789123456789123456789123456789' + ); expect(i.toJSON()).to.be.eql({ value: v.toString(), type: 'u256' }); }); @@ -45,14 +48,14 @@ describe('creating large integers', function () { expect(u64.high).to.equal(-1); }); - it(`upscales + to 128`, function () { + it(`upscales u64 to 128`, function () { const b = new StellarBase.ScInt(sentinel); const i128 = b.toI128().i128(); expect(i128.lo().toBigInt()).to.equal(sentinel); expect(i128.hi().toBigInt()).to.equal(0n); }); - it(`upscales - to 128`, function () { + it(`upscales i64 to 128`, function () { const b = new StellarBase.ScInt(-sentinel); const i128 = b.toI128().i128(); const hi = i128.hi().toBigInt(); @@ -62,7 +65,7 @@ describe('creating large integers', function () { expect(assembled).to.equal(-sentinel); }); - it(`upscales + to 256`, function () { + it(`upscales i64 to 256`, function () { const b = new StellarBase.ScInt(sentinel); const i = b.toI256().i256(); @@ -78,18 +81,34 @@ describe('creating large integers', function () { expect(loHi).to.equal(0n); expect(loLo).to.equal(sentinel); - const assembled = new I256([loLo, loHi, hiLo, hiHi]).toBigInt(); + let assembled = new I256([loLo, loHi, hiLo, hiHi]).toBigInt(); + expect(assembled).to.equal(sentinel); + + assembled = new U256([loLo, loHi, hiLo, hiHi]).toBigInt(); expect(assembled).to.equal(sentinel); }); - it(`upscales - to 256`, function () { + it(`upscales i64 to 256`, function () { const b = new StellarBase.ScInt(-sentinel); - const i128 = b.toI128().i128(); - const hi = i128.hi().toBigInt(); - const lo = i128.lo().toBigInt(); + const i = b.toI256().i256(); - const assembled = new I128([lo, hi]).toBigInt(); + const [hiHi, hiLo, loHi, loLo] = [ + i.hiHi(), + i.hiLo(), + i.loHi(), + i.loLo() + ].map((i) => i.toBigInt()); + + expect(hiHi).to.equal(-1n); + expect(hiLo).to.equal(BigInt.asUintN(64, -1n)); + expect(loHi).to.equal(BigInt.asUintN(64, -1n)); + expect(loLo).to.equal(BigInt.asUintN(64, -sentinel)); + + let assembled = new I256([loLo, loHi, hiLo, hiHi]).toBigInt(); expect(assembled).to.equal(-sentinel); + + assembled = new U256([loLo, loHi, hiLo, hiHi]).toBigInt(); + expect(assembled).to.equal(BigInt.asUintN(256, -sentinel)); }); }); From 758260d828335d1d6d9b54995ef846b9be9fa931 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 16:13:53 -0700 Subject: [PATCH 08/34] Add ScVal interpretation helper, update docs --- package.json | 2 +- src/numbers/scint.js | 140 ++++++++++++++++++++++++++-------------- test/unit/scint_test.js | 41 ++++++++++++ 3 files changed, 132 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index afb78dae..ebd5f7b7 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "buffer": "^6.0.3", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "js-xdr": "git+https://github.com/stellar/js-xdr#a3eb0e6", + "js-xdr": "git+https://github.com/stellar/js-xdr#ad2e43e", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 08990bc9..1fd42b5a 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -12,52 +12,61 @@ import xdr from '../xdr'; * Provides an easier way to manipulate large numbers for Stellar operations. * * You can instantiate this value either from bigints, strings, or numbers - * (whole numbers, or this will throw). Support for byte arrays may come in the - * future. + * (whole numbers, or this will throw). + * + * If you need to create a native BigInt from a list of integer "parts" (for + * example, you have a series of encoded 32-bit integers that represent a larger + * value), you should use the specific XDR type, like {@link U128}. For example, + * you could do `new U128(values...).toBigInt()`. * * @example * ```js - * import * as sdk from "stellar-base"; + * import sdk from "stellar-base"; * * // You have an ScVal from a contract and want to parse it into JS native. * const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64"); - * let bigi = sdk.ScInt.fromScVal(value); + * const bigi = sdk.ScInt.fromScVal(value); // grab it as a BigInt + * let sci = new ScInt(bigi); * - * bigi.toNumber(); // gives native JS type (w/ size check) - * bigi.toBigInt(); // gives the native BigInt value - * bigi.toU64(); // gives ScValType-specific XDR constructs (with size checks) + * sci.toNumber(); // gives native JS type (w/ size check) + * sci.toBigInt(); // gives the native BigInt value + * sci.toU64(); // gives ScValType-specific XDR constructs (with size checks) * * // You have a number and want to shove it into a contract. - * bigi = sdk.ScInt(0xdeadcafebabe); - * bigi.toBigInt() // returns 244838016400062n - * bigi.toNumber() // will throw: too large + * sci = sdk.ScInt(0xdeadcafebabe); + * sci.toBigInt() // returns 244838016400062n + * sci.toNumber() // throws: too large * - * // Pass any to e.g. a Contract.call(), conversion happens automatically. - * const scValU128 = bigi.toU128(); - * const scValI256 = bigi.toI256(); - * const scValU64 = bigi.toU64(); + * // Pass any to e.g. a Contract.call(), conversion happens automatically + * // regardless of the initial type. + * const scValU128 = sci.toU128(); + * const scValI256 = sci.toI256(); + * const scValU64 = sci.toU64(); * * // Lots of ways to initialize: * sdk.ScInt("123456789123456789") * sdk.ScInt(123456789123456789n); * sdk.ScInt(1n << 140n); * sdk.ScInt(-42); + * sdk.ScInt.fromScVal(scValU128); // from above + * + * // If you know the type ahead of time (accessing `.raw` is faster than + * // conversions), you can specify the type directly (otherwise, it's + * // interpreted from the numbers you pass in): + * const i = sdk.ScInt(123456789n, { type: "u256" }); * - * // If you are confident in what you're doing and want to access `.raw` - * // directly (which is faster than conversions), you can specify the type - * // (otherwise, it's interpreted from the numbers you pass in): - * const i = sdk.ScInt( - * 123456789123456789n, - * { type: "u256" } - * ); - * i.raw; // an sdk.U256, which can be converted to an ScVal directly - * i.raw.toScVal(); // an xdr.ScVal with ScValType = "scvU256" + * // For example, you can use the underlying `sdk.U256` and convert it to an + * // `xdr.ScVal` directly like so: + * const scv = new xdr.ScVal.scvU256(i.raw); + * + * // Or reinterpret it as a different type (size permitting): + * const scv = i.toI64(); * ``` * * @param {Number|BigInt|String|ScInt} value - a single, integer-like value * which will be interpreted in the smallest appropriate XDR type supported * by Stellar (32, 64, 128, or 256 bit integer values). signed values are - * supported, though they are sanity-checked against `opts.type` + * supported, though they are sanity-checked against `opts.type`. * * @param {object} [opts] - an object holding optional options for parsing * @param {string} [opts.type] - force a specific data type. options are: @@ -67,8 +76,8 @@ import xdr from '../xdr'; * @throws {RangeError} if the `value` is invalid (e.g. floating point), too * large (i.e. exceeds a 256-bit value), or doesn't fit in the `opts.type` * - * @throws {TypeError} if the "signedness" of `opts` doesn't match the input - * `value`, e.g. passing `{type: 'u64'}` yet passing -1n + * @throws {TypeError} on missing parameters, or if the "signedness" of `opts` + * doesn't match input `value`, e.g. passing `{type: 'u64'}` yet passing -1n * * @throws {SyntaxError} if a string `value` can't be parsed as a big integer */ @@ -79,49 +88,72 @@ export class ScInt { /** * Transforms an opaque {@link xdr.ScVal} into a native BigInt, if possible. * + * You can then give this back to create an {@link ScInt} instance, but the + * rationale here is that the native type is more likely to be immediately + * useful. + * * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer * @returns {BigInt} the integer value, regardless of size (even 32-bit) * @throws {TypeError} if the input value doesn't represent an integer */ static fromScVal(scv) { - switch (scv.switch()) { + switch (scv.switch().name) { case 'scvU32': case 'scvI32': return BigInt(scv.value()); case 'scvU64': case 'scvI64': + return scv.value().toBigInt(); + case 'scvU128': + return new U128(scv.value().lo(), scv.value().hi()).toBigInt(); + case 'scvI128': + return new I128(scv.value().lo(), scv.value().hi()).toBigInt(); + case 'scvU256': + return new U256( + scv.value().loLo(), + scv.value().loHi(), + scv.value().hiLo(), + scv.value().hiHi() + ).toBigInt(); + case 'scvI256': - return new ScInt(scv.value().toBigInt(), { - type: scv.switch().substr(3).toLowerCase() - }); + return new I256( + scv.value().loLo(), + scv.value().loHi(), + scv.value().hiLo(), + scv.value().hiHi() + ).toBigInt(); default: throw TypeError(`expected integer type, got ${scv.switch()}`); } } - static fromParts(...values) { - let result = 0n; - values.forEach((v, _i) => { - result = (result << 32n) | v; - }); - return ScInt(result); - } - constructor(value, opts = {}) { if (value === undefined) { throw TypeError(`expected integer-like value, got ${value}`); } else if (value instanceof ScInt) { value = value.toBigInt(); + // + // TODO: Decide whether or not this is worth supporting, i.e. building the + // value from a list of integer-like values (like jsXdr.LargeInt does). Why + // would someone need to do this? If they need to, they can use the types + // directly and pass them into this (e.g. `new U256(values...).toBigInt()`). + // + // } else if (value instanceof Array) { + // if (typeof opts?.type !== 'string') { + // throw TypeError(`expected opts.type with array of values, got ${opts}`); + // } } else { value = BigInt(value); // normalize } - const signed = value < 0; + let iType = opts.type ?? ''; + const signed = value < 0; if (iType.startsWith('u') && signed) { throw TypeError(`specified type ${opts.type} yet negative (${value})`); @@ -241,22 +273,18 @@ export class ScInt { */ toU128() { this._sizeCheck(128); - const v = this.raw.toBigInt(); - const hi64 = BigInt.asUintN(64, v >> 64n); - const lo64 = BigInt.asUintN(64, v); - return xdr.ScVal.scvI128( - new xdr.Int128Parts({ - hi: new xdr.Int64(hi64), - lo: new xdr.Uint64(lo64) + return xdr.ScVal.scvU128( + new xdr.UInt128Parts({ + hi: new xdr.Uint64(BigInt.asUintN(64, v >> 64n)), + lo: new xdr.Uint64(BigInt.asUintN(64, v)) }) ); } /** * @returns {xdr.ScVal} the integer encoded with `ScValType = I256` - * @throws {RangeError} if the value cannot fit in 256 bits */ toI256() { const v = this.raw.toBigInt(); @@ -266,7 +294,7 @@ export class ScInt { const loLo64 = BigInt.asUintN(64, v); return xdr.ScVal.scvI256( - new xdr.UInt256Parts({ + new xdr.Int256Parts({ hiHi: new xdr.Int64(hiHi64), hiLo: new xdr.Uint64(hiLo64), loHi: new xdr.Uint64(loHi64), @@ -277,10 +305,22 @@ export class ScInt { /** * @returns {xdr.ScVal} the integer encoded with `ScValType = U256` - * @throws {RangeError} if the value cannot fit in 256 bits */ toU256() { - this._sizeCheck(256); + const v = this.raw.toBigInt(); + const hiHi64 = BigInt.asUintN(64, v >> 192n); // encode sign bit + const hiLo64 = BigInt.asUintN(64, v >> 128n); + const loHi64 = BigInt.asUintN(64, v >> 64n); + const loLo64 = BigInt.asUintN(64, v); + + return xdr.ScVal.scvU256( + new xdr.UInt256Parts({ + hiHi: new xdr.Uint64(hiHi64), + hiLo: new xdr.Uint64(hiLo64), + loHi: new xdr.Uint64(loHi64), + loLo: new xdr.Uint64(loLo64) + }) + ); } valueOf() { diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index d8452740..cd475993 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -1,5 +1,6 @@ import { ScInt } from '../../src/numbers/scint'; import { I128, U128, I256, U256 } from '../../src/numbers/scint'; +import xdr from '../../src/xdr'; describe('creating large integers', function () { describe('picks the right types', function () { @@ -112,6 +113,46 @@ describe('creating large integers', function () { }); }); + describe('conversion to/from ScVals', function () { + const v = 80000085n; + const i = new ScInt(v); + + [ + [i.toI64(), 'i64'], + [i.toU64(), 'u64'], + [i.toI128(), 'i128'], + [i.toU128(), 'u128'], + [i.toI256(), 'i256'], + [i.toU256(), 'u256'] + ].forEach(([scv, type]) => { + it(`works for ${type}`, function () { + expect(scv.switch().name).to.equal(`scv${type.toUpperCase()}`); + expect(typeof scv.toXDR('base64')).to.be.equal('string'); + + const bigi = ScInt.fromScVal(scv); + expect(bigi).to.equal(v); + expect(new ScInt(bigi, { type }).toJSON()).to.eql({ + ...i.toJSON(), + type + }); + }); + }); + + it('works for 32-bit', function () { + const i32 = new xdr.ScVal.scvI32(Number(v)); + const u32 = new xdr.ScVal.scvU32(Number(v)); + + expect(ScInt.fromScVal(i32)).to.equal(v); + expect(ScInt.fromScVal(u32)).to.equal(v); + }); + + it('throws for non-integers', function () { + expect(() => ScInt.fromScVal(new xdr.ScVal.scvString('hello'))).to.throw( + /integer/i + ); + }); + }); + describe('error handling', function () { ['u64', 'u128', 'u256'].forEach((type) => { it(`throws when signed parts and {type: '${type}'}`, function () { From 77cab97fc84a3bb6d41c857e8db449ad3753c844 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 16:22:34 -0700 Subject: [PATCH 09/34] Add TypeScript definition --- src/numbers/scint.js | 6 +++--- types/index.d.ts | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 1fd42b5a..04075a21 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -63,7 +63,7 @@ import xdr from '../xdr'; * const scv = i.toI64(); * ``` * - * @param {Number|BigInt|String|ScInt} value - a single, integer-like value + * @param {number|bigint|string|ScInt} value - a single, integer-like value * which will be interpreted in the smallest appropriate XDR type supported * by Stellar (32, 64, 128, or 256 bit integer values). signed values are * supported, though they are sanity-checked against `opts.type`. @@ -93,7 +93,7 @@ export class ScInt { * useful. * * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer - * @returns {BigInt} the integer value, regardless of size (even 32-bit) + * @returns {bigint} the integer value, regardless of size (even 32-bit) * @throws {TypeError} if the input value doesn't represent an integer */ static fromScVal(scv) { @@ -219,7 +219,7 @@ export class ScInt { } /** - * @returns {BigInt} + * @returns {bigint} */ toBigInt() { return this.raw.toBigInt(); diff --git a/types/index.d.ts b/types/index.d.ts index 475db4e7..e5f42647 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1053,3 +1053,26 @@ export function decodeAddressToMuxedAccount(address: string, supportMuxing: bool export function encodeMuxedAccountToAddress(account: xdr.MuxedAccount, supportMuxing: boolean): string; export function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount; export function extractBaseAddress(address: string): string; + +export type ScIntType = 'i32' | 'u32' | 'i64' | 'u64' | 'i128' | 'u128' | 'i256' | 'u256'; +export class ScInt { + constructor(value: number|bigint|string|ScInt, opts: { type: ScIntType }); + static fromScVal(scv: xdr.ScVal): bigint; + + toNumber(): number; + toBigInt(): bigint; + + toI64(): xdr.ScVal; + toU64(): xdr.ScVal; + toI128(): xdr.ScVal; + toU128(): xdr.ScVal; + toI256(): xdr.ScVal; + toU256(): xdr.ScVal; + + valueOf(): any; // FIXME + toString(): string; + toJSON(): { + value: string; + type: ScIntType; + } +} From 59d5c76c7e5d3c0510f9f0fa12be29bc501bccd4 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 16:24:16 -0700 Subject: [PATCH 10/34] Format types --- types/index.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index e5f42647..b80c9279 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1054,7 +1054,16 @@ export function encodeMuxedAccountToAddress(account: xdr.MuxedAccount, supportMu export function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount; export function extractBaseAddress(address: string): string; -export type ScIntType = 'i32' | 'u32' | 'i64' | 'u64' | 'i128' | 'u128' | 'i256' | 'u256'; +export type ScIntType = + | 'i32' + | 'u32' + | 'i64' + | 'u64' + | 'i128' + | 'u128' + | 'i256' + | 'u256'; + export class ScInt { constructor(value: number|bigint|string|ScInt, opts: { type: ScIntType }); static fromScVal(scv: xdr.ScVal): bigint; @@ -1074,5 +1083,5 @@ export class ScInt { toJSON(): { value: string; type: ScIntType; - } + }; } From b307af1345ec3caa6b9dae43751823f333b2c2f7 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 16:30:20 -0700 Subject: [PATCH 11/34] Drop some local changes that snuck in there --- .github/workflows/tests.yml | 2 +- test/unit/contract_test.js | 30 ------------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab85b927..c8721786 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Install Dependencies - run: yarn install + run: yarn install --network-concurrency 1 - name: Build All run: yarn build:prod diff --git a/test/unit/contract_test.js b/test/unit/contract_test.js index 08f8d8c4..378f9861 100644 --- a/test/unit/contract_test.js +++ b/test/unit/contract_test.js @@ -49,34 +49,4 @@ describe('Contract', function () { expect(fp.toXDR().toString('base64')).to.equal(expected); }); }); - - // describe('call', function() { - // it('should create an XDR operation', function() { - // const kp = StellarBase.Keypair.random(); - // const account = new StellarBase.Account(kp.publicKey(), "1"); - // const contractId = '0'.repeat(63) + '1'; - - // let contract = new StellarBase.Contract(contractId); - - // const callOp = contract.call("balance", ...[ - // new StellarBase.Address(kp.publicKey()).toScVal() - // ]); - // console.log(callOp); - // console.log(callOp.toXDR()); - - // let builder = new StellarBase.TransactionBuilder(account, { - // fee: "1000", - // timebounds: { minTime: 0, maxTime: 0 }, - // networkPassphrase: StellarBase.Networks.FUTURENET, - // }); - - // const txXdr = builder.addOperation(callOp).build(); - // const txB64 = txXdr.toXDR(); - // console.log(txB64); - - // const txRt = StellarBase.TransactionBuilder.fromXDR(txB64, - // StellarBase.Networks.FUTURENET); - // console.log(txRt); - // }); - // }); }); From 2da027920f58a8244fbc19dc8425e37c5b4be967 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 16:34:18 -0700 Subject: [PATCH 12/34] Move XDR read/write tests --- src/numbers/scint.js | 2 +- test/unit/i256_test.js | 75 ++++++++++++++++++++++++++++++++++++++++ test/unit/scint_test.js | 76 ----------------------------------------- 3 files changed, 76 insertions(+), 77 deletions(-) create mode 100644 test/unit/i256_test.js diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 04075a21..fa2e2754 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -206,7 +206,7 @@ export class ScInt { } /** - * @returns {Number} + * @returns {number} * @throws {RangeError} if the value can't fit into a Number */ toNumber() { diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js new file mode 100644 index 00000000..aa84d0f4 --- /dev/null +++ b/test/unit/i256_test.js @@ -0,0 +1,75 @@ + +import { XdrWriter, XdrReader } from 'js-xdr'; +import { I256 } from '../../src/numbers/scint'; + +// describe('I256.read', function () { +// it('decodes correctly', function () { +// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(0)); +// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])).to.eql(new I256(1)); +// expect(read([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(-1)); +// expect(read([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(I256.MAX_VALUE)); +// expect(read([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(I256.MIN_VALUE)); +// }); + +// function read(bytes) { +// let io = new XdrReader(bytes); +// return I256.read(io); +// } +// }); + +// describe('I256.write', function () { +// it('encodes correctly', function () { +// expect(write(new I256(0))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); +// expect(write(new I256(1))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]); +// expect(write(new I256(-1))).to.eql([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); +// expect(write(I256.MAX_VALUE)).to.eql([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); +// expect(write(I256.MIN_VALUE)).to.eql([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); +// }); + +// function write(value) { +// let io = new XdrWriter(8); +// I256.write(value, io); +// return io.toArray(); +// } +// }); + +describe('I256.isValid', function () { + it('returns true for I256 instances', function () { + expect(I256.isValid(I256.MIN_VALUE)).to.be.true; + expect(I256.isValid(I256.MAX_VALUE)).to.be.true; + expect(I256.isValid(I256.fromString('0'))).to.be.true; + expect(I256.isValid(I256.fromString('-1'))).to.be.true; + expect(I256.isValid(5n)).to.be.true; + }); + + it('returns false for non I256', function () { + expect(I256.isValid(null)).to.be.false; + expect(I256.isValid(undefined)).to.be.false; + expect(I256.isValid([])).to.be.false; + expect(I256.isValid({})).to.be.false; + expect(I256.isValid(1)).to.be.false; + expect(I256.isValid(true)).to.be.false; + }); +}); + +describe('I256.slice', function () { + it('slices number to parts', function () { + expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(32)).to.be.eql([1n, -2n, 3n, -4n, 5n, -6n, 7n, -8n]); + expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(64)).to.be.eql([-0x1FFFFFFFFn, -0x3FFFFFFFDn, -0x5FFFFFFFBn, -0x7FFFFFFF9n]); + expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(128)).to.be.eql([-0x3fffffffc00000001ffffffffn, -0x7fffffff800000005fffffffbn]); + }); +}); + +describe('I256.fromString', function () { + it('works for positive numbers', function () { + expect(I256.fromString('1059').toString()).to.eql('1059'); + }); + + it('works for negative numbers', function () { + expect(I256.fromString('-105909234885029834059234850234985028304085').toString()).to.eql('-105909234885029834059234850234985028304085'); + }); + + it('fails when providing a string with a decimal place', function () { + expect(() => I256.fromString('105946095601.5')).to.throw(/Invalid/); + }); +}); diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index cd475993..6ccad5e8 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -185,79 +185,3 @@ describe('creating large integers', function () { }); }); }); - -// import { XdrWriter, XdrReader } from 'js-xdr'; - -// let I256 = StellarBase.xdr.I256; - -// describe('I256.read', function () { -// it('decodes correctly', function () { -// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(0)); -// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])).to.eql(new I256(1)); -// expect(read([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(-1)); -// expect(read([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(I256.MAX_VALUE)); -// expect(read([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(I256.MIN_VALUE)); -// }); - -// function read(bytes) { -// let io = new XdrReader(bytes); -// return I256.read(io); -// } -// }); - -// describe('I256.write', function () { -// it('encodes correctly', function () { -// expect(write(new I256(0))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); -// expect(write(new I256(1))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]); -// expect(write(new I256(-1))).to.eql([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); -// expect(write(I256.MAX_VALUE)).to.eql([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); -// expect(write(I256.MIN_VALUE)).to.eql([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); -// }); - -// function write(value) { -// let io = new XdrWriter(8); -// I256.write(value, io); -// return io.toArray(); -// } -// }); - -// describe('I256.isValid', function () { -// it('returns true for I256 instances', function () { -// expect(I256.isValid(I256.MIN_VALUE)).to.be.true; -// expect(I256.isValid(I256.MAX_VALUE)).to.be.true; -// expect(I256.isValid(I256.fromString('0'))).to.be.true; -// expect(I256.isValid(I256.fromString('-1'))).to.be.true; -// expect(I256.isValid(5n)).to.be.true; -// }); - -// it('returns false for non I256', function () { -// expect(I256.isValid(null)).to.be.false; -// expect(I256.isValid(undefined)).to.be.false; -// expect(I256.isValid([])).to.be.false; -// expect(I256.isValid({})).to.be.false; -// expect(I256.isValid(1)).to.be.false; -// expect(I256.isValid(true)).to.be.false; -// }); -// }); - -// describe('I256.slice', function () { -// it('slices number to parts', function () { -// expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(32)).to.be.eql([1n, -2n, 3n, -4n, 5n, -6n, 7n, -8n]); -// expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(64)).to.be.eql([-0x1FFFFFFFFn, -0x3FFFFFFFDn, -0x5FFFFFFFBn, -0x7FFFFFFF9n]); -// expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(128)).to.be.eql([-0x3fffffffc00000001ffffffffn, -0x7fffffff800000005fffffffbn]); -// }); -// }); - -// describe('I256.fromString', function () { -// it('works for positive numbers', function () { -// expect(I256.fromString('1059').toString()).to.eql('1059'); -// }); - -// it('works for negative numbers', function () { -// expect(I256.fromString('-105909234885029834059234850234985028304085').toString()).to.eql('-105909234885029834059234850234985028304085'); -// }); - -// it('fails when providing a string with a decimal place', function () { -// expect(() => I256.fromString('105946095601.5')).to.throw(/Invalid/); -// }); -// }); From e6579ad0f29086f1f4de88d04938922ad4587039 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Mon, 5 Jun 2023 16:37:12 -0700 Subject: [PATCH 13/34] Clarify that 32-bit ScVals aren't supported --- src/numbers/scint.js | 10 ++++++---- types/index.d.ts | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/numbers/scint.js b/src/numbers/scint.js index fa2e2754..014f6d04 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -65,13 +65,15 @@ import xdr from '../xdr'; * * @param {number|bigint|string|ScInt} value - a single, integer-like value * which will be interpreted in the smallest appropriate XDR type supported - * by Stellar (32, 64, 128, or 256 bit integer values). signed values are - * supported, though they are sanity-checked against `opts.type`. + * by Stellar (64, 128, or 256 bit integer values). signed values are + * supported, though they are sanity-checked against `opts.type`. if you need + * 32-bit values, you can construct them directly without needing this + * wrapper, e.g. `xdr.ScVal.scvU32(1234)`. * * @param {object} [opts] - an object holding optional options for parsing * @param {string} [opts.type] - force a specific data type. options are: - * 'i32', u32', i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the - * smallest one that fits the `value`) + * 'i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the smallest + * one that fits the `value`) * * @throws {RangeError} if the `value` is invalid (e.g. floating point), too * large (i.e. exceeds a 256-bit value), or doesn't fit in the `opts.type` diff --git a/types/index.d.ts b/types/index.d.ts index b80c9279..2a18340e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1055,8 +1055,6 @@ export function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccou export function extractBaseAddress(address: string): string; export type ScIntType = - | 'i32' - | 'u32' | 'i64' | 'u64' | 'i128' From 85c69a9c76c65e46730c5d886593508846133e6a Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 6 Jun 2023 15:59:04 -0700 Subject: [PATCH 14/34] Add more conversion tests --- test/unit/i256_test.js | 23 ++++++++--- test/unit/scint_test.js | 90 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 105 insertions(+), 8 deletions(-) diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js index aa84d0f4..581f2d2c 100644 --- a/test/unit/i256_test.js +++ b/test/unit/i256_test.js @@ -1,4 +1,3 @@ - import { XdrWriter, XdrReader } from 'js-xdr'; import { I256 } from '../../src/numbers/scint'; @@ -54,9 +53,21 @@ describe('I256.isValid', function () { describe('I256.slice', function () { it('slices number to parts', function () { - expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(32)).to.be.eql([1n, -2n, 3n, -4n, 5n, -6n, 7n, -8n]); - expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(64)).to.be.eql([-0x1FFFFFFFFn, -0x3FFFFFFFDn, -0x5FFFFFFFBn, -0x7FFFFFFF9n]); - expect(new I256(-0x7FFFFFFF800000005FFFFFFFA00000003FFFFFFFC00000001FFFFFFFFn).slice(128)).to.be.eql([-0x3fffffffc00000001ffffffffn, -0x7fffffff800000005fffffffbn]); + expect( + new I256( + -0x7fffffff800000005fffffffa00000003fffffffc00000001ffffffffn + ).slice(32) + ).to.be.eql([1n, -2n, 3n, -4n, 5n, -6n, 7n, -8n]); + expect( + new I256( + -0x7fffffff800000005fffffffa00000003fffffffc00000001ffffffffn + ).slice(64) + ).to.be.eql([-0x1ffffffffn, -0x3fffffffdn, -0x5fffffffbn, -0x7fffffff9n]); + expect( + new I256( + -0x7fffffff800000005fffffffa00000003fffffffc00000001ffffffffn + ).slice(128) + ).to.be.eql([-0x3fffffffc00000001ffffffffn, -0x7fffffff800000005fffffffbn]); }); }); @@ -66,7 +77,9 @@ describe('I256.fromString', function () { }); it('works for negative numbers', function () { - expect(I256.fromString('-105909234885029834059234850234985028304085').toString()).to.eql('-105909234885029834059234850234985028304085'); + expect( + I256.fromString('-105909234885029834059234850234985028304085').toString() + ).to.eql('-105909234885029834059234850234985028304085'); }); it('fails when providing a string with a decimal place', function () { diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index 6ccad5e8..6c9668d0 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -24,7 +24,7 @@ describe('creating large integers', function () { 123456789123456789123456789123456789123456789123456789123456789123456789n; const i = new ScInt(v); expect(i.valueOf()).to.be.eql(new U256(v)); - expect(i.toString()).to.be.equal( + expect(i.toString()).to.equal( '123456789123456789123456789123456789123456789123456789123456789123456789' ); expect(i.toJSON()).to.be.eql({ value: v.toString(), type: 'u256' }); @@ -33,7 +33,7 @@ describe('creating large integers', function () { describe('64 bit inputs', function () { const sentinel = 800000085n; - it('handles 64 bits', function () { + it('handles u64', function () { let b = new StellarBase.ScInt(sentinel); expect(b.toBigInt()).to.equal(sentinel); expect(b.toNumber()).to.equal(Number(sentinel)); @@ -47,6 +47,15 @@ describe('creating large integers', function () { u64 = b.toU64().u64(); expect(u64.low).to.equal(b.toNumber()); expect(u64.high).to.equal(-1); + }) + + it('handles i64', function () { + let b = new StellarBase.ScInt(sentinel); + expect(b.toBigInt()).to.equal(sentinel); + expect(b.toNumber()).to.equal(Number(sentinel)); + let i64 = b.toI64().i64(); + + expect(new xdr.Int64([i64.low, i64.high]).toBigInt()).to.equal(sentinel); }); it(`upscales u64 to 128`, function () { @@ -113,6 +122,81 @@ describe('creating large integers', function () { }); }); + describe('128 bit inputs', function () { + const sentinel = 800000000000000000000085n; // 80 bits long + + it('handles inputs', function () { + let b = new StellarBase.ScInt(sentinel); + expect(b.toBigInt()).to.equal(sentinel); + expect(() => b.toNumber()).to.throw(/too large/i); + expect(() => b.toU64()).to.throw(/too large/i); + expect(() => b.toI64()).to.throw(/too large/i); + + let u128 = b.toU128().u128(); + expect(new U128([ + u128.lo().low, + u128.lo().high, + u128.hi().low, + u128.hi().high, + ]).toBigInt()).to.equal(sentinel); + + b = new StellarBase.ScInt(-sentinel); + u128 = b.toU128().u128(); + expect(new U128([ + u128.lo().low, + u128.lo().high, + u128.hi().low, + u128.hi().high, + ]).toBigInt()).to.equal(BigInt.asUintN(128, -sentinel)); + + b = new StellarBase.ScInt(sentinel); + let i128 = b.toI128().i128(); + expect(new I128([ + i128.lo().low, + i128.lo().high, + i128.hi().low, + i128.hi().high, + ]).toBigInt()).to.equal(sentinel); + + b = new StellarBase.ScInt(-sentinel); + i128 = b.toI128().i128(); + expect(new I128([ + i128.lo().low, + i128.lo().high, + i128.hi().low, + i128.hi().high, + ]).toBigInt()).to.equal(-sentinel); + }); + + it('upscales to 256 bits', function() { + let b = new StellarBase.ScInt(-sentinel); + let i256 = b.toI256().i256(); + let u256 = b.toU256().u256(); + + expect(new I256([ + i256.loLo().low, + i256.loLo().high, + i256.loHi().low, + i256.loHi().high, + i256.hiLo().low, + i256.hiLo().high, + i256.hiHi().low, + i256.hiHi().high, + ]).toBigInt()).to.equal(-sentinel); + + expect(new U256([ + u256.loLo().low, + u256.loLo().high, + u256.loHi().low, + u256.loHi().high, + u256.hiLo().low, + u256.hiLo().high, + u256.hiHi().low, + u256.hiHi().high, + ]).toBigInt()).to.equal(BigInt.asUintN(256, -sentinel)); + }); + }); + describe('conversion to/from ScVals', function () { const v = 80000085n; const i = new ScInt(v); @@ -127,7 +211,7 @@ describe('creating large integers', function () { ].forEach(([scv, type]) => { it(`works for ${type}`, function () { expect(scv.switch().name).to.equal(`scv${type.toUpperCase()}`); - expect(typeof scv.toXDR('base64')).to.be.equal('string'); + expect(typeof scv.toXDR('base64')).to.equal('string'); const bigi = ScInt.fromScVal(scv); expect(bigi).to.equal(v); From 1800293c61e08795f5a0717458953fdb5573624c Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 6 Jun 2023 16:42:32 -0700 Subject: [PATCH 15/34] Small code simplification + code fmt --- src/numbers/scint.js | 27 +++------- test/unit/scint_test.js | 106 ++++++++++++++++++++++------------------ 2 files changed, 67 insertions(+), 66 deletions(-) diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 014f6d04..30d8d26c 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -140,38 +140,27 @@ export class ScInt { throw TypeError(`expected integer-like value, got ${value}`); } else if (value instanceof ScInt) { value = value.toBigInt(); - // - // TODO: Decide whether or not this is worth supporting, i.e. building the - // value from a list of integer-like values (like jsXdr.LargeInt does). Why - // would someone need to do this? If they need to, they can use the types - // directly and pass them into this (e.g. `new U256(values...).toBigInt()`). - // - // } else if (value instanceof Array) { - // if (typeof opts?.type !== 'string') { - // throw TypeError(`expected opts.type with array of values, got ${opts}`); - // } } else { value = BigInt(value); // normalize } - let iType = opts.type ?? ''; const signed = value < 0; - - if (iType.startsWith('u') && signed) { + let type = opts.type ?? ''; + if (type.startsWith('u') && signed) { throw TypeError(`specified type ${opts.type} yet negative (${value})`); } // If unspecified, we make a best guess at the type based on the bit length // of the value, treating 64 as a minimum and 256 as a maximum. - if (iType === '') { - iType = signed ? 'i' : 'u'; + if (type === '') { + type = signed ? 'i' : 'u'; const bitlen = nearestBigIntSize(value); switch (bitlen) { case 64: case 128: case 256: - iType += bitlen.toString(); + type += bitlen.toString(); break; default: @@ -181,7 +170,7 @@ export class ScInt { } } - switch (iType) { + switch (type) { case 'i64': this.raw = new Hyper(value); break; @@ -201,10 +190,10 @@ export class ScInt { this.raw = new U256(value); break; default: - throw TypeError(`invalid type: ${iType}`); + throw TypeError(`invalid type: ${type}`); } - this.type = iType; + this.type = type; } /** diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index 6c9668d0..be960693 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -47,7 +47,7 @@ describe('creating large integers', function () { u64 = b.toU64().u64(); expect(u64.low).to.equal(b.toNumber()); expect(u64.high).to.equal(-1); - }) + }); it('handles i64', function () { let b = new StellarBase.ScInt(sentinel); @@ -133,67 +133,79 @@ describe('creating large integers', function () { expect(() => b.toI64()).to.throw(/too large/i); let u128 = b.toU128().u128(); - expect(new U128([ - u128.lo().low, - u128.lo().high, - u128.hi().low, - u128.hi().high, - ]).toBigInt()).to.equal(sentinel); + expect( + new U128([ + u128.lo().low, + u128.lo().high, + u128.hi().low, + u128.hi().high + ]).toBigInt() + ).to.equal(sentinel); b = new StellarBase.ScInt(-sentinel); u128 = b.toU128().u128(); - expect(new U128([ - u128.lo().low, - u128.lo().high, - u128.hi().low, - u128.hi().high, - ]).toBigInt()).to.equal(BigInt.asUintN(128, -sentinel)); + expect( + new U128([ + u128.lo().low, + u128.lo().high, + u128.hi().low, + u128.hi().high + ]).toBigInt() + ).to.equal(BigInt.asUintN(128, -sentinel)); b = new StellarBase.ScInt(sentinel); let i128 = b.toI128().i128(); - expect(new I128([ - i128.lo().low, - i128.lo().high, - i128.hi().low, - i128.hi().high, - ]).toBigInt()).to.equal(sentinel); + expect( + new I128([ + i128.lo().low, + i128.lo().high, + i128.hi().low, + i128.hi().high + ]).toBigInt() + ).to.equal(sentinel); b = new StellarBase.ScInt(-sentinel); i128 = b.toI128().i128(); - expect(new I128([ - i128.lo().low, - i128.lo().high, - i128.hi().low, - i128.hi().high, - ]).toBigInt()).to.equal(-sentinel); + expect( + new I128([ + i128.lo().low, + i128.lo().high, + i128.hi().low, + i128.hi().high + ]).toBigInt() + ).to.equal(-sentinel); }); - it('upscales to 256 bits', function() { + it('upscales to 256 bits', function () { let b = new StellarBase.ScInt(-sentinel); let i256 = b.toI256().i256(); let u256 = b.toU256().u256(); - expect(new I256([ - i256.loLo().low, - i256.loLo().high, - i256.loHi().low, - i256.loHi().high, - i256.hiLo().low, - i256.hiLo().high, - i256.hiHi().low, - i256.hiHi().high, - ]).toBigInt()).to.equal(-sentinel); - - expect(new U256([ - u256.loLo().low, - u256.loLo().high, - u256.loHi().low, - u256.loHi().high, - u256.hiLo().low, - u256.hiLo().high, - u256.hiHi().low, - u256.hiHi().high, - ]).toBigInt()).to.equal(BigInt.asUintN(256, -sentinel)); + expect( + new I256([ + i256.loLo().low, + i256.loLo().high, + i256.loHi().low, + i256.loHi().high, + i256.hiLo().low, + i256.hiLo().high, + i256.hiHi().low, + i256.hiHi().high + ]).toBigInt() + ).to.equal(-sentinel); + + expect( + new U256([ + u256.loLo().low, + u256.loLo().high, + u256.loHi().low, + u256.loHi().high, + u256.hiLo().low, + u256.hiLo().high, + u256.hiHi().low, + u256.hiHi().high + ]).toBigInt() + ).to.equal(BigInt.asUintN(256, -sentinel)); }); }); From 0d146781d76b181930637aeeb84faa00d4e627f7 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 6 Jun 2023 17:10:16 -0700 Subject: [PATCH 16/34] Add a way to build the abstraction from raw XDR --- src/numbers/scint.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 30d8d26c..22238eb1 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -135,6 +135,20 @@ export class ScInt { } } + /** + * Constructs an instance from a "large integer"-like XDR type. + * + * @param {xdr.LargeInt} i - the XDR instance + * @returns {ScInt} the parsed value set up with the specified type + * + * @see {@link I128} {@link U128} {@link I256} {@link U256} + */ + static fromXdrInt(i) { + return new ScInt(i.toBigInt(), { + type: `${i.unsigned ? 'u' : 'i'}${i.size}` + }); + } + constructor(value, opts = {}) { if (value === undefined) { throw TypeError(`expected integer-like value, got ${value}`); From 30fb0371d7ca54ce96504120ab1f2c54d0487d8b Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 7 Jun 2023 11:06:07 -0700 Subject: [PATCH 17/34] Add a type-required version of the abstraction --- src/numbers/scint.js | 253 ++++++++++++++++++++++--------------------- 1 file changed, 129 insertions(+), 124 deletions(-) diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 22238eb1..b513acee 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -8,83 +8,8 @@ import { U256 } from './u256'; import xdr from '../xdr'; -/** - * Provides an easier way to manipulate large numbers for Stellar operations. - * - * You can instantiate this value either from bigints, strings, or numbers - * (whole numbers, or this will throw). - * - * If you need to create a native BigInt from a list of integer "parts" (for - * example, you have a series of encoded 32-bit integers that represent a larger - * value), you should use the specific XDR type, like {@link U128}. For example, - * you could do `new U128(values...).toBigInt()`. - * - * @example - * ```js - * import sdk from "stellar-base"; - * - * // You have an ScVal from a contract and want to parse it into JS native. - * const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64"); - * const bigi = sdk.ScInt.fromScVal(value); // grab it as a BigInt - * let sci = new ScInt(bigi); - * - * sci.toNumber(); // gives native JS type (w/ size check) - * sci.toBigInt(); // gives the native BigInt value - * sci.toU64(); // gives ScValType-specific XDR constructs (with size checks) - * - * // You have a number and want to shove it into a contract. - * sci = sdk.ScInt(0xdeadcafebabe); - * sci.toBigInt() // returns 244838016400062n - * sci.toNumber() // throws: too large - * - * // Pass any to e.g. a Contract.call(), conversion happens automatically - * // regardless of the initial type. - * const scValU128 = sci.toU128(); - * const scValI256 = sci.toI256(); - * const scValU64 = sci.toU64(); - * - * // Lots of ways to initialize: - * sdk.ScInt("123456789123456789") - * sdk.ScInt(123456789123456789n); - * sdk.ScInt(1n << 140n); - * sdk.ScInt(-42); - * sdk.ScInt.fromScVal(scValU128); // from above - * - * // If you know the type ahead of time (accessing `.raw` is faster than - * // conversions), you can specify the type directly (otherwise, it's - * // interpreted from the numbers you pass in): - * const i = sdk.ScInt(123456789n, { type: "u256" }); - * - * // For example, you can use the underlying `sdk.U256` and convert it to an - * // `xdr.ScVal` directly like so: - * const scv = new xdr.ScVal.scvU256(i.raw); - * - * // Or reinterpret it as a different type (size permitting): - * const scv = i.toI64(); - * ``` - * - * @param {number|bigint|string|ScInt} value - a single, integer-like value - * which will be interpreted in the smallest appropriate XDR type supported - * by Stellar (64, 128, or 256 bit integer values). signed values are - * supported, though they are sanity-checked against `opts.type`. if you need - * 32-bit values, you can construct them directly without needing this - * wrapper, e.g. `xdr.ScVal.scvU32(1234)`. - * - * @param {object} [opts] - an object holding optional options for parsing - * @param {string} [opts.type] - force a specific data type. options are: - * 'i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the smallest - * one that fits the `value`) - * - * @throws {RangeError} if the `value` is invalid (e.g. floating point), too - * large (i.e. exceeds a 256-bit value), or doesn't fit in the `opts.type` - * - * @throws {TypeError} on missing parameters, or if the "signedness" of `opts` - * doesn't match input `value`, e.g. passing `{type: 'u64'}` yet passing -1n - * - * @throws {SyntaxError} if a string `value` can't be parsed as a big integer - */ -export class ScInt { - raw; // child class of a jsXdr.LargeInt +export class XdrInt { + int; // child class of a jsXdr.LargeInt type; // string, one of i64, u64, i128, u128, i256, or u256 /** @@ -149,59 +74,32 @@ export class ScInt { }); } - constructor(value, opts = {}) { - if (value === undefined) { - throw TypeError(`expected integer-like value, got ${value}`); - } else if (value instanceof ScInt) { - value = value.toBigInt(); - } else { - value = BigInt(value); // normalize - } - - const signed = value < 0; - let type = opts.type ?? ''; - if (type.startsWith('u') && signed) { - throw TypeError(`specified type ${opts.type} yet negative (${value})`); + constructor(type, values) { + if (!(values instanceof Array)) { + values = [values]; } - // If unspecified, we make a best guess at the type based on the bit length - // of the value, treating 64 as a minimum and 256 as a maximum. - if (type === '') { - type = signed ? 'i' : 'u'; - const bitlen = nearestBigIntSize(value); - - switch (bitlen) { - case 64: - case 128: - case 256: - type += bitlen.toString(); - break; - - default: - throw RangeError( - `expected 64/128/256 bits for parts (${value}), got ${bitlen}` - ); - } - } + // normalize values to one type + values = values.map(i => (i instanceof XdrInt) ? i.toBigInt() : BigInt(i)); switch (type) { case 'i64': - this.raw = new Hyper(value); + this.int = new Hyper(values); break; case 'i128': - this.raw = new I128(value); + this.int = new I128(values); break; case 'i256': - this.raw = new I256(value); + this.int = new I256(values); break; case 'u64': - this.raw = new UnsignedHyper(value); + this.int = new UnsignedHyper(values); break; case 'u128': - this.raw = new U128(value); + this.int = new U128(values); break; case 'u256': - this.raw = new U256(value); + this.int = new U256(values); break; default: throw TypeError(`invalid type: ${type}`); @@ -215,7 +113,7 @@ export class ScInt { * @throws {RangeError} if the value can't fit into a Number */ toNumber() { - const bi = this.raw.toBigInt(); + const bi = this.int.toBigInt(); if (bi > Number.MAX_SAFE_INTEGER || bi < Number.MIN_SAFE_INTEGER) { throw RangeError(`value ${bi} too large for Number`); } @@ -227,7 +125,7 @@ export class ScInt { * @returns {bigint} */ toBigInt() { - return this.raw.toBigInt(); + return this.int.toBigInt(); } /** @@ -260,7 +158,7 @@ export class ScInt { toI128() { this._sizeCheck(128); - const v = this.raw.toBigInt(); + const v = this.int.toBigInt(); const hi64 = BigInt.asIntN(64, v >> 64n); // encode top 64 w/ sign bit const lo64 = BigInt.asUintN(64, v); // grab btm 64, encode sign @@ -278,7 +176,7 @@ export class ScInt { */ toU128() { this._sizeCheck(128); - const v = this.raw.toBigInt(); + const v = this.int.toBigInt(); return xdr.ScVal.scvU128( new xdr.UInt128Parts({ @@ -292,7 +190,7 @@ export class ScInt { * @returns {xdr.ScVal} the integer encoded with `ScValType = I256` */ toI256() { - const v = this.raw.toBigInt(); + const v = this.int.toBigInt(); const hiHi64 = BigInt.asIntN(64, v >> 192n); // keep sign bit const hiLo64 = BigInt.asUintN(64, v >> 128n); const loHi64 = BigInt.asUintN(64, v >> 64n); @@ -312,7 +210,7 @@ export class ScInt { * @returns {xdr.ScVal} the integer encoded with `ScValType = U256` */ toU256() { - const v = this.raw.toBigInt(); + const v = this.int.toBigInt(); const hiHi64 = BigInt.asUintN(64, v >> 192n); // encode sign bit const hiLo64 = BigInt.asUintN(64, v >> 128n); const loHi64 = BigInt.asUintN(64, v >> 64n); @@ -329,11 +227,11 @@ export class ScInt { } valueOf() { - return this.raw.valueOf(); + return this.int.valueOf(); } toString() { - return this.raw.toString(); + return this.int.toString(); } toJSON() { @@ -344,12 +242,119 @@ export class ScInt { } _sizeCheck(bits) { - if (this.raw.size > bits) { + if (this.int.size > bits) { throw RangeError(`value too large for ${bits} bits (${this.type})`); } } } +/** + * Provides an easier way to manipulate large numbers for Stellar operations. + * + * You can instantiate this value either from bigints, strings, or numbers + * (whole numbers, or this will throw). + * + * If you need to create a native BigInt from a list of integer "parts" (for + * example, you have a series of encoded 32-bit integers that represent a larger + * value), you should use the specific XDR type, like {@link U128}. For example, + * you could do `new U128(values...).toBigInt()`. + * + * @example + * ```js + * import sdk from "stellar-base"; + * + * // You have an ScVal from a contract and want to parse it into JS native. + * const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64"); + * const bigi = sdk.ScInt.fromScVal(value); // grab it as a BigInt + * let sci = new ScInt(bigi); + * + * sci.toNumber(); // gives native JS type (w/ size check) + * sci.toBigInt(); // gives the native BigInt value + * sci.toU64(); // gives ScValType-specific XDR constructs (with size checks) + * + * // You have a number and want to shove it into a contract. + * sci = sdk.ScInt(0xdeadcafebabe); + * sci.toBigInt() // returns 244838016400062n + * sci.toNumber() // throws: too large + * + * // Pass any to e.g. a Contract.call(), conversion happens automatically + * // regardless of the initial type. + * const scValU128 = sci.toU128(); + * const scValI256 = sci.toI256(); + * const scValU64 = sci.toU64(); + * + * // Lots of ways to initialize: + * sdk.ScInt("123456789123456789") + * sdk.ScInt(123456789123456789n); + * sdk.ScInt(1n << 140n); + * sdk.ScInt(-42); + * sdk.ScInt.fromScVal(scValU128); // from above + * + * // If you know the type ahead of time (accessing `.raw` is faster than + * // conversions), you can specify the type directly (otherwise, it's + * // interpreted from the numbers you pass in): + * const i = sdk.ScInt(123456789n, { type: "u256" }); + * + * // For example, you can use the underlying `sdk.U256` and convert it to an + * // `xdr.ScVal` directly like so: + * const scv = new xdr.ScVal.scvU256(i.raw); + * + * // Or reinterpret it as a different type (size permitting): + * const scv = i.toI64(); + * ``` + * + * @param {number|bigint|string|ScInt} value - a single, integer-like value + * which will be interpreted in the smallest appropriate XDR type supported + * by Stellar (64, 128, or 256 bit integer values). signed values are + * supported, though they are sanity-checked against `opts.type`. if you need + * 32-bit values, you can construct them directly without needing this + * wrapper, e.g. `xdr.ScVal.scvU32(1234)`. + * + * @param {object} [opts] - an optional object controlling optional parameters + * @param {string} [opts.type] - force a specific data type. the type choices + * are: 'i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the + * smallest one that fits the `value`) + * + * @throws {RangeError} if the `value` is invalid (e.g. floating point), too + * large (i.e. exceeds a 256-bit value), or doesn't fit in the `opts.type` + * + * @throws {TypeError} on missing parameters, or if the "signedness" of `opts` + * doesn't match input `value`, e.g. passing `{type: 'u64'}` yet passing -1n + * + * @throws {SyntaxError} if a string `value` can't be parsed as a big integer + */ +export class ScInt extends XdrInt { + constructor(value, opts) { + const signed = value < 0; + let type = opts?.type ?? ''; + if (type.startsWith('u') && signed) { + throw TypeError(`specified type ${opts.type} yet negative (${value})`); + } + + // If unspecified, we make a best guess at the type based on the bit length + // of the value, treating 64 as a minimum and 256 as a maximum. + if (type === '') { + type = signed ? 'i' : 'u'; + const bitlen = nearestBigIntSize(value); + + switch (bitlen) { + case 64: + case 128: + case 256: + type += bitlen.toString(); + break; + + default: + throw RangeError( + `expected 64/128/256 bits for parts (${value}), got ${bitlen}` + ); + } + } + + super(type, value); + } +} + function nearestBigIntSize(bigI) { // Note: Even though BigInt.toString(2) includes the negative sign for // negative values (???), the following is still accurate, because the From 8c5f027abf84788cb2f27246ca10e6d2e240d326 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 7 Jun 2023 12:19:08 -0700 Subject: [PATCH 18/34] Micro-optimization, tests for array construction --- src/index.js | 2 +- src/numbers/scint.js | 10 +++++++++- test/unit/scint_test.js | 42 ++++++++++++++++++++++++++++++----------- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/index.js b/src/index.js index 22c0b9f8..22813c5a 100644 --- a/src/index.js +++ b/src/index.js @@ -47,6 +47,6 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; -export { ScInt } from './numbers/scint'; +export { ScInt, XdrInt } from './numbers/scint'; export default module.exports; diff --git a/src/numbers/scint.js b/src/numbers/scint.js index b513acee..86684d0f 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -80,7 +80,15 @@ export class XdrInt { } // normalize values to one type - values = values.map(i => (i instanceof XdrInt) ? i.toBigInt() : BigInt(i)); + values = values.map((i) => { + // micro-optimization to no-op the likeliest input value: + if (typeof i === 'bigint') { + return i; + } else if (i instanceof XdrInt) { + return i.toBigInt(); + } + return BigInt(i); + }); switch (type) { case 'i64': diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index be960693..5b189aa1 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -1,4 +1,3 @@ -import { ScInt } from '../../src/numbers/scint'; import { I128, U128, I256, U256 } from '../../src/numbers/scint'; import xdr from '../../src/xdr'; @@ -11,7 +10,7 @@ describe('creating large integers', function () { }).forEach(([type, values]) => { values.forEach((value) => { it(`picks ${type} for ${value}`, function () { - const bi = new ScInt(value); + const bi = new StellarBase.ScInt(value); expect(bi.type).to.equal(type); expect(bi.toBigInt()).to.equal(BigInt(value)); }); @@ -22,7 +21,7 @@ describe('creating large integers', function () { it('has correct utility methods', function () { const v = 123456789123456789123456789123456789123456789123456789123456789123456789n; - const i = new ScInt(v); + const i = new StellarBase.ScInt(v); expect(i.valueOf()).to.be.eql(new U256(v)); expect(i.toString()).to.equal( '123456789123456789123456789123456789123456789123456789123456789123456789' @@ -211,7 +210,7 @@ describe('creating large integers', function () { describe('conversion to/from ScVals', function () { const v = 80000085n; - const i = new ScInt(v); + const i = new StellarBase.ScInt(v); [ [i.toI64(), 'i64'], @@ -225,9 +224,9 @@ describe('creating large integers', function () { expect(scv.switch().name).to.equal(`scv${type.toUpperCase()}`); expect(typeof scv.toXDR('base64')).to.equal('string'); - const bigi = ScInt.fromScVal(scv); + const bigi = StellarBase.ScInt.fromScVal(scv); expect(bigi).to.equal(v); - expect(new ScInt(bigi, { type }).toJSON()).to.eql({ + expect(new StellarBase.ScInt(bigi, { type }).toJSON()).to.eql({ ...i.toJSON(), type }); @@ -238,14 +237,14 @@ describe('creating large integers', function () { const i32 = new xdr.ScVal.scvI32(Number(v)); const u32 = new xdr.ScVal.scvU32(Number(v)); - expect(ScInt.fromScVal(i32)).to.equal(v); - expect(ScInt.fromScVal(u32)).to.equal(v); + expect(StellarBase.ScInt.fromScVal(i32)).to.equal(v); + expect(StellarBase.ScInt.fromScVal(u32)).to.equal(v); }); it('throws for non-integers', function () { - expect(() => ScInt.fromScVal(new xdr.ScVal.scvString('hello'))).to.throw( - /integer/i - ); + expect(() => + StellarBase.ScInt.fromScVal(new xdr.ScVal.scvString('hello')) + ).to.throw(/integer/i); }); }); @@ -281,3 +280,24 @@ describe('creating large integers', function () { }); }); }); + +describe('creating raw large XDR integers', function () { + describe('array inputs', function () { + [ + ['i64', 2], + ['i128', 4], + ['i256', 8] + ].forEach(([type, count], idx) => { + it(`works for ${type}`, function () { + const input = new Array(count).fill(1n); + const xdrI = new StellarBase.XdrInt(type, input); + + let expected = input.reduce((accum, v, i) => { + return (accum << 32n) | v; + }, 0n); + + expect(xdrI.toBigInt()).to.equal(expected); + }); + }); + }); +}); From 0a02e689d21ea251aa622273427a8892645cc27b Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 7 Jun 2023 12:31:10 -0700 Subject: [PATCH 19/34] File breakout, rename to conform to e.g. xdr.Int128Parts --- src/index.js | 1 + src/numbers/i128.js | 4 +- src/numbers/i256.js | 4 +- src/numbers/scint.js | 260 +--------------------------------------- src/numbers/u128.js | 4 +- src/numbers/u256.js | 4 +- src/numbers/xdrint.js | 246 +++++++++++++++++++++++++++++++++++++ test/unit/i256_test.js | 68 ++++++----- test/unit/scint_test.js | 10 +- types/index.d.ts | 11 +- 10 files changed, 309 insertions(+), 303 deletions(-) create mode 100644 src/numbers/xdrint.js diff --git a/src/index.js b/src/index.js index 22813c5a..ed072498 100644 --- a/src/index.js +++ b/src/index.js @@ -48,5 +48,6 @@ export { } from './util/decode_encode_muxed_account'; export { ScInt, XdrInt } from './numbers/scint'; +export { Uint256, Int256, Uint128, Int128 } from './numbers/xdrint'; export default module.exports; diff --git a/src/numbers/i128.js b/src/numbers/i128.js index 69800d57..e8968551 100644 --- a/src/numbers/i128.js +++ b/src/numbers/i128.js @@ -1,6 +1,6 @@ import { LargeInt } from 'js-xdr'; -export class I128 extends LargeInt { +export class Int128 extends LargeInt { constructor(...args) { super(args); } @@ -14,4 +14,4 @@ export class I128 extends LargeInt { } } -I128.defineIntBoundaries(); +Int128.defineIntBoundaries(); diff --git a/src/numbers/i256.js b/src/numbers/i256.js index 81af5d13..1f6cbbc3 100644 --- a/src/numbers/i256.js +++ b/src/numbers/i256.js @@ -1,6 +1,6 @@ import { LargeInt } from 'js-xdr'; -export class I256 extends LargeInt { +export class Int256 extends LargeInt { constructor(...args) { super(args); } @@ -14,4 +14,4 @@ export class I256 extends LargeInt { } } -I256.defineIntBoundaries(); +Int256.defineIntBoundaries(); diff --git a/src/numbers/scint.js b/src/numbers/scint.js index 86684d0f..950f0948 100644 --- a/src/numbers/scint.js +++ b/src/numbers/scint.js @@ -1,260 +1,6 @@ -/* eslint no-bitwise: 0 */ -import { Hyper, UnsignedHyper } from 'js-xdr'; +import { XdrInt } from './xdrint'; -import { U128 } from './u128'; -import { I128 } from './i128'; -import { I256 } from './i256'; -import { U256 } from './u256'; - -import xdr from '../xdr'; - -export class XdrInt { - int; // child class of a jsXdr.LargeInt - type; // string, one of i64, u64, i128, u128, i256, or u256 - - /** - * Transforms an opaque {@link xdr.ScVal} into a native BigInt, if possible. - * - * You can then give this back to create an {@link ScInt} instance, but the - * rationale here is that the native type is more likely to be immediately - * useful. - * - * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer - * @returns {bigint} the integer value, regardless of size (even 32-bit) - * @throws {TypeError} if the input value doesn't represent an integer - */ - static fromScVal(scv) { - switch (scv.switch().name) { - case 'scvU32': - case 'scvI32': - return BigInt(scv.value()); - - case 'scvU64': - case 'scvI64': - return scv.value().toBigInt(); - - case 'scvU128': - return new U128(scv.value().lo(), scv.value().hi()).toBigInt(); - - case 'scvI128': - return new I128(scv.value().lo(), scv.value().hi()).toBigInt(); - - case 'scvU256': - return new U256( - scv.value().loLo(), - scv.value().loHi(), - scv.value().hiLo(), - scv.value().hiHi() - ).toBigInt(); - - case 'scvI256': - return new I256( - scv.value().loLo(), - scv.value().loHi(), - scv.value().hiLo(), - scv.value().hiHi() - ).toBigInt(); - - default: - throw TypeError(`expected integer type, got ${scv.switch()}`); - } - } - - /** - * Constructs an instance from a "large integer"-like XDR type. - * - * @param {xdr.LargeInt} i - the XDR instance - * @returns {ScInt} the parsed value set up with the specified type - * - * @see {@link I128} {@link U128} {@link I256} {@link U256} - */ - static fromXdrInt(i) { - return new ScInt(i.toBigInt(), { - type: `${i.unsigned ? 'u' : 'i'}${i.size}` - }); - } - - constructor(type, values) { - if (!(values instanceof Array)) { - values = [values]; - } - - // normalize values to one type - values = values.map((i) => { - // micro-optimization to no-op the likeliest input value: - if (typeof i === 'bigint') { - return i; - } else if (i instanceof XdrInt) { - return i.toBigInt(); - } - return BigInt(i); - }); - - switch (type) { - case 'i64': - this.int = new Hyper(values); - break; - case 'i128': - this.int = new I128(values); - break; - case 'i256': - this.int = new I256(values); - break; - case 'u64': - this.int = new UnsignedHyper(values); - break; - case 'u128': - this.int = new U128(values); - break; - case 'u256': - this.int = new U256(values); - break; - default: - throw TypeError(`invalid type: ${type}`); - } - - this.type = type; - } - - /** - * @returns {number} - * @throws {RangeError} if the value can't fit into a Number - */ - toNumber() { - const bi = this.int.toBigInt(); - if (bi > Number.MAX_SAFE_INTEGER || bi < Number.MIN_SAFE_INTEGER) { - throw RangeError(`value ${bi} too large for Number`); - } - - return Number(bi); - } - - /** - * @returns {bigint} - */ - toBigInt() { - return this.int.toBigInt(); - } - - /** - * @returns {xdr.ScVal} the integer encoded with `ScValType = I64` - */ - toI64() { - this._sizeCheck(64); - const v = this.toBigInt(); - if (BigInt.asIntN(64, v) !== v) { - throw RangeError(`value too large for i64: ${v}`); - } - - return xdr.ScVal.scvI64(new xdr.Int64(v)); - } - - /** - * @returns {xdr.ScVal} the integer encoded with `ScValType = U64` - */ - toU64() { - this._sizeCheck(64); - return xdr.ScVal.scvU64( - new xdr.Uint64(BigInt.asUintN(64, this.toBigInt())) // reiterpret as unsigned - ); - } - - /** - * @returns {xdr.ScVal} the integer encoded with `ScValType = I128` - * @throws {RangeError} if the value cannot fit in 128 bits - */ - toI128() { - this._sizeCheck(128); - - const v = this.int.toBigInt(); - const hi64 = BigInt.asIntN(64, v >> 64n); // encode top 64 w/ sign bit - const lo64 = BigInt.asUintN(64, v); // grab btm 64, encode sign - - return xdr.ScVal.scvI128( - new xdr.Int128Parts({ - hi: new xdr.Int64(hi64), - lo: new xdr.Uint64(lo64) - }) - ); - } - - /** - * @returns {xdr.ScVal} the integer encoded with `ScValType = U128` - * @throws {RangeError} if the value cannot fit in 128 bits - */ - toU128() { - this._sizeCheck(128); - const v = this.int.toBigInt(); - - return xdr.ScVal.scvU128( - new xdr.UInt128Parts({ - hi: new xdr.Uint64(BigInt.asUintN(64, v >> 64n)), - lo: new xdr.Uint64(BigInt.asUintN(64, v)) - }) - ); - } - - /** - * @returns {xdr.ScVal} the integer encoded with `ScValType = I256` - */ - toI256() { - const v = this.int.toBigInt(); - const hiHi64 = BigInt.asIntN(64, v >> 192n); // keep sign bit - const hiLo64 = BigInt.asUintN(64, v >> 128n); - const loHi64 = BigInt.asUintN(64, v >> 64n); - const loLo64 = BigInt.asUintN(64, v); - - return xdr.ScVal.scvI256( - new xdr.Int256Parts({ - hiHi: new xdr.Int64(hiHi64), - hiLo: new xdr.Uint64(hiLo64), - loHi: new xdr.Uint64(loHi64), - loLo: new xdr.Uint64(loLo64) - }) - ); - } - - /** - * @returns {xdr.ScVal} the integer encoded with `ScValType = U256` - */ - toU256() { - const v = this.int.toBigInt(); - const hiHi64 = BigInt.asUintN(64, v >> 192n); // encode sign bit - const hiLo64 = BigInt.asUintN(64, v >> 128n); - const loHi64 = BigInt.asUintN(64, v >> 64n); - const loLo64 = BigInt.asUintN(64, v); - - return xdr.ScVal.scvU256( - new xdr.UInt256Parts({ - hiHi: new xdr.Uint64(hiHi64), - hiLo: new xdr.Uint64(hiLo64), - loHi: new xdr.Uint64(loHi64), - loLo: new xdr.Uint64(loLo64) - }) - ); - } - - valueOf() { - return this.int.valueOf(); - } - - toString() { - return this.int.toString(); - } - - toJSON() { - return { - value: this.toBigInt().toString(), - type: this.type - }; - } - - _sizeCheck(bits) { - if (this.int.size > bits) { - throw RangeError(`value too large for ${bits} bits (${this.type})`); - } - } -} +export { XdrInt }; /** * Provides an easier way to manipulate large numbers for Stellar operations. @@ -370,5 +116,3 @@ function nearestBigIntSize(bigI) { const bitlen = bigI.toString(2).length; return [64, 128, 256].find((len) => bitlen <= len) ?? bitlen; } - -export { U128, I128, U256, I256 }; diff --git a/src/numbers/u128.js b/src/numbers/u128.js index eb5825c1..b32415d9 100644 --- a/src/numbers/u128.js +++ b/src/numbers/u128.js @@ -1,6 +1,6 @@ import { LargeInt } from 'js-xdr'; -export class U128 extends LargeInt { +export class Uint128 extends LargeInt { constructor(...args) { super(args); } @@ -14,4 +14,4 @@ export class U128 extends LargeInt { } } -U128.defineIntBoundaries(); +Uint128.defineIntBoundaries(); diff --git a/src/numbers/u256.js b/src/numbers/u256.js index b4f9b54d..5771b229 100644 --- a/src/numbers/u256.js +++ b/src/numbers/u256.js @@ -1,6 +1,6 @@ import { LargeInt } from 'js-xdr'; -export class U256 extends LargeInt { +export class Uint256 extends LargeInt { constructor(...args) { super(args); } @@ -14,4 +14,4 @@ export class U256 extends LargeInt { } } -U256.defineIntBoundaries(); +Uint256.defineIntBoundaries(); diff --git a/src/numbers/xdrint.js b/src/numbers/xdrint.js new file mode 100644 index 00000000..bd7ed834 --- /dev/null +++ b/src/numbers/xdrint.js @@ -0,0 +1,246 @@ +/* eslint no-bitwise: ["error", {"allow": [">>"]}] */ +import { Hyper, UnsignedHyper } from 'js-xdr'; + +import { Uint128 } from './u128'; +import { Int128 } from './i128'; +import { Int256 } from './i256'; +import { Uint256 } from './u256'; + +import xdr from '../xdr'; + +export class XdrInt { + int; // child class of a jsXdr.LargeInt + type; // string, one of i64, u64, i128, u128, i256, or u256 + + /** + * Transforms an opaque {@link xdr.ScVal} into a native BigInt, if possible. + * + * You can then give this back to create an {@link ScInt} instance, but the + * rationale here is that the native type is more likely to be immediately + * useful. + * + * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer + * @returns {bigint} the integer value, regardless of size (even 32-bit) + * @throws {TypeError} if the input value doesn't represent an integer + */ + static fromScVal(scv) { + switch (scv.switch().name) { + case 'scvU32': + case 'scvI32': + return BigInt(scv.value()); + + case 'scvU64': + case 'scvI64': + return scv.value().toBigInt(); + + case 'scvU128': + return new Uint128(scv.value().lo(), scv.value().hi()).toBigInt(); + + case 'scvI128': + return new Int128(scv.value().lo(), scv.value().hi()).toBigInt(); + + case 'scvU256': + return new Uint256( + scv.value().loLo(), + scv.value().loHi(), + scv.value().hiLo(), + scv.value().hiHi() + ).toBigInt(); + + case 'scvI256': + return new Int256( + scv.value().loLo(), + scv.value().loHi(), + scv.value().hiLo(), + scv.value().hiHi() + ).toBigInt(); + + default: + throw TypeError(`expected integer type, got ${scv.switch()}`); + } + } + + constructor(type, values) { + if (!(values instanceof Array)) { + values = [values]; + } + + // normalize values to one type + values = values.map((i) => { + // micro-optimization to no-op on the likeliest input value: + if (typeof i === 'bigint') { + return i; + } + if (i instanceof XdrInt) { + return i.toBigInt(); + } + return BigInt(i); + }); + + switch (type) { + case 'i64': + this.int = new Hyper(values); + break; + case 'i128': + this.int = new Int128(values); + break; + case 'i256': + this.int = new Int256(values); + break; + case 'u64': + this.int = new UnsignedHyper(values); + break; + case 'u128': + this.int = new Uint128(values); + break; + case 'u256': + this.int = new Uint256(values); + break; + default: + throw TypeError(`invalid type: ${type}`); + } + + this.type = type; + } + + /** + * @returns {number} + * @throws {RangeError} if the value can't fit into a Number + */ + toNumber() { + const bi = this.int.toBigInt(); + if (bi > Number.MAX_SAFE_INTEGER || bi < Number.MIN_SAFE_INTEGER) { + throw RangeError(`value ${bi} too large for Number`); + } + + return Number(bi); + } + + /** + * @returns {bigint} + */ + toBigInt() { + return this.int.toBigInt(); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = I64` + */ + toI64() { + this._sizeCheck(64); + const v = this.toBigInt(); + if (BigInt.asIntN(64, v) !== v) { + throw RangeError(`value too large for i64: ${v}`); + } + + return xdr.ScVal.scvI64(new xdr.Int64(v)); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = U64` + */ + toU64() { + this._sizeCheck(64); + return xdr.ScVal.scvU64( + new xdr.Uint64(BigInt.asUintN(64, this.toBigInt())) // reiterpret as unsigned + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = I128` + * @throws {RangeError} if the value cannot fit in 128 bits + */ + toI128() { + this._sizeCheck(128); + + const v = this.int.toBigInt(); + const hi64 = BigInt.asIntN(64, v >> 64n); // encode top 64 w/ sign bit + const lo64 = BigInt.asUintN(64, v); // grab btm 64, encode sign + + return xdr.ScVal.scvI128( + new xdr.Int128Parts({ + hi: new xdr.Int64(hi64), + lo: new xdr.Uint64(lo64) + }) + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = U128` + * @throws {RangeError} if the value cannot fit in 128 bits + */ + toU128() { + this._sizeCheck(128); + const v = this.int.toBigInt(); + + return xdr.ScVal.scvU128( + new xdr.UInt128Parts({ + hi: new xdr.Uint64(BigInt.asUintN(64, v >> 64n)), + lo: new xdr.Uint64(BigInt.asUintN(64, v)) + }) + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = I256` + */ + toI256() { + const v = this.int.toBigInt(); + const hiHi64 = BigInt.asIntN(64, v >> 192n); // keep sign bit + const hiLo64 = BigInt.asUintN(64, v >> 128n); + const loHi64 = BigInt.asUintN(64, v >> 64n); + const loLo64 = BigInt.asUintN(64, v); + + return xdr.ScVal.scvI256( + new xdr.Int256Parts({ + hiHi: new xdr.Int64(hiHi64), + hiLo: new xdr.Uint64(hiLo64), + loHi: new xdr.Uint64(loHi64), + loLo: new xdr.Uint64(loLo64) + }) + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = U256` + */ + toU256() { + const v = this.int.toBigInt(); + const hiHi64 = BigInt.asUintN(64, v >> 192n); // encode sign bit + const hiLo64 = BigInt.asUintN(64, v >> 128n); + const loHi64 = BigInt.asUintN(64, v >> 64n); + const loLo64 = BigInt.asUintN(64, v); + + return xdr.ScVal.scvU256( + new xdr.UInt256Parts({ + hiHi: new xdr.Uint64(hiHi64), + hiLo: new xdr.Uint64(hiLo64), + loHi: new xdr.Uint64(loHi64), + loLo: new xdr.Uint64(loLo64) + }) + ); + } + + valueOf() { + return this.int.valueOf(); + } + + toString() { + return this.int.toString(); + } + + toJSON() { + return { + value: this.toBigInt().toString(), + type: this.type + }; + } + + _sizeCheck(bits) { + if (this.int.size > bits) { + throw RangeError(`value too large for ${bits} bits (${this.type})`); + } + } +} + +export { Uint128, Int128, Uint256, Int256 }; diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js index 581f2d2c..380b6b47 100644 --- a/test/unit/i256_test.js +++ b/test/unit/i256_test.js @@ -1,36 +1,5 @@ -import { XdrWriter, XdrReader } from 'js-xdr'; -import { I256 } from '../../src/numbers/scint'; - -// describe('I256.read', function () { -// it('decodes correctly', function () { -// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(0)); -// expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])).to.eql(new I256(1)); -// expect(read([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(-1)); -// expect(read([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(I256.MAX_VALUE)); -// expect(read([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(I256.MIN_VALUE)); -// }); - -// function read(bytes) { -// let io = new XdrReader(bytes); -// return I256.read(io); -// } -// }); - -// describe('I256.write', function () { -// it('encodes correctly', function () { -// expect(write(new I256(0))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); -// expect(write(new I256(1))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]); -// expect(write(new I256(-1))).to.eql([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); -// expect(write(I256.MAX_VALUE)).to.eql([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); -// expect(write(I256.MIN_VALUE)).to.eql([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); -// }); - -// function write(value) { -// let io = new XdrWriter(8); -// I256.write(value, io); -// return io.toArray(); -// } -// }); +// import { XdrWriter, XdrReader } from 'js-xdr'; +const I256 = StellarBase.Int256; // shorthand describe('I256.isValid', function () { it('returns true for I256 instances', function () { @@ -86,3 +55,36 @@ describe('I256.fromString', function () { expect(() => I256.fromString('105946095601.5')).to.throw(/Invalid/); }); }); + +/* +describe('Int256.read', function () { + it('decodes correctly', function () { + expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(0)); + expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])).to.eql(new I256(1)); + expect(read([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(-1)); + expect(read([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(I256.MAX_VALUE)); + expect(read([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(I256.MIN_VALUE)); + }); + + function read(bytes) { + let io = new XdrReader(bytes); + return I256.read(io); + } +}); + +describe('I256.write', function () { + it('encodes correctly', function () { + expect(write(new I256(0))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + expect(write(new I256(1))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]); + expect(write(new I256(-1))).to.eql([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); + expect(write(I256.MAX_VALUE)).to.eql([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); + expect(write(I256.MIN_VALUE)).to.eql([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + }); + + function write(value) { + let io = new XdrWriter(8); + I256.write(value, io); + return io.toArray(); + } +}); +*/ diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index 5b189aa1..9fc869b5 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -1,5 +1,11 @@ -import { I128, U128, I256, U256 } from '../../src/numbers/scint'; -import xdr from '../../src/xdr'; +import { + Int128 as I128, + Uint128 as U128, + Int256 as I256, + Uint256 as U256 +} from '../../src/numbers/xdrint'; + +const xdr = StellarBase.xdr; // shorthand describe('creating large integers', function () { describe('picks the right types', function () { diff --git a/types/index.d.ts b/types/index.d.ts index 2a18340e..d0053266 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1062,8 +1062,11 @@ export type ScIntType = | 'i256' | 'u256'; -export class ScInt { - constructor(value: number|bigint|string|ScInt, opts: { type: ScIntType }); +export class XdrInt { + constructor( + type: ScIntType, + values: number|bigint|string|ScInt|Array + ); static fromScVal(scv: xdr.ScVal): bigint; toNumber(): number; @@ -1083,3 +1086,7 @@ export class ScInt { type: ScIntType; }; } + +export class ScInt extends XdrInt { + constructor(value: number|bigint|string|ScInt, opts: { type: ScIntType }); +} From 273b1bc53c9606a5a93ddc66d4ac5dd5f5976788 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 7 Jun 2023 12:34:53 -0700 Subject: [PATCH 20/34] Finish file breakout --- src/numbers/{i128.js => int128.js} | 0 src/numbers/{i256.js => int256.js} | 0 src/numbers/{u128.js => uint128.js} | 0 src/numbers/{u256.js => uint256.js} | 0 src/numbers/xdrint.js | 8 ++++---- 5 files changed, 4 insertions(+), 4 deletions(-) rename src/numbers/{i128.js => int128.js} (100%) rename src/numbers/{i256.js => int256.js} (100%) rename src/numbers/{u128.js => uint128.js} (100%) rename src/numbers/{u256.js => uint256.js} (100%) diff --git a/src/numbers/i128.js b/src/numbers/int128.js similarity index 100% rename from src/numbers/i128.js rename to src/numbers/int128.js diff --git a/src/numbers/i256.js b/src/numbers/int256.js similarity index 100% rename from src/numbers/i256.js rename to src/numbers/int256.js diff --git a/src/numbers/u128.js b/src/numbers/uint128.js similarity index 100% rename from src/numbers/u128.js rename to src/numbers/uint128.js diff --git a/src/numbers/u256.js b/src/numbers/uint256.js similarity index 100% rename from src/numbers/u256.js rename to src/numbers/uint256.js diff --git a/src/numbers/xdrint.js b/src/numbers/xdrint.js index bd7ed834..1029e719 100644 --- a/src/numbers/xdrint.js +++ b/src/numbers/xdrint.js @@ -1,10 +1,10 @@ /* eslint no-bitwise: ["error", {"allow": [">>"]}] */ import { Hyper, UnsignedHyper } from 'js-xdr'; -import { Uint128 } from './u128'; -import { Int128 } from './i128'; -import { Int256 } from './i256'; -import { Uint256 } from './u256'; +import { Uint128 } from './uint128'; +import { Uint256 } from './uint256'; +import { Int128 } from './int128'; +import { Int256 } from './int256'; import xdr from '../xdr'; From cd7e2ec5143be91168cb4ede54a80201700d4d15 Mon Sep 17 00:00:00 2001 From: George Date: Wed, 7 Jun 2023 13:18:31 -0700 Subject: [PATCH 21/34] Fix constructor signature --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index d0053266..7820c7d4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1065,7 +1065,7 @@ export type ScIntType = export class XdrInt { constructor( type: ScIntType, - values: number|bigint|string|ScInt|Array + values: number|bigint|string|Array ); static fromScVal(scv: xdr.ScVal): bigint; From fea88ede502bec1ab5f86c309ef02a265eba894b Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 8 Jun 2023 11:18:20 -0700 Subject: [PATCH 22/34] Rename to match the rest of the repo --- src/numbers/{scint.js => sc_int.js} | 0 src/numbers/{xdrint.js => xdr_int.js} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/numbers/{scint.js => sc_int.js} (100%) rename src/numbers/{xdrint.js => xdr_int.js} (100%) diff --git a/src/numbers/scint.js b/src/numbers/sc_int.js similarity index 100% rename from src/numbers/scint.js rename to src/numbers/sc_int.js diff --git a/src/numbers/xdrint.js b/src/numbers/xdr_int.js similarity index 100% rename from src/numbers/xdrint.js rename to src/numbers/xdr_int.js From ee42e308af5dc3727d305c9a2068b594efbb6efa Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 8 Jun 2023 11:36:14 -0700 Subject: [PATCH 23/34] Modify error message to include Number range --- src/numbers/xdr_int.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/numbers/xdr_int.js b/src/numbers/xdr_int.js index 1029e719..be2c4c87 100644 --- a/src/numbers/xdr_int.js +++ b/src/numbers/xdr_int.js @@ -110,7 +110,10 @@ export class XdrInt { toNumber() { const bi = this.int.toBigInt(); if (bi > Number.MAX_SAFE_INTEGER || bi < Number.MIN_SAFE_INTEGER) { - throw RangeError(`value ${bi} too large for Number`); + throw RangeError( + `value ${bi} not in range for Number ` + + `[${Number.MAX_SAFE_INTEGER}, ${Number.MIN_SAFE_INTEGER}]` + ); } return Number(bi); From 66b7a655946942c1960f6e56dd90dec27093c407 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 8 Jun 2023 11:36:47 -0700 Subject: [PATCH 24/34] Move fn since it isn't a static constructor --- src/numbers/xdr_int.js | 98 +++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/src/numbers/xdr_int.js b/src/numbers/xdr_int.js index be2c4c87..67126a46 100644 --- a/src/numbers/xdr_int.js +++ b/src/numbers/xdr_int.js @@ -12,54 +12,6 @@ export class XdrInt { int; // child class of a jsXdr.LargeInt type; // string, one of i64, u64, i128, u128, i256, or u256 - /** - * Transforms an opaque {@link xdr.ScVal} into a native BigInt, if possible. - * - * You can then give this back to create an {@link ScInt} instance, but the - * rationale here is that the native type is more likely to be immediately - * useful. - * - * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer - * @returns {bigint} the integer value, regardless of size (even 32-bit) - * @throws {TypeError} if the input value doesn't represent an integer - */ - static fromScVal(scv) { - switch (scv.switch().name) { - case 'scvU32': - case 'scvI32': - return BigInt(scv.value()); - - case 'scvU64': - case 'scvI64': - return scv.value().toBigInt(); - - case 'scvU128': - return new Uint128(scv.value().lo(), scv.value().hi()).toBigInt(); - - case 'scvI128': - return new Int128(scv.value().lo(), scv.value().hi()).toBigInt(); - - case 'scvU256': - return new Uint256( - scv.value().loLo(), - scv.value().loHi(), - scv.value().hiLo(), - scv.value().hiHi() - ).toBigInt(); - - case 'scvI256': - return new Int256( - scv.value().loLo(), - scv.value().loHi(), - scv.value().hiLo(), - scv.value().hiHi() - ).toBigInt(); - - default: - throw TypeError(`expected integer type, got ${scv.switch()}`); - } - } - constructor(type, values) { if (!(values instanceof Array)) { values = [values]; @@ -246,4 +198,54 @@ export class XdrInt { } } +/** + * Transforms an opaque {@link xdr.ScVal} into a native bigint, if possible. + * + * If you then want to use this in the abstractions provided by this module, + * you can pass it to the constructor of {@link XdrInt}. + * + * @example + * ```js + * let scv = contract.call("add", x, y); // assume it returns an xdr.ScVal + * let bigi = convertScVal(scv); + * + * new ScInt(bigi); // if you don't care about types, and + * new XdrInt('i128', bigi); // if you do + * ``` + * + * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer + * @returns {bigint} the native value of this input value + * + * @throws {TypeError} if the `scv` input value doesn't represent an integer + */ +export function convertScVal(scv) { + const type = scv.switch().name.slice(3).toLowerCase(); + + switch (scv.switch().name) { + case 'scvU32': + case 'scvI32': + return BigInt(scv.value()); + + case 'scvU64': + case 'scvI64': + return new XdrInt(type, scv.value()).toBigInt(); + + case 'scvU128': + case 'scvI128': + return new XdrInt(type, [scv.value().lo(), scv.value().hi()]).toBigInt(); + + case 'scvU256': + case 'scvI256': + return new XdrInt(type, [ + scv.value().loLo(), + scv.value().loHi(), + scv.value().hiLo(), + scv.value().hiHi() + ]).toBigInt(); + + default: + throw TypeError(`expected integer type, got ${scv.switch()}`); + } +} + export { Uint128, Int128, Uint256, Int256 }; From 229d856d2997412de019666ac83eae1c77030ea8 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 8 Jun 2023 11:38:32 -0700 Subject: [PATCH 25/34] Rename and do exports properly --- src/index.js | 2 +- src/numbers/sc_int.js | 4 ++-- src/numbers/xdr_int.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index ed072498..e57eeb49 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; -export { ScInt, XdrInt } from './numbers/scint'; +export { ScInt, XdrInt, scValToInt } from './numbers/scint'; export { Uint256, Int256, Uint128, Int128 } from './numbers/xdrint'; export default module.exports; diff --git a/src/numbers/sc_int.js b/src/numbers/sc_int.js index 950f0948..88a46a84 100644 --- a/src/numbers/sc_int.js +++ b/src/numbers/sc_int.js @@ -1,6 +1,6 @@ -import { XdrInt } from './xdrint'; +import { XdrInt, scValToInt } from './xdrint'; -export { XdrInt }; +export { XdrInt, scValToInt }; /** * Provides an easier way to manipulate large numbers for Stellar operations. diff --git a/src/numbers/xdr_int.js b/src/numbers/xdr_int.js index 67126a46..3ed6f11f 100644 --- a/src/numbers/xdr_int.js +++ b/src/numbers/xdr_int.js @@ -207,7 +207,7 @@ export class XdrInt { * @example * ```js * let scv = contract.call("add", x, y); // assume it returns an xdr.ScVal - * let bigi = convertScVal(scv); + * let bigi = scValToInt(scv); * * new ScInt(bigi); // if you don't care about types, and * new XdrInt('i128', bigi); // if you do @@ -218,7 +218,7 @@ export class XdrInt { * * @throws {TypeError} if the `scv` input value doesn't represent an integer */ -export function convertScVal(scv) { +export function scValToInt(scv) { const type = scv.switch().name.slice(3).toLowerCase(); switch (scv.switch().name) { From 6f902efeff7e6513010c80fde429c6fe2003ff7c Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 8 Jun 2023 11:40:20 -0700 Subject: [PATCH 26/34] Fix docstring & relative filenames --- src/index.js | 4 ++-- src/numbers/sc_int.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index e57eeb49..3e2d0839 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; -export { ScInt, XdrInt, scValToInt } from './numbers/scint'; -export { Uint256, Int256, Uint128, Int128 } from './numbers/xdrint'; +export { ScInt, XdrInt, scValToInt } from './numbers/sc_int'; +export { Uint256, Int256, Uint128, Int128 } from './numbers/xdr_int'; export default module.exports; diff --git a/src/numbers/sc_int.js b/src/numbers/sc_int.js index 88a46a84..527ca681 100644 --- a/src/numbers/sc_int.js +++ b/src/numbers/sc_int.js @@ -1,4 +1,4 @@ -import { XdrInt, scValToInt } from './xdrint'; +import { XdrInt, scValToInt } from './xdr_int'; export { XdrInt, scValToInt }; @@ -10,8 +10,8 @@ export { XdrInt, scValToInt }; * * If you need to create a native BigInt from a list of integer "parts" (for * example, you have a series of encoded 32-bit integers that represent a larger - * value), you should use the specific XDR type, like {@link U128}. For example, - * you could do `new U128(values...).toBigInt()`. + * value), you can use the lower level abstraction {@link XdrInt}. For example, + * you could do `new XdrInt('u128', bytes...).toBigInt()`. * * @example * ```js From 4f3d9d0138f5851e98328caf90335f142e6af165 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 8 Jun 2023 11:41:56 -0700 Subject: [PATCH 27/34] One last rename fix, I hope --- test/unit/scint_test.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index 9fc869b5..85bde8c6 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -1,10 +1,7 @@ -import { - Int128 as I128, - Uint128 as U128, - Int256 as I256, - Uint256 as U256 -} from '../../src/numbers/xdrint'; - +const I128 = StellarBase.Int128; +const U128 = StellarBase.Uint128; +const I256 = StellarBase.Int256; +const U256 = StellarBase.Uint256; const xdr = StellarBase.xdr; // shorthand describe('creating large integers', function () { From ab0b4af99de004bbc7ee1f0a3352bdbc7f83bbc0 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 8 Jun 2023 13:02:33 -0700 Subject: [PATCH 28/34] Update all tests to match renames --- test/unit/scint_test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index 85bde8c6..c6c5e61f 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -130,7 +130,7 @@ describe('creating large integers', function () { it('handles inputs', function () { let b = new StellarBase.ScInt(sentinel); expect(b.toBigInt()).to.equal(sentinel); - expect(() => b.toNumber()).to.throw(/too large/i); + expect(() => b.toNumber()).to.throw(/not in range/i); expect(() => b.toU64()).to.throw(/too large/i); expect(() => b.toI64()).to.throw(/too large/i); @@ -227,7 +227,7 @@ describe('creating large integers', function () { expect(scv.switch().name).to.equal(`scv${type.toUpperCase()}`); expect(typeof scv.toXDR('base64')).to.equal('string'); - const bigi = StellarBase.ScInt.fromScVal(scv); + const bigi = StellarBase.scValToInt(scv); expect(bigi).to.equal(v); expect(new StellarBase.ScInt(bigi, { type }).toJSON()).to.eql({ ...i.toJSON(), @@ -240,13 +240,13 @@ describe('creating large integers', function () { const i32 = new xdr.ScVal.scvI32(Number(v)); const u32 = new xdr.ScVal.scvU32(Number(v)); - expect(StellarBase.ScInt.fromScVal(i32)).to.equal(v); - expect(StellarBase.ScInt.fromScVal(u32)).to.equal(v); + expect(StellarBase.scValToInt(i32)).to.equal(v); + expect(StellarBase.scValToInt(u32)).to.equal(v); }); it('throws for non-integers', function () { expect(() => - StellarBase.ScInt.fromScVal(new xdr.ScVal.scvString('hello')) + StellarBase.scValToInt(new xdr.ScVal.scvString('hello')) ).to.throw(/integer/i); }); }); @@ -266,10 +266,10 @@ describe('creating large integers', function () { let big; big = new StellarBase.ScInt(1n << 64n); - expect(() => big.toNumber()).to.throw(/too large/i); + expect(() => big.toNumber()).to.throw(/not in range/i); big = new StellarBase.ScInt(Number.MAX_SAFE_INTEGER + 1); - expect(() => big.toNumber()).to.throw(/too large/i); + expect(() => big.toNumber()).to.throw(/not in range/i); big = new StellarBase.ScInt(1, { type: 'i128' }); expect(() => big.toU64()).to.throw(/too large/i); From 193f820dd3770d03ff740756fd382eeda242ce75 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 13 Jun 2023 16:50:56 -0700 Subject: [PATCH 29/34] Renames per PR review suggestions --- package.json | 2 +- src/index.js | 2 +- src/numbers/index.js | 54 +++++++++++++++++++++++++++++++++++++++++ src/numbers/int128.js | 6 +++++ src/numbers/int256.js | 6 +++++ src/numbers/sc_int.js | 10 +++----- src/numbers/uint128.js | 6 +++++ src/numbers/uint256.js | 6 +++++ src/numbers/xdr_int.js | 54 ++--------------------------------------- test/unit/scint_test.js | 10 ++++---- types/index.d.ts | 9 ++++--- types/test.ts | 7 ++++++ yarn.lock | 4 +-- 13 files changed, 105 insertions(+), 71 deletions(-) create mode 100644 src/numbers/index.js diff --git a/package.json b/package.json index ebd5f7b7..68796af7 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "buffer": "^6.0.3", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "js-xdr": "git+https://github.com/stellar/js-xdr#ad2e43e", + "js-xdr": "git+https://github.com/stellar/js-xdr#6d3484c", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" diff --git a/src/index.js b/src/index.js index 3e2d0839..c156f59c 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; -export { ScInt, XdrInt, scValToInt } from './numbers/sc_int'; +export { ScInt, XdrLargeInt, scValToBigInt } from './numbers/index'; export { Uint256, Int256, Uint128, Int128 } from './numbers/xdr_int'; export default module.exports; diff --git a/src/numbers/index.js b/src/numbers/index.js new file mode 100644 index 00000000..11c23518 --- /dev/null +++ b/src/numbers/index.js @@ -0,0 +1,54 @@ +import { XdrLargeInt } from './xdr_int'; + +export { ScInt } from './sc_int'; +export { XdrLargeInt }; + +/** + * Transforms an opaque {@link xdr.ScVal} into a native bigint, if possible. + * + * If you then want to use this in the abstractions provided by this module, + * you can pass it to the constructor of {@link XdrLargeInt}. + * + * @example + * ```js + * let scv = contract.call("add", x, y); // assume it returns an xdr.ScVal + * let bigi = scValToBigInt(scv); + * + * new ScInt(bigi); // if you don't care about types, and + * new XdrLargeInt('i128', bigi); // if you do + * ``` + * + * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer + * @returns {bigint} the native value of this input value + * + * @throws {TypeError} if the `scv` input value doesn't represent an integer + */ +export function scValToBigInt(scv) { + const type = scv.switch().name.slice(3).toLowerCase(); + + switch (scv.switch().name) { + case 'scvU32': + case 'scvI32': + return BigInt(scv.value()); + + case 'scvU64': + case 'scvI64': + return new XdrLargeInt(type, scv.value()).toBigInt(); + + case 'scvU128': + case 'scvI128': + return new XdrLargeInt(type, [scv.value().lo(), scv.value().hi()]).toBigInt(); + + case 'scvU256': + case 'scvI256': + return new XdrLargeInt(type, [ + scv.value().loLo(), + scv.value().loHi(), + scv.value().hiLo(), + scv.value().hiHi() + ]).toBigInt(); + + default: + throw TypeError(`expected integer type, got ${scv.switch()}`); + } +} diff --git a/src/numbers/int128.js b/src/numbers/int128.js index e8968551..a543342a 100644 --- a/src/numbers/int128.js +++ b/src/numbers/int128.js @@ -1,6 +1,12 @@ import { LargeInt } from 'js-xdr'; export class Int128 extends LargeInt { + /** + * Construct a signed 128-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ constructor(...args) { super(args); } diff --git a/src/numbers/int256.js b/src/numbers/int256.js index 1f6cbbc3..76e155c3 100644 --- a/src/numbers/int256.js +++ b/src/numbers/int256.js @@ -1,6 +1,12 @@ import { LargeInt } from 'js-xdr'; export class Int256 extends LargeInt { + /** + * Construct a signed 256-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ constructor(...args) { super(args); } diff --git a/src/numbers/sc_int.js b/src/numbers/sc_int.js index 527ca681..19b0c2a7 100644 --- a/src/numbers/sc_int.js +++ b/src/numbers/sc_int.js @@ -1,6 +1,4 @@ -import { XdrInt, scValToInt } from './xdr_int'; - -export { XdrInt, scValToInt }; +import { XdrLargeInt } from './xdr_int'; /** * Provides an easier way to manipulate large numbers for Stellar operations. @@ -10,8 +8,8 @@ export { XdrInt, scValToInt }; * * If you need to create a native BigInt from a list of integer "parts" (for * example, you have a series of encoded 32-bit integers that represent a larger - * value), you can use the lower level abstraction {@link XdrInt}. For example, - * you could do `new XdrInt('u128', bytes...).toBigInt()`. + * value), you can use the lower level abstraction {@link XdrLargeInt}. For example, + * you could do `new XdrLargeInt('u128', bytes...).toBigInt()`. * * @example * ```js @@ -77,7 +75,7 @@ export { XdrInt, scValToInt }; * * @throws {SyntaxError} if a string `value` can't be parsed as a big integer */ -export class ScInt extends XdrInt { +export class ScInt extends XdrLargeInt { constructor(value, opts) { const signed = value < 0; let type = opts?.type ?? ''; diff --git a/src/numbers/uint128.js b/src/numbers/uint128.js index b32415d9..1f064232 100644 --- a/src/numbers/uint128.js +++ b/src/numbers/uint128.js @@ -1,6 +1,12 @@ import { LargeInt } from 'js-xdr'; export class Uint128 extends LargeInt { + /** + * Construct an unsigned 128-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ constructor(...args) { super(args); } diff --git a/src/numbers/uint256.js b/src/numbers/uint256.js index 5771b229..c7ac461f 100644 --- a/src/numbers/uint256.js +++ b/src/numbers/uint256.js @@ -1,6 +1,12 @@ import { LargeInt } from 'js-xdr'; export class Uint256 extends LargeInt { + /** + * Construct an unsigned 256-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ constructor(...args) { super(args); } diff --git a/src/numbers/xdr_int.js b/src/numbers/xdr_int.js index 3ed6f11f..723aa94c 100644 --- a/src/numbers/xdr_int.js +++ b/src/numbers/xdr_int.js @@ -8,7 +8,7 @@ import { Int256 } from './int256'; import xdr from '../xdr'; -export class XdrInt { +export class XdrLargeInt { int; // child class of a jsXdr.LargeInt type; // string, one of i64, u64, i128, u128, i256, or u256 @@ -23,7 +23,7 @@ export class XdrInt { if (typeof i === 'bigint') { return i; } - if (i instanceof XdrInt) { + if (i instanceof XdrLargeInt) { return i.toBigInt(); } return BigInt(i); @@ -198,54 +198,4 @@ export class XdrInt { } } -/** - * Transforms an opaque {@link xdr.ScVal} into a native bigint, if possible. - * - * If you then want to use this in the abstractions provided by this module, - * you can pass it to the constructor of {@link XdrInt}. - * - * @example - * ```js - * let scv = contract.call("add", x, y); // assume it returns an xdr.ScVal - * let bigi = scValToInt(scv); - * - * new ScInt(bigi); // if you don't care about types, and - * new XdrInt('i128', bigi); // if you do - * ``` - * - * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer - * @returns {bigint} the native value of this input value - * - * @throws {TypeError} if the `scv` input value doesn't represent an integer - */ -export function scValToInt(scv) { - const type = scv.switch().name.slice(3).toLowerCase(); - - switch (scv.switch().name) { - case 'scvU32': - case 'scvI32': - return BigInt(scv.value()); - - case 'scvU64': - case 'scvI64': - return new XdrInt(type, scv.value()).toBigInt(); - - case 'scvU128': - case 'scvI128': - return new XdrInt(type, [scv.value().lo(), scv.value().hi()]).toBigInt(); - - case 'scvU256': - case 'scvI256': - return new XdrInt(type, [ - scv.value().loLo(), - scv.value().loHi(), - scv.value().hiLo(), - scv.value().hiHi() - ]).toBigInt(); - - default: - throw TypeError(`expected integer type, got ${scv.switch()}`); - } -} - export { Uint128, Int128, Uint256, Int256 }; diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js index c6c5e61f..5666bef8 100644 --- a/test/unit/scint_test.js +++ b/test/unit/scint_test.js @@ -227,7 +227,7 @@ describe('creating large integers', function () { expect(scv.switch().name).to.equal(`scv${type.toUpperCase()}`); expect(typeof scv.toXDR('base64')).to.equal('string'); - const bigi = StellarBase.scValToInt(scv); + const bigi = StellarBase.scValToBigInt(scv); expect(bigi).to.equal(v); expect(new StellarBase.ScInt(bigi, { type }).toJSON()).to.eql({ ...i.toJSON(), @@ -240,13 +240,13 @@ describe('creating large integers', function () { const i32 = new xdr.ScVal.scvI32(Number(v)); const u32 = new xdr.ScVal.scvU32(Number(v)); - expect(StellarBase.scValToInt(i32)).to.equal(v); - expect(StellarBase.scValToInt(u32)).to.equal(v); + expect(StellarBase.scValToBigInt(i32)).to.equal(v); + expect(StellarBase.scValToBigInt(u32)).to.equal(v); }); it('throws for non-integers', function () { expect(() => - StellarBase.scValToInt(new xdr.ScVal.scvString('hello')) + StellarBase.scValToBigInt(new xdr.ScVal.scvString('hello')) ).to.throw(/integer/i); }); }); @@ -293,7 +293,7 @@ describe('creating raw large XDR integers', function () { ].forEach(([type, count], idx) => { it(`works for ${type}`, function () { const input = new Array(count).fill(1n); - const xdrI = new StellarBase.XdrInt(type, input); + const xdrI = new StellarBase.XdrLargeInt(type, input); let expected = input.reduce((accum, v, i) => { return (accum << 32n) | v; diff --git a/types/index.d.ts b/types/index.d.ts index 7820c7d4..7ef44a2c 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1062,12 +1062,11 @@ export type ScIntType = | 'i256' | 'u256'; -export class XdrInt { +export class XdrLargeInt { constructor( type: ScIntType, values: number|bigint|string|Array ); - static fromScVal(scv: xdr.ScVal): bigint; toNumber(): number; toBigInt(): bigint; @@ -1087,6 +1086,8 @@ export class XdrInt { }; } -export class ScInt extends XdrInt { - constructor(value: number|bigint|string|ScInt, opts: { type: ScIntType }); +export class ScInt extends XdrLargeInt { + constructor(value: number|bigint|string|ScInt, opts?: { type: ScIntType }); } + +export function scValToBigInt(scv: xdr.ScVal): bigint; diff --git a/types/test.ts b/types/test.ts index f5467262..2b5fcb4c 100644 --- a/types/test.ts +++ b/types/test.ts @@ -348,3 +348,10 @@ const sk = StellarSdk.xdr.SignerKey.signerKeyTypeEd25519SignedPayload( ); StellarSdk.SignerKey.encodeSignerKey(sk); // $ExpectType string StellarSdk.SignerKey.decodeAddress(sourceKey.publicKey()); // $ExpectType SignerKey + +new StellarSdk.ScInt(1234); // $ExpectType ScInt +new StellarSdk.ScInt('1234'); // $ExpectType ScInt +new StellarSdk.ScInt(BigInt(1234)); // $ExpectType ScInt +(['i64', 'u64', 'i128', 'u128', 'i256', 'u256'] as StellarSdk.ScIntType[]).forEach((type) => { + new StellarSdk.ScInt(1234, { type }); // $ExpectType ScInt +}); diff --git a/yarn.lock b/yarn.lock index bfddd069..4605d378 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4350,9 +4350,9 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -"js-xdr@git+https://github.com/stellar/js-xdr#a3eb0e6": +"js-xdr@git+https://github.com/stellar/js-xdr#ad2e43e": version "3.0.0" - resolved "git+https://github.com/stellar/js-xdr#a3eb0e6f2edd2ffe8099290978045a585b28066b" + resolved "git+https://github.com/stellar/js-xdr#ad2e43e5b7cc31edd2169043ab90ad2b82d113e8" js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" From 688be0a23db1d389e1dff8ca84781cfa90705c8c Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 14 Jun 2023 13:34:11 -0700 Subject: [PATCH 30/34] Add reference to js-xdr master commit, fixup test --- package.json | 2 +- src/numbers/index.js | 5 +- test/unit/i256_test.js | 2 +- yarn.lock | 2028 ++++++++++++++++++++-------------------- 4 files changed, 1041 insertions(+), 996 deletions(-) diff --git a/package.json b/package.json index 68796af7..29bf1f19 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "buffer": "^6.0.3", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "js-xdr": "git+https://github.com/stellar/js-xdr#6d3484c", + "js-xdr": "git+https://github.com/stellar/js-xdr#5dd43fb", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" diff --git a/src/numbers/index.js b/src/numbers/index.js index 11c23518..3d892d1a 100644 --- a/src/numbers/index.js +++ b/src/numbers/index.js @@ -37,7 +37,10 @@ export function scValToBigInt(scv) { case 'scvU128': case 'scvI128': - return new XdrLargeInt(type, [scv.value().lo(), scv.value().hi()]).toBigInt(); + return new XdrLargeInt(type, [ + scv.value().lo(), + scv.value().hi() + ]).toBigInt(); case 'scvU256': case 'scvI256': diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js index 380b6b47..6aa3f8c8 100644 --- a/test/unit/i256_test.js +++ b/test/unit/i256_test.js @@ -52,7 +52,7 @@ describe('I256.fromString', function () { }); it('fails when providing a string with a decimal place', function () { - expect(() => I256.fromString('105946095601.5')).to.throw(/Invalid/); + expect(() => I256.fromString('105946095601.5')).to.throw(/bigint-like/); }); }); diff --git a/yarn.lock b/yarn.lock index 4605d378..7decbc22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11,9 +11,9 @@ "@jridgewell/trace-mapping" "^0.3.9" "@babel/cli@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.21.5.tgz#a685a5b50b785f2edfbf6e042c1265c653547d9d" - integrity sha512-TOKytQ9uQW9c4np8F+P7ZfPINy5Kv+pizDIUwSVH8X5zHgYHV4AA8HE5LA450xXeu4jEfmUckTYvv1I4S26M/g== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.22.5.tgz#eb323bd69f50297792c2b7c205a97306a305d703" + integrity sha512-N5d7MjzwsQ2wppwjhrsicVDhJSqF9labEP/swYiHhio4Ca2XjEehpgPmerjnLQl7BPE59BLud0PTWGYwqFl/cQ== dependencies: "@jridgewell/trace-mapping" "^0.3.17" commander "^4.0.1" @@ -26,33 +26,33 @@ "@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== +"@babel/code-frame@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" + integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== dependencies: - "@babel/highlight" "^7.18.6" + "@babel/highlight" "^7.22.5" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.5": - version "7.21.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.7.tgz#61caffb60776e49a57ba61a88f02bedd8714f6bc" - integrity sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA== +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.5.tgz#b1f6c86a02d85d2dd3368a2b67c09add8cd0c255" + integrity sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA== "@babel/core@^7.12.3", "@babel/core@^7.21.8", "@babel/core@^7.7.5": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.8.tgz#2a8c7f0f53d60100ba4c32470ba0281c92aa9aa4" - integrity sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.5.tgz#d67d9747ecf26ee7ecd3ebae1ee22225fe902a89" + integrity sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.5" - "@babel/helper-compilation-targets" "^7.21.5" - "@babel/helper-module-transforms" "^7.21.5" - "@babel/helpers" "^7.21.5" - "@babel/parser" "^7.21.8" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" + "@babel/code-frame" "^7.22.5" + "@babel/generator" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helpers" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -60,84 +60,84 @@ semver "^6.3.0" "@babel/eslint-parser@^7.21.8": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.21.8.tgz#59fb6fc4f3b017ab86987c076226ceef7b2b2ef2" - integrity sha512-HLhI+2q+BP3sf78mFUZNCGc10KEmoUqtUT1OCdMZsN+qr4qFeLUod62/zAnF3jNQstwyasDkZnVXwfK2Bml7MQ== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.22.5.tgz#fa032503b9e2d188e25b1b95d29e8b8431042d78" + integrity sha512-C69RWYNYtrgIRE5CmTd77ZiLDXqgBipahJc/jHP3sLcAGj6AJzxNIuKNpVnICqbyK7X3pFUfEvL++rvtbQpZkQ== dependencies: "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" 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== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/eslint-plugin/-/eslint-plugin-7.22.5.tgz#47407d8c9e527b62ff75ee11e4baa6de3da7cf0e" + integrity sha512-lDXW06rf1sXywWWw+UdS/iYxRjrqhH4AXdPeKE4+fEgEoGBXcdIDQ+uCJOUcvCb0jCTvfwHOSXkwnfd24EAkLQ== dependencies: eslint-rule-composer "^0.3.0" -"@babel/generator@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.5.tgz#c0c0e5449504c7b7de8236d99338c3e2a340745f" - integrity sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w== +"@babel/generator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.5.tgz#1e7bf768688acfb05cf30b2369ef855e82d984f7" + integrity sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA== dependencies: - "@babel/types" "^7.21.5" + "@babel/types" "^7.22.5" "@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== +"@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.22.5" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.21.5.tgz#817f73b6c59726ab39f6ba18c234268a519e5abb" - integrity sha512-uNrjKztPLkUk7bpCNC0jEKDJzzkvel/W+HguzbN8krA+LPfC1CEobJEvAvGka2A/M+ViOqXdcRL0GqPUJSjx9g== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.5.tgz#a3f4758efdd0190d8927fcffd261755937c71878" + integrity sha512-m1EP3lVOPptR+2DwD125gziZNcmoNSHGmJROKoy87loWUQyJaVXDgpmruWqDARZSmtYQ+Dl25okU8+qhVzuykw== dependencies: - "@babel/types" "^7.21.5" + "@babel/types" "^7.22.5" -"@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.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.5.tgz#631e6cc784c7b660417421349aac304c94115366" - integrity sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w== +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz#fc7319fc54c5e2fa14b2909cf3c5fd3046813e02" + integrity sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw== dependencies: - "@babel/compat-data" "^7.21.5" - "@babel/helper-validator-option" "^7.21.0" + "@babel/compat-data" "^7.22.5" + "@babel/helper-validator-option" "^7.22.5" 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.8" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.8.tgz#205b26330258625ef8869672ebca1e0dee5a0f02" - integrity sha512-+THiN8MqiH2AczyuZrnrKL6cAxFRRQDKW9h1YkBvbgKmAm6mwiacig1qT73DHIWMGo40GRnsEfN3LA+E6NtmSw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-member-expression-to-functions" "^7.21.5" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.21.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" - "@babel/helper-split-export-declaration" "^7.18.6" +"@babel/helper-create-class-features-plugin@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz#2192a1970ece4685fbff85b48da2c32fcb130b7c" + integrity sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.5" semver "^6.3.0" -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.21.8.tgz#a7886f61c2e29e21fd4aaeaf1e473deba6b571dc" - integrity sha512-zGuSdedkFtsFHGbexAvNuipg1hbtitDLo2XE8/uf6Y9sOQV1xsYX/2pNbtedp/X0eU1pIt+kGvaqHCowkRbS5g== +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.5.tgz#bb2bf0debfe39b831986a4efbf4066586819c6e4" + integrity sha512-1VpEFOIbMRaXyDeUwUfmTIxExLwQ+zkW+Bh5zXpApA3oQedBx9v/updixWxnx/bZpKw7u8VxWjb/qWpIcmPq8A== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-annotate-as-pure" "^7.22.5" regexpu-core "^5.3.1" semver "^6.3.0" -"@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== +"@babel/helper-define-polyfill-provider@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.0.tgz#487053f103110f25b9755c5980e031e93ced24d8" + integrity sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg== dependencies: "@babel/helper-compilation-targets" "^7.17.7" "@babel/helper-plugin-utils" "^7.16.7" @@ -146,295 +146,179 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-environment-visitor@^7.18.9", "@babel/helper-environment-visitor@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz#c769afefd41d171836f7cb63e295bedf689d48ba" - integrity sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ== - -"@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.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.5.tgz#3b1a009af932e586af77c1030fba9ee0bde396c0" - integrity sha512-nIcGfgwpH2u4n9GG1HpStW5Ogx7x7ekiFHbjjFRKXbn5zUvqO9ZgotCO4x1aNbKn/x/xOUaXEhyNHCwtFCpxWg== - dependencies: - "@babel/types" "^7.21.5" - -"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.21.4": - 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.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.5.tgz#d937c82e9af68d31ab49039136a222b17ac0b420" - integrity sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw== - dependencies: - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-module-imports" "^7.21.4" - "@babel/helper-simple-access" "^7.21.5" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - -"@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.21.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz#345f2377d05a720a4e5ecfa39cbf4474a4daed56" - integrity sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg== - -"@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", "@babel/helper-replace-supers@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.21.5.tgz#a6ad005ba1c7d9bc2973dfde05a1bba7065dde3c" - integrity sha512-/y7vBgsr9Idu4M6MprbOVUfH3vs7tsIfnVWv/Ml2xgwvyH6LTngdfbf5AdsKwkJy4zgy1X/kuNrEKvhhK28Yrg== - dependencies: - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-member-expression-to-functions" "^7.21.5" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - -"@babel/helper-simple-access@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz#d697a7971a5c39eac32c7e63c0921c06c8a249ee" - integrity sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg== - dependencies: - "@babel/types" "^7.21.5" - -"@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.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" - integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== - -"@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.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.5.tgz#5bac66e084d7a4d2d9696bdf0175a93f7fb63c08" - integrity sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA== - dependencies: - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - -"@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" +"@babel/helper-environment-visitor@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" + integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== + +"@babel/helper-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" + integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== + dependencies: + "@babel/template" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-member-expression-to-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2" + integrity sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-imports@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" + integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-transforms@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz#0f65daa0716961b6e96b164034e737f60a80d2ef" + integrity sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-remap-async-to-generator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.5.tgz#14a38141a7bf2165ad38da61d61cf27b43015da2" + integrity sha512-cU0Sq1Rf4Z55fgz7haOakIyM7+x/uCFwXpLPaeRzfoUtAEAuUZjZvFPjL/rk5rW693dIgn2hng1W7xbT7lWT4g== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-wrap-function" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-replace-supers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz#71bc5fb348856dea9fdc4eafd7e2e49f585145dc" + integrity sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz#88cf11050edb95ed08d596f7a044462189127a08" + integrity sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" + integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== + +"@babel/helper-validator-option@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" + integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== + +"@babel/helper-wrap-function@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.5.tgz#44d205af19ed8d872b4eefb0d2fa65f45eb34f06" + integrity sha512-bYqLIBSEshYcYQyfks8ewYA8S30yaGSeRslcvKMvoUk6HHPySbxHq9YRi6ghhzEU+yhQv9bP/jXnygkStOcqZw== + dependencies: + "@babel/helper-function-name" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helpers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.5.tgz#74bb4373eb390d1ceed74a15ef97767e63120820" + integrity sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q== + dependencies: + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/highlight@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" + integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== + dependencies: + "@babel/helper-validator-identifier" "^7.22.5" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.14.7", "@babel/parser@^7.20.15", "@babel/parser@^7.20.7", "@babel/parser@^7.21.5", "@babel/parser@^7.21.8": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" - integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== - -"@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/parser@^7.14.7", "@babel/parser@^7.20.15", "@babel/parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.5.tgz#721fd042f3ce1896238cf1b341c77eb7dee7dbea" + integrity sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q== -"@babel/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== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" + integrity sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ== 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/helper-plugin-utils" "^7.22.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== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz#fef09f9499b1f1c930da8a0c419db42167d792ca" + integrity sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.5" -"@babel/plugin-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-private-property-in-object@7.21.0-placeholder-for-preset-env.2": + version "7.21.0-placeholder-for-preset-env.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" + integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== -"@babel/plugin-proposal-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": +"@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== @@ -477,12 +361,19 @@ dependencies: "@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== +"@babel/plugin-syntax-import-assertions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz#07d252e2aa0bc6125567f742cd58619cb14dce98" + integrity sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-import-attributes@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz#ab840248d834410b829f569f5262b9e517555ecb" + integrity sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -554,289 +445,421 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-arrow-functions@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.21.5.tgz#9bb42a53de447936a57ba256fbf537fc312b6929" - integrity sha512-wb1mhwGOCaXHDTcsRYMKF9e5bbMgqwxtqa2Y1ifH96dXJPwbuLX9qHy3clhrxVqgMz7nyNXs8VkxdH8UBcjKqA== +"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" + integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@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== +"@babel/plugin-transform-arrow-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz#e5ba566d0c58a5b2ba2a8b795450641950b71958" + integrity sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw== 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/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-async-generator-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.5.tgz#7336356d23380eda9a56314974f053a020dab0c3" + integrity sha512-gGOEvFzm3fWoyD5uZq7vVTD57pPJ3PczPUD/xCFGjzBpUosnklmXyKnGQbbbGs1NPNPskFex0j93yKbHt0cHyg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.5" + "@babel/plugin-syntax-async-generators" "^7.8.4" + +"@babel/plugin-transform-async-to-generator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz#c7a85f44e46f8952f6d27fe57c2ed3cc084c3775" + integrity sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ== + dependencies: + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.5" -"@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" +"@babel/plugin-transform-block-scoped-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz#27978075bfaeb9fa586d3cb63a3d30c1de580024" + integrity sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-block-scoping@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz#8bfc793b3a4b2742c0983fadc1480d843ecea31b" + integrity sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz#97a56e31ad8c9dc06a0b3710ce7803d5a48cca77" + integrity sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-class-static-block@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.5.tgz#3e40c46f048403472d6f4183116d5e46b1bff5ba" + integrity sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-transform-classes@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.5.tgz#635d4e98da741fad814984639f4c0149eb0135e1" + integrity sha512-2edQhLfibpWpsVBx2n/GKOz6JdGQvLruZQfGr9l1qes2KQaWswjBzhQF7UDUZMNaMMQeYnQzxwOMPsbYF7wqPQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.5" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.21.5.tgz#3a2d8bb771cd2ef1cd736435f6552fe502e11b44" - integrity sha512-TR653Ki3pAwxBxUe8srfF3e4Pe3FTA46uaNHYyQwIoM4oWKSoOZiDNyHJ0oIoDIUPSRQbQG7jzgVBX3FPVne1Q== +"@babel/plugin-transform-computed-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz#cd1e994bf9f316bd1c2dafcd02063ec261bb3869" + integrity sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" - "@babel/template" "^7.20.7" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/template" "^7.22.5" -"@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== +"@babel/plugin-transform-destructuring@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz#d3aca7438f6c26c78cdd0b0ba920a336001b27cc" + integrity sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-dotall-regex@^7.22.5", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz#dbb4f0e45766eb544e193fb00e65a1dd3b2a4165" + integrity sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-duplicate-keys@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz#b6e6428d9416f5f0bba19c70d1e6e7e0b88ab285" + integrity sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-dynamic-import@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.5.tgz#d6908a8916a810468c4edff73b5b75bda6ad393e" + integrity sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + +"@babel/plugin-transform-exponentiation-operator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz#402432ad544a1f9a480da865fda26be653e48f6a" + integrity sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-for-of@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.5.tgz#e890032b535f5a2e237a18535f56a9fdaa7b83fc" - integrity sha512-nYWpjKW/7j/I/mZkGVgHJXh4bA1sfdFnJoOXwJuj4m3Q2EraO/8ZyrkCau9P5tbHQk01RMSt6KYLCsW7730SXQ== +"@babel/plugin-transform-export-namespace-from@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.5.tgz#57c41cb1d0613d22f548fddd8b288eedb9973a5b" + integrity sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@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== +"@babel/plugin-transform-for-of@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz#ab1b8a200a8f990137aff9a084f8de4099ab173f" + integrity sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A== dependencies: - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz#935189af68b01898e0d6d99658db6b164205c143" + integrity sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-json-strings@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.5.tgz#14b64352fdf7e1f737eed68de1a1468bd2a77ec0" + integrity sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-json-strings" "^7.8.3" -"@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== +"@babel/plugin-transform-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz#e9341f4b5a167952576e23db8d435849b1dd7920" + integrity sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g== dependencies: - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.5.tgz#d69fb947eed51af91de82e4708f676864e5e47bc" - integrity sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ== +"@babel/plugin-transform-logical-assignment-operators@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.5.tgz#66ae5f068fd5a9a5dc570df16f56c2a8462a9d6c" + integrity sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA== dependencies: - "@babel/helper-module-transforms" "^7.21.5" - "@babel/helper-plugin-utils" "^7.21.5" - "@babel/helper-simple-access" "^7.21.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@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== +"@babel/plugin-transform-member-expression-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz#4fcc9050eded981a468347dd374539ed3e058def" + integrity sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew== 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/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-modules-amd@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz#4e045f55dcf98afd00f85691a68fc0780704f526" + integrity sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ== dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-modules-commonjs@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz#7d9875908d19b8c0536085af7b053fd5bd651bfa" + integrity sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" -"@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== +"@babel/plugin-transform-modules-systemjs@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz#18c31410b5e579a0092638f95c896c2a98a5d496" + integrity sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" -"@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== +"@babel/plugin-transform-modules-umd@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz#4694ae40a87b1745e3775b6a7fe96400315d4f98" + integrity sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" + integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-new-target@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz#1b248acea54ce44ea06dfd37247ba089fcf9758d" + integrity sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-nullish-coalescing-operator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz#f8872c65776e0b552e0849d7596cddd416c3e381" + integrity sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + +"@babel/plugin-transform-numeric-separator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.5.tgz#57226a2ed9e512b9b446517ab6fa2d17abb83f58" + integrity sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + +"@babel/plugin-transform-object-rest-spread@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.5.tgz#9686dc3447df4753b0b2a2fae7e8bc33cdc1f2e1" + integrity sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ== + dependencies: + "@babel/compat-data" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.22.5" + +"@babel/plugin-transform-object-super@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz#794a8d2fcb5d0835af722173c1a9d704f44e218c" + integrity sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" + +"@babel/plugin-transform-optional-catch-binding@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.5.tgz#842080be3076703be0eaf32ead6ac8174edee333" + integrity sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-transform-regenerator@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.21.5.tgz#576c62f9923f94bcb1c855adc53561fd7913724e" - integrity sha512-ZoYBKDb6LyMi5yCsByQ5jmXsHAQDDYeexT1Szvlmui+lADvfSecr5Dxd/PkrTC3pAD182Fcju1VQkB4oCp9M+w== +"@babel/plugin-transform-optional-chaining@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.5.tgz#1003762b9c14295501beb41be72426736bedd1e0" + integrity sha512-AconbMKOMkyG+xCng2JogMCDcqW8wedQAqpVIL4cOSescZ7+iW8utC6YDZLMCSUIReEA733gzRSaOSXMAt/4WQ== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +"@babel/plugin-transform-parameters@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz#c3542dd3c39b42c8069936e48717a8d179d63a18" + integrity sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-private-methods@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz#21c8af791f76674420a147ae62e9935d790f8722" + integrity sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-private-property-in-object@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz#07a77f28cbb251546a43d175a1dda4cf3ef83e32" + integrity sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-transform-property-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz#b5ddabd73a4f7f26cd0e20f5db48290b88732766" + integrity sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-regenerator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz#cd8a68b228a5f75fa01420e8cc2fc400f0fc32aa" + integrity sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" 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== +"@babel/plugin-transform-reserved-words@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz#832cd35b81c287c4bcd09ce03e22199641f964fb" + integrity sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-shorthand-properties@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz#6e277654be82b5559fc4b9f58088507c24f0c624" + integrity sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-spread@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz#6487fd29f229c95e284ba6c98d65eafb893fea6b" + integrity sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" -"@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== +"@babel/plugin-transform-sticky-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz#295aba1595bfc8197abd02eae5fc288c0deb26aa" + integrity sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-template-literals@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz#8f38cf291e5f7a8e60e9f733193f0bcc10909bff" + integrity sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-typeof-symbol@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz#5e2ba478da4b603af8673ff7c54f75a97b716b34" + integrity sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-unicode-escapes@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.21.5.tgz#1e55ed6195259b0e9061d81f5ef45a9b009fb7f2" - integrity sha512-LYm/gTOwZqsYohlvFUe/8Tujz75LqqVC2w+2qPHLR+WyWHGCZPN1KBpJCJn+4Bk4gOkQy/IXKIge6az5MqwlOg== +"@babel/plugin-transform-unicode-escapes@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.5.tgz#ce0c248522b1cb22c7c992d88301a5ead70e806c" + integrity sha512-biEmVg1IYB/raUO5wT1tgfacCef15Fbzhkx493D3urBI++6hpJ+RFG4SrWMn0NEZLfvilqKf3QDrRVZHo08FYg== dependencies: - "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@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== +"@babel/plugin-transform-unicode-property-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz#098898f74d5c1e86660dc112057b2d11227f1c81" + integrity sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz#ce7e7bb3ef208c4ff67e02a22816656256d7a183" + integrity sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-transform-unicode-sets-regex@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz#77788060e511b708ffc7d42fdfbc5b37c3004e91" + integrity sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/preset-env@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.21.5.tgz#db2089d99efd2297716f018aeead815ac3decffb" - integrity sha512-wH00QnTTldTbf/IefEVyChtRdw5RJvODT/Vb4Vcxq1AZvtXj6T0YeX0cAcXhI6/BdGuiP3GcNIL4OQbI2DVNxg== - dependencies: - "@babel/compat-data" "^7.21.5" - "@babel/helper-compilation-targets" "^7.21.5" - "@babel/helper-plugin-utils" "^7.21.5" - "@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" + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.22.5.tgz#3da66078b181f3d62512c51cf7014392c511504e" + integrity sha512-fj06hw89dpiZzGZtxn+QybifF07nNiZjZ7sazs2aVDcysAZVGjW7+7iFYxg6GLNM47R/thYfLdrXc+2f11Vi9A== + dependencies: + "@babel/compat-data" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.5" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.22.5" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.5" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@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-import-assertions" "^7.22.5" + "@babel/plugin-syntax-import-attributes" "^7.22.5" "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" @@ -847,44 +870,61 @@ "@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.21.5" - "@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.21.5" - "@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.5" - "@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.5" - "@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.21.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.21.5" - "@babel/plugin-transform-unicode-regex" "^7.18.6" + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.22.5" + "@babel/plugin-transform-async-generator-functions" "^7.22.5" + "@babel/plugin-transform-async-to-generator" "^7.22.5" + "@babel/plugin-transform-block-scoped-functions" "^7.22.5" + "@babel/plugin-transform-block-scoping" "^7.22.5" + "@babel/plugin-transform-class-properties" "^7.22.5" + "@babel/plugin-transform-class-static-block" "^7.22.5" + "@babel/plugin-transform-classes" "^7.22.5" + "@babel/plugin-transform-computed-properties" "^7.22.5" + "@babel/plugin-transform-destructuring" "^7.22.5" + "@babel/plugin-transform-dotall-regex" "^7.22.5" + "@babel/plugin-transform-duplicate-keys" "^7.22.5" + "@babel/plugin-transform-dynamic-import" "^7.22.5" + "@babel/plugin-transform-exponentiation-operator" "^7.22.5" + "@babel/plugin-transform-export-namespace-from" "^7.22.5" + "@babel/plugin-transform-for-of" "^7.22.5" + "@babel/plugin-transform-function-name" "^7.22.5" + "@babel/plugin-transform-json-strings" "^7.22.5" + "@babel/plugin-transform-literals" "^7.22.5" + "@babel/plugin-transform-logical-assignment-operators" "^7.22.5" + "@babel/plugin-transform-member-expression-literals" "^7.22.5" + "@babel/plugin-transform-modules-amd" "^7.22.5" + "@babel/plugin-transform-modules-commonjs" "^7.22.5" + "@babel/plugin-transform-modules-systemjs" "^7.22.5" + "@babel/plugin-transform-modules-umd" "^7.22.5" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" + "@babel/plugin-transform-new-target" "^7.22.5" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.5" + "@babel/plugin-transform-numeric-separator" "^7.22.5" + "@babel/plugin-transform-object-rest-spread" "^7.22.5" + "@babel/plugin-transform-object-super" "^7.22.5" + "@babel/plugin-transform-optional-catch-binding" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.5" + "@babel/plugin-transform-parameters" "^7.22.5" + "@babel/plugin-transform-private-methods" "^7.22.5" + "@babel/plugin-transform-private-property-in-object" "^7.22.5" + "@babel/plugin-transform-property-literals" "^7.22.5" + "@babel/plugin-transform-regenerator" "^7.22.5" + "@babel/plugin-transform-reserved-words" "^7.22.5" + "@babel/plugin-transform-shorthand-properties" "^7.22.5" + "@babel/plugin-transform-spread" "^7.22.5" + "@babel/plugin-transform-sticky-regex" "^7.22.5" + "@babel/plugin-transform-template-literals" "^7.22.5" + "@babel/plugin-transform-typeof-symbol" "^7.22.5" + "@babel/plugin-transform-unicode-escapes" "^7.22.5" + "@babel/plugin-transform-unicode-property-regex" "^7.22.5" + "@babel/plugin-transform-unicode-regex" "^7.22.5" + "@babel/plugin-transform-unicode-sets-regex" "^7.22.5" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.21.5" - 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" + "@babel/types" "^7.22.5" + babel-plugin-polyfill-corejs2 "^0.4.3" + babel-plugin-polyfill-corejs3 "^0.8.1" + babel-plugin-polyfill-regenerator "^0.5.0" + core-js-compat "^3.30.2" semver "^6.3.0" "@babel/preset-modules@^0.1.5": @@ -899,9 +939,9 @@ esutils "^2.0.2" "@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== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.22.5.tgz#e4d8d0f615ea3233a27b5c6ada6750ee59559939" + integrity sha512-vV6pm/4CijSQ8Y47RH5SopXzursN35RQINfGJkmOlcpAtGuf94miFvIPhCKGQN7WGIcsgG1BHEX2KVdTYwTwUQ== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" @@ -915,44 +955,44 @@ integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== "@babel/runtime@^7.8.4": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200" - integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" + integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== 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.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.5.tgz#ad22361d352a5154b498299d523cf72998a4b133" - integrity sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw== - dependencies: - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.5" - "@babel/helper-environment-visitor" "^7.21.5" - "@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.5" - "@babel/types" "^7.21.5" +"@babel/template@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" + integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== + dependencies: + "@babel/code-frame" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/traverse@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.5.tgz#44bd276690db6f4940fdb84e1cb4abd2f729ccd1" + integrity sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ== + dependencies: + "@babel/code-frame" "^7.22.5" + "@babel/generator" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/types" "^7.22.5" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.4", "@babel/types@^7.21.5", "@babel/types@^7.4.4": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.5.tgz#18dfbd47c39d3904d5db3d3dc2cc80bedb60e5b6" - integrity sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q== +"@babel/types@^7.22.5", "@babel/types@^7.4.4": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" + integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== dependencies: - "@babel/helper-string-parser" "^7.21.5" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" "@colors/colors@1.5.0": @@ -1060,15 +1100,15 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.40.0.tgz#3ba73359e11f5a7bd3e407f70b3528abfae69cec" - integrity sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA== +"@eslint/js@8.42.0": + version "8.42.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.42.0.tgz#484a1d638de2911e6f5a30c12f49c7e4a3270fb6" + integrity sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw== -"@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== +"@humanwhocodes/config-array@^0.11.10": + version "0.11.10" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" + integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -1148,7 +1188,7 @@ 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": +"@jridgewell/source-map@^0.3.3": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.3.tgz#8108265659d4c33e72ffe14e33d6cc5eb59f2fda" integrity sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg== @@ -1260,12 +1300,12 @@ 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== +"@sinonjs/fake-timers@^10.0.2", "@sinonjs/fake-timers@^10.1.0": + version "10.2.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.2.0.tgz#b3e322a34c5f26e3184e7f6115695f299c1b1194" + integrity sha512-OPwQlEdg40HAj5KNF8WW6q2KG4Z+cBCZb3m4ninfTZKaBmbIJodviQsDBoYMPHkOyJJMHnOJo5j2+LKDOhOACg== dependencies: - "@sinonjs/commons" "^2.0.0" + "@sinonjs/commons" "^3.0.0" "@sinonjs/samsam@^8.0.0": version "8.0.0" @@ -1302,9 +1342,9 @@ 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== + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@types/cookie@^0.4.1": version "0.4.1" @@ -1327,9 +1367,9 @@ "@types/estree" "*" "@types/eslint@*", "@types/eslint@^8.37.0": - version "8.37.0" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.37.0.tgz#29cebc6c2a3ac7fea7113207bf5a828fdf4d7ef1" - integrity sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ== + version "8.40.2" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.40.2.tgz#2833bc112d809677864a4b0e7d1de4f04d7dac2d" + integrity sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -1359,9 +1399,9 @@ "@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== + version "7.0.12" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" + integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== "@types/json5@^0.0.29": version "0.0.29" @@ -1387,14 +1427,14 @@ integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== "@types/node@*", "@types/node@>=10.0.0", "@types/node@^20.1.1": - version "20.1.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.1.tgz#afc492e8dbe7f672dd3a13674823522b467a45ad" - integrity sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A== + version "20.3.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe" + integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg== "@types/node@^14.14.35": - version "14.18.46" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.46.tgz#ffc5a96cbe4fb5af9d16ac08e50229de30969487" - integrity sha512-n4yVT5FuY5NCcGHCosQSGvvCT74HhowymPN2OEcsHPw6U1NuxV9dvxWbrM2dnBukWjdMYzig1WfIkWdTTQJqng== + version "14.18.51" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.51.tgz#cb90935b89c641201c3d07a595c3e22d1cfaa417" + integrity sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA== "@types/parsimmon@^1.10.1": version "1.10.6" @@ -1419,14 +1459,14 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.55.0": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz#f156827610a3f8cefc56baeaa93cd4a5f32966b4" - integrity sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg== + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.11.tgz#8d466aa21abea4c3f37129997b198d141f09e76f" + integrity sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.59.5" - "@typescript-eslint/type-utils" "5.59.5" - "@typescript-eslint/utils" "5.59.5" + "@typescript-eslint/scope-manager" "5.59.11" + "@typescript-eslint/type-utils" "5.59.11" + "@typescript-eslint/utils" "5.59.11" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -1435,208 +1475,208 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.55.0", "@typescript-eslint/parser@^5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.5.tgz#63064f5eafbdbfb5f9dfbf5c4503cdf949852981" - integrity sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw== + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.11.tgz#af7d4b7110e3068ce0b97550736de455e4250103" + integrity sha512-s9ZF3M+Nym6CAZEkJJeO2TFHHDsKAM3ecNkLuH4i4s8/RCPnF5JRip2GyviYkeEAcwGMJxkqG9h2dAsnA1nZpA== dependencies: - "@typescript-eslint/scope-manager" "5.59.5" - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/typescript-estree" "5.59.5" + "@typescript-eslint/scope-manager" "5.59.11" + "@typescript-eslint/types" "5.59.11" + "@typescript-eslint/typescript-estree" "5.59.11" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz#33ffc7e8663f42cfaac873de65ebf65d2bce674d" - integrity sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A== +"@typescript-eslint/scope-manager@5.59.11": + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.11.tgz#5d131a67a19189c42598af9fb2ea1165252001ce" + integrity sha512-dHFOsxoLFtrIcSj5h0QoBT/89hxQONwmn3FOQ0GOQcLOOXm+MIrS8zEAhs4tWl5MraxCY3ZJpaXQQdFMc2Tu+Q== dependencies: - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/visitor-keys" "5.59.5" + "@typescript-eslint/types" "5.59.11" + "@typescript-eslint/visitor-keys" "5.59.11" -"@typescript-eslint/type-utils@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz#485b0e2c5b923460bc2ea6b338c595343f06fc9b" - integrity sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg== +"@typescript-eslint/type-utils@5.59.11": + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.11.tgz#5eb67121808a84cb57d65a15f48f5bdda25f2346" + integrity sha512-LZqVY8hMiVRF2a7/swmkStMYSoXMFlzL6sXV6U/2gL5cwnLWQgLEG8tjWPpaE4rMIdZ6VKWwcffPlo1jPfk43g== dependencies: - "@typescript-eslint/typescript-estree" "5.59.5" - "@typescript-eslint/utils" "5.59.5" + "@typescript-eslint/typescript-estree" "5.59.11" + "@typescript-eslint/utils" "5.59.11" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.59.5", "@typescript-eslint/types@^5.56.0": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.5.tgz#e63c5952532306d97c6ea432cee0981f6d2258c7" - integrity sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w== +"@typescript-eslint/types@5.59.11", "@typescript-eslint/types@^5.56.0": + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.11.tgz#1a9018fe3c565ba6969561f2a49f330cf1fe8db1" + integrity sha512-epoN6R6tkvBYSc+cllrz+c2sOFWkbisJZWkOE+y3xHtvYaOE6Wk6B8e114McRJwFRjGvYdJwLXQH5c9osME/AA== -"@typescript-eslint/typescript-estree@5.59.5", "@typescript-eslint/typescript-estree@^5.55.0": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz#9b252ce55dd765e972a7a2f99233c439c5101e42" - integrity sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg== +"@typescript-eslint/typescript-estree@5.59.11", "@typescript-eslint/typescript-estree@^5.55.0": + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.11.tgz#b2caaa31725e17c33970c1197bcd54e3c5f42b9f" + integrity sha512-YupOpot5hJO0maupJXixi6l5ETdrITxeo5eBOeuV7RSKgYdU3G5cxO49/9WRnJq9EMrB7AuTSLH/bqOsXi7wPA== dependencies: - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/visitor-keys" "5.59.5" + "@typescript-eslint/types" "5.59.11" + "@typescript-eslint/visitor-keys" "5.59.11" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.59.5", "@typescript-eslint/utils@^5.55.0": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.5.tgz#15b3eb619bb223302e60413adb0accd29c32bcae" - integrity sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA== +"@typescript-eslint/utils@5.59.11", "@typescript-eslint/utils@^5.55.0": + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.11.tgz#9dbff49dc80bfdd9289f9f33548f2e8db3c59ba1" + integrity sha512-didu2rHSOMUdJThLk4aZ1Or8IcO3HzCw/ZvEjTTIfjIrcdd5cvSIwwDy2AOlE7htSNp7QIZ10fLMyRCveesMLg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.59.5" - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/typescript-estree" "5.59.5" + "@typescript-eslint/scope-manager" "5.59.11" + "@typescript-eslint/types" "5.59.11" + "@typescript-eslint/typescript-estree" "5.59.11" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz#ba5b8d6791a13cf9fea6716af1e7626434b29b9b" - integrity sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA== +"@typescript-eslint/visitor-keys@5.59.11": + version "5.59.11" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.11.tgz#dca561ddad169dc27d62396d64f45b2d2c3ecc56" + integrity sha512-KGYniTGG3AMTuKF9QBD7EIrvufkB6O6uX3knP73xbKLMpH+QRPcgnCxjWXSHjMRuOxFLovljqQgQpR0c7GvjoA== dependencies: - "@typescript-eslint/types" "5.59.5" + "@typescript-eslint/types" "5.59.11" eslint-visitor-keys "^3.3.0" -"@webassemblyjs/ast@1.11.5", "@webassemblyjs/ast@^1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.5.tgz#6e818036b94548c1fb53b754b5cae3c9b208281c" - integrity sha512-LHY/GSAZZRpsNQH+/oHqhRQ5FT7eoULcBqgfyTB5nQHogFnK3/7QoN7dLnwSE/JkUAF0SrRuclT7ODqMFtWxxQ== +"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24" + integrity sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q== dependencies: - "@webassemblyjs/helper-numbers" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" + "@webassemblyjs/helper-numbers" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" -"@webassemblyjs/floating-point-hex-parser@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.5.tgz#e85dfdb01cad16b812ff166b96806c050555f1b4" - integrity sha512-1j1zTIC5EZOtCplMBG/IEwLtUojtwFVwdyVMbL/hwWqbzlQoJsWCOavrdnLkemwNoC/EOwtUFch3fuo+cbcXYQ== +"@webassemblyjs/floating-point-hex-parser@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz#dacbcb95aff135c8260f77fa3b4c5fea600a6431" + integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== -"@webassemblyjs/helper-api-error@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.5.tgz#1e82fa7958c681ddcf4eabef756ce09d49d442d1" - integrity sha512-L65bDPmfpY0+yFrsgz8b6LhXmbbs38OnwDCf6NpnMUYqa+ENfE5Dq9E42ny0qz/PdR0LJyq/T5YijPnU8AXEpA== +"@webassemblyjs/helper-api-error@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz#6132f68c4acd59dcd141c44b18cbebbd9f2fa768" + integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== -"@webassemblyjs/helper-buffer@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.5.tgz#91381652ea95bb38bbfd270702351c0c89d69fba" - integrity sha512-fDKo1gstwFFSfacIeH5KfwzjykIE6ldh1iH9Y/8YkAZrhmu4TctqYjSh7t0K2VyDSXOZJ1MLhht/k9IvYGcIxg== +"@webassemblyjs/helper-buffer@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz#b66d73c43e296fd5e88006f18524feb0f2c7c093" + integrity sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA== -"@webassemblyjs/helper-numbers@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.5.tgz#23380c910d56764957292839006fecbe05e135a9" - integrity sha512-DhykHXM0ZABqfIGYNv93A5KKDw/+ywBFnuWybZZWcuzWHfbp21wUfRkbtz7dMGwGgT4iXjWuhRMA2Mzod6W4WA== +"@webassemblyjs/helper-numbers@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz#cbce5e7e0c1bd32cf4905ae444ef64cea919f1b5" + integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.5" - "@webassemblyjs/helper-api-error" "1.11.5" + "@webassemblyjs/floating-point-hex-parser" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.5.tgz#e258a25251bc69a52ef817da3001863cc1c24b9f" - integrity sha512-oC4Qa0bNcqnjAowFn7MPCETQgDYytpsfvz4ujZz63Zu/a/v71HeCAAmZsgZ3YVKec3zSPYytG3/PrRCqbtcAvA== +"@webassemblyjs/helper-wasm-bytecode@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz#bb2ebdb3b83aa26d9baad4c46d4315283acd51e9" + integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== -"@webassemblyjs/helper-wasm-section@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.5.tgz#966e855a6fae04d5570ad4ec87fbcf29b42ba78e" - integrity sha512-uEoThA1LN2NA+K3B9wDo3yKlBfVtC6rh0i4/6hvbz071E8gTNZD/pT0MsBf7MeD6KbApMSkaAK0XeKyOZC7CIA== +"@webassemblyjs/helper-wasm-section@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz#ff97f3863c55ee7f580fd5c41a381e9def4aa577" + integrity sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g== dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-buffer" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/wasm-gen" "1.11.5" + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" -"@webassemblyjs/ieee754@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.5.tgz#b2db1b33ce9c91e34236194c2b5cba9b25ca9d60" - integrity sha512-37aGq6qVL8A8oPbPrSGMBcp38YZFXcHfiROflJn9jxSdSMMM5dS5P/9e2/TpaJuhE+wFrbukN2WI6Hw9MH5acg== +"@webassemblyjs/ieee754@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz#bb665c91d0b14fffceb0e38298c329af043c6e3a" + integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.5.tgz#482e44d26b6b949edf042a8525a66c649e38935a" - integrity sha512-ajqrRSXaTJoPW+xmkfYN6l8VIeNnR4vBOTQO9HzR7IygoCcKWkICbKFbVTNMjMgMREqXEr0+2M6zukzM47ZUfQ== +"@webassemblyjs/leb128@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz#70e60e5e82f9ac81118bc25381a0b283893240d7" + integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.5.tgz#83bef94856e399f3740e8df9f63bc47a987eae1a" - integrity sha512-WiOhulHKTZU5UPlRl53gHR8OxdGsSOxqfpqWeA2FmcwBMaoEdz6b2x2si3IwC9/fSPLfe8pBMRTHVMk5nlwnFQ== +"@webassemblyjs/utf8@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz#90f8bc34c561595fe156603be7253cdbcd0fab5a" + integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== "@webassemblyjs/wasm-edit@^1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.5.tgz#93ee10a08037657e21c70de31c47fdad6b522b2d" - integrity sha512-C0p9D2fAu3Twwqvygvf42iGCQ4av8MFBLiTb+08SZ4cEdwzWx9QeAHDo1E2k+9s/0w1DM40oflJOpkZ8jW4HCQ== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-buffer" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/helper-wasm-section" "1.11.5" - "@webassemblyjs/wasm-gen" "1.11.5" - "@webassemblyjs/wasm-opt" "1.11.5" - "@webassemblyjs/wasm-parser" "1.11.5" - "@webassemblyjs/wast-printer" "1.11.5" - -"@webassemblyjs/wasm-gen@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.5.tgz#ceb1c82b40bf0cf67a492c53381916756ef7f0b1" - integrity sha512-14vteRlRjxLK9eSyYFvw1K8Vv+iPdZU0Aebk3j6oB8TQiQYuO6hj9s4d7qf6f2HJr2khzvNldAFG13CgdkAIfA== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/ieee754" "1.11.5" - "@webassemblyjs/leb128" "1.11.5" - "@webassemblyjs/utf8" "1.11.5" - -"@webassemblyjs/wasm-opt@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.5.tgz#b52bac29681fa62487e16d3bb7f0633d5e62ca0a" - integrity sha512-tcKwlIXstBQgbKy1MlbDMlXaxpucn42eb17H29rawYLxm5+MsEmgPzeCP8B1Cl69hCice8LeKgZpRUAPtqYPgw== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-buffer" "1.11.5" - "@webassemblyjs/wasm-gen" "1.11.5" - "@webassemblyjs/wasm-parser" "1.11.5" - -"@webassemblyjs/wasm-parser@1.11.5", "@webassemblyjs/wasm-parser@^1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.5.tgz#7ba0697ca74c860ea13e3ba226b29617046982e2" - integrity sha512-SVXUIwsLQlc8srSD7jejsfTU83g7pIGr2YYNb9oHdtldSxaOhvA5xwvIiWIfcX8PlSakgqMXsLpLfbbJ4cBYew== - dependencies: - "@webassemblyjs/ast" "1.11.5" - "@webassemblyjs/helper-api-error" "1.11.5" - "@webassemblyjs/helper-wasm-bytecode" "1.11.5" - "@webassemblyjs/ieee754" "1.11.5" - "@webassemblyjs/leb128" "1.11.5" - "@webassemblyjs/utf8" "1.11.5" - -"@webassemblyjs/wast-printer@1.11.5": - version "1.11.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.5.tgz#7a5e9689043f3eca82d544d7be7a8e6373a6fa98" - integrity sha512-f7Pq3wvg3GSPUPzR0F6bmI89Hdb+u9WXrSKc4v+N0aV0q6r42WoF92Jp2jEorBEBRoRNXgjp53nBniDXcqZYPA== - dependencies: - "@webassemblyjs/ast" "1.11.5" + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz#c72fa8220524c9b416249f3d94c2958dfe70ceab" + integrity sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-wasm-section" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" + "@webassemblyjs/wasm-opt" "1.11.6" + "@webassemblyjs/wasm-parser" "1.11.6" + "@webassemblyjs/wast-printer" "1.11.6" + +"@webassemblyjs/wasm-gen@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz#fb5283e0e8b4551cc4e9c3c0d7184a65faf7c268" + integrity sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wasm-opt@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz#d9a22d651248422ca498b09aa3232a81041487c2" + integrity sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" + "@webassemblyjs/wasm-parser" "1.11.6" + +"@webassemblyjs/wasm-parser@1.11.6", "@webassemblyjs/wasm-parser@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz#bb85378c527df824004812bbdb784eea539174a1" + integrity sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wast-printer@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz#a7bf8dd7e362aeb1668ff43f35cb849f188eff20" + integrity sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A== + dependencies: + "@webassemblyjs/ast" "1.11.6" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.0.tgz#b59b33377b1b896a9a7357cfc643b39c1524b1e6" - integrity sha512-K/vuv72vpfSEZoo5KIU0a2FsEoYdW0DUMtMpB5X3LlUwshetMZRZRxB7sCsVji/lFaSxtQQ3aM9O4eMolXkU9w== +"@webpack-cli/configtest@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" + integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== -"@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/info@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" + integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== -"@webpack-cli/serve@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.3.tgz#c00c48d19340224242842e38b8f7b76c308bbd3f" - integrity sha512-Bwxd73pHuYc0cyl7vulPp2I6kAYtmJPkfUivbts7by6wDAVyFdKzGX3AksbvCRyNVFUJu7o2ZTcWXdT90T3qbg== +"@webpack-cli/serve@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" + integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -1663,10 +1703,10 @@ accepts@~1.3.4: mime-types "~2.1.34" negotiator "0.6.3" -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-import-assertions@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" + integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== acorn-jsx@^5.3.2: version "5.3.2" @@ -1678,7 +1718,7 @@ acorn-walk@^8.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: +acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== @@ -1965,29 +2005,29 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -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== +babel-plugin-polyfill-corejs2@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.3.tgz#75044d90ba5043a5fb559ac98496f62f3eb668fd" + integrity sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw== dependencies: "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.3.3" + "@babel/helper-define-polyfill-provider" "^0.4.0" semver "^6.1.1" -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== +babel-plugin-polyfill-corejs3@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.1.tgz#39248263c38191f0d226f928d666e6db1b4b3a8a" + integrity sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" - core-js-compat "^3.25.1" + "@babel/helper-define-polyfill-provider" "^0.4.0" + core-js-compat "^3.30.1" -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== +babel-plugin-polyfill-regenerator@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.0.tgz#e7344d88d9ef18a3c47ded99362ae4a757609380" + integrity sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" + "@babel/helper-define-polyfill-provider" "^0.4.0" balanced-match@^1.0.0: version "1.0.2" @@ -2162,14 +2202,14 @@ browserify-zlib@^0.2.0: pako "~1.0.5" 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== + version "4.21.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.8.tgz#db2498e1f4b80ed199c076248a094935860b6017" + integrity sha512-j+7xYe+v+q2Id9qbBeCI8WX5NmZSRe8es1+0xntD/+gaWXznP8tFEkv5IgSaHf5dS1YwVMbX/4W6m937mj+wQw== dependencies: - caniuse-lite "^1.0.30001449" - electron-to-chromium "^1.4.284" - node-releases "^2.0.8" - update-browserslist-db "^1.0.10" + caniuse-lite "^1.0.30001502" + electron-to-chromium "^1.4.428" + node-releases "^2.0.12" + update-browserslist-db "^1.0.11" buffer-from@^1.0.0: version "1.1.2" @@ -2250,10 +2290,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001449: - version "1.0.30001486" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz#56a08885228edf62cbe1ac8980f2b5dae159997e" - integrity sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg== +caniuse-lite@^1.0.30001502: + version "1.0.30001503" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001503.tgz#88b6ff1b2cf735f1f3361dc1a15b59f0561aa398" + integrity sha512-Sf9NiF+wZxPfzv8Z3iS0rXM1Do+iOy2Lxvib38glFX+08TCYYYGR5fRJXk4d77C4AYwhUjgYgMsMudbh2TqCKw== caseless@~0.12.0: version "0.12.0" @@ -2561,10 +2601,10 @@ cookie@~0.4.1: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== -core-js-compat@^3.25.1: - version "3.30.2" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.2.tgz#83f136e375babdb8c80ad3c22d67c69098c1dd8b" - integrity sha512-nriW1nuJjUgvkEjIot1Spwakz52V9YkYHZAQG6A1eCgC8AA1p0zngrQEP9R0+V6hji5XilWKG1Bd0YRppmGimA== +core-js-compat@^3.30.1, core-js-compat@^3.30.2: + version "3.31.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.31.0.tgz#4030847c0766cc0e803dcdfb30055d7ef2064bf1" + integrity sha512-hM7YCu1cU6Opx7MXNu0NuumM0ezNeAeRKadixyiQELWY3vT3De9S4J5ZBMraWV2vZnrE1Cirl0GtFtDtMUXzPw== dependencies: browserslist "^4.21.5" @@ -2751,9 +2791,9 @@ depd@2.0.0: integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" + integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -2851,10 +2891,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.4.284: - version "1.4.386" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.386.tgz#49d5ab14b849fa19b1d60c67b0a56e504990d1c7" - integrity sha512-w0VD4WR225nuNsz6FokDaqugxzue6iUVBo8QfUrl2Y6nWHxtBUhjWDnUaG/1v5oWeFPLMJAQk3zKHTHW/P8+Og== +electron-to-chromium@^1.4.428: + version "1.4.430" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.430.tgz#52693c812a81800fafb5b312c1a850142e2fc9eb" + integrity sha512-FytjTbGwz///F+ToZ5XSeXbbSaXalsVRXsz2mHityI5gfxft7ieW3HqFLkU5V1aIrY42aflICqbmFoDxW10etg== elliptic@^6.5.3: version "6.5.4" @@ -2892,11 +2932,11 @@ end-of-stream@^1.4.1: once "^1.4.0" engine.io-parser@~5.0.3: - version "5.0.6" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.0.6.tgz#7811244af173e157295dec9b2718dfe42a64ef45" - integrity sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw== + version "5.0.7" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.0.7.tgz#ed5eae76c71f398284c578ab6deafd3ba7e4e4f6" + integrity sha512-P+jDFbvK6lE3n1OL+q9KuzdOFWkkZ/cMV9gol/SbVfpyqfvrfrFTOFJ6fQm2VC3PZHlU3QPhVwmbsCnauHF2MQ== -engine.io@~6.4.1: +engine.io@~6.4.2: version "6.4.2" resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.4.2.tgz#ffeaf68f69b1364b0286badddf15ff633476473f" integrity sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg== @@ -2912,10 +2952,10 @@ engine.io@~6.4.1: engine.io-parser "~5.0.3" ws "~8.11.0" -enhanced-resolve@^5.13.0: - version "5.13.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz#26d1ecc448c02de997133217b5c1053f34a0a275" - integrity sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg== +enhanced-resolve@^5.15.0: + version "5.15.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" + integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -2976,9 +3016,9 @@ es-abstract@^1.19.0, es-abstract@^1.20.4: which-typed-array "^1.1.9" es-module-lexer@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.2.1.tgz#ba303831f63e6a394983fde2f97ad77b22324527" - integrity sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg== + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.0.tgz#6be9c9e0b4543a60cd166ff6f8b4e9dae0b0c16f" + integrity sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA== es-set-tostringtag@^2.0.1: version "2.0.1" @@ -3179,15 +3219,15 @@ eslint-webpack-plugin@^4.0.0: schema-utils "^4.0.0" eslint@^8.17.0, eslint@^8.40.0: - version "8.40.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.40.0.tgz#a564cd0099f38542c4e9a2f630fa45bf33bc42a4" - integrity sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ== + version "8.42.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.42.0.tgz#7bebdc3a55f9ed7167251fe7259f75219cade291" + integrity sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.3" - "@eslint/js" "8.40.0" - "@humanwhocodes/config-array" "^0.11.8" + "@eslint/js" "8.42.0" + "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" @@ -3206,13 +3246,12 @@ eslint@^8.17.0, eslint@^8.40.0: find-up "^5.0.0" glob-parent "^6.0.2" globals "^13.19.0" - grapheme-splitter "^1.0.4" + graphemer "^1.4.0" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" - js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -3326,9 +3365,9 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + version "1.3.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== fast-glob@^3.2.9: version "3.2.12" @@ -3606,12 +3645,13 @@ get-func-name@^2.0.0: 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== + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== dependencies: function-bind "^1.1.1" has "^1.0.3" + has-proto "^1.0.1" has-symbols "^1.0.3" get-package-type@^0.1.0: @@ -3747,6 +3787,11 @@ grapheme-splitter@^1.0.4: resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -4028,9 +4073,9 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-core-module@^2.11.0, is-core-module@^2.5.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" - integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== + version "2.12.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" + integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== dependencies: has "^1.0.3" @@ -4335,11 +4380,6 @@ jest-worker@^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" @@ -4350,9 +4390,9 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -"js-xdr@git+https://github.com/stellar/js-xdr#ad2e43e": - version "3.0.0" - resolved "git+https://github.com/stellar/js-xdr#ad2e43e5b7cc31edd2169043ab90ad2b82d113e8" +"js-xdr@git+https://github.com/stellar/js-xdr#5dd43fb": + version "2.0.0" + resolved "git+https://github.com/stellar/js-xdr#5dd43fbf834198faa4f8a8972e11e6797fb0fa3e" js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" @@ -5012,7 +5052,7 @@ nise@^5.1.4: just-extend "^4.0.2" path-to-regexp "^1.7.0" -node-gyp-build@^4.3.0: +node-gyp-build@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== @@ -5055,10 +5095,10 @@ node-preload@^0.2.1: dependencies: process-on-spawn "^1.0.0" -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== +node-releases@^2.0.12: + version "2.0.12" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.12.tgz#35627cc224a23bfb06fb3380f2b3afaaa7eb1039" + integrity sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ== "normalize-package-data@~1.0.1 || ^2.0.0 || ^3.0.0": version "3.0.3" @@ -5512,10 +5552,10 @@ public-encrypt@^4.0.0: randombytes "^2.0.1" safe-buffer "^5.1.2" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== punycode@^2.1.0, punycode@^2.1.1: version "2.3.0" @@ -5534,6 +5574,13 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" +qs@^6.11.0: + version "6.11.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" + integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== + dependencies: + side-channel "^1.0.4" + qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" @@ -5544,11 +5591,6 @@ querystring-es3@^0.2.1: resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" 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 sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -5856,19 +5898,19 @@ safe-regex-test@^1.0.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -schema-utils@^3.1.1, schema-utils@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.2.tgz#36c10abca6f7577aeae136c804b0c741edeadc99" - integrity sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg== +schema-utils@^3.1.1, schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== dependencies: "@types/json-schema" "^7.0.8" ajv "^6.12.5" ajv-keywords "^3.5.2" schema-utils@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.1.tgz#eb2d042df8b01f4b5c276a2dfd41ba0faab72e8d" - integrity sha512-lELhBAAly9NowEsX0yZBlw9ahZG+sK/1RJ21EpzdYHKEs13Vku3LJ+MIPhh4sMs0oCCeufZQEQbMekiA4vuVIQ== + version "4.2.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" + integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== dependencies: "@types/json-schema" "^7.0.9" ajv "^8.9.0" @@ -5876,9 +5918,9 @@ schema-utils@^4.0.0: ajv-keywords "^5.1.0" "semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.4, semver@^7.3.7: - version "7.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" - integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== + version "7.5.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== dependencies: lru-cache "^6.0.0" @@ -5968,12 +6010,12 @@ sinon-chai@^3.7.0: integrity sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g== sinon@^15.0.3: - version "15.0.4" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-15.0.4.tgz#bcca6fef19b14feccc96473f0d7adc81e0bc5268" - integrity sha512-uzmfN6zx3GQaria1kwgWGeKiXSSbShBbue6Dcj0SI8fiCNFbiUDqKl57WFlY5lyhxZVUKmXvzgG2pilRQCBwWg== + version "15.1.2" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-15.1.2.tgz#09b5f3abfbd9df6b257d0f05bbb9d1b78a31ae51" + integrity sha512-uG1pU54Fis4EfYOPoEi13fmRHgZNg/u+3aReSEzHsN52Bpf+bMVfsBQS5MjouI+rTuG6UBIINlpuuO2Epr7SiA== dependencies: "@sinonjs/commons" "^3.0.0" - "@sinonjs/fake-timers" "^10.0.2" + "@sinonjs/fake-timers" "^10.1.0" "@sinonjs/samsam" "^8.0.0" diff "^5.1.0" nise "^5.1.4" @@ -6027,32 +6069,32 @@ socket.io-adapter@~2.5.2: dependencies: ws "~8.11.0" -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== +socket.io-parser@~4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" + integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== dependencies: "@socket.io/component-emitter" "~3.1.0" debug "~4.3.1" 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== + version "4.6.2" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.6.2.tgz#d597db077d4df9cbbdfaa7a9ed8ccc3d49439786" + integrity sha512-Vp+lSks5k0dewYTfwgPT9UeGGd+ht7sCpB7p0e83VgO4X/AHYWhXITMrNk/pg8syY2bpx23ptClCQuHhqi2BgQ== dependencies: accepts "~1.3.4" base64id "~2.0.0" debug "~4.3.2" - engine.io "~6.4.1" + engine.io "~6.4.2" socket.io-adapter "~2.5.2" - socket.io-parser "~4.2.1" + socket.io-parser "~4.2.4" sodium-native@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-4.0.1.tgz#773201b0d7872da294b9b12cd90d4a913dc9a2dd" - integrity sha512-OQTaxrVLtMvrnfcwZVsOTHe58MfDApJiHJNoOwcmmrhwvlYkfaUt2WuzRio8PgEMOd96R5aDHY49DCtock1zsA== + version "4.0.4" + resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-4.0.4.tgz#561b7c39c97789f8202d6fd224845fe2e8cd6879" + integrity sha512-faqOKw4WQKK7r/ybn6Lqo1F9+L5T6NlBJJYvpxbZPetpWylUVqz449mvlwIBKBqxEHbWakWuOlUt8J3Qpc4sWw== dependencies: - node-gyp-build "^4.3.0" + node-gyp-build "^4.6.0" source-map-support@^0.5.16, source-map-support@~0.5.20: version "0.5.21" @@ -6267,9 +6309,9 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: ansi-regex "^5.0.1" 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== + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== dependencies: ansi-regex "^6.0.1" @@ -6351,9 +6393,9 @@ tar-stream@^2.1.4: readable-stream "^3.1.1" tar@^6.1.11: - version "6.1.14" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.14.tgz#e87926bec1cfe7c9e783a77a79f3e81c1cfa3b66" - integrity sha512-piERznXu0U7/pW7cdSn7hjqySIVTYT6F76icmFk7ptU7dDYlXTm5r9A6K04R2vU3olYgoKeo1Cg3eeu5nhftAw== + version "6.1.15" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69" + integrity sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -6363,9 +6405,9 @@ tar@^6.1.11: yallist "^4.0.0" terser-webpack-plugin@^5.3.7, terser-webpack-plugin@^5.3.8: - version "5.3.8" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.8.tgz#415e03d2508f7de63d59eca85c5d102838f06610" - integrity sha512-WiHL3ElchZMsK27P8uIUh4604IgJyAW47LVXGbEoB21DbQcZ+OuMpGjVYnEUaqcWM6dO8uS2qUbA7LSCWqvsbg== + version "5.3.9" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz#832536999c51b46d468067f9e37662a3b96adfe1" + integrity sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA== dependencies: "@jridgewell/trace-mapping" "^0.3.17" jest-worker "^27.4.5" @@ -6374,12 +6416,12 @@ terser-webpack-plugin@^5.3.7, terser-webpack-plugin@^5.3.8: terser "^5.16.8" terser@^5.16.8: - version "5.17.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.17.2.tgz#06c9818ae998066234b985abeb57bb7bff29d449" - integrity sha512-1D1aGbOF1Mnayq5PvfMc0amAR1y5Z1nrZaGCvI5xsdEfZEVte8okonk02OiaK5fw5hG1GWuuVsakOnpZW8y25A== + version "5.18.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.18.0.tgz#dc811fb8e3481a875d545bda247c8730ee4dc76b" + integrity sha512-pdL757Ig5a0I+owA42l6tIuEycRuM7FPY4n62h44mRLRfnOxJkkOHd6i89dOpwZlpF6JXBwaAHF6yWzFrt+QyA== dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20" @@ -6476,9 +6518,9 @@ tslib@^1.8.0, tslib@^1.8.1: integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tslib@^2.1.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + version "2.5.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" + integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== tslint@5.14.0: version "5.14.0" @@ -6597,9 +6639,9 @@ typedarray@^0.0.6: integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== typescript@^5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== + version "5.1.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826" + integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw== ua-parser-js@^0.7.30: version "0.7.35" @@ -6659,7 +6701,7 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -update-browserslist-db@^1.0.10: +update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== @@ -6675,12 +6717,12 @@ uri-js@^4.2.2: punycode "^2.1.0" url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== + version "0.11.1" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" + integrity sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA== dependencies: - punycode "1.3.2" - querystring "0.2.0" + punycode "^1.4.1" + qs "^6.11.0" util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" @@ -6766,14 +6808,14 @@ watchpack@^2.4.0: graceful-fs "^4.1.2" webpack-cli@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.0.tgz#abc4b1f44b50250f2632d8b8b536cfe2f6257891" - integrity sha512-a7KRJnCxejFoDpYTOwzm5o21ZXMaNqtRlvS183XzGDUPRdVEzJNImcQokqYZ8BNTnk9DkKiuWxw75+DCCoZ26w== + version "5.1.4" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" + integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^2.1.0" - "@webpack-cli/info" "^2.0.1" - "@webpack-cli/serve" "^2.0.3" + "@webpack-cli/configtest" "^2.1.1" + "@webpack-cli/info" "^2.0.2" + "@webpack-cli/serve" "^2.0.5" colorette "^2.0.14" commander "^10.0.1" cross-spawn "^7.0.3" @@ -6792,9 +6834,9 @@ webpack-merge@^4.1.5: lodash "^4.17.15" 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== + version "5.9.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.9.0.tgz#dc160a1c4cf512ceca515cc231669e9ddb133826" + integrity sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg== dependencies: clone-deep "^4.0.1" wildcard "^2.0.0" @@ -6805,9 +6847,9 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.82.0: - version "5.82.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.82.0.tgz#3c0d074dec79401db026b4ba0fb23d6333f88e7d" - integrity sha512-iGNA2fHhnDcV1bONdUu554eZx+XeldsaeQ8T67H6KKHl2nUSwX8Zm7cmzOA46ox/X1ARxf7Bjv8wQ/HsB5fxBg== + version "5.87.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.87.0.tgz#df8a9c094c6037f45e0d77598f9e59d33ca3a98c" + integrity sha512-GOu1tNbQ7p1bDEoFRs2YPcfyGs8xq52yyPBZ3m2VGnXGtV9MxjrkABHm4V9Ia280OefsSLzvbVoXcfLxjKY/Iw== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^1.0.0" @@ -6815,10 +6857,10 @@ webpack@^5.82.0: "@webassemblyjs/wasm-edit" "^1.11.5" "@webassemblyjs/wasm-parser" "^1.11.5" acorn "^8.7.1" - acorn-import-assertions "^1.7.6" + acorn-import-assertions "^1.9.0" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.13.0" + enhanced-resolve "^5.15.0" es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" @@ -6828,7 +6870,7 @@ webpack@^5.82.0: loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.2" + schema-utils "^3.2.0" tapable "^2.1.1" terser-webpack-plugin "^5.3.7" watchpack "^2.4.0" @@ -6967,9 +7009,9 @@ yallist@^4.0.0: integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yaml@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.2.tgz#ec551ef37326e6d42872dad1970300f8eb83a073" - integrity sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA== + version "2.3.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b" + integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== yargs-parser@20.2.4: version "20.2.4" From 49747ff93315aa6d0eaf106b271a90969ada9df9 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 14 Jun 2023 17:12:28 -0700 Subject: [PATCH 31/34] Finish rename, plus clean up exports --- src/index.js | 11 +++++++++-- src/numbers/index.js | 7 +++++++ src/numbers/{xdr_int.js => xdr_large_int.js} | 2 -- 3 files changed, 16 insertions(+), 4 deletions(-) rename src/numbers/{xdr_int.js => xdr_large_int.js} (99%) diff --git a/src/index.js b/src/index.js index c156f59c..cbec539e 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,14 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; -export { ScInt, XdrLargeInt, scValToBigInt } from './numbers/index'; -export { Uint256, Int256, Uint128, Int128 } from './numbers/xdr_int'; +export { + ScInt, + XdrLargeInt, + scValToBigInt, + Uint256, + Int256, + Uint128, + Int128 +} from './numbers/index'; export default module.exports; diff --git a/src/numbers/index.js b/src/numbers/index.js index 3d892d1a..db048f07 100644 --- a/src/numbers/index.js +++ b/src/numbers/index.js @@ -55,3 +55,10 @@ export function scValToBigInt(scv) { throw TypeError(`expected integer type, got ${scv.switch()}`); } } + +import { Uint128 } from './uint128'; +import { Uint256 } from './uint256'; +import { Int128 } from './int128'; +import { Int256 } from './int256'; + +export { Uint256, Int256, Uint128, Int128 }; diff --git a/src/numbers/xdr_int.js b/src/numbers/xdr_large_int.js similarity index 99% rename from src/numbers/xdr_int.js rename to src/numbers/xdr_large_int.js index 723aa94c..ecd4876a 100644 --- a/src/numbers/xdr_int.js +++ b/src/numbers/xdr_large_int.js @@ -197,5 +197,3 @@ export class XdrLargeInt { } } } - -export { Uint128, Int128, Uint256, Int256 }; From 281f0e19a69f42c0f8497305b9b378a53b2b21bb Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 21 Jun 2023 19:11:15 -0700 Subject: [PATCH 32/34] Update rename + fixup imports --- src/numbers/index.js | 16 ++++++++-------- src/numbers/sc_int.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/numbers/index.js b/src/numbers/index.js index db048f07..68e6bbf6 100644 --- a/src/numbers/index.js +++ b/src/numbers/index.js @@ -1,4 +1,11 @@ -import { XdrLargeInt } from './xdr_int'; +import { XdrLargeInt } from './xdr_large_int'; + +import { Uint128 } from './uint128'; +import { Uint256 } from './uint256'; +import { Int128 } from './int128'; +import { Int256 } from './int256'; + +export { Uint256, Int256, Uint128, Int128 }; export { ScInt } from './sc_int'; export { XdrLargeInt }; @@ -55,10 +62,3 @@ export function scValToBigInt(scv) { throw TypeError(`expected integer type, got ${scv.switch()}`); } } - -import { Uint128 } from './uint128'; -import { Uint256 } from './uint256'; -import { Int128 } from './int128'; -import { Int256 } from './int256'; - -export { Uint256, Int256, Uint128, Int128 }; diff --git a/src/numbers/sc_int.js b/src/numbers/sc_int.js index 19b0c2a7..b54c57ca 100644 --- a/src/numbers/sc_int.js +++ b/src/numbers/sc_int.js @@ -1,4 +1,4 @@ -import { XdrLargeInt } from './xdr_int'; +import { XdrLargeInt } from './xdr_large_int'; /** * Provides an easier way to manipulate large numbers for Stellar operations. From 5ae75a485abc45e327829c34c64aa7a56be83525 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Wed, 21 Jun 2023 19:12:07 -0700 Subject: [PATCH 33/34] Add real js-xdr version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29bf1f19..5d0e7df4 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "buffer": "^6.0.3", "crc": "^4.3.2", "crypto-browserify": "^3.12.0", - "js-xdr": "git+https://github.com/stellar/js-xdr#5dd43fb", + "js-xdr": "^3.0.0", "lodash": "^4.17.21", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" From 18aa17309641f568456475185a0574766283641e Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 22 Jun 2023 14:03:21 -0700 Subject: [PATCH 34/34] Update yarn.lock w/ v3.0 --- yarn.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7decbc22..f8221549 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4390,9 +4390,10 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -"js-xdr@git+https://github.com/stellar/js-xdr#5dd43fb": - version "2.0.0" - resolved "git+https://github.com/stellar/js-xdr#5dd43fbf834198faa4f8a8972e11e6797fb0fa3e" +js-xdr@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-3.0.0.tgz#fb74275de0ed3cec61269721140a576edf6fca7e" + integrity sha512-tSt6UKJ2L7t+yaQURGkHo9kop9qnVbChTlCu62zNiDbDZQoZb/YjUj2iFJ3lgelhfg9p5bhO2o/QX+g36TPsSQ== js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0"