diff --git a/.circleci/config.yml b/.circleci/config.yml index 5801ad9cb..554e293af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 orbs: node: circleci/node@5.0.0 slack: circleci/slack@4.4.2 - browser-tools: circleci/browser-tools@1.4.3 + browser-tools: circleci/browser-tools@1.4.8 gh-pages: sugarshin/gh-pages@1.0.0 parameters: @@ -77,6 +77,7 @@ jobs: - checkout - install_dependencies: sudo: 'sudo' + browser: << parameters.browser >> - run: name: Install docker command: | @@ -89,7 +90,13 @@ jobs: $(lsb_release -cs) stable" | $SUDO tee /etc/apt/sources.list.d/docker.list > /dev/null $SUDO apt update $SUDO apt -y install docker-ce docker-ce-cli containerd.io - - browser-tools/install-browser-tools + - when: + condition: + not: + equal: ['node', << parameters.browser >>] + steps: + browser-tools/install-browser-tools: + replace-existing-chrome: true - run: name: << parameters.browser >> test command: | @@ -120,6 +127,9 @@ commands: sudo: type: string default: '' + browser: + type: string + default: '' steps: - run: name: Install Dependencies @@ -133,4 +143,4 @@ commands: command: | set -e npm ci - npm install chromedriver@latest + if [ "<< parameters.browser >>" == "chrome" ]; then npm install chromedriver@latest; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df029b30..eb37564c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +# v2.8.0 + + + +## What's Changed + +### Bugfixes + +- Fix: Update chromedriver deps, make install conditional in CI, and fix indexer sync error in cucumber tests by @jasonpaulos in https://github.com/algorand/js-algorand-sdk/pull/859 +- fix: allow either boolean value for nonParticipation offline keyregs by @joe-p in https://github.com/algorand/js-algorand-sdk/pull/866 + +### Enhancements + +- API: Regenerate algod and indexer models by @jasonpaulos in https://github.com/algorand/js-algorand-sdk/pull/845 +- Spec: Regenerate code from specification file f633b019 by @gmalouf in https://github.com/algorand/js-algorand-sdk/pull/870 + +## New Contributors + +- @gmalouf made their first contribution in https://github.com/algorand/js-algorand-sdk/pull/870 + +**Full Changelog**: https://github.com/algorand/js-algorand-sdk/compare/v2.7.0...v2.8.0 + # v2.7.0 diff --git a/README.md b/README.md index a63a4f7d2..54bfd4827 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ Include a minified browser bundle directly in your HTML like so: ```html ``` @@ -30,8 +30,8 @@ or ```html ``` diff --git a/examples/asa.ts b/examples/asa.ts index 6eb0353e1..db30e2946 100644 --- a/examples/asa.ts +++ b/examples/asa.ts @@ -7,10 +7,12 @@ import { getLocalAlgodClient, getLocalAccounts, getLocalIndexerClient, + indexerWaitForRound, } from './utils'; async function main() { const algodClient = getLocalAlgodClient(); + const indexerClient = getLocalIndexerClient(); const accounts = await getLocalAccounts(); const creator = accounts[0]; @@ -49,11 +51,11 @@ async function main() { console.log(`Asset Params: ${assetInfo.params}`); // example: ASSET_INFO - await new Promise((f) => setTimeout(f, 45000)); // sleep to ensure indexer is caught up + // ensure indexer is caught up + await indexerWaitForRound(indexerClient, result['confirmed-round'], 30); // example: INDEXER_LOOKUP_ASSET - const indexer = getLocalIndexerClient(); - const indexerAssetInfo = await indexer.lookupAssetByID(assetIndex).do(); + const indexerAssetInfo = await indexerClient.lookupAssetByID(assetIndex).do(); console.log('Indexer Asset Info:', indexerAssetInfo); // example: INDEXER_LOOKUP_ASSET diff --git a/examples/indexer.ts b/examples/indexer.ts index 3d62e3ae4..27ccb9e71 100644 --- a/examples/indexer.ts +++ b/examples/indexer.ts @@ -7,6 +7,7 @@ import { getLocalIndexerClient, getLocalAccounts, getLocalAlgodClient, + indexerWaitForRound, } from './utils'; import algosdk from '../src'; @@ -73,9 +74,14 @@ async function main() { }); await client.sendRawTransaction(txn.signTxn(sender.privateKey)).do(); - await algosdk.waitForConfirmation(client, txn.txID().toString(), 3); + const result = await algosdk.waitForConfirmation( + client, + txn.txID().toString(), + 3 + ); - await new Promise((f) => setTimeout(f, 1000)); // sleep to ensure indexer is caught up + // ensure indexer is caught up + await indexerWaitForRound(indexerClient, result['confirmed-round'], 30); // example: INDEXER_PREFIX_SEARCH const txnsWithNotePrefix = await indexerClient diff --git a/examples/participation.ts b/examples/participation.ts index 4cb3da657..f5fd2ae61 100644 --- a/examples/participation.ts +++ b/examples/participation.ts @@ -49,7 +49,6 @@ async function main() { { from: addr, suggestedParams, - nonParticipation: true, } ); console.log(offlineKeyReg.get_obj_for_encoding()); diff --git a/examples/utils.ts b/examples/utils.ts index 4546e10ad..809d46b8a 100644 --- a/examples/utils.ts +++ b/examples/utils.ts @@ -45,6 +45,41 @@ export function getLocalAlgodClient() { return algodClient; } +function sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +export async function indexerWaitForRound( + client: algosdk.Indexer, + round: number | bigint, + maxAttempts: number +) { + let indexerRound = 0; + let attempts = 0; + + for (;;) { + // eslint-disable-next-line no-await-in-loop + const status = await client.makeHealthCheck().do(); + indexerRound = status.round; + + if (indexerRound >= round) { + // Success + break; + } + + // eslint-disable-next-line no-await-in-loop + await sleep(1000); // Sleep 1 second and check again + attempts += 1; + + if (attempts > maxAttempts) { + // Failsafe to prevent infinite loop + throw new Error( + `Timeout waiting for indexer to catch up to round ${round}. It is currently on ${indexerRound}` + ); + } + } +} + export interface SandboxAccount { addr: string; privateKey: Uint8Array; diff --git a/package-lock.json b/package-lock.json index d7369754a..f16d29e71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "algosdk", - "version": "2.7.0", + "version": "2.8.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "algosdk", - "version": "2.7.0", + "version": "2.8.0", "license": "MIT", "dependencies": { "algo-msgpack-with-bigint": "^2.1.1", @@ -25,7 +25,7 @@ "@typescript-eslint/eslint-plugin": "^4.26.1", "@typescript-eslint/parser": "^4.26.1", "assert": "^2.0.0", - "chromedriver": "^116.0.0", + "chromedriver": "^122.0.3", "concurrently": "^6.2.0", "cucumber": "^5.1.0", "es-abstract": "^1.18.3", @@ -360,9 +360,15 @@ } }, "node_modules/@testim/chrome-version": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz", - "integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz", + "integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g==", + "dev": true + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", "dev": true }, "node_modules/@tsconfig/node10": { @@ -1196,6 +1202,24 @@ "repeat-string": "^1.6.1" } }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ast-types/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -1224,12 +1248,12 @@ } }, "node_modules/axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dev": true, "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -1259,6 +1283,15 @@ } ] }, + "node_modules/basic-ftp": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.4.tgz", + "integrity": "sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/becke-ch--regex--s0-0-v1--base--pl--lib": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/becke-ch--regex--s0-0-v1--base--pl--lib/-/becke-ch--regex--s0-0-v1--base--pl--lib-1.4.0.tgz", @@ -1591,31 +1624,31 @@ } }, "node_modules/chromedriver": { - "version": "116.0.0", - "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-116.0.0.tgz", - "integrity": "sha512-/TQaRn+RUAYnVqy5Vx8VtU8DvtWosU8QLM2u7BoNM5h55PRQPXF/onHAehEi8Sj/CehdKqH50NFdiumQAUr0DQ==", + "version": "122.0.3", + "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-122.0.3.tgz", + "integrity": "sha512-f7TcCYM6tPxQAl4NQ4KckZ55j62RUfUswbl2iEScs+gI1cqRhzacjMR/FiFx3LUa4S/EZIBgnCx9L+JDhIzVpw==", "dev": true, "hasInstallScript": true, "dependencies": { - "@testim/chrome-version": "^1.1.3", - "axios": "^1.4.0", - "compare-versions": "^6.0.0", + "@testim/chrome-version": "^1.1.4", + "axios": "^1.6.7", + "compare-versions": "^6.1.0", "extract-zip": "^2.0.1", - "https-proxy-agent": "^5.0.1", + "proxy-agent": "^6.4.0", "proxy-from-env": "^1.1.0", - "tcp-port-used": "^1.0.1" + "tcp-port-used": "^1.0.2" }, "bin": { "chromedriver": "bin/chromedriver" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/chromedriver/node_modules/compare-versions": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.0.0.tgz", - "integrity": "sha512-s2MzYxfRsE9f/ow8hjn7ysa7pod1xhHdQMsgiJtKx6XSNf4x2N1KG4fjrkUmXcP/e9Y2ZX4zB6sHIso0Lm6evQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz", + "integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==", "dev": true }, "node_modules/ci-info": { @@ -2050,6 +2083,15 @@ "type": "^1.0.1" } }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, "node_modules/date-fns": { "version": "2.22.1", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.22.1.tgz", @@ -2156,6 +2198,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2474,6 +2530,46 @@ "node": ">=0.8.0" } }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/eslint": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", @@ -3359,9 +3455,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "dev": true, "funding": [ { @@ -3419,6 +3515,20 @@ "node": ">= 0.6" } }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -3571,6 +3681,38 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-uri": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "dev": true, + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4", + "fs-extra": "^11.2.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-uri/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/gherkin": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/gherkin/-/gherkin-5.1.0.tgz", @@ -3874,6 +4016,48 @@ "node": ">=0.6" } }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/http2-wrapper": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", @@ -4241,6 +4425,25 @@ "node": ">=10.13.0" } }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true + }, "node_modules/ip-regex": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", @@ -4714,6 +4917,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -4764,6 +4973,18 @@ "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", "dev": true }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", @@ -5543,6 +5764,15 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", @@ -5790,6 +6020,80 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pac-proxy-agent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", + "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "dev": true, + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "pac-resolver": "^7.0.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/pad-right": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", @@ -5962,6 +6266,76 @@ "node": ">= 0.10" } }, + "node_modules/proxy-agent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -6619,6 +6993,73 @@ "node": ">=8" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz", + "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==", + "dev": true, + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/source-map": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", @@ -7499,6 +7940,15 @@ "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==", "dev": true }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -8316,9 +8766,15 @@ } }, "@testim/chrome-version": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz", - "integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz", + "integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g==", + "dev": true + }, + "@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", "dev": true }, "@tsconfig/node10": { @@ -8970,6 +9426,23 @@ "repeat-string": "^1.6.1" } }, + "ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "requires": { + "tslib": "^2.0.1" + }, + "dependencies": { + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + } + } + }, "astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -8989,12 +9462,12 @@ "dev": true }, "axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dev": true, "requires": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -9010,6 +9483,12 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, + "basic-ftp": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.4.tgz", + "integrity": "sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==", + "dev": true + }, "becke-ch--regex--s0-0-v1--base--pl--lib": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/becke-ch--regex--s0-0-v1--base--pl--lib/-/becke-ch--regex--s0-0-v1--base--pl--lib-1.4.0.tgz", @@ -9249,24 +9728,24 @@ "dev": true }, "chromedriver": { - "version": "116.0.0", - "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-116.0.0.tgz", - "integrity": "sha512-/TQaRn+RUAYnVqy5Vx8VtU8DvtWosU8QLM2u7BoNM5h55PRQPXF/onHAehEi8Sj/CehdKqH50NFdiumQAUr0DQ==", + "version": "122.0.3", + "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-122.0.3.tgz", + "integrity": "sha512-f7TcCYM6tPxQAl4NQ4KckZ55j62RUfUswbl2iEScs+gI1cqRhzacjMR/FiFx3LUa4S/EZIBgnCx9L+JDhIzVpw==", "dev": true, "requires": { - "@testim/chrome-version": "^1.1.3", - "axios": "^1.4.0", - "compare-versions": "^6.0.0", + "@testim/chrome-version": "^1.1.4", + "axios": "^1.6.7", + "compare-versions": "^6.1.0", "extract-zip": "^2.0.1", - "https-proxy-agent": "^5.0.1", + "proxy-agent": "^6.4.0", "proxy-from-env": "^1.1.0", - "tcp-port-used": "^1.0.1" + "tcp-port-used": "^1.0.2" }, "dependencies": { "compare-versions": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.0.0.tgz", - "integrity": "sha512-s2MzYxfRsE9f/ow8hjn7ysa7pod1xhHdQMsgiJtKx6XSNf4x2N1KG4fjrkUmXcP/e9Y2ZX4zB6sHIso0Lm6evQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz", + "integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==", "dev": true } } @@ -9624,6 +10103,12 @@ "type": "^1.0.1" } }, + "data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true + }, "date-fns": { "version": "2.22.1", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.22.1.tgz", @@ -9690,6 +10175,17 @@ "object-keys": "^1.1.1" } }, + "degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "requires": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -9953,6 +10449,33 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, "eslint": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", @@ -10639,9 +11162,9 @@ "dev": true }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "dev": true }, "for-each": { @@ -10676,6 +11199,17 @@ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "dev": true }, + "fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, "fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -10784,6 +11318,29 @@ "get-intrinsic": "^1.1.1" } }, + "get-uri": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "dev": true, + "requires": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4", + "fs-extra": "^11.2.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, "gherkin": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/gherkin/-/gherkin-5.1.0.tgz", @@ -11000,6 +11557,36 @@ } } }, + "http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "requires": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "dependencies": { + "agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "requires": { + "debug": "^4.3.4" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, "http2-wrapper": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", @@ -11249,6 +11836,24 @@ "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true }, + "ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "requires": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "dependencies": { + "sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true + } + } + }, "ip-regex": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", @@ -11581,6 +12186,12 @@ "esprima": "^4.0.0" } }, + "jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -11628,6 +12239,16 @@ "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", "dev": true }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, "jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", @@ -12210,6 +12831,12 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "dev": true + }, "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", @@ -12390,6 +13017,62 @@ "aggregate-error": "^3.0.0" } }, + "pac-proxy-agent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", + "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "dev": true, + "requires": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "pac-resolver": "^7.0.0", + "socks-proxy-agent": "^8.0.2" + }, + "dependencies": { + "agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "requires": { + "debug": "^4.3.4" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "requires": { + "agent-base": "^7.0.2", + "debug": "4" + } + } + } + }, + "pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "requires": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + } + }, "pad-right": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", @@ -12517,6 +13200,58 @@ "ipaddr.js": "1.9.1" } }, + "proxy-agent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "dev": true, + "requires": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "dependencies": { + "agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "requires": { + "debug": "^4.3.4" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "requires": { + "agent-base": "^7.0.2", + "debug": "4" + } + }, + "lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true + } + } + }, "proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -13006,6 +13741,53 @@ "is-fullwidth-code-point": "^3.0.0" } }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true + }, + "socks": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz", + "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==", + "dev": true, + "requires": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + } + }, + "socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "dev": true, + "requires": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "dependencies": { + "agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "requires": { + "debug": "^4.3.4" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, "source-map": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", @@ -13662,6 +14444,12 @@ "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==", "dev": true }, + "universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/package.json b/package.json index 0a275e69d..a316127dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "algosdk", - "version": "2.7.0", + "version": "2.8.0", "description": "The official JavaScript SDK for Algorand", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", @@ -37,7 +37,7 @@ "@typescript-eslint/eslint-plugin": "^4.26.1", "@typescript-eslint/parser": "^4.26.1", "assert": "^2.0.0", - "chromedriver": "^116.0.0", + "chromedriver": "^122.0.3", "concurrently": "^6.2.0", "cucumber": "^5.1.0", "es-abstract": "^1.18.3", diff --git a/src/client/v2/algod/models/types.ts b/src/client/v2/algod/models/types.ts index 3392591e0..bff5405a5 100644 --- a/src/client/v2/algod/models/types.ts +++ b/src/client/v2/algod/models/types.ts @@ -127,6 +127,23 @@ export class Account extends BaseModel { */ public createdAssets?: Asset[]; + /** + * Whether or not the account can receive block incentives if its balance is in + * range at proposal time. + */ + public incentiveEligible?: boolean; + + /** + * The round in which this account last went online, or explicitly renewed their + * online status. + */ + public lastHeartbeat?: number | bigint; + + /** + * The round in which this account last proposed the block. + */ + public lastProposed?: number | bigint; + /** * AccountParticipation describes the parameters used by this account in consensus * protocol. @@ -197,6 +214,11 @@ export class Account extends BaseModel { * Note: the raw account uses `map[int] -> AppParams` for this type. * @param createdAssets - (apar) parameters of assets created by this account. * Note: the raw account uses `map[int] -> Asset` for this type. + * @param incentiveEligible - Whether or not the account can receive block incentives if its balance is in + * range at proposal time. + * @param lastHeartbeat - The round in which this account last went online, or explicitly renewed their + * online status. + * @param lastProposed - The round in which this account last proposed the block. * @param participation - AccountParticipation describes the parameters used by this account in consensus * protocol. * @param rewardBase - (ebase) used as part of the rewards computation. Only applicable to accounts @@ -229,6 +251,9 @@ export class Account extends BaseModel { authAddr, createdApps, createdAssets, + incentiveEligible, + lastHeartbeat, + lastProposed, participation, rewardBase, sigType, @@ -254,6 +279,9 @@ export class Account extends BaseModel { authAddr?: string; createdApps?: Application[]; createdAssets?: Asset[]; + incentiveEligible?: boolean; + lastHeartbeat?: number | bigint; + lastProposed?: number | bigint; participation?: AccountParticipation; rewardBase?: number | bigint; sigType?: string; @@ -280,6 +308,9 @@ export class Account extends BaseModel { this.authAddr = authAddr; this.createdApps = createdApps; this.createdAssets = createdAssets; + this.incentiveEligible = incentiveEligible; + this.lastHeartbeat = lastHeartbeat; + this.lastProposed = lastProposed; this.participation = participation; this.rewardBase = rewardBase; this.sigType = sigType; @@ -306,6 +337,9 @@ export class Account extends BaseModel { authAddr: 'auth-addr', createdApps: 'created-apps', createdAssets: 'created-assets', + incentiveEligible: 'incentive-eligible', + lastHeartbeat: 'last-heartbeat', + lastProposed: 'last-proposed', participation: 'participation', rewardBase: 'reward-base', sigType: 'sig-type', @@ -394,6 +428,9 @@ export class Account extends BaseModel { typeof data['created-assets'] !== 'undefined' ? data['created-assets'].map(Asset.from_obj_for_encoding) : undefined, + incentiveEligible: data['incentive-eligible'], + lastHeartbeat: data['last-heartbeat'], + lastProposed: data['last-proposed'], participation: typeof data['participation'] !== 'undefined' ? AccountParticipation.from_obj_for_encoding(data['participation']) @@ -484,6 +521,65 @@ export class AccountApplicationResponse extends BaseModel { } } +/** + * AccountAssetHolding describes the account's asset holding and asset parameters + * (if either exist) for a specific asset ID. + */ +export class AccountAssetHolding extends BaseModel { + /** + * (asset) Details about the asset held by this account. + * The raw account uses `AssetHolding` for this type. + */ + public assetHolding: AssetHolding; + + /** + * (apar) parameters of the asset held by this account. + * The raw account uses `AssetParams` for this type. + */ + public assetParams?: AssetParams; + + /** + * Creates a new `AccountAssetHolding` object. + * @param assetHolding - (asset) Details about the asset held by this account. + * The raw account uses `AssetHolding` for this type. + * @param assetParams - (apar) parameters of the asset held by this account. + * The raw account uses `AssetParams` for this type. + */ + constructor({ + assetHolding, + assetParams, + }: { + assetHolding: AssetHolding; + assetParams?: AssetParams; + }) { + super(); + this.assetHolding = assetHolding; + this.assetParams = assetParams; + + this.attribute_map = { + assetHolding: 'asset-holding', + assetParams: 'asset-params', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding(data: Record): AccountAssetHolding { + /* eslint-disable dot-notation */ + if (typeof data['asset-holding'] === 'undefined') + throw new Error( + `Response is missing required field 'asset-holding': ${data}` + ); + return new AccountAssetHolding({ + assetHolding: AssetHolding.from_obj_for_encoding(data['asset-holding']), + assetParams: + typeof data['asset-params'] !== 'undefined' + ? AssetParams.from_obj_for_encoding(data['asset-params']) + : undefined, + }); + /* eslint-enable dot-notation */ + } +} + /** * AccountAssetResponse describes the account's asset holding and asset parameters * (if either exist) for a specific asset ID. Asset parameters will only be @@ -558,6 +654,72 @@ export class AccountAssetResponse extends BaseModel { } } +/** + * AccountAssetsInformationResponse contains a list of assets held by an account. + */ +export class AccountAssetsInformationResponse extends BaseModel { + /** + * The round for which this information is relevant. + */ + public round: number | bigint; + + public assetHoldings?: AccountAssetHolding[]; + + /** + * Used for pagination, when making another request provide this token with the + * next parameter. + */ + public nextToken?: string; + + /** + * Creates a new `AccountAssetsInformationResponse` object. + * @param round - The round for which this information is relevant. + * @param assetHoldings - + * @param nextToken - Used for pagination, when making another request provide this token with the + * next parameter. + */ + constructor({ + round, + assetHoldings, + nextToken, + }: { + round: number | bigint; + assetHoldings?: AccountAssetHolding[]; + nextToken?: string; + }) { + super(); + this.round = round; + this.assetHoldings = assetHoldings; + this.nextToken = nextToken; + + this.attribute_map = { + round: 'round', + assetHoldings: 'asset-holdings', + nextToken: 'next-token', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding( + data: Record + ): AccountAssetsInformationResponse { + /* eslint-disable dot-notation */ + if (typeof data['round'] === 'undefined') + throw new Error(`Response is missing required field 'round': ${data}`); + return new AccountAssetsInformationResponse({ + round: data['round'], + assetHoldings: + typeof data['asset-holdings'] !== 'undefined' + ? data['asset-holdings'].map( + AccountAssetHolding.from_obj_for_encoding + ) + : undefined, + nextToken: data['next-token'], + }); + /* eslint-enable dot-notation */ + } +} + /** * AccountParticipation describes the parameters used by this account in consensus * protocol. @@ -733,6 +895,75 @@ export class AccountStateDelta extends BaseModel { } } +/** + * The logged messages from an app call along with the app ID and outer transaction + * ID. Logs appear in the same order that they were emitted. + */ +export class AppCallLogs extends BaseModel { + /** + * The application from which the logs were generated + */ + public applicationIndex: number | bigint; + + /** + * An array of logs + */ + public logs: Uint8Array[]; + + /** + * The transaction ID of the outer app call that lead to these logs + */ + public txid: string; + + /** + * Creates a new `AppCallLogs` object. + * @param applicationIndex - The application from which the logs were generated + * @param logs - An array of logs + * @param txid - The transaction ID of the outer app call that lead to these logs + */ + constructor({ + applicationIndex, + logs, + txid, + }: { + applicationIndex: number | bigint; + logs: Uint8Array[]; + txid: string; + }) { + super(); + this.applicationIndex = applicationIndex; + this.logs = logs; + this.txid = txid; + + this.attribute_map = { + applicationIndex: 'application-index', + logs: 'logs', + txid: 'txId', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding(data: Record): AppCallLogs { + /* eslint-disable dot-notation */ + if (typeof data['application-index'] === 'undefined') + throw new Error( + `Response is missing required field 'application-index': ${data}` + ); + if (!Array.isArray(data['logs'])) + throw new Error( + `Response is missing required array field 'logs': ${data}` + ); + if (typeof data['txId'] === 'undefined') + throw new Error(`Response is missing required field 'txId': ${data}`); + return new AppCallLogs({ + applicationIndex: data['application-index'], + logs: data['logs'], + txid: data['txId'], + }); + /* eslint-enable dot-notation */ + } +} + /** * Application index and its parameters */ @@ -1867,6 +2098,45 @@ export class BlockHashResponse extends BaseModel { } } +/** + * All logs emitted in the given round. Each app call, whether top-level or inner, + * that contains logs results in a separate AppCallLogs object. Therefore there may + * be multiple AppCallLogs with the same application ID and outer transaction ID in + * the event of multiple inner app calls to the same app. App calls with no logs + * are not included in the response. AppCallLogs are returned in the same order + * that their corresponding app call appeared in the block (pre-order traversal of + * inner app calls) + */ +export class BlockLogsResponse extends BaseModel { + public logs: AppCallLogs[]; + + /** + * Creates a new `BlockLogsResponse` object. + * @param logs - + */ + constructor({ logs }: { logs: AppCallLogs[] }) { + super(); + this.logs = logs; + + this.attribute_map = { + logs: 'logs', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding(data: Record): BlockLogsResponse { + /* eslint-disable dot-notation */ + if (!Array.isArray(data['logs'])) + throw new Error( + `Response is missing required array field 'logs': ${data}` + ); + return new BlockLogsResponse({ + logs: data['logs'].map(AppCallLogs.from_obj_for_encoding), + }); + /* eslint-enable dot-notation */ + } +} + /** * Encoded block object. */ @@ -4931,6 +5201,19 @@ export class SimulationTransactionExecTrace extends BaseModel { */ public clearStateProgramTrace?: SimulationOpcodeTraceUnit[]; + /** + * If true, indicates that the clear state program failed and any persistent state + * changes it produced should be reverted once the program exits. + */ + public clearStateRollback?: boolean; + + /** + * The error message explaining why the clear state program failed. This field will + * only be populated if clear-state-rollback is true and the failure was due to an + * execution error. + */ + public clearStateRollbackError?: string; + /** * An array of SimulationTransactionExecTrace representing the execution trace of * any inner transactions executed. @@ -4953,6 +5236,11 @@ export class SimulationTransactionExecTrace extends BaseModel { * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program. * @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction. * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program. + * @param clearStateRollback - If true, indicates that the clear state program failed and any persistent state + * changes it produced should be reverted once the program exits. + * @param clearStateRollbackError - The error message explaining why the clear state program failed. This field will + * only be populated if clear-state-rollback is true and the failure was due to an + * execution error. * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of * any inner transactions executed. * @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction. @@ -4963,6 +5251,8 @@ export class SimulationTransactionExecTrace extends BaseModel { approvalProgramTrace, clearStateProgramHash, clearStateProgramTrace, + clearStateRollback, + clearStateRollbackError, innerTrace, logicSigHash, logicSigTrace, @@ -4971,6 +5261,8 @@ export class SimulationTransactionExecTrace extends BaseModel { approvalProgramTrace?: SimulationOpcodeTraceUnit[]; clearStateProgramHash?: string | Uint8Array; clearStateProgramTrace?: SimulationOpcodeTraceUnit[]; + clearStateRollback?: boolean; + clearStateRollbackError?: string; innerTrace?: SimulationTransactionExecTrace[]; logicSigHash?: string | Uint8Array; logicSigTrace?: SimulationOpcodeTraceUnit[]; @@ -4986,6 +5278,8 @@ export class SimulationTransactionExecTrace extends BaseModel { ? new Uint8Array(Buffer.from(clearStateProgramHash, 'base64')) : clearStateProgramHash; this.clearStateProgramTrace = clearStateProgramTrace; + this.clearStateRollback = clearStateRollback; + this.clearStateRollbackError = clearStateRollbackError; this.innerTrace = innerTrace; this.logicSigHash = typeof logicSigHash === 'string' @@ -4998,6 +5292,8 @@ export class SimulationTransactionExecTrace extends BaseModel { approvalProgramTrace: 'approval-program-trace', clearStateProgramHash: 'clear-state-program-hash', clearStateProgramTrace: 'clear-state-program-trace', + clearStateRollback: 'clear-state-rollback', + clearStateRollbackError: 'clear-state-rollback-error', innerTrace: 'inner-trace', logicSigHash: 'logic-sig-hash', logicSigTrace: 'logic-sig-trace', @@ -5024,6 +5320,8 @@ export class SimulationTransactionExecTrace extends BaseModel { SimulationOpcodeTraceUnit.from_obj_for_encoding ) : undefined, + clearStateRollback: data['clear-state-rollback'], + clearStateRollbackError: data['clear-state-rollback-error'], innerTrace: typeof data['inner-trace'] !== 'undefined' ? data['inner-trace'].map( diff --git a/src/client/v2/indexer/models/types.ts b/src/client/v2/indexer/models/types.ts index 12b0555f4..7d51e9985 100644 --- a/src/client/v2/indexer/models/types.ts +++ b/src/client/v2/indexer/models/types.ts @@ -18,7 +18,7 @@ export class Account extends BaseModel { public address: string; /** - * (algo) total number of MicroAlgos in the account + * total number of MicroAlgos in the account */ public amount: number | bigint; @@ -27,14 +27,19 @@ export class Account extends BaseModel { */ public amountWithoutPendingRewards: number | bigint; + /** + * MicroAlgo balance required by the account. + * The requirement grows based on asset and application usage. + */ + public minBalance: number | bigint; + /** * amount of MicroAlgos of pending rewards in this account. */ public pendingRewards: number | bigint; /** - * (ern) total rewards of MicroAlgos the account has received, including pending - * rewards. + * total rewards of MicroAlgos the account has received, including pending rewards. */ public rewards: number | bigint; @@ -44,7 +49,7 @@ export class Account extends BaseModel { public round: number | bigint; /** - * (onl) delegation status of the account's MicroAlgos + * voting status of the account's MicroAlgos * * Offline - indicates that the associated account is delegated. * * Online - indicates that the associated account used as part of the delegation * pool. @@ -88,33 +93,32 @@ export class Account extends BaseModel { public totalCreatedAssets: number | bigint; /** - * (appl) applications local data stored in this account. + * application local data stored in this account. * Note the raw object uses `map[int] -> AppLocalState` for this type. */ public appsLocalState?: ApplicationLocalState[]; /** - * (teap) the sum of all extra application program pages for this account. + * the sum of all extra application program pages for this account. */ public appsTotalExtraPages?: number | bigint; /** - * (tsch) stores the sum of all of the local schemas and global schemas in this - * account. + * the sum of all of the local schemas and global schemas in this account. * Note: the raw account uses `StateSchema` for this type. */ public appsTotalSchema?: ApplicationStateSchema; /** - * (asset) assets held by this account. + * assets held by this account. * Note the raw object uses `map[int] -> AssetHolding` for this type. */ public assets?: AssetHolding[]; /** - * (spend) the address against which signing should be checked. If empty, the - * address of the current account is used. This field can be updated in any - * transaction by setting the RekeyTo field. + * The address against which signing should be checked. If empty, the address of + * the current account is used. This field can be updated in any transaction by + * setting the RekeyTo field. */ public authAddr?: string; @@ -124,14 +128,13 @@ export class Account extends BaseModel { public closedAtRound?: number | bigint; /** - * (appp) parameters of applications created by this account including app global - * data. + * parameters of applications created by this account including app global data. * Note: the raw account uses `map[int] -> AppParams` for this type. */ public createdApps?: Application[]; /** - * (apar) parameters of assets created by this account. + * parameters of assets created by this account. * Note: the raw account uses `map[int] -> Asset` for this type. */ public createdAssets?: Asset[]; @@ -146,6 +149,23 @@ export class Account extends BaseModel { */ public deleted?: boolean; + /** + * can the account receive block incentives if its balance is in range at proposal + * time. + */ + public incentiveEligible?: boolean; + + /** + * The round in which this account last went online, or explicitly renewed their + * online status. + */ + public lastHeartbeat?: number | bigint; + + /** + * The round in which this account last proposed the block. + */ + public lastProposed?: number | bigint; + /** * AccountParticipation describes the parameters used by this account in consensus * protocol. @@ -153,13 +173,13 @@ export class Account extends BaseModel { public participation?: AccountParticipation; /** - * (ebase) used as part of the rewards computation. Only applicable to accounts - * which are participating. + * used as part of the rewards computation. Only applicable to accounts which are + * participating. */ public rewardBase?: number | bigint; /** - * Indicates what type of signature is used by this account, must be one of: + * the type of signature used by this account, must be one of: * * sig * * msig * * lsig @@ -170,13 +190,14 @@ export class Account extends BaseModel { /** * Creates a new `Account` object. * @param address - the account public key - * @param amount - (algo) total number of MicroAlgos in the account + * @param amount - total number of MicroAlgos in the account * @param amountWithoutPendingRewards - specifies the amount of MicroAlgos in the account, without the pending rewards. + * @param minBalance - MicroAlgo balance required by the account. + * The requirement grows based on asset and application usage. * @param pendingRewards - amount of MicroAlgos of pending rewards in this account. - * @param rewards - (ern) total rewards of MicroAlgos the account has received, including pending - * rewards. + * @param rewards - total rewards of MicroAlgos the account has received, including pending rewards. * @param round - The round for which this information is relevant. - * @param status - (onl) delegation status of the account's MicroAlgos + * @param status - voting status of the account's MicroAlgos * * Offline - indicates that the associated account is delegated. * * Online - indicates that the associated account used as part of the delegation * pool. @@ -192,30 +213,33 @@ export class Account extends BaseModel { * application. * @param totalCreatedApps - The count of all apps (AppParams objects) created by this account. * @param totalCreatedAssets - The count of all assets (AssetParams objects) created by this account. - * @param appsLocalState - (appl) applications local data stored in this account. + * @param appsLocalState - application local data stored in this account. * Note the raw object uses `map[int] -> AppLocalState` for this type. - * @param appsTotalExtraPages - (teap) the sum of all extra application program pages for this account. - * @param appsTotalSchema - (tsch) stores the sum of all of the local schemas and global schemas in this - * account. + * @param appsTotalExtraPages - the sum of all extra application program pages for this account. + * @param appsTotalSchema - the sum of all of the local schemas and global schemas in this account. * Note: the raw account uses `StateSchema` for this type. - * @param assets - (asset) assets held by this account. + * @param assets - assets held by this account. * Note the raw object uses `map[int] -> AssetHolding` for this type. - * @param authAddr - (spend) the address against which signing should be checked. If empty, the - * address of the current account is used. This field can be updated in any - * transaction by setting the RekeyTo field. + * @param authAddr - The address against which signing should be checked. If empty, the address of + * the current account is used. This field can be updated in any transaction by + * setting the RekeyTo field. * @param closedAtRound - Round during which this account was most recently closed. - * @param createdApps - (appp) parameters of applications created by this account including app global - * data. + * @param createdApps - parameters of applications created by this account including app global data. * Note: the raw account uses `map[int] -> AppParams` for this type. - * @param createdAssets - (apar) parameters of assets created by this account. + * @param createdAssets - parameters of assets created by this account. * Note: the raw account uses `map[int] -> Asset` for this type. * @param createdAtRound - Round during which this account first appeared in a transaction. * @param deleted - Whether or not this account is currently closed. + * @param incentiveEligible - can the account receive block incentives if its balance is in range at proposal + * time. + * @param lastHeartbeat - The round in which this account last went online, or explicitly renewed their + * online status. + * @param lastProposed - The round in which this account last proposed the block. * @param participation - AccountParticipation describes the parameters used by this account in consensus * protocol. - * @param rewardBase - (ebase) used as part of the rewards computation. Only applicable to accounts - * which are participating. - * @param sigType - Indicates what type of signature is used by this account, must be one of: + * @param rewardBase - used as part of the rewards computation. Only applicable to accounts which are + * participating. + * @param sigType - the type of signature used by this account, must be one of: * * sig * * msig * * lsig @@ -225,6 +249,7 @@ export class Account extends BaseModel { address, amount, amountWithoutPendingRewards, + minBalance, pendingRewards, rewards, round, @@ -245,6 +270,9 @@ export class Account extends BaseModel { createdAssets, createdAtRound, deleted, + incentiveEligible, + lastHeartbeat, + lastProposed, participation, rewardBase, sigType, @@ -252,6 +280,7 @@ export class Account extends BaseModel { address: string; amount: number | bigint; amountWithoutPendingRewards: number | bigint; + minBalance: number | bigint; pendingRewards: number | bigint; rewards: number | bigint; round: number | bigint; @@ -272,6 +301,9 @@ export class Account extends BaseModel { createdAssets?: Asset[]; createdAtRound?: number | bigint; deleted?: boolean; + incentiveEligible?: boolean; + lastHeartbeat?: number | bigint; + lastProposed?: number | bigint; participation?: AccountParticipation; rewardBase?: number | bigint; sigType?: string; @@ -280,6 +312,7 @@ export class Account extends BaseModel { this.address = address; this.amount = amount; this.amountWithoutPendingRewards = amountWithoutPendingRewards; + this.minBalance = minBalance; this.pendingRewards = pendingRewards; this.rewards = rewards; this.round = round; @@ -300,6 +333,9 @@ export class Account extends BaseModel { this.createdAssets = createdAssets; this.createdAtRound = createdAtRound; this.deleted = deleted; + this.incentiveEligible = incentiveEligible; + this.lastHeartbeat = lastHeartbeat; + this.lastProposed = lastProposed; this.participation = participation; this.rewardBase = rewardBase; this.sigType = sigType; @@ -308,6 +344,7 @@ export class Account extends BaseModel { address: 'address', amount: 'amount', amountWithoutPendingRewards: 'amount-without-pending-rewards', + minBalance: 'min-balance', pendingRewards: 'pending-rewards', rewards: 'rewards', round: 'round', @@ -328,6 +365,9 @@ export class Account extends BaseModel { createdAssets: 'created-assets', createdAtRound: 'created-at-round', deleted: 'deleted', + incentiveEligible: 'incentive-eligible', + lastHeartbeat: 'last-heartbeat', + lastProposed: 'last-proposed', participation: 'participation', rewardBase: 'reward-base', sigType: 'sig-type', @@ -345,6 +385,10 @@ export class Account extends BaseModel { throw new Error( `Response is missing required field 'amount-without-pending-rewards': ${data}` ); + if (typeof data['min-balance'] === 'undefined') + throw new Error( + `Response is missing required field 'min-balance': ${data}` + ); if (typeof data['pending-rewards'] === 'undefined') throw new Error( `Response is missing required field 'pending-rewards': ${data}` @@ -383,6 +427,7 @@ export class Account extends BaseModel { address: data['address'], amount: data['amount'], amountWithoutPendingRewards: data['amount-without-pending-rewards'], + minBalance: data['min-balance'], pendingRewards: data['pending-rewards'], rewards: data['rewards'], round: data['round'], @@ -422,6 +467,9 @@ export class Account extends BaseModel { : undefined, createdAtRound: data['created-at-round'], deleted: data['deleted'], + incentiveEligible: data['incentive-eligible'], + lastHeartbeat: data['last-heartbeat'], + lastProposed: data['last-proposed'], participation: typeof data['participation'] !== 'undefined' ? AccountParticipation.from_obj_for_encoding(data['participation']) @@ -439,45 +487,43 @@ export class Account extends BaseModel { */ export class AccountParticipation extends BaseModel { /** - * (sel) Selection public key (if any) currently registered for this round. + * Selection public key (if any) currently registered for this round. */ public selectionParticipationKey: Uint8Array; /** - * (voteFst) First round for which this participation is valid. + * First round for which this participation is valid. */ public voteFirstValid: number | bigint; /** - * (voteKD) Number of subkeys in each batch of participation keys. + * Number of subkeys in each batch of participation keys. */ public voteKeyDilution: number | bigint; /** - * (voteLst) Last round for which this participation is valid. + * Last round for which this participation is valid. */ public voteLastValid: number | bigint; /** - * (vote) root participation public key (if any) currently registered for this - * round. + * root participation public key (if any) currently registered for this round. */ public voteParticipationKey: Uint8Array; /** - * (stprf) Root of the state proof key (if any) + * Root of the state proof key (if any) */ public stateProofKey?: Uint8Array; /** * Creates a new `AccountParticipation` object. - * @param selectionParticipationKey - (sel) Selection public key (if any) currently registered for this round. - * @param voteFirstValid - (voteFst) First round for which this participation is valid. - * @param voteKeyDilution - (voteKD) Number of subkeys in each batch of participation keys. - * @param voteLastValid - (voteLst) Last round for which this participation is valid. - * @param voteParticipationKey - (vote) root participation public key (if any) currently registered for this - * round. - * @param stateProofKey - (stprf) Root of the state proof key (if any) + * @param selectionParticipationKey - Selection public key (if any) currently registered for this round. + * @param voteFirstValid - First round for which this participation is valid. + * @param voteKeyDilution - Number of subkeys in each batch of participation keys. + * @param voteLastValid - Last round for which this participation is valid. + * @param voteParticipationKey - root participation public key (if any) currently registered for this round. + * @param stateProofKey - Root of the state proof key (if any) */ constructor({ selectionParticipationKey, @@ -735,12 +781,12 @@ export class AccountsResponse extends BaseModel { */ export class Application extends BaseModel { /** - * (appidx) application index. + * application index. */ public id: number | bigint; /** - * (appparams) application parameters. + * application parameters. */ public params: ApplicationParams; @@ -761,8 +807,8 @@ export class Application extends BaseModel { /** * Creates a new `Application` object. - * @param id - (appidx) application index. - * @param params - (appparams) application parameters. + * @param id - application index. + * @param params - application parameters. * @param createdAtRound - Round when this application was created. * @param deleted - Whether or not this application is currently deleted. * @param deletedAtRound - Round when this application was deleted. @@ -824,7 +870,7 @@ export class ApplicationLocalState extends BaseModel { public id: number | bigint; /** - * (hsch) schema. + * schema. */ public schema: ApplicationStateSchema; @@ -840,7 +886,7 @@ export class ApplicationLocalState extends BaseModel { public deleted?: boolean; /** - * (tkv) storage. + * storage. */ public keyValue?: TealKeyValue[]; @@ -852,11 +898,11 @@ export class ApplicationLocalState extends BaseModel { /** * Creates a new `ApplicationLocalState` object. * @param id - The application which this local state is for. - * @param schema - (hsch) schema. + * @param schema - schema. * @param closedOutAtRound - Round when account closed out of the application. * @param deleted - Whether or not the application local state is currently deleted from its * account. - * @param keyValue - (tkv) storage. + * @param keyValue - storage. * @param optedInAtRound - Round when the account opted into the application. */ constructor({ @@ -990,7 +1036,7 @@ export class ApplicationLocalStatesResponse extends BaseModel { */ export class ApplicationLogData extends BaseModel { /** - * (lg) Logs for the application being executed by the transaction. + * Logs for the application being executed by the transaction. */ public logs: Uint8Array[]; @@ -1001,7 +1047,7 @@ export class ApplicationLogData extends BaseModel { /** * Creates a new `ApplicationLogData` object. - * @param logs - (lg) Logs for the application being executed by the transaction. + * @param logs - Logs for the application being executed by the transaction. * @param txid - Transaction ID */ constructor({ logs, txid }: { logs: Uint8Array[]; txid: string }) { @@ -1118,12 +1164,12 @@ export class ApplicationLogsResponse extends BaseModel { */ export class ApplicationParams extends BaseModel { /** - * (approv) approval program. + * approval program. */ public approvalProgram: Uint8Array; /** - * (clearp) approval program. + * clear state program. */ public clearStateProgram: Uint8Array; @@ -1134,35 +1180,35 @@ export class ApplicationParams extends BaseModel { public creator?: string; /** - * (epp) the amount of extra program pages available to this app. + * the number of extra program pages available to this app. */ public extraProgramPages?: number | bigint; /** - * [\gs) global schema + * global state */ public globalState?: TealKeyValue[]; /** - * [\gsch) global schema + * global schema */ public globalStateSchema?: ApplicationStateSchema; /** - * [\lsch) local schema + * local schema */ public localStateSchema?: ApplicationStateSchema; /** * Creates a new `ApplicationParams` object. - * @param approvalProgram - (approv) approval program. - * @param clearStateProgram - (clearp) approval program. + * @param approvalProgram - approval program. + * @param clearStateProgram - clear state program. * @param creator - The address that created this application. This is the address where the * parameters and global state for this application can be found. - * @param extraProgramPages - (epp) the amount of extra program pages available to this app. - * @param globalState - [\gs) global schema - * @param globalStateSchema - [\gsch) global schema - * @param localStateSchema - [\lsch) local schema + * @param extraProgramPages - the number of extra program pages available to this app. + * @param globalState - global state + * @param globalStateSchema - global schema + * @param localStateSchema - local schema */ constructor({ approvalProgram, @@ -1303,19 +1349,19 @@ export class ApplicationResponse extends BaseModel { */ export class ApplicationStateSchema extends BaseModel { /** - * (nbs) num of byte slices. + * number of byte slices. */ public numByteSlice: number | bigint; /** - * (nui) num of uints. + * number of uints. */ public numUint: number | bigint; /** * Creates a new `ApplicationStateSchema` object. - * @param numByteSlice - (nbs) num of byte slices. - * @param numUint - (nui) num of uints. + * @param numByteSlice - number of byte slices. + * @param numUint - number of uints. */ constructor({ numByteSlice, @@ -1584,7 +1630,7 @@ export class AssetBalancesResponse extends BaseModel { */ export class AssetHolding extends BaseModel { /** - * (a) number of units held. + * number of units held. */ public amount: number | bigint; @@ -1594,7 +1640,7 @@ export class AssetHolding extends BaseModel { public assetId: number | bigint; /** - * (f) whether or not the holding is frozen. + * whether or not the holding is frozen. */ public isFrozen: boolean; @@ -1615,9 +1661,9 @@ export class AssetHolding extends BaseModel { /** * Creates a new `AssetHolding` object. - * @param amount - (a) number of units held. + * @param amount - number of units held. * @param assetId - Asset ID of the holding. - * @param isFrozen - (f) whether or not the holding is frozen. + * @param isFrozen - whether or not the holding is frozen. * @param deleted - Whether or not the asset holding is currently deleted from its account. * @param optedInAtRound - Round during which the account opted into this asset holding. * @param optedOutAtRound - Round during which the account opted out of this asset holding. @@ -1760,49 +1806,49 @@ export class AssetParams extends BaseModel { public creator: string; /** - * (dc) The number of digits to use after the decimal point when displaying this - * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in - * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value - * must be between 0 and 19 (inclusive). + * The number of digits to use after the decimal point when displaying this asset. + * If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. + * If 2, the base unit of the asset is in hundredths, and so on. This value must be + * between 0 and 19 (inclusive). */ public decimals: number | bigint; /** - * (t) The total number of units of this asset. + * The total number of units of this asset. */ public total: number | bigint; /** - * (c) Address of account used to clawback holdings of this asset. If empty, - * clawback is not permitted. + * Address of account used to clawback holdings of this asset. If empty, clawback + * is not permitted. */ public clawback?: string; /** - * (df) Whether holdings of this asset are frozen by default. + * Whether holdings of this asset are frozen by default. */ public defaultFrozen?: boolean; /** - * (f) Address of account used to freeze holdings of this asset. If empty, freezing - * is not permitted. + * Address of account used to freeze holdings of this asset. If empty, freezing is + * not permitted. */ public freeze?: string; /** - * (m) Address of account used to manage the keys of this asset and to destroy it. + * Address of account used to manage the keys of this asset and to destroy it. */ public manager?: string; /** - * (am) A commitment to some unspecified asset metadata. The format of this - * metadata is up to the application. + * A commitment to some unspecified asset metadata. The format of this metadata is + * up to the application. */ public metadataHash?: Uint8Array; /** - * (an) Name of this asset, as supplied by the creator. Included only when the - * asset name is composed of printable utf-8 characters. + * Name of this asset, as supplied by the creator. Included only when the asset + * name is composed of printable utf-8 characters. */ public name?: string; @@ -1812,13 +1858,13 @@ export class AssetParams extends BaseModel { public nameB64?: Uint8Array; /** - * (r) Address of account holding reserve (non-minted) units of this asset. + * Address of account holding reserve (non-minted) units of this asset. */ public reserve?: string; /** - * (un) Name of a unit of this asset, as supplied by the creator. Included only - * when the name of a unit of this asset is composed of printable utf-8 characters. + * Name of a unit of this asset, as supplied by the creator. Included only when the + * name of a unit of this asset is composed of printable utf-8 characters. */ public unitName?: string; @@ -1828,8 +1874,8 @@ export class AssetParams extends BaseModel { public unitNameB64?: Uint8Array; /** - * (au) URL where more information about the asset can be retrieved. Included only - * when the URL is composed of printable utf-8 characters. + * URL where more information about the asset can be retrieved. Included only when + * the URL is composed of printable utf-8 characters. */ public url?: string; @@ -1843,28 +1889,28 @@ export class AssetParams extends BaseModel { * @param creator - The address that created this asset. This is the address where the parameters * for this asset can be found, and also the address where unwanted asset units can * be sent in the worst case. - * @param decimals - (dc) The number of digits to use after the decimal point when displaying this - * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in - * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value - * must be between 0 and 19 (inclusive). - * @param total - (t) The total number of units of this asset. - * @param clawback - (c) Address of account used to clawback holdings of this asset. If empty, - * clawback is not permitted. - * @param defaultFrozen - (df) Whether holdings of this asset are frozen by default. - * @param freeze - (f) Address of account used to freeze holdings of this asset. If empty, freezing + * @param decimals - The number of digits to use after the decimal point when displaying this asset. + * If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. + * If 2, the base unit of the asset is in hundredths, and so on. This value must be + * between 0 and 19 (inclusive). + * @param total - The total number of units of this asset. + * @param clawback - Address of account used to clawback holdings of this asset. If empty, clawback * is not permitted. - * @param manager - (m) Address of account used to manage the keys of this asset and to destroy it. - * @param metadataHash - (am) A commitment to some unspecified asset metadata. The format of this - * metadata is up to the application. - * @param name - (an) Name of this asset, as supplied by the creator. Included only when the - * asset name is composed of printable utf-8 characters. + * @param defaultFrozen - Whether holdings of this asset are frozen by default. + * @param freeze - Address of account used to freeze holdings of this asset. If empty, freezing is + * not permitted. + * @param manager - Address of account used to manage the keys of this asset and to destroy it. + * @param metadataHash - A commitment to some unspecified asset metadata. The format of this metadata is + * up to the application. + * @param name - Name of this asset, as supplied by the creator. Included only when the asset + * name is composed of printable utf-8 characters. * @param nameB64 - Base64 encoded name of this asset, as supplied by the creator. - * @param reserve - (r) Address of account holding reserve (non-minted) units of this asset. - * @param unitName - (un) Name of a unit of this asset, as supplied by the creator. Included only - * when the name of a unit of this asset is composed of printable utf-8 characters. + * @param reserve - Address of account holding reserve (non-minted) units of this asset. + * @param unitName - Name of a unit of this asset, as supplied by the creator. Included only when the + * name of a unit of this asset is composed of printable utf-8 characters. * @param unitNameB64 - Base64 encoded name of a unit of this asset, as supplied by the creator. - * @param url - (au) URL where more information about the asset can be retrieved. Included only - * when the URL is composed of printable utf-8 characters. + * @param url - URL where more information about the asset can be retrieved. Included only when + * the URL is composed of printable utf-8 characters. * @param urlB64 - Base64 encoded URL where more information about the asset can be retrieved. */ constructor({ @@ -2150,11 +2196,31 @@ export class Block extends BaseModel { */ public transactionsRootSha256: Uint8Array; + /** + * the potential bonus payout for this block. + */ + public bonus?: number | bigint; + + /** + * the sum of all fees paid by transactions in this block. + */ + public feesCollected?: number | bigint; + /** * Participation account data that needs to be checked/acted on by the network. */ public participationUpdates?: ParticipationUpdates; + /** + * the proposer of this block. + */ + public proposer?: string; + + /** + * the actual amount transferred to the proposer from the fee sink. + */ + public proposerPayout?: number | bigint; + /** * Fields relating to rewards, */ @@ -2207,7 +2273,11 @@ export class Block extends BaseModel { * vector commitment instead of a merkle tree, and SHA256 hash function instead of * the default SHA512_256. This commitment can be used on environments where only * the SHA256 function exists. + * @param bonus - the potential bonus payout for this block. + * @param feesCollected - the sum of all fees paid by transactions in this block. * @param participationUpdates - Participation account data that needs to be checked/acted on by the network. + * @param proposer - the proposer of this block. + * @param proposerPayout - the actual amount transferred to the proposer from the fee sink. * @param rewards - Fields relating to rewards, * @param stateProofTracking - Tracks the status of state proofs. * @param transactions - (txns) list of transactions corresponding to a given round. @@ -2228,7 +2298,11 @@ export class Block extends BaseModel { timestamp, transactionsRoot, transactionsRootSha256, + bonus, + feesCollected, participationUpdates, + proposer, + proposerPayout, rewards, stateProofTracking, transactions, @@ -2244,7 +2318,11 @@ export class Block extends BaseModel { timestamp: number | bigint; transactionsRoot: string | Uint8Array; transactionsRootSha256: string | Uint8Array; + bonus?: number | bigint; + feesCollected?: number | bigint; participationUpdates?: ParticipationUpdates; + proposer?: string; + proposerPayout?: number | bigint; rewards?: BlockRewards; stateProofTracking?: StateProofTracking[]; transactions?: Transaction[]; @@ -2276,7 +2354,11 @@ export class Block extends BaseModel { typeof transactionsRootSha256 === 'string' ? new Uint8Array(Buffer.from(transactionsRootSha256, 'base64')) : transactionsRootSha256; + this.bonus = bonus; + this.feesCollected = feesCollected; this.participationUpdates = participationUpdates; + this.proposer = proposer; + this.proposerPayout = proposerPayout; this.rewards = rewards; this.stateProofTracking = stateProofTracking; this.transactions = transactions; @@ -2293,7 +2375,11 @@ export class Block extends BaseModel { timestamp: 'timestamp', transactionsRoot: 'transactions-root', transactionsRootSha256: 'transactions-root-sha256', + bonus: 'bonus', + feesCollected: 'fees-collected', participationUpdates: 'participation-updates', + proposer: 'proposer', + proposerPayout: 'proposer-payout', rewards: 'rewards', stateProofTracking: 'state-proof-tracking', transactions: 'transactions', @@ -2343,12 +2429,16 @@ export class Block extends BaseModel { timestamp: data['timestamp'], transactionsRoot: data['transactions-root'], transactionsRootSha256: data['transactions-root-sha256'], + bonus: data['bonus'], + feesCollected: data['fees-collected'], participationUpdates: typeof data['participation-updates'] !== 'undefined' ? ParticipationUpdates.from_obj_for_encoding( data['participation-updates'] ) : undefined, + proposer: data['proposer'], + proposerPayout: data['proposer-payout'], rewards: typeof data['rewards'] !== 'undefined' ? BlockRewards.from_obj_for_encoding(data['rewards']) @@ -2653,6 +2743,11 @@ export class Box extends BaseModel { */ public name: Uint8Array; + /** + * The round for which this information is relevant + */ + public round: number | bigint; + /** * (value) box value, base64 encoded. */ @@ -2661,13 +2756,16 @@ export class Box extends BaseModel { /** * Creates a new `Box` object. * @param name - (name) box name, base64 encoded + * @param round - The round for which this information is relevant * @param value - (value) box value, base64 encoded. */ constructor({ name, + round, value, }: { name: string | Uint8Array; + round: number | bigint; value: string | Uint8Array; }) { super(); @@ -2675,6 +2773,7 @@ export class Box extends BaseModel { typeof name === 'string' ? new Uint8Array(Buffer.from(name, 'base64')) : name; + this.round = round; this.value = typeof value === 'string' ? new Uint8Array(Buffer.from(value, 'base64')) @@ -2682,6 +2781,7 @@ export class Box extends BaseModel { this.attribute_map = { name: 'name', + round: 'round', value: 'value', }; } @@ -2691,10 +2791,13 @@ export class Box extends BaseModel { /* eslint-disable dot-notation */ if (typeof data['name'] === 'undefined') throw new Error(`Response is missing required field 'name': ${data}`); + if (typeof data['round'] === 'undefined') + throw new Error(`Response is missing required field 'round': ${data}`); if (typeof data['value'] === 'undefined') throw new Error(`Response is missing required field 'value': ${data}`); return new Box({ name: data['name'], + round: data['round'], value: data['value'], }); /* eslint-enable dot-notation */ @@ -3309,6 +3412,11 @@ export class MiniAssetHolding extends BaseModel { * Participation account data that needs to be checked/acted on by the network. */ export class ParticipationUpdates extends BaseModel { + /** + * (partupabs) a list of online accounts that need to be suspended. + */ + public absentParticipationAccounts?: string[]; + /** * (partupdrmv) a list of online accounts that needs to be converted to offline * since their participation key expired. @@ -3317,18 +3425,23 @@ export class ParticipationUpdates extends BaseModel { /** * Creates a new `ParticipationUpdates` object. + * @param absentParticipationAccounts - (partupabs) a list of online accounts that need to be suspended. * @param expiredParticipationAccounts - (partupdrmv) a list of online accounts that needs to be converted to offline * since their participation key expired. */ constructor({ + absentParticipationAccounts, expiredParticipationAccounts, }: { + absentParticipationAccounts?: string[]; expiredParticipationAccounts?: string[]; }) { super(); + this.absentParticipationAccounts = absentParticipationAccounts; this.expiredParticipationAccounts = expiredParticipationAccounts; this.attribute_map = { + absentParticipationAccounts: 'absent-participation-accounts', expiredParticipationAccounts: 'expired-participation-accounts', }; } @@ -3339,6 +3452,7 @@ export class ParticipationUpdates extends BaseModel { ): ParticipationUpdates { /* eslint-disable dot-notation */ return new ParticipationUpdates({ + absentParticipationAccounts: data['absent-participation-accounts'], expiredParticipationAccounts: data['expired-participation-accounts'], }); /* eslint-enable dot-notation */ @@ -3908,25 +4022,25 @@ export class TealKeyValue extends BaseModel { */ export class TealValue extends BaseModel { /** - * (tb) bytes value. + * bytes value. */ public bytes: string; /** - * (tt) value type. Value `1` refers to **bytes**, value `2` refers to **uint** + * type of the value. Value `1` refers to **bytes**, value `2` refers to **uint** */ public type: number | bigint; /** - * (ui) uint value. + * uint value. */ public uint: number | bigint; /** * Creates a new `TealValue` object. - * @param bytes - (tb) bytes value. - * @param type - (tt) value type. Value `1` refers to **bytes**, value `2` refers to **uint** - * @param uint - (ui) uint value. + * @param bytes - bytes value. + * @param type - type of the value. Value `1` refers to **bytes**, value `2` refers to **uint** + * @param uint - uint value. */ constructor({ bytes, @@ -4892,7 +5006,7 @@ export class TransactionAssetTransfer extends BaseModel { public receiver: string; /** - * Number of assets transfered to the close-to account as part of the transaction. + * Number of assets transferred to the close-to account as part of the transaction. */ public closeAmount?: number | bigint; @@ -4916,7 +5030,7 @@ export class TransactionAssetTransfer extends BaseModel { * that asset in the account's Assets map. * @param assetId - (xaid) ID of the asset being transferred. * @param receiver - (arcv) Recipient address of the transfer. - * @param closeAmount - Number of assets transfered to the close-to account as part of the transaction. + * @param closeAmount - Number of assets transferred to the close-to account as part of the transaction. * @param closeTo - (aclose) Indicates that the asset should be removed from the account's Assets * map, and specifies where the remaining asset holdings should be transferred. * It's always valid to transfer remaining asset holdings to the creator account. diff --git a/src/makeTxn.ts b/src/makeTxn.ts index 9814989f9..4dd08ecf1 100644 --- a/src/makeTxn.ts +++ b/src/makeTxn.ts @@ -135,7 +135,7 @@ export function makeKeyRegistrationTxnWithSuggestedParams( voteKeyDilution: undefined, suggestedParams: MustHaveSuggestedParams['suggestedParams'], rekeyTo?: KeyRegistrationTxn['reKeyTo'], - nonParticipation?: true, + nonParticipation?: boolean, stateProofKey?: undefined ): txnBuilder.Transaction; export function makeKeyRegistrationTxnWithSuggestedParams( diff --git a/tests/cucumber/steps/steps.js b/tests/cucumber/steps/steps.js index f54f2c9ef..c14fad91f 100644 --- a/tests/cucumber/steps/steps.js +++ b/tests/cucumber/steps/steps.js @@ -3482,6 +3482,7 @@ module.exports = function getSteps(options) { 1 ); assert.ok(info['confirmed-round'] > 0); + this.lastTxnConfirmedRound = info['confirmed-round']; }); Given('I reset the array of application IDs to remember.', async function () { @@ -4617,10 +4618,36 @@ module.exports = function getSteps(options) { ); Then( - 'I sleep for {int} milliseconds for indexer to digest things down.', - async (milliseconds) => { + 'I wait for indexer to catch up to the round where my most recent transaction was confirmed.', + async function () { const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); - await sleep(milliseconds); + const maxAttempts = 30; + + const roundToWaitFor = this.lastTxnConfirmedRound; + let indexerRound = 0; + let attempts = 0; + + for (;;) { + // eslint-disable-next-line no-await-in-loop + const status = await this.indexerV2client.makeHealthCheck().do(); + indexerRound = status.round; + + if (indexerRound >= roundToWaitFor) { + // Success + break; + } + + // eslint-disable-next-line no-await-in-loop + await sleep(1000); // Sleep 1 second and check again + attempts += 1; + + if (attempts > maxAttempts) { + // Failsafe to prevent infinite loop + throw new Error( + `Timeout waiting for indexer to catch up to round ${roundToWaitFor}. It is currently on ${indexerRound}` + ); + } + } } ); diff --git a/tests/cucumber/unit.tags b/tests/cucumber/unit.tags index 5c66cad6c..482d9f4b2 100644 --- a/tests/cucumber/unit.tags +++ b/tests/cucumber/unit.tags @@ -22,6 +22,7 @@ @unit.responses.participationupdates @unit.responses.unlimited_assets @unit.responses.blocksummary +@unit.responses.minbalance @unit.responses.statedelta.json @unit.responses.sync @unit.responses.timestamp