From 74254fbe34db3bab5a5d73de07e41880b026db22 Mon Sep 17 00:00:00 2001 From: sarahschwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:08:09 -0600 Subject: [PATCH 01/24] bump versions --- docs/fuels-wallet | 2 +- .../docs/intro-to-sway/typescript-sdk.mdx | 2 +- .../docs/quickstart/building-a-frontend.mdx | 2 +- docs/nightly/builds/sway | 2 +- docs/nightly/fuel-specs | 2 +- docs/nightly/fuels-ts | 2 +- docs/nightly/sway | 2 +- package.json | 4 ++-- pnpm-lock.yaml | 22 +++++++++---------- scripts/wallet-patch-fixes/download-link.mjs | 4 ++-- src/config/versions.json | 2 +- tests/utils/fixtures/index.ts | 2 +- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/fuels-wallet b/docs/fuels-wallet index ca51081a..c5b986ff 160000 --- a/docs/fuels-wallet +++ b/docs/fuels-wallet @@ -1 +1 @@ -Subproject commit ca51081acd4ddf763c1efd7ef59d2411f53bae8b +Subproject commit c5b986ff08955b5b7d47f61404686399f0eecd86 diff --git a/docs/guides/docs/intro-to-sway/typescript-sdk.mdx b/docs/guides/docs/intro-to-sway/typescript-sdk.mdx index 2ce261f7..e4af93ae 100644 --- a/docs/guides/docs/intro-to-sway/typescript-sdk.mdx +++ b/docs/guides/docs/intro-to-sway/typescript-sdk.mdx @@ -41,7 +41,7 @@ action={{ /> ```sh -npm install fuels@0.73.0 @fuel-wallet/sdk@0.15.2 @fuel-wallet/react@0.15.2 +npm install fuels@0.73.0 @fuel-wallet/sdk@0.16.1 @fuel-wallet/react@0.16.1 ``` ## Generate contract types diff --git a/docs/guides/docs/quickstart/building-a-frontend.mdx b/docs/guides/docs/quickstart/building-a-frontend.mdx index 9b9c776a..c2eb32ec 100644 --- a/docs/guides/docs/quickstart/building-a-frontend.mdx +++ b/docs/guides/docs/quickstart/building-a-frontend.mdx @@ -115,7 +115,7 @@ action={{ ```sh -npm install fuels@0.73.0 @fuel-wallet/sdk@0.15.2 @fuel-wallet/react@0.15.2 +npm install fuels@0.73.0 @fuel-wallet/sdk@0.16.1 @fuel-wallet/react@0.16.1 ``` diff --git a/docs/nightly/builds/sway b/docs/nightly/builds/sway index 777c4ca9..4587bb4a 160000 --- a/docs/nightly/builds/sway +++ b/docs/nightly/builds/sway @@ -1 +1 @@ -Subproject commit 777c4ca9a6147d59950281f32d4e8292afc5b464 +Subproject commit 4587bb4ac4b24bca3e568e7d014e212541db7243 diff --git a/docs/nightly/fuel-specs b/docs/nightly/fuel-specs index 3f228e7f..c3416526 160000 --- a/docs/nightly/fuel-specs +++ b/docs/nightly/fuel-specs @@ -1 +1 @@ -Subproject commit 3f228e7fc90283b6fd85752f7b6002867fa42f85 +Subproject commit c34165264ace17eddd3876be91f667d45583b24c diff --git a/docs/nightly/fuels-ts b/docs/nightly/fuels-ts index 37d28e61..97504f17 160000 --- a/docs/nightly/fuels-ts +++ b/docs/nightly/fuels-ts @@ -1 +1 @@ -Subproject commit 37d28e61d1316850af6c565be2e8e4a1e05f47e5 +Subproject commit 97504f17919f99339ef4b26846a9a979993ded2d diff --git a/docs/nightly/sway b/docs/nightly/sway index d1e8f019..98d8f4ca 160000 --- a/docs/nightly/sway +++ b/docs/nightly/sway @@ -1 +1 @@ -Subproject commit d1e8f019c1da46273c3d3a72b385ce356ba2bc20 +Subproject commit 98d8f4cadbac34f232926b9a44b1170ec9da425d diff --git a/package.json b/package.json index 10fc4221..a6c732a7 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "@fuel-ui/icons": "0.21.0-pr-305-04b8434", "@fuel-ui/react": "0.21.0-pr-305-04b8434", "@fuel-wallet/playwright-utils": "^0.13.10", - "@fuel-wallet/react": "0.15.2", - "@fuel-wallet/sdk": "0.15.2", + "@fuel-wallet/react": "0.16.1", + "@fuel-wallet/sdk": "0.16.1", "@fuels/react": "^0.16.0", "@fuels/ts-config": "^0.15.1", "@mdx-js/mdx": "^2.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a2da86e..35e20f0f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,11 +41,11 @@ dependencies: specifier: ^0.13.10 version: 0.13.10(@playwright/test@1.38.1) '@fuel-wallet/react': - specifier: 0.15.2 - version: 0.15.2(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0) + specifier: 0.16.1 + version: 0.16.1(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0) '@fuel-wallet/sdk': - specifier: 0.15.2 - version: 0.15.2(dexie@3.2.4)(fuels@0.76.0) + specifier: 0.16.1 + version: 0.16.1(dexie@3.2.4)(fuels@0.76.0) '@fuels/react': specifier: ^0.16.0 version: 0.16.0(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0) @@ -1829,8 +1829,8 @@ packages: - utf-8-validate dev: false - /@fuel-wallet/react@0.15.2(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cJPidiRSSZM2jV4bHgvQl7EOTnNde7Lx7+49Hxs7hr53eleS5Otd8yY3grgWDWL0D4wiSLZkrUM+U2SH9ScENg==} + /@fuel-wallet/react@0.16.1(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-0VJ5JDulIG5OF/bBdPgXuakIbiJ86cbryDkMjbAPRjsSgW/3J+j9KDzn0WevZxmOG7b/msvf60OHq9Q3tIrnOA==} peerDependencies: fuels: '>=0.73.0' react: ^18.2.0 @@ -1847,12 +1847,12 @@ packages: - react-native dev: false - /@fuel-wallet/sdk@0.15.2(dexie@3.2.4)(fuels@0.76.0): - resolution: {integrity: sha512-hUrCNpWqso968h8oExhVCWp8lOgAR0ZA1dkv7/bOYT+HEpWebl90GjJ2q2xx6+ijq4WrRJi8fIDVgnB7+LD+mw==} + /@fuel-wallet/sdk@0.16.1(dexie@3.2.4)(fuels@0.76.0): + resolution: {integrity: sha512-LqGdOh0gUPMp0XtWtiDjtPbeTucTOPGG+4qbx5gLSeaLoi8QiTw9MQ1wU0VNAIht1tAgF7vwmwYgi0HVDjfsOQ==} peerDependencies: fuels: '>=0.73.0' dependencies: - '@fuel-wallet/types': 0.15.2(dexie@3.2.4)(fuels@0.76.0) + '@fuel-wallet/types': 0.16.1(dexie@3.2.4)(fuels@0.76.0) events: 3.3.0 fuels: 0.76.0(dexie@3.2.4) json-rpc-2.0: 1.7.0 @@ -1860,8 +1860,8 @@ packages: - dexie dev: false - /@fuel-wallet/types@0.15.2(dexie@3.2.4)(fuels@0.76.0): - resolution: {integrity: sha512-RQCIImIItQiAjUrSWjpOp2t9o6YUlSyxakpSlX+myTBM7TjIWXFjZDSFthcLKhQdECMYIf7hZyRf7d0o2AJ6dQ==} + /@fuel-wallet/types@0.16.1(dexie@3.2.4)(fuels@0.76.0): + resolution: {integrity: sha512-x90HaNvjbyBfFF/ZWeoeVdfiJj3wdFkk4IaneQBAB5tVAoF0QzXStWJHSbGnsPm38xzlme+Oo0k+y11OnU3MUw==} peerDependencies: fuels: '>=0.73.0' dependencies: diff --git a/scripts/wallet-patch-fixes/download-link.mjs b/scripts/wallet-patch-fixes/download-link.mjs index f6f318bf..36c408a6 100644 --- a/scripts/wallet-patch-fixes/download-link.mjs +++ b/scripts/wallet-patch-fixes/download-link.mjs @@ -49,8 +49,8 @@ function handleConstantsFile(filePath, version) { const walletVersion = getWalletVersion(version); if (start !== undefined && end !== undefined && walletVersion) { - const downloadLink = walletVersion.includes('15.2') - ? 'https://wallet.fuel.network/app/fuel-wallet-0.15.2.zip' + const downloadLink = walletVersion.includes('16.1') + ? 'https://wallet.fuel.network/app/fuel-wallet-0.16.1.zip' : `https://next-wallet.fuel.network/app/fuel-wallet-${walletVersion}.zip`; const modifiedContent = `export const DOWNLOAD_LINK = '${downloadLink}';`; lines.splice(start, end - start + 1, modifiedContent); diff --git a/src/config/versions.json b/src/config/versions.json index 1dbfafbf..c6b3bec9 100644 --- a/src/config/versions.json +++ b/src/config/versions.json @@ -3,6 +3,6 @@ "forc": "0.49.3", "rust": "0.55.0", "ts": "0.73.0", - "wallet": "0.15.2" + "wallet": "0.16.1" } } diff --git a/tests/utils/fixtures/index.ts b/tests/utils/fixtures/index.ts index 566d0801..54e2e141 100644 --- a/tests/utils/fixtures/index.ts +++ b/tests/utils/fixtures/index.ts @@ -13,7 +13,7 @@ export const test = base.extend<{ // biome-ignore lint/correctness/noEmptyPattern: context: async ({}, use) => { // download fuel wallet - const fuelPathExtension = await downloadFuel('0.15.2'); + const fuelPathExtension = await downloadFuel('0.16.1'); // prepare browser args const browserArgs = [ `--disable-extensions-except=${fuelPathExtension}`, From f7451542f3ef63d993bf1798bcdecbf97aedc83f Mon Sep 17 00:00:00 2001 From: sarahschwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:49:21 -0600 Subject: [PATCH 02/24] fix fuels-ts docs --- docs/fuels-ts | 2 +- package.json | 11 +- pnpm-lock.yaml | 489 +++++++++++----------- scripts/generate-links/getSortedLinks.mjs | 17 +- src/components/SidebarSection.tsx | 1 + src/config/versions.json | 2 +- src/pages/_app.tsx | 29 +- 7 files changed, 285 insertions(+), 266 deletions(-) diff --git a/docs/fuels-ts b/docs/fuels-ts index d9a7729c..97504f17 160000 --- a/docs/fuels-ts +++ b/docs/fuels-ts @@ -1 +1 @@ -Subproject commit d9a7729c549253abcae64ab394c896e2d95bfe5a +Subproject commit 97504f17919f99339ef4b26846a9a979993ded2d diff --git a/package.json b/package.json index a6c732a7..e2021114 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "cookie": "^0.5.0", "dotenv": "^16.3.1", "framer-motion": "^10.16.4", - "fuels": "^0.76.0", + "fuels": "^0.79.0", "globby": "^13.2.2", "gray-matter": "^4.0.3", "hast-util-from-text": "^2.0.1", @@ -96,7 +96,7 @@ }, "devDependencies": { "@biomejs/biome": "1.6.1", - "@playwright/test": "^1.38.1", + "@playwright/test": "^1.39.1", "@types/chrome": "^0.0.245", "@types/cookie": "^0.5.2", "@types/node": "^20.5.9", @@ -106,7 +106,7 @@ "husky": "^8.0.3", "lint-staged": "^14.0.1", "npm-run-all": "^4.1.5", - "pm2": "5.3.0", + "pm2": "^5.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", "sharp": "^0.32.6", @@ -122,7 +122,10 @@ "zod@<=3.22.2": ">=3.22.3", "next@<13.4.20-canary.13": ">=13.4.20-canary.13", "axios@>=0.8.1 <1.6.0": ">=1.6.0", - "sharp@<0.32.6": ">=0.32.6" + "sharp@<0.32.6": ">=0.32.6", + "ip@<1.1.9": ">=1.1.9", + "ip@=2.0.0": ">=2.0.1", + "follow-redirects@<=1.15.5": ">=1.15.6" } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35e20f0f..b3d26844 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ overrides: next@<13.4.20-canary.13: '>=13.4.20-canary.13' axios@>=0.8.1 <1.6.0: '>=1.6.0' sharp@<0.32.6: '>=0.32.6' + ip@<1.1.9: '>=1.1.9' + ip@=2.0.0: '>=2.0.1' + follow-redirects@<=1.15.5: '>=1.15.6' dependencies: '@actions/exec': @@ -39,16 +42,16 @@ dependencies: version: 0.21.0-pr-305-04b8434(@types/react-dom@18.2.7)(@types/react@18.2.21)(csstype@3.1.3) '@fuel-wallet/playwright-utils': specifier: ^0.13.10 - version: 0.13.10(@playwright/test@1.38.1) + version: 0.13.10(@playwright/test@1.42.1) '@fuel-wallet/react': specifier: 0.16.1 - version: 0.16.1(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0) + version: 0.16.1(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.79.0)(react-dom@18.2.0)(react@18.2.0) '@fuel-wallet/sdk': specifier: 0.16.1 - version: 0.16.1(dexie@3.2.4)(fuels@0.76.0) + version: 0.16.1(dexie@3.2.4)(fuels@0.79.0) '@fuels/react': specifier: ^0.16.0 - version: 0.16.0(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0) + version: 0.16.0(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.79.0)(react-dom@18.2.0)(react@18.2.0) '@fuels/ts-config': specifier: ^0.15.1 version: 0.15.1(typescript@5.2.2) @@ -92,8 +95,8 @@ dependencies: specifier: ^10.16.4 version: 10.16.4(react-dom@18.2.0)(react@18.2.0) fuels: - specifier: ^0.76.0 - version: 0.76.0(dexie@3.2.4) + specifier: ^0.79.0 + version: 0.79.0(dexie@3.2.4) globby: specifier: ^13.2.2 version: 13.2.2 @@ -199,8 +202,8 @@ devDependencies: specifier: 1.6.1 version: 1.6.1 '@playwright/test': - specifier: ^1.38.1 - version: 1.38.1 + specifier: ^1.39.1 + version: 1.42.1 '@types/chrome': specifier: ^0.0.245 version: 0.0.245 @@ -229,8 +232,8 @@ devDependencies: specifier: ^4.1.5 version: 4.1.5 pm2: - specifier: 5.3.0 - version: 5.3.0 + specifier: ^5.3.1 + version: 5.3.1 sharp: specifier: ^0.32.6 version: 0.32.6 @@ -1093,16 +1096,17 @@ packages: - utf-8-validate dev: false - /@fuel-ts/abi-coder@0.76.0: - resolution: {integrity: sha512-ADIUhck7NlHKEx/Qud84BPu6lAcc/U22/1KnLSUi1b2Vi8bR0JSgovr7ZW/Gi2/mmiwJmQO9Wb8xeJHb4zl+4g==} + /@fuel-ts/abi-coder@0.79.0: + resolution: {integrity: sha512-Jdp0megar7aFP+jecnUvd1SR488wYG0AMb0C7lXpXoWIryk8DwHv8odIMXnj5WA7/VpApXiREgYoTCFs8k65oA==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/crypto': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - '@fuel-ts/utils': 0.76.0 - '@fuel-ts/versions': 0.76.0 + '@fuel-ts/crypto': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/hasher': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@fuel-ts/versions': 0.79.0 ethers: 6.9.0 type-fest: 3.13.1 transitivePeerDependencies: @@ -1130,15 +1134,15 @@ packages: - utf-8-validate dev: false - /@fuel-ts/abi-typegen@0.76.0: - resolution: {integrity: sha512-CwJYx0QBD5rAznfX12KT+0gg80DW8H0sZQH92rKcJiJd6lbqCYMLyRuEETkbw1LVVcUcotKt5NAYi/tmBGztzA==} + /@fuel-ts/abi-typegen@0.79.0: + resolution: {integrity: sha512-YGSc8KmFiYGp/H1ONbKsmX9CQwtV3TSt9NKcfguD26mlW5vNdmpDgEmELxn9xZCKqu4swAtMhT85f+jHzE//CQ==} engines: {node: ^18.18.2 || ^20.0.0} hasBin: true dependencies: - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/utils': 0.76.0 - '@fuel-ts/versions': 0.76.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@fuel-ts/versions': 0.79.0 commander: 9.5.0 glob: 10.3.4 handlebars: 4.7.8 @@ -1147,22 +1151,22 @@ packages: rimraf: 3.0.2 dev: false - /@fuel-ts/account@0.76.0(dexie@3.2.4): - resolution: {integrity: sha512-yz/0Fe4i+ckLYB6P7L4WGfyVuV1dfs8XcBkrc+dusdPHm5vMEkqIUvRkuSn4f9PB1k68TcAkEStxljMSE5jXgQ==} + /@fuel-ts/account@0.79.0(dexie@3.2.4): + resolution: {integrity: sha512-Rj0jV7JrXAolHk6/qlgCrK0YYjSVV6ehqf2g8lxmS102ShcS+/bVHvGhxhUeefGtHOdmHuVEJEcchcbpfuiYaQ==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/abi-coder': 0.76.0 - '@fuel-ts/address': 0.76.0 - '@fuel-ts/crypto': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/fuel-core': 0.76.0 - '@fuel-ts/hasher': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - '@fuel-ts/merkle': 0.76.0 - '@fuel-ts/transactions': 0.76.0 - '@fuel-ts/utils': 0.76.0 - '@fuel-ts/versions': 0.76.0 + '@fuel-ts/abi-coder': 0.79.0 + '@fuel-ts/address': 0.79.0 + '@fuel-ts/crypto': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/fuel-core': 0.79.0 + '@fuel-ts/hasher': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 + '@fuel-ts/merkle': 0.79.0 + '@fuel-ts/transactions': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@fuel-ts/versions': 0.79.0 '@fuels/assets': 0.1.5 '@fuels/vm-asm': 0.42.1 '@noble/curves': 1.3.0 @@ -1201,17 +1205,17 @@ packages: - utf-8-validate dev: false - /@fuel-ts/address@0.76.0: - resolution: {integrity: sha512-J6vhEvfs0EcAW/V7V2eMsKa3/6h3fiAtMkaRPPwX+SybEbnI+3e17JXXD1yGt1UqaS9OWQuaDtnXlXU3UklSZQ==} + /@fuel-ts/address@0.79.0: + resolution: {integrity: sha512-KiDWMQB6cyY9sUCi7e7NPx2sCCejYjC/vLQrTnu4AxV2aVVwQ4GWcRpHO1OGYZ5RalR/yvcR9ebQhpidnU0lUw==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/crypto': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/utils': 0.76.0 - '@fuel-ts/versions': 0.76.0 + '@fuel-ts/crypto': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@fuel-ts/versions': 0.79.0 + '@noble/hashes': 1.3.3 bech32: 2.0.0 - ethers: 6.9.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -1240,22 +1244,22 @@ packages: - utf-8-validate dev: false - /@fuel-ts/contract@0.76.0(dexie@3.2.4): - resolution: {integrity: sha512-95duLCUnXqkhZxiexJIzOURzoYUlOgijCABvV3Gi7LCLS5fwM+6rW4mli7a26CC/hq/irUQY+Ekdu4QV4rg+Ag==} + /@fuel-ts/contract@0.79.0(dexie@3.2.4): + resolution: {integrity: sha512-kyC/pynI5kgTcm9R7xl1qrfUfMWsUQhXfnyv8AXeFuPIIrQMxIvKlKL4bgmQ6AUFJhTDiAv2fmc5dlbqO8RS7w==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/abi-coder': 0.76.0 - '@fuel-ts/account': 0.76.0(dexie@3.2.4) - '@fuel-ts/address': 0.76.0 - '@fuel-ts/crypto': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/merkle': 0.76.0 - '@fuel-ts/program': 0.76.0(dexie@3.2.4) - '@fuel-ts/transactions': 0.76.0 - '@fuel-ts/utils': 0.76.0 - '@fuel-ts/versions': 0.76.0 - ethers: 6.9.0 + '@fuel-ts/abi-coder': 0.79.0 + '@fuel-ts/account': 0.79.0(dexie@3.2.4) + '@fuel-ts/address': 0.79.0 + '@fuel-ts/crypto': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/hasher': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/merkle': 0.79.0 + '@fuel-ts/program': 0.79.0(dexie@3.2.4) + '@fuel-ts/transactions': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@fuel-ts/versions': 0.79.0 transitivePeerDependencies: - bufferutil - dexie @@ -1276,13 +1280,13 @@ packages: - utf-8-validate dev: false - /@fuel-ts/crypto@0.76.0: - resolution: {integrity: sha512-CsZxuyCE0qVt3SATYBXwYQUgp8lB/h9RvIi4ZWAO1Fx+kVGHDgn7aVEn2QQbKvelYKk1HAgled8hMyqaDRk4cQ==} + /@fuel-ts/crypto@0.79.0: + resolution: {integrity: sha512-kjXhoNK3rVrx0nDGDN9L1nZ6yU6XBVOujhrA5un9RD/hw4DdXfBL4XSIwu6HJ5ZLCcx555kabNHku9VxpIGopg==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/utils': 0.76.0 - ethereum-cryptography: 2.1.2 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@noble/hashes': 1.3.3 ethers: 6.9.0 transitivePeerDependencies: - bufferutil @@ -1296,11 +1300,11 @@ packages: '@fuel-ts/versions': 0.67.0 dev: false - /@fuel-ts/errors@0.76.0: - resolution: {integrity: sha512-X67pOvTtTqf1TB1EnsH1UDNULgEAxDvSJ6KRHoNKchS5xwSwNM/VeDqzFlNYaNJDq/5HYaGY91Bnjep10zXmSA==} + /@fuel-ts/errors@0.79.0: + resolution: {integrity: sha512-duca9y2b2z2uOgecxSqaCiRnWbu8Mb+O9zcJelXRpML9yAd7RUMn9enCEohCyFJpFCn4O3tKizJvnmNkeDrbew==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/versions': 0.76.0 + '@fuel-ts/versions': 0.79.0 dev: false /@fuel-ts/forc@0.67.0: @@ -1313,8 +1317,8 @@ packages: - encoding dev: false - /@fuel-ts/forc@0.76.0: - resolution: {integrity: sha512-qtWsf/kCoeKj0rES8y5cUDKscuLdJqseyJmpl0XMM0jDn3WPkXGeGml3qLZYuG9ZMX6xDzC/9UixqiW2hUVuEA==} + /@fuel-ts/forc@0.79.0: + resolution: {integrity: sha512-+8fthdhkKLrnjwMNf8Cg66IYfEIOHipxE+q+Pem4iECDKq8o5U94sjut+AG1MisoXuU4P6hYd5uKioT4YLV+ow==} hasBin: true requiresBuild: true dependencies: @@ -1333,8 +1337,8 @@ packages: - encoding dev: false - /@fuel-ts/fuel-core@0.76.0: - resolution: {integrity: sha512-AZJIZ1g6sfm69xB4dreXfGdmvg0i544kLrHBGszmmbDQwdi+P7GPLwhmfhFFaGaPBZWurFjAA7GNcfp4PCU2XQ==} + /@fuel-ts/fuel-core@0.79.0: + resolution: {integrity: sha512-7RfY2YsXaw5iSzMQgdHjA+NB4WH24qaaMrHqg3+llBBVst0ZsdgC6DK61Z/DUf7sAnLX/DC147b05O5xI6/QCg==} hasBin: true requiresBuild: true dependencies: @@ -1361,16 +1365,16 @@ packages: - utf-8-validate dev: false - /@fuel-ts/hasher@0.76.0: - resolution: {integrity: sha512-SQ1c+XXsghQXPssuMC+/rrHb4fpSIN8VGIrVzyW65IADzIYQvxxNmls8ECqs8j3xAIPjcAglP6MRlZ/Q5Y9AtA==} + /@fuel-ts/hasher@0.79.0: + resolution: {integrity: sha512-y4qcJjIqHxYas3QJm5eI2tcR2Ql/+ReF8avCJ/TS4c/7ZTqESlW4GYHuzgt4+BRawXa+keDfyrbV3gSVS0UByQ==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/address': 0.76.0 - '@fuel-ts/crypto': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - '@fuel-ts/utils': 0.76.0 - ethers: 6.9.0 + '@fuel-ts/address': 0.79.0 + '@fuel-ts/crypto': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@noble/hashes': 1.3.3 ramda: 0.29.0 transitivePeerDependencies: - bufferutil @@ -1397,8 +1401,8 @@ packages: engines: {node: ^18.14.1} dev: false - /@fuel-ts/interfaces@0.76.0: - resolution: {integrity: sha512-ysdQUUU2UP1/f1YzrkVOqhVqBOPrEd8kyTMPbNV0x0hqs7t3z6UqZYtNNHdTYNMOPyYYxxVzREKSaNN42j8FBA==} + /@fuel-ts/interfaces@0.79.0: + resolution: {integrity: sha512-L0KrElKvtLRYDzR/SNH26jVLSLBlE+xng9Wm4gyLSrR7Wnf6pB/l+/BrqGdwbWlN9kD205tC7pUa0KD5AugE2w==} engines: {node: ^18.18.2 || ^20.0.0} dev: false @@ -1418,11 +1422,11 @@ packages: bn.js: 5.2.1 dev: false - /@fuel-ts/math@0.76.0: - resolution: {integrity: sha512-WjxErOHpPQZAJel4kCys1MCIQo0HUfv7z4Vy1Dy3P4/iG4jGa1s4zOghX5QRJMEyZwMyu5Do7BVfa2fT/2insA==} + /@fuel-ts/math@0.79.0: + resolution: {integrity: sha512-x5BxKYzrBF+RfqaUQyWXl4dLn16CMOWQdiVL22ixwFJY42lLKMCaFkN+91dXbF1T0bOlsYclZXfNIlCxGqqfFA==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/errors': 0.76.0 + '@fuel-ts/errors': 0.79.0 '@types/bn.js': 5.1.1 bn.js: 5.2.1 dev: false @@ -1438,13 +1442,13 @@ packages: - utf-8-validate dev: false - /@fuel-ts/merkle@0.76.0: - resolution: {integrity: sha512-zUeLbs26xGTwbkfLNEot5mHSICDyBAU1gcd3JhdUZFDqG+YeBoDeX5MYOCTEqy4uyj0THNexAqLqNQ+97GnrLg==} + /@fuel-ts/merkle@0.79.0: + resolution: {integrity: sha512-VNKvpayikz6HusX2KhSkJTdPyamG+4sv5zOugCRFfjLMJHp1YpGwvy64AY4SijVMojNWP7Pf6Yr4juEKc01XaQ==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - ethers: 6.9.0 + '@fuel-ts/hasher': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -1509,20 +1513,20 @@ packages: - utf-8-validate dev: false - /@fuel-ts/program@0.76.0(dexie@3.2.4): - resolution: {integrity: sha512-g7gwbOi8aK+4oHxVE1+rTITit9tlHxbaAaN+7UEhhDCcwIldGoiJ6aupbVQXPRoOu6HJ0KTZXjGa4VOmT5defA==} + /@fuel-ts/program@0.79.0(dexie@3.2.4): + resolution: {integrity: sha512-TwLP2qYuR13anM57cDEUGPUlakuVGUnJ4W5h3uUGINfO5USnyQkW9vwvLcFsXL8WvqOimFGMnmRv+ElsMM4Q3A==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/abi-coder': 0.76.0 - '@fuel-ts/account': 0.76.0(dexie@3.2.4) - '@fuel-ts/address': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/hasher': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - '@fuel-ts/transactions': 0.76.0 - '@fuel-ts/utils': 0.76.0 - '@fuel-ts/versions': 0.76.0 + '@fuel-ts/abi-coder': 0.79.0 + '@fuel-ts/account': 0.79.0(dexie@3.2.4) + '@fuel-ts/address': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/hasher': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 + '@fuel-ts/transactions': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@fuel-ts/versions': 0.79.0 '@fuels/vm-asm': 0.42.1 transitivePeerDependencies: - bufferutil @@ -1579,20 +1583,20 @@ packages: - utf-8-validate dev: false - /@fuel-ts/script@0.76.0(dexie@3.2.4): - resolution: {integrity: sha512-q24zSmCg7eCG5mmSO7GPs+8jxLZ1AWxk5upmNwx11K5iLfK5N603w30RSnXGZURIlurYgSq+fvqD7UwhkE2haw==} + /@fuel-ts/script@0.79.0(dexie@3.2.4): + resolution: {integrity: sha512-w3qB3oD1y/HMOzSU7pWRSMHDn+nurYB/zqk0HRDVPdF6t53hv6yaXQukSzHhsk2Fvsy+nsDEWVj63VZl0ehzAw==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/abi-coder': 0.76.0 - '@fuel-ts/abi-typegen': 0.76.0 - '@fuel-ts/account': 0.76.0(dexie@3.2.4) - '@fuel-ts/address': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - '@fuel-ts/program': 0.76.0(dexie@3.2.4) - '@fuel-ts/transactions': 0.76.0 - '@fuel-ts/utils': 0.76.0 + '@fuel-ts/abi-coder': 0.79.0 + '@fuel-ts/abi-typegen': 0.79.0 + '@fuel-ts/account': 0.79.0(dexie@3.2.4) + '@fuel-ts/address': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 + '@fuel-ts/program': 0.79.0(dexie@3.2.4) + '@fuel-ts/transactions': 0.79.0 + '@fuel-ts/utils': 0.79.0 transitivePeerDependencies: - bufferutil - dexie @@ -1632,17 +1636,17 @@ packages: - utf-8-validate dev: false - /@fuel-ts/transactions@0.76.0: - resolution: {integrity: sha512-Q98wWOber+q2AB20oFUrQNONAiQHWXVKotKGT3KI8Cg351QXj4pCq+EYBboZGsU9CAI9pxFi+rsB6ZdoNtXciw==} + /@fuel-ts/transactions@0.79.0: + resolution: {integrity: sha512-k7S4FSO6RrSaSjUaHnuK9KmfaH856ertn+Eall75ZhVV+00Lh+Ewe64xMzzqmKqdr7Puii2QAaKCtssHVDAfOQ==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/abi-coder': 0.76.0 - '@fuel-ts/address': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - '@fuel-ts/utils': 0.76.0 - ethers: 6.9.0 + '@fuel-ts/abi-coder': 0.79.0 + '@fuel-ts/address': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/hasher': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 + '@fuel-ts/utils': 0.79.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -1660,12 +1664,12 @@ packages: - utf-8-validate dev: false - /@fuel-ts/utils@0.76.0: - resolution: {integrity: sha512-KFohp5afWNFVilG9aJIVadDmVJOOtaz5c5L2E7EZa1sSiDvsxJT/Qp+SdWGU5/rFrDTkYRsRJUqkOn8539OSyA==} + /@fuel-ts/utils@0.79.0: + resolution: {integrity: sha512-9hESU0q04jKlOvOC3qr9hpmJF2pgf5cdF785sV2apyTOfw9Luzi+O5uzTr9EKmazKr5nl8KhuDKAtTCIiBRfmA==} engines: {node: ^18.18.2 || ^20.0.0} dependencies: - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 ramda: 0.29.0 rimraf: 3.0.2 dev: false @@ -1680,8 +1684,8 @@ packages: semver: 7.5.4 dev: false - /@fuel-ts/versions@0.76.0: - resolution: {integrity: sha512-Y8+RXEEd3Nj+fLmGclb04l8lFmWgPrxrJ7WUYmA+pr0YoWmUn2C9y8NPIfDakaER4wx8DDcxiIShZ8xnrz8AxQ==} + /@fuel-ts/versions@0.79.0: + resolution: {integrity: sha512-nTpBnfgYqyaK5snKmUaF43M1jcOQOOteQmsxrLnkrWIff4nR3vXGPM4Dm90pCNATMpz9DNs9gSDuC2oSKqoxnA==} engines: {node: ^18.18.2 || ^20.0.0} hasBin: true dependencies: @@ -1814,12 +1818,12 @@ packages: - immer dev: false - /@fuel-wallet/playwright-utils@0.13.10(@playwright/test@1.38.1): + /@fuel-wallet/playwright-utils@0.13.10(@playwright/test@1.42.1): resolution: {integrity: sha512-bU7lzTj5I4I05dNwWwdL9j5vnm/hhbbU848pvVqZjudMXX+ATHZENIHGkzkXRkKdOL1qZefYkg300WaadPruUg==} peerDependencies: '@playwright/test': ^1.39.0 dependencies: - '@playwright/test': 1.38.1 + '@playwright/test': 1.42.1 adm-zip: 0.5.10 fuels: 0.67.0 transitivePeerDependencies: @@ -1829,7 +1833,7 @@ packages: - utf-8-validate dev: false - /@fuel-wallet/react@0.16.1(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0): + /@fuel-wallet/react@0.16.1(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.79.0)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-0VJ5JDulIG5OF/bBdPgXuakIbiJ86cbryDkMjbAPRjsSgW/3J+j9KDzn0WevZxmOG7b/msvf60OHq9Q3tIrnOA==} peerDependencies: fuels: '>=0.73.0' @@ -1838,7 +1842,7 @@ packages: '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react@18.2.0) events: 3.3.0 - fuels: 0.76.0(dexie@3.2.4) + fuels: 0.79.0(dexie@3.2.4) react: 18.2.0 transitivePeerDependencies: - '@types/react' @@ -1847,27 +1851,27 @@ packages: - react-native dev: false - /@fuel-wallet/sdk@0.16.1(dexie@3.2.4)(fuels@0.76.0): + /@fuel-wallet/sdk@0.16.1(dexie@3.2.4)(fuels@0.79.0): resolution: {integrity: sha512-LqGdOh0gUPMp0XtWtiDjtPbeTucTOPGG+4qbx5gLSeaLoi8QiTw9MQ1wU0VNAIht1tAgF7vwmwYgi0HVDjfsOQ==} peerDependencies: fuels: '>=0.73.0' dependencies: - '@fuel-wallet/types': 0.16.1(dexie@3.2.4)(fuels@0.76.0) + '@fuel-wallet/types': 0.16.1(dexie@3.2.4)(fuels@0.79.0) events: 3.3.0 - fuels: 0.76.0(dexie@3.2.4) + fuels: 0.79.0(dexie@3.2.4) json-rpc-2.0: 1.7.0 transitivePeerDependencies: - dexie dev: false - /@fuel-wallet/types@0.16.1(dexie@3.2.4)(fuels@0.76.0): + /@fuel-wallet/types@0.16.1(dexie@3.2.4)(fuels@0.79.0): resolution: {integrity: sha512-x90HaNvjbyBfFF/ZWeoeVdfiJj3wdFkk4IaneQBAB5tVAoF0QzXStWJHSbGnsPm38xzlme+Oo0k+y11OnU3MUw==} peerDependencies: fuels: '>=0.73.0' dependencies: '@fuels/assets': 0.1.5 dexie-observable: 4.0.1-beta.13(dexie@3.2.4) - fuels: 0.76.0(dexie@3.2.4) + fuels: 0.79.0(dexie@3.2.4) json-rpc-2.0: 1.7.0 transitivePeerDependencies: - dexie @@ -1877,7 +1881,7 @@ packages: resolution: {integrity: sha512-3rFZdY2f5/h7e2Rlhv/+WKz1CVsTnydKoxLdVjQfUaNsj7zbMLSfT37bsBSB42AnXKOlPs/vyMbS77LxhN8a2A==} dev: false - /@fuels/react@0.16.0(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.76.0)(react-dom@18.2.0)(react@18.2.0): + /@fuels/react@0.16.0(@types/react-dom@18.2.7)(@types/react@18.2.21)(fuels@0.79.0)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-+VE2yczITKhAW9343f9MrOV29YSRpyS/oRa46A9yCY/Ks/BtG1XwbC2lCs5amGHRDmBB35kQcuUL9cvL36+gdA==} peerDependencies: fuels: '>=0.74.0' @@ -1886,7 +1890,7 @@ packages: '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react@18.2.0) events: 3.3.0 - fuels: 0.76.0(dexie@3.2.4) + fuels: 0.79.0(dexie@3.2.4) react: 18.2.0 transitivePeerDependencies: - '@types/react' @@ -2504,12 +2508,12 @@ packages: dev: false optional: true - /@playwright/test@1.38.1: - resolution: {integrity: sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==} + /@playwright/test@1.42.1: + resolution: {integrity: sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==} engines: {node: '>=16'} hasBin: true dependencies: - playwright: 1.38.1 + playwright: 1.42.1 /@pm2/agent@2.0.3: resolution: {integrity: sha512-xkqqCoTf5VsciMqN0vb9jthW7olVAi4KRFNddCc7ZkeJZ3i8QwZANr4NSH2H5DvseRFHq7MiPspRY/EWAFWWTg==} @@ -2551,14 +2555,14 @@ packages: - supports-color dev: true - /@pm2/js-api@0.6.7: - resolution: {integrity: sha512-jiJUhbdsK+5C4zhPZNnyA3wRI01dEc6a2GhcQ9qI38DyIk+S+C8iC3fGjcjUbt/viLYKPjlAaE+hcT2/JMQPXw==} + /@pm2/js-api@0.8.0: + resolution: {integrity: sha512-nmWzrA/BQZik3VBz+npRcNIu01kdBhWL0mxKmP1ciF/gTcujPTQqt027N9fc1pK9ERM8RipFhymw7RcmCyOEYA==} engines: {node: '>=4.0'} dependencies: async: 2.6.4 - axios: 1.6.7(debug@4.3.4) debug: 4.3.4 eventemitter2: 6.4.9 + extrareqp2: 1.0.0(debug@4.3.4) ws: 7.5.9 transitivePeerDependencies: - bufferutil @@ -5274,21 +5278,12 @@ packages: /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} - /axios@1.6.7(debug@4.3.4): - resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} - dependencies: - follow-redirects: 1.15.5(debug@4.3.4) - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - /b4a@1.6.4: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} dev: true @@ -5304,8 +5299,8 @@ packages: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: true - /basic-ftp@5.0.4: - resolution: {integrity: sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==} + /basic-ftp@5.0.5: + resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} engines: {node: '>=10.0.0'} dev: true @@ -5619,6 +5614,7 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 + dev: false /comma-separated-tokens@1.0.8: resolution: {integrity: sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==} @@ -5795,8 +5791,8 @@ packages: engines: {node: '>= 12'} dev: false - /data-uri-to-buffer@6.0.1: - resolution: {integrity: sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==} + /data-uri-to-buffer@6.0.2: + resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==} engines: {node: '>= 14'} dev: true @@ -5911,6 +5907,7 @@ packages: /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + dev: false /deprecation@2.3.1: resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} @@ -6342,6 +6339,14 @@ packages: engines: {node: ^10.17.0 || ^12.0.0 || >= 13.7.0} dev: false + /extrareqp2@1.0.0(debug@4.3.4): + resolution: {integrity: sha512-Gum0g1QYb6wpPJCVypWP3bbIuaibcFiJcpuPM10YSXp/tzqi84x9PJageob+eN4xVRIOto4wjSGNLyMD54D2xA==} + dependencies: + follow-redirects: 1.15.6(debug@4.3.4) + transitivePeerDependencies: + - debug + dev: true + /fast-fifo@1.3.2: resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} dev: true @@ -6397,8 +6402,8 @@ packages: dependencies: to-regex-range: 5.0.1 - /follow-redirects@1.15.5(debug@4.3.4): - resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} + /follow-redirects@1.15.6(debug@4.3.4): + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -6431,15 +6436,6 @@ packages: mime-types: 2.1.35 dev: false - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - /format@0.2.2: resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} engines: {node: '>=0.4.x'} @@ -6474,13 +6470,13 @@ packages: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} dev: true - /fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} + /fs-extra@11.2.0: + resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} + engines: {node: '>=14.14'} dependencies: graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 + jsonfile: 6.1.0 + universalify: 2.0.1 dev: true /fs-monkey@1.0.4: @@ -6556,29 +6552,29 @@ packages: - utf-8-validate dev: false - /fuels@0.76.0(dexie@3.2.4): - resolution: {integrity: sha512-VwOuoCRaD84ZsUZ9WHAD1gpflCXHjoOLFo/eXSfDFvvmQZx0Miy7xfbLRFtIraBTabkUpumqCjlsSAgtLWL4pg==} + /fuels@0.79.0(dexie@3.2.4): + resolution: {integrity: sha512-koo7YKNzq821FOa7aLXdSAEllCLHWd+dcNwoAqyHkPw/zGKIUmeNpPDFXuL1zMGxkibTTJEaQ22vM4zHKP2rng==} engines: {node: ^18.18.2 || ^20.0.0} hasBin: true dependencies: - '@fuel-ts/abi-coder': 0.76.0 - '@fuel-ts/abi-typegen': 0.76.0 - '@fuel-ts/account': 0.76.0(dexie@3.2.4) - '@fuel-ts/address': 0.76.0 - '@fuel-ts/contract': 0.76.0(dexie@3.2.4) - '@fuel-ts/crypto': 0.76.0 - '@fuel-ts/errors': 0.76.0 - '@fuel-ts/forc': 0.76.0 - '@fuel-ts/fuel-core': 0.76.0 - '@fuel-ts/hasher': 0.76.0 - '@fuel-ts/interfaces': 0.76.0 - '@fuel-ts/math': 0.76.0 - '@fuel-ts/merkle': 0.76.0 - '@fuel-ts/program': 0.76.0(dexie@3.2.4) - '@fuel-ts/script': 0.76.0(dexie@3.2.4) - '@fuel-ts/transactions': 0.76.0 - '@fuel-ts/utils': 0.76.0 - '@fuel-ts/versions': 0.76.0 + '@fuel-ts/abi-coder': 0.79.0 + '@fuel-ts/abi-typegen': 0.79.0 + '@fuel-ts/account': 0.79.0(dexie@3.2.4) + '@fuel-ts/address': 0.79.0 + '@fuel-ts/contract': 0.79.0(dexie@3.2.4) + '@fuel-ts/crypto': 0.79.0 + '@fuel-ts/errors': 0.79.0 + '@fuel-ts/forc': 0.79.0 + '@fuel-ts/fuel-core': 0.79.0 + '@fuel-ts/hasher': 0.79.0 + '@fuel-ts/interfaces': 0.79.0 + '@fuel-ts/math': 0.79.0 + '@fuel-ts/merkle': 0.79.0 + '@fuel-ts/program': 0.79.0(dexie@3.2.4) + '@fuel-ts/script': 0.79.0(dexie@3.2.4) + '@fuel-ts/transactions': 0.79.0 + '@fuel-ts/utils': 0.79.0 + '@fuel-ts/versions': 0.79.0 bundle-require: 4.0.2(esbuild@0.19.11) chalk: 4.1.2 chokidar: 3.5.3 @@ -6663,14 +6659,14 @@ packages: get-intrinsic: 1.2.1 dev: true - /get-uri@6.0.2: - resolution: {integrity: sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==} + /get-uri@6.0.3: + resolution: {integrity: sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==} engines: {node: '>= 14'} dependencies: - basic-ftp: 5.0.4 - data-uri-to-buffer: 6.0.1 + basic-ftp: 5.0.5 + data-uri-to-buffer: 6.0.2 debug: 4.3.4 - fs-extra: 8.1.0 + fs-extra: 11.2.0 transitivePeerDependencies: - supports-color dev: true @@ -7072,8 +7068,8 @@ packages: resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==} dev: false - /http-proxy-agent@7.0.0: - resolution: {integrity: sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==} + /http-proxy-agent@7.0.2: + resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 @@ -7082,8 +7078,8 @@ packages: - supports-color dev: true - /https-proxy-agent@7.0.2: - resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==} + /https-proxy-agent@7.0.4: + resolution: {integrity: sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==} engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 @@ -7174,12 +7170,12 @@ packages: loose-envify: 1.4.0 dev: false - /ip@1.1.8: - resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==} - dev: true - - /ip@2.0.0: - resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} + /ip-address@9.0.5: + resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} + engines: {node: '>= 12'} + dependencies: + jsbn: 1.1.0 + sprintf-js: 1.1.3 dev: true /is-alphabetical@1.0.4: @@ -7459,6 +7455,10 @@ packages: resolution: {integrity: sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g==} dev: false + /jsbn@1.1.0: + resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} + dev: true + /json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} dev: true @@ -7477,8 +7477,10 @@ packages: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} dev: false - /jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + /jsonfile@6.1.0: + resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + dependencies: + universalify: 2.0.1 optionalDependencies: graceful-fs: 4.2.11 dev: true @@ -8298,12 +8300,14 @@ packages: /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} + dev: false /mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 + dev: false /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} @@ -8656,21 +8660,20 @@ packages: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.0 debug: 4.3.4 - get-uri: 6.0.2 - http-proxy-agent: 7.0.0 - https-proxy-agent: 7.0.2 - pac-resolver: 7.0.0 + get-uri: 6.0.3 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.4 + pac-resolver: 7.0.1 socks-proxy-agent: 8.0.2 transitivePeerDependencies: - supports-color dev: true - /pac-resolver@7.0.0: - resolution: {integrity: sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==} + /pac-resolver@7.0.1: + resolution: {integrity: sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==} engines: {node: '>= 14'} dependencies: degenerator: 5.0.1 - ip: 1.1.8 netmask: 2.0.2 dev: true @@ -8815,17 +8818,17 @@ packages: engines: {node: '>=4'} dev: true - /playwright-core@1.38.1: - resolution: {integrity: sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==} + /playwright-core@1.42.1: + resolution: {integrity: sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==} engines: {node: '>=16'} hasBin: true - /playwright@1.38.1: - resolution: {integrity: sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==} + /playwright@1.42.1: + resolution: {integrity: sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==} engines: {node: '>=16'} hasBin: true dependencies: - playwright-core: 1.38.1 + playwright-core: 1.42.1 optionalDependencies: fsevents: 2.3.2 @@ -8896,21 +8899,21 @@ packages: async: 3.2.5 debug: 4.3.4 pidusage: 2.0.21 - systeminformation: 5.21.24 + systeminformation: 5.22.6 tx2: 1.0.5 transitivePeerDependencies: - supports-color dev: true optional: true - /pm2@5.3.0: - resolution: {integrity: sha512-xscmQiAAf6ArVmKhjKTeeN8+Td7ZKnuZFFPw1DGkdFPR/0Iyx+m+1+OpCdf9+HQopX3VPc9/wqPQHqVOfHum9w==} + /pm2@5.3.1: + resolution: {integrity: sha512-DLVQHpSR1EegaTaRH3KbRXxpPVaqYwAp3uHSCtCsS++LSErvk07WSxuUnntFblBRqNU/w2KQyqs12mSq5wurkg==} engines: {node: '>=10.0.0'} hasBin: true dependencies: '@pm2/agent': 2.0.3 '@pm2/io': 5.0.2 - '@pm2/js-api': 0.6.7 + '@pm2/js-api': 0.8.0 '@pm2/pm2-version-check': 1.0.4 async: 3.2.5 blessed: 0.1.81 @@ -9068,8 +9071,8 @@ packages: dependencies: agent-base: 7.1.0 debug: 4.3.4 - http-proxy-agent: 7.0.0 - https-proxy-agent: 7.0.2 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.4 lru-cache: 7.18.3 pac-proxy-agent: 7.0.1 proxy-from-env: 1.1.0 @@ -9754,16 +9757,16 @@ packages: dependencies: agent-base: 7.1.0 debug: 4.3.4 - socks: 2.7.1 + socks: 2.8.1 transitivePeerDependencies: - supports-color dev: true - /socks@2.7.1: - resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} - engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} + /socks@2.8.1: + resolution: {integrity: sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} dependencies: - ip: 2.0.0 + ip-address: 9.0.5 smart-buffer: 4.2.0 dev: true @@ -9831,6 +9834,10 @@ packages: resolution: {integrity: sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==} dev: true + /sprintf-js@1.1.3: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + dev: true + /stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} @@ -10026,8 +10033,8 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /systeminformation@5.21.24: - resolution: {integrity: sha512-xQada8ByGGFoRXJaUptGgddn3i7IjtSdqNdCKzB8xkzsM7pHnfLYBWxkPdGzhZ0Z/l+W1yo+aZQZ74d2isj8kw==} + /systeminformation@5.22.6: + resolution: {integrity: sha512-hUTQX+bRgIFbv1T/z251NtwGwNIeSyWURnT2BGnsYu6dQNbkiBl4oAwk50acVfITFq1Zvb8KDNgibQK9uGlUGg==} engines: {node: '>=8.0.0'} os: [darwin, linux, win32, freebsd, openbsd, netbsd, sunos, android] hasBin: true @@ -10330,9 +10337,9 @@ packages: resolution: {integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==} dev: false - /universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} + /universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} dev: true /updates@15.0.2: diff --git a/scripts/generate-links/getSortedLinks.mjs b/scripts/generate-links/getSortedLinks.mjs index 734ae582..b1b80f9e 100644 --- a/scripts/generate-links/getSortedLinks.mjs +++ b/scripts/generate-links/getSortedLinks.mjs @@ -19,7 +19,22 @@ export default function getSortedLinks(config, docs) { const isNightly = docs[0].slug.includes('/nightly/'); const isBeta4 = docs[0].slug.includes('/beta-4/'); const links = createLinks(docs, isNightly, isBeta4); - const sortedLinks = sortLinks(lcOrder, links, config, isNightly, isBeta4); + let sortedLinks = sortLinks(lcOrder, links, config, isNightly, isBeta4); + + // TODO: FIX FUELS-TS NAV AT SOURCE + if (config.menu[0] === 'fuels-ts' && !isBeta4) { + sortedLinks = sortedLinks.filter((link) => { + const remove = + link.label !== 'Guide' && + link.label !== 'basics' && + link.label !== 'essentials' && + link.label !== 'extras' && + link.label !== 'tooling' && + link.label !== 'cli' && + link.label !== 'API'; + return remove; + }); + } return sortedLinks; } diff --git a/src/components/SidebarSection.tsx b/src/components/SidebarSection.tsx index 21812873..33536dd4 100644 --- a/src/components/SidebarSection.tsx +++ b/src/components/SidebarSection.tsx @@ -139,6 +139,7 @@ const styles = { fontSize: '$sm', pl: '$4', mb: '$8', + color: '$semanticLinkBaseColor !important', 'html[class="fuel_light-theme"] &': { color: '$intentsBase12 !important', }, diff --git a/src/config/versions.json b/src/config/versions.json index c6b3bec9..57feabbe 100644 --- a/src/config/versions.json +++ b/src/config/versions.json @@ -2,7 +2,7 @@ "default": { "forc": "0.49.3", "rust": "0.55.0", - "ts": "0.73.0", + "ts": "0.79.0", "wallet": "0.16.1" } } diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 1aee5e41..40cd3026 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,5 +1,4 @@ -import { FuelProvider } from '@fuel-wallet/react'; -import { FuelProvider as NewFuelProvider } from '@fuels/react'; +import { FuelProvider } from '@fuels/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Analytics } from '@vercel/analytics/react'; import type { AppProps } from 'next/app'; @@ -13,28 +12,22 @@ const queryClient = new QueryClient(); export default function App({ Component, pageProps }: AppProps) { return ( - - - - - - - - - - - - + + + + + ); } From 1608279c630259312473c67ab392e49d31c2e011 Mon Sep 17 00:00:00 2001 From: sarahschwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:56:37 -0600 Subject: [PATCH 03/24] cleanup, fix nightly warning --- src/pages/[...slug].tsx | 1 - src/screens/DocPage.tsx | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/pages/[...slug].tsx b/src/pages/[...slug].tsx index ac481889..9e3efe48 100644 --- a/src/pages/[...slug].tsx +++ b/src/pages/[...slug].tsx @@ -17,7 +17,6 @@ import { } from '../lib/versions'; import { DocScreen } from '../screens/DocPage'; import type { DocType, NavOrder, SidebarLinkItem, Versions } from '../types'; -import { generateSiteMap } from './sitemap.xml'; export type DocPageProps = { allNavs: NavOrder[]; diff --git a/src/screens/DocPage.tsx b/src/screens/DocPage.tsx index 0decc8a5..befca5b8 100644 --- a/src/screens/DocPage.tsx +++ b/src/screens/DocPage.tsx @@ -22,19 +22,16 @@ export function DocScreen(props: DocPageProps) { useEffect(() => { if (version === 'Nightly' || doc?.versionSet === 'nightly') { setVersionSet('nightly'); + setIsAlertVisible(true); } else if (version === 'Beta-4' || doc?.versionSet === 'beta-4') { setVersionSet('beta-4'); + setIsAlertVisible(false); } else { setVersionSet('default'); + setIsAlertVisible(false); } }, [version, doc]); - useEffect(() => { - if (versionSet === 'nightly') { - setIsAlertVisible(true); - } - }, [versionSet]); - const navs = getActiveNav( versionSet, allNavs, From b7d6acd83c78a9faf7228cce727b2d51cf97108d Mon Sep 17 00:00:00 2001 From: sarahschwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:46:44 -0600 Subject: [PATCH 04/24] bump quickstart code --- .../docs/quickstart/building-a-frontend.mdx | 2 +- .../quickstart/counter-contract/Forc.lock | 4 +- .../quickstart/frontend/package-lock.json | 3454 +++++++++-------- .../examples/quickstart/frontend/package.json | 8 +- .../examples/quickstart/frontend/src/App.tsx | 13 +- .../quickstart/frontend/src/index.tsx | 24 +- src/components/SidebarSection.tsx | 6 + 7 files changed, 1921 insertions(+), 1590 deletions(-) diff --git a/docs/guides/docs/quickstart/building-a-frontend.mdx b/docs/guides/docs/quickstart/building-a-frontend.mdx index c2eb32ec..a0f7a1ef 100644 --- a/docs/guides/docs/quickstart/building-a-frontend.mdx +++ b/docs/guides/docs/quickstart/building-a-frontend.mdx @@ -312,7 +312,7 @@ action={{ filepath: 'guides-testing/fuel-project/frontend/src/App.tsx', atLine: 13, removeLines: [13], - useSetData: ' "0x78218d62429082ccf3f6a8a36155aaf771508c632c0855f8fe2d51d6f7baec73";' + useSetData: ' "0xf2402a4c375550abc8c781bb59761135f88799dcfa81862f8233dfe234894dfe";' }} /> diff --git a/docs/guides/examples/quickstart/counter-contract/Forc.lock b/docs/guides/examples/quickstart/counter-contract/Forc.lock index b01ab784..0c6666b1 100644 --- a/docs/guides/examples/quickstart/counter-contract/Forc.lock +++ b/docs/guides/examples/quickstart/counter-contract/Forc.lock @@ -1,6 +1,6 @@ [[package]] name = "core" -source = "path+from-root-B672DC9E3D340CD2" +source = "path+from-root-566CA1D5F8BEAFBF" [[package]] name = "counter-contract" @@ -9,5 +9,5 @@ dependencies = ["std"] [[package]] name = "std" -source = "git+https://github.com/fuellabs/sway?tag=v0.49.2#a70c746d27b3300beef896ccd1dcce1299836192" +source = "git+https://github.com/fuellabs/sway?tag=v0.49.3#0dc6570377ee9c4a6359ade597fa27351e02a728" dependencies = ["core"] diff --git a/docs/guides/examples/quickstart/frontend/package-lock.json b/docs/guides/examples/quickstart/frontend/package-lock.json index 787cdc05..aa17e4cc 100644 --- a/docs/guides/examples/quickstart/frontend/package-lock.json +++ b/docs/guides/examples/quickstart/frontend/package-lock.json @@ -8,8 +8,10 @@ "name": "frontend", "version": "0.1.0", "dependencies": { - "@fuel-wallet/react": "^0.15.2", - "@fuel-wallet/sdk": "^0.15.2", + "@fuels/connectors": "^0.1.1", + "@fuels/react": "^0.18.0", + "@tanstack/react-query": "^5.28.9", + "@tanstack/react-query-devtools": "^5.28.10", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -17,7 +19,7 @@ "@types/node": "^16.18.8", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", - "fuels": "^0.73.0", + "fuels": "^0.79.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", @@ -39,9 +41,9 @@ "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==" }, "node_modules/@adraffy/ens-normalize": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", - "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==" + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", @@ -55,116 +57,52 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/compat-data": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", - "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.1.tgz", + "integrity": "sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", - "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", + "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.2", + "@babel/generator": "^7.24.1", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.9", - "@babel/parser": "^7.23.9", - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/helpers": "^7.24.1", + "@babel/parser": "^7.24.1", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -209,9 +147,9 @@ } }, "node_modules/@babel/eslint-parser": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.23.9.tgz", - "integrity": "sha512-xPndlO7qxiJbn0ATvfXQBjCS7qApc9xmKHArgI/FTEFxXas5dnjC/VqM37lfZun9dclRYcn+YQAr6uDFy0bB2g==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.24.1.tgz", + "integrity": "sha512-d5guuzMlPeDfZIbpQ8+g1NaCNuAGBBGNECh0HVqz1sjOeVLh2CEaifuOysCH18URW6R7pqXINvf5PaR/dC6jLQ==", "dependencies": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "eslint-visitor-keys": "^2.1.0", @@ -242,13 +180,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", + "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -309,16 +247,16 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.9.tgz", - "integrity": "sha512-B2L9neXTIyPQoXDm+NtovPvG6VOLWnaXu3BIeVDWwdKFgG30oNa6CqVGiJPDWQwIAK49t9gnQI9c6K6RzabiKw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.1.tgz", + "integrity": "sha512-1yJa9dX9g//V6fDebXoEfEsxkZHk3Hcbm+zLhyu6qVgYFLvmTALTeV+jNU9e5RnYtioBrGEOdoI2joMSNQ/+aA==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-member-expression-to-functions": "^7.23.0", "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.20", + "@babel/helper-replace-supers": "^7.24.1", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", "semver": "^6.3.1" @@ -363,9 +301,9 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.5.0.tgz", - "integrity": "sha512-NovQquuQLAQ5HuyjCz7WQP9MjRj7dx++yspwiyUiGl9ZyadHRSql1HZh5ogRd8W8w6YM6EQ/NTB8rgjLt5W65Q==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.1.tgz", + "integrity": "sha512-o7SDgTJuvx5vLKD6SFvkydkSMBvahDKGiNJzG22IZYXhiqoe9efY7zocICBgzHV4IRg5wdgl2nEL/tulKIEIbA==", "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -441,11 +379,11 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", + "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", "dependencies": { - "@babel/types": "^7.22.15" + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -481,9 +419,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "engines": { "node": ">=6.9.0" } @@ -505,12 +443,12 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz", - "integrity": "sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz", + "integrity": "sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-member-expression-to-functions": "^7.22.15", + "@babel/helper-member-expression-to-functions": "^7.23.0", "@babel/helper-optimise-call-expression": "^7.22.5" }, "engines": { @@ -554,9 +492,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", + "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", "engines": { "node": ">=6.9.0" } @@ -591,26 +529,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", - "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", + "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", "dependencies": { - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -681,9 +620,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", - "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", + "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -692,11 +631,11 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz", - "integrity": "sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.1.tgz", + "integrity": "sha512-y4HqEnkelJIOQGd+3g1bTeKsA5c6qM7eOn7VggGVbBc0y8MLSKHacwcIE2PplNlQSj0PqS9rrXL/nkPVK+kUNg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -706,13 +645,13 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz", - "integrity": "sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.1.tgz", + "integrity": "sha512-Hj791Ii4ci8HqnaKHAlLNs+zaLXb0EzSDhiAWp5VNlyvCNymYfacs64pxTxbH1znW/NcArSmwpmG9IKE/TUVVQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/plugin-transform-optional-chaining": "^7.23.3" + "@babel/plugin-transform-optional-chaining": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -722,12 +661,12 @@ } }, "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.23.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.7.tgz", - "integrity": "sha512-LlRT7HgaifEpQA1ZgLVOIJZZFVPWN5iReq/7/JixwBtwcoeVGDBD53ZV28rrsLYOZs1Y/EHhA8N/Z6aazHR8cw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.1.tgz", + "integrity": "sha512-m9m/fXsXLiHfwdgydIFnpk+7jlVbnvlK5B2EKiPdLUb6WX654ZaaEWJUjk8TftRbZpK0XibovlLWX4KIZhV6jw==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -753,13 +692,13 @@ } }, "node_modules/@babel/plugin-proposal-decorators": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.23.9.tgz", - "integrity": "sha512-hJhBCb0+NnTWybvWq2WpbCYDOcflSbx0t+BYP65e5R9GVnukiDTi+on5bFkk4p7QGuv190H6KfNiV9Knf/3cZA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.24.1.tgz", + "integrity": "sha512-zPEvzFijn+hRvJuX2Vu3KbEBN39LN3f7tW3MQO2LsIs57B26KU+kUc82BdAktS1VCM6libzh45eKGI65lg0cpA==", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.23.9", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-decorators": "^7.23.3" + "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/plugin-syntax-decorators": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -892,11 +831,11 @@ } }, "node_modules/@babel/plugin-syntax-decorators": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.23.3.tgz", - "integrity": "sha512-cf7Niq4/+/juY67E0PbgH0TDhLQ5J7zS8C/Q5FFx+DWyrRa9sUQdTXkjqKu8zGvuqr7vw1muKiukseihU+PJDA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.24.1.tgz", + "integrity": "sha512-05RJdO/cCrtVWuAaSn1tS3bH8jbsJa/Y1uD186u6J4C/1mnHFxseeuWpsqr9anvo7TUulev7tm7GDwRV+VuhDw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -928,11 +867,11 @@ } }, "node_modules/@babel/plugin-syntax-flow": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.23.3.tgz", - "integrity": "sha512-YZiAIpkJAwQXBJLIQbRFayR5c+gJ35Vcz3bg954k7cd73zqjvhacJuL9RbrzPz8qPmZdgqP6EUKwy0PCNhaaPA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.24.1.tgz", + "integrity": "sha512-sxi2kLTI5DeW5vDtMUsk4mTPwvlUDbjOnoWayhynCwrw4QXRld4QEYwqzY8JmQXaJUtgUuCIurtSRH5sn4c7mA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -942,11 +881,11 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz", - "integrity": "sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.1.tgz", + "integrity": "sha512-IuwnI5XnuF189t91XbxmXeCDz3qs6iDRO7GJ++wcfgeXNs/8FmIlKcpDSXNVyuLQxlwvskmI3Ct73wUODkJBlQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -956,11 +895,11 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.23.3.tgz", - "integrity": "sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.1.tgz", + "integrity": "sha512-zhQTMH0X2nVLnb04tz+s7AMuasX8U0FnpE+nHTOhSOINjWMnopoZTxtIKsd45n4GQ/HIZLyfIpoul8e2m0DnRA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -992,11 +931,11 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", - "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1100,11 +1039,11 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", - "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", + "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1129,11 +1068,11 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz", - "integrity": "sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.1.tgz", + "integrity": "sha512-ngT/3NkRhsaep9ck9uj2Xhv9+xB1zShY3tM3g6om4xxCELwCDN4g4Aq5dRn48+0hasAql7s2hdBOysCfNpr4fw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1143,12 +1082,12 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.9.tgz", - "integrity": "sha512-8Q3veQEDGe14dTYuwagbRtwxQDnytyg1JFu4/HwEMETeofocrB0U0ejBJIXoeG/t2oXZ8kzCyI0ZZfbT80VFNQ==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.3.tgz", + "integrity": "sha512-Qe26CMYVjpQxJ8zxM1340JFNjZaF+ISWpr1Kt/jGo+ZTUzKkfw/pphEWbRCb+lmSM6k/TOgfYLvmbHkUQ0asIg==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-remap-async-to-generator": "^7.22.20", "@babel/plugin-syntax-async-generators": "^7.8.4" }, @@ -1160,12 +1099,12 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz", - "integrity": "sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.1.tgz", + "integrity": "sha512-AawPptitRXp1y0n4ilKcGbRYWfbbzFWz2NqNu7dacYDtFtz0CMjG64b3LQsb3KIgnf4/obcUL78hfaOS7iCUfw==", "dependencies": { - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-module-imports": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-remap-async-to-generator": "^7.22.20" }, "engines": { @@ -1176,11 +1115,11 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz", - "integrity": "sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.1.tgz", + "integrity": "sha512-TWWC18OShZutrv9C6mye1xwtam+uNi2bnTOCBUd5sZxyHOiWbU6ztSROofIMrK84uweEZC219POICK/sTYwfgg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1190,11 +1129,11 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz", - "integrity": "sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.1.tgz", + "integrity": "sha512-h71T2QQvDgM2SmT29UYU6ozjMlAt7s7CSs5Hvy8f8cf/GM/Z4a2zMfN+fjVGaieeCrXR3EdQl6C4gQG+OgmbKw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1204,12 +1143,12 @@ } }, "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz", - "integrity": "sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.1.tgz", + "integrity": "sha512-OMLCXi0NqvJfORTaPQBwqLXHhb93wkBKZ4aNwMl6WtehO7ar+cmp+89iPEQPqxAnxsOKTaMcs3POz3rKayJ72g==", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1219,12 +1158,12 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.4.tgz", - "integrity": "sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.1.tgz", + "integrity": "sha512-FUHlKCn6J3ERiu8Dv+4eoz7w8+kFLSyeVG4vDAikwADGjUCoHw/JHokyGtr8OR4UjpwPVivyF+h8Q5iv/JmrtA==", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-class-static-block": "^7.14.5" }, "engines": { @@ -1235,16 +1174,16 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.23.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.8.tgz", - "integrity": "sha512-yAYslGsY1bX6Knmg46RjiCiNSwJKv2IUC8qOdYKqMMr0491SXFhcHqOdRDeCRohOOIzwN/90C6mQ9qAKgrP7dg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.1.tgz", + "integrity": "sha512-ZTIe3W7UejJd3/3R4p7ScyyOoafetUShSf4kCqV0O7F/RiHxVj/wRaRnQlrGwflvcehNA8M42HkAiEDYZu2F1Q==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.20", + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-replace-supers": "^7.24.1", "@babel/helper-split-export-declaration": "^7.22.6", "globals": "^11.1.0" }, @@ -1256,12 +1195,12 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz", - "integrity": "sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.1.tgz", + "integrity": "sha512-5pJGVIUfJpOS+pAqBQd+QMaTD2vCL/HcePooON6pDpHgRp4gNRmzyHTPIkXntwKsq3ayUFVfJaIKPw2pOkOcTw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/template": "^7.22.15" + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/template": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1271,11 +1210,11 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz", - "integrity": "sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.1.tgz", + "integrity": "sha512-ow8jciWqNxR3RYbSNVuF4U2Jx130nwnBnhRw6N6h1bOejNkABmcI5X5oz29K4alWX7vf1C+o6gtKXikzRKkVdw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1285,12 +1224,12 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.23.3.tgz", - "integrity": "sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.1.tgz", + "integrity": "sha512-p7uUxgSoZwZ2lPNMzUkqCts3xlp8n+o05ikjy7gbtFJSt9gdU88jAmtfmOxHM14noQXBxfgzf2yRWECiNVhTCw==", "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1300,11 +1239,11 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.23.3.tgz", - "integrity": "sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.1.tgz", + "integrity": "sha512-msyzuUnvsjsaSaocV6L7ErfNsa5nDWL1XKNnDePLgmz+WdU4w/J8+AxBMrWfi9m4IxfL5sZQKUPQKDQeeAT6lA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1314,11 +1253,11 @@ } }, "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.4.tgz", - "integrity": "sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.1.tgz", + "integrity": "sha512-av2gdSTyXcJVdI+8aFZsCAtR29xJt0S5tas+Ef8NvBNmD1a+N/3ecMLeMBgfcK+xzsjdLDT6oHt+DFPyeqUbDA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-dynamic-import": "^7.8.3" }, "engines": { @@ -1329,12 +1268,12 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.23.3.tgz", - "integrity": "sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.1.tgz", + "integrity": "sha512-U1yX13dVBSwS23DEAqU+Z/PkwE9/m7QQy8Y9/+Tdb8UWYaGNDYwTLi19wqIAiROr8sXVum9A/rtiH5H0boUcTw==", "dependencies": { "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1344,11 +1283,11 @@ } }, "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz", - "integrity": "sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.1.tgz", + "integrity": "sha512-Ft38m/KFOyzKw2UaJFkWG9QnHPG/Q/2SkOrRk4pNBPg5IPZ+dOxcmkK5IyuBcxiNPyyYowPGUReyBvrvZs7IlQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-export-namespace-from": "^7.8.3" }, "engines": { @@ -1359,12 +1298,12 @@ } }, "node_modules/@babel/plugin-transform-flow-strip-types": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.23.3.tgz", - "integrity": "sha512-26/pQTf9nQSNVJCrLB1IkHUKyPxR+lMrH2QDPG89+Znu9rAMbtrybdbWeE9bb7gzjmE5iXHEY+e0HUwM6Co93Q==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.24.1.tgz", + "integrity": "sha512-iIYPIWt3dUmUKKE10s3W+jsQ3icFkw0JyRVyY1B7G4yK/nngAOHLVx8xlhA6b/Jzl/Y0nis8gjqhqKtRDQqHWQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-flow": "^7.23.3" + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/plugin-syntax-flow": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -1374,11 +1313,11 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.6.tgz", - "integrity": "sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.1.tgz", + "integrity": "sha512-OxBdcnF04bpdQdR3i4giHZNZQn7cm8RQKcSwA17wAAqEELo1ZOwp5FFgeptWUQXFyT9kwHo10aqqauYkRZPCAg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" }, "engines": { @@ -1389,13 +1328,13 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz", - "integrity": "sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.1.tgz", + "integrity": "sha512-BXmDZpPlh7jwicKArQASrj8n22/w6iymRnvHYYd2zO30DbE277JO20/7yXJT3QxDPtiQiOxQBbZH4TpivNXIxA==", "dependencies": { - "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-function-name": "^7.23.0", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1405,11 +1344,11 @@ } }, "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.4.tgz", - "integrity": "sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.1.tgz", + "integrity": "sha512-U7RMFmRvoasscrIFy5xA4gIp8iWnWubnKkKuUGJjsuOH7GfbMkB+XZzeslx2kLdEGdOJDamEmCqOks6e8nv8DQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-json-strings": "^7.8.3" }, "engines": { @@ -1420,11 +1359,11 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz", - "integrity": "sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.1.tgz", + "integrity": "sha512-zn9pwz8U7nCqOYIiBaOxoQOtYmMODXTJnkxG4AtX8fPmnCRYWBOHD0qcpwS9e2VDSp1zNJYpdnFMIKb8jmwu6g==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1434,11 +1373,11 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz", - "integrity": "sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.1.tgz", + "integrity": "sha512-OhN6J4Bpz+hIBqItTeWJujDOfNP+unqv/NJgyhlpSqgBTPm37KkMmZV6SYcOj+pnDbdcl1qRGV/ZiIjX9Iy34w==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, "engines": { @@ -1449,11 +1388,11 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz", - "integrity": "sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.1.tgz", + "integrity": "sha512-4ojai0KysTWXzHseJKa1XPNXKRbuUrhkOPY4rEGeR+7ChlJVKxFa3H3Bz+7tWaGKgJAXUWKOGmltN+u9B3+CVg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1463,12 +1402,12 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz", - "integrity": "sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.1.tgz", + "integrity": "sha512-lAxNHi4HVtjnHd5Rxg3D5t99Xm6H7b04hUS7EHIXcUl2EV4yl1gWdqZrNzXnSrHveL9qMdbODlLF55mvgjAfaQ==", "dependencies": { "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1478,12 +1417,12 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz", - "integrity": "sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz", + "integrity": "sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw==", "dependencies": { "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-simple-access": "^7.22.5" }, "engines": { @@ -1494,13 +1433,13 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.9.tgz", - "integrity": "sha512-KDlPRM6sLo4o1FkiSlXoAa8edLXFsKKIda779fbLrvmeuc3itnjCtaO6RrtoaANsIJANj+Vk1zqbZIMhkCAHVw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.1.tgz", + "integrity": "sha512-mqQ3Zh9vFO1Tpmlt8QPnbwGHzNz3lpNEMxQb1kAemn/erstyqw1r9KeOlOfo3y6xAnFEcOv2tSyrXfmMk+/YZA==", "dependencies": { "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { @@ -1511,12 +1450,12 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.23.3.tgz", - "integrity": "sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.1.tgz", + "integrity": "sha512-tuA3lpPj+5ITfcCluy6nWonSL7RvaG0AOTeAuvXqEKS34lnLzXpDb0dcP6K8jD0zWZFNDVly90AGFJPnm4fOYg==", "dependencies": { "@babel/helper-module-transforms": "^7.23.3", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1541,11 +1480,11 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.23.3.tgz", - "integrity": "sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.1.tgz", + "integrity": "sha512-/rurytBM34hYy0HKZQyA0nHbQgQNFm4Q/BOc9Hflxi2X3twRof7NaE5W46j4kQitm7SvACVRXsa6N/tSZxvPug==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1555,11 +1494,11 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz", - "integrity": "sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.1.tgz", + "integrity": "sha512-iQ+caew8wRrhCikO5DrUYx0mrmdhkaELgFa+7baMcVuhxIkN7oxt06CZ51D65ugIb1UWRQ8oQe+HXAVM6qHFjw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" }, "engines": { @@ -1570,11 +1509,11 @@ } }, "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.4.tgz", - "integrity": "sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.1.tgz", + "integrity": "sha512-7GAsGlK4cNL2OExJH1DzmDeKnRv/LXq0eLUSvudrehVA5Rgg4bIrqEUW29FbKMBRT0ztSqisv7kjP+XIC4ZMNw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-numeric-separator": "^7.10.4" }, "engines": { @@ -1585,15 +1524,14 @@ } }, "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz", - "integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.1.tgz", + "integrity": "sha512-XjD5f0YqOtebto4HGISLNfiNMTTs6tbkFf2TOqJlYKYmbo+mN9Dnpl4SRoofiziuOWMIyq3sZEUqLo3hLITFEA==", "dependencies": { - "@babel/compat-data": "^7.23.3", - "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.23.3" + "@babel/plugin-transform-parameters": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -1603,12 +1541,12 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz", - "integrity": "sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.1.tgz", + "integrity": "sha512-oKJqR3TeI5hSLRxudMjFQ9re9fBVUU0GICqM3J1mi8MqlhVr6hC/ZN4ttAyMuQR6EZZIY6h/exe5swqGNNIkWQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.20" + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-replace-supers": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -1618,11 +1556,11 @@ } }, "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.4.tgz", - "integrity": "sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.1.tgz", + "integrity": "sha512-oBTH7oURV4Y+3EUrf6cWn1OHio3qG/PVwO5J03iSJmBg6m2EhKjkAu/xuaXaYwWW9miYtvbWv4LNf0AmR43LUA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" }, "engines": { @@ -1633,11 +1571,11 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz", - "integrity": "sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.1.tgz", + "integrity": "sha512-n03wmDt+987qXwAgcBlnUUivrZBPZ8z1plL0YvgQalLm+ZE5BMhGm94jhxXtA1wzv1Cu2aaOv1BM9vbVttrzSg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, @@ -1649,11 +1587,11 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz", - "integrity": "sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.1.tgz", + "integrity": "sha512-8Jl6V24g+Uw5OGPeWNKrKqXPDw2YDjLc53ojwfMcKwlEoETKU9rU0mHUtcg9JntWI/QYzGAXNWEcVHZ+fR+XXg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1663,12 +1601,12 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz", - "integrity": "sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.1.tgz", + "integrity": "sha512-tGvisebwBO5em4PaYNqt4fkw56K2VALsAbAakY0FjTYqJp7gfdrgr7YX76Or8/cpik0W6+tj3rZ0uHU9Oil4tw==", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1678,13 +1616,13 @@ } }, "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz", - "integrity": "sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.1.tgz", + "integrity": "sha512-pTHxDVa0BpUbvAgX3Gat+7cSciXqUcY9j2VZKTbSB6+VQGpNgNO9ailxTGHSXlqOnX1Hcx1Enme2+yv7VqP9bg==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-create-class-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { @@ -1695,11 +1633,11 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz", - "integrity": "sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.1.tgz", + "integrity": "sha512-LetvD7CrHmEx0G442gOomRr66d7q8HzzGGr4PMHGr+5YIm6++Yke+jxj246rpvsbyhJwCLxcTn6zW1P1BSenqA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1709,11 +1647,11 @@ } }, "node_modules/@babel/plugin-transform-react-constant-elements": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.23.3.tgz", - "integrity": "sha512-zP0QKq/p6O42OL94udMgSfKXyse4RyJ0JqbQ34zDAONWjyrEsghYEyTSK5FIpmXmCpB55SHokL1cRRKHv8L2Qw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.24.1.tgz", + "integrity": "sha512-QXp1U9x0R7tkiGB0FOk8o74jhnap0FlZ5gNkRIWdG3eP+SvMFg118e1zaWewDzgABb106QSKpVsD3Wgd8t6ifA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1723,11 +1661,11 @@ } }, "node_modules/@babel/plugin-transform-react-display-name": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.23.3.tgz", - "integrity": "sha512-GnvhtVfA2OAtzdX58FJxU19rhoGeQzyVndw3GgtdECQvQFXPEZIOVULHVZGAYmOgmqjXpVpfocAbSjh99V/Fqw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.24.1.tgz", + "integrity": "sha512-mvoQg2f9p2qlpDQRBC7M3c3XTr0k7cp/0+kFKKO/7Gtu0LSw16eKB+Fabe2bDT/UpsyasTBBkAnbdsLrkD5XMw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1769,12 +1707,12 @@ } }, "node_modules/@babel/plugin-transform-react-pure-annotations": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.23.3.tgz", - "integrity": "sha512-qMFdSS+TUhB7Q/3HVPnEdYJDQIk57jkntAwSuz9xfSE4n+3I+vHYCli3HoHawN1Z3RfCz/y1zXA/JXjG6cVImQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.24.1.tgz", + "integrity": "sha512-+pWEAaDJvSm9aFvJNpLiM2+ktl2Sn2U5DdyiWdZBxmLc6+xGt88dvFqsHiAiDS+8WqUwbDfkKz9jRxK3M0k+kA==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1784,11 +1722,11 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz", - "integrity": "sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.1.tgz", + "integrity": "sha512-sJwZBCzIBE4t+5Q4IGLaaun5ExVMRY0lYwos/jNecjMrVCygCdph3IKv0tkP5Fc87e/1+bebAmEAGBfnRD+cnw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "regenerator-transform": "^0.15.2" }, "engines": { @@ -1799,11 +1737,11 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.23.3.tgz", - "integrity": "sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.1.tgz", + "integrity": "sha512-JAclqStUfIwKN15HrsQADFgeZt+wexNQ0uLhuqvqAUFoqPMjEcFCYZBhq0LUdz6dZK/mD+rErhW71fbx8RYElg==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1813,15 +1751,15 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.9.tgz", - "integrity": "sha512-A7clW3a0aSjm3ONU9o2HAILSegJCYlEZmOhmBRReVtIpY/Z/p7yIZ+wR41Z+UipwdGuqwtID/V/dOdZXjwi9gQ==", - "dependencies": { - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5", - "babel-plugin-polyfill-corejs2": "^0.4.8", - "babel-plugin-polyfill-corejs3": "^0.9.0", - "babel-plugin-polyfill-regenerator": "^0.5.5", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.24.3.tgz", + "integrity": "sha512-J0BuRPNlNqlMTRJ72eVptpt9VcInbxO6iP3jaxr+1NPhC0UkKL+6oeX6VXMEYdADnuqmMmsBspt4d5w8Y/TCbQ==", + "dependencies": { + "@babel/helper-module-imports": "^7.24.3", + "@babel/helper-plugin-utils": "^7.24.0", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.1", + "babel-plugin-polyfill-regenerator": "^0.6.1", "semver": "^6.3.1" }, "engines": { @@ -1840,11 +1778,11 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz", - "integrity": "sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.1.tgz", + "integrity": "sha512-LyjVB1nsJ6gTTUKRjRWx9C1s9hE7dLfP/knKdrfeH9UPtAGjYGgxIbFfx7xyLIEWs7Xe1Gnf8EWiUqfjLhInZA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1854,11 +1792,11 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz", - "integrity": "sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.1.tgz", + "integrity": "sha512-KjmcIM+fxgY+KxPVbjelJC6hrH1CgtPmTvdXAfn3/a9CnWGSTY7nH4zm5+cjmWJybdcPSsD0++QssDsjcpe47g==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" }, "engines": { @@ -1869,11 +1807,11 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz", - "integrity": "sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.1.tgz", + "integrity": "sha512-9v0f1bRXgPVcPrngOQvLXeGNNVLc8UjMVfebo9ka0WF3/7+aVUHmaJVT3sa0XCzEFioPfPHZiOcYG9qOsH63cw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1883,11 +1821,11 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz", - "integrity": "sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.1.tgz", + "integrity": "sha512-WRkhROsNzriarqECASCNu/nojeXCDTE/F2HmRgOzi7NGvyfYGq1NEjKBK3ckLfRgGc6/lPAqP0vDOSw3YtG34g==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1897,11 +1835,11 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.23.3.tgz", - "integrity": "sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.1.tgz", + "integrity": "sha512-CBfU4l/A+KruSUoW+vTQthwcAdwuqbpRNB8HQKlZABwHRhsdHZ9fezp4Sn18PeAlYxTNiLMlx4xUBV3AWfg1BA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1911,14 +1849,14 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.6.tgz", - "integrity": "sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.24.1.tgz", + "integrity": "sha512-liYSESjX2fZ7JyBFkYG78nfvHlMKE6IpNdTVnxmlYUR+j5ZLsitFbaAE+eJSK2zPPkNWNw4mXL51rQ8WrvdK0w==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-create-class-features-plugin": "^7.23.6", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-typescript": "^7.23.3" + "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/plugin-syntax-typescript": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -1928,11 +1866,11 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz", - "integrity": "sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.1.tgz", + "integrity": "sha512-RlkVIcWT4TLI96zM660S877E7beKlQw7Ig+wqkKBiWfj0zH5Q4h50q6er4wzZKRNSYpfo6ILJ+hrJAGSX2qcNw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1942,12 +1880,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.23.3.tgz", - "integrity": "sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.1.tgz", + "integrity": "sha512-Ss4VvlfYV5huWApFsF8/Sq0oXnGO+jB+rijFEFugTd3cwSObUSnUi88djgR5528Csl0uKlrI331kRqe56Ov2Ng==", "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1957,12 +1895,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz", - "integrity": "sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.1.tgz", + "integrity": "sha512-2A/94wgZgxfTsiLaQ2E36XAOdcZmGAaEEgVmxQWwZXWkGhvoHbaqXcKnU8zny4ycpu3vNqg0L/PcCiYtHtA13g==", "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1972,12 +1910,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.23.3.tgz", - "integrity": "sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.1.tgz", + "integrity": "sha512-fqj4WuzzS+ukpgerpAoOnMfQXwUHFxXUZUE84oL2Kao2N8uSlvcpnAidKASgsNgzZHBsHWvcm8s9FPWUhAb8fA==", "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1987,25 +1925,25 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.9.tgz", - "integrity": "sha512-3kBGTNBBk9DQiPoXYS0g0BYlwTQYUTifqgKTjxUwEUkduRT2QOa0FPGBJ+NROQhGyYO5BuTJwGvBnqKDykac6A==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.3.tgz", + "integrity": "sha512-fSk430k5c2ff8536JcPvPWK4tZDwehWLGlBp0wrsBUjZVdeQV6lePbwKWZaZfK2vnh/1kQX1PzAJWsnBmVgGJA==", "dependencies": { - "@babel/compat-data": "^7.23.5", + "@babel/compat-data": "^7.24.1", "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-validator-option": "^7.23.5", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.23.7", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.1", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.1", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.1", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.23.3", - "@babel/plugin-syntax-import-attributes": "^7.23.3", + "@babel/plugin-syntax-import-assertions": "^7.24.1", + "@babel/plugin-syntax-import-attributes": "^7.24.1", "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", @@ -2017,58 +1955,58 @@ "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.23.3", - "@babel/plugin-transform-async-generator-functions": "^7.23.9", - "@babel/plugin-transform-async-to-generator": "^7.23.3", - "@babel/plugin-transform-block-scoped-functions": "^7.23.3", - "@babel/plugin-transform-block-scoping": "^7.23.4", - "@babel/plugin-transform-class-properties": "^7.23.3", - "@babel/plugin-transform-class-static-block": "^7.23.4", - "@babel/plugin-transform-classes": "^7.23.8", - "@babel/plugin-transform-computed-properties": "^7.23.3", - "@babel/plugin-transform-destructuring": "^7.23.3", - "@babel/plugin-transform-dotall-regex": "^7.23.3", - "@babel/plugin-transform-duplicate-keys": "^7.23.3", - "@babel/plugin-transform-dynamic-import": "^7.23.4", - "@babel/plugin-transform-exponentiation-operator": "^7.23.3", - "@babel/plugin-transform-export-namespace-from": "^7.23.4", - "@babel/plugin-transform-for-of": "^7.23.6", - "@babel/plugin-transform-function-name": "^7.23.3", - "@babel/plugin-transform-json-strings": "^7.23.4", - "@babel/plugin-transform-literals": "^7.23.3", - "@babel/plugin-transform-logical-assignment-operators": "^7.23.4", - "@babel/plugin-transform-member-expression-literals": "^7.23.3", - "@babel/plugin-transform-modules-amd": "^7.23.3", - "@babel/plugin-transform-modules-commonjs": "^7.23.3", - "@babel/plugin-transform-modules-systemjs": "^7.23.9", - "@babel/plugin-transform-modules-umd": "^7.23.3", + "@babel/plugin-transform-arrow-functions": "^7.24.1", + "@babel/plugin-transform-async-generator-functions": "^7.24.3", + "@babel/plugin-transform-async-to-generator": "^7.24.1", + "@babel/plugin-transform-block-scoped-functions": "^7.24.1", + "@babel/plugin-transform-block-scoping": "^7.24.1", + "@babel/plugin-transform-class-properties": "^7.24.1", + "@babel/plugin-transform-class-static-block": "^7.24.1", + "@babel/plugin-transform-classes": "^7.24.1", + "@babel/plugin-transform-computed-properties": "^7.24.1", + "@babel/plugin-transform-destructuring": "^7.24.1", + "@babel/plugin-transform-dotall-regex": "^7.24.1", + "@babel/plugin-transform-duplicate-keys": "^7.24.1", + "@babel/plugin-transform-dynamic-import": "^7.24.1", + "@babel/plugin-transform-exponentiation-operator": "^7.24.1", + "@babel/plugin-transform-export-namespace-from": "^7.24.1", + "@babel/plugin-transform-for-of": "^7.24.1", + "@babel/plugin-transform-function-name": "^7.24.1", + "@babel/plugin-transform-json-strings": "^7.24.1", + "@babel/plugin-transform-literals": "^7.24.1", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.1", + "@babel/plugin-transform-member-expression-literals": "^7.24.1", + "@babel/plugin-transform-modules-amd": "^7.24.1", + "@babel/plugin-transform-modules-commonjs": "^7.24.1", + "@babel/plugin-transform-modules-systemjs": "^7.24.1", + "@babel/plugin-transform-modules-umd": "^7.24.1", "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", - "@babel/plugin-transform-new-target": "^7.23.3", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4", - "@babel/plugin-transform-numeric-separator": "^7.23.4", - "@babel/plugin-transform-object-rest-spread": "^7.23.4", - "@babel/plugin-transform-object-super": "^7.23.3", - "@babel/plugin-transform-optional-catch-binding": "^7.23.4", - "@babel/plugin-transform-optional-chaining": "^7.23.4", - "@babel/plugin-transform-parameters": "^7.23.3", - "@babel/plugin-transform-private-methods": "^7.23.3", - "@babel/plugin-transform-private-property-in-object": "^7.23.4", - "@babel/plugin-transform-property-literals": "^7.23.3", - "@babel/plugin-transform-regenerator": "^7.23.3", - "@babel/plugin-transform-reserved-words": "^7.23.3", - "@babel/plugin-transform-shorthand-properties": "^7.23.3", - "@babel/plugin-transform-spread": "^7.23.3", - "@babel/plugin-transform-sticky-regex": "^7.23.3", - "@babel/plugin-transform-template-literals": "^7.23.3", - "@babel/plugin-transform-typeof-symbol": "^7.23.3", - "@babel/plugin-transform-unicode-escapes": "^7.23.3", - "@babel/plugin-transform-unicode-property-regex": "^7.23.3", - "@babel/plugin-transform-unicode-regex": "^7.23.3", - "@babel/plugin-transform-unicode-sets-regex": "^7.23.3", + "@babel/plugin-transform-new-target": "^7.24.1", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.1", + "@babel/plugin-transform-numeric-separator": "^7.24.1", + "@babel/plugin-transform-object-rest-spread": "^7.24.1", + "@babel/plugin-transform-object-super": "^7.24.1", + "@babel/plugin-transform-optional-catch-binding": "^7.24.1", + "@babel/plugin-transform-optional-chaining": "^7.24.1", + "@babel/plugin-transform-parameters": "^7.24.1", + "@babel/plugin-transform-private-methods": "^7.24.1", + "@babel/plugin-transform-private-property-in-object": "^7.24.1", + "@babel/plugin-transform-property-literals": "^7.24.1", + "@babel/plugin-transform-regenerator": "^7.24.1", + "@babel/plugin-transform-reserved-words": "^7.24.1", + "@babel/plugin-transform-shorthand-properties": "^7.24.1", + "@babel/plugin-transform-spread": "^7.24.1", + "@babel/plugin-transform-sticky-regex": "^7.24.1", + "@babel/plugin-transform-template-literals": "^7.24.1", + "@babel/plugin-transform-typeof-symbol": "^7.24.1", + "@babel/plugin-transform-unicode-escapes": "^7.24.1", + "@babel/plugin-transform-unicode-property-regex": "^7.24.1", + "@babel/plugin-transform-unicode-regex": "^7.24.1", + "@babel/plugin-transform-unicode-sets-regex": "^7.24.1", "@babel/preset-modules": "0.1.6-no-external-plugins", - "babel-plugin-polyfill-corejs2": "^0.4.8", - "babel-plugin-polyfill-corejs3": "^0.9.0", - "babel-plugin-polyfill-regenerator": "^0.5.5", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.4", + "babel-plugin-polyfill-regenerator": "^0.6.1", "core-js-compat": "^3.31.0", "semver": "^6.3.1" }, @@ -2101,16 +2039,16 @@ } }, "node_modules/@babel/preset-react": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.23.3.tgz", - "integrity": "sha512-tbkHOS9axH6Ysf2OUEqoSZ6T3Fa2SrNH6WTWSPBboxKzdxNc9qOICeLXkNG0ZEwbQ1HY8liwOce4aN/Ceyuq6w==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.24.1.tgz", + "integrity": "sha512-eFa8up2/8cZXLIpkafhaADTXSnl7IsUFCYenRWrARBz0/qZwcT0RBXpys0LJU4+WfPoF2ZG6ew6s2V6izMCwRA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-validator-option": "^7.22.15", - "@babel/plugin-transform-react-display-name": "^7.23.3", - "@babel/plugin-transform-react-jsx": "^7.22.15", + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-validator-option": "^7.23.5", + "@babel/plugin-transform-react-display-name": "^7.24.1", + "@babel/plugin-transform-react-jsx": "^7.23.4", "@babel/plugin-transform-react-jsx-development": "^7.22.5", - "@babel/plugin-transform-react-pure-annotations": "^7.23.3" + "@babel/plugin-transform-react-pure-annotations": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -2120,15 +2058,15 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz", - "integrity": "sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.24.1.tgz", + "integrity": "sha512-1DBaMmRDpuYQBPWD8Pf/WEwCrtgRHxsZnP4mIy9G/X+hFfbI47Q2G4t1Paakld84+qsk2fSsUPMKg71jkoOOaQ==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-validator-option": "^7.22.15", - "@babel/plugin-syntax-jsx": "^7.23.3", - "@babel/plugin-transform-modules-commonjs": "^7.23.3", - "@babel/plugin-transform-typescript": "^7.23.3" + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-validator-option": "^7.23.5", + "@babel/plugin-syntax-jsx": "^7.24.1", + "@babel/plugin-transform-modules-commonjs": "^7.24.1", + "@babel/plugin-transform-typescript": "^7.24.1" }, "engines": { "node": ">=6.9.0" @@ -2143,9 +2081,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "node_modules/@babel/runtime": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", - "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.1.tgz", + "integrity": "sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -2154,31 +2092,31 @@ } }, "node_modules/@babel/template": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", - "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dependencies": { "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", - "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", + "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", + "@babel/code-frame": "^7.24.1", + "@babel/generator": "^7.24.1", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/parser": "^7.24.1", + "@babel/types": "^7.24.0", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -2208,9 +2146,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/@babel/types": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", - "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -2495,51 +2433,381 @@ "postcss-selector-parser": "^6.0.10" } }, - "node_modules/@esbuild/darwin-arm64": { + "node_modules/@esbuild/aix-ppc64": { "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", "cpu": [ - "arm64" + "ppc64" ], "optional": true, "os": [ - "darwin" + "aix" ], "engines": { "node": ">=12" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + "node": ">=12" } }, - "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -2637,23 +2905,25 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@fuel-ts/abi-coder": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/abi-coder/-/abi-coder-0.73.0.tgz", - "integrity": "sha512-whuX9mqhYKOiP0iyNYUrL5Onn6Lk21PmctyGMYh+rK4sU8yAIBDN8ubQcDmwq1YoYkpJR2UzANXwBXud33KDWQ==", - "dependencies": { - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuel-ts/versions": "0.73.0", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/abi-coder/-/abi-coder-0.79.0.tgz", + "integrity": "sha512-Jdp0megar7aFP+jecnUvd1SR488wYG0AMb0C7lXpXoWIryk8DwHv8odIMXnj5WA7/VpApXiREgYoTCFs8k65oA==", + "dependencies": { + "@fuel-ts/crypto": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/hasher": "^0.79.0", + "@fuel-ts/interfaces": "0.79.0", + "@fuel-ts/math": "0.79.0", + "@fuel-ts/utils": "0.79.0", + "@fuel-ts/versions": "0.79.0", "ethers": "^6.7.1", "type-fest": "^3.1.0" }, @@ -2662,15 +2932,15 @@ } }, "node_modules/@fuel-ts/abi-typegen": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/abi-typegen/-/abi-typegen-0.73.0.tgz", - "integrity": "sha512-m/k7wYsQ3kll46O1WMGT8+KrpU0QSmJBrck56RyvBxCBrC3wX55VV94uwUM/ytQJ75Y8skAC0HQdW7DBISF7SQ==", - "dependencies": { - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuel-ts/versions": "0.73.0", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/abi-typegen/-/abi-typegen-0.79.0.tgz", + "integrity": "sha512-YGSc8KmFiYGp/H1ONbKsmX9CQwtV3TSt9NKcfguD26mlW5vNdmpDgEmELxn9xZCKqu4swAtMhT85f+jHzE//CQ==", + "dependencies": { + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/interfaces": "^0.79.0", + "@fuel-ts/utils": "0.79.0", + "@fuel-ts/versions": "0.79.0", "commander": "^9.4.1", - "ethers": "^6.7.1", "glob": "^10.2.6", "handlebars": "^4.7.7", "mkdirp": "^1.0.4", @@ -2684,51 +2954,90 @@ "node": "^18.18.2 || ^20.0.0" } }, + "node_modules/@fuel-ts/account": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/account/-/account-0.79.0.tgz", + "integrity": "sha512-Rj0jV7JrXAolHk6/qlgCrK0YYjSVV6ehqf2g8lxmS102ShcS+/bVHvGhxhUeefGtHOdmHuVEJEcchcbpfuiYaQ==", + "dependencies": { + "@fuel-ts/abi-coder": "0.79.0", + "@fuel-ts/address": "0.79.0", + "@fuel-ts/crypto": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/fuel-core": "0.79.0", + "@fuel-ts/hasher": "0.79.0", + "@fuel-ts/interfaces": "0.79.0", + "@fuel-ts/math": "0.79.0", + "@fuel-ts/merkle": "0.79.0", + "@fuel-ts/transactions": "0.79.0", + "@fuel-ts/utils": "0.79.0", + "@fuel-ts/versions": "0.79.0", + "@fuels/assets": "^0.1.4", + "@fuels/vm-asm": "0.42.1", + "@noble/curves": "^1.3.0", + "dexie-observable": "4.0.1-beta.13", + "ethers": "^6.7.1", + "events": "^3.3.0", + "graphql": "^16.6.0", + "graphql-request": "5.0.0", + "graphql-tag": "^2.12.6", + "json-rpc-2.0": "^1.7.0", + "portfinder": "^1.0.32", + "ramda": "^0.29.0", + "tai64": "^1.0.0", + "tree-kill": "^1.2.2", + "uuid": "^9.0.0" + }, + "engines": { + "node": "^18.18.2 || ^20.0.0" + } + }, "node_modules/@fuel-ts/address": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/address/-/address-0.73.0.tgz", - "integrity": "sha512-uGLvXlua6mQua3CGpCANdiSRb1SY3BoVIyfac1hIA5bT5fKgnjxtfhqSeAvPR5cLCurBvOKXqW38n+c1F9Xjxg==", - "dependencies": { - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/versions": "0.73.0", - "bech32": "^2.0.0", - "ethers": "^6.7.1" + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/address/-/address-0.79.0.tgz", + "integrity": "sha512-KiDWMQB6cyY9sUCi7e7NPx2sCCejYjC/vLQrTnu4AxV2aVVwQ4GWcRpHO1OGYZ5RalR/yvcR9ebQhpidnU0lUw==", + "dependencies": { + "@fuel-ts/crypto": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/interfaces": "0.79.0", + "@fuel-ts/utils": "^0.79.0", + "@fuel-ts/versions": "0.79.0", + "@noble/hashes": "^1.3.3", + "bech32": "^2.0.0" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/contract": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/contract/-/contract-0.73.0.tgz", - "integrity": "sha512-IveZAYEvHvssWbST2mqv6BlOvmAMea8im+JIAgl+XICj/Q5KAf6e0Mn/JQv/7fHq4UqUonk3Kb2Ye/1tHjwHqw==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/merkle": "0.73.0", - "@fuel-ts/program": "0.73.0", - "@fuel-ts/providers": "0.73.0", - "@fuel-ts/transactions": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuel-ts/versions": "0.73.0", - "@fuel-ts/wallet": "0.73.0", - "ethers": "^6.7.1" + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/contract/-/contract-0.79.0.tgz", + "integrity": "sha512-kyC/pynI5kgTcm9R7xl1qrfUfMWsUQhXfnyv8AXeFuPIIrQMxIvKlKL4bgmQ6AUFJhTDiAv2fmc5dlbqO8RS7w==", + "dependencies": { + "@fuel-ts/abi-coder": "0.79.0", + "@fuel-ts/account": "0.79.0", + "@fuel-ts/address": "0.79.0", + "@fuel-ts/crypto": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/hasher": "0.79.0", + "@fuel-ts/interfaces": "^0.79.0", + "@fuel-ts/merkle": "0.79.0", + "@fuel-ts/program": "0.79.0", + "@fuel-ts/transactions": "0.79.0", + "@fuel-ts/utils": "0.79.0", + "@fuel-ts/versions": "0.79.0" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/crypto": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/crypto/-/crypto-0.73.0.tgz", - "integrity": "sha512-nkQBkcQthAsRW1agvAXgeOJ0c4DyElt2v993bjYGJX8Av8vRmc8q/LRqzRTXhqfDAEUDQ84JQibWtc+Ywwj25Q==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/crypto/-/crypto-0.79.0.tgz", + "integrity": "sha512-kjXhoNK3rVrx0nDGDN9L1nZ6yU6XBVOujhrA5un9RD/hw4DdXfBL4XSIwu6HJ5ZLCcx555kabNHku9VxpIGopg==", "dependencies": { - "@fuel-ts/errors": "0.73.0", - "ethereum-cryptography": "^2.1.2", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/utils": "^0.79.0", + "@noble/hashes": "^1.3.3", "ethers": "^6.7.1" }, "engines": { @@ -2736,20 +3045,20 @@ } }, "node_modules/@fuel-ts/errors": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/errors/-/errors-0.73.0.tgz", - "integrity": "sha512-Uqe+hFVut4TZgrUsS+KzeXgDl3dADqqTS4eVoKUbG9ML9CTMaG9P2V/qYOTjJOOx+QX3xx72E7AR/oSwUEBWLA==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/errors/-/errors-0.79.0.tgz", + "integrity": "sha512-duca9y2b2z2uOgecxSqaCiRnWbu8Mb+O9zcJelXRpML9yAd7RUMn9enCEohCyFJpFCn4O3tKizJvnmNkeDrbew==", "dependencies": { - "@fuel-ts/versions": "0.73.0" + "@fuel-ts/versions": "0.79.0" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/forc": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/forc/-/forc-0.73.0.tgz", - "integrity": "sha512-Dpli/ch7axvJ2nptzVnYgpQQHUM4NwuSXkIRrhEKdcSGy6q1kClngL5NaeenUHLzsQfZPrMJ69fExF6BpOHNhg==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/forc/-/forc-0.79.0.tgz", + "integrity": "sha512-+8fthdhkKLrnjwMNf8Cg66IYfEIOHipxE+q+Pem4iECDKq8o5U94sjut+AG1MisoXuU4P6hYd5uKioT4YLV+ow==", "hasInstallScript": true, "dependencies": { "node-fetch": "^2.6.7" @@ -2759,9 +3068,9 @@ } }, "node_modules/@fuel-ts/fuel-core": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/fuel-core/-/fuel-core-0.73.0.tgz", - "integrity": "sha512-+c1678UfBhfz8atxZEgBJfxKY7OXtlcIqQzZOft6mSiyu81Lc6C3WfQY/EJqMG/mEKCmZpNHHrpA3sU72sO+7Q==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/fuel-core/-/fuel-core-0.79.0.tgz", + "integrity": "sha512-7RfY2YsXaw5iSzMQgdHjA+NB4WH24qaaMrHqg3+llBBVst0ZsdgC6DK61Z/DUf7sAnLX/DC147b05O5xI6/QCg==", "hasInstallScript": true, "dependencies": { "node-fetch": "^2.7.0" @@ -2771,50 +3080,36 @@ } }, "node_modules/@fuel-ts/hasher": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/hasher/-/hasher-0.73.0.tgz", - "integrity": "sha512-1tN+J0pBBLPpbneDqQTqWH6kYrsJ24i9F9rDBUf6iDXHiyCD1QKVL2MXtVdRUZ/0zBkxNxdOoUjdDKfsrMWL5g==", - "dependencies": { - "@fuel-ts/address": "0.73.0", - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "ethers": "^6.7.1", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/hasher/-/hasher-0.79.0.tgz", + "integrity": "sha512-y4qcJjIqHxYas3QJm5eI2tcR2Ql/+ReF8avCJ/TS4c/7ZTqESlW4GYHuzgt4+BRawXa+keDfyrbV3gSVS0UByQ==", + "dependencies": { + "@fuel-ts/address": "0.79.0", + "@fuel-ts/crypto": "0.79.0", + "@fuel-ts/interfaces": "^0.79.0", + "@fuel-ts/math": "0.79.0", + "@fuel-ts/utils": "0.79.0", + "@noble/hashes": "^1.3.3", "ramda": "^0.29.0" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, - "node_modules/@fuel-ts/hdwallet": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/hdwallet/-/hdwallet-0.73.0.tgz", - "integrity": "sha512-8ncYkrgQBQO6FoSQSgsa/r+HdUuTbeHAiMG10AMAvLBwzrTtyp7tlwr1KBDmrBEQQn95CSa1pd1drd/7f2F7MA==", - "dependencies": { - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/mnemonic": "0.73.0", - "@fuel-ts/signer": "0.73.0", - "ethers": "^6.7.1" - }, - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, "node_modules/@fuel-ts/interfaces": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/interfaces/-/interfaces-0.73.0.tgz", - "integrity": "sha512-/YwdWf1nlBX6XcSkNsk3fxkISlUMCHPh3R+CKLl8Bvq63erOr60KCz0ULeoqXpD/HsGTdJUiNGAv8Sv3eqrpTw==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/interfaces/-/interfaces-0.79.0.tgz", + "integrity": "sha512-L0KrElKvtLRYDzR/SNH26jVLSLBlE+xng9Wm4gyLSrR7Wnf6pB/l+/BrqGdwbWlN9kD205tC7pUa0KD5AugE2w==", "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/math": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/math/-/math-0.73.0.tgz", - "integrity": "sha512-eyXOSa0zxy7J1ArfAelOVPsuiziAqqzyLogwW/1TuQO4Q5WYyJfhFPsYf7CnpzrOd4fSQggeGBMdzheu5j/Bhw==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/math/-/math-0.79.0.tgz", + "integrity": "sha512-x5BxKYzrBF+RfqaUQyWXl4dLn16CMOWQdiVL22ixwFJY42lLKMCaFkN+91dXbF1T0bOlsYclZXfNIlCxGqqfFA==", "dependencies": { - "@fuel-ts/errors": "0.73.0", + "@fuel-ts/errors": "0.79.0", "@types/bn.js": "^5.1.1", "bn.js": "^5.2.1" }, @@ -2823,162 +3118,83 @@ } }, "node_modules/@fuel-ts/merkle": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/merkle/-/merkle-0.73.0.tgz", - "integrity": "sha512-FStpyuBuFlTgInBBhnmFuLW8yvgz/grBmh3k+tE7ph9QG6zUH5iTlnu4hd26xCYMprqyjx2VOfOCIXI5B2PjPQ==", - "dependencies": { - "@fuel-ts/math": "0.73.0", - "ethers": "^6.7.1" - }, - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, - "node_modules/@fuel-ts/mnemonic": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/mnemonic/-/mnemonic-0.73.0.tgz", - "integrity": "sha512-IsECe6WOvbfXWYx/SMbhzb4pmUPxfB174sSmk1H8z+mn3/QCAuEE6ld6qWnmh1OE0ZrUKD84FflcS20VsBFmWg==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/merkle/-/merkle-0.79.0.tgz", + "integrity": "sha512-VNKvpayikz6HusX2KhSkJTdPyamG+4sv5zOugCRFfjLMJHp1YpGwvy64AY4SijVMojNWP7Pf6Yr4juEKc01XaQ==", "dependencies": { - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/wordlists": "0.73.0", - "ethers": "^6.7.1" - }, - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, - "node_modules/@fuel-ts/predicate": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/predicate/-/predicate-0.73.0.tgz", - "integrity": "sha512-CRqhXIsjp/XAPs4Lx7qnELAz8jbPEe3CDoo5bzUBO2ZsDU6ADeOavmpuyYwkP8/QqvGSCZ4W3u7rMcTILxjE5w==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/hasher": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/merkle": "0.73.0", - "@fuel-ts/providers": "0.73.0", - "@fuel-ts/transactions": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuel-ts/versions": "0.73.0", - "@fuel-ts/wallet": "0.73.0", - "ethers": "^6.7.1" + "@fuel-ts/hasher": "^0.79.0", + "@fuel-ts/interfaces": "^0.79.0", + "@fuel-ts/math": "0.79.0" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/program": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/program/-/program-0.73.0.tgz", - "integrity": "sha512-1SzQu1PfFDEuoF49CqCjzWY0XA+paVIIqTJWx2fzjJTC1vNI75kNDmueU2GxPNi6LiXPHeow/5bAiO7SnMrQRQ==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/hasher": "^0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/providers": "0.73.0", - "@fuel-ts/transactions": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuel-ts/versions": "0.73.0", - "@fuel-ts/wallet": "0.73.0", - "@fuels/vm-asm": "0.42.1", - "ethers": "^6.7.1" - }, - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, - "node_modules/@fuel-ts/providers": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/providers/-/providers-0.73.0.tgz", - "integrity": "sha512-81NWYrCG4AuNmXbVxBn3jgI1Ed6hiJWOGbN8Cu7SKenDg8MSlfqDkZylNCKx+vAOSdtPki2nyzSRWLSCca3+rw==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/hasher": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/transactions": "0.73.0", - "@fuel-ts/versions": "0.73.0", - "ethers": "^6.7.1", - "graphql": "^16.6.0", - "graphql-request": "5.0.0", - "graphql-tag": "^2.12.6", - "ramda": "^0.29.0", - "tai64": "^1.0.0" + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/program/-/program-0.79.0.tgz", + "integrity": "sha512-TwLP2qYuR13anM57cDEUGPUlakuVGUnJ4W5h3uUGINfO5USnyQkW9vwvLcFsXL8WvqOimFGMnmRv+ElsMM4Q3A==", + "dependencies": { + "@fuel-ts/abi-coder": "0.79.0", + "@fuel-ts/account": "0.79.0", + "@fuel-ts/address": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/hasher": "^0.79.0", + "@fuel-ts/interfaces": "0.79.0", + "@fuel-ts/math": "0.79.0", + "@fuel-ts/transactions": "0.79.0", + "@fuel-ts/utils": "0.79.0", + "@fuel-ts/versions": "0.79.0", + "@fuels/vm-asm": "0.42.1" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/script": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/script/-/script-0.73.0.tgz", - "integrity": "sha512-m9pn1IMwZB3OGuK4tTUdmnNUi3gtvC4nYIYbymO8rGhY/ZdH0SCnlCrIkmm/urYzNqcZMwGkmqN9Vb7iPF/sPw==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/abi-typegen": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/program": "0.73.0", - "@fuel-ts/providers": "0.73.0", - "@fuel-ts/transactions": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuel-ts/wallet": "0.73.0", - "ethers": "^6.7.1" - }, - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, - "node_modules/@fuel-ts/signer": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/signer/-/signer-0.73.0.tgz", - "integrity": "sha512-VCEgNg1FtrN8iSXkPpM5xtdYiKQ92VX+s82nfFS0mnFyk0urlmd/Xk4O4rjK9uvC5+nyAY587ysHFGca8qvS0Q==", - "dependencies": { - "@fuel-ts/address": "0.73.0", - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/hasher": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@noble/curves": "^1.3.0", - "ethers": "^6.7.1" + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/script/-/script-0.79.0.tgz", + "integrity": "sha512-w3qB3oD1y/HMOzSU7pWRSMHDn+nurYB/zqk0HRDVPdF6t53hv6yaXQukSzHhsk2Fvsy+nsDEWVj63VZl0ehzAw==", + "dependencies": { + "@fuel-ts/abi-coder": "0.79.0", + "@fuel-ts/abi-typegen": "0.79.0", + "@fuel-ts/account": "0.79.0", + "@fuel-ts/address": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/interfaces": "0.79.0", + "@fuel-ts/math": "0.79.0", + "@fuel-ts/program": "0.79.0", + "@fuel-ts/transactions": "0.79.0", + "@fuel-ts/utils": "0.79.0" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/transactions": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/transactions/-/transactions-0.73.0.tgz", - "integrity": "sha512-E+M9YJRXSiIr3FAJXakb5EKN6drAvz9I8wlWld707uvJ8TS1tpIW9rzvCXCYH7fmcFr7CaNgdyFUvKrvX55r2Q==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "ethers": "^6.7.1" + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/transactions/-/transactions-0.79.0.tgz", + "integrity": "sha512-k7S4FSO6RrSaSjUaHnuK9KmfaH856ertn+Eall75ZhVV+00Lh+Ewe64xMzzqmKqdr7Puii2QAaKCtssHVDAfOQ==", + "dependencies": { + "@fuel-ts/abi-coder": "0.79.0", + "@fuel-ts/address": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/hasher": "^0.79.0", + "@fuel-ts/interfaces": "^0.79.0", + "@fuel-ts/math": "0.79.0", + "@fuel-ts/utils": "0.79.0" }, "engines": { "node": "^18.18.2 || ^20.0.0" } }, "node_modules/@fuel-ts/utils": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/utils/-/utils-0.73.0.tgz", - "integrity": "sha512-wY0oQqo3US4WWx3A2eDb0KBJerP9euoVMgp+FYNFSgWMuHZgm0sX5Oz2pJEKR9K0xFnXyomHUdIHGGvvi8v29w==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/utils/-/utils-0.79.0.tgz", + "integrity": "sha512-9hESU0q04jKlOvOC3qr9hpmJF2pgf5cdF785sV2apyTOfw9Luzi+O5uzTr9EKmazKr5nl8KhuDKAtTCIiBRfmA==", "dependencies": { - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/interfaces": "0.79.0", "ramda": "^0.29.0", "rimraf": "^3.0.2" }, @@ -2987,9 +3203,9 @@ } }, "node_modules/@fuel-ts/versions": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/versions/-/versions-0.73.0.tgz", - "integrity": "sha512-llc1gwmSOk+ymEx+PnaTinTDa1nhTUQg0p8vqatPCre4uTCmRoMz5aNI2aYt4RzjWgiCvXpewu0n/PDpxQ1OWg==", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@fuel-ts/versions/-/versions-0.79.0.tgz", + "integrity": "sha512-nTpBnfgYqyaK5snKmUaF43M1jcOQOOteQmsxrLnkrWIff4nR3vXGPM4Dm90pCNATMpz9DNs9gSDuC2oSKqoxnA==", "dependencies": { "chalk": "4", "cli-table": "^0.3.11" @@ -3001,106 +3217,36 @@ "node": "^18.18.2 || ^20.0.0" } }, - "node_modules/@fuel-ts/wallet": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/wallet/-/wallet-0.73.0.tgz", - "integrity": "sha512-nzAfNN+y13Xm4o0tx6K9h5Vu60iAyCixqp1s5FMtol5gnwUbruH1KT25jIVD2ipVl2qGVktrtYROm75n6YijOg==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/fuel-core": "0.73.0", - "@fuel-ts/hasher": "0.73.0", - "@fuel-ts/hdwallet": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/mnemonic": "0.73.0", - "@fuel-ts/providers": "0.73.0", - "@fuel-ts/signer": "0.73.0", - "@fuel-ts/transactions": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuels/vm-asm": "0.42.1", - "ethers": "^6.7.1", - "portfinder": "^1.0.32", - "tree-kill": "^1.2.2", - "uuid": "^9.0.0" - }, - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, - "node_modules/@fuel-ts/wallet-manager": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/wallet-manager/-/wallet-manager-0.73.0.tgz", - "integrity": "sha512-VNgawSQX2KPsimkqZqWZhfeljXuBrMJpkIEY1rLGAm7z4ex/pNd2K6wmCCDhqm35mHFFTx1gxMdFCTAl+5W08g==", - "dependencies": { - "@fuel-ts/address": "0.73.0", - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/mnemonic": "0.73.0", - "@fuel-ts/providers": "0.73.0", - "@fuel-ts/wallet": "0.73.0", - "events": "^3.3.0" - }, - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, - "node_modules/@fuel-ts/wordlists": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/@fuel-ts/wordlists/-/wordlists-0.73.0.tgz", - "integrity": "sha512-Fd1jiLw7Sm0v6EqqVOEuXXYcQStDGMe/LyIf/9K7nrZbC6siVfw1FktBANnd39/uaQ0GHM4NZRXOO58LEf7nzg==", - "engines": { - "node": "^18.18.2 || ^20.0.0" - } - }, - "node_modules/@fuel-wallet/react": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@fuel-wallet/react/-/react-0.15.2.tgz", - "integrity": "sha512-cJPidiRSSZM2jV4bHgvQl7EOTnNde7Lx7+49Hxs7hr53eleS5Otd8yY3grgWDWL0D4wiSLZkrUM+U2SH9ScENg==", - "dependencies": { - "@radix-ui/react-dialog": "^1.0.5", - "@tanstack/react-query": "^4.36.1", - "events": "^3.3.0" - }, - "peerDependencies": { - "fuels": ">=0.73.0", - "react": "^18.2.0" - } + "node_modules/@fuels/assets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@fuels/assets/-/assets-0.1.5.tgz", + "integrity": "sha512-3rFZdY2f5/h7e2Rlhv/+WKz1CVsTnydKoxLdVjQfUaNsj7zbMLSfT37bsBSB42AnXKOlPs/vyMbS77LxhN8a2A==" }, - "node_modules/@fuel-wallet/sdk": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@fuel-wallet/sdk/-/sdk-0.15.2.tgz", - "integrity": "sha512-hUrCNpWqso968h8oExhVCWp8lOgAR0ZA1dkv7/bOYT+HEpWebl90GjJ2q2xx6+ijq4WrRJi8fIDVgnB7+LD+mw==", + "node_modules/@fuels/connectors": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fuels/connectors/-/connectors-0.1.1.tgz", + "integrity": "sha512-h0ErY8J8y58QaOyjVtcXICY/GjmSZMD/nLnrAMyrBpsrAUChLV6lYdwZ1MxVhHJFpbtaCG0IrclHxwJvQCFE5Q==", "dependencies": { - "@fuel-wallet/types": "0.15.2", - "events": "^3.3.0", - "json-rpc-2.0": "^1.6.0" + "json-rpc-2.0": "1.7.0" }, "peerDependencies": { - "fuels": ">=0.73.0" + "fuels": ">=0.77.0" } }, - "node_modules/@fuel-wallet/types": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@fuel-wallet/types/-/types-0.15.2.tgz", - "integrity": "sha512-RQCIImIItQiAjUrSWjpOp2t9o6YUlSyxakpSlX+myTBM7TjIWXFjZDSFthcLKhQdECMYIf7hZyRf7d0o2AJ6dQ==", + "node_modules/@fuels/react": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@fuels/react/-/react-0.18.0.tgz", + "integrity": "sha512-y9IZ4/ZlZ7gq+VZFGMDoV4EzHbSvfv8GLVtwU/qfRL3aduZbUwg3/lJ8wMNArB/W8+o633ZswDHjGXEw0JPHIA==", "dependencies": { - "@fuels/assets": "^0.1.1", - "dexie-observable": "4.0.1-beta.13", - "json-rpc-2.0": "^1.6.0" + "@radix-ui/react-dialog": "^1.0.5", + "events": "^3.3.0" }, "peerDependencies": { - "fuels": ">=0.73.0" + "@tanstack/react-query": ">=5.0.0", + "fuels": ">=0.74.0", + "react": "^18.2.0" } }, - "node_modules/@fuels/assets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@fuels/assets/-/assets-0.1.5.tgz", - "integrity": "sha512-3rFZdY2f5/h7e2Rlhv/+WKz1CVsTnydKoxLdVjQfUaNsj7zbMLSfT37bsBSB42AnXKOlPs/vyMbS77LxhN8a2A==" - }, "node_modules/@fuels/vm-asm": { "version": "0.42.1", "resolved": "https://registry.npmjs.org/@fuels/vm-asm/-/vm-asm-0.42.1.tgz", @@ -3576,41 +3722,41 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -3619,18 +3765,18 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@leichtgewicht/ip-codec": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==" }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", @@ -3661,20 +3807,20 @@ } }, "node_modules/@noble/curves": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.3.0.tgz", - "integrity": "sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", + "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", "dependencies": { - "@noble/hashes": "1.3.3" + "@noble/hashes": "1.4.0" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@noble/hashes": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", - "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "engines": { "node": ">= 16" }, @@ -4178,42 +4324,9 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" }, "node_modules/@rushstack/eslint-patch": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz", - "integrity": "sha512-RbhOOTCNoCrbfkRyoXODZp75MlpiHMgbE5MEBZAnnnLyQNgrigEj4p0lzsMDyc1zVsJDLrivB58tgg3emX0eEA==" - }, - "node_modules/@scure/base": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.5.tgz", - "integrity": "sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.3.tgz", - "integrity": "sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ==", - "dependencies": { - "@noble/curves": "~1.3.0", - "@noble/hashes": "~1.3.2", - "@scure/base": "~1.1.4" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.2.tgz", - "integrity": "sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==", - "dependencies": { - "@noble/hashes": "~1.3.2", - "@scure/base": "~1.1.4" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.0.tgz", + "integrity": "sha512-ih6xH1dOGBTP/RNc/QbnVLLa/s80SkXydI7tnyq+a2eIdd7gDsmSpD1Jz7T1oCa+GIsVTyQCR3cW0tlYB97iFg==" }, "node_modules/@sinclair/typebox": { "version": "0.24.51", @@ -4455,38 +4568,52 @@ } }, "node_modules/@tanstack/query-core": { - "version": "4.36.1", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-4.36.1.tgz", - "integrity": "sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==", + "version": "5.28.9", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.28.9.tgz", + "integrity": "sha512-hNlfCiqZevr3GRVPXS3MhaGW5hjcxvCsIQ4q6ff7EPlvFwYZaS+0d9EIIgofnegDaU2BbCDlyURoYfRl5rmzow==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/query-devtools": { + "version": "5.28.10", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.28.10.tgz", + "integrity": "sha512-5UN629fKa5/1K/2Pd26gaU7epxRrYiT1gy+V+pW5K6hnf1DeUKK3pANSb2eHKlecjIKIhTwyF7k9XdyE2gREvQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "4.36.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-4.36.1.tgz", - "integrity": "sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw==", + "version": "5.28.9", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.28.9.tgz", + "integrity": "sha512-vwifBkGXsydsLxFOBMe3+f8kvtDoqDRDwUNjPHVDDt+FoBetCbOWAUHgZn4k+CVeZgLmy7bx6aKeDbe3e8koOQ==", "dependencies": { - "@tanstack/query-core": "4.36.1", - "use-sync-external-store": "^1.2.0" + "@tanstack/query-core": "5.28.9" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-native": "*" + "react": "^18.0.0" + } + }, + "node_modules/@tanstack/react-query-devtools": { + "version": "5.28.10", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.28.10.tgz", + "integrity": "sha512-D+SiHZTWhK2sNgBYj+xIvUOqonsKy74OLU/YHmRB5OZVLLTiekvZd12C3rKlU+WM69jid0hjEjuFqkULOMwc3A==", + "dependencies": { + "@tanstack/query-devtools": "5.28.10" }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - } + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "@tanstack/react-query": "^5.28.9", + "react": "^18.0.0" } }, "node_modules/@testing-library/dom": { @@ -4692,9 +4819,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.2.tgz", - "integrity": "sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw==", + "version": "8.56.6", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.6.tgz", + "integrity": "sha512-ymwc+qb1XkjT/gfoQwxIeHZ6ixH23A+tCT2ADSA/DPVKzAjwYkTXBMCQ/f6fe4wEa85Lhp26VPeUxI7wMhAi7A==", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -4726,9 +4853,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.42", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.42.tgz", - "integrity": "sha512-ckM3jm2bf/MfB3+spLPWYPUH573plBFwpOhqQ2WottxYV85j1HQFlxmnTq57X1yHY9awZPig06hL/cLMgNWHIQ==", + "version": "4.17.43", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", + "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -4803,9 +4930,9 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, "node_modules/@types/lodash": { - "version": "4.14.202", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", - "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==" + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", + "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==" }, "node_modules/@types/long": { "version": "4.0.0", @@ -4818,9 +4945,9 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "node_modules/@types/node": { - "version": "16.18.77", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.77.tgz", - "integrity": "sha512-zwqAbRkHjGlxH9PBv8i9dmeaDpBRgfQDSFuREMF2Z+WUi8uc13gfRquMV/8LxBqwm+7jBz+doTVkEEA1CIWOnQ==" + "version": "16.18.91", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.91.tgz", + "integrity": "sha512-h8Q4klc8xzc9kJKr7UYNtJde5TU2qEePVyH3WyzJaUC+3ptyc5kPQbWOIUcn8ZsG5+KSkq+P0py0kC0VqxgAXw==" }, "node_modules/@types/node-forge": { "version": "1.3.11", @@ -4841,9 +4968,9 @@ "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==" }, "node_modules/@types/prop-types": { - "version": "15.7.11", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", - "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" + "version": "15.7.12", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", + "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" }, "node_modules/@types/q": { "version": "1.5.8", @@ -4851,9 +4978,9 @@ "integrity": "sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==" }, "node_modules/@types/qs": { - "version": "6.9.11", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" + "version": "6.9.14", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", + "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==" }, "node_modules/@types/range-parser": { "version": "1.2.7", @@ -4861,19 +4988,18 @@ "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/react": { - "version": "18.2.48", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.48.tgz", - "integrity": "sha512-qboRCl6Ie70DQQG9hhNREz81jqC1cs9EVNcjQ1AU+jH6NFfSAhVVbrrY/+nSF+Bsk4AOwm9Qa61InvMCyV+H3w==", + "version": "18.2.73", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.73.tgz", + "integrity": "sha512-XcGdod0Jjv84HOC7N5ziY3x+qL0AfmubvKOZ9hJjJ2yd5EE+KYjWhdOjt387e9HPheHkdggF9atTifMRtyAaRA==", "dependencies": { "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, "node_modules/@types/react-dom": { - "version": "18.2.18", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz", - "integrity": "sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==", + "version": "18.2.23", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.23.tgz", + "integrity": "sha512-ZQ71wgGOTmDYpnav2knkjr3qXdAFu0vsk8Ci5w3pGAIdj7/kKAyn+VsQDhXsmzzzepAiI9leWMmubXz690AI/A==", "dependencies": { "@types/react": "*" } @@ -4891,15 +5017,10 @@ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" }, - "node_modules/@types/scheduler": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", - "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" - }, "node_modules/@types/semver": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", - "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==" + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==" }, "node_modules/@types/send": { "version": "0.17.4", @@ -5283,9 +5404,9 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6" @@ -5302,9 +5423,9 @@ "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==" }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==" + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", @@ -5322,14 +5443,14 @@ "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==" }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { @@ -5354,26 +5475,26 @@ "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==" }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -5381,22 +5502,22 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -5405,11 +5526,11 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -5701,9 +5822,9 @@ } }, "node_modules/aria-hidden": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.3.tgz", - "integrity": "sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.4.tgz", + "integrity": "sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==", "dependencies": { "tslib": "^2.0.0" }, @@ -5720,12 +5841,15 @@ } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5737,14 +5861,15 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -5762,16 +5887,36 @@ "node": ">=8" } }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", - "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5815,14 +5960,16 @@ } }, "node_modules/array.prototype.reduce": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.6.tgz", - "integrity": "sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.7.tgz", + "integrity": "sha512-mzmiUCVwtiD4lgxYP8g7IYy8El8p2CSMePvIbTS7gchKir/L1fgJrk0yDKmAX6mnRQFKNADYIk8nNlTris5H1Q==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", "es-array-method-boxes-properly": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "is-string": "^1.0.7" }, "engines": { @@ -5832,29 +5979,41 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array.prototype.tosorted": { + "node_modules/array.prototype.toreversed": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.2.tgz", - "integrity": "sha512-HuQCHOlk1Weat5jzStICBCd83NxiIMwqDg/dHEsoefabn/hJRj5pVdWcPUSpRrwhwxZOsQassMpgN/xRYFBMIg==", + "resolved": "https://registry.npmjs.org/array.prototype.toreversed/-/array.prototype.toreversed-1.1.2.tgz", + "integrity": "sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA==", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" + "es-shim-unscopables": "^1.0.0" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz", + "integrity": "sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.1.0", + "es-shim-unscopables": "^1.0.2" } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", - "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", "is-shared-array-buffer": "^1.0.2" }, "engines": { @@ -5882,14 +6041,6 @@ "lodash": "^4.17.14" } }, - "node_modules/asynciterator.prototype": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz", - "integrity": "sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg==", - "dependencies": { - "has-symbols": "^1.0.3" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -5904,9 +6055,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.17", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", - "integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==", + "version": "10.4.19", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", + "integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==", "funding": [ { "type": "opencollective", @@ -5922,8 +6073,8 @@ } ], "dependencies": { - "browserslist": "^4.22.2", - "caniuse-lite": "^1.0.30001578", + "browserslist": "^4.23.0", + "caniuse-lite": "^1.0.30001599", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", @@ -5940,9 +6091,12 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -6074,12 +6228,12 @@ } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.8.tgz", - "integrity": "sha512-OtIuQfafSzpo/LhnJaykc0R/MMnuLSSVjVYy9mHArIZ9qTCSZ6TpWCuEKZYVoN//t8HqBNScHrOtCrIK5IaGLg==", + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.10.tgz", + "integrity": "sha512-rpIuu//y5OX6jVU+a5BCn1R5RSZYWAl2Nar76iwaOdycqb6JPxediskWFMMl7stfwNJR4b7eiQvh5fB5TEQJTQ==", "dependencies": { "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.5.0", + "@babel/helper-define-polyfill-provider": "^0.6.1", "semver": "^6.3.1" }, "peerDependencies": { @@ -6095,23 +6249,23 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.9.0.tgz", - "integrity": "sha512-7nZPG1uzK2Ymhy/NbaOWTg3uibM2BmGASS4vHS4szRZAIR8R6GwA/xAujpdrXU5iyklrimWnLWU+BLF9suPTqg==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", + "integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.5.0", - "core-js-compat": "^3.34.0" + "@babel/helper-define-polyfill-provider": "^0.6.1", + "core-js-compat": "^3.36.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.5.tgz", - "integrity": "sha512-OJGYZlhLqBh2DDHeqAxWB1XIvr49CxiJ2gIt61/PU55CQK4Z58OzMqjDe1zwQdQk+rBYsRc+1rJmdajM3gimHg==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.1.tgz", + "integrity": "sha512-JfTApdE++cgcTWjsiCQlLyFBMbTUft9ja17saCc93lgV33h4tuCVj7tlvu//qpLwaG+3yEz7/KhahGrUMkVq9g==", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.5.0" + "@babel/helper-define-polyfill-provider": "^0.6.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -6221,11 +6375,14 @@ } }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/bluebird": { @@ -6239,12 +6396,12 @@ "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -6252,7 +6409,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.1", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -6332,9 +6489,9 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==" }, "node_modules/browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "funding": [ { "type": "opencollective", @@ -6350,8 +6507,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -6409,13 +6566,18 @@ } }, "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6469,9 +6631,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001581", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz", - "integrity": "sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==", + "version": "1.0.30001600", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001600.tgz", + "integrity": "sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==", "funding": [ { "type": "opencollective", @@ -6524,15 +6686,9 @@ "integrity": "sha512-+67P1GkJRaxQD6PKK0Et9DhwQB+vGg3PM5+aavopCpZT1lj9jeqfvpgTLAWErNj8qApkkmXlu/Ug74kmhagkXg==" }, "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -6545,6 +6701,9 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } @@ -6904,9 +7063,9 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "engines": { "node": ">= 0.6" } @@ -6917,9 +7076,9 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "node_modules/core-js": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.1.tgz", - "integrity": "sha512-IgdsbxNyMskrTFxa9lWHyMwAJU5gXOPP+1yO+K59d50VLVAIDAbs7gIv705KzALModfK3ZrSZTPNpC0PQgIZuw==", + "version": "3.36.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.36.1.tgz", + "integrity": "sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -6927,11 +7086,11 @@ } }, "node_modules/core-js-compat": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.35.1.tgz", - "integrity": "sha512-sftHa5qUJY3rs9Zht1WEnmkvXputCyDBczPnr7QDgL8n3qrF3CMXY4VPSYtOLLiOUJcah2WNXREd48iOl6mQIw==", + "version": "3.36.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.36.1.tgz", + "integrity": "sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==", "dependencies": { - "browserslist": "^4.22.2" + "browserslist": "^4.23.0" }, "funding": { "type": "opencollective", @@ -6939,9 +7098,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.35.1.tgz", - "integrity": "sha512-zcIdi/CL3MWbBJYo5YCeVAAx+Sy9yJE9I3/u9LkFABwbeaPhTMRWraM8mYFp9jW5Z50hOy7FVzCc8dCrpZqtIQ==", + "version": "3.36.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.36.1.tgz", + "integrity": "sha512-NXCvHvSVYSrewP0L5OhltzXeWFJLo2AL2TYnj6iLV3Bw8mM62wAQMNgUCRI6EBu6hVVpbCxmOPlxh1Ikw2PfUA==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -7225,9 +7384,9 @@ "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==" }, "node_modules/cssdb": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.10.0.tgz", - "integrity": "sha512-yGZ5tmA57gWh/uvdQBHs45wwFY0IBh3ypABk5sEubPBPSzXzkNgsWReqx7gdx6uhC+QoFBe+V8JwBB9/hQ6cIA==", + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.11.2.tgz", + "integrity": "sha512-lhQ32TFkc1X4eTefGfYPvgovRSzIMofHkigfH8nWtyRL4XJLsRhJFreRvEgKzept7x1rjBuy3J/MurXLaFxW/A==", "funding": [ { "type": "opencollective", @@ -7419,6 +7578,54 @@ "node": ">=10" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -7493,16 +7700,19 @@ } }, "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-lazy-prop": { @@ -7610,13 +7820,10 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/dexie": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/dexie/-/dexie-3.2.4.tgz", - "integrity": "sha512-VKoTQRSv7+RnffpOJ3Dh6ozknBqzWw/F3iqMdsZg958R0AS8AnY9x9d1lbwENr0gzeGJHXKcGhAMRaqys6SxqA==", - "peer": true, - "engines": { - "node": ">=6.0" - } + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.1.tgz", + "integrity": "sha512-wSNn+TcCh+DuE2pdg058K3MhxA4g+IiZlW7yGz4cMd/t3z2rJXZcV3HDxZljbrICU2Iq0qY4UHnbolTMK/+bcA==", + "peer": true }, "node_modules/dexie-observable": { "version": "4.0.1-beta.13", @@ -7813,9 +8020,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.651", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.651.tgz", - "integrity": "sha512-jjks7Xx+4I7dslwsbaFocSwqBbGHQmuXBJUK9QBZTIrzPq3pzn6Uf2szFSP728FtLYE3ldiccmlkOM/zhGKCpA==" + "version": "1.4.719", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.719.tgz", + "integrity": "sha512-FbWy2Q2YgdFzkFUW/W5jBjE9dj+804+98E4Pup78JBPnbdb3pv6IneY2JCPKdeKLh3AOKHQeYf+KwLr7mxGh6Q==" }, "node_modules/emittery": { "version": "0.8.1", @@ -7850,9 +8057,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -7886,49 +8093,56 @@ } }, "node_modules/es-abstract": { - "version": "1.22.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", - "integrity": "sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.2", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.5", - "es-set-tostringtag": "^2.0.1", + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.2", - "get-symbol-description": "^1.0.0", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.0", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", - "is-typed-array": "^1.1.12", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "safe-array-concat": "^1.0.1", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.13" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -7942,6 +8156,25 @@ "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-get-iterator": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", @@ -7962,39 +8195,53 @@ } }, "node_modules/es-iterator-helpers": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.15.tgz", - "integrity": "sha512-GhoY8uYqd6iwUl2kgjTm4CZAf6oo5mHK7BPqx3rKgx893YSsy0LGHV6gfqqQvZt/8xM8xeOnfXBCfqclMKkJ5g==", + "version": "1.0.18", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.18.tgz", + "integrity": "sha512-scxAJaewsahbqTYrGKJihhViaM6DDZDDoucfvzNbK0pOren1g/daDQ3IAhzn+1G14rBG7w+i5N+qul60++zlKA==", "dependencies": { - "asynciterator.prototype": "^1.0.0", - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.1", - "es-set-tostringtag": "^2.0.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.2.1", + "es-abstract": "^1.23.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", "globalthis": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", + "internal-slot": "^1.0.7", "iterator.prototype": "^1.1.2", - "safe-array-concat": "^1.0.1" + "safe-array-concat": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.0.tgz", + "integrity": "sha512-pqrTKmwEIgafsYZAGw9kszYzmagcE/n4dbgwGWLEXg7J4QFJVQRBld8j3Q3GNez79jzxZshq0bcT962QHOghjw==" + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/es-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", - "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" - }, "node_modules/es-set-tostringtag": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", - "integrity": "sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dependencies": { - "get-intrinsic": "^1.2.2", - "has-tostringtag": "^1.0.0", - "hasown": "^2.0.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -8062,9 +8309,9 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "engines": { "node": ">=6" } @@ -8106,15 +8353,15 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -8197,9 +8444,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", - "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", "dependencies": { "debug": "^3.2.7" }, @@ -8379,26 +8626,28 @@ } }, "node_modules/eslint-plugin-react": { - "version": "7.33.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", - "integrity": "sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==", + "version": "7.34.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz", + "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==", "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flatmap": "^1.3.1", - "array.prototype.tosorted": "^1.1.1", + "array-includes": "^3.1.7", + "array.prototype.findlast": "^1.2.4", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.toreversed": "^1.1.2", + "array.prototype.tosorted": "^1.1.3", "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.0.12", + "es-iterator-helpers": "^1.0.17", "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", - "object.entries": "^1.1.6", - "object.fromentries": "^2.0.6", - "object.hasown": "^1.1.2", - "object.values": "^1.1.6", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7", + "object.hasown": "^1.1.3", + "object.values": "^1.1.7", "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.4", + "resolve": "^2.0.0-next.5", "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.8" + "string.prototype.matchall": "^4.0.10" }, "engines": { "node": ">=4" @@ -8796,21 +9045,10 @@ "node": ">= 0.6" } }, - "node_modules/ethereum-cryptography": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz", - "integrity": "sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==", - "dependencies": { - "@noble/curves": "1.3.0", - "@noble/hashes": "1.3.3", - "@scure/bip32": "1.3.3", - "@scure/bip39": "1.2.2" - } - }, "node_modules/ethers": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.10.0.tgz", - "integrity": "sha512-nMNwYHzs6V1FR3Y4cdfxSQmNgZsRj1RiTU25JwvnJLmyzw9z3SKxNc2XKDuiXXo/v9ds5Mp9m6HBabgYQQ26tA==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.11.1.tgz", + "integrity": "sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==", "funding": [ { "type": "individual", @@ -8822,7 +9060,7 @@ } ], "dependencies": { - "@adraffy/ens-normalize": "1.10.0", + "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", "@noble/hashes": "1.3.2", "@types/node": "18.15.13", @@ -8929,16 +9167,16 @@ } }, "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -9024,9 +9262,9 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, "node_modules/fastq": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.0.tgz", - "integrity": "sha512-zGygtijUMT7jnk3h26kUms3BkSDp4IfIKjmnqI2tvx6nuBfiF1UqOxbnLfzdv+apBy+53oaImsKtMw/xYbW+1w==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } @@ -9193,14 +9431,14 @@ } }, "node_modules/flatted": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", - "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==" + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -9448,41 +9686,33 @@ } }, "node_modules/fuels": { - "version": "0.73.0", - "resolved": "https://registry.npmjs.org/fuels/-/fuels-0.73.0.tgz", - "integrity": "sha512-EjJMfS4jSb/avYbk56RrbPFSNRAl+zM+WLS+H0NeXOJlu89iUIFJmBSV/c/YCbeS6Fa1h2EK4SdrjJdd9ijOvA==", - "dependencies": { - "@fuel-ts/abi-coder": "0.73.0", - "@fuel-ts/abi-typegen": "0.73.0", - "@fuel-ts/address": "0.73.0", - "@fuel-ts/contract": "0.73.0", - "@fuel-ts/crypto": "0.73.0", - "@fuel-ts/errors": "0.73.0", - "@fuel-ts/forc": "0.73.0", - "@fuel-ts/fuel-core": "0.73.0", - "@fuel-ts/hasher": "0.73.0", - "@fuel-ts/hdwallet": "0.73.0", - "@fuel-ts/interfaces": "0.73.0", - "@fuel-ts/math": "0.73.0", - "@fuel-ts/merkle": "0.73.0", - "@fuel-ts/mnemonic": "0.73.0", - "@fuel-ts/predicate": "0.73.0", - "@fuel-ts/program": "0.73.0", - "@fuel-ts/providers": "0.73.0", - "@fuel-ts/script": "0.73.0", - "@fuel-ts/signer": "0.73.0", - "@fuel-ts/transactions": "0.73.0", - "@fuel-ts/utils": "0.73.0", - "@fuel-ts/versions": "0.73.0", - "@fuel-ts/wallet": "0.73.0", - "@fuel-ts/wallet-manager": "0.73.0", - "@fuel-ts/wordlists": "0.73.0", + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/fuels/-/fuels-0.79.0.tgz", + "integrity": "sha512-koo7YKNzq821FOa7aLXdSAEllCLHWd+dcNwoAqyHkPw/zGKIUmeNpPDFXuL1zMGxkibTTJEaQ22vM4zHKP2rng==", + "dependencies": { + "@fuel-ts/abi-coder": "0.79.0", + "@fuel-ts/abi-typegen": "0.79.0", + "@fuel-ts/account": "0.79.0", + "@fuel-ts/address": "0.79.0", + "@fuel-ts/contract": "0.79.0", + "@fuel-ts/crypto": "0.79.0", + "@fuel-ts/errors": "0.79.0", + "@fuel-ts/forc": "0.79.0", + "@fuel-ts/fuel-core": "0.79.0", + "@fuel-ts/hasher": "0.79.0", + "@fuel-ts/interfaces": "0.79.0", + "@fuel-ts/math": "0.79.0", + "@fuel-ts/merkle": "0.79.0", + "@fuel-ts/program": "0.79.0", + "@fuel-ts/script": "0.79.0", + "@fuel-ts/transactions": "0.79.0", + "@fuel-ts/utils": "0.79.0", + "@fuel-ts/versions": "0.79.0", "bundle-require": "^4.0.1", "chalk": "4", "chokidar": "^3.5.3", "commander": "^9.4.1", "esbuild": "^0.19.3", - "ethers": "^6.7.1", "glob": "^10.2.6", "handlebars": "^4.7.7", "joycon": "^3.1.1", @@ -9550,15 +9780,19 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -9596,12 +9830,13 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" }, "engines": { "node": ">= 0.4" @@ -9611,15 +9846,15 @@ } }, "node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", + "jackspeak": "^2.3.6", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -9841,20 +10076,20 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dependencies": { - "get-intrinsic": "^1.2.2" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "engines": { "node": ">= 0.4" }, @@ -9874,11 +10109,11 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -9888,9 +10123,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -9969,9 +10204,9 @@ } }, "node_modules/html-entities": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", - "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", "funding": [ { "type": "github", @@ -10240,9 +10475,9 @@ } }, "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "engines": { "node": ">= 4" } @@ -10333,11 +10568,11 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/internal-slot": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", - "integrity": "sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dependencies": { - "get-intrinsic": "^1.2.2", + "es-errors": "^1.3.0", "hasown": "^2.0.0", "side-channel": "^1.0.4" }, @@ -10377,13 +10612,15 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -10467,6 +10704,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -10556,9 +10807,12 @@ } }, "node_modules/is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10569,9 +10823,9 @@ "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==" }, "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "engines": { "node": ">= 0.4" }, @@ -10665,19 +10919,25 @@ } }, "node_modules/is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -10723,11 +10983,11 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dependencies": { - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -10742,9 +11002,12 @@ "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, "node_modules/is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10761,12 +11024,15 @@ } }, "node_modules/is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", + "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -10886,9 +11152,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -12455,11 +12721,12 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "2.7.7", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.7.tgz", - "integrity": "sha512-+0n11YGyRavUR3IlaOzJ0/4Il1avMvJ1VJfhWfCn24ITQXhRr1gghbhhrda6tgtNcpZaWKdSuwKq20Jb7fnlyw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.8.1.tgz", + "integrity": "sha512-/1HDlyFRxWIZPI1ZpgqlZ8jMw/1Dp/dl3P0L1jtZ+zVcHqwPhGwaJwKL00WVgfnBy6PWCde9W65or7IIETImuA==", "dependencies": { - "schema-utils": "^4.0.0" + "schema-utils": "^4.0.0", + "tapable": "^2.2.1" }, "engines": { "node": ">= 12.13.0" @@ -12527,9 +12794,9 @@ "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -12764,12 +13031,12 @@ } }, "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -12804,26 +13071,27 @@ } }, "node_modules/object.entries": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz", - "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -12833,15 +13101,17 @@ } }, "node_modules/object.getownpropertydescriptors": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.7.tgz", - "integrity": "sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.8.tgz", + "integrity": "sha512-qkHIGe4q0lSYMv0XI4SsBTJz3WaURhLvd0lKSgtVuOsJ2krg4SgMw3PIRQFMp07yi++UR3se2mkcLqsBNpBb/A==", "dependencies": { "array.prototype.reduce": "^1.0.6", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "safe-array-concat": "^1.0.0" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "gopd": "^1.0.1", + "safe-array-concat": "^1.1.2" }, "engines": { "node": ">= 0.8" @@ -12851,36 +13121,42 @@ } }, "node_modules/object.groupby": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", - "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.hasown": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", - "integrity": "sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.4.tgz", + "integrity": "sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==", "dependencies": { - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -13104,11 +13380,11 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { @@ -13318,10 +13594,18 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { - "version": "8.4.33", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", - "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "funding": [ { "type": "opencollective", @@ -13339,7 +13623,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -13809,17 +14093,23 @@ } }, "node_modules/postcss-load-config/node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz", + "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==", "engines": { "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/postcss-load-config/node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", + "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } @@ -14413,9 +14703,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", - "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", + "version": "6.0.16", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", + "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -14714,9 +15004,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -14886,9 +15176,9 @@ } }, "node_modules/react-remove-scroll-bar": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz", - "integrity": "sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.6.tgz", + "integrity": "sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g==", "dependencies": { "react-style-singleton": "^2.2.1", "tslib": "^2.0.0" @@ -15076,14 +15366,15 @@ } }, "node_modules/reflect.getprototypeof": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz", - "integrity": "sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", + "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", "globalthis": "^1.0.3", "which-builtin-type": "^1.1.3" }, @@ -15129,13 +15420,14 @@ "integrity": "sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg==" }, "node_modules/regexp.prototype.flags": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", - "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "set-function-name": "^2.0.0" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -15470,12 +15762,12 @@ } }, "node_modules/safe-array-concat": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", - "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dependencies": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -15506,12 +15798,12 @@ ] }, "node_modules/safe-regex-test": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.2.tgz", - "integrity": "sha512-83S9w6eFq12BBIJYvjMux6/dkirb8+4zJRA9cxNBVb7Wq5fJBW+Xze48WqR8pxua7bDuAaaAxtVVd4Idjp1dBQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dependencies": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", "is-regex": "^1.1.4" }, "engines": { @@ -15627,9 +15919,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -15785,28 +16077,30 @@ } }, "node_modules/set-function-length": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", - "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dependencies": { - "define-data-property": "^1.1.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.2", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/set-function-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", - "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dependencies": { - "define-data-property": "^1.0.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -15845,13 +16139,17 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -15913,9 +16211,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "engines": { "node": ">=0.10.0" } @@ -16246,32 +16544,39 @@ } }, "node_modules/string.prototype.matchall": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", - "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", + "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "regexp.prototype.flags": "^1.5.0", - "set-function-name": "^2.0.0", - "side-channel": "^1.0.4" + "internal-slot": "^1.0.7", + "regexp.prototype.flags": "^1.5.2", + "set-function-name": "^2.0.2", + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -16281,26 +16586,29 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -16676,9 +16984,9 @@ "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==" }, "node_modules/tailwindcss": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", - "integrity": "sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz", + "integrity": "sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", @@ -16688,7 +16996,7 @@ "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.19.1", + "jiti": "^1.21.0", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", @@ -16782,9 +17090,9 @@ } }, "node_modules/terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.0.tgz", + "integrity": "sha512-Y/SblUl5kEyEFzhMAQdsxVHh+utAxd4IuRNJzKywY/4uzSogh3G219jqbDDxYu4MXO9CzY3tSEqmZvW6AoEDJw==", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -17106,27 +17414,28 @@ } }, "node_modules/typed-array-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", - "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", - "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -17136,15 +17445,16 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", - "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -17154,13 +17464,19 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -17341,9 +17657,9 @@ } }, "node_modules/use-callback-ref": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.1.tgz", - "integrity": "sha512-Lg4Vx1XZQauB42Hw3kK7JM6yjVjgFmFC5/Ab797s79aARomD2nEErc4mCgM8EZrARLmmbWpi5DGCadmK50DcAQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.2.tgz", + "integrity": "sha512-elOQwe6Q8gqZgDA8mrh44qRTQqpIHDcZ3hXTLjBe1i4ph8XpNJnO+aQf3NaG+lriLopI4HMx9VjQLfPQ6vhnoA==", "dependencies": { "tslib": "^2.0.0" }, @@ -17381,14 +17697,6 @@ } } }, - "node_modules/use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -17496,9 +17804,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", + "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -17529,25 +17837,25 @@ } }, "node_modules/webpack": { - "version": "5.90.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.0.tgz", - "integrity": "sha512-bdmyXRCXeeNIePv6R6tGPyy20aUobw4Zy8r0LUS2EWO+U+Ke/gYDgsCh7bl5rB6jPpr4r0SZa6dPxBxLooDT3w==", + "version": "5.91.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", + "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", "acorn-import-assertions": "^1.9.0", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.16.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", @@ -17555,7 +17863,7 @@ "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.0", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -17575,9 +17883,9 @@ } }, "node_modules/webpack-dev-middleware": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz", - "integrity": "sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==", + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz", + "integrity": "sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==", "dependencies": { "colorette": "^2.0.10", "memfs": "^3.4.3", @@ -17646,9 +17954,9 @@ } }, "node_modules/webpack-dev-server": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.1.tgz", - "integrity": "sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA==", + "version": "4.15.2", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz", + "integrity": "sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==", "dependencies": { "@types/bonjour": "^3.5.9", "@types/connect-history-api-fallback": "^1.3.5", @@ -17678,7 +17986,7 @@ "serve-index": "^1.9.1", "sockjs": "^0.3.24", "spdy": "^4.0.2", - "webpack-dev-middleware": "^5.3.1", + "webpack-dev-middleware": "^5.3.4", "ws": "^8.13.0" }, "bin": { @@ -17946,29 +18254,32 @@ } }, "node_modules/which-collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dependencies": { - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-weakmap": "^2.0.1", - "is-weakset": "^2.0.1" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", - "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -18204,6 +18515,7 @@ "version": "6.6.0", "resolved": "https://registry.npmjs.org/workbox-google-analytics/-/workbox-google-analytics-6.6.0.tgz", "integrity": "sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==", + "deprecated": "It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained", "dependencies": { "workbox-background-sync": "6.6.0", "workbox-core": "6.6.0", diff --git a/docs/guides/examples/quickstart/frontend/package.json b/docs/guides/examples/quickstart/frontend/package.json index 530b3e5b..2fb14524 100644 --- a/docs/guides/examples/quickstart/frontend/package.json +++ b/docs/guides/examples/quickstart/frontend/package.json @@ -3,8 +3,10 @@ "version": "0.1.0", "private": true, "dependencies": { - "@fuel-wallet/react": "^0.15.2", - "@fuel-wallet/sdk": "^0.15.2", + "@fuels/connectors": "^0.1.1", + "@fuels/react": "^0.18.0", + "@tanstack/react-query": "^5.28.9", + "@tanstack/react-query-devtools": "^5.28.10", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -12,7 +14,7 @@ "@types/node": "^16.18.8", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", - "fuels": "^0.73.0", + "fuels": "^0.79.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", diff --git a/docs/guides/examples/quickstart/frontend/src/App.tsx b/docs/guides/examples/quickstart/frontend/src/App.tsx index f5678a16..7b192c96 100644 --- a/docs/guides/examples/quickstart/frontend/src/App.tsx +++ b/docs/guides/examples/quickstart/frontend/src/App.tsx @@ -2,26 +2,23 @@ import { useEffect, useState } from "react"; import { useConnectUI, useIsConnected, - useWallet, -} from '@fuel-wallet/react'; + useWallet +} from '@fuels/react'; // Import the contract factory -- you can find the name in src/contracts/contracts/index.ts. // You can also do command + space and the compiler will suggest the correct name. import { CounterContractAbi__factory } from "./sway-api" import type { CounterContractAbi } from "./sway-api"; const CONTRACT_ID = - "0x..."; + "0xf2402a4c375550abc8c781bb59761135f88799dcfa81862f8233dfe234894dfe"; export default function Home() { const [contract, setContract] = useState(); const [counter, setCounter] = useState(); - const { connect, setTheme, isConnecting } = - useConnectUI(); + const { connect, isConnecting } = useConnectUI(); const { isConnected } = useIsConnected(); const { wallet } = useWallet(); - setTheme("dark"); - useEffect(() => { async function getInitialCount(){ if(isConnected && wallet){ @@ -42,7 +39,7 @@ export default function Home() { gasPrice: 1, gasLimit: 100_000, }) - .simulate(); + .get(); setCounter(value.toNumber()); } catch(error) { console.error(error); diff --git a/docs/guides/examples/quickstart/frontend/src/index.tsx b/docs/guides/examples/quickstart/frontend/src/index.tsx index 78749875..f8ba711d 100644 --- a/docs/guides/examples/quickstart/frontend/src/index.tsx +++ b/docs/guides/examples/quickstart/frontend/src/index.tsx @@ -3,20 +3,34 @@ import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; -import { FuelProvider } from '@fuel-wallet/react'; +import { FuelProvider } from '@fuels/react'; +import { + FuelWalletConnector, + FuelWalletDevelopmentConnector, + FueletWalletConnector, +} from '@fuels/connectors'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; + +const queryClient = new QueryClient(); const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); root.render( - + - + + ); diff --git a/src/components/SidebarSection.tsx b/src/components/SidebarSection.tsx index 33536dd4..67a08285 100644 --- a/src/components/SidebarSection.tsx +++ b/src/components/SidebarSection.tsx @@ -140,8 +140,14 @@ const styles = { pl: '$4', mb: '$8', color: '$semanticLinkBaseColor !important', + '.fuel_Icon': { + color: '$semanticLinkBaseColor !important', + }, 'html[class="fuel_light-theme"] &': { color: '$intentsBase12 !important', + '.fuel_Icon': { + color: '$intentsBase12 !important', + }, }, '[aria-label*="Icon Link"]': { display: 'none', From f85717968bc37cf21d8a72d464e42981ec37eb75 Mon Sep 17 00:00:00 2001 From: sarahschwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:16:17 -0600 Subject: [PATCH 05/24] update quickstart --- .../docs/intro-to-sway/typescript-sdk.mdx | 4 +-- .../docs/quickstart/building-a-frontend.mdx | 29 ++++++++----------- .../quickstart/frontend/package-lock.json | 26 ----------------- .../examples/quickstart/frontend/package.json | 1 - .../examples/quickstart/frontend/src/App.tsx | 2 +- .../quickstart/frontend/src/index.tsx | 2 +- 6 files changed, 16 insertions(+), 48 deletions(-) diff --git a/docs/guides/docs/intro-to-sway/typescript-sdk.mdx b/docs/guides/docs/intro-to-sway/typescript-sdk.mdx index e4af93ae..d9a653cf 100644 --- a/docs/guides/docs/intro-to-sway/typescript-sdk.mdx +++ b/docs/guides/docs/intro-to-sway/typescript-sdk.mdx @@ -30,7 +30,7 @@ Let's go into the frontend folder: cd frontend ``` -Next, install the `fuels` TypeScript and wallet SDKs in the frontend folder: +Next, install the following packages in your `frontend` folder: ```sh -npm install fuels@0.73.0 @fuel-wallet/sdk@0.16.1 @fuel-wallet/react@0.16.1 +npm install fuels@0.79.0 @fuels/react@0.18.0 @fuels/connectors@0.1.1 @tanstack/react-query@5.28.9 ``` ## Generate contract types diff --git a/docs/guides/docs/quickstart/building-a-frontend.mdx b/docs/guides/docs/quickstart/building-a-frontend.mdx index a0f7a1ef..9908a556 100644 --- a/docs/guides/docs/quickstart/building-a-frontend.mdx +++ b/docs/guides/docs/quickstart/building-a-frontend.mdx @@ -96,13 +96,7 @@ cd frontend > `fuels` requires Node version {props.nodeVersion}. - -Install `fuels`, `@fuel-wallet/sdk`, and `@fuel-wallet/react`. - - - -Install `fuels` and `@fuel-wallet/sdk`. - +Install the following packages in your `frontend` folder: ```sh -npm install fuels@0.73.0 @fuel-wallet/sdk@0.16.1 @fuel-wallet/react@0.16.1 +npm install fuels@0.79.0 @fuels/react@0.18.0 @fuels/connectors@0.1.1 @tanstack/react-query@5.28.9 ``` @@ -239,11 +233,9 @@ Now you should be able to find a new folder `fuel-project/frontend/src/contracts Inside the `frontend/src` folder let's add code that interacts with our contract. -Because we'll be using `@fuel-wallet/react`, first we need to wrap our app with the `FuelProvider` component. -Modify the file `fuel-project/frontend/src/index.tsx` so that the `App` component is wrapped with the `FuelProvider` component. +Because we'll be using `@fuels/react`, first we need to wrap our app with the `FuelProvider` component. -For development purposes `devMode` is also enabled here. -This allows users to connect with the Fuel Development Wallet as well. +Add the imports below to the top of your `frontend/src/index.tsx` file and setup a query client: + +Next, modify your `frontend/src/index.tsx` file to wrap the `App` component with the `FuelProvider` and `QueryClientProvider` components. + diff --git a/docs/guides/examples/quickstart/frontend/package-lock.json b/docs/guides/examples/quickstart/frontend/package-lock.json index aa17e4cc..f4b58fb5 100644 --- a/docs/guides/examples/quickstart/frontend/package-lock.json +++ b/docs/guides/examples/quickstart/frontend/package-lock.json @@ -11,7 +11,6 @@ "@fuels/connectors": "^0.1.1", "@fuels/react": "^0.18.0", "@tanstack/react-query": "^5.28.9", - "@tanstack/react-query-devtools": "^5.28.10", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -4576,15 +4575,6 @@ "url": "https://github.com/sponsors/tannerlinsley" } }, - "node_modules/@tanstack/query-devtools": { - "version": "5.28.10", - "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.28.10.tgz", - "integrity": "sha512-5UN629fKa5/1K/2Pd26gaU7epxRrYiT1gy+V+pW5K6hnf1DeUKK3pANSb2eHKlecjIKIhTwyF7k9XdyE2gREvQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - } - }, "node_modules/@tanstack/react-query": { "version": "5.28.9", "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.28.9.tgz", @@ -4600,22 +4590,6 @@ "react": "^18.0.0" } }, - "node_modules/@tanstack/react-query-devtools": { - "version": "5.28.10", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.28.10.tgz", - "integrity": "sha512-D+SiHZTWhK2sNgBYj+xIvUOqonsKy74OLU/YHmRB5OZVLLTiekvZd12C3rKlU+WM69jid0hjEjuFqkULOMwc3A==", - "dependencies": { - "@tanstack/query-devtools": "5.28.10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "peerDependencies": { - "@tanstack/react-query": "^5.28.9", - "react": "^18.0.0" - } - }, "node_modules/@testing-library/dom": { "version": "9.3.4", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", diff --git a/docs/guides/examples/quickstart/frontend/package.json b/docs/guides/examples/quickstart/frontend/package.json index 2fb14524..9a380040 100644 --- a/docs/guides/examples/quickstart/frontend/package.json +++ b/docs/guides/examples/quickstart/frontend/package.json @@ -6,7 +6,6 @@ "@fuels/connectors": "^0.1.1", "@fuels/react": "^0.18.0", "@tanstack/react-query": "^5.28.9", - "@tanstack/react-query-devtools": "^5.28.10", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", diff --git a/docs/guides/examples/quickstart/frontend/src/App.tsx b/docs/guides/examples/quickstart/frontend/src/App.tsx index 7b192c96..2babedbb 100644 --- a/docs/guides/examples/quickstart/frontend/src/App.tsx +++ b/docs/guides/examples/quickstart/frontend/src/App.tsx @@ -10,7 +10,7 @@ import { CounterContractAbi__factory } from "./sway-api" import type { CounterContractAbi } from "./sway-api"; const CONTRACT_ID = - "0xf2402a4c375550abc8c781bb59761135f88799dcfa81862f8233dfe234894dfe"; + "0x..."; export default function Home() { const [contract, setContract] = useState(); diff --git a/docs/guides/examples/quickstart/frontend/src/index.tsx b/docs/guides/examples/quickstart/frontend/src/index.tsx index f8ba711d..a527d026 100644 --- a/docs/guides/examples/quickstart/frontend/src/index.tsx +++ b/docs/guides/examples/quickstart/frontend/src/index.tsx @@ -28,7 +28,7 @@ root.render( ], }} > - + From e8408790f14b18b6abaac2420bbe540e71dc8790 Mon Sep 17 00:00:00 2001 From: sarahschwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:10:18 -0600 Subject: [PATCH 06/24] fixes --- .../fuels.config.explicit-built-in.ts | 10 ++ .../fuels.config.explicit-system.ts | 10 ++ .../apps/demo-fuels/fuels.config.full.ts | 114 +++++++++++++++++ .../fuels-ts/apps/demo-fuels/fuels.config.ts | 13 ++ .../apps/demo-fuels/src/index.test.ts | 115 ++++++++++++++++++ scripts/generate-links/getDocs.mjs | 4 + src/lib/plugins/mdbook-example-import.ts | 6 +- 7 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-built-in.ts create mode 100644 docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-system.ts create mode 100644 docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.full.ts create mode 100644 docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.ts create mode 100644 docs/beta-4/fuels-ts/apps/demo-fuels/src/index.test.ts diff --git a/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-built-in.ts b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-built-in.ts new file mode 100644 index 00000000..8c0cc48b --- /dev/null +++ b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-built-in.ts @@ -0,0 +1,10 @@ +import { createConfig } from 'fuels'; + +// #region config-built-in +export default createConfig({ + workspace: './sway-programs', + output: './src/sway-programs-api', + useBuiltinForc: true, + useBuiltinFuelCore: true, +}); +// #endregion config-built-in diff --git a/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-system.ts b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-system.ts new file mode 100644 index 00000000..12294eea --- /dev/null +++ b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.explicit-system.ts @@ -0,0 +1,10 @@ +import { createConfig } from 'fuels'; + +// #region config-system +export default createConfig({ + workspace: './sway-programs', + output: './src/sway-programs-api', + useBuiltinForc: false, + useBuiltinFuelCore: false, +}); +// #endregion config-system diff --git a/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.full.ts b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.full.ts new file mode 100644 index 00000000..91488177 --- /dev/null +++ b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.full.ts @@ -0,0 +1,114 @@ +/* eslint-disable no-console */ +import { createConfig } from 'fuels'; +import type { CommandEvent, ContractDeployOptions, FuelsConfig } from 'fuels/src/cli/types'; + +const MY_FIRST_DEPLOYED_CONTRACT_NAME = ''; + +export default createConfig({ + // #region workspace + workspace: './sway-programs', + // #endregion workspace + + // #region contracts + contracts: ['./sway-programs/contracts'], + // #endregion contracts + + // #region predicates + predicates: ['./sway-programs/predicates'], + // #endregion predicates + + // #region scripts + scripts: ['./sway-programs/scripts'], + // #endregion scripts + + // #region output + output: './src/sway-programs-api', + // #endregion output + + // #region privateKey + privateKey: '0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298', + // #endregion privateKey + + // #region providerUrl + // Default: http://127.0.0.1:4000/graphql + providerUrl: 'http://network:port/graphql', + // #endregion providerUrl + + // #region chainConfig + chainConfig: './my/custom/chainConfig.json', + // #endregion chainConfig + + // #region autoStartFuelCore + autoStartFuelCore: true, + // #endregion autoStartFuelCore + + // #region fuelCorePort + // Default: first free port, starting from 4000 + fuelCorePort: 4000, + // #endregion fuelCorePort + + // #region deployConfig-fn + deployConfig: async (options: ContractDeployOptions) => { + // ability to fetch data remotely + await Promise.resolve(`simulating remote data fetch`); + + // get contract by name + const { contracts } = options; + + const contract = contracts.find(({ name }) => { + const found = name === MY_FIRST_DEPLOYED_CONTRACT_NAME; + return found; + }); + + if (!contract) { + throw new Error('Contract not found!'); + } + + return { + gasPrice: 1, + storageSlots: [ + { + key: '0x..', + /** + * Here we could initialize a storage slot, + * using the relevant contract ID. + */ + value: contract.contractId, + }, + ], + }; + }, + // #endregion deployConfig-fn + + // #region onSuccess + onSuccess: (event: CommandEvent, config: FuelsConfig) => { + console.log('fuels:onSuccess', { event, config }); + }, + // #endregion onSuccess + + // #region onFailure + onFailure: (error: Error, config: FuelsConfig) => { + console.log('fuels:onFailure', { error, config }); + }, + // #endregion onFailure + + // #region useBuiltInForc + // Default: undefined + useBuiltinForc: false, + // #endregion useBuiltInForc + + // #region useBuiltInFuelCore + // Default: undefined + useBuiltinFuelCore: false, + // #endregion useBuiltInFuelCore +}); + +export const simpleDeployConfig = createConfig({ + workspace: './sway-programs', + output: './src/sway-programs-api', + // #region deployConfig-obj + deployConfig: { + gasPrice: 1, + }, + // #endregion deployConfig-obj +}); diff --git a/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.ts b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.ts new file mode 100644 index 00000000..903894a4 --- /dev/null +++ b/docs/beta-4/fuels-ts/apps/demo-fuels/fuels.config.ts @@ -0,0 +1,13 @@ +// #region config +import { createConfig } from 'fuels'; + +export default createConfig({ + workspace: './sway-programs', // forc workspace + output: './src/sway-programs-api', +}); +// #endregion config + +/** + * Check the docs: + * https://fuellabs.github.io/fuels-ts/guide/cli/config-file + */ diff --git a/docs/beta-4/fuels-ts/apps/demo-fuels/src/index.test.ts b/docs/beta-4/fuels-ts/apps/demo-fuels/src/index.test.ts new file mode 100644 index 00000000..4b4351d8 --- /dev/null +++ b/docs/beta-4/fuels-ts/apps/demo-fuels/src/index.test.ts @@ -0,0 +1,115 @@ +/** + * NOTE: These tests are a copy of the ones at: + * - /apps/demo-typegen/src/index.test.ts + * + * It ensures that built code is fully working. + */ + +import { safeExec } from '@fuel-ts/errors/test-utils'; +import { generateTestWallet } from '@fuel-ts/wallet/test-utils'; +import type { BN } from 'fuels'; +import { ContractFactory, Provider, toHex, BaseAssetId, Wallet, FUEL_NETWORK_URL } from 'fuels'; + +import { SampleAbi__factory } from './sway-programs-api'; +import bytecode from './sway-programs-api/contracts/SampleAbi.hex'; + +let gasPrice: BN; +describe('ExampleContract', () => { + beforeAll(async () => { + const provider = await Provider.create(FUEL_NETWORK_URL); + ({ minGasPrice: gasPrice } = provider.getGasConfig()); + }); + + it('should return the input', async () => { + const provider = await Provider.create(FUEL_NETWORK_URL); + const wallet = await generateTestWallet(provider, [[500_000, BaseAssetId]]); + + // Deploy + const factory = new ContractFactory(bytecode, SampleAbi__factory.abi, wallet); + const contract = await factory.deployContract({ gasPrice }); + + // Call + const { value } = await contract.functions.return_input(1337).txParams({ gasPrice }).call(); + + // Assert + expect(value.toHex()).toEqual(toHex(1337)); + + // You can also make a call using the factory + const contractInstance = SampleAbi__factory.connect(contract.id, wallet); + const { value: v2 } = await contractInstance.functions + .return_input(1337) + .txParams({ gasPrice }) + .call(); + expect(v2.toHex()).toBe(toHex(1337)); + }); + + it('deployContract method', async () => { + const provider = await Provider.create(FUEL_NETWORK_URL); + const wallet = await generateTestWallet(provider, [[500_000, BaseAssetId]]); + + // Deploy + const contract = await SampleAbi__factory.deployContract(bytecode, wallet, { gasPrice }); + + // Call + const { value } = await contract.functions.return_input(1337).txParams({ gasPrice }).call(); + + // Assert + expect(value.toHex()).toEqual(toHex(1337)); + }); + + it('should throw when simulating via contract factory with wallet with no resources', async () => { + const provider = await Provider.create(FUEL_NETWORK_URL); + const fundedWallet = await generateTestWallet(provider, [[500_000, BaseAssetId]]); + const unfundedWallet = Wallet.generate({ provider }); + + const factory = new ContractFactory(bytecode, SampleAbi__factory.abi, fundedWallet); + const contract = await factory.deployContract({ gasPrice }); + const contractInstance = SampleAbi__factory.connect(contract.id, unfundedWallet); + + const { error } = await safeExec(() => + contractInstance.functions.return_input(1337).simulate() + ); + + expect((error).message).toMatch('not enough coins to fit the target'); + }); + + it('should throw when dry running via contract factory with wallet with no resources', async () => { + const provider = await Provider.create(FUEL_NETWORK_URL); + const fundedWallet = await generateTestWallet(provider, [[500_000, BaseAssetId]]); + const unfundedWallet = Wallet.generate({ provider }); + + const factory = new ContractFactory(bytecode, SampleAbi__factory.abi, fundedWallet); + const contract = await factory.deployContract({ gasPrice }); + const contractInstance = SampleAbi__factory.connect(contract.id, unfundedWallet); + + const { error } = await safeExec(() => contractInstance.functions.return_input(1337).dryRun()); + + expect((error).message).toMatch('not enough coins to fit the target'); + }); + + it('should demo how to use generated files just fine', async () => { + const provider = await Provider.create(FUEL_NETWORK_URL); + const wallet = await generateTestWallet(provider, [[500_000, BaseAssetId]]); + const depoloyed = await SampleAbi__factory.deployContract(bytecode, wallet, { gasPrice }); + const contractsIds = { + sample: depoloyed.id, + }; + + // #region using-generated-files + // #context import { SampleAbi__factory } from './sway-programs-api'; + // #context import contractsIds from './sway-programs-api/contract-ids.json'; + + // #context /** + // #context * Get IDs using: + // #context * contractsIds. + // #context */ + + // #context const wallet = new Wallet.fromPrivateKey(process.env.PRIVATE_KEY); + const contract = SampleAbi__factory.connect(contractsIds.sample, wallet); + + const { value } = await contract.functions.return_input(1337).dryRun(); + + expect(value.toHex()).toEqual(toHex(1337)); + // #endregion using-generated-files + }); +}); diff --git a/scripts/generate-links/getDocs.mjs b/scripts/generate-links/getDocs.mjs index 87e05624..474cf06f 100644 --- a/scripts/generate-links/getDocs.mjs +++ b/scripts/generate-links/getDocs.mjs @@ -328,6 +328,10 @@ export function getDocBySlug(slug, slugs) { doc.category = `API-${doc.category}`; } + if (slugPath.slug.includes('beta-4/fuels-ts/cli/built-in-binaries.md')) { + doc.category = 'cli'; + } + return { ...doc, }; diff --git a/src/lib/plugins/mdbook-example-import.ts b/src/lib/plugins/mdbook-example-import.ts index e8ed78c5..1129ce99 100644 --- a/src/lib/plugins/mdbook-example-import.ts +++ b/src/lib/plugins/mdbook-example-import.ts @@ -148,7 +148,11 @@ export function handleExampleImports( content = extractCommentBlock(fileContent, exampleName); } catch (err) { - // console.error('ERROR:', err); + console.error('ERROR GETTING EXAMPLE CODE:', err); + } + + if (!content) { + throw new Error(`${fileAbsPath} not found`); } return content; From a7be2f2ac42fe90d827df726d7b887230b698ebc Mon Sep 17 00:00:00 2001 From: sarahschwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:52:15 -0600 Subject: [PATCH 07/24] lint, add missing code examples --- .../packages/fuels-accounts/Cargo.toml | 40 + .../fuels-accounts/src/accounts_utils.rs | 79 + .../packages/fuels-accounts/src/lib.rs | 422 ++++ .../packages/fuels-accounts/src/predicate.rs | 163 ++ .../packages/fuels-accounts/src/provider.rs | 617 +++++ .../packages/fuels-accounts/src/wallet.rs | 416 ++++ .../fuels-rs/packages/fuels-core/Cargo.toml | 39 + .../fuels-rs/packages/fuels-core/src/codec.rs | 73 + .../fuels-core/src/codec/abi_decoder.rs | 810 +++++++ .../fuels-core/src/codec/abi_encoder.rs | 1203 ++++++++++ .../fuels-core/src/codec/function_selector.rs | 264 +++ .../fuels-rs/packages/fuels-core/src/lib.rs | 24 + .../packages/fuels-core/src/traits.rs | 5 + .../fuels-core/src/traits/parameterize.rs | 222 ++ .../fuels-core/src/traits/tokenizable.rs | 623 +++++ .../fuels-rs/packages/fuels-core/src/types.rs | 139 ++ .../packages/fuels-core/src/types/bech32.rs | 240 ++ .../packages/fuels-core/src/types/core.rs | 13 + .../fuels-core/src/types/core/bits.rs | 165 ++ .../fuels-core/src/types/core/bytes.rs | 20 + .../fuels-core/src/types/core/identity.rs | 28 + .../fuels-core/src/types/core/raw_slice.rs | 22 + .../src/types/core/sized_ascii_string.rs | 302 +++ .../fuels-core/src/types/core/u256.rs | 76 + .../fuels-core/src/types/enum_variants.rs | 66 + .../packages/fuels-core/src/types/errors.rs | 66 + .../fuels-core/src/types/param_types.rs | 1507 +++++++++++++ .../src/types/transaction_builders.rs | 740 ++++++ .../fuels-core/src/types/unresolved_bytes.rs | 89 + .../packages/fuels-core/src/types/wrappers.rs | 13 + .../fuels-core/src/types/wrappers/block.rs | 58 + .../src/types/wrappers/chain_info.rs | 28 + .../fuels-core/src/types/wrappers/coin.rs | 56 + .../src/types/wrappers/coin_type.rs | 53 + .../fuels-core/src/types/wrappers/input.rs | 93 + .../fuels-core/src/types/wrappers/message.rs | 80 + .../src/types/wrappers/message_proof.rs | 60 + .../src/types/wrappers/node_info.rs | 26 + .../src/types/wrappers/transaction.rs | 372 +++ .../types/wrappers/transaction_response.rs | 76 + .../fuels-rs/packages/fuels-core/src/utils.rs | 2 + .../fuels-core/src/utils/constants.rs | 19 + .../packages/fuels-core/src/utils/offsets.rs | 70 + .../packages/fuels-programs/Cargo.toml | 39 + .../fuels-programs/src/call_response.rs | 58 + .../packages/fuels-programs/src/call_utils.rs | 889 ++++++++ .../packages/fuels-programs/src/contract.rs | 1056 +++++++++ .../packages/fuels-programs/src/lib.rs | 6 + .../packages/fuels-programs/src/logs.rs | 234 ++ .../fuels-programs/src/receipt_parser.rs | 324 +++ .../fuels-programs/src/script_calls.rs | 322 +++ .../fuels-rs/packages/fuels/tests/bindings.rs | 910 ++++++++ .../sharing_types/contract_a/Forc.toml | 8 + .../sharing_types/contract_a/src/main.sw | 41 + .../sharing_types/contract_b/Forc.toml | 8 + .../sharing_types/contract_b/src/main.sw | 41 + .../sharing_types/shared_lib/Forc.toml | 5 + .../sharing_types/shared_lib/src/lib.sw | 16 + .../tests/bindings/simple_contract/Forc.toml | 5 + .../bindings/simple_contract/src/main.sw | 11 + .../fuels/tests/bindings/type_paths/Forc.toml | 5 + .../bindings/type_paths/src/another_lib.sw | 5 + .../type_paths/src/contract_a_types.sw | 9 + .../tests/bindings/type_paths/src/main.sw | 17 + .../packages/fuels/tests/configurables.rs | 170 ++ .../packages/fuels/tests/contracts.rs | 1609 +++++++++++++ .../fuels/tests/contracts/asserts/Forc.toml | 5 + .../fuels/tests/contracts/asserts/src/main.sw | 53 + .../contracts/auth_testing_abi/Forc.toml | 5 + .../contracts/auth_testing_abi/src/main.sw | 6 + .../contracts/auth_testing_contract/Forc.toml | 8 + .../auth_testing_contract/src/main.sw | 28 + .../tests/contracts/block_timestamp/Forc.toml | 5 + .../contracts/block_timestamp/src/main.sw | 13 + .../tests/contracts/configurables/Forc.toml | 5 + .../tests/contracts/configurables/src/main.sw | 34 + .../tests/contracts/contract_test/Forc.toml | 8 + .../tests/contracts/contract_test/src/main.sw | 138 ++ .../contracts/large_return_data/Forc.toml | 5 + .../contracts/large_return_data/src/main.sw | 57 + .../tests/contracts/lib_contract/Forc.toml | 8 + .../tests/contracts/lib_contract/src/main.sw | 13 + .../contracts/lib_contract_abi/Forc.toml | 5 + .../contracts/lib_contract_abi/src/main.sw | 6 + .../contracts/lib_contract_caller/Forc.toml | 8 + .../contracts/lib_contract_caller/src/main.sw | 44 + .../tests/contracts/library_test/Forc.toml | 5 + .../tests/contracts/library_test/src/main.sw | 6 + .../tests/contracts/liquidity_pool/Forc.toml | 5 + .../contracts/liquidity_pool/src/main.sw | 48 + .../contracts/low_level_caller/Forc.toml | 5 + .../contracts/low_level_caller/src/main.sw | 28 + .../tests/contracts/msg_amount/Forc.toml | 5 + .../tests/contracts/msg_amount/src/main.sw | 13 + .../contracts/multiple_read_calls/Forc.toml | 5 + .../contracts/multiple_read_calls/src/main.sw | 24 + .../contracts/payable_annotation/Forc.toml | 5 + .../contracts/payable_annotation/src/main.sw | 18 + .../fuels/tests/contracts/require/Forc.toml | 5 + .../fuels/tests/contracts/require/src/main.sw | 60 + .../revert_transaction_error/Forc.toml | 5 + .../revert_transaction_error/src/main.sw | 12 + .../fuels/tests/contracts/storage/Forc.toml | 5 + .../fuels/tests/contracts/storage/src/main.sw | 35 + .../fuels/tests/contracts/token_ops/Forc.toml | 5 + .../tests/contracts/token_ops/src/main.sw | 60 + .../transaction_block_height/Forc.toml | 5 + .../transaction_block_height/src/main.sw | 14 + .../packages/fuels/tests/from_token.rs | 218 ++ .../fuels-rs/packages/fuels/tests/imports.rs | 9 + .../fuels-rs/packages/fuels/tests/logs.rs | 1297 +++++++++++ .../fuels/tests/logs/contract_logs/Forc.toml | 8 + .../tests/logs/contract_logs/src/main.sw | 140 ++ .../tests/logs/contract_logs_abi/Forc.toml | 5 + .../tests/logs/contract_logs_abi/src/main.sw | 12 + .../contract_with_contract_logs/Forc.toml | 8 + .../contract_with_contract_logs/src/main.sw | 16 + .../fuels/tests/logs/script_logs/Forc.toml | 5 + .../fuels/tests/logs/script_logs/src/main.sw | 82 + .../logs/script_with_contract_logs/Forc.toml | 8 + .../script_with_contract_logs/src/main.sw | 19 + .../packages/fuels/tests/predicates.rs | 765 +++++++ .../predicates/basic_predicate/Forc.toml | 5 + .../predicates/basic_predicate/src/main.sw | 5 + .../predicate_configurables/Forc.toml | 5 + .../predicate_configurables/src/main.sw | 49 + .../tests/predicates/signatures/Forc.toml | 5 + .../tests/predicates/signatures/src/main.sw | 29 + .../packages/fuels/tests/providers.rs | 823 +++++++ .../fuels-rs/packages/fuels/tests/scripts.rs | 384 ++++ .../fuels/tests/scripts/arguments/Forc.toml | 5 + .../fuels/tests/scripts/arguments/src/main.sw | 15 + .../tests/scripts/basic_script/Forc.toml | 5 + .../tests/scripts/basic_script/src/main.sw | 11 + .../scripts/require_from_contract/Forc.toml | 8 + .../scripts/require_from_contract/src/main.sw | 8 + .../tests/scripts/script_array/Forc.toml | 5 + .../tests/scripts/script_array/src/main.sw | 5 + .../tests/scripts/script_asserts/Forc.toml | 5 + .../tests/scripts/script_asserts/src/main.sw | 50 + .../fuels/tests/scripts/script_b256/Forc.toml | 5 + .../tests/scripts/script_b256/src/main.sw | 6 + .../scripts/script_configurables/Forc.toml | 5 + .../scripts/script_configurables/src/main.sw | 29 + .../fuels/tests/scripts/script_enum/Forc.toml | 5 + .../tests/scripts/script_enum/src/main.sw | 16 + .../tests/scripts/script_require/Forc.toml | 5 + .../tests/scripts/script_require/src/main.sw | 55 + .../tests/scripts/script_struct/Forc.toml | 5 + .../tests/scripts/script_struct/src/main.sw | 14 + .../tests/scripts/transfer_script/Forc.toml | 5 + .../tests/scripts/transfer_script/src/main.sw | 7 + .../fuels-rs/packages/fuels/tests/storage.rs | 108 + .../tests/types/contracts/b512/Forc.toml | 5 + .../tests/types/contracts/b512/src/main.sw | 24 + .../tests/types/contracts/bytes/Forc.toml | 5 + .../tests/types/contracts/bytes/src/main.sw | 59 + .../contracts/call_empty_return/Forc.toml | 5 + .../contracts/call_empty_return/src/main.sw | 17 + .../complex_types_contract/Forc.toml | 5 + .../complex_types_contract/src/main.sw | 48 + .../contracts/contract_output_test/Forc.toml | 5 + .../contract_output_test/src/main.sw | 30 + .../types/contracts/empty_arguments/Forc.toml | 5 + .../contracts/empty_arguments/src/main.sw | 11 + .../types/contracts/enum_as_input/Forc.toml | 5 + .../types/contracts/enum_as_input/src/main.sw | 53 + .../types/contracts/enum_encoding/Forc.toml | 5 + .../types/contracts/enum_encoding/src/main.sw | 73 + .../contracts/enum_inside_struct/Forc.toml | 5 + .../contracts/enum_inside_struct/src/main.sw | 30 + .../types/contracts/evm_address/Forc.toml | 5 + .../types/contracts/evm_address/src/main.sw | 25 + .../tests/types/contracts/generics/Forc.toml | 5 + .../types/contracts/generics/src/main.sw | 107 + .../tests/types/contracts/identity/Forc.toml | 5 + .../types/contracts/identity/src/main.sw | 75 + .../types/contracts/native_types/Forc.toml | 5 + .../types/contracts/native_types/src/main.sw | 21 + .../types/contracts/nested_structs/Forc.toml | 5 + .../contracts/nested_structs/src/main.sw | 46 + .../tests/types/contracts/options/Forc.toml | 5 + .../tests/types/contracts/options/src/main.sw | 92 + .../tests/types/contracts/raw_slice/Forc.toml | 5 + .../types/contracts/raw_slice/src/main.sw | 59 + .../tests/types/contracts/results/Forc.toml | 5 + .../tests/types/contracts/results/src/main.sw | 75 + .../types/contracts/std_lib_string/Forc.toml | 5 + .../contracts/std_lib_string/src/main.sw | 37 + .../types/contracts/str_in_array/Forc.toml | 5 + .../types/contracts/str_in_array/src/main.sw | 21 + .../tests/types/contracts/tuples/Forc.toml | 5 + .../tests/types/contracts/tuples/src/main.sw | 79 + .../types/contracts/two_structs/Forc.toml | 5 + .../types/contracts/two_structs/src/main.sw | 25 + .../contracts/type_inside_enum/Forc.toml | 5 + .../contracts/type_inside_enum/src/main.sw | 81 + .../tests/types/contracts/u128/Forc.toml | 5 + .../tests/types/contracts/u128/src/main.sw | 34 + .../tests/types/contracts/u256/Forc.toml | 5 + .../tests/types/contracts/u256/src/main.sw | 34 + .../types/contracts/vector_output/Forc.toml | 5 + .../types/contracts/vector_output/src/main.sw | 148 ++ .../tests/types/contracts/vectors/Forc.toml | 5 + .../contracts/vectors/src/data_structures.sw | 9 + .../types/contracts/vectors/src/eq_impls.sw | 197 ++ .../tests/types/contracts/vectors/src/main.sw | 122 + .../types/contracts/vectors/src/utils.sw | 9 + .../tests/types/predicates/address/Forc.toml | 5 + .../types/predicates/address/src/main.sw | 7 + .../tests/types/predicates/enums/Forc.toml | 5 + .../tests/types/predicates/enums/src/main.sw | 23 + .../predicates/predicate_bytes/Forc.toml | 5 + .../predicates/predicate_bytes/src/main.sw | 44 + .../predicates/predicate_generics/Forc.toml | 5 + .../predicates/predicate_generics/src/main.sw | 22 + .../predicates/predicate_raw_slice/Forc.toml | 5 + .../predicate_raw_slice/src/main.sw | 30 + .../predicate_std_lib_string/Forc.toml | 5 + .../predicate_std_lib_string/src/main.sw | 30 + .../predicates/predicate_tuples/Forc.toml | 5 + .../predicates/predicate_tuples/src/main.sw | 21 + .../types/predicates/predicate_u128/Forc.toml | 5 + .../predicates/predicate_u128/src/main.sw | 7 + .../types/predicates/predicate_u256/Forc.toml | 5 + .../predicates/predicate_u256/src/main.sw | 7 + .../predicates/predicate_vector/Forc.toml | 5 + .../predicates/predicate_vector/src/main.sw | 6 + .../predicates/predicate_vectors/Forc.toml | 5 + .../predicates/predicate_vectors/src/main.sw | 61 + .../tests/types/predicates/structs/Forc.toml | 5 + .../types/predicates/structs/src/main.sw | 14 + .../tests/types/predicates/u64/Forc.toml | 5 + .../tests/types/predicates/u64/src/main.sw | 5 + .../types/scripts/options_results/Forc.toml | 5 + .../types/scripts/options_results/src/main.sw | 15 + .../types/scripts/script_bytes/Forc.toml | 5 + .../types/scripts/script_bytes/src/main.sw | 37 + .../types/scripts/script_generics/Forc.toml | 5 + .../types/scripts/script_generics/src/main.sw | 26 + .../types/scripts/script_raw_slice/Forc.toml | 5 + .../scripts/script_raw_slice/src/main.sw | 44 + .../scripts/script_std_lib_string/Forc.toml | 5 + .../scripts/script_std_lib_string/src/main.sw | 24 + .../types/scripts/script_tuples/Forc.toml | 5 + .../types/scripts/script_tuples/src/main.sw | 27 + .../tests/types/scripts/script_u128/Forc.toml | 5 + .../types/scripts/script_u128/src/main.sw | 7 + .../tests/types/scripts/script_u256/Forc.toml | 5 + .../types/scripts/script_u256/src/main.sw | 7 + .../types/scripts/script_vectors/Forc.toml | 5 + .../script_vectors/src/data_structures.sw | 9 + .../scripts/script_vectors/src/eq_impls.sw | 197 ++ .../types/scripts/script_vectors/src/main.sw | 114 + .../types/scripts/script_vectors/src/utils.sw | 9 + .../packages/fuels/tests/types_contracts.rs | 1999 +++++++++++++++++ .../packages/fuels/tests/types_predicates.rs | 379 ++++ .../packages/fuels/tests/types_scripts.rs | 311 +++ .../fuels-rs/packages/fuels/tests/wallets.rs | 452 ++++ .../apps/demo-typegen/contract/src/main.sw | 13 + .../fuels-ts/packages/address/src/address.ts | 225 ++ .../docs/quickstart/building-a-frontend.mdx | 1 - scripts/clean-build-files.sh | 2 +- 263 files changed, 26427 insertions(+), 2 deletions(-) create mode 100644 docs/beta-4/fuels-rs/packages/fuels-accounts/Cargo.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels-accounts/src/accounts_utils.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-accounts/src/lib.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-accounts/src/predicate.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-accounts/src/provider.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-accounts/src/wallet.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/Cargo.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/codec.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_decoder.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_encoder.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/codec/function_selector.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/lib.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/traits.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/traits/parameterize.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/traits/tokenizable.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/bech32.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/core.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bits.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bytes.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/identity.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/raw_slice.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/sized_ascii_string.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/u256.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/enum_variants.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/errors.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/param_types.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/transaction_builders.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/unresolved_bytes.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/block.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/chain_info.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/coin.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/coin_type.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/input.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/message.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/message_proof.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/node_info.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/transaction.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/types/wrappers/transaction_response.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/utils.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/utils/constants.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-core/src/utils/offsets.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/Cargo.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/src/call_response.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/src/call_utils.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/src/contract.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/src/lib.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/src/logs.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/src/receipt_parser.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels-programs/src/script_calls.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/sharing_types/contract_a/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/sharing_types/contract_a/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/sharing_types/contract_b/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/sharing_types/contract_b/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/sharing_types/shared_lib/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/sharing_types/shared_lib/src/lib.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/simple_contract/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/simple_contract/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/type_paths/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/type_paths/src/another_lib.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/type_paths/src/contract_a_types.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/bindings/type_paths/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/configurables.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/asserts/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/asserts/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/auth_testing_abi/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/auth_testing_abi/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/auth_testing_contract/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/auth_testing_contract/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/block_timestamp/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/block_timestamp/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/configurables/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/configurables/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/contract_test/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/contract_test/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/large_return_data/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/large_return_data/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/lib_contract/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/lib_contract/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/lib_contract_abi/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/lib_contract_abi/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/lib_contract_caller/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/lib_contract_caller/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/library_test/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/library_test/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/liquidity_pool/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/liquidity_pool/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/low_level_caller/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/low_level_caller/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/msg_amount/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/msg_amount/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/multiple_read_calls/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/multiple_read_calls/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/payable_annotation/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/payable_annotation/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/require/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/require/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/revert_transaction_error/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/revert_transaction_error/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/storage/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/storage/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/token_ops/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/token_ops/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/transaction_block_height/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/contracts/transaction_block_height/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/from_token.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/imports.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/contract_logs/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/contract_logs/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/contract_logs_abi/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/contract_logs_abi/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/contract_with_contract_logs/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/contract_with_contract_logs/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/script_logs/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/script_logs/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/script_with_contract_logs/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/logs/script_with_contract_logs/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/predicates.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/predicates/basic_predicate/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/predicates/basic_predicate/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/predicates/predicate_configurables/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/predicates/predicate_configurables/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/predicates/signatures/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/predicates/signatures/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/providers.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/arguments/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/arguments/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/basic_script/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/basic_script/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/require_from_contract/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/require_from_contract/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_array/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_array/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_asserts/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_asserts/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_b256/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_b256/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_configurables/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_configurables/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_enum/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_enum/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_require/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_require/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_struct/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/script_struct/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/transfer_script/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/scripts/transfer_script/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/storage.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/b512/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/b512/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/bytes/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/bytes/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/call_empty_return/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/call_empty_return/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/complex_types_contract/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/complex_types_contract/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/contract_output_test/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/contract_output_test/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/empty_arguments/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/empty_arguments/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/enum_as_input/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/enum_as_input/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/enum_encoding/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/enum_encoding/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/enum_inside_struct/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/enum_inside_struct/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/evm_address/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/evm_address/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/generics/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/generics/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/identity/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/identity/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/native_types/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/native_types/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/nested_structs/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/nested_structs/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/options/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/options/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/raw_slice/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/raw_slice/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/results/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/results/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/std_lib_string/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/std_lib_string/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/str_in_array/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/str_in_array/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/tuples/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/tuples/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/two_structs/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/two_structs/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/type_inside_enum/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/type_inside_enum/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/u128/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/u128/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/u256/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/u256/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/vector_output/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/vector_output/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/vectors/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/vectors/src/data_structures.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/vectors/src/eq_impls.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/vectors/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/contracts/vectors/src/utils.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/address/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/address/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/enums/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/enums/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_bytes/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_bytes/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_generics/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_generics/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_raw_slice/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_raw_slice/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_std_lib_string/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_std_lib_string/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_tuples/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_tuples/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_u128/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_u128/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_u256/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_u256/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_vector/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_vector/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_vectors/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/predicate_vectors/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/structs/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/structs/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/u64/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/predicates/u64/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/options_results/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/options_results/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_bytes/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_bytes/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_generics/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_generics/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_raw_slice/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_raw_slice/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_std_lib_string/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_std_lib_string/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_tuples/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_tuples/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_u128/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_u128/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_u256/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_u256/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_vectors/Forc.toml create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_vectors/src/data_structures.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_vectors/src/eq_impls.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_vectors/src/main.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types/scripts/script_vectors/src/utils.sw create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types_contracts.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types_predicates.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/types_scripts.rs create mode 100644 docs/beta-4/fuels-rs/packages/fuels/tests/wallets.rs create mode 100644 docs/beta-4/fuels-ts/apps/demo-typegen/contract/src/main.sw create mode 100644 docs/beta-4/fuels-ts/packages/address/src/address.ts diff --git a/docs/beta-4/fuels-rs/packages/fuels-accounts/Cargo.toml b/docs/beta-4/fuels-rs/packages/fuels-accounts/Cargo.toml new file mode 100644 index 00000000..323f99ab --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-accounts/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "fuels-accounts" +version = { workspace = true } +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +rust-version = { workspace = true } +description = "Fuel Rust SDK accounts." + +[dependencies] +async-trait = { workspace = true, default-features = false } +bytes = { workspace = true, features = ["serde"] } +chrono = { workspace = true } +elliptic-curve = { workspace = true, default-features = false } +eth-keystore = { workspace = true } +fuel-core = { workspace = true, default-features = false, optional = true } +fuel-core-client = { workspace = true, features = ["default"] } +fuel-crypto = { workspace = true, features = ["random"] } +fuel-tx = { workspace = true } +fuel-types = { workspace = true, features = ["random"] } +fuel-vm = { workspace = true } +fuels-core = { workspace = true } +hex = { workspace = true, default-features = false, features = ["std"] } +itertools = { workspace = true } +rand = { workspace = true, default-features = false } +serde = { workspace = true, default-features = true, features = ["derive"] } +sha2 = { workspace = true, default-features = false } +tai64 = { workspace = true, features = ["serde"] } +thiserror = { workspace = true, default-features = false } +tokio = { workspace = true, features = ["full"] } + +[dev-dependencies] +hex = { workspace = true, default-features = false, features = ["std"] } +tempfile = { workspace = true } + +[features] +default = ["std"] +std = ["fuels-core/std"] diff --git a/docs/beta-4/fuels-rs/packages/fuels-accounts/src/accounts_utils.rs b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/accounts_utils.rs new file mode 100644 index 00000000..fb39660e --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/accounts_utils.rs @@ -0,0 +1,79 @@ +use fuel_tx::{ConsensusParameters, Output, Receipt}; +use fuel_types::MessageId; +use fuels_core::{ + constants::BASE_ASSET_ID, + types::{ + bech32::Bech32Address, + errors::{error, Error, Result}, + input::Input, + transaction_builders::TransactionBuilder, + }, +}; + +pub fn extract_message_id(receipts: &[Receipt]) -> Option { + receipts.iter().find_map(|m| m.message_id()) +} + +pub fn calculate_base_amount_with_fee( + tb: &impl TransactionBuilder, + consensus_params: &ConsensusParameters, + previous_base_amount: u64, +) -> Result { + let transaction_fee = tb + .fee_checked_from_tx(consensus_params)? + .ok_or(error!(InvalidData, "Error calculating TransactionFee"))?; + + let mut new_base_amount = transaction_fee.max_fee() + previous_base_amount; + + // If the tx doesn't consume any UTXOs, attempting to repeat it will lead to an + // error due to non unique tx ids (e.g. repeated contract call with configured gas cost of 0). + // Here we enforce a minimum amount on the base asset to avoid this + let is_consuming_utxos = tb + .inputs() + .iter() + .any(|input| !matches!(input, Input::Contract { .. })); + const MIN_AMOUNT: u64 = 1; + if !is_consuming_utxos && new_base_amount == 0 { + new_base_amount = MIN_AMOUNT; + } + + Ok(new_base_amount) +} + +// Replace the current base asset inputs of a tx builder with the provided ones. +// Only signed resources and coin predicates are replaced, the remaining inputs are kept. +// Messages that contain data are also kept since we don't know who will consume the data. +pub fn adjust_inputs( + tb: &mut impl TransactionBuilder, + new_base_inputs: impl IntoIterator, +) { + let adjusted_inputs = tb + .inputs() + .iter() + .filter(|input| { + input.contains_data() + || !matches!(input , Input::ResourceSigned { resource , .. } + | Input::ResourcePredicate { resource, .. } if resource.asset_id() == BASE_ASSET_ID) + }) + .cloned() + .chain(new_base_inputs) + .collect(); + + *tb.inputs_mut() = adjusted_inputs +} + +pub fn adjust_outputs( + tb: &mut impl TransactionBuilder, + address: &Bech32Address, + new_base_amount: u64, +) { + let is_base_change_present = tb.outputs().iter().any(|output| { + matches!(output , Output::Change { asset_id , .. } + if asset_id == & BASE_ASSET_ID) + }); + + if !is_base_change_present && new_base_amount != 0 { + tb.outputs_mut() + .push(Output::change(address.into(), 0, BASE_ASSET_ID)); + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-accounts/src/lib.rs b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/lib.rs new file mode 100644 index 00000000..97faf8e8 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/lib.rs @@ -0,0 +1,422 @@ +use std::{collections::HashMap, fmt::Display}; + +use async_trait::async_trait; +use fuel_core_client::client::pagination::{PaginatedResult, PaginationRequest}; +#[doc(no_inline)] +pub use fuel_crypto; +use fuel_crypto::Signature; +use fuel_tx::{Output, Receipt, TxId, TxPointer, UtxoId}; +use fuel_types::{AssetId, Bytes32, ContractId, MessageId}; +use fuels_core::{ + constants::BASE_ASSET_ID, + types::{ + bech32::{Bech32Address, Bech32ContractId}, + coin::Coin, + coin_type::CoinType, + errors::{Error, Result}, + input::Input, + message::Message, + transaction::TxParameters, + transaction_builders::{ScriptTransactionBuilder, TransactionBuilder}, + transaction_response::TransactionResponse, + }, +}; +use provider::ResourceFilter; + +use crate::{accounts_utils::extract_message_id, provider::Provider}; + +mod accounts_utils; +pub mod predicate; +pub mod provider; +pub mod wallet; + +/// Trait for signing transactions and messages +/// +/// Implement this trait to support different signing modes, e.g. Ledger, hosted etc. +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +pub trait Signer: std::fmt::Debug + Send + Sync { + type Error: std::error::Error + Send + Sync; + + async fn sign_message>( + &self, + message: S, + ) -> std::result::Result; + + /// Signs the transaction + fn sign_transaction(&self, message: &mut impl TransactionBuilder); +} + +#[derive(Debug)] +pub struct AccountError(String); + +impl AccountError { + pub fn no_provider() -> Self { + Self("No provider was setup: make sure to set_provider in your account!".to_string()) + } +} + +impl Display for AccountError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{self:?}") + } +} + +impl std::error::Error for AccountError {} + +impl From for Error { + fn from(e: AccountError) -> Self { + Error::AccountError(e.0) + } +} + +type AccountResult = std::result::Result; + +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +pub trait ViewOnlyAccount: std::fmt::Debug + Send + Sync + Clone { + fn address(&self) -> &Bech32Address; + + fn try_provider(&self) -> AccountResult<&Provider>; + + async fn get_transactions( + &self, + request: PaginationRequest, + ) -> Result> { + Ok(self + .try_provider()? + .get_transactions_by_owner(self.address(), request) + .await?) + } + + /// Gets all unspent coins of asset `asset_id` owned by the account. + async fn get_coins(&self, asset_id: AssetId) -> Result> { + Ok(self + .try_provider()? + .get_coins(self.address(), asset_id) + .await?) + } + + /// Get the balance of all spendable coins `asset_id` for address `address`. This is different + /// from getting coins because we are just returning a number (the sum of UTXOs amount) instead + /// of the UTXOs. + async fn get_asset_balance(&self, asset_id: &AssetId) -> Result { + self.try_provider()? + .get_asset_balance(self.address(), *asset_id) + .await + .map_err(Into::into) + } + + /// Gets all unspent messages owned by the account. + async fn get_messages(&self) -> Result> { + Ok(self.try_provider()?.get_messages(self.address()).await?) + } + + /// Get all the spendable balances of all assets for the account. This is different from getting + /// the coins because we are only returning the sum of UTXOs coins amount and not the UTXOs + /// coins themselves. + async fn get_balances(&self) -> Result> { + self.try_provider()? + .get_balances(self.address()) + .await + .map_err(Into::into) + } + + // /// Get some spendable resources (coins and messages) of asset `asset_id` owned by the account + // /// that add up at least to amount `amount`. The returned coins (UTXOs) are actual coins that + // /// can be spent. The number of UXTOs is optimized to prevent dust accumulation. + async fn get_spendable_resources( + &self, + asset_id: AssetId, + amount: u64, + ) -> Result> { + let filter = ResourceFilter { + from: self.address().clone(), + asset_id, + amount, + ..Default::default() + }; + self.try_provider()? + .get_spendable_resources(filter) + .await + .map_err(Into::into) + } +} + +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +pub trait Account: ViewOnlyAccount { + /// Returns a vector consisting of `Input::Coin`s and `Input::Message`s for the given + /// asset ID and amount. The `witness_index` is the position of the witness (signature) + /// in the transaction's list of witnesses. In the validation process, the node will + /// use the witness at this index to validate the coins returned by this method. + async fn get_asset_inputs_for_amount( + &self, + asset_id: AssetId, + amount: u64, + ) -> Result>; + + /// Returns a vector containing the output coin and change output given an asset and amount + fn get_asset_outputs_for_amount( + &self, + to: &Bech32Address, + asset_id: AssetId, + amount: u64, + ) -> Vec { + vec![ + Output::coin(to.into(), amount, asset_id), + // Note that the change will be computed by the node. + // Here we only have to tell the node who will own the change and its asset ID. + Output::change(self.address().into(), 0, asset_id), + ] + } + + async fn add_fee_resources( + &self, + tb: Tb, + previous_base_amount: u64, + ) -> Result; + + /// Transfer funds from this account to another `Address`. + /// Fails if amount for asset ID is larger than address's spendable coins. + /// Returns the transaction ID that was sent and the list of receipts. + async fn transfer( + &self, + to: &Bech32Address, + amount: u64, + asset_id: AssetId, + tx_parameters: TxParameters, + ) -> Result<(TxId, Vec)> { + let provider = self.try_provider()?; + + let inputs = self.get_asset_inputs_for_amount(asset_id, amount).await?; + + let outputs = self.get_asset_outputs_for_amount(to, asset_id, amount); + + let consensus_parameters = provider.consensus_parameters(); + + let tx_builder = ScriptTransactionBuilder::prepare_transfer(inputs, outputs, tx_parameters) + .with_consensus_parameters(consensus_parameters); + + // if we are not transferring the base asset, previous base amount is 0 + let previous_base_amount = if asset_id == AssetId::default() { + amount + } else { + 0 + }; + + let tx = self + .add_fee_resources(tx_builder, previous_base_amount) + .await?; + + let tx_id = provider.send_transaction(tx).await?; + let receipts = provider.get_receipts(&tx_id).await?; + + Ok((tx_id, receipts)) + } + + /// Unconditionally transfers `balance` of type `asset_id` to + /// the contract at `to`. + /// Fails if balance for `asset_id` is larger than this account's spendable balance. + /// Returns the corresponding transaction ID and the list of receipts. + /// + /// CAUTION !!! + /// + /// This will transfer coins to a contract, possibly leading + /// to the PERMANENT LOSS OF COINS if not used with care. + async fn force_transfer_to_contract( + &self, + to: &Bech32ContractId, + balance: u64, + asset_id: AssetId, + tx_parameters: TxParameters, + ) -> std::result::Result<(String, Vec), Error> { + let provider = self.try_provider()?; + + let zeroes = Bytes32::zeroed(); + let plain_contract_id: ContractId = to.into(); + + let mut inputs = vec![Input::contract( + UtxoId::new(zeroes, 0), + zeroes, + zeroes, + TxPointer::default(), + plain_contract_id, + )]; + + inputs.extend(self.get_asset_inputs_for_amount(asset_id, balance).await?); + + let outputs = vec![ + Output::contract(0, zeroes, zeroes), + Output::change(self.address().into(), 0, asset_id), + ]; + + // Build transaction and sign it + let params = provider.consensus_parameters(); + + let tb = ScriptTransactionBuilder::prepare_contract_transfer( + plain_contract_id, + balance, + asset_id, + inputs, + outputs, + tx_parameters, + ) + .with_consensus_parameters(params); + + // if we are not transferring the base asset, previous base amount is 0 + let base_amount = if asset_id == AssetId::default() { + balance + } else { + 0 + }; + + let tx = self.add_fee_resources(tb, base_amount).await?; + + let tx_id = provider.send_transaction(tx).await?; + let receipts = provider.get_receipts(&tx_id).await?; + + Ok((tx_id.to_string(), receipts)) + } + + /// Withdraws an amount of the base asset to + /// an address on the base chain. + /// Returns the transaction ID, message ID and the list of receipts. + async fn withdraw_to_base_layer( + &self, + to: &Bech32Address, + amount: u64, + tx_parameters: TxParameters, + ) -> std::result::Result<(TxId, MessageId, Vec), Error> { + let provider = self.try_provider()?; + + let inputs = self + .get_asset_inputs_for_amount(BASE_ASSET_ID, amount) + .await?; + + let tb = ScriptTransactionBuilder::prepare_message_to_output( + to.into(), + amount, + inputs, + tx_parameters, + ); + + let tx = self.add_fee_resources(tb, amount).await?; + let tx_id = provider.send_transaction(tx).await?; + let receipts = provider.get_receipts(&tx_id).await?; + + let message_id = extract_message_id(&receipts) + .expect("MessageId could not be retrieved from tx receipts."); + + Ok((tx_id, message_id, receipts)) + } +} + +#[cfg(test)] +mod tests { + use std::str::FromStr; + + use fuel_crypto::{Message, SecretKey}; + use fuel_tx::{Address, Output}; + use fuels_core::types::transaction::Transaction; + use rand::{rngs::StdRng, RngCore, SeedableRng}; + + use super::*; + use crate::wallet::WalletUnlocked; + + #[tokio::test] + async fn sign_and_verify() -> std::result::Result<(), Box> { + // ANCHOR: sign_message + let mut rng = StdRng::seed_from_u64(2322u64); + let mut secret_seed = [0u8; 32]; + rng.fill_bytes(&mut secret_seed); + + let secret = secret_seed + .as_slice() + .try_into() + .expect("The seed size is valid"); + + // Create a wallet using the private key created above. + let wallet = WalletUnlocked::new_from_private_key(secret, None); + + let message = "my message"; + + let signature = wallet.sign_message(message).await?; + + // Check if signature is what we expect it to be + assert_eq!(signature, Signature::from_str("0x8eeb238db1adea4152644f1cd827b552dfa9ab3f4939718bb45ca476d167c6512a656f4d4c7356bfb9561b14448c230c6e7e4bd781df5ee9e5999faa6495163d")?); + + // Recover address that signed the message + let message = Message::new(message); + let recovered_address = signature.recover(&message)?; + + assert_eq!(wallet.address().hash(), recovered_address.hash()); + + // Verify signature + signature.verify(&recovered_address, &message)?; + // ANCHOR_END: sign_message + + Ok(()) + } + + #[tokio::test] + async fn sign_tx_and_verify() -> std::result::Result<(), Box> { + // ANCHOR: sign_tx + let secret = SecretKey::from_str( + "5f70feeff1f229e4a95e1056e8b4d80d0b24b565674860cc213bdb07127ce1b1", + )?; + let wallet = WalletUnlocked::new_from_private_key(secret, None); + + // Set up a transaction + let mut tb = { + let input_coin = Input::ResourceSigned { + resource: CoinType::Coin(Coin { + amount: 10000000, + owner: wallet.address().clone(), + ..Default::default() + }), + }; + + let output_coin = Output::coin( + Address::from_str( + "0xc7862855b418ba8f58878db434b21053a61a2025209889cc115989e8040ff077", + )?, + 1, + Default::default(), + ); + + ScriptTransactionBuilder::prepare_transfer( + vec![input_coin], + vec![output_coin], + Default::default(), + ) + }; + + // Sign the transaction + wallet.sign_transaction(&mut tb); // Add the private key to the transaction builder + let tx = tb.build()?; // Resolve signatures and add corresponding witness indexes + + // Extract the signature from the tx witnesses + let bytes = <[u8; Signature::LEN]>::try_from(tx.witnesses().first().unwrap().as_ref())?; + let tx_signature = Signature::from_bytes(bytes); + + // Sign the transaction manually + let message = Message::from_bytes(*tx.id(0.into())); + let signature = Signature::sign(&wallet.private_key, &message); + + // Check if the signatures are the same + assert_eq!(signature, tx_signature); + + // Check if the signature is what we expect it to be + assert_eq!(signature, Signature::from_str("d7027be16db0aada625ac8cd438f9b6187bd74465495ba39511c1ad72b7bb10af4ef582c94cc33433f7a1eb4f2ad21c471473947f5f645e90924ba273e2cee7f")?); + + // Recover the address that signed the transaction + let recovered_address = signature.recover(&message)?; + + assert_eq!(wallet.address().hash(), recovered_address.hash()); + + // Verify the signature + signature.verify(&recovered_address, &message)?; + // ANCHOR_END: sign_tx + + Ok(()) + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-accounts/src/predicate.rs b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/predicate.rs new file mode 100644 index 00000000..510d00db --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/predicate.rs @@ -0,0 +1,163 @@ +use std::{fmt::Debug, fs}; + +use fuel_tx::ConsensusParameters; +use fuel_types::AssetId; +use fuels_core::{ + constants::BASE_ASSET_ID, + types::{ + bech32::Bech32Address, errors::Result, input::Input, + transaction_builders::TransactionBuilder, unresolved_bytes::UnresolvedBytes, + }, + Configurables, +}; + +use crate::{ + accounts_utils::{adjust_inputs, adjust_outputs, calculate_base_amount_with_fee}, + provider::Provider, + Account, AccountError, AccountResult, ViewOnlyAccount, +}; + +#[derive(Debug, Clone)] +pub struct Predicate { + address: Bech32Address, + code: Vec, + data: UnresolvedBytes, + provider: Option, +} + +impl Predicate { + pub fn address(&self) -> &Bech32Address { + &self.address + } + + pub fn code(&self) -> &Vec { + &self.code + } + + pub fn data(&self) -> &UnresolvedBytes { + &self.data + } + + pub fn provider(&self) -> Option<&Provider> { + self.provider.as_ref() + } + + pub fn set_provider(&mut self, provider: Provider) { + self.address = Self::calculate_address(&self.code, provider.chain_id().into()); + self.provider = Some(provider); + } + + pub fn with_provider(self, provider: Provider) -> Self { + let address = Self::calculate_address(&self.code, provider.chain_id().into()); + Self { + address, + provider: Some(provider), + ..self + } + } + + pub fn calculate_address(code: &[u8], chain_id: u64) -> Bech32Address { + fuel_tx::Input::predicate_owner(code, &chain_id.into()).into() + } + + fn consensus_parameters(&self) -> ConsensusParameters { + self.provider() + .map(|p| p.consensus_parameters()) + .unwrap_or_default() + } + + /// Uses default `ConsensusParameters` + pub fn from_code(code: Vec) -> Self { + Self { + address: Self::calculate_address(&code, ConsensusParameters::default().chain_id.into()), + code, + data: Default::default(), + provider: None, + } + } + + /// Uses default `ConsensusParameters` + pub fn load_from(file_path: &str) -> Result { + let code = fs::read(file_path)?; + Ok(Self::from_code(code)) + } + + pub fn with_data(mut self, data: UnresolvedBytes) -> Self { + self.data = data; + self + } + + pub fn with_code(self, code: Vec) -> Self { + let address = Self::calculate_address(&code, self.consensus_parameters().chain_id.into()); + Self { + code, + address, + ..self + } + } + + pub fn with_configurables(mut self, configurables: impl Into) -> Self { + let configurables: Configurables = configurables.into(); + configurables.update_constants_in(&mut self.code); + let address = + Self::calculate_address(&self.code, self.consensus_parameters().chain_id.into()); + self.address = address; + self + } +} + +impl ViewOnlyAccount for Predicate { + fn address(&self) -> &Bech32Address { + self.address() + } + + fn try_provider(&self) -> AccountResult<&Provider> { + self.provider.as_ref().ok_or(AccountError::no_provider()) + } +} + +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +impl Account for Predicate { + async fn get_asset_inputs_for_amount( + &self, + asset_id: AssetId, + amount: u64, + ) -> Result> { + Ok(self + .get_spendable_resources(asset_id, amount) + .await? + .into_iter() + .map(|resource| { + Input::resource_predicate(resource, self.code.clone(), self.data.clone()) + }) + .collect::>()) + } + + /// Add base asset inputs to the transaction to cover the estimated fee. + /// The original base asset amount cannot be calculated reliably from + /// the existing transaction inputs because the selected resources may exceed + /// the required amount to avoid dust. Therefore we require it as an argument. + /// + /// Requires contract inputs to be at the start of the transactions inputs vec + /// so that their indexes are retained + async fn add_fee_resources( + &self, + mut tb: Tb, + previous_base_amount: u64, + ) -> Result { + let consensus_parameters = self.try_provider()?.consensus_parameters(); + tb = tb.with_consensus_parameters(consensus_parameters); + + let new_base_amount = + calculate_base_amount_with_fee(&tb, &consensus_parameters, previous_base_amount)?; + + let new_base_inputs = self + .get_asset_inputs_for_amount(BASE_ASSET_ID, new_base_amount) + .await?; + + adjust_inputs(&mut tb, new_base_inputs); + adjust_outputs(&mut tb, self.address(), new_base_amount); + + tb.build() + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-accounts/src/provider.rs b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/provider.rs new file mode 100644 index 00000000..46662108 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/provider.rs @@ -0,0 +1,617 @@ +use std::{collections::HashMap, fmt::Debug, io}; + +use chrono::{DateTime, Utc}; +#[cfg(feature = "fuel-core-lib")] +use fuel_core::service::{Config, FuelService}; +use fuel_core_client::client::{ + pagination::{PageDirection, PaginatedResult, PaginationRequest}, + types::{balance::Balance, contract::ContractBalance, TransactionStatus}, + FuelClient, +}; +use fuel_tx::{AssetId, ConsensusParameters, Receipt, ScriptExecutionResult, TxId, UtxoId}; +use fuel_types::{Address, Bytes32, ChainId, MessageId, Nonce}; +use fuel_vm::state::ProgramState; +use fuels_core::{ + constants::{BASE_ASSET_ID, DEFAULT_GAS_ESTIMATION_TOLERANCE}, + types::{ + bech32::{Bech32Address, Bech32ContractId}, + block::Block, + chain_info::ChainInfo, + coin::Coin, + coin_type::CoinType, + errors::{error, Error, Result}, + message::Message, + message_proof::MessageProof, + node_info::NodeInfo, + transaction::Transaction, + transaction_response::TransactionResponse, + }, +}; +use tai64::Tai64; +use thiserror::Error; + +type ProviderResult = std::result::Result; + +#[derive(Debug)] +pub struct TransactionCost { + pub min_gas_price: u64, + pub gas_price: u64, + pub gas_used: u64, + pub metered_bytes_size: u64, + pub total_fee: u64, +} + +pub(crate) struct ResourceQueries { + utxos: Vec, + messages: Vec, + asset_id: AssetId, + amount: u64, +} + +impl ResourceQueries { + pub fn new( + utxo_ids: Vec, + message_nonces: Vec, + asset_id: AssetId, + amount: u64, + ) -> Self { + Self { + utxos: utxo_ids, + messages: message_nonces, + asset_id, + amount, + } + } + + pub fn exclusion_query(&self) -> Option<(Vec, Vec)> { + if self.utxos.is_empty() && self.messages.is_empty() { + return None; + } + + Some((self.utxos.clone(), self.messages.clone())) + } + + pub fn spend_query(&self) -> Vec<(AssetId, u64, Option)> { + vec![(self.asset_id, self.amount, None)] + } +} + +// ANCHOR: resource_filter +pub struct ResourceFilter { + pub from: Bech32Address, + pub asset_id: AssetId, + pub amount: u64, + pub excluded_utxos: Vec, + pub excluded_message_nonces: Vec, +} +// ANCHOR_END: resource_filter + +impl ResourceFilter { + pub fn owner(&self) -> Address { + (&self.from).into() + } + + pub(crate) fn resource_queries(&self) -> ResourceQueries { + ResourceQueries::new( + self.excluded_utxos.clone(), + self.excluded_message_nonces.clone(), + self.asset_id, + self.amount, + ) + } +} + +impl Default for ResourceFilter { + fn default() -> Self { + Self { + from: Default::default(), + asset_id: BASE_ASSET_ID, + amount: Default::default(), + excluded_utxos: Default::default(), + excluded_message_nonces: Default::default(), + } + } +} + +#[derive(Debug, Error)] +pub enum ProviderError { + // Every IO error in the context of Provider comes from the gql client + #[error(transparent)] + ClientRequestError(#[from] io::Error), +} + +impl From for Error { + fn from(e: ProviderError) -> Self { + Error::ProviderError(e.to_string()) + } +} + +/// Encapsulates common client operations in the SDK. +/// Note that you may also use `client`, which is an instance +/// of `FuelClient`, directly, which provides a broader API. +#[derive(Debug, Clone)] +pub struct Provider { + pub client: FuelClient, + pub consensus_parameters: ConsensusParameters, +} + +impl Provider { + pub fn new(client: FuelClient, consensus_parameters: ConsensusParameters) -> Self { + Self { + client, + consensus_parameters, + } + } + + /// Sends a transaction to the underlying Provider's client. + pub async fn send_transaction(&self, tx: T) -> Result { + let tolerance = 0.0; + let TransactionCost { + gas_used, + min_gas_price, + .. + } = self + .estimate_transaction_cost(tx.clone(), Some(tolerance)) + .await?; + + if gas_used > tx.gas_limit() { + return Err(error!( + ProviderError, + "gas_limit({}) is lower than the estimated gas_used({})", + tx.gas_limit(), + gas_used + )); + } else if min_gas_price > tx.gas_price() { + return Err(error!( + ProviderError, + "gas_price({}) is lower than the required min_gas_price({})", + tx.gas_price(), + min_gas_price + )); + } + + let chain_info = self.chain_info().await?; + tx.check_without_signatures( + chain_info.latest_block.header.height, + &self.consensus_parameters(), + )?; + + let tx_id = self.submit_tx(tx.clone()).await?; + + Ok(tx_id) + } + + pub async fn get_receipts(&self, tx_id: &TxId) -> Result> { + let tx_status = self.client.transaction_status(tx_id).await?; + let receipts = self.client.receipts(tx_id).await?.map_or(vec![], |v| v); + Self::if_failure_generate_error(&tx_status, &receipts)?; + Ok(receipts) + } + + fn if_failure_generate_error(status: &TransactionStatus, receipts: &[Receipt]) -> Result<()> { + if let TransactionStatus::Failure { + reason, + program_state, + .. + } = status + { + let revert_id = program_state + .and_then(|state| match state { + ProgramState::Revert(revert_id) => Some(revert_id), + _ => None, + }) + .expect("Transaction failed without a `revert_id`"); + + return Err(Error::RevertTransactionError { + reason: reason.to_string(), + revert_id, + receipts: receipts.to_owned(), + }); + } + + Ok(()) + } + + async fn submit_tx(&self, tx: impl Transaction) -> ProviderResult { + let tx_id = self.client.submit(&tx.into()).await?; + self.client.await_transaction_commit(&tx_id).await?; + + Ok(tx_id) + } + + #[cfg(feature = "fuel-core-lib")] + /// Launches a local `fuel-core` network based on provided config. + pub async fn launch(config: Config) -> Result { + let srv = FuelService::new_node(config).await.unwrap(); + Ok(FuelClient::from(srv.bound_address)) + } + + /// Connects to an existing node at the given address. + pub async fn connect(url: impl AsRef) -> Result { + let client = FuelClient::new(url).map_err(|err| error!(InfrastructureError, "{err}"))?; + let consensus_parameters = client.chain_info().await?.consensus_parameters.into(); + Ok(Provider::new(client, consensus_parameters)) + } + + pub async fn chain_info(&self) -> ProviderResult { + Ok(self.client.chain_info().await?.into()) + } + + pub fn consensus_parameters(&self) -> ConsensusParameters { + self.consensus_parameters + } + + pub fn chain_id(&self) -> ChainId { + self.consensus_parameters.chain_id + } + + pub async fn node_info(&self) -> ProviderResult { + Ok(self.client.node_info().await?.into()) + } + + pub async fn checked_dry_run(&self, tx: T) -> Result> { + let receipts = self.dry_run(tx).await?; + Self::has_script_succeeded(&receipts)?; + + Ok(receipts) + } + + fn has_script_succeeded(receipts: &[Receipt]) -> Result<()> { + receipts + .iter() + .find_map(|receipt| match receipt { + Receipt::ScriptResult { result, .. } + if *result != ScriptExecutionResult::Success => + { + Some(format!("{result:?}")) + } + _ => None, + }) + .map(|error_message| { + Err(Error::RevertTransactionError { + reason: error_message, + revert_id: 0, + receipts: receipts.to_owned(), + }) + }) + .unwrap_or(Ok(())) + } + + pub async fn dry_run(&self, tx: T) -> Result> { + let receipts = self.client.dry_run(&tx.into()).await?; + + Ok(receipts) + } + + pub async fn dry_run_no_validation(&self, tx: T) -> Result> { + let receipts = self.client.dry_run_opt(&tx.into(), Some(false)).await?; + + Ok(receipts) + } + + /// Gets all unspent coins owned by address `from`, with asset ID `asset_id`. + pub async fn get_coins( + &self, + from: &Bech32Address, + asset_id: AssetId, + ) -> ProviderResult> { + let mut coins: Vec = vec![]; + + let mut cursor = None; + + loop { + let res = self + .client + .coins( + &from.into(), + Some(&asset_id), + PaginationRequest { + cursor: cursor.clone(), + results: 100, + direction: PageDirection::Forward, + }, + ) + .await?; + + if res.results.is_empty() { + break; + } + coins.extend(res.results.into_iter().map(Into::into)); + cursor = res.cursor; + } + + Ok(coins) + } + + /// Get some spendable coins of asset `asset_id` for address `from` that add up at least to + /// amount `amount`. The returned coins (UTXOs) are actual coins that can be spent. The number + /// of coins (UXTOs) is optimized to prevent dust accumulation. + pub async fn get_spendable_resources( + &self, + filter: ResourceFilter, + ) -> ProviderResult> { + let queries = filter.resource_queries(); + + let res = self + .client + .coins_to_spend( + &filter.owner(), + queries.spend_query(), + queries.exclusion_query(), + ) + .await? + .into_iter() + .flatten() + .map(|c| CoinType::try_from(c).map_err(ProviderError::ClientRequestError)) + .collect::>>()?; + Ok(res) + } + + /// Get the balance of all spendable coins `asset_id` for address `address`. This is different + /// from getting coins because we are just returning a number (the sum of UTXOs amount) instead + /// of the UTXOs. + pub async fn get_asset_balance( + &self, + address: &Bech32Address, + asset_id: AssetId, + ) -> ProviderResult { + self.client + .balance(&address.into(), Some(&asset_id)) + .await + .map_err(Into::into) + } + + /// Get the balance of all spendable coins `asset_id` for contract with id `contract_id`. + pub async fn get_contract_asset_balance( + &self, + contract_id: &Bech32ContractId, + asset_id: AssetId, + ) -> ProviderResult { + self.client + .contract_balance(&contract_id.into(), Some(&asset_id)) + .await + .map_err(Into::into) + } + + /// Get all the spendable balances of all assets for address `address`. This is different from + /// getting the coins because we are only returning the numbers (the sum of UTXOs coins amount + /// for each asset id) and not the UTXOs coins themselves + pub async fn get_balances( + &self, + address: &Bech32Address, + ) -> ProviderResult> { + // We don't paginate results because there are likely at most ~100 different assets in one + // wallet + let pagination = PaginationRequest { + cursor: None, + results: 9999, + direction: PageDirection::Forward, + }; + let balances_vec = self + .client + .balances(&address.into(), pagination) + .await? + .results; + let balances = balances_vec + .into_iter() + .map( + |Balance { + owner: _, + amount, + asset_id, + }| (asset_id.to_string(), amount), + ) + .collect(); + Ok(balances) + } + + /// Get all balances of all assets for the contract with id `contract_id`. + pub async fn get_contract_balances( + &self, + contract_id: &Bech32ContractId, + ) -> ProviderResult> { + // We don't paginate results because there are likely at most ~100 different assets in one + // wallet + let pagination = PaginationRequest { + cursor: None, + results: 9999, + direction: PageDirection::Forward, + }; + + let balances_vec = self + .client + .contract_balances(&contract_id.into(), pagination) + .await? + .results; + let balances = balances_vec + .into_iter() + .map( + |ContractBalance { + contract: _, + amount, + asset_id, + }| (asset_id, amount), + ) + .collect(); + Ok(balances) + } + + pub async fn get_transaction_by_id( + &self, + tx_id: &TxId, + ) -> ProviderResult> { + Ok(self.client.transaction(tx_id).await?.map(Into::into)) + } + + pub async fn get_transactions( + &self, + request: PaginationRequest, + ) -> ProviderResult> { + let pr = self.client.transactions(request).await?; + + Ok(PaginatedResult { + cursor: pr.cursor, + results: pr.results.into_iter().map(Into::into).collect(), + has_next_page: pr.has_next_page, + has_previous_page: pr.has_previous_page, + }) + } + + // Get transaction(s) by owner + pub async fn get_transactions_by_owner( + &self, + owner: &Bech32Address, + request: PaginationRequest, + ) -> ProviderResult> { + let pr = self + .client + .transactions_by_owner(&owner.into(), request) + .await?; + + Ok(PaginatedResult { + cursor: pr.cursor, + results: pr.results.into_iter().map(Into::into).collect(), + has_next_page: pr.has_next_page, + has_previous_page: pr.has_previous_page, + }) + } + + pub async fn latest_block_height(&self) -> ProviderResult { + Ok(self.chain_info().await?.latest_block.header.height) + } + + pub async fn latest_block_time(&self) -> ProviderResult>> { + Ok(self.chain_info().await?.latest_block.header.time) + } + + pub async fn produce_blocks( + &self, + blocks_to_produce: u64, + start_time: Option>, + ) -> io::Result { + let start_time = start_time.map(|time| Tai64::from_unix(time.timestamp()).0); + self.client + .produce_blocks(blocks_to_produce, start_time) + .await + .map(Into::into) + } + + /// Get block by id. + pub async fn block(&self, block_id: &Bytes32) -> ProviderResult> { + let block = self.client.block(block_id).await?.map(Into::into); + Ok(block) + } + + // - Get block(s) + pub async fn get_blocks( + &self, + request: PaginationRequest, + ) -> ProviderResult> { + let pr = self.client.blocks(request).await?; + + Ok(PaginatedResult { + cursor: pr.cursor, + results: pr.results.into_iter().map(Into::into).collect(), + has_next_page: pr.has_next_page, + has_previous_page: pr.has_previous_page, + }) + } + + pub async fn estimate_transaction_cost( + &self, + tx: T, + tolerance: Option, + ) -> Result { + let NodeInfo { min_gas_price, .. } = self.node_info().await?; + let gas_price = std::cmp::max(tx.gas_price(), min_gas_price); + let tolerance = tolerance.unwrap_or(DEFAULT_GAS_ESTIMATION_TOLERANCE); + + // Remove limits from an existing Transaction for accurate gas estimation + let dry_run_tx = self.generate_dry_run_tx(tx.clone()); + let gas_used = self + .get_gas_used_with_tolerance(dry_run_tx.clone(), tolerance) + .await?; + + // Update the tx with estimated gas_used and correct gas price to calculate the total_fee + let dry_run_tx = dry_run_tx + .with_gas_price(gas_price) + .with_gas_limit(gas_used); + + let transaction_fee = dry_run_tx + .fee_checked_from_tx(&self.consensus_parameters) + .expect("Error calculating TransactionFee"); + + Ok(TransactionCost { + min_gas_price, + gas_price, + gas_used, + metered_bytes_size: dry_run_tx.metered_bytes_size() as u64, + total_fee: transaction_fee.max_fee(), + }) + } + + // Remove limits from an existing Transaction to get an accurate gas estimation + fn generate_dry_run_tx(&self, tx: T) -> T { + // Simulate the contract call with max gas to get the complete gas_used + let max_gas_per_tx = self.consensus_parameters.max_gas_per_tx; + tx.clone().with_gas_limit(max_gas_per_tx).with_gas_price(0) + } + + // Increase estimated gas by the provided tolerance + async fn get_gas_used_with_tolerance( + &self, + tx: T, + tolerance: f64, + ) -> Result { + let gas_used = self.get_gas_used(&self.dry_run_no_validation(tx).await?); + Ok((gas_used as f64 * (1.0 + tolerance)) as u64) + } + + fn get_gas_used(&self, receipts: &[Receipt]) -> u64 { + receipts + .iter() + .rfind(|r| matches!(r, Receipt::ScriptResult { .. })) + .map(|script_result| { + script_result + .gas_used() + .expect("could not retrieve gas used from ScriptResult") + }) + .unwrap_or(0) + } + + pub async fn get_messages(&self, from: &Bech32Address) -> ProviderResult> { + let pagination = PaginationRequest { + cursor: None, + results: 100, + direction: PageDirection::Forward, + }; + Ok(self + .client + .messages(Some(&from.into()), pagination) + .await? + .results + .into_iter() + .map(Into::into) + .collect()) + } + + pub async fn get_message_proof( + &self, + tx_id: &TxId, + message_id: &MessageId, + commit_block_id: Option<&Bytes32>, + commit_block_height: Option, + ) -> ProviderResult> { + let proof = self + .client + .message_proof( + tx_id, + message_id, + commit_block_id.map(Into::into), + commit_block_height.map(Into::into), + ) + .await? + .map(Into::into); + Ok(proof) + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-accounts/src/wallet.rs b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/wallet.rs new file mode 100644 index 00000000..4aaa9f51 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-accounts/src/wallet.rs @@ -0,0 +1,416 @@ +use std::{fmt, ops, path::Path}; + +use async_trait::async_trait; +use elliptic_curve::rand_core; +use eth_keystore::KeystoreError; +use fuel_crypto::{Message, PublicKey, SecretKey, Signature}; +use fuels_core::{ + constants::BASE_ASSET_ID, + types::{ + bech32::{Bech32Address, FUEL_BECH32_HRP}, + errors::{Error, Result}, + input::Input, + transaction_builders::TransactionBuilder, + AssetId, + }, +}; +use rand::{CryptoRng, Rng}; +use thiserror::Error; + +use crate::{ + accounts_utils::{adjust_inputs, adjust_outputs, calculate_base_amount_with_fee}, + provider::{Provider, ProviderError}, + Account, AccountError, AccountResult, Signer, ViewOnlyAccount, +}; + +pub const DEFAULT_DERIVATION_PATH_PREFIX: &str = "m/44'/1179993420'"; + +#[derive(Error, Debug)] +/// Error thrown by the Wallet module +pub enum WalletError { + /// Error propagated from the hex crate. + #[error(transparent)] + Hex(#[from] hex::FromHexError), + /// Error propagated by parsing of a slice + #[error("Failed to parse slice")] + Parsing(#[from] std::array::TryFromSliceError), + /// Keystore error + #[error(transparent)] + KeystoreError(#[from] KeystoreError), + #[error(transparent)] + FuelCrypto(#[from] fuel_crypto::Error), + #[error(transparent)] + ProviderError(#[from] ProviderError), + #[error("Called `try_provider` method on wallet where no provider was set up")] + NoProviderError, +} + +impl From for Error { + fn from(e: WalletError) -> Self { + Error::WalletError(e.to_string()) + } +} + +type WalletResult = std::result::Result; + +/// A FuelVM-compatible wallet that can be used to list assets, balances and more. +/// +/// Note that instances of the `Wallet` type only know their public address, and as a result can +/// only perform read-only operations. +/// +/// In order to sign messages or send transactions, a `Wallet` must first call [`Wallet::unlock`] +/// with a valid private key to produce a [`WalletUnlocked`]. +#[derive(Clone)] +pub struct Wallet { + /// The wallet's address. The wallet's address is derived + /// from the first 32 bytes of SHA-256 hash of the wallet's public key. + pub(crate) address: Bech32Address, + provider: Option, +} + +/// A `WalletUnlocked` is equivalent to a [`Wallet`] whose private key is known and stored +/// alongside in-memory. Knowing the private key allows a `WalletUlocked` to sign operations, send +/// transactions, and more. +#[derive(Clone, Debug)] +pub struct WalletUnlocked { + wallet: Wallet, + pub(crate) private_key: SecretKey, +} + +impl Wallet { + /// Construct a Wallet from its given public address. + pub fn from_address(address: Bech32Address, provider: Option) -> Self { + Self { address, provider } + } + + pub fn provider(&self) -> Option<&Provider> { + self.provider.as_ref() + } + + pub fn set_provider(&mut self, provider: Provider) { + self.provider = Some(provider); + } + + pub fn address(&self) -> &Bech32Address { + &self.address + } + + /// Unlock the wallet with the given `private_key`. + /// + /// The private key will be stored in memory until `wallet.lock()` is called or until the + /// wallet is `drop`ped. + pub fn unlock(self, private_key: SecretKey) -> WalletUnlocked { + WalletUnlocked { + wallet: self, + private_key, + } + } +} + +impl ViewOnlyAccount for Wallet { + fn address(&self) -> &Bech32Address { + self.address() + } + + fn try_provider(&self) -> AccountResult<&Provider> { + self.provider.as_ref().ok_or(AccountError::no_provider()) + } +} + +impl WalletUnlocked { + /// Lock the wallet by `drop`ping the private key from memory. + pub fn lock(self) -> Wallet { + self.wallet + } + + // NOTE: Rather than providing a `DerefMut` implementation, we wrap the `set_provider` method + // directly. This is because we should not allow the user a `&mut` handle to the inner `Wallet` + // as this could lead to ending up with a `WalletUnlocked` in an inconsistent state (e.g. the + // private key doesn't match the inner wallet's public key). + pub fn set_provider(&mut self, provider: Provider) { + self.wallet.set_provider(provider); + } + + /// Creates a new wallet with a random private key. + pub fn new_random(provider: Option) -> Self { + let mut rng = rand::thread_rng(); + let private_key = SecretKey::random(&mut rng); + Self::new_from_private_key(private_key, provider) + } + + /// Creates a new wallet from the given private key. + pub fn new_from_private_key(private_key: SecretKey, provider: Option) -> Self { + let public = PublicKey::from(&private_key); + let hashed = public.hash(); + let address = Bech32Address::new(FUEL_BECH32_HRP, hashed); + Wallet::from_address(address, provider).unlock(private_key) + } + + /// Creates a new wallet from a mnemonic phrase. + /// The default derivation path is used. + pub fn new_from_mnemonic_phrase( + phrase: &str, + provider: Option, + ) -> WalletResult { + let path = format!("{DEFAULT_DERIVATION_PATH_PREFIX}/0'/0/0"); + Self::new_from_mnemonic_phrase_with_path(phrase, provider, &path) + } + + /// Creates a new wallet from a mnemonic phrase. + /// It takes a path to a BIP32 derivation path. + pub fn new_from_mnemonic_phrase_with_path( + phrase: &str, + provider: Option, + path: &str, + ) -> WalletResult { + let secret_key = SecretKey::new_from_mnemonic_phrase_with_path(phrase, path)?; + + Ok(Self::new_from_private_key(secret_key, provider)) + } + + /// Creates a new wallet and stores its encrypted version in the given path. + pub fn new_from_keystore( + dir: P, + rng: &mut R, + password: S, + provider: Option, + ) -> WalletResult<(Self, String)> + where + P: AsRef, + R: Rng + CryptoRng + rand_core::CryptoRng, + S: AsRef<[u8]>, + { + let (secret, uuid) = eth_keystore::new(dir, rng, password, None)?; + + let secret_key = + SecretKey::try_from(secret.as_slice()).expect("A new secret should be correct size"); + + let wallet = Self::new_from_private_key(secret_key, provider); + + Ok((wallet, uuid)) + } + + /// Encrypts the wallet's private key with the given password and saves it + /// to the given path. + pub fn encrypt(&self, dir: P, password: S) -> WalletResult + where + P: AsRef, + S: AsRef<[u8]>, + { + let mut rng = rand::thread_rng(); + + Ok(eth_keystore::encrypt_key( + dir, + &mut rng, + *self.private_key, + password, + None, + )?) + } + + /// Recreates a wallet from an encrypted JSON wallet given the provided path and password. + pub fn load_keystore( + keypath: P, + password: S, + provider: Option, + ) -> WalletResult + where + P: AsRef, + S: AsRef<[u8]>, + { + let secret = eth_keystore::decrypt_key(keypath, password)?; + let secret_key = SecretKey::try_from(secret.as_slice()) + .expect("Decrypted key should have a correct size"); + Ok(Self::new_from_private_key(secret_key, provider)) + } +} + +impl ViewOnlyAccount for WalletUnlocked { + fn address(&self) -> &Bech32Address { + self.wallet.address() + } + + fn try_provider(&self) -> AccountResult<&Provider> { + self.provider.as_ref().ok_or(AccountError::no_provider()) + } +} + +#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] +impl Account for WalletUnlocked { + /// Returns a vector consisting of `Input::Coin`s and `Input::Message`s for the given + /// asset ID and amount. The `witness_index` is the position of the witness (signature) + /// in the transaction's list of witnesses. In the validation process, the node will + /// use the witness at this index to validate the coins returned by this method. + async fn get_asset_inputs_for_amount( + &self, + asset_id: AssetId, + amount: u64, + ) -> Result> { + Ok(self + .get_spendable_resources(asset_id, amount) + .await? + .into_iter() + .map(Input::resource_signed) + .collect::>()) + } + + async fn add_fee_resources( + &self, + mut tb: Tb, + previous_base_amount: u64, + ) -> Result { + let consensus_parameters = self.try_provider()?.consensus_parameters(); + tb = tb.with_consensus_parameters(consensus_parameters); + + self.sign_transaction(&mut tb); + + let new_base_amount = + calculate_base_amount_with_fee(&tb, &consensus_parameters, previous_base_amount)?; + + let new_base_inputs = self + .get_asset_inputs_for_amount(BASE_ASSET_ID, new_base_amount) + .await?; + + adjust_inputs(&mut tb, new_base_inputs); + adjust_outputs(&mut tb, self.address(), new_base_amount); + + tb.build() + } +} + +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +impl Signer for WalletUnlocked { + type Error = WalletError; + async fn sign_message>( + &self, + message: S, + ) -> WalletResult { + let message = Message::new(message); + let sig = Signature::sign(&self.private_key, &message); + Ok(sig) + } + + fn sign_transaction(&self, tb: &mut impl TransactionBuilder) { + tb.add_unresolved_signature(self.address().clone(), self.private_key); + } +} + +impl fmt::Debug for Wallet { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Wallet") + .field("address", &self.address) + .finish() + } +} + +impl ops::Deref for WalletUnlocked { + type Target = Wallet; + fn deref(&self) -> &Self::Target { + &self.wallet + } +} + +/// Generates a random mnemonic phrase given a random number generator and the number of words to +/// generate, `count`. +pub fn generate_mnemonic_phrase(rng: &mut R, count: usize) -> WalletResult { + Ok(fuel_crypto::generate_mnemonic_phrase(rng, count)?) +} + +#[cfg(test)] +mod tests { + use tempfile::tempdir; + + use super::*; + + #[tokio::test] + async fn encrypted_json_keystore() -> Result<()> { + let dir = tempdir()?; + let mut rng = rand::thread_rng(); + + // Create a wallet to be stored in the keystore. + let (wallet, uuid) = WalletUnlocked::new_from_keystore(&dir, &mut rng, "password", None)?; + + // sign a message using the above key. + let message = "Hello there!"; + let signature = wallet.sign_message(message).await?; + + // Read from the encrypted JSON keystore and decrypt it. + let path = Path::new(dir.path()).join(uuid); + let recovered_wallet = WalletUnlocked::load_keystore(path.clone(), "password", None)?; + + // Sign the same message as before and assert that the signature is the same. + let signature2 = recovered_wallet.sign_message(message).await?; + assert_eq!(signature, signature2); + + // Remove tempdir. + assert!(std::fs::remove_file(&path).is_ok()); + Ok(()) + } + + #[tokio::test] + async fn mnemonic_generation() -> Result<()> { + let mnemonic = generate_mnemonic_phrase(&mut rand::thread_rng(), 12)?; + + let _wallet = WalletUnlocked::new_from_mnemonic_phrase(&mnemonic, None)?; + Ok(()) + } + + #[tokio::test] + async fn wallet_from_mnemonic_phrase() -> Result<()> { + let phrase = + "oblige salon price punch saddle immune slogan rare snap desert retire surprise"; + + // Create first account from mnemonic phrase. + let wallet = + WalletUnlocked::new_from_mnemonic_phrase_with_path(phrase, None, "m/44'/60'/0'/0/0")?; + + let expected_plain_address = + "df9d0e6c6c5f5da6e82e5e1a77974af6642bdb450a10c43f0c6910a212600185"; + let expected_address = "fuel1m7wsumrvtaw6d6pwtcd809627ejzhk69pggvg0cvdyg2yynqqxzseuzply"; + + assert_eq!(wallet.address().hash().to_string(), expected_plain_address); + assert_eq!(wallet.address().to_string(), expected_address); + + // Create a second account from the same phrase. + let wallet2 = + WalletUnlocked::new_from_mnemonic_phrase_with_path(phrase, None, "m/44'/60'/1'/0/0")?; + + let expected_second_plain_address = + "261191b0164a24fd0fd51566ec5e5b0b9ba8fb2d42dc9cf7dbbd6f23d2742759"; + let expected_second_address = + "fuel1ycgervqkfgj06r74z4nwchjmpwd637edgtwfea7mh4hj85n5yavszjk4cc"; + + assert_eq!( + wallet2.address().hash().to_string(), + expected_second_plain_address + ); + assert_eq!(wallet2.address().to_string(), expected_second_address); + + Ok(()) + } + + #[tokio::test] + async fn encrypt_and_store_wallet_from_mnemonic() -> Result<()> { + let dir = tempdir()?; + + let phrase = + "oblige salon price punch saddle immune slogan rare snap desert retire surprise"; + + // Create first account from mnemonic phrase. + let wallet = + WalletUnlocked::new_from_mnemonic_phrase_with_path(phrase, None, "m/44'/60'/0'/0/0")?; + + let uuid = wallet.encrypt(&dir, "password")?; + + let path = Path::new(dir.path()).join(uuid); + + let recovered_wallet = WalletUnlocked::load_keystore(&path, "password", None)?; + + assert_eq!(wallet.address(), recovered_wallet.address()); + + // Remove tempdir. + assert!(std::fs::remove_file(&path).is_ok()); + Ok(()) + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/Cargo.toml b/docs/beta-4/fuels-rs/packages/fuels-core/Cargo.toml new file mode 100644 index 00000000..f2e759eb --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "fuels-core" +version = { workspace = true } +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +rust-version = { workspace = true } +description = "Fuel Rust SDK core." + +[dependencies] +bech32 = { workspace = true } +chrono = { workspace = true } +fuel-abi-types = { workspace = true } +fuel-asm = { workspace = true } +fuel-core = { workspace = true, default-features = false, optional = true } +fuel-core-chain-config = { workspace = true } +fuel-core-client = { workspace = true, optional = true } +fuel-crypto = { workspace = true } +fuel-tx = { workspace = true } +fuel-types = { workspace = true, features = ["default"] } +fuel-vm = { workspace = true } +fuels-macros = { workspace = true } +hex = { workspace = true, features = ["std"] } +itertools = { workspace = true } +proc-macro2 = { workspace = true } +regex = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true, default-features = true } +sha2 = { workspace = true } +strum = { workspace = true } +strum_macros = { workspace = true } +thiserror = { workspace = true, default-features = false } +uint = { version = "0.9.5", default-features = false } + +[features] +default = ["std"] +std = ["dep:fuel-core-client"] diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/codec.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec.rs new file mode 100644 index 00000000..c70f4496 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec.rs @@ -0,0 +1,73 @@ +mod abi_decoder; +mod abi_encoder; +mod function_selector; + +pub use abi_decoder::*; +pub use abi_encoder::*; +pub use function_selector::*; + +use crate::{ + traits::{Parameterize, Tokenizable}, + types::errors::Result, +}; + +pub fn try_from_bytes(bytes: &[u8]) -> Result +where + T: Parameterize + Tokenizable, +{ + let token = ABIDecoder::decode_single(&T::param_type(), bytes)?; + + T::from_token(token) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{ + constants::WORD_SIZE, + types::{Address, AssetId, ContractId}, + }; + + #[test] + fn can_convert_bytes_into_tuple() -> Result<()> { + let tuple_in_bytes: Vec = vec![0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2]; + + let the_tuple: (u64, u32) = try_from_bytes(&tuple_in_bytes)?; + + assert_eq!(the_tuple, (1, 2)); + + Ok(()) + } + + #[test] + fn can_convert_all_from_bool_to_u64() -> Result<()> { + let bytes: Vec = vec![0xFF; WORD_SIZE]; + + assert!(try_from_bytes::(&bytes)?); + assert_eq!(try_from_bytes::(&bytes)?, u8::MAX); + assert_eq!(try_from_bytes::(&bytes)?, u16::MAX); + assert_eq!(try_from_bytes::(&bytes)?, u32::MAX); + assert_eq!(try_from_bytes::(&bytes)?, u64::MAX); + + Ok(()) + } + + #[test] + fn can_convert_native_types() -> Result<()> { + let bytes = [0xFF; 32]; + + assert_eq!( + try_from_bytes::
(&bytes)?, + Address::new(bytes.as_slice().try_into()?) + ); + assert_eq!( + try_from_bytes::(&bytes)?, + ContractId::new(bytes.as_slice().try_into()?) + ); + assert_eq!( + try_from_bytes::(&bytes)?, + AssetId::new(bytes.as_slice().try_into()?) + ); + Ok(()) + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_decoder.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_decoder.rs new file mode 100644 index 00000000..ecacff9e --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_decoder.rs @@ -0,0 +1,810 @@ +use std::{convert::TryInto, str}; + +use fuel_types::bytes::padded_len_usize; + +use crate::{ + constants::WORD_SIZE, + traits::Tokenizable, + types::{ + enum_variants::EnumVariants, + errors::{error, Error, Result}, + param_types::ParamType, + StaticStringToken, Token, U256, + }, +}; + +const U128_BYTES_SIZE: usize = 2 * WORD_SIZE; +const U256_BYTES_SIZE: usize = 4 * WORD_SIZE; +const B256_BYTES_SIZE: usize = 4 * WORD_SIZE; + +#[derive(Debug, Clone)] +struct DecodeResult { + token: Token, + bytes_read: usize, +} + +pub struct ABIDecoder; + +impl ABIDecoder { + /// Decodes types described by `param_types` into their respective `Token`s + /// using the data in `bytes` and `receipts`. + /// + /// # Arguments + /// + /// * `param_types`: The ParamType's of the types we expect are encoded + /// inside `bytes` and `receipts`. + /// * `bytes`: The bytes to be used in the decoding process. + /// # Examples + /// + /// ``` + /// use fuels_core::codec::ABIDecoder; + /// use fuels_core::types::{param_types::ParamType, Token}; + /// + /// let tokens = ABIDecoder::decode(&[ParamType::U8, ParamType::U8], &[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2]).unwrap(); + /// + /// assert_eq!(tokens, vec![Token::U8(1), Token::U8(2)]) + /// ``` + pub fn decode(param_types: &[ParamType], bytes: &[u8]) -> Result> { + let (tokens, _) = Self::decode_multiple(param_types, bytes)?; + + Ok(tokens) + } + + /// The same as `decode` just for a single type. Used in most cases since + /// contract functions can only return one type. + pub fn decode_single(param_type: &ParamType, bytes: &[u8]) -> Result { + Ok(Self::decode_param(param_type, bytes)?.token) + } + + fn decode_param(param_type: &ParamType, bytes: &[u8]) -> Result { + if param_type.contains_nested_heap_types() { + return Err(error!( + InvalidData, + "Type {param_type:?} contains nested heap types (`Vec` or `Bytes`), this is not supported." + )); + } + match param_type { + ParamType::Unit => Self::decode_unit(bytes), + ParamType::U8 => Self::decode_u8(bytes), + ParamType::U16 => Self::decode_u16(bytes), + ParamType::U32 => Self::decode_u32(bytes), + ParamType::U64 => Self::decode_u64(bytes), + ParamType::U128 => Self::decode_u128(bytes), + ParamType::U256 => Self::decode_u256(bytes), + ParamType::Bool => Self::decode_bool(bytes), + ParamType::B256 => Self::decode_b256(bytes), + ParamType::RawSlice => Self::decode_raw_slice(bytes), + ParamType::StringSlice => Self::decode_string_slice(bytes), + ParamType::StringArray(len) => Self::decode_string_array(bytes, *len), + ParamType::Array(ref t, length) => Self::decode_array(t, bytes, *length), + ParamType::Struct { fields, .. } => Self::decode_struct(fields, bytes), + ParamType::Enum { variants, .. } => Self::decode_enum(bytes, variants), + ParamType::Tuple(types) => Self::decode_tuple(types, bytes), + ParamType::Vector(param_type) => Self::decode_vector(param_type, bytes), + ParamType::Bytes => Self::decode_bytes(bytes), + ParamType::String => Self::decode_std_string(bytes), + } + } + + fn decode_bytes(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::Bytes(bytes.to_vec()), + bytes_read: bytes.len(), + }) + } + + fn decode_std_string(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::String(str::from_utf8(bytes)?.to_string()), + bytes_read: bytes.len(), + }) + } + + fn decode_vector(param_type: &ParamType, bytes: &[u8]) -> Result { + let num_of_elements = ParamType::calculate_num_of_elements(param_type, bytes.len())?; + let (tokens, bytes_read) = Self::decode_multiple(vec![param_type; num_of_elements], bytes)?; + + Ok(DecodeResult { + token: Token::Vector(tokens), + bytes_read, + }) + } + + fn decode_tuple(param_types: &[ParamType], bytes: &[u8]) -> Result { + let (tokens, bytes_read) = Self::decode_multiple(param_types, bytes)?; + + Ok(DecodeResult { + token: Token::Tuple(tokens), + bytes_read, + }) + } + + fn decode_struct(param_types: &[ParamType], bytes: &[u8]) -> Result { + let (tokens, bytes_read) = Self::decode_multiple(param_types, bytes)?; + + Ok(DecodeResult { + token: Token::Struct(tokens), + bytes_read, + }) + } + + fn decode_multiple<'a>( + param_types: impl IntoIterator, + bytes: &[u8], + ) -> Result<(Vec, usize)> { + let mut results = vec![]; + + let mut bytes_read = 0; + + for param_type in param_types { + let res = Self::decode_param(param_type, skip(bytes, bytes_read)?)?; + bytes_read += res.bytes_read; + results.push(res.token); + } + + Ok((results, bytes_read)) + } + + fn decode_array(param_type: &ParamType, bytes: &[u8], length: usize) -> Result { + let (tokens, bytes_read) = Self::decode_multiple(&vec![param_type.clone(); length], bytes)?; + + Ok(DecodeResult { + token: Token::Array(tokens), + bytes_read, + }) + } + + fn decode_raw_slice(bytes: &[u8]) -> Result { + let raw_slice_element = ParamType::U64; + let num_of_elements = + ParamType::calculate_num_of_elements(&raw_slice_element, bytes.len())?; + let (tokens, bytes_read) = + Self::decode_multiple(&vec![ParamType::U64; num_of_elements], bytes)?; + let elements = tokens + .into_iter() + .map(u64::from_token) + .collect::>>() + .map_err(|e| error!(InvalidData, "{e}"))?; + + Ok(DecodeResult { + token: Token::RawSlice(elements), + bytes_read, + }) + } + + fn decode_string_slice(bytes: &[u8]) -> Result { + let decoded = str::from_utf8(bytes)?; + + Ok(DecodeResult { + token: Token::StringSlice(StaticStringToken::new(decoded.into(), None)), + bytes_read: decoded.len(), + }) + } + + fn decode_string_array(bytes: &[u8], length: usize) -> Result { + let encoded_len = padded_len_usize(length); + let encoded_str = peek(bytes, encoded_len)?; + + let decoded = str::from_utf8(&encoded_str[..length])?; + let result = DecodeResult { + token: Token::StringArray(StaticStringToken::new(decoded.into(), Some(length))), + bytes_read: encoded_len, + }; + Ok(result) + } + + fn decode_b256(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::B256(*peek_fixed::<32>(bytes)?), + bytes_read: B256_BYTES_SIZE, + }) + } + + fn decode_bool(bytes: &[u8]) -> Result { + // Grab last byte of the word and compare it to 0x00 + let b = peek_u8(bytes)? != 0u8; + + let result = DecodeResult { + token: Token::Bool(b), + bytes_read: WORD_SIZE, + }; + + Ok(result) + } + + fn decode_u128(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::U128(peek_u128(bytes)?), + bytes_read: U128_BYTES_SIZE, + }) + } + + fn decode_u256(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::U256(peek_u256(bytes)?), + bytes_read: U256_BYTES_SIZE, + }) + } + + fn decode_u64(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::U64(peek_u64(bytes)?), + bytes_read: WORD_SIZE, + }) + } + + fn decode_u32(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::U32(peek_u32(bytes)?), + bytes_read: WORD_SIZE, + }) + } + + fn decode_u16(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::U16(peek_u16(bytes)?), + bytes_read: WORD_SIZE, + }) + } + + fn decode_u8(bytes: &[u8]) -> Result { + Ok(DecodeResult { + token: Token::U8(peek_u8(bytes)?), + bytes_read: WORD_SIZE, + }) + } + + fn decode_unit(bytes: &[u8]) -> Result { + // We don't need the data, we're doing this purely as a bounds + // check. + peek_fixed::(bytes)?; + Ok(DecodeResult { + token: Token::Unit, + bytes_read: WORD_SIZE, + }) + } + + /// The encoding follows the ABI specs defined + /// [here](https://github.com/FuelLabs/fuel-specs/blob/1be31f70c757d8390f74b9e1b3beb096620553eb/specs/protocol/abi.md) + /// + /// # Arguments + /// + /// * `data`: slice of encoded data on whose beginning we're expecting an encoded enum + /// * `variants`: all types that this particular enum type could hold + fn decode_enum(bytes: &[u8], variants: &EnumVariants) -> Result { + let enum_width = variants.compute_encoding_width_of_enum(); + + let discriminant = peek_u32(bytes)? as u8; + let selected_variant = variants.param_type_of_variant(discriminant)?; + + let words_to_skip = enum_width - selected_variant.compute_encoding_width(); + let enum_content_bytes = skip(bytes, words_to_skip * WORD_SIZE)?; + let result = Self::decode_token_in_enum(enum_content_bytes, variants, selected_variant)?; + + let selector = Box::new((discriminant, result.token, variants.clone())); + Ok(DecodeResult { + token: Token::Enum(selector), + bytes_read: enum_width * WORD_SIZE, + }) + } + + fn decode_token_in_enum( + bytes: &[u8], + variants: &EnumVariants, + selected_variant: &ParamType, + ) -> Result { + // Enums that contain only Units as variants have only their discriminant encoded. + // Because of this we construct the Token::Unit rather than calling `decode_param` + if variants.only_units_inside() { + Ok(DecodeResult { + token: Token::Unit, + bytes_read: 0, + }) + } else { + Self::decode_param(selected_variant, bytes) + } + } +} + +fn peek_u128(bytes: &[u8]) -> Result { + let slice = peek_fixed::(bytes)?; + Ok(u128::from_be_bytes(*slice)) +} + +fn peek_u256(bytes: &[u8]) -> Result { + let slice = peek_fixed::(bytes)?; + Ok(U256::from(*slice)) +} + +fn peek_u64(bytes: &[u8]) -> Result { + let slice = peek_fixed::(bytes)?; + Ok(u64::from_be_bytes(*slice)) +} + +fn peek_u32(bytes: &[u8]) -> Result { + const BYTES: usize = std::mem::size_of::(); + + let slice = peek_fixed::(bytes)?; + let bytes = slice[WORD_SIZE - BYTES..] + .try_into() + .expect("peek_u32: You must use a slice containing exactly 4B."); + Ok(u32::from_be_bytes(bytes)) +} + +fn peek_u16(bytes: &[u8]) -> Result { + const BYTES: usize = std::mem::size_of::(); + + let slice = peek_fixed::(bytes)?; + let bytes = slice[WORD_SIZE - BYTES..] + .try_into() + .expect("peek_u16: You must use a slice containing exactly 2B."); + Ok(u16::from_be_bytes(bytes)) +} + +fn peek_u8(bytes: &[u8]) -> Result { + const BYTES: usize = std::mem::size_of::(); + + let slice = peek_fixed::(bytes)?; + let bytes = slice[WORD_SIZE - BYTES..] + .try_into() + .expect("peek_u8: You must use a slice containing exactly 1B."); + Ok(u8::from_be_bytes(bytes)) +} + +fn peek_fixed(data: &[u8]) -> Result<&[u8; LEN]> { + let slice_w_correct_length = peek(data, LEN)?; + Ok(<&[u8; LEN]>::try_from(slice_w_correct_length) + .expect("peek(data,len) must return a slice of length `len` or error out")) +} + +fn peek(data: &[u8], len: usize) -> Result<&[u8]> { + if len > data.len() { + Err(error!( + InvalidData, + "tried to read {len} bytes from response but only had {} remaining!", + data.len() + )) + } else { + Ok(&data[..len]) + } +} + +fn skip(slice: &[u8], num_bytes: usize) -> Result<&[u8]> { + if num_bytes > slice.len() { + Err(error!( + InvalidData, + "tried to consume {num_bytes} bytes from response but only had {} remaining!", + slice.len() + )) + } else { + Ok(&slice[num_bytes..]) + } +} + +#[cfg(test)] +mod tests { + use std::vec; + + use super::*; + + #[test] + fn decode_int() -> Result<()> { + let data = [0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff]; + + let decoded = ABIDecoder::decode_single(&ParamType::U32, &data)?; + + assert_eq!(decoded, Token::U32(u32::MAX)); + Ok(()) + } + + #[test] + fn decode_multiple_int() -> Result<()> { + let types = vec![ + ParamType::U32, + ParamType::U8, + ParamType::U16, + ParamType::U64, + ]; + let data = [ + 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, + ]; + + let decoded = ABIDecoder::decode(&types, &data)?; + + let expected = vec![ + Token::U32(u32::MAX), + Token::U8(u8::MAX), + Token::U16(u16::MAX), + Token::U64(u64::MAX), + ]; + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_bool() -> Result<()> { + let types = vec![ParamType::Bool, ParamType::Bool]; + let data = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x00, + ]; + + let decoded = ABIDecoder::decode(&types, &data)?; + + let expected = vec![Token::Bool(true), Token::Bool(false)]; + + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_b256() -> Result<()> { + let data = [ + 0xd5, 0x57, 0x9c, 0x46, 0xdf, 0xcc, 0x7f, 0x18, 0x20, 0x70, 0x13, 0xe6, 0x5b, 0x44, + 0xe4, 0xcb, 0x4e, 0x2c, 0x22, 0x98, 0xf4, 0xac, 0x45, 0x7b, 0xa8, 0xf8, 0x27, 0x43, + 0xf3, 0x1e, 0x93, 0xb, + ]; + + let decoded = ABIDecoder::decode_single(&ParamType::B256, &data)?; + + assert_eq!(decoded, Token::B256(data)); + Ok(()) + } + + #[test] + fn decode_string_array() -> Result<()> { + let types = vec![ParamType::StringArray(23), ParamType::StringArray(5)]; + let data = [ + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, // This is + 0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, // a full s + 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x00, // entence + 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, // Hello + ]; + + let decoded = ABIDecoder::decode(&types, &data)?; + + let expected = vec![ + Token::StringArray(StaticStringToken::new( + "This is a full sentence".into(), + Some(23), + )), + Token::StringArray(StaticStringToken::new("Hello".into(), Some(5))), + ]; + + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_string_slice() -> Result<()> { + let types = vec![ParamType::StringSlice]; + let data = [ + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, // This is + 0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, // a full s + 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, // entence + ]; + + let decoded = ABIDecoder::decode(&types, &data)?; + + let expected = vec![Token::StringSlice(StaticStringToken::new( + "This is a full sentence".into(), + None, + ))]; + + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_array() -> Result<()> { + // Create a parameter type for u8[2]. + let types = vec![ParamType::Array(Box::new(ParamType::U8), 2)]; + let data = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2a, + ]; + + let decoded = ABIDecoder::decode(&types, &data)?; + + let expected = vec![Token::Array(vec![Token::U8(255), Token::U8(42)])]; + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_struct() -> Result<()> { + // struct MyStruct { + // foo: u8, + // bar: bool, + // } + + let data = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + ]; + let param_type = ParamType::Struct { + fields: vec![ParamType::U8, ParamType::Bool], + generics: vec![], + }; + + let decoded = ABIDecoder::decode_single(¶m_type, &data)?; + + let expected = Token::Struct(vec![Token::U8(1), Token::Bool(true)]); + + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_bytes() -> Result<()> { + let data = [0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05]; + let decoded = ABIDecoder::decode_single(&ParamType::Bytes, &data)?; + + let expected = Token::Bytes(data.to_vec()); + + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_enum() -> Result<()> { + // enum MyEnum { + // x: u32, + // y: bool, + // } + + let types = vec![ParamType::U32, ParamType::Bool]; + let inner_enum_types = EnumVariants::new(types)?; + let types = vec![ParamType::Enum { + variants: inner_enum_types.clone(), + generics: vec![], + }]; + + // "0" discriminant and 42 enum value + let data = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2a, + ]; + + let decoded = ABIDecoder::decode(&types, &data)?; + + let expected = vec![Token::Enum(Box::new((0, Token::U32(42), inner_enum_types)))]; + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decoder_will_skip_enum_padding_and_decode_next_arg() -> Result<()> { + // struct MyStruct { + // par1: MyEnum, + // par2: u32 + // } + + // enum MyEnum { + // x: b256, + // y: u32, + // } + + let types = vec![ParamType::B256, ParamType::U32]; + let inner_enum_types = EnumVariants::new(types)?; + + let fields = vec![ + ParamType::Enum { + variants: inner_enum_types.clone(), + generics: vec![], + }, + ParamType::U32, + ]; + let struct_type = ParamType::Struct { + fields, + generics: vec![], + }; + + let enum_discriminant_enc = vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1]; + let enum_data_enc = vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x39]; + // this padding is due to the biggest variant of MyEnum being 3 WORDs bigger than the chosen variant + let enum_padding_enc = vec![0x0; 3 * WORD_SIZE]; + let struct_par2_enc = vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xD4, 0x31]; + let data: Vec = vec![ + enum_discriminant_enc, + enum_padding_enc, + enum_data_enc, + struct_par2_enc, + ] + .into_iter() + .flatten() + .collect(); + + let decoded = ABIDecoder::decode_single(&struct_type, &data)?; + + let expected = Token::Struct(vec![ + Token::Enum(Box::new((1, Token::U32(12345), inner_enum_types))), + Token::U32(54321), + ]); + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn decode_nested_struct() -> Result<()> { + // struct Foo { + // x: u16, + // y: Bar, + // } + // + // struct Bar { + // a: bool, + // b: u8[2], + // } + + let fields = vec![ + ParamType::U16, + ParamType::Struct { + fields: vec![ + ParamType::Bool, + ParamType::Array(Box::new(ParamType::U8), 2), + ], + generics: vec![], + }, + ]; + let nested_struct = ParamType::Struct { + fields, + generics: vec![], + }; + + let data = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, + ]; + + let decoded = ABIDecoder::decode_single(&nested_struct, &data)?; + + let my_nested_struct = vec![ + Token::U16(10), + Token::Struct(vec![ + Token::Bool(true), + Token::Array(vec![Token::U8(1), Token::U8(2)]), + ]), + ]; + + assert_eq!(decoded, Token::Struct(my_nested_struct)); + Ok(()) + } + + #[test] + fn decode_comprehensive() -> Result<()> { + // struct Foo { + // x: u16, + // y: Bar, + // } + // + // struct Bar { + // a: bool, + // b: u8[2], + // } + + // fn: long_function(Foo,u8[2],b256,str[3],str) + + // Parameters + let fields = vec![ + ParamType::U16, + ParamType::Struct { + fields: vec![ + ParamType::Bool, + ParamType::Array(Box::new(ParamType::U8), 2), + ], + generics: vec![], + }, + ]; + let nested_struct = ParamType::Struct { + fields, + generics: vec![], + }; + + let u8_arr = ParamType::Array(Box::new(ParamType::U8), 2); + let b256 = ParamType::B256; + let s = ParamType::StringArray(3); + let ss = ParamType::StringSlice; + + let types = [nested_struct, u8_arr, b256, s, ss]; + + let bytes = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, // foo.x == 10u16 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // foo.y.a == true + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // foo.b.0 == 1u8 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, // foo.b.1 == 2u8 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // u8[2].0 == 1u8 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, // u8[2].0 == 2u8 + 0xd5, 0x57, 0x9c, 0x46, 0xdf, 0xcc, 0x7f, 0x18, // b256 + 0x20, 0x70, 0x13, 0xe6, 0x5b, 0x44, 0xe4, 0xcb, // b256 + 0x4e, 0x2c, 0x22, 0x98, 0xf4, 0xac, 0x45, 0x7b, // b256 + 0xa8, 0xf8, 0x27, 0x43, 0xf3, 0x1e, 0x93, 0xb, // b256 + 0x66, 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, // str[3] + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, // str data + 0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, // str data + 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, // str data + ]; + + let decoded = ABIDecoder::decode(&types, &bytes)?; + + // Expected tokens + let foo = Token::Struct(vec![ + Token::U16(10), + Token::Struct(vec![ + Token::Bool(true), + Token::Array(vec![Token::U8(1), Token::U8(2)]), + ]), + ]); + + let u8_arr = Token::Array(vec![Token::U8(1), Token::U8(2)]); + + let b256 = Token::B256([ + 0xd5, 0x57, 0x9c, 0x46, 0xdf, 0xcc, 0x7f, 0x18, 0x20, 0x70, 0x13, 0xe6, 0x5b, 0x44, + 0xe4, 0xcb, 0x4e, 0x2c, 0x22, 0x98, 0xf4, 0xac, 0x45, 0x7b, 0xa8, 0xf8, 0x27, 0x43, + 0xf3, 0x1e, 0x93, 0xb, + ]); + + let ss = Token::StringSlice(StaticStringToken::new( + "This is a full sentence".into(), + None, + )); + + let s = Token::StringArray(StaticStringToken::new("foo".into(), Some(3))); + + let expected: Vec = vec![foo, u8_arr, b256, s, ss]; + + assert_eq!(decoded, expected); + Ok(()) + } + + #[test] + fn units_in_structs_are_decoded_as_one_word() -> Result<()> { + let data = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + ]; + let struct_type = ParamType::Struct { + fields: vec![ParamType::Unit, ParamType::U64], + generics: vec![], + }; + + let actual = ABIDecoder::decode_single(&struct_type, &data)?; + + let expected = Token::Struct(vec![Token::Unit, Token::U64(u64::MAX)]); + assert_eq!(actual, expected); + Ok(()) + } + + #[test] + fn enums_with_all_unit_variants_are_decoded_from_one_word() -> Result<()> { + let data = [0, 0, 0, 0, 0, 0, 0, 1]; + let types = vec![ParamType::Unit, ParamType::Unit]; + let variants = EnumVariants::new(types)?; + let enum_w_only_units = ParamType::Enum { + variants: variants.clone(), + generics: vec![], + }; + + let result = ABIDecoder::decode_single(&enum_w_only_units, &data)?; + + let expected_enum = Token::Enum(Box::new((1, Token::Unit, variants))); + assert_eq!(result, expected_enum); + Ok(()) + } + + #[test] + fn out_of_bounds_discriminant_is_detected() -> Result<()> { + let data = [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2]; + let types = vec![ParamType::U32]; + let variants = EnumVariants::new(types)?; + let enum_type = ParamType::Enum { + variants, + generics: vec![], + }; + + let result = ABIDecoder::decode_single(&enum_type, &data); + + let error = result.expect_err("Should have resulted in an error"); + + let expected_msg = "Discriminant '1' doesn't point to any variant: "; + assert!(matches!(error, Error::InvalidData(str) if str.starts_with(expected_msg))); + Ok(()) + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_encoder.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_encoder.rs new file mode 100644 index 00000000..6d53e049 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/abi_encoder.rs @@ -0,0 +1,1203 @@ +use fuel_types::bytes::padded_len_usize; +use itertools::Itertools; + +use crate::{ + constants::WORD_SIZE, + types::{ + errors::Result, + pad_string, pad_u16, pad_u32, pad_u8, + unresolved_bytes::{Data, UnresolvedBytes}, + EnumSelector, StaticStringToken, Token, U256, + }, +}; + +pub struct ABIEncoder; + +impl ABIEncoder { + /// Encodes `Token`s in `args` following the ABI specs defined + /// [here](https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/abi.md) + pub fn encode(args: &[Token]) -> Result { + let data = Self::encode_tokens(args)?; + + Ok(UnresolvedBytes::new(data)) + } + + fn encode_tokens(tokens: &[Token]) -> Result> { + tokens + .iter() + .map(Self::encode_token) + .flatten_ok() + .collect::>>() + } + + fn encode_token(arg: &Token) -> Result> { + let encoded_token = match arg { + Token::U8(arg_u8) => vec![Self::encode_u8(*arg_u8)], + Token::U16(arg_u16) => vec![Self::encode_u16(*arg_u16)], + Token::U32(arg_u32) => vec![Self::encode_u32(*arg_u32)], + Token::U64(arg_u64) => vec![Self::encode_u64(*arg_u64)], + Token::U128(arg_u128) => vec![Self::encode_u128(*arg_u128)], + Token::U256(arg_u256) => vec![Self::encode_u256(*arg_u256)], + Token::Bool(arg_bool) => vec![Self::encode_bool(*arg_bool)], + Token::B256(arg_bits256) => vec![Self::encode_b256(arg_bits256)], + Token::Array(arg_array) => Self::encode_array(arg_array)?, + Token::Vector(data) => Self::encode_vector(data)?, + Token::StringSlice(arg_string) => Self::encode_string_slice(arg_string)?, + Token::StringArray(arg_string) => vec![Self::encode_string_array(arg_string)?], + Token::Struct(arg_struct) => Self::encode_struct(arg_struct)?, + Token::Enum(arg_enum) => Self::encode_enum(arg_enum)?, + Token::Tuple(arg_tuple) => Self::encode_tuple(arg_tuple)?, + Token::Unit => vec![Self::encode_unit()], + Token::RawSlice(data) => Self::encode_raw_slice(data)?, + Token::Bytes(data) => Self::encode_bytes(data.to_vec())?, + // `String` in Sway has the same memory layout as the bytes type + Token::String(string) => Self::encode_bytes(string.clone().into_bytes())?, + }; + + Ok(encoded_token) + } + + fn encode_unit() -> Data { + Data::Inline(vec![0; WORD_SIZE]) + } + + fn encode_tuple(arg_tuple: &[Token]) -> Result> { + Self::encode_tokens(arg_tuple) + } + + fn encode_struct(subcomponents: &[Token]) -> Result> { + Self::encode_tokens(subcomponents) + } + + fn encode_array(arg_array: &[Token]) -> Result> { + Self::encode_tokens(arg_array) + } + + fn encode_b256(arg_bits256: &[u8; 32]) -> Data { + Data::Inline(arg_bits256.to_vec()) + } + + fn encode_bool(arg_bool: bool) -> Data { + Data::Inline(pad_u8(u8::from(arg_bool)).to_vec()) + } + + fn encode_u128(arg_u128: u128) -> Data { + Data::Inline(arg_u128.to_be_bytes().to_vec()) + } + + fn encode_u256(arg_u256: U256) -> Data { + let mut bytes = [0u8; 32]; + arg_u256.to_big_endian(&mut bytes); + Data::Inline(bytes.to_vec()) + } + + fn encode_u64(arg_u64: u64) -> Data { + Data::Inline(arg_u64.to_be_bytes().to_vec()) + } + + fn encode_u32(arg_u32: u32) -> Data { + Data::Inline(pad_u32(arg_u32).to_vec()) + } + + fn encode_u16(arg_u16: u16) -> Data { + Data::Inline(pad_u16(arg_u16).to_vec()) + } + + fn encode_u8(arg_u8: u8) -> Data { + Data::Inline(pad_u8(arg_u8).to_vec()) + } + + fn encode_enum(selector: &EnumSelector) -> Result> { + let (discriminant, token_within_enum, variants) = selector; + + let mut encoded_enum = vec![Self::encode_discriminant(*discriminant)]; + + // Enums that contain only Units as variants have only their discriminant encoded. + if !variants.only_units_inside() { + let variant_param_type = variants.param_type_of_variant(*discriminant)?; + let padding_amount = variants.compute_padding_amount(variant_param_type); + + encoded_enum.push(Data::Inline(vec![0; padding_amount])); + + let token_data = Self::encode_token(token_within_enum)?; + encoded_enum.extend(token_data); + } + + Ok(encoded_enum) + } + + fn encode_discriminant(discriminant: u8) -> Data { + Self::encode_u8(discriminant) + } + + fn encode_vector(data: &[Token]) -> Result> { + let encoded_data = Self::encode_tokens(data)?; + let cap = data.len() as u64; + let len = data.len() as u64; + + // A vector is expected to be encoded as 3 WORDs -- a ptr, a cap and a + // len. This means that we must place the encoded vector elements + // somewhere else. Hence the use of Data::Dynamic which will, when + // resolved, leave behind in its place only a pointer to the actual + // data. + Ok(vec![ + Data::Dynamic(encoded_data), + Self::encode_u64(cap), + Self::encode_u64(len), + ]) + } + + fn encode_raw_slice(data: &[u64]) -> Result> { + let encoded_data = data + .iter() + .map(|&word| Self::encode_u64(word)) + .collect::>(); + + let num_bytes = data.len() * WORD_SIZE; + + let len = Self::encode_u64(num_bytes as u64); + Ok(vec![Data::Dynamic(encoded_data), len]) + } + + fn encode_string_slice(arg_string: &StaticStringToken) -> Result> { + let encoded_data = Data::Inline(arg_string.get_encodable_str()?.as_bytes().to_vec()); + + let num_bytes = arg_string.get_encodable_str()?.len(); + let len = Self::encode_u64(num_bytes as u64); + Ok(vec![Data::Dynamic(vec![encoded_data]), len]) + } + + fn encode_string_array(arg_string: &StaticStringToken) -> Result { + Ok(Data::Inline(pad_string(arg_string.get_encodable_str()?))) + } + + fn encode_bytes(mut data: Vec) -> Result> { + let len = data.len(); + + zeropad_to_word_alignment(&mut data); + + let cap = data.len() as u64; + let encoded_data = vec![Data::Inline(data)]; + + Ok(vec![ + Data::Dynamic(encoded_data), + Self::encode_u64(cap), + Self::encode_u64(len as u64), + ]) + } +} + +fn zeropad_to_word_alignment(data: &mut Vec) { + let padded_length = padded_len_usize(data.len()); + data.resize(padded_length, 0); +} + +#[cfg(test)] +mod tests { + use std::slice; + + use itertools::chain; + use sha2::{Digest, Sha256}; + + use super::*; + use crate::{ + codec::first_four_bytes_of_sha256_hash, + types::{enum_variants::EnumVariants, param_types::ParamType}, + }; + + const VEC_METADATA_SIZE: usize = 3 * WORD_SIZE; + const DISCRIMINANT_SIZE: usize = WORD_SIZE; + + #[test] + fn encode_function_signature() { + let fn_signature = "entry_one(u64)"; + + let result = first_four_bytes_of_sha256_hash(fn_signature); + + println!("Encoded function selector for ({fn_signature}): {result:#0x?}"); + + assert_eq!(result, [0x0, 0x0, 0x0, 0x0, 0x0c, 0x36, 0xcb, 0x9c]); + } + + #[test] + fn encode_function_with_u32_type() -> Result<()> { + // @todo eventually we must update the json abi examples in here. + // They're in the old format. + // + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"u32"}], + // "name":"entry_one", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "entry_one(u32)"; + let arg = Token::U32(u32::MAX); + + let args: Vec = vec![arg]; + + let expected_encoded_abi = [0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0xb7, 0x9e, 0xf7, 0x43]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_u32_type_multiple_args() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"first","type":"u32"},{"name":"second","type":"u32"}], + // "name":"takes_two", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_two(u32,u32)"; + let first = Token::U32(u32::MAX); + let second = Token::U32(u32::MAX); + + let args: Vec = vec![first, second]; + + let expected_encoded_abi = [ + 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, + ]; + + let expected_fn_selector = [0x0, 0x0, 0x0, 0x0, 0xa7, 0x07, 0xb0, 0x8e]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_fn_selector); + Ok(()) + } + + #[test] + fn encode_function_with_u64_type() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"u64"}], + // "name":"entry_one", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "entry_one(u64)"; + let arg = Token::U64(u64::MAX); + + let args: Vec = vec![arg]; + + let expected_encoded_abi = [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0x0c, 0x36, 0xcb, 0x9c]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_bool_type() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"bool"}], + // "name":"bool_check", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "bool_check(bool)"; + let arg = Token::Bool(true); + + let args: Vec = vec![arg]; + + let expected_encoded_abi = [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0x66, 0x8f, 0xff, 0x58]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_two_different_type() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"first","type":"u32"},{"name":"second","type":"bool"}], + // "name":"takes_two_types", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_two_types(u32,bool)"; + let first = Token::U32(u32::MAX); + let second = Token::Bool(true); + + let args: Vec = vec![first, second]; + + let expected_encoded_abi = [ + 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0xf5, 0x40, 0x73, 0x2b]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_bits256_type() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"b256"}], + // "name":"takes_bits256", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_bits256(b256)"; + + let mut hasher = Sha256::new(); + hasher.update("test string".as_bytes()); + + let arg = hasher.finalize(); + + let arg = Token::B256(arg.into()); + + let args: Vec = vec![arg]; + + let expected_encoded_abi = [ + 0xd5, 0x57, 0x9c, 0x46, 0xdf, 0xcc, 0x7f, 0x18, 0x20, 0x70, 0x13, 0xe6, 0x5b, 0x44, + 0xe4, 0xcb, 0x4e, 0x2c, 0x22, 0x98, 0xf4, 0xac, 0x45, 0x7b, 0xa8, 0xf8, 0x27, 0x43, + 0xf3, 0x1e, 0x93, 0xb, + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0x01, 0x49, 0x42, 0x96]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_array_type() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"u8[3]"}], + // "name":"takes_integer_array", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_integer_array(u8[3])"; + + // Keeping the construction of the arguments array separate for better readability. + let first = Token::U8(1); + let second = Token::U8(2); + let third = Token::U8(3); + + let arg = vec![first, second, third]; + let arg_array = Token::Array(arg); + + let args: Vec = vec![arg_array]; + + let expected_encoded_abi = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0x2c, 0x5a, 0x10, 0x2e]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_string_array_type() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"str[23]"}], + // "name":"takes_string", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_string(str[23])"; + + let args: Vec = vec![Token::StringArray(StaticStringToken::new( + "This is a full sentence".into(), + Some(23), + ))]; + + let expected_encoded_abi = [ + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, + 0x20, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x00, + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0xd5, 0x6e, 0x76, 0x51]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_string_slice_type() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"str"}], + // "name":"takes_string", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_string(str)"; + + let args: Vec = vec![Token::StringSlice(StaticStringToken::new( + "This is a full sentence".into(), + None, + ))]; + + let expected_encoded_abi = [ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // str at data index 16 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // str of lenght 23 + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, // + 0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, // + 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, // + ]; + + let expected_function_selector = [0, 0, 0, 0, 239, 77, 222, 230]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_struct() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"MyStruct"}], + // "name":"takes_my_struct", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_my_struct(MyStruct)"; + + // struct MyStruct { + // foo: u8, + // bar: bool, + // } + + let foo = Token::U8(1); + let bar = Token::Bool(true); + + // Create the custom struct token using the array of tuples above + let arg = Token::Struct(vec![foo, bar]); + + let args: Vec = vec![arg]; + + let expected_encoded_abi = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0xa8, 0x1e, 0x8d, 0xd7]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_function_with_enum() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"MyEnum"}], + // "name":"takes_my_enum", + // "outputs": [] + // } + // ] + // "#; + + let fn_signature = "takes_my_enum(MyEnum)"; + + // enum MyEnum { + // x: u32, + // y: bool, + // } + let types = vec![ParamType::U32, ParamType::Bool]; + let params = EnumVariants::new(types)?; + + // An `EnumSelector` indicating that we've chosen the first Enum variant, + // whose value is 42 of the type ParamType::U32 and that the Enum could + // have held any of the other types present in `params`. + + let enum_selector = Box::new((0, Token::U32(42), params)); + + let arg = Token::Enum(enum_selector); + + let args: Vec = vec![arg]; + + let expected_encoded_abi = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2a, + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0x35, 0x5c, 0xa6, 0xfa]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + // The encoding follows the ABI specs defined [here](https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/abi.md) + #[test] + fn enums_are_sized_to_fit_the_biggest_variant() -> Result<()> { + // Our enum has two variants: B256, and U64. So the enum will set aside + // 256b of space or 4 WORDS because that is the space needed to fit the + // largest variant(B256). + let types = vec![ParamType::B256, ParamType::U64]; + let enum_variants = EnumVariants::new(types)?; + let enum_selector = Box::new((1, Token::U64(42), enum_variants)); + + let encoded = ABIEncoder::encode(slice::from_ref(&Token::Enum(enum_selector)))?.resolve(0); + + let enum_discriminant_enc = vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1]; + let u64_enc = vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2a]; + let enum_padding = vec![0x0; 24]; + + // notice the ordering, first the discriminant, then the necessary + // padding and then the value itself. + let expected: Vec = [enum_discriminant_enc, enum_padding, u64_enc] + .into_iter() + .flatten() + .collect(); + + assert_eq!(hex::encode(expected), hex::encode(encoded)); + Ok(()) + } + + #[test] + fn encoding_enums_with_deeply_nested_types() -> Result<()> { + /* + enum DeeperEnum { + v1: bool, + v2: str[10] + } + */ + let types = vec![ParamType::Bool, ParamType::StringArray(10)]; + let deeper_enum_variants = EnumVariants::new(types)?; + let deeper_enum_token = + Token::StringArray(StaticStringToken::new("0123456789".into(), Some(10))); + + let str_enc = vec![ + b'0', b'1', b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9', 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + ]; + let deeper_enum_discriminant_enc = vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1]; + + /* + struct StructA { + some_enum: DeeperEnum + some_number: u32 + } + */ + + let fields = vec![ + ParamType::Enum { + variants: deeper_enum_variants.clone(), + generics: vec![], + }, + ParamType::Bool, + ]; + let struct_a_type = ParamType::Struct { + fields, + generics: vec![], + }; + + let struct_a_token = Token::Struct(vec![ + Token::Enum(Box::new((1, deeper_enum_token, deeper_enum_variants))), + Token::U32(11332), + ]); + let some_number_enc = vec![0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c, 0x44]; + + /* + enum TopLevelEnum { + v1: StructA, + v2: bool, + v3: u64 + } + */ + + let types = vec![struct_a_type, ParamType::Bool, ParamType::U64]; + let top_level_enum_variants = EnumVariants::new(types)?; + let top_level_enum_token = + Token::Enum(Box::new((0, struct_a_token, top_level_enum_variants))); + let top_lvl_discriminant_enc = vec![0x0; 8]; + + let encoded = ABIEncoder::encode(slice::from_ref(&top_level_enum_token))?.resolve(0); + + let correct_encoding: Vec = [ + top_lvl_discriminant_enc, + deeper_enum_discriminant_enc, + str_enc, + some_number_enc, + ] + .into_iter() + .flatten() + .collect(); + + assert_eq!(hex::encode(correct_encoding), hex::encode(encoded)); + Ok(()) + } + + #[test] + fn encode_function_with_nested_structs() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type":"function", + // "inputs": [{"name":"arg","type":"Foo"}], + // "name":"takes_my_nested_struct", + // "outputs": [] + // } + // ] + // "#; + + // struct Foo { + // x: u16, + // y: Bar, + // } + // + // struct Bar { + // a: bool, + // b: u8[2], + // } + + let fn_signature = "takes_my_nested_struct(Foo)"; + + let args: Vec = vec![Token::Struct(vec![ + Token::U16(10), + Token::Struct(vec![ + Token::Bool(true), + Token::Array(vec![Token::U8(1), Token::U8(2)]), + ]), + ])]; + + let expected_encoded_abi = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0xea, 0x0a, 0xfd, 0x23]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + println!("Encoded ABI for ({fn_signature}): {encoded:#0x?}"); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn encode_comprehensive_function() -> Result<()> { + // let json_abi = + // r#" + // [ + // { + // "type": "contract", + // "inputs": [ + // { + // "name": "arg", + // "type": "Foo" + // }, + // { + // "name": "arg2", + // "type": "u8[2]" + // }, + // { + // "name": "arg3", + // "type": "b256" + // }, + // { + // "name": "arg", + // "type": "str[23]" + // } + // ], + // "name": "long_function", + // "outputs": [] + // } + // ] + // "#; + + // struct Foo { + // x: u16, + // y: Bar, + // } + // + // struct Bar { + // a: bool, + // b: u8[2], + // } + + let fn_signature = "long_function(Foo,u8[2],b256,str[23])"; + + let foo = Token::Struct(vec![ + Token::U16(10), + Token::Struct(vec![ + Token::Bool(true), + Token::Array(vec![Token::U8(1), Token::U8(2)]), + ]), + ]); + + let u8_arr = Token::Array(vec![Token::U8(1), Token::U8(2)]); + + let mut hasher = Sha256::new(); + hasher.update("test string".as_bytes()); + + let b256 = Token::B256(hasher.finalize().into()); + + let s = Token::StringArray(StaticStringToken::new( + "This is a full sentence".into(), + Some(23), + )); + + let args: Vec = vec![foo, u8_arr, b256, s]; + + let expected_encoded_abi = [ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, // foo.x == 10u16 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // foo.y.a == true + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // foo.b.0 == 1u8 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, // foo.b.1 == 2u8 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // u8[2].0 == 1u8 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, // u8[2].0 == 2u8 + 0xd5, 0x57, 0x9c, 0x46, 0xdf, 0xcc, 0x7f, 0x18, // b256 + 0x20, 0x70, 0x13, 0xe6, 0x5b, 0x44, 0xe4, 0xcb, // b256 + 0x4e, 0x2c, 0x22, 0x98, 0xf4, 0xac, 0x45, 0x7b, // b256 + 0xa8, 0xf8, 0x27, 0x43, 0xf3, 0x1e, 0x93, 0xb, // b256 + 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, // str[23] + 0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, // str[23] + 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x0, // str[23] + ]; + + let expected_function_selector = [0x0, 0x0, 0x0, 0x0, 0x10, 0x93, 0xb2, 0x12]; + + let encoded_function_selector = first_four_bytes_of_sha256_hash(fn_signature); + + let encoded = ABIEncoder::encode(&args)?.resolve(0); + + assert_eq!(hex::encode(expected_encoded_abi), hex::encode(encoded)); + assert_eq!(encoded_function_selector, expected_function_selector); + Ok(()) + } + + #[test] + fn enums_with_only_unit_variants_are_encoded_in_one_word() -> Result<()> { + let expected = [0, 0, 0, 0, 0, 0, 0, 1]; + + let types = vec![ParamType::Unit, ParamType::Unit]; + let enum_selector = Box::new((1, Token::Unit, EnumVariants::new(types)?)); + + let actual = ABIEncoder::encode(&[Token::Enum(enum_selector)])?.resolve(0); + + assert_eq!(actual, expected); + Ok(()) + } + + #[test] + fn units_in_composite_types_are_encoded_in_one_word() -> Result<()> { + let expected = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5]; + + let actual = + ABIEncoder::encode(&[Token::Struct(vec![Token::Unit, Token::U32(5)])])?.resolve(0); + + assert_eq!(actual, expected); + Ok(()) + } + + #[test] + fn enums_with_units_are_correctly_padded() -> Result<()> { + let discriminant = vec![0, 0, 0, 0, 0, 0, 0, 1]; + let padding = vec![0; 32]; + let expected: Vec = [discriminant, padding].into_iter().flatten().collect(); + + let types = vec![ParamType::B256, ParamType::Unit]; + let enum_selector = Box::new((1, Token::Unit, EnumVariants::new(types)?)); + + let actual = ABIEncoder::encode(&[Token::Enum(enum_selector)])?.resolve(0); + + assert_eq!(actual, expected); + Ok(()) + } + + #[test] + fn vector_has_ptr_cap_len_and_then_data() -> Result<()> { + // arrange + let offset: u8 = 150; + let token = Token::Vector(vec![Token::U64(5)]); + + // act + let result = ABIEncoder::encode(&[token])?.resolve(offset as u64); + + // assert + let ptr = [0, 0, 0, 0, 0, 0, 0, 3 * WORD_SIZE as u8 + offset]; + let cap = [0, 0, 0, 0, 0, 0, 0, 1]; + let len = [0, 0, 0, 0, 0, 0, 0, 1]; + let data = [0, 0, 0, 0, 0, 0, 0, 5]; + + let expected = chain!(ptr, cap, len, data).collect::>(); + + assert_eq!(result, expected); + + Ok(()) + } + + #[test] + fn data_from_two_vectors_aggregated_at_the_end() -> Result<()> { + // arrange + let offset: u8 = 40; + let vec_1 = Token::Vector(vec![Token::U64(5)]); + let vec_2 = Token::Vector(vec![Token::U64(6)]); + + // act + let result = ABIEncoder::encode(&[vec_1, vec_2])?.resolve(offset as u64); + + // assert + let vec1_data_offset = 6 * WORD_SIZE as u8 + offset; + let vec1_ptr = [0, 0, 0, 0, 0, 0, 0, vec1_data_offset]; + let vec1_cap = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_len = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_data = [0, 0, 0, 0, 0, 0, 0, 5]; + + let vec2_data_offset = vec1_data_offset + vec1_data.len() as u8; + let vec2_ptr = [0, 0, 0, 0, 0, 0, 0, vec2_data_offset]; + let vec2_cap = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec2_len = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec2_data = [0, 0, 0, 0, 0, 0, 0, 6]; + + let expected = chain!( + vec1_ptr, vec1_cap, vec1_len, vec2_ptr, vec2_cap, vec2_len, vec1_data, vec2_data, + ) + .collect::>(); + + assert_eq!(result, expected); + + Ok(()) + } + + #[test] + fn a_vec_in_an_enum() -> Result<()> { + // arrange + let offset = 40; + let types = vec![ParamType::B256, ParamType::Vector(Box::new(ParamType::U64))]; + let variants = EnumVariants::new(types)?; + let selector = (1, Token::Vector(vec![Token::U64(5)]), variants); + let token = Token::Enum(Box::new(selector)); + + // act + let result = ABIEncoder::encode(&[token])?.resolve(offset as u64); + + // assert + let discriminant = vec![0, 0, 0, 0, 0, 0, 0, 1]; + + const PADDING: usize = std::mem::size_of::<[u8; 32]>() - VEC_METADATA_SIZE; + + let vec1_ptr = ((DISCRIMINANT_SIZE + PADDING + VEC_METADATA_SIZE + offset) as u64) + .to_be_bytes() + .to_vec(); + let vec1_cap = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_len = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_data = [0, 0, 0, 0, 0, 0, 0, 5]; + + let expected = chain!( + discriminant, + vec![0; PADDING], + vec1_ptr, + vec1_cap, + vec1_len, + vec1_data + ) + .collect::>(); + + assert_eq!(result, expected); + + Ok(()) + } + + #[test] + fn an_enum_in_a_vec() -> Result<()> { + // arrange + let offset = 40; + let types = vec![ParamType::B256, ParamType::U8]; + let variants = EnumVariants::new(types)?; + let selector = (1, Token::U8(8), variants); + let enum_token = Token::Enum(Box::new(selector)); + + let vec_token = Token::Vector(vec![enum_token]); + + // act + let result = ABIEncoder::encode(&[vec_token])?.resolve(offset as u64); + + // assert + const PADDING: usize = std::mem::size_of::<[u8; 32]>() - WORD_SIZE; + + let vec1_ptr = ((VEC_METADATA_SIZE + offset) as u64).to_be_bytes().to_vec(); + let vec1_cap = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_len = [0, 0, 0, 0, 0, 0, 0, 1]; + let discriminant = 1u64.to_be_bytes(); + let vec1_data = chain!(discriminant, [0; PADDING], 8u64.to_be_bytes()).collect::>(); + + let expected = chain!(vec1_ptr, vec1_cap, vec1_len, vec1_data).collect::>(); + + assert_eq!(result, expected); + + Ok(()) + } + + #[test] + fn a_vec_in_a_struct() -> Result<()> { + // arrange + let offset = 40; + let token = Token::Struct(vec![Token::Vector(vec![Token::U64(5)]), Token::U8(9)]); + + // act + let result = ABIEncoder::encode(&[token])?.resolve(offset as u64); + + // assert + let vec1_ptr = ((VEC_METADATA_SIZE + WORD_SIZE + offset) as u64) + .to_be_bytes() + .to_vec(); + let vec1_cap = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_len = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_data = [0, 0, 0, 0, 0, 0, 0, 5]; + + let expected = chain!( + vec1_ptr, + vec1_cap, + vec1_len, + [0, 0, 0, 0, 0, 0, 0, 9], + vec1_data + ) + .collect::>(); + + assert_eq!(result, expected); + + Ok(()) + } + + #[test] + fn a_vec_in_a_vec() -> Result<()> { + // arrange + let offset = 40; + let token = Token::Vector(vec![Token::Vector(vec![Token::U8(5), Token::U8(6)])]); + + // act + let result = ABIEncoder::encode(&[token])?.resolve(offset as u64); + + // assert + let vec1_data_offset = (VEC_METADATA_SIZE + offset) as u64; + let vec1_ptr = vec1_data_offset.to_be_bytes().to_vec(); + let vec1_cap = [0, 0, 0, 0, 0, 0, 0, 1]; + let vec1_len = [0, 0, 0, 0, 0, 0, 0, 1]; + + let vec2_ptr = (vec1_data_offset + VEC_METADATA_SIZE as u64) + .to_be_bytes() + .to_vec(); + let vec2_cap = [0, 0, 0, 0, 0, 0, 0, 2]; + let vec2_len = [0, 0, 0, 0, 0, 0, 0, 2]; + let vec2_data = [0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6]; + + let vec1_data = chain!(vec2_ptr, vec2_cap, vec2_len, vec2_data).collect::>(); + + let expected = chain!(vec1_ptr, vec1_cap, vec1_len, vec1_data).collect::>(); + + assert_eq!(result, expected); + + Ok(()) + } + + #[test] + fn encoding_bytes() -> Result<()> { + // arrange + let token = Token::Bytes(vec![1, 2, 3]); + let offset = 40; + + // act + let encoded_bytes = ABIEncoder::encode(&[token])?.resolve(offset); + + // assert + let ptr = [0, 0, 0, 0, 0, 0, 0, 64]; + let cap = [0, 0, 0, 0, 0, 0, 0, 8]; + let len = [0, 0, 0, 0, 0, 0, 0, 3]; + let data = [1, 2, 3, 0, 0, 0, 0, 0]; + + let expected_encoded_bytes = [ptr, cap, len, data].concat(); + + assert_eq!(expected_encoded_bytes, encoded_bytes); + + Ok(()) + } + + #[test] + fn encoding_raw_slices() -> Result<()> { + // arrange + let token = Token::RawSlice(vec![1, 2, 3]); + let offset = 40; + + // act + let encoded_bytes = ABIEncoder::encode(&[token])?.resolve(offset); + + // assert + let ptr = vec![0, 0, 0, 0, 0, 0, 0, 56]; + let len = vec![0, 0, 0, 0, 0, 0, 0, 24]; + let data = [ + [0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 2], + [0, 0, 0, 0, 0, 0, 0, 3], + ] + .concat(); + + let expected_encoded_bytes = [ptr, len, data].concat(); + + assert_eq!(expected_encoded_bytes, encoded_bytes); + + Ok(()) + } + + #[test] + fn encoding_std_string() -> Result<()> { + // arrange + let string = String::from("This "); + let token = Token::String(string); + let offset = 40; + + // act + let encoded_std_string = ABIEncoder::encode(&[token])?.resolve(offset); + + // assert + let ptr = [0, 0, 0, 0, 0, 0, 0, 64]; + let cap = [0, 0, 0, 0, 0, 0, 0, 8]; + let len = [0, 0, 0, 0, 0, 0, 0, 5]; + let data = [0x54, 0x68, 0x69, 0x73, 0x20, 0, 0, 0]; + + let expected_encoded_std_string = [ptr, cap, len, data].concat(); + + assert_eq!(expected_encoded_std_string, encoded_std_string); + + Ok(()) + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/function_selector.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/function_selector.rs new file mode 100644 index 00000000..2e04683e --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/codec/function_selector.rs @@ -0,0 +1,264 @@ +use sha2::{Digest, Sha256}; + +use crate::types::{param_types::ParamType, ByteArray}; + +/// Given a function name and its inputs will return a ByteArray representing +/// the function selector as specified in the Fuel specs. +pub fn resolve_fn_selector(name: &str, inputs: &[ParamType]) -> ByteArray { + let fn_signature = resolve_fn_signature(name, inputs); + + first_four_bytes_of_sha256_hash(&fn_signature) +} + +fn resolve_fn_signature(name: &str, inputs: &[ParamType]) -> String { + let fn_args = resolve_args(inputs); + + format!("{name}({fn_args})") +} + +fn resolve_args(arg: &[ParamType]) -> String { + arg.iter().map(resolve_arg).collect::>().join(",") +} + +fn resolve_arg(arg: &ParamType) -> String { + match &arg { + ParamType::U8 => "u8".to_owned(), + ParamType::U16 => "u16".to_owned(), + ParamType::U32 => "u32".to_owned(), + ParamType::U64 => "u64".to_owned(), + ParamType::U128 => "s(u64,u64)".to_owned(), + ParamType::U256 => "s(u64,u64,u64,u64)".to_owned(), + ParamType::Bool => "bool".to_owned(), + ParamType::B256 => "b256".to_owned(), + ParamType::Unit => "()".to_owned(), + ParamType::StringSlice => "str".to_owned(), + ParamType::StringArray(len) => { + format!("str[{len}]") + } + ParamType::Array(internal_type, len) => { + let inner = resolve_arg(internal_type); + format!("a[{inner};{len}]") + } + ParamType::Struct { + fields, generics, .. + } => { + let gen_params = resolve_args(generics); + let field_params = resolve_args(fields); + let gen_params = if !gen_params.is_empty() { + format!("<{gen_params}>") + } else { + gen_params + }; + format!("s{gen_params}({field_params})") + } + ParamType::Enum { + variants: fields, + generics, + .. + } => { + let gen_params = resolve_args(generics); + let field_params = resolve_args(fields.param_types()); + let gen_params = if !gen_params.is_empty() { + format!("<{gen_params}>") + } else { + gen_params + }; + format!("e{gen_params}({field_params})") + } + ParamType::Tuple(inner) => { + let inner = resolve_args(inner); + format!("({inner})") + } + ParamType::Vector(el_type) => { + let inner = resolve_arg(el_type); + format!("s<{inner}>(s<{inner}>(rawptr,u64),u64)") + } + ParamType::RawSlice => "rawslice".to_string(), + ParamType::Bytes => "s(s(rawptr,u64),u64)".to_string(), + ParamType::String => "s(s(s(rawptr,u64),u64))".to_string(), + } +} + +/// Hashes an encoded function selector using SHA256 and returns the first 4 bytes. +/// The function selector has to have been already encoded following the ABI specs defined +/// [here](https://github.com/FuelLabs/fuel-specs/blob/1be31f70c757d8390f74b9e1b3beb096620553eb/specs/protocol/abi.md) +pub(crate) fn first_four_bytes_of_sha256_hash(string: &str) -> ByteArray { + let string_as_bytes = string.as_bytes(); + let mut hasher = Sha256::new(); + hasher.update(string_as_bytes); + let result = hasher.finalize(); + let mut output = ByteArray::default(); + output[4..].copy_from_slice(&result[..4]); + output +} + +#[macro_export] +macro_rules! fn_selector { + ( $fn_name: ident ( $($fn_arg: ty),* ) ) => { + ::fuels::core::codec::resolve_fn_selector( + stringify!($fn_name), + &[$( <$fn_arg as ::fuels::core::traits::Parameterize>::param_type() ),*] + ) + .to_vec() + } +} + +pub use fn_selector; + +#[macro_export] +macro_rules! calldata { + ( $($arg: expr),* ) => { + ::fuels::core::codec::ABIEncoder::encode(&[$(::fuels::core::traits::Tokenizable::into_token($arg)),*]) + .map(|ub| ub.resolve(0)) + } +} + +pub use calldata; + +#[cfg(test)] +mod tests { + use super::*; + use crate::types::enum_variants::EnumVariants; + + #[test] + fn handles_primitive_types() { + let check_selector_for_type = |primitive_type: ParamType, expected_selector: &str| { + let selector = resolve_fn_signature("some_fun", &[primitive_type]); + + assert_eq!(selector, format!("some_fun({expected_selector})")); + }; + + for (param_type, expected_signature) in [ + (ParamType::U8, "u8"), + (ParamType::U16, "u16"), + (ParamType::U32, "u32"), + (ParamType::U64, "u64"), + (ParamType::Bool, "bool"), + (ParamType::B256, "b256"), + (ParamType::Unit, "()"), + (ParamType::StringArray(15), "str[15]"), + (ParamType::StringSlice, "str"), + ] { + check_selector_for_type(param_type, expected_signature); + } + } + + #[test] + fn handles_std_strings() { + let inputs = [ParamType::String]; + + let signature = resolve_fn_signature("some_fn", &inputs); + + assert_eq!(signature, "some_fn(s(s(s(rawptr,u64),u64)))"); + } + + #[test] + fn handles_arrays() { + let inputs = [ParamType::Array(Box::new(ParamType::U8), 1)]; + + let signature = resolve_fn_signature("some_fun", &inputs); + + assert_eq!(signature, format!("some_fun(a[u8;1])")); + } + + #[test] + fn handles_tuples() { + let inputs = [ParamType::Tuple(vec![ParamType::U8, ParamType::U8])]; + + let selector = resolve_fn_signature("some_fun", &inputs); + + assert_eq!(selector, format!("some_fun((u8,u8))")); + } + + #[test] + fn handles_structs() { + let fields = vec![ParamType::U64, ParamType::U32]; + let generics = vec![ParamType::U32]; + let inputs = [ParamType::Struct { fields, generics }]; + + let selector = resolve_fn_signature("some_fun", &inputs); + + assert_eq!(selector, format!("some_fun(s(u64,u32))")); + } + + #[test] + fn handles_vectors() { + let inputs = [ParamType::Vector(Box::new(ParamType::U32))]; + + let selector = resolve_fn_signature("some_fun", &inputs); + + assert_eq!(selector, "some_fun(s(s(rawptr,u64),u64))") + } + + #[test] + fn handles_bytes() { + let inputs = [ParamType::Bytes]; + + let selector = resolve_fn_signature("some_fun", &inputs); + + assert_eq!(selector, "some_fun(s(s(rawptr,u64),u64))") + } + + #[test] + fn handles_enums() { + let types = vec![ParamType::U64, ParamType::U32]; + let variants = EnumVariants::new(types).unwrap(); + let generics = vec![ParamType::U32]; + let inputs = [ParamType::Enum { variants, generics }]; + + let selector = resolve_fn_signature("some_fun", &inputs); + + assert_eq!(selector, format!("some_fun(e(u64,u32))")); + } + + #[test] + fn ultimate_test() { + let fields = vec![ParamType::Struct { + fields: vec![ParamType::StringArray(2)], + generics: vec![ParamType::StringArray(2)], + }]; + let struct_a = ParamType::Struct { + fields, + generics: vec![ParamType::StringArray(2)], + }; + + let fields = vec![ParamType::Array(Box::new(struct_a.clone()), 2)]; + let struct_b = ParamType::Struct { + fields, + generics: vec![struct_a], + }; + + let fields = vec![ParamType::Tuple(vec![struct_b.clone(), struct_b.clone()])]; + let struct_c = ParamType::Struct { + fields, + generics: vec![struct_b], + }; + + let types = vec![ParamType::U64, struct_c.clone()]; + let fields = vec![ + ParamType::Tuple(vec![ + ParamType::Array(Box::new(ParamType::B256), 2), + ParamType::StringArray(2), + ]), + ParamType::Tuple(vec![ + ParamType::Array( + Box::new(ParamType::Enum { + variants: EnumVariants::new(types).unwrap(), + generics: vec![struct_c], + }), + 1, + ), + ParamType::U32, + ]), + ]; + + let inputs = [ParamType::Struct { + fields, + generics: vec![ParamType::StringArray(2), ParamType::B256], + }]; + + let selector = resolve_fn_signature("complex_test", &inputs); + + assert_eq!(selector, "complex_test(s((a[b256;2],str[2]),(a[e(s(str[2]))>(a[s(s(str[2]));2])>((s(s(str[2]))>(a[s(s(str[2]));2]),s(s(str[2]))>(a[s(s(str[2]));2])))>(u64,s(s(str[2]))>(a[s(s(str[2]));2])>((s(s(str[2]))>(a[s(s(str[2]));2]),s(s(str[2]))>(a[s(s(str[2]));2]))));1],u32)))"); + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/lib.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/lib.rs new file mode 100644 index 00000000..4fe809b0 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/lib.rs @@ -0,0 +1,24 @@ +pub mod codec; +pub mod traits; +pub mod types; +mod utils; + +pub use utils::*; + +#[derive(Debug, Clone, Default)] +pub struct Configurables { + offsets_with_data: Vec<(u64, Vec)>, +} + +impl Configurables { + pub fn new(offsets_with_data: Vec<(u64, Vec)>) -> Self { + Self { offsets_with_data } + } + + pub fn update_constants_in(&self, binary: &mut [u8]) { + for (offset, data) in &self.offsets_with_data { + let offset = *offset as usize; + binary[offset..offset + data.len()].copy_from_slice(data) + } + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/traits.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/traits.rs new file mode 100644 index 00000000..fa9fe98b --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/traits.rs @@ -0,0 +1,5 @@ +mod parameterize; +mod tokenizable; + +pub use parameterize::*; +pub use tokenizable::*; diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/traits/parameterize.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/traits/parameterize.rs new file mode 100644 index 00000000..447101a7 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/traits/parameterize.rs @@ -0,0 +1,222 @@ +use fuel_types::{Address, AssetId, ContractId}; + +use crate::types::{ + enum_variants::EnumVariants, param_types::ParamType, AsciiString, Bits256, Bytes, RawSlice, + SizedAsciiString, +}; + +/// `abigen` requires `Parameterized` to construct nested types. It is also used by `try_from_bytes` +/// to facilitate the instantiation of custom types from bytes. +pub trait Parameterize { + fn param_type() -> ParamType; +} + +impl Parameterize for Bits256 { + fn param_type() -> ParamType { + ParamType::B256 + } +} + +impl Parameterize for RawSlice { + fn param_type() -> ParamType { + ParamType::RawSlice + } +} + +impl Parameterize for [T; SIZE] { + fn param_type() -> ParamType { + ParamType::Array(Box::new(T::param_type()), SIZE) + } +} + +impl Parameterize for Vec { + fn param_type() -> ParamType { + ParamType::Vector(Box::new(T::param_type())) + } +} + +impl Parameterize for Bytes { + fn param_type() -> ParamType { + ParamType::Bytes + } +} + +impl Parameterize for String { + fn param_type() -> ParamType { + ParamType::String + } +} + +impl Parameterize for Address { + fn param_type() -> ParamType { + ParamType::Struct { + fields: vec![ParamType::B256], + generics: vec![], + } + } +} + +impl Parameterize for ContractId { + fn param_type() -> ParamType { + ParamType::Struct { + fields: vec![ParamType::B256], + generics: vec![], + } + } +} + +impl Parameterize for AssetId { + fn param_type() -> ParamType { + ParamType::Struct { + fields: vec![ParamType::B256], + generics: vec![], + } + } +} + +impl Parameterize for () { + fn param_type() -> ParamType { + ParamType::Unit + } +} + +impl Parameterize for bool { + fn param_type() -> ParamType { + ParamType::Bool + } +} + +impl Parameterize for u8 { + fn param_type() -> ParamType { + ParamType::U8 + } +} + +impl Parameterize for u16 { + fn param_type() -> ParamType { + ParamType::U16 + } +} + +impl Parameterize for u32 { + fn param_type() -> ParamType { + ParamType::U32 + } +} + +impl Parameterize for u64 { + fn param_type() -> ParamType { + ParamType::U64 + } +} + +impl Parameterize for u128 { + fn param_type() -> ParamType { + ParamType::U128 + } +} + +impl Parameterize for Option +where + T: Parameterize, +{ + fn param_type() -> ParamType { + let param_types = vec![ParamType::Unit, T::param_type()]; + let variants = EnumVariants::new(param_types) + .expect("should never happen as we provided valid Option param types"); + ParamType::Enum { + variants, + generics: vec![T::param_type()], + } + } +} + +impl Parameterize for Result +where + T: Parameterize, + E: Parameterize, +{ + fn param_type() -> ParamType { + let param_types = vec![T::param_type(), E::param_type()]; + let variants = EnumVariants::new(param_types.clone()) + .expect("should never happen as we provided valid Result param types"); + ParamType::Enum { + variants, + generics: param_types, + } + } +} + +impl Parameterize for SizedAsciiString { + fn param_type() -> ParamType { + ParamType::StringArray(LEN) + } +} + +impl Parameterize for AsciiString { + fn param_type() -> ParamType { + ParamType::StringSlice + } +} + +// Here we implement `Parameterize` for a given tuple of a given length. +// This is done this way because we can't use `impl Parameterize for (T,)`. +// So we implement `Parameterize` for each tuple length, covering +// a reasonable range of tuple lengths. +macro_rules! impl_parameterize_tuples { + ($num: expr, $( $ty: ident : $no: tt, )+) => { + impl<$($ty, )+> Parameterize for ($($ty,)+) where + $( + $ty: Parameterize, + )+ + { + fn param_type() -> ParamType { + ParamType::Tuple(vec![ + $( $ty::param_type(), )+ + ]) + } + + } + } +} + +// And where we actually implement the `Parameterize` for tuples +// from size 1 to size 16. +impl_parameterize_tuples!(1, A:0, ); +impl_parameterize_tuples!(2, A:0, B:1, ); +impl_parameterize_tuples!(3, A:0, B:1, C:2, ); +impl_parameterize_tuples!(4, A:0, B:1, C:2, D:3, ); +impl_parameterize_tuples!(5, A:0, B:1, C:2, D:3, E:4, ); +impl_parameterize_tuples!(6, A:0, B:1, C:2, D:3, E:4, F:5, ); +impl_parameterize_tuples!(7, A:0, B:1, C:2, D:3, E:4, F:5, G:6, ); +impl_parameterize_tuples!(8, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, ); +impl_parameterize_tuples!(9, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, ); +impl_parameterize_tuples!(10, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, ); +impl_parameterize_tuples!(11, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, ); +impl_parameterize_tuples!(12, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, ); +impl_parameterize_tuples!(13, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, ); +impl_parameterize_tuples!(14, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, ); +impl_parameterize_tuples!(15, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, ); +impl_parameterize_tuples!(16, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, ); + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn sized_ascii_string_is_parameterized_correctly() { + let param_type = SizedAsciiString::<3>::param_type(); + + assert!(matches!(param_type, ParamType::StringArray(3))); + } + + #[test] + fn test_param_type_b256() { + assert_eq!(Bits256::param_type(), ParamType::B256); + } + + #[test] + fn test_param_type_raw_slice() { + assert_eq!(RawSlice::param_type(), ParamType::RawSlice); + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/traits/tokenizable.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/traits/tokenizable.rs new file mode 100644 index 00000000..2413089f --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/traits/tokenizable.rs @@ -0,0 +1,623 @@ +use fuel_types::{Address, AssetId, ContractId}; + +use crate::{ + traits::Parameterize, + types::{ + errors::{error, Error, Result}, + param_types::ParamType, + AsciiString, Bits256, Bytes, RawSlice, SizedAsciiString, StaticStringToken, Token, + }, +}; + +pub trait Tokenizable { + /// Converts a `Token` into expected type. + fn from_token(token: Token) -> Result + where + Self: Sized; + /// Converts a specified type back into token. + fn into_token(self) -> Token; +} + +impl Tokenizable for Token { + fn from_token(token: Token) -> Result { + Ok(token) + } + fn into_token(self) -> Token { + self + } +} + +impl Tokenizable for Bits256 { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + match token { + Token::B256(data) => Ok(Bits256(data)), + _ => Err(error!( + InvalidData, + "Bits256 cannot be constructed from token {token}" + )), + } + } + + fn into_token(self) -> Token { + Token::B256(self.0) + } +} + +impl Tokenizable for Vec { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + if let Token::Vector(tokens) = token { + tokens.into_iter().map(Tokenizable::from_token).collect() + } else { + Err(error!( + InvalidData, + "Vec::from_token must only be given a Token::Vector. Got: {token}" + )) + } + } + + fn into_token(self) -> Token { + let tokens = self.into_iter().map(Tokenizable::into_token).collect(); + Token::Vector(tokens) + } +} + +impl Tokenizable for bool { + fn from_token(token: Token) -> Result { + match token { + Token::Bool(data) => Ok(data), + other => Err(error!( + InstantiationError, + "Expected `bool`, got {:?}", other + )), + } + } + fn into_token(self) -> Token { + Token::Bool(self) + } +} + +impl Tokenizable for () { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + match token { + Token::Unit => Ok(()), + other => Err(error!( + InstantiationError, + "Expected `Unit`, got {:?}", other + )), + } + } + + fn into_token(self) -> Token { + Token::Unit + } +} + +impl Tokenizable for u8 { + fn from_token(token: Token) -> Result { + match token { + Token::U8(data) => Ok(data), + other => Err(error!(InstantiationError, "Expected `u8`, got {:?}", other)), + } + } + fn into_token(self) -> Token { + Token::U8(self) + } +} + +impl Tokenizable for u16 { + fn from_token(token: Token) -> Result { + match token { + Token::U16(data) => Ok(data), + other => Err(error!( + InstantiationError, + "Expected `u16`, got {:?}", other + )), + } + } + fn into_token(self) -> Token { + Token::U16(self) + } +} + +impl Tokenizable for u32 { + fn from_token(token: Token) -> Result { + match token { + Token::U32(data) => Ok(data), + other => Err(error!( + InstantiationError, + "Expected `u32`, got {:?}", other + )), + } + } + fn into_token(self) -> Token { + Token::U32(self) + } +} + +impl Tokenizable for u64 { + fn from_token(token: Token) -> Result { + match token { + Token::U64(data) => Ok(data), + other => Err(error!( + InstantiationError, + "Expected `u64`, got {:?}", other + )), + } + } + fn into_token(self) -> Token { + Token::U64(self) + } +} + +impl Tokenizable for u128 { + fn from_token(token: Token) -> Result { + match token { + Token::U128(data) => Ok(data), + other => Err(error!( + InstantiationError, + "Expected `u128`, got {:?}", other + )), + } + } + fn into_token(self) -> Token { + Token::U128(self) + } +} + +impl Tokenizable for RawSlice { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + match token { + Token::RawSlice(contents) => Ok(Self(contents)), + _ => Err(error!(InvalidData, + "RawSlice::from_token expected a token of the variant Token::RawSlice, got: {token}" + )), + } + } + + fn into_token(self) -> Token { + Token::RawSlice(Vec::from(self)) + } +} + +impl Tokenizable for Bytes { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + match token { + Token::Bytes(contents) => Ok(Self(contents)), + _ => Err(error!( + InvalidData, + "Bytes::from_token expected a token of the variant Token::Bytes, got: {token}" + )), + } + } + + fn into_token(self) -> Token { + Token::Bytes(Vec::from(self)) + } +} + +impl Tokenizable for String { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + match token { + Token::String(string) => Ok(string), + _ => Err(error!( + InvalidData, + "String::from_token expected a token of the variant Token::String, got: {token}" + )), + } + } + + fn into_token(self) -> Token { + Token::String(self) + } +} + +// Here we implement `Tokenizable` for a given tuple of a given length. +// This is done this way because we can't use `impl Tokenizable for (T,)`. +// So we implement `Tokenizable` for each tuple length, covering +// a reasonable range of tuple lengths. +macro_rules! impl_tokenizable_tuples { + ($num: expr, $( $ty: ident : $no: tt, )+) => { + impl<$($ty, )+> Tokenizable for ($($ty,)+) where + $( + $ty: Tokenizable, + )+ + { + fn from_token(token: Token) -> Result { + match token { + Token::Tuple(tokens) => { + let mut it = tokens.into_iter(); + let mut next_token = move || { + it.next().ok_or_else(|| { + error!(InstantiationError,"Ran out of tokens before tuple could be constructed") + }) + }; + Ok(($( + $ty::from_token(next_token()?)?, + )+)) + }, + other => Err(error!(InstantiationError, + "Expected `Tuple`, got {:?}", + other + )), + } + } + + fn into_token(self) -> Token { + Token::Tuple(vec![ + $( self.$no.into_token(), )+ + ]) + } + } + + } +} + +// And where we actually implement the `Tokenizable` for tuples +// from size 1 to size 16. +impl_tokenizable_tuples!(1, A:0, ); +impl_tokenizable_tuples!(2, A:0, B:1, ); +impl_tokenizable_tuples!(3, A:0, B:1, C:2, ); +impl_tokenizable_tuples!(4, A:0, B:1, C:2, D:3, ); +impl_tokenizable_tuples!(5, A:0, B:1, C:2, D:3, E:4, ); +impl_tokenizable_tuples!(6, A:0, B:1, C:2, D:3, E:4, F:5, ); +impl_tokenizable_tuples!(7, A:0, B:1, C:2, D:3, E:4, F:5, G:6, ); +impl_tokenizable_tuples!(8, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, ); +impl_tokenizable_tuples!(9, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, ); +impl_tokenizable_tuples!(10, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, ); +impl_tokenizable_tuples!(11, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, ); +impl_tokenizable_tuples!(12, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, ); +impl_tokenizable_tuples!(13, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, ); +impl_tokenizable_tuples!(14, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, ); +impl_tokenizable_tuples!(15, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, ); +impl_tokenizable_tuples!(16, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, ); + +impl Tokenizable for ContractId { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + if let Token::Struct(tokens) = token { + if let [Token::B256(data)] = tokens.as_slice() { + Ok(ContractId::from(*data)) + } else { + Err(error!( + InstantiationError, + "ContractId expected one `Token::B256`, got {tokens:?}" + )) + } + } else { + Err(error!( + InstantiationError, + "Address expected `Token::Struct` got {token:?}" + )) + } + } + + fn into_token(self) -> Token { + let underlying_data: &[u8; 32] = &self; + Token::Struct(vec![Bits256(*underlying_data).into_token()]) + } +} + +impl Tokenizable for Address { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + if let Token::Struct(tokens) = token { + if let [Token::B256(data)] = tokens.as_slice() { + Ok(Address::from(*data)) + } else { + Err(error!( + InstantiationError, + "Address expected one `Token::B256`, got {tokens:?}" + )) + } + } else { + Err(error!( + InstantiationError, + "Address expected `Token::Struct` got {token:?}" + )) + } + } + + fn into_token(self) -> Token { + let underlying_data: &[u8; 32] = &self; + + Token::Struct(vec![Bits256(*underlying_data).into_token()]) + } +} + +impl Tokenizable for AssetId { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + if let Token::Struct(tokens) = token { + if let [Token::B256(data)] = tokens.as_slice() { + Ok(AssetId::from(*data)) + } else { + Err(error!( + InstantiationError, + "AssetId expected one `Token::B256`, got {tokens:?}" + )) + } + } else { + Err(error!( + InstantiationError, + "AssetId expected `Token::Struct` got {token:?}" + )) + } + } + + fn into_token(self) -> Token { + let underlying_data: &[u8; 32] = &self; + Token::Struct(vec![Bits256(*underlying_data).into_token()]) + } +} + +impl Tokenizable for Option +where + T: Tokenizable + Parameterize, +{ + fn from_token(token: Token) -> Result { + if let Token::Enum(enum_selector) = token { + match *enum_selector { + (0u8, _, _) => Ok(None), + (1u8, token, _) => Ok(Option::::Some(T::from_token(token)?)), + (_, _, _) => Err(error!( + InstantiationError, + "Could not construct Option from enum_selector. Received: {:?}", enum_selector + )), + } + } else { + Err(error!( + InstantiationError, + "Could not construct Option from token. Received: {token:?}" + )) + } + } + fn into_token(self) -> Token { + let (dis, tok) = match self { + None => (0u8, Token::Unit), + Some(value) => (1u8, value.into_token()), + }; + if let ParamType::Enum { variants, .. } = Self::param_type() { + let selector = (dis, tok, variants); + Token::Enum(Box::new(selector)) + } else { + panic!("should never happen as Option::param_type() returns valid Enum variants"); + } + } +} + +impl Tokenizable for std::result::Result +where + T: Tokenizable + Parameterize, + E: Tokenizable + Parameterize, +{ + fn from_token(token: Token) -> Result { + if let Token::Enum(enum_selector) = token { + match *enum_selector { + (0u8, token, _) => Ok(std::result::Result::::Ok(T::from_token(token)?)), + (1u8, token, _) => Ok(std::result::Result::::Err(E::from_token(token)?)), + (_, _, _) => Err(error!( + InstantiationError, + "Could not construct Result from enum_selector. Received: {:?}", enum_selector + )), + } + } else { + Err(error!( + InstantiationError, + "Could not construct Result from token. Received: {token:?}" + )) + } + } + fn into_token(self) -> Token { + let (dis, tok) = match self { + Ok(value) => (0u8, value.into_token()), + Err(value) => (1u8, value.into_token()), + }; + if let ParamType::Enum { variants, .. } = Self::param_type() { + let selector = (dis, tok, variants); + Token::Enum(Box::new(selector)) + } else { + panic!("should never happen as Result::param_type() returns valid Enum variants"); + } + } +} + +impl Tokenizable for [T; SIZE] { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + let gen_error = |reason| { + error!( + InvalidData, + "While constructing an array of size {SIZE}: {reason}" + ) + }; + + match token { + Token::Array(elements) => { + let len = elements.len(); + if len != SIZE { + return Err(gen_error(format!( + "Was given a Token::Array with wrong number of elements: {len}" + ))); + } + + let detokenized = elements + .into_iter() + .map(Tokenizable::from_token) + .collect::>>() + .map_err(|err| { + gen_error(format!(", not all elements could be detokenized: {err}")) + })?; + + Ok(detokenized.try_into().unwrap_or_else(|_| { + panic!("This should never fail since we're checking the length beforehand.") + })) + } + _ => Err(gen_error(format!("Expected a Token::Array, got {token}"))), + } + } + + fn into_token(self) -> Token { + Token::Array(self.map(Tokenizable::into_token).to_vec()) + } +} + +impl Tokenizable for SizedAsciiString { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + match token { + Token::StringArray(contents) => { + let expected_len = contents.get_encodable_str()?.len() ; + if expected_len!= LEN { + return Err(error!(InvalidData,"SizedAsciiString<{LEN}>::from_token got a Token::StringArray whose expected length({}) is != {LEN}", expected_len)) + } + Self::new(contents.try_into()?) + }, + _ => { + Err(error!(InvalidData,"SizedAsciiString<{LEN}>::from_token expected a token of the variant Token::StringArray, got: {token}")) + } + } + } + + fn into_token(self) -> Token { + Token::StringArray(StaticStringToken::new(self.into(), Some(LEN))) + } +} + +impl Tokenizable for AsciiString { + fn from_token(token: Token) -> Result + where + Self: Sized, + { + match token { + Token::StringSlice(contents) => { + Self::new(contents.try_into()?) + }, + _ => { + Err(error!(InvalidData,"AsciiString::from_token expected a token of the variant Token::StringSlice, got: {token}")) + } + } + } + + fn into_token(self) -> Token { + Token::StringSlice(StaticStringToken::new(self.into(), None)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_from_token_b256() -> Result<()> { + let data = [1u8; 32]; + let token = Token::B256(data); + + let bits256 = Bits256::from_token(token)?; + + assert_eq!(bits256.0, data); + + Ok(()) + } + + #[test] + fn test_into_token_b256() { + let bytes = [1u8; 32]; + let bits256 = Bits256(bytes); + + let token = bits256.into_token(); + + assert_eq!(token, Token::B256(bytes)); + } + + #[test] + fn test_from_token_raw_slice() -> Result<()> { + let data = vec![42; 11]; + let token = Token::RawSlice(data.clone()); + + let slice = RawSlice::from_token(token)?; + + assert_eq!(slice, data); + + Ok(()) + } + + #[test] + fn test_into_token_raw_slice() { + let data = vec![13; 32]; + let raw_slice_token = Token::RawSlice(data.clone()); + + let token = raw_slice_token.into_token(); + + assert_eq!(token, Token::RawSlice(data)); + } + + #[test] + fn sized_ascii_string_is_tokenized_correctly() -> Result<()> { + let sut = SizedAsciiString::<3>::new("abc".to_string())?; + + let token = sut.into_token(); + + match token { + Token::StringArray(string_token) => { + let contents = string_token.get_encodable_str()?; + assert_eq!(contents, "abc"); + } + _ => { + panic!("Not tokenized correctly! Should have gotten a Token::String") + } + } + + Ok(()) + } + + #[test] + fn sized_ascii_string_is_detokenized_correctly() -> Result<()> { + let token = Token::StringArray(StaticStringToken::new("abc".to_string(), Some(3))); + + let sized_ascii_string = + SizedAsciiString::<3>::from_token(token).expect("Should have succeeded"); + + assert_eq!(sized_ascii_string, "abc"); + + Ok(()) + } + + #[test] + fn test_into_token_std_string() -> Result<()> { + let expected = String::from("hello"); + let token = Token::String(expected.clone()); + let detokenized = String::from_token(token.into_token())?; + + assert_eq!(detokenized, expected); + + Ok(()) + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types.rs new file mode 100644 index 00000000..d423909f --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types.rs @@ -0,0 +1,139 @@ +use std::fmt; + +pub use fuel_tx::{Address, AssetId, ContractId, TxPointer, UtxoId}; +use fuel_types::bytes::padded_len; +pub use fuel_types::{ChainId, MessageId, Nonce}; + +pub use crate::types::{core::*, wrappers::*}; +use crate::types::{ + enum_variants::EnumVariants, + errors::{error, Error, Result}, +}; + +pub mod bech32; +mod core; +pub mod enum_variants; +pub mod errors; +pub mod param_types; +pub mod transaction_builders; +pub mod unresolved_bytes; +mod wrappers; + +pub type ByteArray = [u8; 8]; +pub type Selector = ByteArray; +pub type EnumSelector = (u8, Token, EnumVariants); + +#[derive(Debug, Clone, PartialEq, Eq, Default, serde::Serialize, serde::Deserialize)] +pub struct StaticStringToken { + data: String, + expected_len: Option, +} + +impl StaticStringToken { + pub fn new(data: String, expected_len: Option) -> Self { + StaticStringToken { data, expected_len } + } + + fn validate(&self) -> Result<()> { + if !self.data.is_ascii() { + return Err(error!( + InvalidData, + "String data can only have ascii values" + )); + } + + if let Some(expected_len) = self.expected_len { + if self.data.len() != expected_len { + return Err(error!( + InvalidData, + "String data has len {}, but the expected len is {}", + self.data.len(), + expected_len + )); + } + } + + Ok(()) + } + + pub fn get_encodable_str(&self) -> Result<&str> { + self.validate()?; + Ok(self.data.as_str()) + } +} + +impl TryFrom for String { + type Error = Error; + fn try_from(string_token: StaticStringToken) -> Result { + string_token.validate()?; + Ok(string_token.data) + } +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +pub enum Token { + // Used for unit type variants in Enum. An "empty" enum is not represented as Enum, + // because this way we can have both unit and non-unit type variants. + Unit, + U8(u8), + U16(u16), + U32(u32), + U64(u64), + U128(u128), + U256(U256), + Bool(bool), + B256([u8; 32]), + Array(Vec), + Vector(Vec), + StringSlice(StaticStringToken), + StringArray(StaticStringToken), + Struct(Vec), + Enum(Box), + Tuple(Vec), + RawSlice(Vec), + Bytes(Vec), + String(String), +} + +impl fmt::Display for Token { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{self:?}") + } +} + +impl Default for Token { + fn default() -> Self { + Token::U8(0) + } +} + +/// Converts a u8 to a right aligned array of 8 bytes. +pub fn pad_u8(value: u8) -> ByteArray { + let mut padded = ByteArray::default(); + padded[7] = value; + padded +} + +/// Converts a u16 to a right aligned array of 8 bytes. +pub fn pad_u16(value: u16) -> ByteArray { + let mut padded = ByteArray::default(); + padded[6..].copy_from_slice(&value.to_be_bytes()); + padded +} + +/// Converts a u32 to a right aligned array of 8 bytes. +pub fn pad_u32(value: u32) -> ByteArray { + let mut padded = [0u8; 8]; + padded[4..].copy_from_slice(&value.to_be_bytes()); + padded +} + +pub fn pad_string(s: &str) -> Vec { + let pad = padded_len(s.as_bytes()) - s.len(); + + let mut padded = s.as_bytes().to_owned(); + + padded.extend_from_slice(&vec![0; pad]); + + padded +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/bech32.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/bech32.rs new file mode 100644 index 00000000..2d7fab01 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/bech32.rs @@ -0,0 +1,240 @@ +use std::{ + fmt::{Display, Formatter}, + str::FromStr, +}; + +use bech32::{FromBase32, ToBase32, Variant::Bech32m}; +use fuel_tx::{Address, Bytes32, ContractId, ContractIdExt}; +use fuel_types::AssetId; + +use crate::types::{ + errors::{Error, Result}, + Bits256, +}; + +// Fuel Network human-readable part for bech32 encoding +pub const FUEL_BECH32_HRP: &str = "fuel"; + +/// Generate type represented in the Bech32 format, +/// consisting of a human-readable part (hrp) and a hash (e.g. pubkey-, contract hash) +macro_rules! bech32type { + ($i:ident) => { + #[derive(Debug, Clone, PartialEq, Eq, Hash)] + pub struct $i { + pub hrp: String, + pub hash: Bytes32, + } + + impl $i { + pub fn new>(hrp: &str, hash: T) -> Self { + Self { + hrp: hrp.to_string(), + hash: Bytes32::from(hash.into()), + } + } + + pub fn hash(&self) -> Bytes32 { + self.hash + } + + pub fn hrp(&self) -> &str { + &self.hrp + } + } + + impl Default for $i { + fn default() -> $i { + Self { + hrp: FUEL_BECH32_HRP.to_string(), + hash: Bytes32::new([0u8; 32]), + } + } + } + + impl FromStr for $i { + type Err = Error; + + fn from_str(s: &str) -> Result { + let (hrp, pubkey_hash_base32, _) = bech32::decode(s)?; + + let pubkey_hash: [u8; Address::LEN] = Vec::::from_base32(&pubkey_hash_base32)? + .as_slice() + .try_into()?; + + Ok(Self { + hrp, + hash: Bytes32::new(pubkey_hash), + }) + } + } + + impl Display for $i { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + let data_base32 = self.hash.to_base32(); + let encoding = bech32::encode(&self.hrp, &data_base32, Bech32m).unwrap(); + + write!(f, "{}", encoding) + } + } + }; +} + +bech32type!(Bech32Address); +bech32type!(Bech32ContractId); + +// Bech32Address - Address conversion +impl From<&Bech32Address> for Bech32Address { + fn from(data: &Bech32Address) -> Bech32Address { + data.clone() + } +} +impl From<&Bech32Address> for Address { + fn from(data: &Bech32Address) -> Address { + Address::new(*data.hash) + } +} +impl From for Address { + fn from(data: Bech32Address) -> Address { + Address::new(*data.hash) + } +} +impl From
for Bech32Address { + fn from(address: Address) -> Self { + Self { + hrp: FUEL_BECH32_HRP.to_string(), + hash: Bytes32::new(*address), + } + } +} + +// Bech32ContractId - ContractId conversion +impl From<&Bech32ContractId> for Bech32ContractId { + fn from(data: &Bech32ContractId) -> Bech32ContractId { + data.clone() + } +} +impl From<&Bech32ContractId> for ContractId { + fn from(data: &Bech32ContractId) -> ContractId { + ContractId::new(*data.hash) + } +} +impl From for ContractId { + fn from(data: Bech32ContractId) -> ContractId { + ContractId::new(*data.hash) + } +} +impl From for Bech32ContractId { + fn from(contract_id: ContractId) -> Self { + Self { + hrp: FUEL_BECH32_HRP.to_string(), + hash: Bytes32::new(*contract_id), + } + } +} + +impl Bech32ContractId { + /// Creates an `AssetId` from the `Bech32ContractId` and `sub_id`. + pub fn asset_id(&self, sub_id: &Bits256) -> AssetId { + let sub_id = Bytes32::from(sub_id.0); + ContractId::from(self).asset_id(&sub_id) + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_new() { + let pubkey_hash = [ + 107, 50, 223, 89, 84, 225, 186, 222, 175, 254, 253, 44, 15, 197, 229, 148, 220, 255, + 55, 19, 170, 227, 221, 24, 183, 217, 102, 98, 75, 1, 0, 39, + ]; + + { + // Create from Bytes32 + let bech32_addr = &Bech32Address::new(FUEL_BECH32_HRP, Bytes32::new(pubkey_hash)); + let bech32_cid = &Bech32ContractId::new(FUEL_BECH32_HRP, Bytes32::new(pubkey_hash)); + + assert_eq!(*bech32_addr.hash(), pubkey_hash); + assert_eq!(*bech32_cid.hash(), pubkey_hash); + } + + { + // Create from ContractId + let bech32_addr = &Bech32Address::new(FUEL_BECH32_HRP, ContractId::new(pubkey_hash)); + let bech32_cid = &Bech32ContractId::new(FUEL_BECH32_HRP, ContractId::new(pubkey_hash)); + + assert_eq!(*bech32_addr.hash(), pubkey_hash); + assert_eq!(*bech32_cid.hash(), pubkey_hash); + } + + { + // Create from Address + let bech32_addr = &Bech32Address::new(FUEL_BECH32_HRP, Address::new(pubkey_hash)); + let bech32_cid = &Bech32ContractId::new(FUEL_BECH32_HRP, Address::new(pubkey_hash)); + + assert_eq!(*bech32_addr.hash(), pubkey_hash); + assert_eq!(*bech32_cid.hash(), pubkey_hash); + } + } + + #[test] + fn test_from_str() { + let pubkey_hashes = [ + [ + 107, 50, 223, 89, 84, 225, 186, 222, 175, 254, 253, 44, 15, 197, 229, 148, 220, + 255, 55, 19, 170, 227, 221, 24, 183, 217, 102, 98, 75, 1, 0, 39, + ], + [ + 49, 83, 18, 64, 150, 242, 119, 146, 83, 184, 84, 96, 160, 212, 110, 69, 81, 34, + 101, 86, 182, 99, 62, 68, 44, 28, 40, 26, 131, 21, 221, 64, + ], + [ + 48, 101, 49, 52, 48, 102, 48, 55, 48, 100, 49, 97, 102, 117, 51, 57, 49, 50, 48, + 54, 48, 98, 48, 100, 48, 56, 49, 53, 48, 52, 49, 52, + ], + ]; + let bech32m_encodings = [ + "fuel1dved7k25uxadatl7l5kql309jnw07dcn4t3a6x9hm9nxyjcpqqns50p7n2", + "fuel1x9f3ysyk7fmey5ac23s2p4rwg4gjye2kke3nu3pvrs5p4qc4m4qqwx56k3", + "fuel1xpjnzdpsvccrwvryx9skvafn8ycnyvpkxp3rqeps8qcn2vp5xy6qu7yyz7", + ]; + + for (b32m_e, pbkh) in bech32m_encodings.iter().zip(pubkey_hashes) { + let bech32_contract_id = &Bech32ContractId::from_str(b32m_e).unwrap(); + assert_eq!(*bech32_contract_id.hash(), pbkh); + } + + for (b32m_e, pbkh) in bech32m_encodings.iter().zip(pubkey_hashes) { + let bech32_contract_id = &Bech32Address::from_str(b32m_e).unwrap(); + assert_eq!(*bech32_contract_id.hash(), pbkh); + } + } + + #[test] + fn test_from_invalid_bech32_string() { + { + let expected = [ + Error::from(bech32::Error::InvalidChecksum), + Error::from(bech32::Error::InvalidChar('b')), + Error::from(bech32::Error::MissingSeparator), + ]; + let invalid_bech32 = [ + "fuel1x9f3ysyk7fmey5ac23s2p4rwg4gjye2kke3nu3pvrs5p4qc4m4qqwx32k3", + "fuel1xpjnzdpsvccrwvryx9skvafn8ycnyvpkxp3rqeps8qcn2vp5xy6qu7yyb7", + "fuelldved7k25uxadatl7l5kql309jnw07dcn4t3a6x9hm9nxyjcpqqns50p7n2", + ]; + + for (b32m_e, e) in invalid_bech32.iter().zip(expected.iter()) { + let result = &Bech32ContractId::from_str(b32m_e).expect_err("should error"); + assert_eq!(result.to_string(), e.to_string()); + } + + for (b32m_e, e) in invalid_bech32.iter().zip(expected) { + let result = &Bech32Address::from_str(b32m_e).expect_err("should error"); + assert_eq!(result.to_string(), e.to_string()); + } + } + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core.rs new file mode 100644 index 00000000..55cd9399 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core.rs @@ -0,0 +1,13 @@ +pub use bits::*; +pub use bytes::*; +pub use identity::*; +pub use raw_slice::*; +pub use sized_ascii_string::*; +pub use u256::*; + +mod bits; +mod bytes; +mod identity; +mod raw_slice; +mod sized_ascii_string; +mod u256; diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bits.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bits.rs new file mode 100644 index 00000000..8234232b --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bits.rs @@ -0,0 +1,165 @@ +use fuel_types::AssetId; +use fuels_macros::{Parameterize, Tokenizable, TryFrom}; + +use crate::types::errors::{error, Error, Result}; + +// A simple wrapper around [u8; 32] representing the `b256` type. Exists +// mainly so that we may differentiate `Parameterize` and `Tokenizable` +// implementations from what otherwise is just an array of 32 u8's. +#[derive(Debug, PartialEq, Eq, Copy, Clone)] +pub struct Bits256(pub [u8; 32]); + +impl Bits256 { + /// Returns `Self` with zeroes inside. + pub fn zeroed() -> Self { + Self([0; 32]) + } + + /// Create a new `Bits256` from a string representation of a hex. + /// Accepts both `0x` prefixed and non-prefixed hex strings. + pub fn from_hex_str(hex: &str) -> Result { + let hex = if let Some(stripped_hex) = hex.strip_prefix("0x") { + stripped_hex + } else { + hex + }; + + let mut bytes = [0u8; 32]; + hex::decode_to_slice(hex, &mut bytes as &mut [u8]).map_err(|e| { + error!( + InvalidData, + "Could not convert hex str '{hex}' to Bits256! {e}" + ) + })?; + Ok(Bits256(bytes)) + } +} + +impl From for Bits256 { + fn from(value: AssetId) -> Self { + Self(value.into()) + } +} + +// A simple wrapper around [Bits256; 2] representing the `B512` type. +#[derive(Debug, PartialEq, Eq, Copy, Clone, Parameterize, Tokenizable, TryFrom)] +#[FuelsCorePath = "crate"] +#[FuelsTypesPath = "crate::types"] +// ANCHOR: b512 +pub struct B512 { + pub bytes: [Bits256; 2], +} +// ANCHOR_END: b512 + +impl From<(Bits256, Bits256)> for B512 { + fn from(bits_tuple: (Bits256, Bits256)) -> Self { + B512 { + bytes: [bits_tuple.0, bits_tuple.1], + } + } +} + +#[derive(Debug, PartialEq, Eq, Copy, Clone, Parameterize, Tokenizable, TryFrom)] +#[FuelsCorePath = "crate"] +#[FuelsTypesPath = "crate::types"] +// ANCHOR: evm_address +pub struct EvmAddress { + // An evm address is only 20 bytes, the first 12 bytes should be set to 0 + value: Bits256, +} +// ANCHOR_END: evm_address +impl EvmAddress { + fn new(b256: Bits256) -> Self { + Self { + value: Bits256(Self::clear_12_bytes(b256.0)), + } + } + + pub fn value(&self) -> Bits256 { + self.value + } + + // sets the leftmost 12 bytes to zero + fn clear_12_bytes(bytes: [u8; 32]) -> [u8; 32] { + let mut bytes = bytes; + bytes[..12].copy_from_slice(&[0u8; 12]); + + bytes + } +} + +impl From for EvmAddress { + fn from(b256: Bits256) -> Self { + EvmAddress::new(b256) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{ + traits::{Parameterize, Tokenizable}, + types::{param_types::ParamType, Token}, + }; + + #[test] + fn from_hex_str_b256() -> Result<()> { + // ANCHOR: from_hex_str + let hex_str = "0101010101010101010101010101010101010101010101010101010101010101"; + + let bits256 = Bits256::from_hex_str(hex_str)?; + + assert_eq!(bits256.0, [1u8; 32]); + + // With the `0x0` prefix + let hex_str = "0x0101010101010101010101010101010101010101010101010101010101010101"; + + let bits256 = Bits256::from_hex_str(hex_str)?; + + assert_eq!(bits256.0, [1u8; 32]); + // ANCHOR_END: from_hex_str + + Ok(()) + } + + #[test] + fn test_param_type_evm_addr() { + assert_eq!( + EvmAddress::param_type(), + ParamType::Struct { + fields: vec![ParamType::B256], + generics: vec![] + } + ); + } + + #[test] + fn evm_address_clears_first_12_bytes() -> Result<()> { + let data = [1u8; 32]; + let address = EvmAddress::new(Bits256(data)); + + let expected_data = Bits256([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, + ]); + + assert_eq!(address.value(), expected_data); + + Ok(()) + } + + #[test] + fn test_into_token_evm_addr() { + let bits = [1u8; 32]; + let evm_address = EvmAddress::from(Bits256(bits)); + + let token = evm_address.into_token(); + + let expected_data = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, + ]; + + assert_eq!(token, Token::Struct(vec![Token::B256(expected_data)])); + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bytes.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bytes.rs new file mode 100644 index 00000000..10f0cb9a --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/bytes.rs @@ -0,0 +1,20 @@ +#[derive(Debug, PartialEq, Clone, Eq)] +pub struct Bytes(pub Vec); + +impl From for Vec { + fn from(raw_slice: Bytes) -> Vec { + raw_slice.0 + } +} + +impl PartialEq> for Bytes { + fn eq(&self, other: &Vec) -> bool { + self.0 == *other + } +} + +impl PartialEq for Vec { + fn eq(&self, other: &Bytes) -> bool { + *self == other.0 + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/identity.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/identity.rs new file mode 100644 index 00000000..3df23840 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/identity.rs @@ -0,0 +1,28 @@ +use fuel_tx::{Address, ContractId}; +use fuels_macros::{Parameterize, Tokenizable, TryFrom}; +use serde::{Deserialize, Serialize}; + +#[derive( + Debug, Clone, PartialEq, Eq, Hash, Parameterize, Tokenizable, TryFrom, Serialize, Deserialize, +)] +#[FuelsCorePath = "crate"] +#[FuelsTypesPath = "crate::types"] +pub enum Identity { + Address(Address), + ContractId(ContractId), +} + +impl Default for Identity { + fn default() -> Self { + Self::Address(Address::default()) + } +} + +impl AsRef<[u8]> for Identity { + fn as_ref(&self) -> &[u8] { + match self { + Identity::Address(address) => address.as_ref(), + Identity::ContractId(contract_id) => contract_id.as_ref(), + } + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/raw_slice.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/raw_slice.rs new file mode 100644 index 00000000..d4e0b0cd --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/raw_slice.rs @@ -0,0 +1,22 @@ +#[derive(Debug, PartialEq, Clone, Eq)] +// `RawSlice` is a mapping of the contract type "untyped raw slice" -- currently the only way of +// returning dynamically sized data from a script. +pub struct RawSlice(pub Vec); + +impl From for Vec { + fn from(raw_slice: RawSlice) -> Vec { + raw_slice.0 + } +} + +impl PartialEq> for RawSlice { + fn eq(&self, other: &Vec) -> bool { + self.0 == *other + } +} + +impl PartialEq for Vec { + fn eq(&self, other: &RawSlice) -> bool { + *self == other.0 + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/sized_ascii_string.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/sized_ascii_string.rs new file mode 100644 index 00000000..1eccc985 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/sized_ascii_string.rs @@ -0,0 +1,302 @@ +use std::fmt::{Debug, Display, Formatter}; + +use serde::{Deserialize, Serialize}; + +use crate::types::errors::{error, Error, Result}; + +// To be used when interacting with contracts which have string slices in their ABI. +// The FuelVM strings only support ascii characters. +#[derive(Debug, PartialEq, Clone, Eq)] +pub struct AsciiString { + data: String, +} + +impl AsciiString { + pub fn new(data: String) -> Result { + if !data.is_ascii() { + return Err(error!(InvalidData, + "AsciiString must be constructed from a string containing only ascii encodable characters. Got: {data}" + )); + } + Ok(Self { data }) + } + + pub fn to_trimmed_str(&self) -> &str { + self.data.trim() + } + pub fn to_left_trimmed_str(&self) -> &str { + self.data.trim_start() + } + pub fn to_right_trimmed_str(&self) -> &str { + self.data.trim_end() + } +} + +impl TryFrom<&str> for AsciiString { + type Error = Error; + + fn try_from(value: &str) -> Result { + Self::new(value.to_owned()) + } +} + +impl TryFrom for AsciiString { + type Error = Error; + + fn try_from(value: String) -> Result { + Self::new(value) + } +} + +impl From for String { + fn from(ascii_str: AsciiString) -> Self { + ascii_str.data + } +} + +impl Display for AsciiString { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.data) + } +} + +impl PartialEq<&str> for AsciiString { + fn eq(&self, other: &&str) -> bool { + self.data == *other + } +} +impl PartialEq for &str { + fn eq(&self, other: &AsciiString) -> bool { + *self == other.data + } +} + +// To be used when interacting with contracts which have strings in their ABI. +// The length of a string is part of its type -- i.e. str[2] is a +// different type from str[3]. The FuelVM strings only support ascii characters. +#[derive(Debug, PartialEq, Clone, Eq, Hash, Default)] +pub struct SizedAsciiString { + data: String, +} + +impl SizedAsciiString { + pub fn new(data: String) -> Result { + if !data.is_ascii() { + return Err(error!(InvalidData, + "SizedAsciiString must be constructed from a string containing only ascii encodable characters. Got: {data}" + )); + } + if data.len() != LEN { + return Err(error!(InvalidData, + "SizedAsciiString<{LEN}> can only be constructed from a String of length {LEN}. Got: {data}" + )); + } + Ok(Self { data }) + } + + pub fn to_trimmed_str(&self) -> &str { + self.data.trim() + } + pub fn to_left_trimmed_str(&self) -> &str { + self.data.trim_start() + } + pub fn to_right_trimmed_str(&self) -> &str { + self.data.trim_end() + } + + /// Pad `data` string with whitespace characters on the right to fit into the `SizedAsciiString` + pub fn new_with_right_whitespace_padding(data: String) -> Result { + if data.len() > LEN { + return Err(error!( + InvalidData, + "SizedAsciiString<{LEN}> cannot be constructed from a string of size {}", + data.len() + )); + } + + Ok(Self { + data: format!("{:LEN$}", data), + }) + } +} + +impl TryFrom<&str> for SizedAsciiString { + type Error = Error; + + fn try_from(value: &str) -> Result { + Self::new(value.to_owned()) + } +} + +impl TryFrom for SizedAsciiString { + type Error = Error; + + fn try_from(value: String) -> Result { + Self::new(value) + } +} + +impl From> for String { + fn from(sized_ascii_str: SizedAsciiString) -> Self { + sized_ascii_str.data + } +} + +impl Display for SizedAsciiString { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.data) + } +} + +impl PartialEq<&str> for SizedAsciiString { + fn eq(&self, other: &&str) -> bool { + self.data == *other + } +} + +impl PartialEq> for &str { + fn eq(&self, other: &SizedAsciiString) -> bool { + *self == other.data + } +} + +impl Serialize for SizedAsciiString { + fn serialize( + &self, + serializer: S, + ) -> core::result::Result { + self.data.serialize(serializer) + } +} + +impl<'de, const LEN: usize> Deserialize<'de> for SizedAsciiString { + fn deserialize>( + deserializer: D, + ) -> core::result::Result { + let data = String::deserialize(deserializer)?; + Self::new(data).map_err(serde::de::Error::custom) + } +} + +impl AsRef<[u8]> for SizedAsciiString { + fn as_ref(&self) -> &[u8] { + self.data.as_bytes() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn accepts_ascii_of_correct_length() { + // ANCHOR: string_simple_example + let ascii_data = "abc".to_string(); + + SizedAsciiString::<3>::new(ascii_data) + .expect("Should have succeeded since we gave ascii data of correct length!"); + // ANCHOR_END: string_simple_example + } + + #[test] + fn refuses_non_ascii() { + let ascii_data = "ab©".to_string(); + + let err = SizedAsciiString::<3>::new(ascii_data) + .expect_err("Should not have succeeded since we gave non ascii data"); + + let expected_reason = "SizedAsciiString must be constructed from a string containing only ascii encodable characters. Got: "; + assert!(matches!(err, Error::InvalidData(reason) if reason.starts_with(expected_reason))); + } + + #[test] + fn refuses_invalid_len() { + let ascii_data = "abcd".to_string(); + + let err = SizedAsciiString::<3>::new(ascii_data) + .expect_err("Should not have succeeded since we gave data of wrong length"); + + let expected_reason = + "SizedAsciiString<3> can only be constructed from a String of length 3. Got: abcd"; + assert!(matches!(err, Error::InvalidData(reason) if reason.starts_with(expected_reason))); + } + + // ANCHOR: conversion + #[test] + fn can_be_constructed_from_str_ref() { + let _: SizedAsciiString<3> = "abc".try_into().expect("Should have succeeded"); + } + + #[test] + fn can_be_constructed_from_string() { + let _: SizedAsciiString<3> = "abc".to_string().try_into().expect("Should have succeeded"); + } + + #[test] + fn can_be_converted_into_string() { + let sized_str = SizedAsciiString::<3>::new("abc".to_string()).unwrap(); + + let str: String = sized_str.into(); + + assert_eq!(str, "abc"); + } + // ANCHOR_END: conversion + + #[test] + fn can_be_printed() { + let sized_str = SizedAsciiString::<3>::new("abc".to_string()).unwrap(); + + assert_eq!(sized_str.to_string(), "abc"); + } + + #[test] + fn can_be_compared_w_str_ref() { + let sized_str = SizedAsciiString::<3>::new("abc".to_string()).unwrap(); + + assert_eq!(sized_str, "abc"); + // and vice-versa + assert_eq!("abc", sized_str); + } + + #[test] + fn trim() -> Result<()> { + // Using single whitespaces + let untrimmed = SizedAsciiString::<9>::new(" est abc ".to_string())?; + assert_eq!("est abc ", untrimmed.to_left_trimmed_str()); + assert_eq!(" est abc", untrimmed.to_right_trimmed_str()); + assert_eq!("est abc", untrimmed.to_trimmed_str()); + + let padded = // adds 6 whitespaces + SizedAsciiString::<12>::new_with_right_whitespace_padding("victor".to_string())?; + assert_eq!("victor ", padded); + + Ok(()) + } + + #[test] + fn test_can_serialize_sized_ascii() { + let sized_str = SizedAsciiString::<3>::new("abc".to_string()).unwrap(); + + let serialized = serde_json::to_string(&sized_str).unwrap(); + assert_eq!(serialized, "\"abc\""); + } + + #[test] + fn test_can_deserialize_sized_ascii() { + let serialized = "\"abc\""; + + let deserialized: SizedAsciiString<3> = serde_json::from_str(serialized).unwrap(); + assert_eq!( + deserialized, + SizedAsciiString::<3>::new("abc".to_string()).unwrap() + ); + } + + #[test] + fn test_can_convert_sized_ascii_to_bytes() { + let sized_str = SizedAsciiString::<3>::new("abc".to_string()).unwrap(); + + let bytes: &[u8] = sized_str.as_ref(); + assert_eq!(bytes, &[97, 98, 99]); + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/u256.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/u256.rs new file mode 100644 index 00000000..b948002d --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/core/u256.rs @@ -0,0 +1,76 @@ +#![allow(clippy::assign_op_pattern)] + +use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +use uint::construct_uint; + +use crate::{ + traits::{Parameterize, Tokenizable}, + types::{ + errors::{error, Error, Result as FuelsResult}, + param_types::ParamType, + Token, + }, +}; + +construct_uint! { + /// 256-bit unsigned integer. + pub struct U256(4); +} + +impl Parameterize for U256 { + fn param_type() -> ParamType { + ParamType::U256 + } +} + +impl Tokenizable for U256 { + fn from_token(token: Token) -> FuelsResult + where + Self: Sized, + { + match token { + Token::U256(data) => Ok(data), + _ => Err(error!( + InvalidData, + "U256 cannot be constructed from token {token}" + )), + } + } + + fn into_token(self) -> Token { + Token::U256(self) + } +} + +impl Serialize for U256 { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&self.to_string()) + } +} + +impl<'de> Deserialize<'de> for U256 { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + U256::from_dec_str(Deserialize::deserialize(deserializer)?).map_err(de::Error::custom) + } +} + +#[cfg(test)] +mod tests { + use crate::types::U256; + + #[test] + fn u256_serialize_deserialize() { + let num = U256::from(123); + let serialized: String = serde_json::to_string(&num).unwrap(); + assert_eq!(serialized, "\"123\""); + + let deserialized_num: U256 = serde_json::from_str(&serialized).unwrap(); + assert_eq!(deserialized_num, num); + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/enum_variants.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/enum_variants.rs new file mode 100644 index 00000000..ef532bd8 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/enum_variants.rs @@ -0,0 +1,66 @@ +use crate::{ + constants::{ENUM_DISCRIMINANT_WORD_WIDTH, WORD_SIZE}, + types::{ + errors::{error, Error, Result}, + param_types::ParamType, + }, +}; + +#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub struct EnumVariants { + param_types: Vec, +} + +impl EnumVariants { + pub fn new(param_types: Vec) -> Result { + if !param_types.is_empty() { + Ok(EnumVariants { param_types }) + } else { + Err(error!(InvalidData, "Enum variants can not be empty!")) + } + } + + pub fn param_types(&self) -> &[ParamType] { + &self.param_types + } + + pub fn param_type_of_variant(&self, discriminant: u8) -> Result<&ParamType> { + self.param_types.get(discriminant as usize).ok_or_else(|| { + error!( + InvalidData, + "Discriminant '{discriminant}' doesn't point to any variant: {:?}", + self.param_types() + ) + }) + } + + pub fn only_units_inside(&self) -> bool { + self.param_types + .iter() + .all(|param_type| *param_type == ParamType::Unit) + } + + /// Calculates how many WORDs are needed to encode an enum. + pub fn compute_encoding_width_of_enum(&self) -> usize { + if self.only_units_inside() { + return ENUM_DISCRIMINANT_WORD_WIDTH; + } + self.param_types() + .iter() + .map(|p| p.compute_encoding_width()) + .max() + .map(|width| width + ENUM_DISCRIMINANT_WORD_WIDTH) + .expect( + "Will never panic because EnumVariants must have at least one variant inside it!", + ) + } + + /// Determines the padding needed for the provided enum variant (based on the width of the + /// biggest variant) and returns it. + pub fn compute_padding_amount(&self, variant_param_type: &ParamType) -> usize { + let biggest_variant_width = + self.compute_encoding_width_of_enum() - ENUM_DISCRIMINANT_WORD_WIDTH; + let variant_width = variant_param_type.compute_encoding_width(); + (biggest_variant_width - variant_width) * WORD_SIZE + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/errors.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/errors.rs new file mode 100644 index 00000000..e6e5c6f1 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/errors.rs @@ -0,0 +1,66 @@ +use std::{array::TryFromSliceError, str::Utf8Error}; + +use fuel_tx::{CheckError, Receipt}; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum Error { + #[error("Invalid data: {0}")] + InvalidData(String), + #[error("Serialization error: {0}")] + SerdeJson(#[from] serde_json::Error), + #[error("IO error: {0}")] + IOError(#[from] std::io::Error), + #[error("Invalid type: {0}")] + InvalidType(String), + #[error("Utf8 error: {0}")] + Utf8Error(#[from] Utf8Error), + #[error("Instantiation error: {0}")] + InstantiationError(String), + #[error("Infrastructure error: {0}")] + InfrastructureError(String), + #[error("Account error: {0}")] + AccountError(String), + #[error("Wallet error: {0}")] + WalletError(String), + #[error("Provider error: {0}")] + ProviderError(String), + #[error("Validation error: {0}")] + ValidationError(#[from] CheckError), + #[error("Tried to forward assets to a contract method that is not payable.")] + AssetsForwardedToNonPayableMethod, + #[error("Revert transaction error: {reason},\n receipts: {receipts:?}")] + RevertTransactionError { + reason: String, + revert_id: u64, + receipts: Vec, + }, + #[error("Transaction build error: {0}")] + TransactionBuildError(String), +} + +pub type Result = std::result::Result; + +/// This macro can only be used for `Error` variants that have a `String` field. +/// Those are: `InvalidData`, `InvalidType`, `InfrastructureError`, +/// `InstantiationError`, `WalletError`, `ProviderError`, `TransactionBuildError` +#[macro_export] +macro_rules! error { + ($err_variant:ident, $fmt_str: literal $(,$arg: expr)*) => { + Error::$err_variant(format!($fmt_str,$($arg),*)) + } +} +pub use error; + +macro_rules! impl_error_from { + ($err_variant:ident, $err_type:ty ) => { + impl From<$err_type> for Error { + fn from(err: $err_type) -> Error { + Error::$err_variant(err.to_string()) + } + } + }; +} + +impl_error_from!(InvalidData, bech32::Error); +impl_error_from!(InvalidData, TryFromSliceError); diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/param_types.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/param_types.rs new file mode 100644 index 00000000..efb20c42 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/param_types.rs @@ -0,0 +1,1507 @@ +use std::{collections::HashMap, iter::zip}; + +use fuel_abi_types::{ + abi::program::{TypeApplication, TypeDeclaration}, + utils::{extract_array_len, extract_generic_name, extract_str_len, has_tuple_format}, +}; +use itertools::chain; + +use crate::{ + constants::WORD_SIZE, + types::{ + enum_variants::EnumVariants, + errors::{error, Error, Result}, + }, +}; + +#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub enum ParamType { + U8, + U16, + U32, + U64, + U128, + U256, + Bool, + B256, + // The Unit ParamType is used for unit variants in Enums. The corresponding type field is `()`, + // similar to Rust. + Unit, + Array(Box, usize), + Vector(Box), + StringSlice, + StringArray(usize), + Struct { + fields: Vec, + generics: Vec, + }, + Enum { + variants: EnumVariants, + generics: Vec, + }, + Tuple(Vec), + RawSlice, + Bytes, + String, +} + +pub enum ReturnLocation { + Return, + ReturnData, +} + +impl ParamType { + // Depending on the type, the returned value will be stored + // either in `Return` or `ReturnData`. + pub fn get_return_location(&self) -> ReturnLocation { + match self { + Self::Unit | Self::U8 | Self::U16 | Self::U32 | Self::U64 | Self::Bool => { + ReturnLocation::Return + } + + _ => ReturnLocation::ReturnData, + } + } + + /// Given a [ParamType], return the number of elements of that [ParamType] that can fit in + /// `available_bytes`: it is the length of the corresponding heap type. + pub fn calculate_num_of_elements( + param_type: &ParamType, + available_bytes: usize, + ) -> Result { + let memory_size = param_type.compute_encoding_width() * WORD_SIZE; + let remainder = available_bytes % memory_size; + if remainder != 0 { + return Err(error!( + InvalidData, + "{remainder} extra bytes detected while decoding heap type" + )); + } + Ok(available_bytes / memory_size) + } + + pub fn contains_nested_heap_types(&self) -> bool { + match &self { + ParamType::Vector(param_type) => param_type.uses_heap_types(), + ParamType::Bytes => false, + // Here, we return false because even though the `Token::String` type has an underlying + // `Bytes` type nested, it is an exception that will be generalized as part of + // https://github.com/FuelLabs/fuels-rs/discussions/944 + ParamType::String => false, + _ => self.uses_heap_types(), + } + } + + fn uses_heap_types(&self) -> bool { + match &self { + ParamType::Vector(..) | ParamType::Bytes | ParamType::String => true, + ParamType::Array(param_type, ..) => param_type.uses_heap_types(), + ParamType::Tuple(param_types, ..) => Self::any_nested_heap_types(param_types), + ParamType::Enum { + generics, variants, .. + } => { + let variants_types = variants.param_types(); + Self::any_nested_heap_types(chain!(generics, variants_types)) + } + ParamType::Struct { + fields, generics, .. + } => Self::any_nested_heap_types(chain!(fields, generics)), + _ => false, + } + } + + fn any_nested_heap_types<'a>(param_types: impl IntoIterator) -> bool { + param_types + .into_iter() + .any(|param_type| param_type.uses_heap_types()) + } + + pub fn is_vm_heap_type(&self) -> bool { + matches!( + self, + ParamType::Vector(..) | ParamType::Bytes | ParamType::String + ) + } + + /// Compute the inner memory size of a containing heap type (`Bytes` or `Vec`s). + pub fn heap_inner_element_size(&self) -> Option { + match &self { + ParamType::Vector(inner_param_type) => { + Some(inner_param_type.compute_encoding_width() * WORD_SIZE) + } + // `Bytes` type is byte-packed in the VM, so it's the size of an u8 + ParamType::Bytes | ParamType::String => Some(std::mem::size_of::()), + _ => None, + } + } + + /// Calculates the number of `WORD`s the VM expects this parameter to be encoded in. + pub fn compute_encoding_width(&self) -> usize { + const fn count_words(bytes: usize) -> usize { + let q = bytes / WORD_SIZE; + let r = bytes % WORD_SIZE; + match r == 0 { + true => q, + false => q + 1, + } + } + + match &self { + ParamType::Unit + | ParamType::U8 + | ParamType::U16 + | ParamType::U32 + | ParamType::U64 + | ParamType::Bool => 1, + ParamType::U128 | ParamType::RawSlice | ParamType::StringSlice => 2, + ParamType::Vector(_) | ParamType::Bytes | ParamType::String => 3, + ParamType::U256 | ParamType::B256 => 4, + ParamType::Array(param, count) => param.compute_encoding_width() * count, + ParamType::StringArray(len) => count_words(*len), + ParamType::Struct { fields, .. } => fields + .iter() + .map(|param_type| param_type.compute_encoding_width()) + .sum(), + ParamType::Enum { variants, .. } => variants.compute_encoding_width_of_enum(), + ParamType::Tuple(params) => params.iter().map(|p| p.compute_encoding_width()).sum(), + } + } + + /// For when you need to convert a ABI JSON's TypeApplication into a ParamType. + /// + /// # Arguments + /// + /// * `type_application`: The TypeApplication you wish to convert into a ParamType + /// * `type_lookup`: A HashMap of TypeDeclarations mentioned in the + /// TypeApplication where the type id is the key. + pub fn try_from_type_application( + type_application: &TypeApplication, + type_lookup: &HashMap, + ) -> Result { + Type::try_from(type_application, type_lookup)?.try_into() + } +} + +#[derive(Debug, Clone)] +struct Type { + type_field: String, + generic_params: Vec, + components: Vec, +} + +impl Type { + /// Will recursively drill down the given generic parameters until all types are + /// resolved. + /// + /// # Arguments + /// + /// * `type_application`: the type we wish to resolve + /// * `types`: all types used in the function call + pub fn try_from( + type_application: &TypeApplication, + type_lookup: &HashMap, + ) -> Result { + Self::resolve(type_application, type_lookup, &[]) + } + + fn resolve( + type_application: &TypeApplication, + type_lookup: &HashMap, + parent_generic_params: &[(usize, Type)], + ) -> Result { + let type_declaration = type_lookup.get(&type_application.type_id).ok_or_else(|| { + error!( + InvalidData, + "type id {} not found in type lookup", type_application.type_id + ) + })?; + + if extract_generic_name(&type_declaration.type_field).is_some() { + let (_, generic_type) = parent_generic_params + .iter() + .find(|(id, _)| *id == type_application.type_id) + .ok_or_else(|| { + error!( + InvalidData, + "type id {} not found in parent's generic parameters", + type_application.type_id + ) + })?; + + return Ok(generic_type.clone()); + } + + // Figure out what does the current type do with the inherited generic + // parameters and reestablish the mapping since the current type might have + // renamed the inherited generic parameters. + let generic_params_lookup = Self::determine_generics_for_type( + type_application, + type_lookup, + type_declaration, + parent_generic_params, + )?; + + // Resolve the enclosed components (if any) with the newly resolved generic + // parameters. + let components = type_declaration + .components + .iter() + .flatten() + .map(|component| Self::resolve(component, type_lookup, &generic_params_lookup)) + .collect::>>()?; + + Ok(Type { + type_field: type_declaration.type_field.clone(), + components, + generic_params: generic_params_lookup + .into_iter() + .map(|(_, ty)| ty) + .collect(), + }) + } + + /// For the given type generates generic_type_id -> Type mapping describing to + /// which types generic parameters should be resolved. + /// + /// # Arguments + /// + /// * `type_application`: The type on which the generic parameters are defined. + /// * `types`: All types used. + /// * `parent_generic_params`: The generic parameters as inherited from the + /// enclosing type (a struct/enum/array etc.). + fn determine_generics_for_type( + type_application: &TypeApplication, + type_lookup: &HashMap, + type_declaration: &TypeDeclaration, + parent_generic_params: &[(usize, Type)], + ) -> Result> { + match &type_declaration.type_parameters { + // The presence of type_parameters indicates that the current type + // (a struct or an enum) defines some generic parameters (i.e. SomeStruct). + Some(params) if !params.is_empty() => { + // Determine what Types the generics will resolve to. + let generic_params_from_current_type = type_application + .type_arguments + .iter() + .flatten() + .map(|ty| Self::resolve(ty, type_lookup, parent_generic_params)) + .collect::>>()?; + + let generics_to_use = if !generic_params_from_current_type.is_empty() { + generic_params_from_current_type + } else { + // Types such as arrays and enums inherit and forward their + // generic parameters, without declaring their own. + parent_generic_params + .iter() + .map(|(_, ty)| ty) + .cloned() + .collect() + }; + + // All inherited but unused generic types are dropped. The rest are + // re-mapped to new type_ids since child types are free to rename + // the generic parameters as they see fit -- i.e. + // struct ParentStruct{ + // b: ChildStruct + // } + // struct ChildStruct { + // c: K + // } + + Ok(zip(params.clone(), generics_to_use).collect()) + } + _ => Ok(parent_generic_params.to_vec()), + } + } +} + +impl TryFrom for ParamType { + type Error = Error; + + fn try_from(value: Type) -> Result { + (&value).try_into() + } +} + +impl TryFrom<&Type> for ParamType { + type Error = Error; + + fn try_from(the_type: &Type) -> Result { + let matched_param_type = [ + try_primitive, + try_array, + try_str_array, + try_str_slice, + try_tuple, + try_vector, + try_bytes, + try_std_string, + try_raw_slice, + try_enum, + try_u128, + try_u256, + try_struct, + ] + .into_iter() + .map(|fun| fun(the_type)) + .flat_map(|result| result.ok().flatten()) + .next(); + + matched_param_type.map(Ok).unwrap_or_else(|| { + Err(error!( + InvalidType, + "Type {} couldn't be converted into a ParamType", the_type.type_field + )) + }) + } +} + +fn convert_into_param_types(coll: &[Type]) -> Result> { + coll.iter().map(ParamType::try_from).collect() +} + +fn try_struct(the_type: &Type) -> Result> { + let result = if has_struct_format(&the_type.type_field) { + let generics = param_types(&the_type.generic_params)?; + + let fields = convert_into_param_types(&the_type.components)?; + Some(ParamType::Struct { fields, generics }) + } else { + None + }; + + Ok(result) +} + +fn has_struct_format(field: &str) -> bool { + field.starts_with("struct ") +} + +fn try_vector(the_type: &Type) -> Result> { + if !["struct std::vec::Vec", "struct Vec"].contains(&the_type.type_field.as_str()) { + return Ok(None); + } + + if the_type.generic_params.len() != 1 { + return Err(error!( + InvalidType, + "Vec must have exactly one generic argument for its type. Found: {:?}", + the_type.generic_params + )); + } + + let vec_elem_type = convert_into_param_types(&the_type.generic_params)?.remove(0); + + Ok(Some(ParamType::Vector(Box::new(vec_elem_type)))) +} + +fn try_u128(the_type: &Type) -> Result> { + Ok(["struct std::u128::U128", "struct U128"] + .contains(&the_type.type_field.as_str()) + .then_some(ParamType::U128)) +} + +fn try_u256(the_type: &Type) -> Result> { + Ok(["struct std::u256::U256", "struct U256"] + .contains(&the_type.type_field.as_str()) + .then_some(ParamType::U256)) +} + +fn try_bytes(the_type: &Type) -> Result> { + Ok(["struct std::bytes::Bytes", "struct Bytes"] + .contains(&the_type.type_field.as_str()) + .then_some(ParamType::Bytes)) +} + +fn try_std_string(the_type: &Type) -> Result> { + Ok(["struct std::string::String", "struct String"] + .contains(&the_type.type_field.as_str()) + .then_some(ParamType::String)) +} + +fn try_raw_slice(the_type: &Type) -> Result> { + Ok((the_type.type_field == "raw untyped slice").then_some(ParamType::RawSlice)) +} + +fn try_enum(the_type: &Type) -> Result> { + let field = &the_type.type_field; + let result = if field.starts_with("enum ") { + let generics = param_types(&the_type.generic_params)?; + + let components = convert_into_param_types(&the_type.components)?; + let variants = EnumVariants::new(components)?; + + Some(ParamType::Enum { variants, generics }) + } else { + None + }; + + Ok(result) +} + +fn try_tuple(the_type: &Type) -> Result> { + let result = if has_tuple_format(&the_type.type_field) { + let tuple_elements = param_types(&the_type.components)?; + Some(ParamType::Tuple(tuple_elements)) + } else { + None + }; + + Ok(result) +} + +fn param_types(coll: &[Type]) -> Result> { + coll.iter().map(|e| e.try_into()).collect() +} + +fn try_str_array(the_type: &Type) -> Result> { + Ok(extract_str_len(&the_type.type_field).map(ParamType::StringArray)) +} + +fn try_str_slice(the_type: &Type) -> Result> { + Ok(if the_type.type_field == "str" { + Some(ParamType::StringSlice) + } else { + None + }) +} + +fn try_array(the_type: &Type) -> Result> { + if let Some(len) = extract_array_len(&the_type.type_field) { + return match the_type.components.as_slice() { + [single_type] => { + let array_type = single_type.try_into()?; + Ok(Some(ParamType::Array(Box::new(array_type), len))) + } + _ => Err(error!( + InvalidType, + "An array must have elements of exactly one type. Array types: {:?}", + the_type.components + )), + }; + } + Ok(None) +} + +fn try_primitive(the_type: &Type) -> Result> { + let result = match the_type.type_field.as_str() { + "bool" => Some(ParamType::Bool), + "u8" => Some(ParamType::U8), + "u16" => Some(ParamType::U16), + "u32" => Some(ParamType::U32), + "u64" => Some(ParamType::U64), + "b256" => Some(ParamType::B256), + "()" => Some(ParamType::Unit), + "str" => Some(ParamType::StringSlice), + _ => None, + }; + + Ok(result) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::types::param_types::ParamType; + + const WIDTH_OF_B256: usize = 4; + const WIDTH_OF_U32: usize = 1; + const WIDTH_OF_BOOL: usize = 1; + + #[test] + fn array_size_dependent_on_num_of_elements() { + const NUM_ELEMENTS: usize = 11; + let param = ParamType::Array(Box::new(ParamType::B256), NUM_ELEMENTS); + + let width = param.compute_encoding_width(); + + let expected = NUM_ELEMENTS * WIDTH_OF_B256; + assert_eq!(expected, width); + } + + #[test] + fn string_size_dependent_on_num_of_elements() { + const NUM_ASCII_CHARS: usize = 9; + let param = ParamType::StringArray(NUM_ASCII_CHARS); + + let width = param.compute_encoding_width(); + + // 2 WORDS or 16 B are enough to fit 9 ascii chars + assert_eq!(2, width); + } + + #[test] + fn structs_are_just_all_elements_combined() { + let inner_struct = ParamType::Struct { + fields: vec![ParamType::U32, ParamType::U32], + generics: vec![], + }; + + let a_struct = ParamType::Struct { + fields: vec![ParamType::B256, ParamType::Bool, inner_struct], + generics: vec![], + }; + + let width = a_struct.compute_encoding_width(); + + const INNER_STRUCT_WIDTH: usize = WIDTH_OF_U32 * 2; + const EXPECTED_WIDTH: usize = WIDTH_OF_B256 + WIDTH_OF_BOOL + INNER_STRUCT_WIDTH; + assert_eq!(EXPECTED_WIDTH, width); + } + + #[test] + fn enums_are_as_big_as_their_biggest_variant_plus_a_word() -> Result<()> { + let fields = vec![ParamType::B256]; + let inner_struct = ParamType::Struct { + fields, + generics: vec![], + }; + let types = vec![ParamType::U32, inner_struct]; + let param = ParamType::Enum { + variants: EnumVariants::new(types)?, + generics: vec![], + }; + + let width = param.compute_encoding_width(); + + const INNER_STRUCT_SIZE: usize = WIDTH_OF_B256; + const EXPECTED_WIDTH: usize = INNER_STRUCT_SIZE + 1; + assert_eq!(EXPECTED_WIDTH, width); + Ok(()) + } + + #[test] + fn tuples_are_just_all_elements_combined() { + let inner_tuple = ParamType::Tuple(vec![ParamType::B256]); + let param = ParamType::Tuple(vec![ParamType::U32, inner_tuple]); + + let width = param.compute_encoding_width(); + + const INNER_TUPLE_WIDTH: usize = WIDTH_OF_B256; + const EXPECTED_WIDTH: usize = WIDTH_OF_U32 + INNER_TUPLE_WIDTH; + assert_eq!(EXPECTED_WIDTH, width); + } + + #[test] + fn handles_simple_types() -> Result<()> { + let parse_param_type = |type_field: &str| { + let type_application = TypeApplication { + name: "".to_string(), + type_id: 0, + type_arguments: None, + }; + + let declarations = [TypeDeclaration { + type_id: 0, + type_field: type_field.to_string(), + components: None, + type_parameters: None, + }]; + + let type_lookup = declarations + .into_iter() + .map(|decl| (decl.type_id, decl)) + .collect::>(); + + ParamType::try_from_type_application(&type_application, &type_lookup) + }; + + assert_eq!(parse_param_type("u8")?, ParamType::U8); + assert_eq!(parse_param_type("u16")?, ParamType::U16); + assert_eq!(parse_param_type("u32")?, ParamType::U32); + assert_eq!(parse_param_type("u64")?, ParamType::U64); + assert_eq!(parse_param_type("bool")?, ParamType::Bool); + assert_eq!(parse_param_type("b256")?, ParamType::B256); + assert_eq!(parse_param_type("()")?, ParamType::Unit); + assert_eq!(parse_param_type("str[21]")?, ParamType::StringArray(21)); + assert_eq!(parse_param_type("str")?, ParamType::StringSlice); + + Ok(()) + } + + #[test] + fn handles_arrays() -> Result<()> { + // given + let type_application = TypeApplication { + name: "".to_string(), + type_id: 0, + type_arguments: None, + }; + + let declarations = [ + TypeDeclaration { + type_id: 0, + type_field: "[_; 10]".to_string(), + components: Some(vec![TypeApplication { + name: "__array_element".to_string(), + type_id: 1, + type_arguments: None, + }]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 1, + type_field: "u8".to_string(), + components: None, + type_parameters: None, + }, + ]; + + let type_lookup = declarations + .into_iter() + .map(|decl| (decl.type_id, decl)) + .collect::>(); + + // when + let result = ParamType::try_from_type_application(&type_application, &type_lookup)?; + + // then + assert_eq!(result, ParamType::Array(Box::new(ParamType::U8), 10)); + + Ok(()) + } + + #[test] + fn handles_vectors() -> Result<()> { + // given + let declarations = [ + TypeDeclaration { + type_id: 1, + type_field: "generic T".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 2, + type_field: "raw untyped ptr".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 3, + type_field: "struct std::vec::RawVec".to_string(), + components: Some(vec![ + TypeApplication { + name: "ptr".to_string(), + type_id: 2, + type_arguments: None, + }, + TypeApplication { + name: "cap".to_string(), + type_id: 5, + type_arguments: None, + }, + ]), + type_parameters: Some(vec![1]), + }, + TypeDeclaration { + type_id: 4, + type_field: "struct std::vec::Vec".to_string(), + components: Some(vec![ + TypeApplication { + name: "buf".to_string(), + type_id: 3, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 1, + type_arguments: None, + }]), + }, + TypeApplication { + name: "len".to_string(), + type_id: 5, + type_arguments: None, + }, + ]), + type_parameters: Some(vec![1]), + }, + TypeDeclaration { + type_id: 5, + type_field: "u64".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 6, + type_field: "u8".to_string(), + components: None, + type_parameters: None, + }, + ]; + + let type_application = TypeApplication { + name: "arg".to_string(), + type_id: 4, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 6, + type_arguments: None, + }]), + }; + + let type_lookup = declarations + .into_iter() + .map(|decl| (decl.type_id, decl)) + .collect::>(); + + // when + let result = ParamType::try_from_type_application(&type_application, &type_lookup)?; + + // then + assert_eq!(result, ParamType::Vector(Box::new(ParamType::U8))); + + Ok(()) + } + + #[test] + fn handles_structs() -> Result<()> { + // given + let declarations = [ + TypeDeclaration { + type_id: 1, + type_field: "generic T".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 2, + type_field: "struct SomeStruct".to_string(), + components: Some(vec![TypeApplication { + name: "field".to_string(), + type_id: 1, + type_arguments: None, + }]), + type_parameters: Some(vec![1]), + }, + TypeDeclaration { + type_id: 3, + type_field: "u8".to_string(), + components: None, + type_parameters: None, + }, + ]; + + let type_application = TypeApplication { + name: "arg".to_string(), + type_id: 2, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 3, + type_arguments: None, + }]), + }; + + let type_lookup = declarations + .into_iter() + .map(|decl| (decl.type_id, decl)) + .collect::>(); + + // when + let result = ParamType::try_from_type_application(&type_application, &type_lookup)?; + + // then + assert_eq!( + result, + ParamType::Struct { + fields: vec![ParamType::U8], + generics: vec![ParamType::U8] + } + ); + + Ok(()) + } + + #[test] + fn handles_enums() -> Result<()> { + // given + let declarations = [ + TypeDeclaration { + type_id: 1, + type_field: "generic T".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 2, + type_field: "enum SomeEnum".to_string(), + components: Some(vec![TypeApplication { + name: "variant".to_string(), + type_id: 1, + type_arguments: None, + }]), + type_parameters: Some(vec![1]), + }, + TypeDeclaration { + type_id: 3, + type_field: "u8".to_string(), + components: None, + type_parameters: None, + }, + ]; + + let type_application = TypeApplication { + name: "arg".to_string(), + type_id: 2, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 3, + type_arguments: None, + }]), + }; + + let type_lookup = declarations + .into_iter() + .map(|decl| (decl.type_id, decl)) + .collect::>(); + + // when + let result = ParamType::try_from_type_application(&type_application, &type_lookup)?; + + // then + assert_eq!( + result, + ParamType::Enum { + variants: EnumVariants::new(vec![ParamType::U8])?, + generics: vec![ParamType::U8] + } + ); + + Ok(()) + } + + #[test] + fn handles_tuples() -> Result<()> { + // given + let declarations = [ + TypeDeclaration { + type_id: 1, + type_field: "(_, _)".to_string(), + components: Some(vec![ + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 3, + type_arguments: None, + }, + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 2, + type_arguments: None, + }, + ]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 2, + type_field: "str[15]".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 3, + type_field: "u8".to_string(), + components: None, + type_parameters: None, + }, + ]; + + let type_application = TypeApplication { + name: "arg".to_string(), + type_id: 1, + type_arguments: None, + }; + let type_lookup = declarations + .into_iter() + .map(|decl| (decl.type_id, decl)) + .collect::>(); + + // when + let result = ParamType::try_from_type_application(&type_application, &type_lookup)?; + + // then + assert_eq!( + result, + ParamType::Tuple(vec![ParamType::U8, ParamType::StringArray(15)]) + ); + + Ok(()) + } + + #[test] + fn ultimate_example() -> Result<()> { + // given + let declarations = [ + TypeDeclaration { + type_id: 1, + type_field: "(_, _)".to_string(), + components: Some(vec![ + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 11, + type_arguments: None, + }, + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 11, + type_arguments: None, + }, + ]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 2, + type_field: "(_, _)".to_string(), + components: Some(vec![ + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 4, + type_arguments: None, + }, + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 24, + type_arguments: None, + }, + ]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 3, + type_field: "(_, _)".to_string(), + components: Some(vec![ + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 5, + type_arguments: None, + }, + TypeApplication { + name: "__tuple_element".to_string(), + type_id: 13, + type_arguments: None, + }, + ]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 4, + type_field: "[_; 1]".to_string(), + components: Some(vec![TypeApplication { + name: "__array_element".to_string(), + type_id: 8, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 22, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 21, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 18, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 13, + type_arguments: None, + }]), + }]), + }]), + }]), + }]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 5, + type_field: "[_; 2]".to_string(), + components: Some(vec![TypeApplication { + name: "__array_element".to_string(), + type_id: 14, + type_arguments: None, + }]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 6, + type_field: "[_; 2]".to_string(), + components: Some(vec![TypeApplication { + name: "__array_element".to_string(), + type_id: 10, + type_arguments: None, + }]), + type_parameters: None, + }, + TypeDeclaration { + type_id: 7, + type_field: "b256".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 8, + type_field: "enum EnumWGeneric".to_string(), + components: Some(vec![ + TypeApplication { + name: "a".to_string(), + type_id: 25, + type_arguments: None, + }, + TypeApplication { + name: "b".to_string(), + type_id: 12, + type_arguments: None, + }, + ]), + type_parameters: Some(vec![12]), + }, + TypeDeclaration { + type_id: 9, + type_field: "generic K".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 10, + type_field: "generic L".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 11, + type_field: "generic M".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 12, + type_field: "generic N".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 13, + type_field: "generic T".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 14, + type_field: "generic U".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 15, + type_field: "raw untyped ptr".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 16, + type_field: "str[2]".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 17, + type_field: "struct MegaExample".to_string(), + components: Some(vec![ + TypeApplication { + name: "a".to_string(), + type_id: 3, + type_arguments: None, + }, + TypeApplication { + name: "b".to_string(), + type_id: 23, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 2, + type_arguments: None, + }]), + }, + ]), + type_parameters: Some(vec![13, 14]), + }, + TypeDeclaration { + type_id: 18, + type_field: "struct PassTheGenericOn".to_string(), + components: Some(vec![TypeApplication { + name: "one".to_string(), + type_id: 20, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 9, + type_arguments: None, + }]), + }]), + type_parameters: Some(vec![9]), + }, + TypeDeclaration { + type_id: 19, + type_field: "struct std::vec::RawVec".to_string(), + components: Some(vec![ + TypeApplication { + name: "ptr".to_string(), + type_id: 15, + type_arguments: None, + }, + TypeApplication { + name: "cap".to_string(), + type_id: 25, + type_arguments: None, + }, + ]), + type_parameters: Some(vec![13]), + }, + TypeDeclaration { + type_id: 20, + type_field: "struct SimpleGeneric".to_string(), + components: Some(vec![TypeApplication { + name: "single_generic_param".to_string(), + type_id: 13, + type_arguments: None, + }]), + type_parameters: Some(vec![13]), + }, + TypeDeclaration { + type_id: 21, + type_field: "struct StructWArrayGeneric".to_string(), + components: Some(vec![TypeApplication { + name: "a".to_string(), + type_id: 6, + type_arguments: None, + }]), + type_parameters: Some(vec![10]), + }, + TypeDeclaration { + type_id: 22, + type_field: "struct StructWTupleGeneric".to_string(), + components: Some(vec![TypeApplication { + name: "a".to_string(), + type_id: 1, + type_arguments: None, + }]), + type_parameters: Some(vec![11]), + }, + TypeDeclaration { + type_id: 23, + type_field: "struct std::vec::Vec".to_string(), + components: Some(vec![ + TypeApplication { + name: "buf".to_string(), + type_id: 19, + type_arguments: Some(vec![TypeApplication { + name: "".to_string(), + type_id: 13, + type_arguments: None, + }]), + }, + TypeApplication { + name: "len".to_string(), + type_id: 25, + type_arguments: None, + }, + ]), + type_parameters: Some(vec![13]), + }, + TypeDeclaration { + type_id: 24, + type_field: "u32".to_string(), + components: None, + type_parameters: None, + }, + TypeDeclaration { + type_id: 25, + type_field: "u64".to_string(), + components: None, + type_parameters: None, + }, + ]; + + let type_lookup = declarations + .into_iter() + .map(|decl| (decl.type_id, decl)) + .collect::>(); + + let type_application = TypeApplication { + name: "arg1".to_string(), + type_id: 17, + type_arguments: Some(vec![ + TypeApplication { + name: "".to_string(), + type_id: 16, + type_arguments: None, + }, + TypeApplication { + name: "".to_string(), + type_id: 7, + type_arguments: None, + }, + ]), + }; + + // when + let result = ParamType::try_from_type_application(&type_application, &type_lookup)?; + + // then + let expected_param_type = { + let fields = vec![ParamType::Struct { + fields: vec![ParamType::StringArray(2)], + generics: vec![ParamType::StringArray(2)], + }]; + let pass_the_generic_on = ParamType::Struct { + fields, + generics: vec![ParamType::StringArray(2)], + }; + + let fields = vec![ParamType::Array(Box::from(pass_the_generic_on.clone()), 2)]; + let struct_w_array_generic = ParamType::Struct { + fields, + generics: vec![pass_the_generic_on], + }; + + let fields = vec![ParamType::Tuple(vec![ + struct_w_array_generic.clone(), + struct_w_array_generic.clone(), + ])]; + let struct_w_tuple_generic = ParamType::Struct { + fields, + generics: vec![struct_w_array_generic], + }; + + let types = vec![ParamType::U64, struct_w_tuple_generic.clone()]; + let fields = vec![ + ParamType::Tuple(vec![ + ParamType::Array(Box::from(ParamType::B256), 2), + ParamType::StringArray(2), + ]), + ParamType::Vector(Box::from(ParamType::Tuple(vec![ + ParamType::Array( + Box::from(ParamType::Enum { + variants: EnumVariants::new(types).unwrap(), + generics: vec![struct_w_tuple_generic], + }), + 1, + ), + ParamType::U32, + ]))), + ]; + ParamType::Struct { + fields, + generics: vec![ParamType::StringArray(2), ParamType::B256], + } + }; + + assert_eq!(result, expected_param_type); + + Ok(()) + } + + #[test] + fn contains_nested_heap_types_false_on_simple_types() -> Result<()> { + // Simple types cannot have nested heap types + assert!(!ParamType::Unit.contains_nested_heap_types()); + assert!(!ParamType::U8.contains_nested_heap_types()); + assert!(!ParamType::U16.contains_nested_heap_types()); + assert!(!ParamType::U32.contains_nested_heap_types()); + assert!(!ParamType::U64.contains_nested_heap_types()); + assert!(!ParamType::Bool.contains_nested_heap_types()); + assert!(!ParamType::B256.contains_nested_heap_types()); + assert!(!ParamType::StringArray(10).contains_nested_heap_types()); + assert!(!ParamType::RawSlice.contains_nested_heap_types()); + assert!(!ParamType::Bytes.contains_nested_heap_types()); + assert!(!ParamType::String.contains_nested_heap_types()); + Ok(()) + } + + #[test] + fn test_complex_types_for_nested_heap_types_containing_vectors() -> Result<()> { + let base_vector = ParamType::Vector(Box::from(ParamType::U8)); + let param_types_no_nested_vec = vec![ParamType::U64, ParamType::U32]; + let param_types_nested_vec = vec![ParamType::Unit, ParamType::Bool, base_vector.clone()]; + + let is_nested = |param_type: ParamType| assert!(param_type.contains_nested_heap_types()); + let not_nested = |param_type: ParamType| assert!(!param_type.contains_nested_heap_types()); + + not_nested(base_vector.clone()); + is_nested(ParamType::Vector(Box::from(base_vector.clone()))); + + not_nested(ParamType::Array(Box::from(ParamType::U8), 10)); + is_nested(ParamType::Array(Box::from(base_vector), 10)); + + not_nested(ParamType::Tuple(param_types_no_nested_vec.clone())); + is_nested(ParamType::Tuple(param_types_nested_vec.clone())); + + not_nested(ParamType::Struct { + generics: param_types_no_nested_vec.clone(), + fields: param_types_no_nested_vec.clone(), + }); + is_nested(ParamType::Struct { + generics: param_types_nested_vec.clone(), + fields: param_types_no_nested_vec.clone(), + }); + is_nested(ParamType::Struct { + generics: param_types_no_nested_vec.clone(), + fields: param_types_nested_vec.clone(), + }); + + not_nested(ParamType::Enum { + variants: EnumVariants::new(param_types_no_nested_vec.clone())?, + generics: param_types_no_nested_vec.clone(), + }); + is_nested(ParamType::Enum { + variants: EnumVariants::new(param_types_nested_vec.clone())?, + generics: param_types_no_nested_vec.clone(), + }); + is_nested(ParamType::Enum { + variants: EnumVariants::new(param_types_no_nested_vec)?, + generics: param_types_nested_vec, + }); + Ok(()) + } + + #[test] + fn test_complex_types_for_nested_heap_types_containing_bytes() -> Result<()> { + let base_bytes = ParamType::Bytes; + let param_types_no_nested_bytes = vec![ParamType::U64, ParamType::U32]; + let param_types_nested_bytes = vec![ParamType::Unit, ParamType::Bool, base_bytes.clone()]; + + let is_nested = |param_type: ParamType| assert!(param_type.contains_nested_heap_types()); + let not_nested = |param_type: ParamType| assert!(!param_type.contains_nested_heap_types()); + + not_nested(base_bytes.clone()); + is_nested(ParamType::Vector(Box::from(base_bytes.clone()))); + + not_nested(ParamType::Array(Box::from(ParamType::U8), 10)); + is_nested(ParamType::Array(Box::from(base_bytes), 10)); + + not_nested(ParamType::Tuple(param_types_no_nested_bytes.clone())); + is_nested(ParamType::Tuple(param_types_nested_bytes.clone())); + + let not_nested_struct = ParamType::Struct { + generics: param_types_no_nested_bytes.clone(), + fields: param_types_no_nested_bytes.clone(), + }; + not_nested(not_nested_struct); + + let nested_struct = ParamType::Struct { + generics: param_types_nested_bytes.clone(), + fields: param_types_no_nested_bytes.clone(), + }; + is_nested(nested_struct); + + let nested_struct = ParamType::Struct { + generics: param_types_no_nested_bytes.clone(), + fields: param_types_nested_bytes.clone(), + }; + is_nested(nested_struct); + + let not_nested_enum = ParamType::Enum { + variants: EnumVariants::new(param_types_no_nested_bytes.clone())?, + generics: param_types_no_nested_bytes.clone(), + }; + not_nested(not_nested_enum); + + let nested_enum = ParamType::Enum { + variants: EnumVariants::new(param_types_nested_bytes.clone())?, + generics: param_types_no_nested_bytes.clone(), + }; + is_nested(nested_enum); + + let nested_enum = ParamType::Enum { + variants: EnumVariants::new(param_types_no_nested_bytes)?, + generics: param_types_nested_bytes, + }; + is_nested(nested_enum); + + Ok(()) + } + + #[test] + fn try_vector_is_type_path_backward_compatible() { + // TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked. + let the_type = given_generic_type_with_path("Vec"); + + let param_type = try_vector(&the_type).unwrap().unwrap(); + + assert_eq!(param_type, ParamType::Vector(Box::new(ParamType::U8))); + } + + #[test] + fn try_vector_correctly_resolves_param_type() { + let the_type = given_generic_type_with_path("std::vec::Vec"); + + let param_type = try_vector(&the_type).unwrap().unwrap(); + + assert_eq!(param_type, ParamType::Vector(Box::new(ParamType::U8))); + } + + #[test] + fn try_bytes_is_type_path_backward_compatible() { + // TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked. + let the_type = given_type_with_path("Bytes"); + + let param_type = try_bytes(&the_type).unwrap().unwrap(); + + assert_eq!(param_type, ParamType::Bytes); + } + + #[test] + fn try_bytes_correctly_resolves_param_type() { + let the_type = given_type_with_path("std::bytes::Bytes"); + + let param_type = try_bytes(&the_type).unwrap().unwrap(); + + assert_eq!(param_type, ParamType::Bytes); + } + + #[test] + fn try_raw_slice_correctly_resolves_param_type() { + let the_type = Type { + type_field: "raw untyped slice".to_string(), + generic_params: vec![], + components: vec![], + }; + + let param_type = try_raw_slice(&the_type).unwrap().unwrap(); + + assert_eq!(param_type, ParamType::RawSlice); + } + + #[test] + fn try_std_string_correctly_resolves_param_type() { + let the_type = given_type_with_path("std::string::String"); + + let param_type = try_std_string(&the_type).unwrap().unwrap(); + + assert_eq!(param_type, ParamType::String); + } + + #[test] + fn try_std_string_is_type_path_backward_compatible() { + // TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked. + let the_type = given_type_with_path("String"); + + let param_type = try_std_string(&the_type).unwrap().unwrap(); + + assert_eq!(param_type, ParamType::String); + } + + fn given_type_with_path(path: &str) -> Type { + Type { + type_field: format!("struct {path}"), + generic_params: vec![], + components: vec![], + } + } + + fn given_generic_type_with_path(path: &str) -> Type { + Type { + type_field: format!("struct {path}"), + generic_params: vec![Type { + type_field: "u8".to_string(), + generic_params: vec![], + components: vec![], + }], + components: vec![], + } + } +} diff --git a/docs/beta-4/fuels-rs/packages/fuels-core/src/types/transaction_builders.rs b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/transaction_builders.rs new file mode 100644 index 00000000..6e761d35 --- /dev/null +++ b/docs/beta-4/fuels-rs/packages/fuels-core/src/types/transaction_builders.rs @@ -0,0 +1,740 @@ +#![cfg(feature = "std")] + +use std::collections::HashMap; + +use fuel_asm::{op, GTFArgs, RegId}; +use fuel_crypto::{Message as CryptoMessage, SecretKey, Signature}; +use fuel_tx::{ + field::{GasLimit, GasPrice, Witnesses}, + Cacheable, ConsensusParameters, Create, Input as FuelInput, Output, Script, StorageSlot, + Transaction as FuelTransaction, TransactionFee, TxPointer, UniqueIdentifier, Witness, +}; +use fuel_types::{bytes::padded_len_usize, Bytes32, MemLayout, Salt}; +use fuel_vm::{checked_transaction::EstimatePredicates, gas::GasCosts}; + +use super::unresolved_bytes::UnresolvedBytes; +use crate::{ + constants::{BASE_ASSET_ID, WORD_SIZE}, + offsets, + types::{ + bech32::Bech32Address, + coin::Coin, + coin_type::CoinType, + errors::{error, Error, Result}, + input::Input, + message::Message, + transaction::{CreateTransaction, ScriptTransaction, Transaction, TxParameters}, + Address, AssetId, ContractId, + }, +}; + +#[derive(Debug, Clone, Default)] +struct UnresolvedSignatures { + addr_idx_offset_map: HashMap, + secret_keys: Vec, +} + +pub trait TransactionBuilder: Send { + type TxType: Transaction; + + fn build(self) -> Result; + fn add_unresolved_signature(&mut self, owner: Bech32Address, secret_key: SecretKey); + fn fee_checked_from_tx(&self, params: &ConsensusParameters) -> Result>; + fn with_maturity(self, maturity: u32) -> Self; + fn with_gas_price(self, gas_price: u64) -> Self; + fn with_gas_limit(self, gas_limit: u64) -> Self; + fn with_tx_params(self, tx_params: TxParameters) -> Self; + fn with_inputs(self, inputs: Vec) -> Self; + fn with_outputs(self, outputs: Vec) -> Self; + fn with_witnesses(self, witnesses: Vec) -> Self; + fn with_consensus_parameters(self, consensus_parameters: ConsensusParameters) -> Self; + fn inputs(&self) -> &Vec; + fn inputs_mut(&mut self) -> &mut Vec; + fn outputs(&self) -> &Vec; + fn outputs_mut(&mut self) -> &mut Vec; + fn witnesses(&self) -> &Vec; + fn witnesses_mut(&mut self) -> &mut Vec; +} + +macro_rules! impl_tx_trait { + ($ty: ty, $tx_ty: ident) => { + impl TransactionBuilder for $ty { + type TxType = $tx_ty; + fn build(self) -> Result<$tx_ty> { + let uses_predicates = self.is_using_predicates(); + let (base_offset, consensus_parameters) = if uses_predicates { + let consensus_params = self + .consensus_parameters + .ok_or(error!( + TransactionBuildError, + "predicate inputs require consensus parameters. Use `.set_consensus_parameters()`."))?; + (self.base_offset(&consensus_params), consensus_params) + } else { + // If no ConsensusParameters have been set, we can use the default instead of + // erroring out since the tx doesn't use predicates + (0, self.consensus_parameters.unwrap_or_default()) + }; + + let num_witnesses = self.num_witnesses()?; + let mut tx = + self.resolve_fuel_tx(base_offset, num_witnesses, &consensus_parameters)?; + + tx.precompute(&consensus_parameters.chain_id)?; + + if uses_predicates { + estimate_predicates(&mut tx, &consensus_parameters)?; + }; + + Ok($tx_ty { tx }) + } + + fn add_unresolved_signature(&mut self, owner: Bech32Address, secret_key: SecretKey) { + let index_offset = self.unresolved_signatures.secret_keys.len() as u8; + self.unresolved_signatures.secret_keys.push(secret_key); + self.unresolved_signatures.addr_idx_offset_map.insert(owner, index_offset); + } + + fn fee_checked_from_tx(&self, params: &ConsensusParameters) -> Result>{ + let tx = self.clone().build()?.tx; + Ok(TransactionFee::checked_from_tx(params, &tx)) + } + + fn with_maturity(mut self, maturity: u32) -> Self { + self.maturity = maturity.into(); + self + } + + fn with_gas_price(mut self, gas_price: u64) -> Self { + self.gas_price = gas_price; + self + } + + fn with_gas_limit(mut self, gas_limit: u64) -> Self { + self.gas_limit = gas_limit; + self + } + + fn with_tx_params(self, tx_params: TxParameters) -> Self { + self.with_gas_limit(tx_params.gas_limit()) + .with_gas_price(tx_params.gas_price()) + .with_maturity(tx_params.maturity().into()) + } + + fn with_inputs(mut self, inputs: Vec) -> Self { + self.inputs = inputs; + self + } + + fn with_outputs(mut self, outputs: Vec) -> Self { + self.outputs = outputs; + self + } + + fn with_witnesses(mut self, witnesses: Vec) -> Self { + self.witnesses = witnesses; + self + } + + fn with_consensus_parameters( + mut self, + consensus_parameters: ConsensusParameters, + ) -> Self { + self.consensus_parameters = Some(consensus_parameters); + self + } + + fn inputs(&self) -> &Vec { + self.inputs.as_ref() + } + + fn inputs_mut(&mut self) -> &mut Vec { + &mut self.inputs + } + + fn outputs(&self) -> &Vec { + self.outputs.as_ref() + } + + fn outputs_mut(&mut self) -> &mut Vec { + &mut self.outputs + } + + fn witnesses(&self) -> &Vec { + self.witnesses.as_ref() + } + + fn witnesses_mut(&mut self) -> &mut Vec { + &mut self.witnesses + } + } + + impl $ty { + fn is_using_predicates(&self) -> bool { + self.inputs() + .iter() + .any(|input| matches!(input, Input::ResourcePredicate { .. })) + } + + fn num_witnesses(&self) -> Result { + let num_witnesses = self + .witnesses() + .len(); + + if num_witnesses + self.unresolved_signatures.secret_keys.len() > 256 { + return Err(error!(InvalidData, "tx can not have more than 256 witnesses")); + } + + Ok(num_witnesses as u8) + } + } + }; +} + +#[derive(Debug, Clone, Default)] +pub struct ScriptTransactionBuilder { + pub gas_price: u64, + pub gas_limit: u64, + pub maturity: u32, + pub script: Vec, + pub script_data: Vec, + pub inputs: Vec, + pub outputs: Vec, + pub witnesses: Vec, + pub(crate) consensus_parameters: Option, + unresolved_signatures: UnresolvedSignatures, +} + +#[derive(Debug, Clone, Default)] +pub struct CreateTransactionBuilder { + pub gas_price: u64, + pub gas_limit: u64, + pub maturity: u32, + pub bytecode_length: u64, + pub bytecode_witness_index: u8, + pub storage_slots: Vec, + pub inputs: Vec, + pub outputs: Vec, + pub witnesses: Vec, + pub salt: Salt, + pub(crate) consensus_parameters: Option, + unresolved_signatures: UnresolvedSignatures, +} + +impl_tx_trait!(ScriptTransactionBuilder, ScriptTransaction); +impl_tx_trait!(CreateTransactionBuilder, CreateTransaction); + +impl ScriptTransactionBuilder { + fn resolve_fuel_tx( + self, + base_offset: usize, + num_witnesses: u8, + consensus_parameters: &ConsensusParameters, + ) -> Result