From 79c1ec1055fdf8120bf5aff67b6794fbcea078b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 11:32:18 +0100 Subject: [PATCH 01/36] Version Packages (#541) Co-authored-by: github-actions[bot] --- .changeset/empty-bats-wish.md | 5 ---- .changeset/four-sides-jog.md | 5 ---- .changeset/fuzzy-bats-repair.md | 5 ---- .changeset/gorgeous-news-camp.md | 5 ---- .changeset/hot-parents-hunt.md | 5 ---- .changeset/major-insects-do.md | 28 -------------------- .changeset/silver-games-brake.md | 5 ---- packages/bcs/CHANGELOG.md | 11 ++++++++ packages/bcs/package.json | 2 +- packages/codegen/CHANGELOG.md | 15 +++++++++++ packages/codegen/package.json | 2 +- packages/create-dapp/CHANGELOG.md | 13 +++++++++ packages/create-dapp/package.json | 2 +- packages/dapp-kit/CHANGELOG.md | 15 +++++++++++ packages/dapp-kit/package.json | 2 +- packages/deepbook-v3/CHANGELOG.md | 13 +++++++++ packages/deepbook-v3/package.json | 2 +- packages/deepbook/CHANGELOG.md | 12 +++++++++ packages/deepbook/package.json | 2 +- packages/enoki-connect/CHANGELOG.md | 19 +++++++++++++ packages/enoki-connect/package.json | 2 +- packages/enoki/CHANGELOG.md | 15 +++++++++++ packages/enoki/package.json | 2 +- packages/graphql-transport/CHANGELOG.md | 13 +++++++++ packages/graphql-transport/package.json | 2 +- packages/kiosk/CHANGELOG.md | 13 +++++++++ packages/kiosk/package.json | 2 +- packages/ledgerjs-hw-app-sui/CHANGELOG.md | 6 +++++ packages/ledgerjs-hw-app-sui/package.json | 2 +- packages/move-bytecode-template/CHANGELOG.md | 6 +++++ packages/move-bytecode-template/package.json | 2 +- packages/mvr-static/CHANGELOG.md | 12 +++++++++ packages/mvr-static/package.json | 2 +- packages/seal/CHANGELOG.md | 13 +++++++++ packages/seal/package.json | 2 +- packages/seal/src/version.ts | 2 +- packages/signers/CHANGELOG.md | 13 +++++++++ packages/signers/package.json | 2 +- packages/slush-wallet/CHANGELOG.md | 16 +++++++++++ packages/slush-wallet/package.json | 2 +- packages/sui-grpc/CHANGELOG.md | 13 +++++++++ packages/sui-grpc/package.json | 2 +- packages/suins/CHANGELOG.md | 12 +++++++++ packages/suins/package.json | 2 +- packages/typescript/CHANGELOG.md | 13 +++++++++ packages/typescript/package.json | 2 +- packages/typescript/src/version.ts | 2 +- packages/utils/CHANGELOG.md | 6 +++++ packages/utils/package.json | 2 +- packages/wallet-standard/CHANGELOG.md | 12 +++++++++ packages/wallet-standard/package.json | 2 +- packages/walrus/CHANGELOG.md | 14 ++++++++++ packages/walrus/package.json | 2 +- packages/window-wallet-core/CHANGELOG.md | 13 ++++++++- packages/window-wallet-core/package.json | 2 +- packages/zksend/CHANGELOG.md | 16 +++++++++++ packages/zksend/package.json | 2 +- 57 files changed, 329 insertions(+), 85 deletions(-) delete mode 100644 .changeset/empty-bats-wish.md delete mode 100644 .changeset/four-sides-jog.md delete mode 100644 .changeset/fuzzy-bats-repair.md delete mode 100644 .changeset/gorgeous-news-camp.md delete mode 100644 .changeset/hot-parents-hunt.md delete mode 100644 .changeset/major-insects-do.md delete mode 100644 .changeset/silver-games-brake.md diff --git a/.changeset/empty-bats-wish.md b/.changeset/empty-bats-wish.md deleted file mode 100644 index 28775455b..000000000 --- a/.changeset/empty-bats-wish.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/codegen': minor ---- - -Add option to codegen private functions which defaults to generating only private entry functions diff --git a/.changeset/four-sides-jog.md b/.changeset/four-sides-jog.md deleted file mode 100644 index 76b4ee2d6..000000000 --- a/.changeset/four-sides-jog.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/window-wallet-core': patch ---- - -add config option to use an existing window instead of opening a new one diff --git a/.changeset/fuzzy-bats-repair.md b/.changeset/fuzzy-bats-repair.md deleted file mode 100644 index e0c687831..000000000 --- a/.changeset/fuzzy-bats-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/enoki': patch ---- - -reuse existing proof when available diff --git a/.changeset/gorgeous-news-camp.md b/.changeset/gorgeous-news-camp.md deleted file mode 100644 index 27e2930fb..000000000 --- a/.changeset/gorgeous-news-camp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui': patch ---- - -Adds `deriveObjectID` helper to calculate `derived_object` addresses. diff --git a/.changeset/hot-parents-hunt.md b/.changeset/hot-parents-hunt.md deleted file mode 100644 index 6a72164ff..000000000 --- a/.changeset/hot-parents-hunt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/enoki-connect': minor ---- - -show fallback modal to click to open a popup when opening a new tab is blocked diff --git a/.changeset/major-insects-do.md b/.changeset/major-insects-do.md deleted file mode 100644 index 43bcf9c8c..000000000 --- a/.changeset/major-insects-do.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -'@mysten/move-bytecode-template': minor -'@mysten/ledgerjs-hw-app-sui': minor -'@mysten/window-wallet-core': minor -'@mysten/graphql-transport': minor -'@mysten/wallet-standard': minor -'@mysten/enoki-connect': minor -'@mysten/slush-wallet': minor -'@mysten/create-dapp': minor -'@mysten/deepbook-v3': minor -'@mysten/mvr-static': minor -'@mysten/sui': minor -'@mysten/dapp-kit': minor -'@mysten/deepbook': minor -'@mysten/sui-grpc': minor -'@mysten/codegen': minor -'@mysten/signers': minor -'@mysten/walrus': minor -'@mysten/zksend': minor -'@mysten/enoki': minor -'@mysten/kiosk': minor -'@mysten/suins': minor -'@mysten/utils': minor -'@mysten/seal': minor -'@mysten/bcs': minor ---- - -Update dependencies and improve support for typescript 5.9 diff --git a/.changeset/silver-games-brake.md b/.changeset/silver-games-brake.md deleted file mode 100644 index 86f5dd9af..000000000 --- a/.changeset/silver-games-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/enoki-connect': patch ---- - -enhance wallet operation request popup fallback modal to support custom CSS variables for improved styling flexibility diff --git a/packages/bcs/CHANGELOG.md b/packages/bcs/CHANGELOG.md index 7a56d198a..86507e789 100644 --- a/packages/bcs/CHANGELOG.md +++ b/packages/bcs/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 1.8.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [ea1ac70] + - @mysten/utils@0.2.0 + ## 1.7.0 ### Minor Changes diff --git a/packages/bcs/package.json b/packages/bcs/package.json index 3f5ad1666..d6a1922bc 100644 --- a/packages/bcs/package.json +++ b/packages/bcs/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/bcs", - "version": "1.7.0", + "version": "1.8.0", "description": "BCS - Canonical Binary Serialization implementation for JavaScript", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/codegen/CHANGELOG.md b/packages/codegen/CHANGELOG.md index 2067d8623..1f844a4ce 100644 --- a/packages/codegen/CHANGELOG.md +++ b/packages/codegen/CHANGELOG.md @@ -1,5 +1,20 @@ # @mysten/codegen +## 0.5.0 + +### Minor Changes + +- 223d075: Add option to codegen private functions which defaults to generating only private entry + functions +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/bcs@1.8.0 + ## 0.4.5 ### Patch Changes diff --git a/packages/codegen/package.json b/packages/codegen/package.json index 41bfbc8ff..e43e2f26a 100644 --- a/packages/codegen/package.json +++ b/packages/codegen/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/codegen", - "version": "0.4.5", + "version": "0.5.0", "description": "typescript codegen for sui move", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/create-dapp/CHANGELOG.md b/packages/create-dapp/CHANGELOG.md index 0c52a071a..fc5e09bcd 100644 --- a/packages/create-dapp/CHANGELOG.md +++ b/packages/create-dapp/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/create-dapp +## 0.5.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/dapp-kit@0.18.0 + ## 0.4.26 ### Patch Changes diff --git a/packages/create-dapp/package.json b/packages/create-dapp/package.json index e3e26113f..7d691cab1 100644 --- a/packages/create-dapp/package.json +++ b/packages/create-dapp/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "A CLI for creating new Sui dApps", "homepage": "https://sdk.mystenlabs.com", - "version": "0.4.26", + "version": "0.5.0", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/packages/dapp-kit/CHANGELOG.md b/packages/dapp-kit/CHANGELOG.md index 36cfa3bb4..ceed90d77 100644 --- a/packages/dapp-kit/CHANGELOG.md +++ b/packages/dapp-kit/CHANGELOG.md @@ -1,5 +1,20 @@ # @mysten/dapp-kit +## 0.18.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/wallet-standard@0.17.0 + - @mysten/slush-wallet@0.2.0 + - @mysten/utils@0.2.0 + ## 0.17.7 ### Patch Changes diff --git a/packages/dapp-kit/package.json b/packages/dapp-kit/package.json index 786bca2ff..c67c4cff6 100644 --- a/packages/dapp-kit/package.json +++ b/packages/dapp-kit/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "A collection of React hooks and components for interacting with the Sui blockchain and wallets.", "homepage": "https://sdk.mystenlabs.com/typescript", - "version": "0.17.7", + "version": "0.18.0", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/packages/deepbook-v3/CHANGELOG.md b/packages/deepbook-v3/CHANGELOG.md index 33c4ffeb9..706975343 100644 --- a/packages/deepbook-v3/CHANGELOG.md +++ b/packages/deepbook-v3/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/deepbook-v3 +## 0.17.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/bcs@1.8.0 + ## 0.16.1 ### Patch Changes diff --git a/packages/deepbook-v3/package.json b/packages/deepbook-v3/package.json index da40a2e49..f11fac47c 100644 --- a/packages/deepbook-v3/package.json +++ b/packages/deepbook-v3/package.json @@ -2,7 +2,7 @@ "name": "@mysten/deepbook-v3", "author": "Mysten Labs ", "description": "Sui Deepbook SDK", - "version": "0.16.1", + "version": "0.17.0", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/packages/deepbook/CHANGELOG.md b/packages/deepbook/CHANGELOG.md index 2cf4b7196..533e775c9 100644 --- a/packages/deepbook/CHANGELOG.md +++ b/packages/deepbook/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/deepbook +## 0.9.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + ## 0.8.74 ### Patch Changes diff --git a/packages/deepbook/package.json b/packages/deepbook/package.json index 3a2ef5bad..46e3687d7 100644 --- a/packages/deepbook/package.json +++ b/packages/deepbook/package.json @@ -2,7 +2,7 @@ "name": "@mysten/deepbook", "author": "Mysten Labs ", "description": "Sui Deepbook SDK", - "version": "0.8.74", + "version": "0.9.0", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/packages/enoki-connect/CHANGELOG.md b/packages/enoki-connect/CHANGELOG.md index 916432328..07fbc20da 100644 --- a/packages/enoki-connect/CHANGELOG.md +++ b/packages/enoki-connect/CHANGELOG.md @@ -1,5 +1,24 @@ # @mysten/enoki-connect +## 0.1.0 + +### Minor Changes + +- 45efc26: show fallback modal to click to open a popup when opening a new tab is blocked +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- 45efc26: enhance wallet operation request popup fallback modal to support custom CSS variables for + improved styling flexibility +- Updated dependencies [45efc26] +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/window-wallet-core@0.1.0 + - @mysten/sui@1.38.0 + - @mysten/wallet-standard@0.17.0 + - @mysten/utils@0.2.0 + ## 0.0.26 ### Patch Changes diff --git a/packages/enoki-connect/package.json b/packages/enoki-connect/package.json index a4b58a217..9e751d915 100644 --- a/packages/enoki-connect/package.json +++ b/packages/enoki-connect/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/enoki-connect", - "version": "0.0.26", + "version": "0.1.0", "description": "Enoki Connect Wallet-Standard implementation", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/enoki/CHANGELOG.md b/packages/enoki/CHANGELOG.md index 583c1a08a..c9471a4ea 100644 --- a/packages/enoki/CHANGELOG.md +++ b/packages/enoki/CHANGELOG.md @@ -1,5 +1,20 @@ # @mysten/enoki +## 0.12.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- 1fb857c: reuse existing proof when available +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/wallet-standard@0.17.0 + - @mysten/signers@0.4.0 + ## 0.11.10 ### Patch Changes diff --git a/packages/enoki/package.json b/packages/enoki/package.json index c795167cb..056221d08 100644 --- a/packages/enoki/package.json +++ b/packages/enoki/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/enoki", - "version": "0.11.10", + "version": "0.12.0", "description": "TODO: Description", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/graphql-transport/CHANGELOG.md b/packages/graphql-transport/CHANGELOG.md index d84eba70c..0a9f4d675 100644 --- a/packages/graphql-transport/CHANGELOG.md +++ b/packages/graphql-transport/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/graphql-transport +## 0.4.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/bcs@1.8.0 + ## 0.3.9 ### Patch Changes diff --git a/packages/graphql-transport/package.json b/packages/graphql-transport/package.json index d88b3a86b..53c68a996 100644 --- a/packages/graphql-transport/package.json +++ b/packages/graphql-transport/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/graphql-transport", - "version": "0.3.9", + "version": "0.4.0", "description": "A GraphQL transport to allow SuiClient to work with RPC 2.0", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/kiosk/CHANGELOG.md b/packages/kiosk/CHANGELOG.md index 2ea6e6bf3..c2b16b424 100644 --- a/packages/kiosk/CHANGELOG.md +++ b/packages/kiosk/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/kiosk +## 0.13.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/utils@0.2.0 + ## 0.12.26 ### Patch Changes diff --git a/packages/kiosk/package.json b/packages/kiosk/package.json index 5ce193b0b..8319108c0 100644 --- a/packages/kiosk/package.json +++ b/packages/kiosk/package.json @@ -2,7 +2,7 @@ "name": "@mysten/kiosk", "author": "Mysten Labs ", "description": "Sui Kiosk library", - "version": "0.12.26", + "version": "0.13.0", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/packages/ledgerjs-hw-app-sui/CHANGELOG.md b/packages/ledgerjs-hw-app-sui/CHANGELOG.md index 8a46ca7fa..3b98b0835 100644 --- a/packages/ledgerjs-hw-app-sui/CHANGELOG.md +++ b/packages/ledgerjs-hw-app-sui/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/ledgerjs-hw-app-sui +## 0.6.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + ## 0.5.2 ### Patch Changes diff --git a/packages/ledgerjs-hw-app-sui/package.json b/packages/ledgerjs-hw-app-sui/package.json index 1c25deb39..e01d3d2ae 100644 --- a/packages/ledgerjs-hw-app-sui/package.json +++ b/packages/ledgerjs-hw-app-sui/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/ledgerjs-hw-app-sui", - "version": "0.5.2", + "version": "0.6.0", "description": "Ledger Hardware Wallet Sui Application API", "keywords": [ "Ledger", diff --git a/packages/move-bytecode-template/CHANGELOG.md b/packages/move-bytecode-template/CHANGELOG.md index b06225814..7aa8d707c 100644 --- a/packages/move-bytecode-template/CHANGELOG.md +++ b/packages/move-bytecode-template/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/move-bytecode-template +## 0.3.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + ## 0.2.1 ### Patch Changes diff --git a/packages/move-bytecode-template/package.json b/packages/move-bytecode-template/package.json index 1a41682f2..4542a7690 100644 --- a/packages/move-bytecode-template/package.json +++ b/packages/move-bytecode-template/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/move-bytecode-template", - "version": "0.2.1", + "version": "0.3.0", "description": "Move Binary Format implementation in WASM", "main": "index.js", "types": "./web/move_bytecode_template.d.ts", diff --git a/packages/mvr-static/CHANGELOG.md b/packages/mvr-static/CHANGELOG.md index 39d59409b..60c67b1d9 100644 --- a/packages/mvr-static/CHANGELOG.md +++ b/packages/mvr-static/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/mvr-static +## 0.2.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + ## 0.1.31 ### Patch Changes diff --git a/packages/mvr-static/package.json b/packages/mvr-static/package.json index cf2bdf68d..000e285b3 100644 --- a/packages/mvr-static/package.json +++ b/packages/mvr-static/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "The static generation tool for Move Registry (mvr)", "homepage": "https://sdk.mystenlabs.com", - "version": "0.1.31", + "version": "0.2.0", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/packages/seal/CHANGELOG.md b/packages/seal/CHANGELOG.md index fd3ebf67a..523084496 100644 --- a/packages/seal/CHANGELOG.md +++ b/packages/seal/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/seal +## 0.6.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/bcs@1.8.0 + ## 0.5.2 ### Patch Changes diff --git a/packages/seal/package.json b/packages/seal/package.json index 27022c02e..b3fc8a57c 100644 --- a/packages/seal/package.json +++ b/packages/seal/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/seal", - "version": "0.5.2", + "version": "0.6.0", "description": "Seal SDK", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/seal/src/version.ts b/packages/seal/src/version.ts index 1ec1d4f42..203f46c91 100644 --- a/packages/seal/src/version.ts +++ b/packages/seal/src/version.ts @@ -3,4 +3,4 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '0.5.2'; +export const PACKAGE_VERSION = '0.6.0'; diff --git a/packages/signers/CHANGELOG.md b/packages/signers/CHANGELOG.md index b37dbaf06..78fe9b50b 100644 --- a/packages/signers/CHANGELOG.md +++ b/packages/signers/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/signers +## 0.4.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/ledgerjs-hw-app-sui@0.6.0 + ## 0.3.9 ### Patch Changes diff --git a/packages/signers/package.json b/packages/signers/package.json index db4103606..1ce9bfff4 100644 --- a/packages/signers/package.json +++ b/packages/signers/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/signers", - "version": "0.3.9", + "version": "0.4.0", "description": "A collection of signers for various providers", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/slush-wallet/CHANGELOG.md b/packages/slush-wallet/CHANGELOG.md index 8cc396d7d..cd72654c7 100644 --- a/packages/slush-wallet/CHANGELOG.md +++ b/packages/slush-wallet/CHANGELOG.md @@ -1,5 +1,21 @@ # @mysten/slush-wallet +## 0.2.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [45efc26] +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/window-wallet-core@0.1.0 + - @mysten/sui@1.38.0 + - @mysten/wallet-standard@0.17.0 + - @mysten/utils@0.2.0 + ## 0.1.24 ### Patch Changes diff --git a/packages/slush-wallet/package.json b/packages/slush-wallet/package.json index 8eda15c67..eff1af7b7 100644 --- a/packages/slush-wallet/package.json +++ b/packages/slush-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/slush-wallet", - "version": "0.1.24", + "version": "0.2.0", "description": "Wallet adapter for Slush web wallet", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/sui-grpc/CHANGELOG.md b/packages/sui-grpc/CHANGELOG.md index 3714eb8a2..8f863dcf2 100644 --- a/packages/sui-grpc/CHANGELOG.md +++ b/packages/sui-grpc/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/sui-grpc +## 0.1.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/utils@0.2.0 + ## 0.0.17 ### Patch Changes diff --git a/packages/sui-grpc/package.json b/packages/sui-grpc/package.json index bfe8799b8..ac8cadc86 100644 --- a/packages/sui-grpc/package.json +++ b/packages/sui-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/sui-grpc", - "version": "0.0.17", + "version": "0.1.0", "description": "A typescript GRPC client for sui", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/suins/CHANGELOG.md b/packages/suins/CHANGELOG.md index 685e83b91..368148794 100644 --- a/packages/suins/CHANGELOG.md +++ b/packages/suins/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/suins +## 0.8.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + ## 0.7.36 ### Patch Changes diff --git a/packages/suins/package.json b/packages/suins/package.json index 23e386cdf..e72fc6f51 100644 --- a/packages/suins/package.json +++ b/packages/suins/package.json @@ -2,7 +2,7 @@ "name": "@mysten/suins", "author": "Mysten Labs ", "description": "SuiNS SDK", - "version": "0.7.36", + "version": "0.8.0", "license": "Apache-2.0", "private": false, "type": "commonjs", diff --git a/packages/typescript/CHANGELOG.md b/packages/typescript/CHANGELOG.md index 6d9d7626a..42bf9e669 100644 --- a/packages/typescript/CHANGELOG.md +++ b/packages/typescript/CHANGELOG.md @@ -1,5 +1,18 @@ # @mysten/sui.js +## 1.38.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- 3c1741f: Adds `deriveObjectID` helper to calculate `derived_object` addresses. +- Updated dependencies [ea1ac70] + - @mysten/utils@0.2.0 + - @mysten/bcs@1.8.0 + ## 1.37.6 ### Patch Changes diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 2a0684794..f557ed873 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "Sui TypeScript API", "homepage": "https://sdk.mystenlabs.com", - "version": "1.37.6", + "version": "1.38.0", "license": "Apache-2.0", "sideEffects": false, "files": [ diff --git a/packages/typescript/src/version.ts b/packages/typescript/src/version.ts index 0f5ab86fd..78dc58b0c 100644 --- a/packages/typescript/src/version.ts +++ b/packages/typescript/src/version.ts @@ -3,5 +3,5 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '1.37.6'; +export const PACKAGE_VERSION = '1.38.0'; export const TARGETED_RPC_VERSION = '1.57.0'; diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 3fa60a4c7..31f388a53 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/utils +## 0.2.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + ## 0.1.1 ### Patch Changes diff --git a/packages/utils/package.json b/packages/utils/package.json index fb9c8b0c3..b516616cd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/utils", - "version": "0.1.1", + "version": "0.2.0", "description": "Shared utilities for @mysten/* packages", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/wallet-standard/CHANGELOG.md b/packages/wallet-standard/CHANGELOG.md index bfd903964..975832a16 100644 --- a/packages/wallet-standard/CHANGELOG.md +++ b/packages/wallet-standard/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/wallet-standard +## 0.17.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + ## 0.16.14 ### Patch Changes diff --git a/packages/wallet-standard/package.json b/packages/wallet-standard/package.json index 95e036936..0d8b8241b 100644 --- a/packages/wallet-standard/package.json +++ b/packages/wallet-standard/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/wallet-standard", - "version": "0.16.14", + "version": "0.17.0", "description": "A suite of standard utilities for implementing wallets based on the Wallet Standard.", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/walrus/CHANGELOG.md b/packages/walrus/CHANGELOG.md index 0dd29e069..26c01b1bc 100644 --- a/packages/walrus/CHANGELOG.md +++ b/packages/walrus/CHANGELOG.md @@ -1,5 +1,19 @@ # @mysten/walrus +## 0.7.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/sui@1.38.0 + - @mysten/utils@0.2.0 + - @mysten/bcs@1.8.0 + ## 0.6.7 ### Patch Changes diff --git a/packages/walrus/package.json b/packages/walrus/package.json index cc502287b..86b0601ee 100644 --- a/packages/walrus/package.json +++ b/packages/walrus/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/walrus", - "version": "0.6.7", + "version": "0.7.0", "private": false, "description": "Walrus SDK", "license": "Apache-2.0", diff --git a/packages/window-wallet-core/CHANGELOG.md b/packages/window-wallet-core/CHANGELOG.md index 27df7d043..890fff494 100644 --- a/packages/window-wallet-core/CHANGELOG.md +++ b/packages/window-wallet-core/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/window-wallet-core +## 0.1.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- 45efc26: add config option to use an existing window instead of opening a new one +- Updated dependencies [ea1ac70] + - @mysten/utils@0.2.0 + ## 0.0.6 ### Patch Changes @@ -28,7 +40,6 @@ ### Patch Changes - a257600: improve verifyJwtSession - - remove opener origin check as it's not possible to access it - add extra CryptoKey type to verifyJwtSession secretKey diff --git a/packages/window-wallet-core/package.json b/packages/window-wallet-core/package.json index b92b10dec..1daf0554c 100644 --- a/packages/window-wallet-core/package.json +++ b/packages/window-wallet-core/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/window-wallet-core", - "version": "0.0.6", + "version": "0.1.0", "description": "Window wallet core functionality", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/zksend/CHANGELOG.md b/packages/zksend/CHANGELOG.md index 91de8813b..d27a3bb23 100644 --- a/packages/zksend/CHANGELOG.md +++ b/packages/zksend/CHANGELOG.md @@ -1,5 +1,21 @@ # @mysten/zksend +## 0.14.0 + +### Minor Changes + +- ea1ac70: Update dependencies and improve support for typescript 5.9 + +### Patch Changes + +- Updated dependencies [45efc26] +- Updated dependencies [3c1741f] +- Updated dependencies [ea1ac70] + - @mysten/window-wallet-core@0.1.0 + - @mysten/sui@1.38.0 + - @mysten/wallet-standard@0.17.0 + - @mysten/utils@0.2.0 + ## 0.13.24 ### Patch Changes diff --git a/packages/zksend/package.json b/packages/zksend/package.json index c7dcead2d..fbea549b5 100644 --- a/packages/zksend/package.json +++ b/packages/zksend/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/zksend", - "version": "0.13.24", + "version": "0.14.0", "description": "TODO: Write Description", "license": "Apache-2.0", "author": "Mysten Labs ", From 0fb52716ac1ae6974d19b471ea26cf8b5c011e45 Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Wed, 10 Sep 2025 20:14:52 -0500 Subject: [PATCH 02/36] Fix kiosk imports (#546) --- .changeset/quiet-plums-pump.md | 5 +++++ packages/kiosk/src/constants.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/quiet-plums-pump.md diff --git a/.changeset/quiet-plums-pump.md b/.changeset/quiet-plums-pump.md new file mode 100644 index 000000000..fce6e2b86 --- /dev/null +++ b/.changeset/quiet-plums-pump.md @@ -0,0 +1,5 @@ +--- +'@mysten/kiosk': patch +--- + +Fix double-slash in Kiosk imports. diff --git a/packages/kiosk/src/constants.ts b/packages/kiosk/src/constants.ts index d4fa4e815..b5358314b 100644 --- a/packages/kiosk/src/constants.ts +++ b/packages/kiosk/src/constants.ts @@ -7,7 +7,7 @@ import { resolveKioskLockRule, resolvePersonalKioskRule, resolveRoyaltyRule, -} from './tx/rules//resolve.js'; +} from './tx/rules/resolve.js'; import { Network } from './types/index.js'; import type { ObjectArgument, RuleResolvingParams } from './types/index.js'; From 642ff2784ffb89b1bce4a43a6ceae91c04486669 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:33:44 -0500 Subject: [PATCH 03/36] Version Packages (#547) Co-authored-by: github-actions[bot] --- .changeset/quiet-plums-pump.md | 5 ----- packages/kiosk/CHANGELOG.md | 6 ++++++ packages/kiosk/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/quiet-plums-pump.md diff --git a/.changeset/quiet-plums-pump.md b/.changeset/quiet-plums-pump.md deleted file mode 100644 index fce6e2b86..000000000 --- a/.changeset/quiet-plums-pump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/kiosk': patch ---- - -Fix double-slash in Kiosk imports. diff --git a/packages/kiosk/CHANGELOG.md b/packages/kiosk/CHANGELOG.md index c2b16b424..58584cc55 100644 --- a/packages/kiosk/CHANGELOG.md +++ b/packages/kiosk/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/kiosk +## 0.13.1 + +### Patch Changes + +- 0fb5271: Fix double-slash in Kiosk imports. + ## 0.13.0 ### Minor Changes diff --git a/packages/kiosk/package.json b/packages/kiosk/package.json index 8319108c0..90081eb97 100644 --- a/packages/kiosk/package.json +++ b/packages/kiosk/package.json @@ -2,7 +2,7 @@ "name": "@mysten/kiosk", "author": "Mysten Labs ", "description": "Sui Kiosk library", - "version": "0.13.0", + "version": "0.13.1", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", From fe8b58b1114f16b330cedaf526d8c1a53bed83a1 Mon Sep 17 00:00:00 2001 From: Manolis Liolios Date: Wed, 17 Sep 2025 21:18:26 +0300 Subject: [PATCH 04/36] [docs] Add derived object docs (#549) * Add derived object TS docs * Fix * remove normalize, nest under utils, fix/enhance tests to include the doc cases * remove from base meta --- .../typescript/utils/derived_objects.mdx | 61 +++++++++++++++++++ .../typescript/{utils.mdx => utils/index.mdx} | 0 .../docs/content/typescript/utils/meta.json | 4 ++ .../test/unit/utils/derived-objects.test.ts | 28 +++++++-- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 packages/docs/content/typescript/utils/derived_objects.mdx rename packages/docs/content/typescript/{utils.mdx => utils/index.mdx} (100%) create mode 100644 packages/docs/content/typescript/utils/meta.json diff --git a/packages/docs/content/typescript/utils/derived_objects.mdx b/packages/docs/content/typescript/utils/derived_objects.mdx new file mode 100644 index 000000000..e2f2d6c7d --- /dev/null +++ b/packages/docs/content/typescript/utils/derived_objects.mdx @@ -0,0 +1,61 @@ +--- +title: Derived Objects +--- + +Derived objects enable deterministic IDs for objects, enabling offline derivation of object IDs. +[Click here to read more.](https://docs.sui.io/concepts/sui-move-concepts/derived-objects) + +To derive an object ID, you can import `deriveObjectID` function exposed from utils. + +```typescript +import { deriveObjectID } from '@mysten/sui/utils'; +``` + +To derive any object, you need to have its parent's ID (the object from which it was derived), and +the key used to generate it. + + + It is recommended to verify the on-chain `derived_object::derive_address` match your off-chain + calculation (at least once when implementing offline calculations), especially for critical cases + like transferring assets. + + +## Deriving using primitive keys + +To derive the IDs using primitive types, you can use the built-in types like this, assuming you have +a parent object with ID `0xc0ffee`. + +```typescript +// Example 1: On-chain derivation for `0xc0ffee + vector([0,1,2]) +deriveObjectID('0xc0ffee', 'vector', bcs.vector(bcs.u8()).serialize([0, 1, 2]).toBytes()); + +// Example 2: On-chain derivation for `0xc0ffee + address('0x111')` +deriveObjectID('0xc0ffee', 'address', bcs.Address.serialize('0x111').toBytes()); + +// Example 3: On-chain derivation for `0xc0ffee + non-ascii string ("foo")` +deriveObjectID('0xc0ffee', '0x1::string::String', bcs.String.serialize('foo').toBytes()); +``` + +## Deriving using custom types + +To derive IDs using your custom objects, you can use BCS & the known type IDs. + +Assuming a custom struct on-chain (for the key) being: + +```move +public struct DemoStruct has copy, store, drop { value: u64 } +``` + +you can derive it by doing: + +```typescript +// Assuming we wanted to derive for key `DemoStruct { value: 1 }`. +const bcsType = bcs.struct('DemoStruct', { + value: bcs.u64(), +}); + +const key = bcsType.serialize({ value: 1 }).toBytes(); + +// Derive the object ID for the key `DemoStruct { value: 1 }`. +deriveObjectID('0xc0ffee', `0xc0ffee::demo::DemoStruct`, key); +``` diff --git a/packages/docs/content/typescript/utils.mdx b/packages/docs/content/typescript/utils/index.mdx similarity index 100% rename from packages/docs/content/typescript/utils.mdx rename to packages/docs/content/typescript/utils/index.mdx diff --git a/packages/docs/content/typescript/utils/meta.json b/packages/docs/content/typescript/utils/meta.json new file mode 100644 index 000000000..6ee92bc39 --- /dev/null +++ b/packages/docs/content/typescript/utils/meta.json @@ -0,0 +1,4 @@ +{ + "title": "The `@mysten/sui/utils` package", + "derived_objects": "Derived Objects" +} diff --git a/packages/typescript/test/unit/utils/derived-objects.test.ts b/packages/typescript/test/unit/utils/derived-objects.test.ts index 94006d8fb..48ae984e0 100644 --- a/packages/typescript/test/unit/utils/derived-objects.test.ts +++ b/packages/typescript/test/unit/utils/derived-objects.test.ts @@ -5,7 +5,6 @@ import { describe, expect, test } from 'vitest'; import { bcs, TypeTagSerializer } from '../../../src/bcs'; import { deriveObjectID } from '../../../src/utils/derived-objects'; -import { normalizeSuiAddress } from '../../../src/utils'; // Snapshots are recreated from `derived_object_tests.move` file, // as well as `sui-types/derived-object.rs` file. @@ -13,12 +12,12 @@ describe('derived object test utils', () => { test('deriveObjectID with primitive type', () => { const key = bcs.vector(bcs.u8()).serialize(new TextEncoder().encode('foo')).toBytes(); - expect(deriveObjectID(normalizeSuiAddress('0x2'), 'vector', key)).toBe( + expect(deriveObjectID('0x2', 'vector', key)).toBe( + '0xa2b411aa9588c398d8e3bc97dddbdd430b5ded7f81545d05e33916c3ca0f30c3', + ); + expect(deriveObjectID('0x2', TypeTagSerializer.parseFromStr('vector'), key)).toBe( '0xa2b411aa9588c398d8e3bc97dddbdd430b5ded7f81545d05e33916c3ca0f30c3', ); - expect( - deriveObjectID(normalizeSuiAddress('0x2'), TypeTagSerializer.parseFromStr('vector'), key), - ).toBe('0xa2b411aa9588c398d8e3bc97dddbdd430b5ded7f81545d05e33916c3ca0f30c3'); }); test('deriveObjectID with struct type', () => { @@ -67,4 +66,23 @@ describe('derived object test utils', () => { '0x4de7696edddfb592a8dc7c8b66053b1557eb4fa1a9194322562aabf3da9e9239', ); }); + + test('deriveObjectId from docs', () => { + const parentAddress = '0xc0ffee'; + + expect(deriveObjectID(parentAddress, 'address', bcs.Address.serialize('0x111').toBytes())).toBe( + '0x190ed830d9b453c5c620dc0385ced49cc84804644f5dbe66aa08c0e21947d1d4', + ); + expect( + deriveObjectID(parentAddress, '0x1::string::String', bcs.String.serialize('foo').toBytes()), + ).toBe('0x699219f4a2b6cfb8640bb853fc4ab4f497da038ec0614bfa2835aa27993399db'); + + expect( + deriveObjectID( + parentAddress, + 'vector', + bcs.vector(bcs.u8()).serialize([0, 1, 2]).toBytes(), + ), + ).toBe('0x9067661aa45d09dac59d3eec926f8cfabb6e1ec57a9803ebc170723d3b19a9e2'); + }); }); From bda17bfe7bfeaba2b1d08146c0c3e37ea4f7a69f Mon Sep 17 00:00:00 2001 From: tomiir Date: Thu, 18 Sep 2025 18:29:15 +0200 Subject: [PATCH 05/36] feat: WalletConnect Connector (#490) * feat: add universal-connector to createDappKit * feat: add demo * chore: change name * chore: add z-index * chore: use updated version with config * chore: lint fixes - remove unused script * chore: remove pid * chore: update lock * chore: rebuild lock * chore: remove changelog * chore: use projectId in initializer id * chore: remove isMounted check * feat: add getClient parameter to initialization. Make requests use corresponding provided network client * chore: use provided client * chore: use preconfigured getclient method * chore: rename to network * chore: fill in metadata * chore: emit events on accoutn reconnection. Amend readme * fix: remove duplicated emition * chore: use stable ak 1.7.20 * chore: parse transaction to get bytes. use waitforTransaction * chore: add toStandardAccounts util * feat: remove automatic wc initialization from dapp-kit * chore: remove unused dependencies * Update packages/walletconnect-wallet/src/wallet/index.ts Co-authored-by: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> * chore: update to latest ak * fix: issue with message re-encoding * chore: mantpkg fix and lock reset * fix: lint fixes * chore: remove .js from import * chore: rollback examples changes from linter * chore: add .ts to filename during import. Adds `allowImportingTsExtensions` to demo config * chore: update to latest stable appkit * chore: fix icon * Prepare for release --------- Co-authored-by: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Co-authored-by: Jordan Gensler --- .changeset/three-numbers-dress.md | 5 + CLAUDE.md | 10 +- .../simple/app/ClientOnlyConnectButton.tsx | 2 +- .../examples/next-js/simple/tsconfig.json | 1 + packages/suins/package.json | 2 +- packages/walletconnect-wallet/.prettierignore | 2 + packages/walletconnect-wallet/README.md | 1 + .../walletconnect-wallet/demo-dapp/README.md | 32 + .../walletconnect-wallet/demo-dapp/index.html | 59 + .../demo-dapp/package.json | 37 + .../demo-dapp/prettier.config.cjs | 4 + .../demo-dapp/src/Actions.tsx | 152 ++ .../demo-dapp/src/App.tsx | 41 + .../demo-dapp/src/OwnedObjects.tsx | 44 + .../demo-dapp/src/WalletStatus.tsx | 27 + .../demo-dapp/src/main.tsx | 42 + .../demo-dapp/src/networkConfig.ts | 19 + .../demo-dapp/src/vite-env.d.ts | 2 + .../demo-dapp/tsconfig.json | 25 + .../demo-dapp/tsconfig.node.json | 10 + .../demo-dapp/vite.config.mts | 7 + packages/walletconnect-wallet/package.json | 55 + packages/walletconnect-wallet/src/index.ts | 9 + .../walletconnect-wallet/src/wallet/index.ts | 407 ++++ .../walletconnect-wallet/tsconfig.esm.json | 7 + packages/walletconnect-wallet/tsconfig.json | 10 + packages/walletconnect-wallet/typedoc.json | 6 + .../walletconnect-wallet/vitest.config.mts | 6 + pnpm-lock.yaml | 1945 +++++++++++++++-- 29 files changed, 2745 insertions(+), 224 deletions(-) create mode 100644 .changeset/three-numbers-dress.md create mode 100644 packages/walletconnect-wallet/.prettierignore create mode 100644 packages/walletconnect-wallet/README.md create mode 100644 packages/walletconnect-wallet/demo-dapp/README.md create mode 100644 packages/walletconnect-wallet/demo-dapp/index.html create mode 100644 packages/walletconnect-wallet/demo-dapp/package.json create mode 100644 packages/walletconnect-wallet/demo-dapp/prettier.config.cjs create mode 100644 packages/walletconnect-wallet/demo-dapp/src/Actions.tsx create mode 100644 packages/walletconnect-wallet/demo-dapp/src/App.tsx create mode 100644 packages/walletconnect-wallet/demo-dapp/src/OwnedObjects.tsx create mode 100644 packages/walletconnect-wallet/demo-dapp/src/WalletStatus.tsx create mode 100644 packages/walletconnect-wallet/demo-dapp/src/main.tsx create mode 100644 packages/walletconnect-wallet/demo-dapp/src/networkConfig.ts create mode 100644 packages/walletconnect-wallet/demo-dapp/src/vite-env.d.ts create mode 100644 packages/walletconnect-wallet/demo-dapp/tsconfig.json create mode 100644 packages/walletconnect-wallet/demo-dapp/tsconfig.node.json create mode 100644 packages/walletconnect-wallet/demo-dapp/vite.config.mts create mode 100644 packages/walletconnect-wallet/package.json create mode 100644 packages/walletconnect-wallet/src/index.ts create mode 100644 packages/walletconnect-wallet/src/wallet/index.ts create mode 100644 packages/walletconnect-wallet/tsconfig.esm.json create mode 100644 packages/walletconnect-wallet/tsconfig.json create mode 100644 packages/walletconnect-wallet/typedoc.json create mode 100644 packages/walletconnect-wallet/vitest.config.mts diff --git a/.changeset/three-numbers-dress.md b/.changeset/three-numbers-dress.md new file mode 100644 index 000000000..c5e49e901 --- /dev/null +++ b/.changeset/three-numbers-dress.md @@ -0,0 +1,5 @@ +--- +'@mysten/walletconnect-wallet': minor +--- + +Initial Release diff --git a/CLAUDE.md b/CLAUDE.md index b9898f792..d0764b2c4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,6 +9,7 @@ This is a monorepo containing TypeScript SDKs for the Sui blockchain ecosystem. ## Common Commands ### Setup and Build + ```bash # Initial setup pnpm install @@ -22,6 +23,7 @@ pnpm turbo build --filter=@mysten/sui ``` ### Testing + ```bash # Run unit tests pnpm test @@ -37,6 +39,7 @@ pnpm test:e2e ``` ### Linting and Formatting + ```bash # Check lint and formatting pnpm lint @@ -50,6 +53,7 @@ pnpm prettier:check ``` ### Package Management + ```bash # Add a changeset for version updates pnpm changeset @@ -61,6 +65,7 @@ pnpm changeset-version ## Architecture ### Repository Structure + - **packages/** - All SDK packages organized by functionality - **typescript/** - Core Sui SDK with submodules for bcs, client, cryptography, transactions, etc. - **dapp-kit/** - React hooks and components for dApp development @@ -71,11 +76,13 @@ pnpm changeset-version - **zksend/** - zkSend functionality ### Build System + - Uses Turbo for monorepo task orchestration with dependency-aware builds - Each package can have its own test configuration (typically using Vitest) - Common build outputs: `dist/` for compiled code, with both ESM and CJS formats ### Key Patterns + 1. **Modular exports**: Packages use subpath exports (e.g., `@mysten/sui/client`, `@mysten/sui/bcs`) 2. **Shared utilities**: Common functionality in `packages/utils` 3. **Code generation**: Some packages use GraphQL codegen and version generation scripts @@ -83,7 +90,8 @@ pnpm changeset-version 5. **Type safety**: Extensive TypeScript usage with strict type checking ### Development Workflow + 1. Changes require changesets for version management 2. Turbo ensures dependencies are built before dependents 3. ESLint and Prettier are enforced across the codebase -4. Tests must pass before changes can be merged \ No newline at end of file +4. Tests must pass before changes can be merged diff --git a/packages/dapp-kit-next/examples/next-js/simple/app/ClientOnlyConnectButton.tsx b/packages/dapp-kit-next/examples/next-js/simple/app/ClientOnlyConnectButton.tsx index 09ce33b78..0e57d9223 100644 --- a/packages/dapp-kit-next/examples/next-js/simple/app/ClientOnlyConnectButton.tsx +++ b/packages/dapp-kit-next/examples/next-js/simple/app/ClientOnlyConnectButton.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { DAppKitProvider, ConnectButton } from '@mysten/dapp-kit-react'; -import { dAppKit } from './dApp-kit'; +import { dAppKit } from './dApp-kit.ts'; export default function ClientOnlyConnectButton() { return ( diff --git a/packages/dapp-kit-next/examples/next-js/simple/tsconfig.json b/packages/dapp-kit-next/examples/next-js/simple/tsconfig.json index 12f823df1..41a5af9a5 100644 --- a/packages/dapp-kit-next/examples/next-js/simple/tsconfig.json +++ b/packages/dapp-kit-next/examples/next-js/simple/tsconfig.json @@ -9,6 +9,7 @@ "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", + "allowImportingTsExtensions": true, "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/packages/suins/package.json b/packages/suins/package.json index e72fc6f51..2c76a2748 100644 --- a/packages/suins/package.json +++ b/packages/suins/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "@mysten/sui": "workspace:*", - "axios": "^1.10.0", + "axios": "^1.12.2", "axios-retry": "^4.5.0" }, "devDependencies": { diff --git a/packages/walletconnect-wallet/.prettierignore b/packages/walletconnect-wallet/.prettierignore new file mode 100644 index 000000000..f44447b8c --- /dev/null +++ b/packages/walletconnect-wallet/.prettierignore @@ -0,0 +1,2 @@ +CHANGELOG.md +dist/ diff --git a/packages/walletconnect-wallet/README.md b/packages/walletconnect-wallet/README.md new file mode 100644 index 000000000..6743b4736 --- /dev/null +++ b/packages/walletconnect-wallet/README.md @@ -0,0 +1 @@ +# `@mysten/walletconnect-wallet` diff --git a/packages/walletconnect-wallet/demo-dapp/README.md b/packages/walletconnect-wallet/demo-dapp/README.md new file mode 100644 index 000000000..b18e10c18 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/README.md @@ -0,0 +1,32 @@ +# Demo DApp + +This demo dApp provides a basic example of integrating WalletConnect wallet +connector into your Sui application. It demonstrates key wallet integration +features including: + +- Setting up the WalletProvider to use WalletConnect compatible wallets +- Connecting to multiple supported wallet providers +- Managing wallet connections, disconnections +- Executing transactions and message signing + +## Starting your dApp + +To install dependencies you can run + +```bash +pnpm install +``` + +To start your dApp in development mode run + +```bash +pnpm dev +``` + +## Building + +To build your app for deployment you can run + +```bash +pnpm build +``` diff --git a/packages/walletconnect-wallet/demo-dapp/index.html b/packages/walletconnect-wallet/demo-dapp/index.html new file mode 100644 index 000000000..bb7f75b16 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/index.html @@ -0,0 +1,59 @@ + + + + + + + Sui dApp Starter + + + + +
+ + + diff --git a/packages/walletconnect-wallet/demo-dapp/package.json b/packages/walletconnect-wallet/demo-dapp/package.json new file mode 100644 index 000000000..28d7f4e94 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/package.json @@ -0,0 +1,37 @@ +{ + "name": "walletconnect-demo-dapp", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "lint": "eslint . --ext .ts --ext .tsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" + }, + "dependencies": { + "@mysten/dapp-kit": "workspace:*", + "@mysten/sui": "workspace:*", + "@mysten/wallet-standard": "workspace:*", + "@mysten/walletconnect-wallet": "workspace:*", + "@radix-ui/colors": "^3.0.0", + "@radix-ui/react-icons": "^1.3.0", + "@radix-ui/themes": "^3.1.1", + "@tanstack/react-query": "^5.87.1", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^8.43.0", + "@typescript-eslint/parser": "^8.43.0", + "@vitejs/plugin-react-swc": "^3.11.0", + "eslint": "^8.45.0", + "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-react-refresh": "^0.4.20", + "prettier": "^3.6.2", + "typescript": "^5.9.2", + "vite": "^7.1.5" + } +} diff --git a/packages/walletconnect-wallet/demo-dapp/prettier.config.cjs b/packages/walletconnect-wallet/demo-dapp/prettier.config.cjs new file mode 100644 index 000000000..c07541106 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/prettier.config.cjs @@ -0,0 +1,4 @@ +// eslint-disable-next-line no-undef +module.exports = { + proseWrap: "always", +}; diff --git a/packages/walletconnect-wallet/demo-dapp/src/Actions.tsx b/packages/walletconnect-wallet/demo-dapp/src/Actions.tsx new file mode 100644 index 000000000..5408076ac --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/src/Actions.tsx @@ -0,0 +1,152 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { + useCurrentAccount, + useCurrentWallet, + useSignAndExecuteTransaction, + useSignPersonalMessage, + useSignTransaction, + useSuiClientContext, +} from "@mysten/dapp-kit"; +import { Transaction } from "@mysten/sui/transactions"; +import { + verifyPersonalMessageSignature, + verifyTransactionSignature, +} from "@mysten/sui/verify"; +import { Button, Container } from "@radix-ui/themes"; +import { fromBase64 } from "@mysten/sui/utils"; +import type { + SuiChain, + WalletAccount, + WalletWithRequiredFeatures, +} from "@mysten/wallet-standard"; +import { signAndExecuteTransaction as signAndExecuteTransactionWalletStandard } from "@mysten/wallet-standard"; +import { useMutation } from "@tanstack/react-query"; + +export function Actions() { + const account = useCurrentAccount(); + const signMessage = useSignPersonalMessage(); + const signTransaction = useSignTransaction(); + const signAndExecuteTransaction = useSignAndExecuteTransaction(); + const { network, client } = useSuiClientContext(); + const { currentWallet } = useCurrentWallet(); + const signAndExecuteTransactionForceInWallet = useMutation({ + mutationFn: ({ + transaction, + account, + chain, + wallet, + }: { + transaction: Transaction; + account: WalletAccount; + chain: SuiChain; + wallet: WalletWithRequiredFeatures; + }) => { + return signAndExecuteTransactionWalletStandard(wallet, { + transaction, + account, + chain, + }); + }, + }); + + if (!account) { + return null; + } + + return ( + + + + + + + ); +} diff --git a/packages/walletconnect-wallet/demo-dapp/src/App.tsx b/packages/walletconnect-wallet/demo-dapp/src/App.tsx new file mode 100644 index 000000000..a8d93e7f9 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/src/App.tsx @@ -0,0 +1,41 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { ConnectButton } from "@mysten/dapp-kit"; +import { Box, Container, Flex, Heading } from "@radix-ui/themes"; +import { WalletStatus } from "./WalletStatus.js"; + +function App() { + return ( + <> + + + dApp Starter Template + + + + + + + + + + + + + ); +} + +export default App; diff --git a/packages/walletconnect-wallet/demo-dapp/src/OwnedObjects.tsx b/packages/walletconnect-wallet/demo-dapp/src/OwnedObjects.tsx new file mode 100644 index 000000000..d263ccddf --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/src/OwnedObjects.tsx @@ -0,0 +1,44 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { useCurrentAccount, useSuiClientQuery } from "@mysten/dapp-kit"; +import { Flex, Heading, Text } from "@radix-ui/themes"; + +export function OwnedObjects() { + const account = useCurrentAccount(); + const { data, isPending, error } = useSuiClientQuery( + "getOwnedObjects", + { + owner: account?.address as string, + }, + { + enabled: !!account, + }, + ); + + if (!account) { + return; + } + + if (error) { + return Error: {error.message}; + } + + if (isPending || !data) { + return Loading...; + } + + return ( + + {data.data.length === 0 ? ( + No objects owned by the connected wallet + ) : ( + Objects owned by the connected wallet + )} + {data.data.map((object) => ( + + Object ID: {object.data?.objectId} + + ))} + + ); +} diff --git a/packages/walletconnect-wallet/demo-dapp/src/WalletStatus.tsx b/packages/walletconnect-wallet/demo-dapp/src/WalletStatus.tsx new file mode 100644 index 000000000..418e99844 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/src/WalletStatus.tsx @@ -0,0 +1,27 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { useCurrentAccount } from "@mysten/dapp-kit"; +import { Container, Flex, Heading, Text } from "@radix-ui/themes"; +import { OwnedObjects } from "./OwnedObjects.js"; +import { Actions } from "./Actions.js"; + +export function WalletStatus() { + const account = useCurrentAccount(); + + return ( + + Wallet Status + + {account ? ( + + Wallet connected + Address: {account.address} + + ) : ( + Wallet not connected + )} + + + + ); +} diff --git a/packages/walletconnect-wallet/demo-dapp/src/main.tsx b/packages/walletconnect-wallet/demo-dapp/src/main.tsx new file mode 100644 index 000000000..4fc8b74a9 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/src/main.tsx @@ -0,0 +1,42 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import React from "react"; +import ReactDOM from "react-dom/client"; +import "@mysten/dapp-kit/dist/index.css"; +import "@radix-ui/themes/styles.css"; + +import { SuiClientProvider, WalletProvider } from "@mysten/dapp-kit"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { Theme } from "@radix-ui/themes"; +import App from "./App.tsx"; +import { networkConfig } from "./networkConfig.ts"; +import { registerWalletConnectWallet } from "@mysten/walletconnect-wallet"; +import { SuiClient, getFullnodeUrl } from "@mysten/sui/client"; + +const queryClient = new QueryClient(); + +registerWalletConnectWallet({ + projectId: "your_project_id", + getClient: (chain) => + new SuiClient({ network: chain, url: getFullnodeUrl(chain) }), + metadata: { + walletName: "Wallet Connect", + icon: "https://walletconnect.org/walletconnect-logo.png", + enabled: true, + id: "walletconnect", + }, +}); + +ReactDOM.createRoot(document.getElementById("root")!).render( + + + + + + + + + + + , +); diff --git a/packages/walletconnect-wallet/demo-dapp/src/networkConfig.ts b/packages/walletconnect-wallet/demo-dapp/src/networkConfig.ts new file mode 100644 index 000000000..f81095781 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/src/networkConfig.ts @@ -0,0 +1,19 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { getFullnodeUrl } from "@mysten/sui/client"; +import { createNetworkConfig } from "@mysten/dapp-kit"; + +const { networkConfig, useNetworkVariable, useNetworkVariables } = + createNetworkConfig({ + devnet: { + url: getFullnodeUrl("devnet"), + }, + testnet: { + url: getFullnodeUrl("testnet"), + }, + mainnet: { + url: getFullnodeUrl("mainnet"), + }, + }); + +export { useNetworkVariable, useNetworkVariables, networkConfig }; diff --git a/packages/walletconnect-wallet/demo-dapp/src/vite-env.d.ts b/packages/walletconnect-wallet/demo-dapp/src/vite-env.d.ts new file mode 100644 index 000000000..40a8edabb --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/src/vite-env.d.ts @@ -0,0 +1,2 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 diff --git a/packages/walletconnect-wallet/demo-dapp/tsconfig.json b/packages/walletconnect-wallet/demo-dapp/tsconfig.json new file mode 100644 index 000000000..a7fc6fbf2 --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/packages/walletconnect-wallet/demo-dapp/tsconfig.node.json b/packages/walletconnect-wallet/demo-dapp/tsconfig.node.json new file mode 100644 index 000000000..a8583534f --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.mts"] +} diff --git a/packages/walletconnect-wallet/demo-dapp/vite.config.mts b/packages/walletconnect-wallet/demo-dapp/vite.config.mts new file mode 100644 index 000000000..d366e8c8d --- /dev/null +++ b/packages/walletconnect-wallet/demo-dapp/vite.config.mts @@ -0,0 +1,7 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react-swc"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], +}); diff --git a/packages/walletconnect-wallet/package.json b/packages/walletconnect-wallet/package.json new file mode 100644 index 000000000..f8807a7b9 --- /dev/null +++ b/packages/walletconnect-wallet/package.json @@ -0,0 +1,55 @@ +{ + "name": "@mysten/walletconnect-wallet", + "version": "0.0.0", + "description": "Wallet adapter for WalletConnect on Sui", + "license": "Apache-2.0", + "author": "Mysten Labs ", + "type": "commonjs", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/cjs/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + } + }, + "sideEffects": false, + "files": [ + "CHANGELOG.md", + "dist" + ], + "scripts": { + "clean": "rm -rf tsconfig.tsbuildinfo ./dist", + "build": "build-package", + "prepublishOnly": "pnpm turbo build", + "prettier:check": "prettier -c --ignore-unknown .", + "prettier:fix": "prettier -w --ignore-unknown .", + "eslint:check": "eslint --max-warnings=0 .", + "eslint:fix": "pnpm run eslint:check --fix", + "lint": "pnpm run eslint:check && pnpm run prettier:check", + "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mystenlabs/ts-sdks.git" + }, + "bugs": { + "url": "https://github.com/mystenlabs/ts-sdks/issues" + }, + "homepage": "https://github.com/MystenLabs/ts-sdks/tree/main/packages/walletconnect-wallet#readme", + "devDependencies": { + "@mysten/build-scripts": "workspace:*", + "@types/node": "^22.15.29", + "typescript": "^5.9.2", + "vitest": "^3.2.4" + }, + "dependencies": { + "@mysten/sui": "workspace:*", + "@mysten/utils": "workspace:*", + "@mysten/wallet-standard": "workspace:*", + "@reown/appkit-universal-connector": "1.8.5", + "mitt": "^3.0.1", + "valibot": "^0.36.0" + } +} diff --git a/packages/walletconnect-wallet/src/index.ts b/packages/walletconnect-wallet/src/index.ts new file mode 100644 index 000000000..dd485d95c --- /dev/null +++ b/packages/walletconnect-wallet/src/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +export { + registerWalletConnectWallet, + WalletConnectWallet, + WALLETCONNECT_WALLET_NAME, + type GetClient, +} from './wallet/index.js'; diff --git a/packages/walletconnect-wallet/src/wallet/index.ts b/packages/walletconnect-wallet/src/wallet/index.ts new file mode 100644 index 000000000..05a3a5a9a --- /dev/null +++ b/packages/walletconnect-wallet/src/wallet/index.ts @@ -0,0 +1,407 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { fromBase64, toBase64 } from '@mysten/sui/utils'; +import type { + IdentifierArray, + StandardConnectFeature, + StandardConnectMethod, + StandardDisconnectFeature, + StandardDisconnectMethod, + StandardEventsFeature, + StandardEventsListeners, + StandardEventsOnMethod, + SuiSignAndExecuteTransactionFeature, + SuiSignAndExecuteTransactionMethod, + SuiSignPersonalMessageFeature, + SuiSignPersonalMessageMethod, + SuiSignTransactionFeature, + SuiSignTransactionMethod, + Wallet, + WalletIcon, +} from '@mysten/wallet-standard'; +import { + getWallets, + ReadonlyWalletAccount, + StandardConnect, + StandardDisconnect, + StandardEvents, + SUI_CHAINS, + SuiSignAndExecuteTransaction, + SuiSignPersonalMessage, + SuiSignTransaction, +} from '@mysten/wallet-standard'; +import type { Emitter } from 'mitt'; +import mitt from 'mitt'; +import type { InferOutput } from 'valibot'; +import { boolean, object, string } from 'valibot'; +import type { CustomCaipNetwork } from '@reown/appkit-universal-connector'; +import { UniversalConnector } from '@reown/appkit-universal-connector'; +import type { Experimental_BaseClient } from '@mysten/sui/experimental'; +import { Transaction } from '@mysten/sui/transactions'; + +// -- Types -- +type WalletEventsMap = { + [E in keyof StandardEventsListeners]: Parameters[0]; +}; + +type SupportedNetwork = 'mainnet' | 'testnet' | 'devnet' | 'localnet'; + +export type GetClient = (network: SupportedNetwork) => Experimental_BaseClient; +type WalletMetadata = InferOutput; + +// -- Constants -- +const icon = + 'data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjQwMCIgdmlld0JveD0iMCAwIDQwMCA0MDAiIHdpZHRoPSI0MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxjbGlwUGF0aCBpZD0iYSI+PHBhdGggZD0ibTAgMGg0MDB2NDAwaC00MDB6Ii8+PC9jbGlwUGF0aD48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxjaXJjbGUgY3g9IjIwMCIgY3k9IjIwMCIgZmlsbD0iIzE0MTQxNCIgcj0iMTk5LjUiIHN0cm9rZT0iIzNiNDA0MCIvPjxwYXRoIGQ9Im0xMjIuNTE5IDE0OC45NjVjNDIuNzkxLTQxLjcyOSAxMTIuMTcxLTQxLjcyOSAxNTQuOTYyIDBsNS4xNSA1LjAyMmMyLjE0IDIuMDg2IDIuMTQgNS40NjkgMCA3LjU1NWwtMTcuNjE3IDE3LjE4Yy0xLjA3IDEuMDQzLTIuODA0IDEuMDQzLTMuODc0IDBsLTcuMDg3LTYuOTExYy0yOS44NTMtMjkuMTExLTc4LjI1My0yOS4xMTEtMTA4LjEwNiAwbC03LjU5IDcuNDAxYy0xLjA3IDEuMDQzLTIuODA0IDEuMDQzLTMuODc0IDBsLTE3LjYxNy0xNy4xOGMtMi4xNC0yLjA4Ni0yLjE0LTUuNDY5IDAtNy41NTV6bTE5MS4zOTcgMzUuNTI5IDE1LjY3OSAxNS4yOWMyLjE0IDIuMDg2IDIuMTQgNS40NjkgMCA3LjU1NWwtNzAuNyA2OC45NDRjLTIuMTM5IDIuMDg3LTUuNjA4IDIuMDg3LTcuNzQ4IDBsLTUwLjE3OC00OC45MzFjLS41MzUtLjUyMi0xLjQwMi0uNTIyLTEuOTM3IDBsLTUwLjE3OCA0OC45MzFjLTIuMTM5IDIuMDg3LTUuNjA4IDIuMDg3LTcuNzQ4IDBsLTcwLjcwMTUtNjguOTQ1Yy0yLjEzOTYtMi4wODYtMi4xMzk2LTUuNDY5IDAtNy41NTVsMTUuNjc5NS0xNS4yOWMyLjEzOTYtMi4wODcgNS42MDg1LTIuMDg3IDcuNzQ4MSAwbDUwLjE3ODkgNDguOTMyYy41MzUuNTIyIDEuNDAyLjUyMiAxLjkzNyAwbDUwLjE3Ny00OC45MzJjMi4xMzktMi4wODcgNS42MDgtMi4wODcgNy43NDggMGw1MC4xNzkgNDguOTMyYy41MzUuNTIyIDEuNDAyLjUyMiAxLjkzNyAwbDUwLjE3OS00OC45MzFjMi4xMzktMi4wODcgNS42MDgtMi4wODcgNy43NDggMHoiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+'; +export const WALLETCONNECT_WALLET_NAME = 'WalletConnect' as const; +const walletAccountFeatures = [ + 'sui:signTransaction', + 'sui:signAndExecuteTransaction', + 'sui:signPersonalMessage', +] as const; + +const SUICaipNetworks: CustomCaipNetwork<'sui'>[] = SUI_CHAINS.map((chain) => { + const [_, chainId] = chain.split(':'); + return { + id: chainId, + chainNamespace: 'sui', + caipNetworkId: chain, + name: `Sui ${chainId}`, + nativeCurrency: { name: 'SUI', symbol: 'SUI', decimals: 9 }, + rpcUrls: { default: { http: [`https://sui-${chainId}.gateway.tatum.io`] } }, + }; +}); + +const WalletMetadataSchema = object({ + id: string('Wallet ID is required'), + walletName: string('Wallet name is required'), + icon: string('Icon must be a valid wallet icon format'), + enabled: boolean('Enabled is required'), +}); + +const toStandardAccounts = ( + accounts: { address: string; pubkey: string }[], + chains: IdentifierArray, +) => { + return accounts.map((account) => { + return new ReadonlyWalletAccount({ + address: account.address, + chains, + features: walletAccountFeatures, + publicKey: fromBase64(account.pubkey), + }); + }); +}; + +// -- Wallet -- +export class WalletConnectWallet implements Wallet { + #id: string; + #events: Emitter; + #accounts: ReadonlyWalletAccount[]; + #walletName: string; + #icon: WalletIcon; + #connector?: UniversalConnector; + #projectId: string; + #getClient: GetClient; + + get name() { + return this.#walletName; + } + + get id() { + return this.#id; + } + + get icon() { + return this.#icon; + } + + get version() { + return '1.0.0' as const; + } + + get chains() { + return SUI_CHAINS; + } + + get accounts() { + return this.#accounts; + } + + get features(): StandardConnectFeature & + StandardDisconnectFeature & + StandardEventsFeature & + SuiSignTransactionFeature & + SuiSignPersonalMessageFeature & + SuiSignAndExecuteTransactionFeature { + return { + [StandardConnect]: { + version: '1.0.0', + connect: this.#connect, + }, + [StandardDisconnect]: { + version: '1.0.0', + disconnect: this.#disconnect, + }, + [StandardEvents]: { + version: '1.0.0', + on: this.#on, + }, + [SuiSignTransaction]: { + version: '2.0.0', + signTransaction: this.#signTransaction, + }, + [SuiSignPersonalMessage]: { + version: '1.1.0', + signPersonalMessage: this.#signPersonalMessage, + }, + [SuiSignAndExecuteTransaction]: { + version: '2.0.0', + signAndExecuteTransaction: this.#signAndExecuteTransaction, + }, + }; + } + + constructor({ + metadata, + projectId, + getClient, + }: { + metadata: WalletMetadata; + projectId: string; + getClient: GetClient; + }) { + this.#id = metadata.id; + this.#accounts = []; + this.#events = mitt(); + this.#walletName = metadata.walletName; + this.#icon = icon; + this.#projectId = projectId; + this.#getClient = getClient; + this.init(); + } + + async init() { + this.#connector = await UniversalConnector.init({ + projectId: this.#projectId, + + // TODO: Use dapp metadata + metadata: { + name: this.#walletName, + description: 'WalletConnect', + icon: this.#icon, + }, + networks: [ + { + namespace: 'sui', + methods: [ + 'sui_signTransaction', + 'sui_signPersonalMessage', + 'sui_signAndExecuteTransaction', + 'sui_getAccounts', + ], + events: ['chainChanged', 'accountsChanged'], + chains: SUICaipNetworks, + }, + ], + modalConfig: { + themeVariables: { + '--w3m-z-index': 2147483647, + }, + }, + }); + this.#accounts = await this.#getPreviouslyAuthorizedAccounts(); + } + + #signTransaction: SuiSignTransactionMethod = async ({ transaction, account, chain }) => { + const tx = await transaction.toJSON(); + + const response = (await this.#connector?.request( + { + method: 'sui_signTransaction', + params: { + transaction: tx, + address: account.address, + }, + }, + chain, + )) as { transactionBytes: string; signature: string }; + + return { + bytes: response.transactionBytes, + signature: response.signature, + }; + }; + + #signAndExecuteTransaction: SuiSignAndExecuteTransactionMethod = async ({ + transaction, + account, + chain, + }) => { + const [, network] = chain.split(':'); + const client = this.#getClient(network as SupportedNetwork); + const data = await transaction.toJSON(); + const parsedTransaction = Transaction.from(data); + const bytes = await parsedTransaction.build({ client }); + const response = (await this.#connector?.request( + { + method: 'sui_signAndExecuteTransaction', + params: { + transaction: data, + address: account.address, + }, + }, + chain, + )) as { digest: string }; + + const tx = await client.core.waitForTransaction({ + digest: response.digest, + }); + + return { + digest: response.digest, + signature: tx.transaction.signatures[0] ?? '', + bytes: toBase64(bytes), + effects: tx.transaction.effects.bcs ? toBase64(tx.transaction.effects.bcs) : '', + }; + }; + + #signPersonalMessage: SuiSignPersonalMessageMethod = async ({ message, account, chain }) => { + const messageString = new TextDecoder().decode(message); + const response = (await this.#connector?.request( + { + method: 'sui_signPersonalMessage', + params: { + message: messageString, + address: account.address, + }, + }, + chain ?? 'sui:mainnet', + )) as { signature: string }; + + return { + signature: response.signature, + bytes: toBase64(message), + }; + }; + + #on: StandardEventsOnMethod = (event, listener) => { + this.#events.on(event, listener); + return () => this.#events.off(event, listener); + }; + + #setAccounts(accounts: ReadonlyWalletAccount[]) { + this.#accounts = accounts; + this.#events.emit('change', { accounts: this.accounts }); + } + + #getAccounts = async () => { + let accounts: { address: string; pubkey: string }[] | undefined = JSON.parse( + this.#connector?.provider?.session?.sessionProperties?.['sui_getAccounts'] ?? '[]', + ); + + if (!accounts?.length) { + accounts = (await this.#connector?.request({ method: 'sui_getAccounts' }, 'sui:mainnet')) as { + address: string; + pubkey: string; + }[]; + } + + return toStandardAccounts(accounts, this.chains); + }; + + #connect: StandardConnectMethod = async (input) => { + if (input?.silent) { + const accounts = await this.#getPreviouslyAuthorizedAccounts(); + if (accounts.length > 0) { + this.#setAccounts(accounts); + return { accounts }; + } + } + + if (!this.#connector?.provider?.session?.namespaces?.sui) { + await this.#connector?.connect(); + } + + const accounts = await this.#getAccounts(); + this.#setAccounts(accounts); + + return { accounts: this.accounts }; + }; + + #getPreviouslyAuthorizedAccounts = async () => { + const session = this.#connector?.provider?.session; + if (!session?.namespaces?.sui) { + return []; + } + + const accounts = JSON.parse(session.sessionProperties?.['sui_getAccounts'] ?? '[]') as { + address: string; + pubkey: string; + }[]; + + return toStandardAccounts(accounts, SUI_CHAINS); + }; + + #disconnect: StandardDisconnectMethod = async () => { + this.#connector?.disconnect(); + this.#setAccounts([]); + }; + + updateMetadata(metadata: WalletMetadata) { + this.#id = metadata.id; + this.#walletName = metadata.walletName; + } +} +type RegisterWalletConnectWallet = { + projectId: string; + getClient: GetClient; + metadata?: WalletMetadata; +}; + +export function registerWalletConnectWallet({ + projectId, + getClient, + metadata, +}: RegisterWalletConnectWallet) { + const wallets = getWallets(); + + let unregister: (() => void) | null = null; + + // listen for wallet registration + wallets.on('register', (wallet: Wallet) => { + if (wallet.id === 'walletconnect') { + unregister?.(); + } + }); + + const extension = wallets.get().find((wallet: Wallet) => wallet.id === 'walletconnect'); + if (extension) { + return; + } + + const fullMetadata = { + id: 'walletconnect', + walletName: 'Wallet Connect', + icon, + enabled: true, + ...(metadata ?? {}), + }; + + const walletConnectWalletInstance = new WalletConnectWallet({ + metadata: fullMetadata, + projectId, + getClient, + }); + unregister = wallets.register(walletConnectWalletInstance); + + walletConnectWalletInstance.updateMetadata({ + ...fullMetadata, + enabled: true, + }); + + return { + wallet: walletConnectWalletInstance, + unregister, + }; +} diff --git a/packages/walletconnect-wallet/tsconfig.esm.json b/packages/walletconnect-wallet/tsconfig.esm.json new file mode 100644 index 000000000..5048bdf8f --- /dev/null +++ b/packages/walletconnect-wallet/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ESNext", + "outDir": "dist/esm" + } +} diff --git a/packages/walletconnect-wallet/tsconfig.json b/packages/walletconnect-wallet/tsconfig.json new file mode 100644 index 000000000..4453986bf --- /dev/null +++ b/packages/walletconnect-wallet/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../build-scripts/tsconfig.shared.json", + "include": ["src"], + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist/cjs", + "isolatedModules": true, + "rootDir": "src" + } +} diff --git a/packages/walletconnect-wallet/typedoc.json b/packages/walletconnect-wallet/typedoc.json new file mode 100644 index 000000000..ccb323f01 --- /dev/null +++ b/packages/walletconnect-wallet/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["src"], + "excludeInternal": true, + "excludePrivate": true, + "intentionallyNotExported": [] +} diff --git a/packages/walletconnect-wallet/vitest.config.mts b/packages/walletconnect-wallet/vitest.config.mts new file mode 100644 index 000000000..bdc36a5e4 --- /dev/null +++ b/packages/walletconnect-wallet/vitest.config.mts @@ -0,0 +1,6 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { defineConfig } from 'vitest/config'; + +export default defineConfig({}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8f9dee10d..cef0b9f56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: devDependencies: '@changesets/cli': specifier: ^2.29.6 - version: 2.29.6(@types/node@24.3.1) + version: 2.29.6(@types/node@22.16.5) '@ianvs/prettier-plugin-sort-imports': specifier: ^4.7.0 version: 4.7.0(@vue/compiler-sfc@3.5.21)(prettier@3.6.2) @@ -76,7 +76,7 @@ importers: version: 3.2.0(@typescript-eslint/eslint-plugin@8.43.0(@typescript-eslint/parser@8.43.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1) graphql-config: specifier: ^5.1.5 - version: 5.1.5(@types/node@24.3.1)(graphql@16.11.0)(typescript@5.9.2) + version: 5.1.5(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2) prettier: specifier: ^3.6.2 version: 3.6.2 @@ -119,7 +119,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/build-scripts: dependencies: @@ -255,7 +255,7 @@ importers: version: 8.43.0(eslint@9.17.0(jiti@2.5.1))(typescript@5.9.2) '@vitejs/plugin-react-swc': specifier: ^3.11.0 - version: 3.11.0(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) eslint: specifier: ^9.17.0 version: 9.17.0(jiti@2.5.1) @@ -273,7 +273,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/create-dapp/templates/react-e2e-counter: dependencies: @@ -319,7 +319,7 @@ importers: version: 8.43.0(eslint@9.17.0(jiti@2.5.1))(typescript@5.9.2) '@vitejs/plugin-react-swc': specifier: ^3.11.0 - version: 3.11.0(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) eslint: specifier: ^9.17.0 version: 9.17.0(jiti@2.5.1) @@ -337,7 +337,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit: dependencies: @@ -407,7 +407,7 @@ importers: version: 2.3.18(babel-plugin-macros@3.1.0)(esbuild@0.25.9) '@vanilla-extract/vite-plugin': specifier: ^5.1.1 - version: 5.1.1(@types/node@24.3.1)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1) + version: 5.1.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1) happy-dom: specifier: ^18.0.1 version: 18.0.1 @@ -428,10 +428,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/examples/next-js/simple: dependencies: @@ -493,7 +493,7 @@ importers: version: 18.3.5(@types/react@18.3.18) '@vitejs/plugin-react': specifier: ^5.0.2 - version: 5.0.2(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 5.0.2(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) globals: specifier: ^16.3.0 version: 16.3.0 @@ -502,7 +502,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/examples/vanilla/simple: dependencies: @@ -518,7 +518,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/examples/vue/simple: dependencies: @@ -610,7 +610,7 @@ importers: version: 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2)) '@storybook/web-components-vite': specifier: ^8.6.12 - version: 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) storybook: specifier: ^8.6.12 version: 8.6.12(prettier@3.6.2) @@ -622,7 +622,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/packages/dapp-kit-react: dependencies: @@ -1010,7 +1010,7 @@ importers: version: 8.43.0(eslint@8.57.1)(typescript@5.9.2) '@vitejs/plugin-react-swc': specifier: ^3.11.0 - version: 3.11.0(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) eslint: specifier: ^8.45.0 version: 8.57.1 @@ -1028,7 +1028,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/graphql-transport: dependencies: @@ -1050,7 +1050,7 @@ importers: version: 5.0.3(graphql@16.11.0) '@graphql-codegen/cli': specifier: ^5.0.7 - version: 5.0.7(@parcel/watcher@2.5.1)(@types/node@22.15.29)(enquirer@2.4.1)(graphql@16.11.0)(typescript@5.9.2) + version: 5.0.7(@parcel/watcher@2.5.1)(@types/node@22.15.29)(crossws@0.3.5)(enquirer@2.4.1)(graphql@16.11.0)(typescript@5.9.2) '@graphql-codegen/typed-document-node': specifier: ^5.1.2 version: 5.1.2(graphql@16.11.0) @@ -1074,7 +1074,7 @@ importers: version: 22.15.29 graphql-config: specifier: ^5.1.5 - version: 5.1.5(@types/node@22.15.29)(graphql@16.11.0)(typescript@5.9.2) + version: 5.1.5(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2) typescript: specifier: ^5.9.2 version: 5.9.2 @@ -1111,10 +1111,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: specifier: ^8.0.4 version: 8.0.4 @@ -1163,7 +1163,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wasm-pack: specifier: ^0.13.1 version: 0.13.1 @@ -1327,7 +1327,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/suins: dependencies: @@ -1335,11 +1335,11 @@ importers: specifier: workspace:* version: link:../typescript axios: - specifier: ^1.10.0 - version: 1.11.0 + specifier: ^1.12.2 + version: 1.12.2 axios-retry: specifier: ^4.5.0 - version: 4.5.0(axios@1.11.0) + version: 4.5.0(axios@1.12.2) devDependencies: '@mysten/build-scripts': specifier: workspace:* @@ -1355,10 +1355,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/suins-v2: dependencies: @@ -1383,10 +1383,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/typescript: dependencies: @@ -1435,7 +1435,7 @@ importers: version: 5.0.3(graphql@16.11.0) '@graphql-codegen/cli': specifier: ^5.0.7 - version: 5.0.7(@parcel/watcher@2.5.1)(@types/node@22.15.29)(enquirer@2.4.1)(graphql@16.11.0)(typescript@5.9.2) + version: 5.0.7(@parcel/watcher@2.5.1)(@types/node@22.15.29)(crossws@0.3.5)(enquirer@2.4.1)(graphql@16.11.0)(typescript@5.9.2) '@graphql-codegen/typed-document-node': specifier: ^5.1.2 version: 5.1.2(graphql@16.11.0) @@ -1471,7 +1471,7 @@ importers: version: 7.0.3 graphql-config: specifier: ^5.1.5 - version: 5.1.5(@types/node@22.15.29)(graphql@16.11.0)(typescript@5.9.2) + version: 5.1.5(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2) msw: specifier: ^2.11.1 version: 2.11.1(@types/node@22.15.29)(typescript@5.9.2) @@ -1514,7 +1514,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/wallet-standard: dependencies: @@ -1535,6 +1535,107 @@ importers: specifier: ^0.65.1 version: 0.65.1(@swc/core@1.13.1) + packages/walletconnect-wallet: + dependencies: + '@mysten/sui': + specifier: workspace:* + version: link:../typescript + '@mysten/utils': + specifier: workspace:* + version: link:../utils + '@mysten/wallet-standard': + specifier: workspace:* + version: link:../wallet-standard + '@reown/appkit-universal-connector': + specifier: 1.8.5 + version: 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + mitt: + specifier: ^3.0.1 + version: 3.0.1 + valibot: + specifier: ^0.36.0 + version: 0.36.0 + devDependencies: + '@mysten/build-scripts': + specifier: workspace:* + version: link:../build-scripts + '@types/node': + specifier: ^22.15.29 + version: 22.16.5 + typescript: + specifier: ^5.9.2 + version: 5.9.2 + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + + packages/walletconnect-wallet/demo-dapp: + dependencies: + '@mysten/dapp-kit': + specifier: workspace:* + version: link:../../dapp-kit + '@mysten/sui': + specifier: workspace:* + version: link:../../typescript + '@mysten/wallet-standard': + specifier: workspace:* + version: link:../../wallet-standard + '@mysten/walletconnect-wallet': + specifier: workspace:* + version: link:.. + '@radix-ui/colors': + specifier: ^3.0.0 + version: 3.0.0 + '@radix-ui/react-icons': + specifier: ^1.3.0 + version: 1.3.2(react@18.3.1) + '@radix-ui/themes': + specifier: ^3.1.1 + version: 3.2.1(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@tanstack/react-query': + specifier: ^5.87.1 + version: 5.87.1(react@18.3.1) + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + devDependencies: + '@types/react': + specifier: ^18.3.3 + version: 18.3.18 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.5(@types/react@18.3.18) + '@typescript-eslint/eslint-plugin': + specifier: ^8.43.0 + version: 8.43.0(@typescript-eslint/parser@8.43.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1)(typescript@5.9.2) + '@typescript-eslint/parser': + specifier: ^8.43.0 + version: 8.43.0(eslint@8.57.1)(typescript@5.9.2) + '@vitejs/plugin-react-swc': + specifier: ^3.11.0 + version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + eslint: + specifier: ^8.45.0 + version: 8.57.1 + eslint-plugin-react-hooks: + specifier: ^5.2.0 + version: 5.2.0(eslint@8.57.1) + eslint-plugin-react-refresh: + specifier: ^0.4.20 + version: 0.4.20(eslint@8.57.1) + prettier: + specifier: ^3.6.2 + version: 3.6.2 + typescript: + specifier: ^5.9.2 + version: 5.9.2 + vite: + specifier: ^7.1.5 + version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + packages/walrus: dependencies: '@mysten/bcs': @@ -1627,7 +1728,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/zksend: dependencies: @@ -1685,6 +1786,9 @@ packages: '@adobe/css-tools@4.4.4': resolution: {integrity: sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==} + '@adraffy/ens-normalize@1.11.0': + resolution: {integrity: sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==} + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -3553,6 +3657,10 @@ packages: '@microsoft/tsdoc@0.14.2': resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} + '@msgpack/msgpack@3.1.2': + resolution: {integrity: sha512-JEW4DEtBzfe8HvUYecLU9e6+XJnKDlUAIve8FvPzF3Kzs6Xo/KuZkZJsDH0wJXl/qEZbeeE7edxDNY3kMs39hQ==} + engines: {node: '>= 18'} + '@mswjs/interceptors@0.39.6': resolution: {integrity: sha512-bndDP83naYYkfayr/qhBHMhk0YGwS1iv6vaEGcr0SQbO0IZtbOPqjKjds/WcG+bJA+1T5vCx6kprKOzn5Bg+Vw==} engines: {node: '>=18'} @@ -3573,6 +3681,9 @@ packages: '@napi-rs/wasm-runtime@1.0.3': resolution: {integrity: sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==} + '@napi-rs/wasm-runtime@1.0.5': + resolution: {integrity: sha512-TBr9Cf9onSAS2LQ2+QHx6XcC6h9+RIzJgbqG3++9TUZSH204AwEy5jg3BTQ0VATsyoGj4ee49tN/y6rvaOOtcg==} + '@next/env@15.5.2': resolution: {integrity: sha512-Qe06ew4zt12LeO6N7j8/nULSOe3fMXE4dM6xgpBQNvdzyK1sv5y4oAP3bq4LamrvGCZtmRYnW8URFCeX5nFgGg==} @@ -3627,10 +3738,30 @@ packages: '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} + '@noble/ciphers@1.3.0': + resolution: {integrity: sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==} + engines: {node: ^14.21.3 || >=16} + + '@noble/curves@1.8.0': + resolution: {integrity: sha512-j84kjAbzEnQHaSIhRPUmB3/eVXu2k3dKPl2LOrR8fSOIL+89U+7lV117EWHtq/GHM3ReGHM46iRBdZfpc4HRUQ==} + engines: {node: ^14.21.3 || >=16} + + '@noble/curves@1.9.1': + resolution: {integrity: sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==} + engines: {node: ^14.21.3 || >=16} + + '@noble/curves@1.9.2': + resolution: {integrity: sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==} + engines: {node: ^14.21.3 || >=16} + '@noble/curves@1.9.4': resolution: {integrity: sha512-2bKONnuM53lINoDrSmK8qP8W271ms7pygDhZt4SiLOoLwBtoHqeCFi6RG42V8zd3mLHuJFhU/Bmaqo4nX0/kBw==} engines: {node: ^14.21.3 || >=16} + '@noble/hashes@1.7.0': + resolution: {integrity: sha512-HXydb0DgzTpDPwbVeDGCG1gIu7X6+AuU6Zl6av/E/KG8LMsvPntvq+w17CHRpKBmN6Ybdrt1eP3k4cj8DJa78w==} + engines: {node: ^14.21.3 || >=16} + '@noble/hashes@1.8.0': resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} engines: {node: ^14.21.3 || >=16} @@ -3664,12 +3795,8 @@ packages: resolution: {integrity: sha512-O0hdKt4K31i8fpq8Bw5RfdPVAqm0EdduBUcluPo2MRcfCOwUEf5JlnvRhf/J0ezOYOD8jQ/LumYZxOVi/XK/BA==} engines: {node: '>= 20.0.0'} - '@oxc-project/runtime@0.87.0': - resolution: {integrity: sha512-ky2Hqi2q/uGX36UfY79zxMbUqiNIl1RyKKVJfFenG70lbn+/fcaKBVTbhmUwn8a2wPyv2gNtDQxuDytbKX9giQ==} - engines: {node: '>=6.9.0'} - - '@oxc-project/types@0.87.0': - resolution: {integrity: sha512-ipZFWVGE9fADBVXXWJWY/cxpysc41Gt5upKDeb32F6WMgFyO7XETUMVq8UuREKCih+Km5E6p2VhEvf6Fuhey6g==} + '@oxc-project/types@0.89.0': + resolution: {integrity: sha512-yuo+ECPIW5Q9mSeNmCDC2im33bfKuwW18mwkaHMQh8KakHYDzj4ci/q7wxf2qS3dMlVVCIyrs3kFtH5LmnlYnw==} '@oxc-transform/binding-android-arm64@0.82.3': resolution: {integrity: sha512-25Wh8wRSVMNiGJHeT1kIOKynrXbMoSR5vkhL+j7GyXs+R7tA3Vah574NK86y7k8Ayz7bmddSepue+Mp4/B2bqg==} @@ -3842,6 +3969,9 @@ packages: resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==} engines: {node: '>= 10.0.0'} + '@phosphor-icons/webcomponents@2.1.5': + resolution: {integrity: sha512-JcvQkZxvcX2jK+QCclm8+e8HXqtdFW9xV4/kk2aL9Y3dJA2oQVt+pzbv1orkumz3rfx4K9mn9fDoMr1He1yr7Q==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -4961,88 +5091,118 @@ packages: '@types/react-dom': optional: true + '@reown/appkit-common@1.8.5': + resolution: {integrity: sha512-oXe7r69evfOQgK58zK/F3Kc6qrgKaV0T70jNF2qEiG/6t0Su3JJD99ny2R07ljoKgUw81o5VhEJuurUtQBFuAw==} + + '@reown/appkit-controllers@1.8.5': + resolution: {integrity: sha512-t0Kl9c2xav0uo3MaQhOs+sb+3fAFyXWM8tvHiWhL4vz8z6xzCsoSVaoZZSK/T5v09oH0NbMlA/4D7RCCHCRdNg==} + + '@reown/appkit-pay@1.8.5': + resolution: {integrity: sha512-ORx96mqbQgfdwohokTNuSscgQtro4DXw14EhNqbnzYob/WgSK/GlHCH/UFYClopS7lvopJ9VopUYNrutXhlmhg==} + + '@reown/appkit-polyfills@1.8.5': + resolution: {integrity: sha512-ENkePQD82PjafoA4L4P4zpflRD8dmaE+8cPSW6YAw76BMaN1yxfbkz4bR2ko6ReK6vDt3kqUqEz+wkocALfyZA==} + + '@reown/appkit-scaffold-ui@1.8.5': + resolution: {integrity: sha512-eDdRZ5iOoAG08g01e2/7L9iwNme4N6U4buHN40sD/JsaJHfc4eWVfItfGv41/5USR2YZsPN+oWTJP+hmsllPzw==} + + '@reown/appkit-ui@1.8.5': + resolution: {integrity: sha512-ynlnW/xsD2o5kEiTvO66EiiciCDwwjg0OGM9hxhFItKtxoTnb7r6numsqJDqEstlD6J2R7pTtep77cmgLpsuOg==} + + '@reown/appkit-universal-connector@1.8.5': + resolution: {integrity: sha512-LtT/XqkpHHFULHigSP8NFN/y/eecmrHVtRUtAVvWoxYAf/DEm3B4iTibw5xnGy5CVdKfrITRhsxFJ59y8UF/VQ==} + + '@reown/appkit-utils@1.8.5': + resolution: {integrity: sha512-kpj18Sdp+LwB/o+EWn5brD66Uzn3bstg6PkIXZZnev/k2RmdEckZHsJcsdxdHmBLkZw/vzSJKmyzNwlUlmXQxw==} + + '@reown/appkit-wallet@1.8.5': + resolution: {integrity: sha512-mwHLqbeajlDRc6YkAhO3vay8i4o/mSvdRn0ABHtAKgrN/mh9FMe+4t1IUww758fl7y61VIDi9+WjgnIJfYLvPQ==} + + '@reown/appkit@1.8.5': + resolution: {integrity: sha512-7G4o3kNnKRRt18Kuqnm4VWqtkvjWGJdYTjYyBPrPnYjM3oOxdsGHCGQfp6ipbxLC18q17ge/rswfy59jDsdEPQ==} + '@repeaterjs/repeater@3.0.6': resolution: {integrity: sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==} - '@rolldown/binding-android-arm64@1.0.0-beta.36': - resolution: {integrity: sha512-0y4+MDSw9GzX4VZtATiygDv+OtijxsRtNBZW6qA3OUGi0fq6Gq+MnvFHMjdJxz3mv/thIHMmJ0AL7d8urYBCUw==} + '@rolldown/binding-android-arm64@1.0.0-beta.38': + resolution: {integrity: sha512-AE3HFQrjWCKLFZD1Vpiy+qsqTRwwoil1oM5WsKPSmfQ5fif/A+ZtOZetF32erZdsR7qyvns6qHEteEsF6g6rsQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.0.0-beta.36': - resolution: {integrity: sha512-F/xv0vsxXuwpyecy3GMpXPhRLI4WogQkSYYl6hh61OfmyX4lxsemSoYQ5nlK/MopdVaT111wS1dRO2eXgzBHuA==} + '@rolldown/binding-darwin-arm64@1.0.0-beta.38': + resolution: {integrity: sha512-RaoWOKc0rrFsVmKOjQpebMY6c6/I7GR1FBc25v7L/R7NlM0166mUotwGEv7vxu7ruXH4SJcFeVrfADFUUXUmmQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-beta.36': - resolution: {integrity: sha512-FX3x/GSybYRt4/fUljqIMuB7JRJThxnwzjK9Ka4qKwSw92RNmxRtw+NEkpuKq/Tzcq5qpnvSWudKmjcbBSMH1g==} + '@rolldown/binding-darwin-x64@1.0.0-beta.38': + resolution: {integrity: sha512-Ymojqc2U35iUc8NFU2XX1WQPfBRRHN6xHcrxAf9WS8BFFBn8pDrH5QPvH1tYs3lDkw6UGGbanr1RGzARqdUp1g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-beta.36': - resolution: {integrity: sha512-j7Y/OG4XxICRgGMLB7VVbROAzdnvtr0ZTBBYnv53KZESE97Ta4zXfGhEe+EiXLRKW8JWSMeNumOaBrWAXDMiZQ==} + '@rolldown/binding-freebsd-x64@1.0.0-beta.38': + resolution: {integrity: sha512-0ermTQ//WzSI0nOL3z/LUWMNiE9xeM5cLGxjewPFEexqxV/0uM8/lNp9QageQ8jfc/VO1OURsGw34HYO5PaL8w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.36': - resolution: {integrity: sha512-j3rDknokIJZ+iVGjWw2cVRgKLmk9boUoHtp2k3Ba6p7vWIv+D/YypQKHxAayyzvUkxTBZsw64Ojq5/zrytRODA==} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.38': + resolution: {integrity: sha512-GADxzVUTCTp6EWI52831A29Tt7PukFe94nhg/SUsfkI33oTiNQtPxyLIT/3oRegizGuPSZSlrdBurkjDwxyEUQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.36': - resolution: {integrity: sha512-7Ds2nl3ZhC0eaSJnw7dQ5uCK1cmaBKC+EL7IIpjTpzqY10y1xCn5w6gTFKzpqKhD2nSraY4MHOyAnE+zmSAZRA==} + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.38': + resolution: {integrity: sha512-SKO7Exl5Yem/OSNoA5uLHzyrptUQ8Hg70kHDxuwEaH0+GUg+SQe9/7PWmc4hFKBMrJGdQtii8WZ0uIz9Dofg5Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.36': - resolution: {integrity: sha512-0Qa4b3gv956iSdJQplV1xdI9ALbEdNo5xsFpcLU4mW2A+CqWNenVHqcHbCvwvKTP07yX6yoUvUqZR1CBxxQShg==} + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.38': + resolution: {integrity: sha512-SOo6+WqhXPBaShLxLT0eCgH17d3Yu1lMAe4mFP0M9Bvr/kfMSOPQXuLxBcbBU9IFM9w3N6qP9xWOHO+oUJvi8Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.36': - resolution: {integrity: sha512-wUdZljtx9W1V9KlnmwPgF0o2ZPFq2zffr/q+wM+GUrSFIJNmP9w0zgyl1coCt1ESnNyYYyJh8T1bqvx8+16SqA==} + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.38': + resolution: {integrity: sha512-yvsQ3CyrodOX+lcoi+lejZGCOvJZa9xTsNB8OzpMDmHeZq3QzJfpYjXSAS6vie70fOkLVJb77UqYO193Cl8XBQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@rolldown/binding-linux-x64-musl@1.0.0-beta.36': - resolution: {integrity: sha512-Up56sJMDSKYi92/28lq9xB2wonuCwVnqBzjRnKmQauZJ5QOor9h1RtcMeCzSxg4ReMsNvrdYomBogewcZgKEww==} + '@rolldown/binding-linux-x64-musl@1.0.0-beta.38': + resolution: {integrity: sha512-84qzKMwUwikfYeOuJ4Kxm/3z15rt0nFGGQArHYIQQNSTiQdxGHxOkqXtzPFqrVfBJUdxBAf+jYzR1pttFJuWyg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@rolldown/binding-openharmony-arm64@1.0.0-beta.36': - resolution: {integrity: sha512-qX3covX7EX00yrgQl3oi8GuRTS1XFe+YHm+sGsxQvPok+r7Ct2eDFpLmmw7wajZ2SuvAJYSo/9BXLSCGR0ve2w==} + '@rolldown/binding-openharmony-arm64@1.0.0-beta.38': + resolution: {integrity: sha512-QrNiWlce01DYH0rL8K3yUBu+lNzY+B0DyCbIc2Atan6/S6flxOL0ow5DLQvMamOI/oKhrJ4xG+9MkMb9dDHbLQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.0.0-beta.36': - resolution: {integrity: sha512-phFsiR97/nbQEtyo5GTPX4h/Ootz0Pdd7P7+gTmkiashePwPUik5aoMAluvzY1tTUAfhdrFR2Y8WiWbnxnsSrQ==} + '@rolldown/binding-wasm32-wasi@1.0.0-beta.38': + resolution: {integrity: sha512-fnLtHyjwEsG4/aNV3Uv3Qd1ZbdH+CopwJNoV0RgBqrcQB8V6/Qdikd5JKvnO23kb3QvIpP+dAMGZMv1c2PJMzw==} engines: {node: '>=14.0.0'} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.36': - resolution: {integrity: sha512-dvvByfl7TRVhD9zY/VJ94hOVJmpN8Cfxl/A77yJ/oKV67IPEXx9hRUIhuL/V9eJ0RphNbLo4VKxdVuZ+wzEWTA==} + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.38': + resolution: {integrity: sha512-19cTfnGedem+RY+znA9J6ARBOCEFD4YSjnx0p5jiTm9tR6pHafRfFIfKlTXhun+NL0WWM/M0eb2IfPPYUa8+wg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.36': - resolution: {integrity: sha512-n7odfY4zatppNGY/EE8wE8B78wIxlQzBaY7Ycyjun+HvYu4dJgz8A4JCKHhyYYoEA8+VXO167Or4EJ9SyBLNnw==} + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.38': + resolution: {integrity: sha512-HcICm4YzFJZV+fI0O0bFLVVlsWvRNo/AB9EfUXvNYbtAxakCnQZ15oq22deFdz6sfi9Y4/SagH2kPU723dhCFA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.36': - resolution: {integrity: sha512-ik9dlOa/bhRk+8NmbqCEZm9BBPy5UfSOg/Y6cAQac29Aw2/uoyoBbFUBFUKMsvfLg8F0dNxUOsT3IcVlfOJu0g==} + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.38': + resolution: {integrity: sha512-4Qx6cgEPXLb0XsCyLoQcUgYBpfL0sjugftob+zhUH0EOk/NVCAIT+h0NJhY+jn7pFpeKxhNMqhvTNx3AesxIAQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -5059,6 +5219,9 @@ packages: '@rolldown/pluginutils@1.0.0-beta.36': resolution: {integrity: sha512-qa+gfzhv0/Xv52zZInENLu6JbsnSjSExD7kTaNm7Qn5LUIH6IQb7l9pB+NrsU5/Bvt9aqcBTdRGc7x1DYMTiqQ==} + '@rolldown/pluginutils@1.0.0-beta.38': + resolution: {integrity: sha512-N/ICGKleNhA5nc9XXQG/kkKHJ7S55u0x0XUJbbkmdCnFuoRkM1Il12q9q0eX19+M7KKUEPw/daUPIRnxhcxAIw==} + '@rollup/rollup-android-arm-eabi@4.45.1': resolution: {integrity: sha512-NEySIFvMY0ZQO+utJkgoMiCAjMrGvnbDLHvcmlA33UXJpYBCvlBEbMMtV837uCkS+plG2umfhn0T5mMAxGrlRA==} cpu: [arm] @@ -5720,6 +5883,9 @@ packages: '@tybys/wasm-util@0.10.0': resolution: {integrity: sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==} + '@tybys/wasm-util@0.10.1': + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@types/aria-query@5.0.4': resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} @@ -5807,9 +5973,6 @@ packages: '@types/node@22.16.5': resolution: {integrity: sha512-bJFoMATwIGaxxx8VJPeM8TonI8t579oRvgAuT8zFugJsJZgzqv0Fu8Mhp68iecjzG7cnN3mO2dJQ5uUM2EFrgQ==} - '@types/node@24.3.1': - resolution: {integrity: sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==} - '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} @@ -6220,6 +6383,75 @@ packages: resolution: {integrity: sha512-Gt8TnSlDZpAl+RWOOAB/kuvC7RpcdWAlFbHNoi4gsXsfaWa1QCT6LBcfIYTPdOZC9OVZUDwqGuGAcqZejDmHjg==} engines: {node: '>=16'} + '@walletconnect/core@2.21.7': + resolution: {integrity: sha512-q/Au5Ne3g4R+q4GvHR5cvRd3+ha00QZCZiCs058lmy+eDbiZd0YsautvTPJ5a2guD6UaS1k/w5e1JHgixdcgLA==} + engines: {node: '>=18'} + + '@walletconnect/environment@1.0.1': + resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} + + '@walletconnect/events@1.0.1': + resolution: {integrity: sha512-NPTqaoi0oPBVNuLv7qPaJazmGHs5JGyO8eEAk5VGKmJzDR7AHzD4k6ilox5kxk1iwiOnFopBOOMLs86Oa76HpQ==} + + '@walletconnect/heartbeat@1.2.2': + resolution: {integrity: sha512-uASiRmC5MwhuRuf05vq4AT48Pq8RMi876zV8rr8cV969uTOzWdB/k+Lj5yI2PBtB1bGQisGen7MM1GcZlQTBXw==} + + '@walletconnect/jsonrpc-http-connection@1.0.8': + resolution: {integrity: sha512-+B7cRuaxijLeFDJUq5hAzNyef3e3tBDIxyaCNmFtjwnod5AGis3RToNqzFU33vpVcxFhofkpE7Cx+5MYejbMGw==} + + '@walletconnect/jsonrpc-provider@1.0.14': + resolution: {integrity: sha512-rtsNY1XqHvWj0EtITNeuf8PHMvlCLiS3EjQL+WOkxEOA4KPxsohFnBDeyPYiNm4ZvkQdLnece36opYidmtbmow==} + + '@walletconnect/jsonrpc-types@1.0.4': + resolution: {integrity: sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ==} + + '@walletconnect/jsonrpc-utils@1.0.8': + resolution: {integrity: sha512-vdeb03bD8VzJUL6ZtzRYsFMq1eZQcM3EAzT0a3st59dyLfJ0wq+tKMpmGH7HlB7waD858UWgfIcudbPFsbzVdw==} + + '@walletconnect/jsonrpc-ws-connection@1.0.16': + resolution: {integrity: sha512-G81JmsMqh5nJheE1mPst1W0WfVv0SG3N7JggwLLGnI7iuDZJq8cRJvQwLGKHn5H1WTW7DEPCo00zz5w62AbL3Q==} + + '@walletconnect/keyvaluestorage@1.1.1': + resolution: {integrity: sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==} + peerDependencies: + '@react-native-async-storage/async-storage': 1.x + peerDependenciesMeta: + '@react-native-async-storage/async-storage': + optional: true + + '@walletconnect/logger@2.1.2': + resolution: {integrity: sha512-aAb28I3S6pYXZHQm5ESB+V6rDqIYfsnHaQyzFbwUUBFY4H0OXx/YtTl8lvhUNhMMfb9UxbwEBS253TlXUYJWSw==} + + '@walletconnect/relay-api@1.0.11': + resolution: {integrity: sha512-tLPErkze/HmC9aCmdZOhtVmYZq1wKfWTJtygQHoWtgg722Jd4homo54Cs4ak2RUFUZIGO2RsOpIcWipaua5D5Q==} + + '@walletconnect/relay-auth@1.1.0': + resolution: {integrity: sha512-qFw+a9uRz26jRCDgL7Q5TA9qYIgcNY8jpJzI1zAWNZ8i7mQjaijRnWFKsCHAU9CyGjvt6RKrRXyFtFOpWTVmCQ==} + + '@walletconnect/safe-json@1.0.2': + resolution: {integrity: sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==} + + '@walletconnect/sign-client@2.21.7': + resolution: {integrity: sha512-9k/JEl9copR6nXRhqnmzWz2Zk1hiWysH+o6bp6Cqo8TgDUrZoMLBZMZ6qbo+2HLI54V02kKf0Vg8M81nNFOpjQ==} + + '@walletconnect/time@1.0.2': + resolution: {integrity: sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==} + + '@walletconnect/types@2.21.7': + resolution: {integrity: sha512-kyGnFje4Iq+XGkZZcSoAIrJWBE4BeghVW4O7n9e1MhUyeOOtO55M/kcqceNGYrvwjHvdN+Kf+aoLnKC0zKlpbQ==} + + '@walletconnect/universal-provider@2.21.7': + resolution: {integrity: sha512-8PB+vA5VuR9PBqt5Y0xj4JC2doYNPlXLGQt3wJORVF9QC227Mm/8R1CAKpmneeLrUH02LkSRwx+wnN/pPnDiQA==} + + '@walletconnect/utils@2.21.7': + resolution: {integrity: sha512-qyaclTgcFf9AwVuoV8CLLg8wfH3nX7yZdpylNkDqCpS7wawQL9zmFFTaGgma8sQrCsd3Sd9jUIymcpRvCJnSTw==} + + '@walletconnect/window-getters@1.0.1': + resolution: {integrity: sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==} + + '@walletconnect/window-metadata@1.0.1': + resolution: {integrity: sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA==} + '@webcomponents/scoped-custom-element-registry@0.0.10': resolution: {integrity: sha512-wP4LF28aysE2Pq3NQRNQxko7Q0vOOwcoOSMg8FFI4S6z76UuXkYIc5ndC31dJMwso1/vSteL75LW2CEKedAJbA==} @@ -6251,6 +6483,28 @@ packages: resolution: {integrity: sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA==} engines: {node: '>=16.0.0'} + abitype@1.0.8: + resolution: {integrity: sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + + abitype@1.1.0: + resolution: {integrity: sha512-6Vh4HcRxNMLA0puzPjM5GBgT4aAcFGKZzSgAXvuZ27shJP6NEpielTuqbBmZILR5/xd0PizkBGy5hReKz9jl5A==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3.22.0 || ^4.0.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -6324,6 +6578,10 @@ packages: resolution: {integrity: sha512-BGcItUBWSMRgOCe+SVZJ+S7yTRG0eGt9cXAHev72yuGcY23hnLA7Bky5L/xLyPINoSN95geovfBkqoTlNZYa7w==} engines: {node: '>=14'} + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + archiver-utils@5.0.2: resolution: {integrity: sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==} engines: {node: '>= 14'} @@ -6433,6 +6691,10 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + atomic-sleep@1.0.0: + resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} + engines: {node: '>=8.0.0'} + auto-bind@4.0.0: resolution: {integrity: sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==} engines: {node: '>=8'} @@ -6463,6 +6725,9 @@ packages: axios@1.11.0: resolution: {integrity: sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==} + axios@1.12.2: + resolution: {integrity: sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==} + axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -6531,6 +6796,9 @@ packages: bare-events: optional: true + base-x@5.0.1: + resolution: {integrity: sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -6545,6 +6813,9 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} + big.js@6.2.2: + resolution: {integrity: sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==} + bignumber.js@9.3.1: resolution: {integrity: sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==} @@ -6558,6 +6829,9 @@ packages: bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + blakejs@1.2.1: + resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} + brace-expansion@1.1.12: resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} @@ -6581,6 +6855,9 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + bs58@6.0.0: + resolution: {integrity: sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==} + bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} @@ -6648,6 +6925,10 @@ packages: camel-case@4.1.2: resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + caniuse-lite@1.0.30001707: resolution: {integrity: sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw==} @@ -6758,6 +7039,9 @@ packages: client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -6850,6 +7134,9 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cookie-es@1.2.2: + resolution: {integrity: sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==} + cookie@0.7.2: resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} @@ -6914,6 +7201,9 @@ packages: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} + crossws@0.3.5: + resolution: {integrity: sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==} + css-what@6.2.2: resolution: {integrity: sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==} engines: {node: '>= 6'} @@ -6959,6 +7249,9 @@ packages: dataloader@2.2.3: resolution: {integrity: sha512-y2krtASINtPFS1rSDjacrFgn1dcUuoREVabwlOGOe4SdxenREqwjwjElAdwvbGM7kgZz9a3KVicWR7vcz8rnzA==} + dayjs@1.11.13: + resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==} + de-indent@1.0.2: resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} @@ -6991,6 +7284,10 @@ packages: supports-color: optional: true + decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + decimal.js@10.5.0: resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==} @@ -7000,6 +7297,10 @@ packages: decode-named-character-reference@1.2.0: resolution: {integrity: sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==} + decode-uri-component@0.2.2: + resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} + engines: {node: '>=0.10'} + dedent@1.6.0: resolution: {integrity: sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==} peerDependencies: @@ -7071,6 +7372,9 @@ packages: destr@2.0.5: resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + detect-browser@5.3.0: + resolution: {integrity: sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==} + detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} @@ -7102,6 +7406,9 @@ packages: resolution: {integrity: sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==} engines: {node: '>=0.3.1'} + dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -7185,6 +7492,9 @@ packages: resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==} engines: {node: '>=14'} + encode-utf8@1.0.3: + resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} + end-of-stream@1.4.5: resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} @@ -7257,6 +7567,9 @@ packages: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} + es-toolkit@1.39.3: + resolution: {integrity: sha512-Qb/TCFCldgOy8lZ5uC7nLGdqJwSabkQiYQShmw4jyiPk1pZzaYWTwaYKYP7EgLccWYgZocMrtItrwh683voaww==} + esast-util-from-estree@2.0.0: resolution: {integrity: sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==} @@ -7562,6 +7875,9 @@ packages: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} + eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -7603,6 +7919,10 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + fast-redact@3.5.0: + resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} + engines: {node: '>=6'} + fast-sha256@1.3.0: resolution: {integrity: sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==} @@ -7663,6 +7983,10 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + filter-obj@1.1.0: + resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} + engines: {node: '>=0.10.0'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -8019,6 +8343,9 @@ packages: resolution: {integrity: sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==} engines: {node: '>=14.0.0'} + h3@1.15.4: + resolution: {integrity: sha512-z5cFQWDffyOe4vQ9xIqNfCZdV4p//vy6fBnr8Q1AWnVZ0teurKMG66rLj++TKwKPUP3u7iMUvrvKaEUiQw2QWQ==} + handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} @@ -8192,6 +8519,9 @@ packages: invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} + iron-webcrypto@1.2.1: + resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} + is-absolute@1.0.0: resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} engines: {node: '>=0.10.0'} @@ -8422,6 +8752,11 @@ packages: peerDependencies: ws: '*' + isows@1.0.7: + resolution: {integrity: sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==} + peerDependencies: + ws: '*' + iterator.prototype@1.1.5: resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==} engines: {node: '>= 0.4'} @@ -8541,6 +8876,9 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + keyvaluestorage-interface@1.0.0: + resolution: {integrity: sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==} + kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -8653,6 +8991,9 @@ packages: lit-html@3.3.1: resolution: {integrity: sha512-S9hbyDu/vs1qNrithiNyeyv64c9yqiW9l+DBgI18fL+MTvOtWoFR0FWiyq1TxaYef5wNlpEmzlXoBlZEO+WjoA==} + lit@3.3.0: + resolution: {integrity: sha512-DGVsqsOIHBww2DqnuZzW7QsuCdahp50ojuDaBPC7jUDRpYoH0z7kHBBYZewRzer75FwtrkmkKk7iOAwSaWdBmw==} + lit@3.3.1: resolution: {integrity: sha512-Ksr/8L3PTapbdXJCk+EJVB78jDodUMaP54gD24W186zGRARvwrsPfS60wae/SSCTCNZVPd1chXqio1qHQmu4NA==} @@ -9052,6 +9393,9 @@ packages: muggle-string@0.4.1: resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} + multiformats@9.9.0: + resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} + mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} @@ -9149,6 +9493,9 @@ packages: node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + node-mock-http@1.0.3: + resolution: {integrity: sha512-jN8dK25fsfnMrVsEhluUTPkBFY+6ybu7jSB1n+ri/vOGjJxU8J9CZhpSGkHXSkFjtUhbmoncG/YG9ta5Ludqog==} + node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} @@ -9219,9 +9566,15 @@ packages: resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} engines: {node: '>= 0.4'} + ofetch@1.4.1: + resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==} + ohash@1.1.6: resolution: {integrity: sha512-TBu7PtV8YkAZn0tSxobKY2n2aAQva936lhRrj6957aDaCf9IEtqsKbgMzXE/F/sjqYOwmrukeORHNLe5glk7Cg==} + on-exit-leak-free@0.2.0: + resolution: {integrity: sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -9265,6 +9618,22 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} + ox@0.7.1: + resolution: {integrity: sha512-+k9fY9PRNuAMHRFIUbiK9Nt5seYHHzSQs9Bj+iMETcGtlpS7SmBzcGSVUQO3+nqGLEiNK4598pHNFlVRaZbRsg==} + peerDependencies: + typescript: '>=5.4.0' + peerDependenciesMeta: + typescript: + optional: true + + ox@0.9.3: + resolution: {integrity: sha512-KzyJP+fPV4uhuuqrTZyok4DC7vFzi7HLUFiUNEmpbyh59htKWkOC98IONC1zgXJPbHAhQgqs6B0Z6StCGhmQvg==} + peerDependencies: + typescript: '>=5.4.0' + peerDependenciesMeta: + typescript: + optional: true + oxc-transform@0.82.3: resolution: {integrity: sha512-/vpZvbKSGpUcD06oTPMdAoLLNl2YjIzPAhAR2UDmBy/EyrTObmopxqOL9Pczg/R5cpisi7PzXbsn25tu00Ruqw==} engines: {node: '>=14.0.0'} @@ -9435,9 +9804,23 @@ packages: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} + pino-abstract-transport@0.5.0: + resolution: {integrity: sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==} + + pino-std-serializers@4.0.0: + resolution: {integrity: sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==} + + pino@7.11.0: + resolution: {integrity: sha512-dMACeu63HtRLmCG8VKdy4cShCPKaYDR4youZqoSWLxl5Gu99HUw8bw75thbPv9Nip+H+QYX8o3ZJbTdVZZ2TVg==} + hasBin: true + pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + polished@4.3.1: resolution: {integrity: sha512-OBatVyC/N7SCW/FaDHrSd+vn0o5cS855TOmYi4OkdWUMSJCET/xip//ch8xGUvtr3i44X9LVyWwQlRMTN3pwSA==} engines: {node: '>=10'} @@ -9555,6 +9938,9 @@ packages: process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + process-warning@1.0.0: + resolution: {integrity: sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==} + process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} @@ -9590,6 +9976,9 @@ packages: resolution: {integrity: sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==} engines: {node: '>=12.0.0'} + proxy-compare@3.0.1: + resolution: {integrity: sha512-V9plBAt3qjMlS1+nC8771KNf6oJ12gExvaxnNzN/9yVRLdTv/lc+oJlnSzrdYDAvBfTStPCoiaCOTmTs0adv7Q==} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} @@ -9604,12 +9993,24 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + qrcode@1.5.3: + resolution: {integrity: sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==} + engines: {node: '>=10.13.0'} + hasBin: true + quansync@0.2.11: resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + query-string@7.1.3: + resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} + engines: {node: '>=6'} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + quick-format-unescaped@4.0.4: + resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + radix-ui@1.1.3: resolution: {integrity: sha512-W8L6soM1vQnIXVvVa31AkQhoZBDPwVoNHhT13R3aB9Qq7ARYIUS9DLaCopRBsbTdZm1NEEPx3rnq659CiNOBDw==} peerDependencies: @@ -9623,6 +10024,9 @@ packages: '@types/react-dom': optional: true + radix3@1.1.2: + resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} + rc9@2.1.2: resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} @@ -9713,6 +10117,10 @@ packages: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} + real-require@0.1.0: + resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} + engines: {node: '>= 12.13.0'} + recast@0.23.11: resolution: {integrity: sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA==} engines: {node: '>= 4'} @@ -9824,6 +10232,9 @@ packages: require-like@0.1.2: resolution: {integrity: sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A==} + require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -9887,8 +10298,8 @@ packages: vue-tsc: optional: true - rolldown@1.0.0-beta.36: - resolution: {integrity: sha512-eethnJ/UfQWg2VWBDDMEu7IDvEh4WPbPb1azPWDCHcuOwoPT9C2NT4Y/ecZztCl9OBzXoA+CXXb5MS+qbukAig==} + rolldown@1.0.0-beta.38: + resolution: {integrity: sha512-58frPNX55Je1YsyrtPJv9rOSR3G5efUZpRqok94Efsj0EUa8dnqJV3BldShyI7A+bVPleucOtzXHwVpJRcR0kQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -9977,6 +10388,9 @@ packages: sentence-case@3.0.4: resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==} + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -10063,6 +10477,9 @@ packages: snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} + sonic-boom@2.8.0: + resolution: {integrity: sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -10084,6 +10501,14 @@ packages: split-ca@1.0.1: resolution: {integrity: sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ==} + split-on-first@1.1.0: + resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==} + engines: {node: '>=6'} + + split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + sponge-case@1.0.1: resolution: {integrity: sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA==} @@ -10135,6 +10560,10 @@ packages: strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} + strict-uri-encode@2.0.0: + resolution: {integrity: sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==} + engines: {node: '>=4'} + string-env-interpolation@1.0.1: resolution: {integrity: sha512-78lwMoCcn0nNu8LszbP1UA7g55OeE4v7rCeWnM5B453rnNr4aq+5it3FEYtZrSEiMvHZOZ9Jlqb0OD0M2VInqg==} @@ -10312,6 +10741,9 @@ packages: text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + thread-stream@0.15.2: + resolution: {integrity: sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==} + through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -10622,6 +11054,9 @@ packages: engines: {node: '>=0.8.0'} hasBin: true + uint8arrays@3.1.1: + resolution: {integrity: sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==} + unbox-primitive@1.1.0: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} @@ -10633,15 +11068,15 @@ packages: unconfig@7.3.3: resolution: {integrity: sha512-QCkQoOnJF8L107gxfHL0uavn7WD9b3dpBcFX6HtfQYmjw2YzWxGuFQ0N0J6tE9oguCBJn9KOvfqYDCMPHIZrBA==} + uncrypto@0.1.3: + resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - undici-types@7.10.0: - resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} - undici@7.15.0: resolution: {integrity: sha512-7oZJCPvvMvTd0OlqWsIxTuItTpJBpU1tcbVl24FMn3xt3+VSunwUasmfPJRE57oNO1KsZ4PgA1xTdAX4hq8NyQ==} engines: {node: '>=20.18.1'} @@ -10699,14 +11134,76 @@ packages: resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==} engines: {node: '>=14.0.0'} - update-browserslist-db@1.1.3: - resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - - upper-case-first@2.0.2: - resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} + unstorage@1.17.1: + resolution: {integrity: sha512-KKGwRTT0iVBCErKemkJCLs7JdxNVfqTPc/85ae1XES0+bsHbc/sFBfVi5kJp156cc51BHinIH2l3k0EZ24vOBQ==} + peerDependencies: + '@azure/app-configuration': ^1.8.0 + '@azure/cosmos': ^4.2.0 + '@azure/data-tables': ^13.3.0 + '@azure/identity': ^4.6.0 + '@azure/keyvault-secrets': ^4.9.0 + '@azure/storage-blob': ^12.26.0 + '@capacitor/preferences': ^6.0.3 || ^7.0.0 + '@deno/kv': '>=0.9.0' + '@netlify/blobs': ^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0 + '@planetscale/database': ^1.19.0 + '@upstash/redis': ^1.34.3 + '@vercel/blob': '>=0.27.1' + '@vercel/functions': ^2.2.12 || ^3.0.0 + '@vercel/kv': ^1.0.1 + aws4fetch: ^1.0.20 + db0: '>=0.2.1' + idb-keyval: ^6.2.1 + ioredis: ^5.4.2 + uploadthing: ^7.4.4 + peerDependenciesMeta: + '@azure/app-configuration': + optional: true + '@azure/cosmos': + optional: true + '@azure/data-tables': + optional: true + '@azure/identity': + optional: true + '@azure/keyvault-secrets': + optional: true + '@azure/storage-blob': + optional: true + '@capacitor/preferences': + optional: true + '@deno/kv': + optional: true + '@netlify/blobs': + optional: true + '@planetscale/database': + optional: true + '@upstash/redis': + optional: true + '@vercel/blob': + optional: true + '@vercel/functions': + optional: true + '@vercel/kv': + optional: true + aws4fetch: + optional: true + db0: + optional: true + idb-keyval: + optional: true + ioredis: + optional: true + uploadthing: + optional: true + + update-browserslist-db@1.1.3: + resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + upper-case-first@2.0.2: + resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} upper-case@2.0.2: resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==} @@ -10766,6 +11263,18 @@ packages: resolution: {integrity: sha512-IUoow1YUtvoBBC06dXs8bR8B9vuA3aJfmQNKMoaPG/OFsPmoQvw8xh+6Ye25Gx9DQhoEom3Pcu9MKHerm/NpUQ==} engines: {node: ^18.17.0 || >=20.5.0} + valtio@2.1.7: + resolution: {integrity: sha512-DwJhCDpujuQuKdJ2H84VbTjEJJteaSmqsuUltsfbfdbotVfNeTE4K/qc/Wi57I9x8/2ed4JNdjEna7O6PfavRg==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=18.0.0' + react: '>=18.0.0' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + vfile-message@4.0.2: resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} @@ -10775,6 +11284,22 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + viem@2.31.0: + resolution: {integrity: sha512-U7OMQ6yqK+bRbEIarf2vqxL7unSEQvNxvML/1zG7suAmKuJmipqdVTVJGKBCJiYsm/EremyO2FS4dHIPpGv+eA==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + + viem@2.37.5: + resolution: {integrity: sha512-bLKvKgLcge6KWBMLk8iP9weu5tHNr0hkxPNwQd+YQrHEgek7ogTBBeE10T0V6blwBMYmeZFZHLnMhDmPjp63/A==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + vite-node@3.2.4: resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} @@ -10974,6 +11499,9 @@ packages: resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} engines: {node: '>= 0.4'} + which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + which-typed-array@1.1.18: resolution: {integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==} engines: {node: '>= 0.4'} @@ -11014,6 +11542,18 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + ws@7.5.10: + resolution: {integrity: sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.18.2: resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==} engines: {node: '>=10.0.0'} @@ -11045,6 +11585,9 @@ packages: xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -11072,10 +11615,18 @@ packages: engines: {node: '>= 14.6'} hasBin: true + yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} @@ -11100,6 +11651,9 @@ packages: resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==} engines: {node: '>= 14'} + zod@3.22.4: + resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} + zod@3.25.67: resolution: {integrity: sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw==} @@ -11138,6 +11692,8 @@ snapshots: '@adobe/css-tools@4.4.4': {} + '@adraffy/ens-normalize@1.11.0': {} + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -12276,7 +12832,7 @@ snapshots: dependencies: '@changesets/types': 6.1.0 - '@changesets/cli@2.29.6(@types/node@24.3.1)': + '@changesets/cli@2.29.6(@types/node@22.16.5)': dependencies: '@changesets/apply-release-plan': 7.0.12 '@changesets/assemble-release-plan': 6.0.9 @@ -12292,7 +12848,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@changesets/write': 0.4.0 - '@inquirer/external-editor': 1.0.1(@types/node@24.3.1) + '@inquirer/external-editor': 1.0.1(@types/node@22.16.5) '@manypkg/get-packages': 1.1.3 ansi-colors: 4.1.3 ci-info: 3.9.0 @@ -12682,7 +13238,7 @@ snapshots: graphql: 16.11.0 tslib: 2.6.3 - '@graphql-codegen/cli@5.0.7(@parcel/watcher@2.5.1)(@types/node@22.15.29)(enquirer@2.4.1)(graphql@16.11.0)(typescript@5.9.2)': + '@graphql-codegen/cli@5.0.7(@parcel/watcher@2.5.1)(@types/node@22.15.29)(crossws@0.3.5)(enquirer@2.4.1)(graphql@16.11.0)(typescript@5.9.2)': dependencies: '@babel/generator': 7.28.0 '@babel/template': 7.27.2 @@ -12697,8 +13253,8 @@ snapshots: '@graphql-tools/graphql-file-loader': 8.0.22(graphql@16.11.0) '@graphql-tools/json-file-loader': 8.0.20(graphql@16.11.0) '@graphql-tools/load': 8.1.2(graphql@16.11.0) - '@graphql-tools/prisma-loader': 8.0.17(@types/node@22.15.29)(graphql@16.11.0) - '@graphql-tools/url-loader': 8.0.33(@types/node@22.15.29)(graphql@16.11.0) + '@graphql-tools/prisma-loader': 8.0.17(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0) + '@graphql-tools/url-loader': 8.0.33(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0) '@graphql-tools/utils': 10.9.1(graphql@16.11.0) '@whatwg-node/fetch': 0.10.9 chalk: 4.1.2 @@ -12706,7 +13262,7 @@ snapshots: debounce: 1.2.1 detect-indent: 6.1.0 graphql: 16.11.0 - graphql-config: 5.1.5(@types/node@22.15.29)(graphql@16.11.0)(typescript@5.9.2) + graphql-config: 5.1.5(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2) inquirer: 8.2.6 is-glob: 4.0.3 jiti: 1.21.7 @@ -12927,13 +13483,13 @@ snapshots: '@graphql-tools/utils': 10.8.6(graphql@16.11.0) graphql: 16.11.0 - '@graphql-tools/executor-graphql-ws@2.0.5(graphql@16.11.0)': + '@graphql-tools/executor-graphql-ws@2.0.5(crossws@0.3.5)(graphql@16.11.0)': dependencies: '@graphql-tools/executor-common': 0.0.4(graphql@16.11.0) '@graphql-tools/utils': 10.8.6(graphql@16.11.0) '@whatwg-node/disposablestack': 0.0.6 graphql: 16.11.0 - graphql-ws: 6.0.5(graphql@16.11.0)(ws@8.18.3) + graphql-ws: 6.0.5(crossws@0.3.5)(graphql@16.11.0)(ws@8.18.3) isomorphic-ws: 5.0.0(ws@8.18.3) tslib: 2.8.1 ws: 8.18.3 @@ -12959,7 +13515,7 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@graphql-tools/executor-http@1.3.3(@types/node@24.3.1)(graphql@16.11.0)': + '@graphql-tools/executor-http@1.3.3(@types/node@22.16.5)(graphql@16.11.0)': dependencies: '@graphql-hive/signal': 1.0.0 '@graphql-tools/executor-common': 0.0.4(graphql@16.11.0) @@ -12969,7 +13525,7 @@ snapshots: '@whatwg-node/fetch': 0.10.8 '@whatwg-node/promise-helpers': 1.3.2 graphql: 16.11.0 - meros: 1.3.0(@types/node@24.3.1) + meros: 1.3.0(@types/node@22.16.5) tslib: 2.8.1 transitivePeerDependencies: - '@types/node' @@ -13143,9 +13699,9 @@ snapshots: graphql: 16.11.0 tslib: 2.6.3 - '@graphql-tools/prisma-loader@8.0.17(@types/node@22.15.29)(graphql@16.11.0)': + '@graphql-tools/prisma-loader@8.0.17(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)': dependencies: - '@graphql-tools/url-loader': 8.0.33(@types/node@22.15.29)(graphql@16.11.0) + '@graphql-tools/url-loader': 8.0.33(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0) '@graphql-tools/utils': 10.9.1(graphql@16.11.0) '@types/js-yaml': 4.0.9 '@whatwg-node/fetch': 0.10.9 @@ -13195,9 +13751,9 @@ snapshots: graphql: 16.11.0 tslib: 2.8.1 - '@graphql-tools/url-loader@8.0.31(@types/node@22.15.29)(graphql@16.11.0)': + '@graphql-tools/url-loader@8.0.31(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)': dependencies: - '@graphql-tools/executor-graphql-ws': 2.0.5(graphql@16.11.0) + '@graphql-tools/executor-graphql-ws': 2.0.5(crossws@0.3.5)(graphql@16.11.0) '@graphql-tools/executor-http': 1.3.3(@types/node@22.15.29)(graphql@16.11.0) '@graphql-tools/executor-legacy-ws': 1.1.17(graphql@16.11.0) '@graphql-tools/utils': 10.8.6(graphql@16.11.0) @@ -13218,10 +13774,10 @@ snapshots: - uWebSockets.js - utf-8-validate - '@graphql-tools/url-loader@8.0.31(@types/node@24.3.1)(graphql@16.11.0)': + '@graphql-tools/url-loader@8.0.31(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0)': dependencies: - '@graphql-tools/executor-graphql-ws': 2.0.5(graphql@16.11.0) - '@graphql-tools/executor-http': 1.3.3(@types/node@24.3.1)(graphql@16.11.0) + '@graphql-tools/executor-graphql-ws': 2.0.5(crossws@0.3.5)(graphql@16.11.0) + '@graphql-tools/executor-http': 1.3.3(@types/node@22.16.5)(graphql@16.11.0) '@graphql-tools/executor-legacy-ws': 1.1.17(graphql@16.11.0) '@graphql-tools/utils': 10.8.6(graphql@16.11.0) '@graphql-tools/wrap': 10.1.0(graphql@16.11.0) @@ -13241,9 +13797,9 @@ snapshots: - uWebSockets.js - utf-8-validate - '@graphql-tools/url-loader@8.0.33(@types/node@22.15.29)(graphql@16.11.0)': + '@graphql-tools/url-loader@8.0.33(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)': dependencies: - '@graphql-tools/executor-graphql-ws': 2.0.5(graphql@16.11.0) + '@graphql-tools/executor-graphql-ws': 2.0.5(crossws@0.3.5)(graphql@16.11.0) '@graphql-tools/executor-http': 1.3.3(@types/node@22.15.29)(graphql@16.11.0) '@graphql-tools/executor-legacy-ws': 1.1.19(graphql@16.11.0) '@graphql-tools/utils': 10.9.1(graphql@16.11.0) @@ -13484,12 +14040,12 @@ snapshots: optionalDependencies: '@types/node': 22.15.29 - '@inquirer/confirm@5.1.16(@types/node@24.3.1)': + '@inquirer/confirm@5.1.16(@types/node@22.16.5)': dependencies: - '@inquirer/core': 10.2.0(@types/node@24.3.1) - '@inquirer/type': 3.0.8(@types/node@24.3.1) + '@inquirer/core': 10.2.0(@types/node@22.16.5) + '@inquirer/type': 3.0.8(@types/node@22.16.5) optionalDependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 optional: true '@inquirer/core@10.2.0(@types/node@22.15.29)': @@ -13505,10 +14061,10 @@ snapshots: optionalDependencies: '@types/node': 22.15.29 - '@inquirer/core@10.2.0(@types/node@24.3.1)': + '@inquirer/core@10.2.0(@types/node@22.16.5)': dependencies: '@inquirer/figures': 1.0.13 - '@inquirer/type': 3.0.8(@types/node@24.3.1) + '@inquirer/type': 3.0.8(@types/node@22.16.5) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -13516,15 +14072,15 @@ snapshots: wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 optional: true - '@inquirer/external-editor@1.0.1(@types/node@24.3.1)': + '@inquirer/external-editor@1.0.1(@types/node@22.16.5)': dependencies: chardet: 2.1.0 iconv-lite: 0.6.3 optionalDependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 '@inquirer/figures@1.0.13': {} @@ -13532,9 +14088,9 @@ snapshots: optionalDependencies: '@types/node': 22.15.29 - '@inquirer/type@3.0.8(@types/node@24.3.1)': + '@inquirer/type@3.0.8(@types/node@22.16.5)': optionalDependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 optional: true '@isaacs/balanced-match@4.0.1': {} @@ -13569,7 +14125,7 @@ snapshots: '@jridgewell/gen-mapping@0.3.8': dependencies: '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.29 '@jridgewell/remapping@2.3.5': @@ -13590,7 +14146,7 @@ snapshots: '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping@0.3.29': dependencies: @@ -13750,6 +14306,8 @@ snapshots: '@microsoft/tsdoc@0.14.2': {} + '@msgpack/msgpack@3.1.2': {} + '@mswjs/interceptors@0.39.6': dependencies: '@open-draft/deferred-promise': 2.2.0 @@ -13776,6 +14334,13 @@ snapshots: '@tybys/wasm-util': 0.10.0 optional: true + '@napi-rs/wasm-runtime@1.0.5': + dependencies: + '@emnapi/core': 1.5.0 + '@emnapi/runtime': 1.5.0 + '@tybys/wasm-util': 0.10.1 + optional: true + '@next/env@15.5.2': {} '@next/swc-darwin-arm64@15.5.2': @@ -13806,10 +14371,26 @@ snapshots: dependencies: eslint-scope: 5.1.1 + '@noble/ciphers@1.3.0': {} + + '@noble/curves@1.8.0': + dependencies: + '@noble/hashes': 1.7.0 + + '@noble/curves@1.9.1': + dependencies: + '@noble/hashes': 1.8.0 + + '@noble/curves@1.9.2': + dependencies: + '@noble/hashes': 1.8.0 + '@noble/curves@1.9.4': dependencies: '@noble/hashes': 1.8.0 + '@noble/hashes@1.7.0': {} + '@noble/hashes@1.8.0': {} '@nodelib/fs.scandir@2.1.5': @@ -13837,9 +14418,7 @@ snapshots: '@orama/orama@3.1.13': {} - '@oxc-project/runtime@0.87.0': {} - - '@oxc-project/types@0.87.0': {} + '@oxc-project/types@0.89.0': {} '@oxc-transform/binding-android-arm64@0.82.3': optional: true @@ -13948,6 +14527,10 @@ snapshots: '@parcel/watcher-win32-ia32': 2.5.1 '@parcel/watcher-win32-x64': 2.5.1 + '@phosphor-icons/webcomponents@2.1.5': + dependencies: + lit: 3.3.1 + '@pkgjs/parseargs@0.11.0': optional: true @@ -15119,50 +15702,349 @@ snapshots: '@types/react': 18.3.18 '@types/react-dom': 18.3.5(@types/react@18.3.18) + '@reown/appkit-common@1.8.5(typescript@5.9.2)(zod@3.22.4)': + dependencies: + big.js: 6.2.2 + dayjs: 1.11.13 + viem: 2.37.5(typescript@5.9.2)(zod@3.22.4) + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + + '@reown/appkit-common@1.8.5(typescript@5.9.2)(zod@3.25.67)': + dependencies: + big.js: 6.2.2 + dayjs: 1.11.13 + viem: 2.37.5(typescript@5.9.2)(zod@3.25.67) + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + + '@reown/appkit-controllers@1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-wallet': 1.8.5(typescript@5.9.2) + '@walletconnect/universal-provider': 2.21.7(typescript@5.9.2)(zod@3.25.67) + valtio: 2.1.7(@types/react@18.3.18)(react@18.3.1) + viem: 2.37.5(typescript@5.9.2)(zod@3.25.67) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + + '@reown/appkit-pay@1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-controllers': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-ui': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-utils': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + lit: 3.3.0 + valtio: 2.1.7(@types/react@18.3.18)(react@18.3.1) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + + '@reown/appkit-polyfills@1.8.5': + dependencies: + buffer: 6.0.3 + + '@reown/appkit-scaffold-ui@1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-controllers': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-ui': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-utils': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-wallet': 1.8.5(typescript@5.9.2) + lit: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + + '@reown/appkit-ui@1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@phosphor-icons/webcomponents': 2.1.5 + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-controllers': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-wallet': 1.8.5(typescript@5.9.2) + lit: 3.3.0 + qrcode: 1.5.3 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + + '@reown/appkit-universal-connector@1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@reown/appkit': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.25.67) + '@walletconnect/types': 2.21.7 + '@walletconnect/universal-provider': 2.21.7(typescript@5.9.2)(zod@3.25.67) + bs58: 6.0.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + + '@reown/appkit-utils@1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-controllers': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-polyfills': 1.8.5 + '@reown/appkit-wallet': 1.8.5(typescript@5.9.2) + '@wallet-standard/wallet': 1.1.0 + '@walletconnect/logger': 2.1.2 + '@walletconnect/universal-provider': 2.21.7(typescript@5.9.2)(zod@3.25.67) + valtio: 2.1.7(@types/react@18.3.18)(react@18.3.1) + viem: 2.37.5(typescript@5.9.2)(zod@3.25.67) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + + '@reown/appkit-wallet@1.8.5(typescript@5.9.2)': + dependencies: + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.22.4) + '@reown/appkit-polyfills': 1.8.5 + '@walletconnect/logger': 2.1.2 + zod: 3.22.4 + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + + '@reown/appkit@1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@reown/appkit-common': 1.8.5(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-controllers': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-pay': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-polyfills': 1.8.5 + '@reown/appkit-scaffold-ui': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-ui': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-utils': 1.8.5(@types/react@18.3.18)(react@18.3.1)(typescript@5.9.2)(zod@3.25.67) + '@reown/appkit-wallet': 1.8.5(typescript@5.9.2) + '@walletconnect/universal-provider': 2.21.7(typescript@5.9.2)(zod@3.25.67) + bs58: 6.0.0 + semver: 7.7.2 + valtio: 2.1.7(@types/react@18.3.18)(react@18.3.1) + viem: 2.37.5(typescript@5.9.2)(zod@3.25.67) + optionalDependencies: + '@lit/react': 1.0.8(@types/react@18.3.18) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - react + - typescript + - uploadthing + - utf-8-validate + - zod + '@repeaterjs/repeater@3.0.6': {} - '@rolldown/binding-android-arm64@1.0.0-beta.36': + '@rolldown/binding-android-arm64@1.0.0-beta.38': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-beta.36': + '@rolldown/binding-darwin-arm64@1.0.0-beta.38': optional: true - '@rolldown/binding-darwin-x64@1.0.0-beta.36': + '@rolldown/binding-darwin-x64@1.0.0-beta.38': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-beta.36': + '@rolldown/binding-freebsd-x64@1.0.0-beta.38': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.36': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.38': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.36': + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.38': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.36': + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.38': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.36': + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.38': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-beta.36': + '@rolldown/binding-linux-x64-musl@1.0.0-beta.38': optional: true - '@rolldown/binding-openharmony-arm64@1.0.0-beta.36': + '@rolldown/binding-openharmony-arm64@1.0.0-beta.38': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-beta.36': + '@rolldown/binding-wasm32-wasi@1.0.0-beta.38': dependencies: - '@napi-rs/wasm-runtime': 1.0.3 + '@napi-rs/wasm-runtime': 1.0.5 optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.36': + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.38': optional: true - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.36': + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.38': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.36': + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.38': optional: true '@rolldown/pluginutils@1.0.0-beta.27': {} @@ -15173,6 +16055,8 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.36': {} + '@rolldown/pluginutils@1.0.0-beta.38': {} + '@rollup/rollup-android-arm-eabi@4.45.1': optional: true @@ -15473,13 +16357,13 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/builder-vite@8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@storybook/builder-vite@8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@storybook/csf-plugin': 8.6.12(storybook@8.6.12(prettier@3.6.2)) browser-assert: 1.2.1 storybook: 8.6.12(prettier@3.6.2) ts-dedent: 2.2.0 - vite: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) '@storybook/components@8.6.12(storybook@8.6.12(prettier@3.6.2))': dependencies: @@ -15541,9 +16425,9 @@ snapshots: dependencies: storybook: 8.6.12(prettier@3.6.2) - '@storybook/web-components-vite@8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@storybook/web-components-vite@8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: - '@storybook/builder-vite': 8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + '@storybook/builder-vite': 8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) '@storybook/web-components': 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2)) magic-string: 0.30.17 storybook: 8.6.12(prettier@3.6.2) @@ -15786,6 +16670,11 @@ snapshots: tslib: 2.8.1 optional: true + '@tybys/wasm-util@0.10.1': + dependencies: + tslib: 2.8.1 + optional: true + '@types/aria-query@5.0.4': {} '@types/babel__core@7.20.5': @@ -15825,13 +16714,13 @@ snapshots: '@types/docker-modem@3.0.6': dependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 '@types/ssh2': 1.15.5 '@types/dockerode@3.3.43': dependencies: '@types/docker-modem': 3.0.6 - '@types/node': 24.3.1 + '@types/node': 22.16.5 '@types/ssh2': 1.15.5 '@types/estree-jsx@1.0.5': @@ -15884,10 +16773,6 @@ snapshots: dependencies: undici-types: 6.21.0 - '@types/node@24.3.1': - dependencies: - undici-types: 7.10.0 - '@types/parse-json@4.0.2': {} '@types/postcss-prefix-selector@1.16.3': @@ -15916,11 +16801,11 @@ snapshots: '@types/ssh2-streams@0.1.12': dependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 '@types/ssh2@0.5.52': dependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 '@types/ssh2-streams': 0.1.12 '@types/ssh2@1.15.5': @@ -16199,12 +17084,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@vanilla-extract/compiler@0.3.1(@types/node@24.3.1)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)': + '@vanilla-extract/compiler@0.3.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)': dependencies: '@vanilla-extract/css': 1.17.4(babel-plugin-macros@3.1.0) '@vanilla-extract/integration': 8.0.4(babel-plugin-macros@3.1.0) - vite: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) - vite-node: 3.2.4(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite-node: 3.2.4(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -16272,11 +17157,11 @@ snapshots: dependencies: '@vanilla-extract/css': 1.17.4(babel-plugin-macros@3.1.0) - '@vanilla-extract/vite-plugin@5.1.1(@types/node@24.3.1)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1)': + '@vanilla-extract/vite-plugin@5.1.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1)': dependencies: - '@vanilla-extract/compiler': 0.3.1(@types/node@24.3.1)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + '@vanilla-extract/compiler': 0.3.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) '@vanilla-extract/integration': 8.0.4(babel-plugin-macros@3.1.0) - vite: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -16300,11 +17185,11 @@ snapshots: transitivePeerDependencies: - '@swc/helpers' - '@vitejs/plugin-react-swc@3.11.0(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@vitejs/plugin-react-swc@3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@rolldown/pluginutils': 1.0.0-beta.27 '@swc/core': 1.13.1 - vite: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@swc/helpers' @@ -16320,7 +17205,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@5.0.2(vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@vitejs/plugin-react@5.0.2(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@babel/core': 7.28.4 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.4) @@ -16328,7 +17213,7 @@ snapshots: '@rolldown/pluginutils': 1.0.0-beta.34 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - supports-color @@ -16362,19 +17247,19 @@ snapshots: dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 - magic-string: 0.30.17 + magic-string: 0.30.19 optionalDependencies: msw: 2.11.1(@types/node@22.15.29)(typescript@5.9.2) vite: 7.0.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) - '@vitest/mocker@3.2.4(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(vite@7.0.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@vitest/mocker@3.2.4(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(vite@7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - msw: 2.11.1(@types/node@24.3.1)(typescript@5.9.2) - vite: 7.0.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + msw: 2.11.1(@types/node@22.16.5)(typescript@5.9.2) + vite: 7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) '@vitest/pretty-format@3.2.4': dependencies: @@ -16591,6 +17476,312 @@ snapshots: dependencies: '@wallet-standard/base': 1.1.0 + '@walletconnect/core@2.21.7(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.16 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.1.2 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.1.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.7 + '@walletconnect/utils': 2.21.7(typescript@5.9.2)(zod@3.25.67) + '@walletconnect/window-getters': 1.0.1 + es-toolkit: 1.39.3 + events: 3.3.0 + uint8arrays: 3.1.1 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + + '@walletconnect/environment@1.0.1': + dependencies: + tslib: 1.14.1 + + '@walletconnect/events@1.0.1': + dependencies: + keyvaluestorage-interface: 1.0.0 + tslib: 1.14.1 + + '@walletconnect/heartbeat@1.2.2': + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/time': 1.0.2 + events: 3.3.0 + + '@walletconnect/jsonrpc-http-connection@1.0.8': + dependencies: + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/safe-json': 1.0.2 + cross-fetch: 3.2.0 + events: 3.3.0 + transitivePeerDependencies: + - encoding + + '@walletconnect/jsonrpc-provider@1.0.14': + dependencies: + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/safe-json': 1.0.2 + events: 3.3.0 + + '@walletconnect/jsonrpc-types@1.0.4': + dependencies: + events: 3.3.0 + keyvaluestorage-interface: 1.0.0 + + '@walletconnect/jsonrpc-utils@1.0.8': + dependencies: + '@walletconnect/environment': 1.0.1 + '@walletconnect/jsonrpc-types': 1.0.4 + tslib: 1.14.1 + + '@walletconnect/jsonrpc-ws-connection@1.0.16': + dependencies: + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/safe-json': 1.0.2 + events: 3.3.0 + ws: 7.5.10 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@walletconnect/keyvaluestorage@1.1.1': + dependencies: + '@walletconnect/safe-json': 1.0.2 + idb-keyval: 6.2.2 + unstorage: 1.17.1(idb-keyval@6.2.2) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - db0 + - ioredis + - uploadthing + + '@walletconnect/logger@2.1.2': + dependencies: + '@walletconnect/safe-json': 1.0.2 + pino: 7.11.0 + + '@walletconnect/relay-api@1.0.11': + dependencies: + '@walletconnect/jsonrpc-types': 1.0.4 + + '@walletconnect/relay-auth@1.1.0': + dependencies: + '@noble/curves': 1.8.0 + '@noble/hashes': 1.7.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + uint8arrays: 3.1.1 + + '@walletconnect/safe-json@1.0.2': + dependencies: + tslib: 1.14.1 + + '@walletconnect/sign-client@2.21.7(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@walletconnect/core': 2.21.7(typescript@5.9.2)(zod@3.25.67) + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.1.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.7 + '@walletconnect/utils': 2.21.7(typescript@5.9.2)(zod@3.25.67) + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + + '@walletconnect/time@1.0.2': + dependencies: + tslib: 1.14.1 + + '@walletconnect/types@2.21.7': + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.1.2 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - db0 + - ioredis + - uploadthing + + '@walletconnect/universal-provider@2.21.7(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/jsonrpc-http-connection': 1.0.8 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.1.2 + '@walletconnect/sign-client': 2.21.7(typescript@5.9.2)(zod@3.25.67) + '@walletconnect/types': 2.21.7 + '@walletconnect/utils': 2.21.7(typescript@5.9.2)(zod@3.25.67) + es-toolkit: 1.39.3 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - encoding + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + + '@walletconnect/utils@2.21.7(typescript@5.9.2)(zod@3.25.67)': + dependencies: + '@msgpack/msgpack': 3.1.2 + '@noble/ciphers': 1.3.0 + '@noble/curves': 1.9.2 + '@noble/hashes': 1.8.0 + '@scure/base': 1.2.6 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.1.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.21.7 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + blakejs: 1.2.1 + bs58: 6.0.0 + detect-browser: 5.3.0 + query-string: 7.1.3 + uint8arrays: 3.1.1 + viem: 2.31.0(typescript@5.9.2)(zod@3.25.67) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/functions' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - typescript + - uploadthing + - utf-8-validate + - zod + + '@walletconnect/window-getters@1.0.1': + dependencies: + tslib: 1.14.1 + + '@walletconnect/window-metadata@1.0.1': + dependencies: + '@walletconnect/window-getters': 1.0.1 + tslib: 1.14.1 + '@webcomponents/scoped-custom-element-registry@0.0.10': {} '@whatwg-node/disposablestack@0.0.6': @@ -16630,6 +17821,21 @@ snapshots: dependencies: tslib: 2.8.1 + abitype@1.0.8(typescript@5.9.2)(zod@3.25.67): + optionalDependencies: + typescript: 5.9.2 + zod: 3.25.67 + + abitype@1.1.0(typescript@5.9.2)(zod@3.22.4): + optionalDependencies: + typescript: 5.9.2 + zod: 3.22.4 + + abitype@1.1.0(typescript@5.9.2)(zod@3.25.67): + optionalDependencies: + typescript: 5.9.2 + zod: 3.25.67 + abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 @@ -16692,6 +17898,11 @@ snapshots: ansis@4.1.0: {} + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + archiver-utils@5.0.2: dependencies: glob: 10.4.5 @@ -16841,6 +18052,8 @@ snapshots: asynckit@0.4.0: {} + atomic-sleep@1.0.0: {} + auto-bind@4.0.0: {} autoprefixer@10.4.21(postcss@8.5.6): @@ -16859,9 +18072,9 @@ snapshots: axe-core@4.10.2: {} - axios-retry@4.5.0(axios@1.11.0): + axios-retry@4.5.0(axios@1.12.2): dependencies: - axios: 1.11.0 + axios: 1.12.2 is-retry-allowed: 2.2.0 axios@0.30.0: @@ -16880,6 +18093,14 @@ snapshots: transitivePeerDependencies: - debug + axios@1.12.2: + dependencies: + follow-redirects: 1.15.9 + form-data: 4.0.4 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + axobject-query@4.1.0: {} b4a@1.6.7: {} @@ -16967,6 +18188,8 @@ snapshots: bare-events: 2.6.1 optional: true + base-x@5.0.1: {} + base64-js@1.5.1: {} bcrypt-pbkdf@1.0.2: @@ -16981,6 +18204,8 @@ snapshots: dependencies: is-windows: 1.0.2 + big.js@6.2.2: {} + bignumber.js@9.3.1: {} binary-install@1.1.0: @@ -16999,6 +18224,8 @@ snapshots: inherits: 2.0.4 readable-stream: 3.6.2 + blakejs@1.2.1: {} + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 @@ -17028,6 +18255,10 @@ snapshots: node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.25.1) + bs58@6.0.0: + dependencies: + base-x: 5.0.1 + bser@2.1.1: dependencies: node-int64: 0.4.0 @@ -17103,6 +18334,8 @@ snapshots: pascal-case: 3.1.2 tslib: 2.8.1 + camelcase@5.3.1: {} + caniuse-lite@1.0.30001707: {} caniuse-lite@1.0.30001727: {} @@ -17215,6 +18448,12 @@ snapshots: client-only@0.0.1: {} + cliui@6.0.0: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -17303,6 +18542,8 @@ snapshots: convert-source-map@2.0.0: {} + cookie-es@1.2.2: {} + cookie@0.7.2: {} core-js-compat@3.39.0: @@ -17372,6 +18613,10 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + crossws@0.3.5: + dependencies: + uncrypto: 0.1.3 + css-what@6.2.2: {} css.escape@1.5.1: {} @@ -17414,6 +18659,8 @@ snapshots: dataloader@2.2.3: {} + dayjs@1.11.13: {} + de-indent@1.0.2: {} debounce@1.2.1: {} @@ -17430,6 +18677,8 @@ snapshots: dependencies: ms: 2.1.3 + decamelize@1.2.0: {} + decimal.js@10.5.0: {} decode-named-character-reference@1.0.2: @@ -17440,6 +18689,8 @@ snapshots: dependencies: character-entities: 2.0.2 + decode-uri-component@0.2.2: {} + dedent@1.6.0(babel-plugin-macros@3.1.0): optionalDependencies: babel-plugin-macros: 3.1.0 @@ -17491,6 +18742,8 @@ snapshots: destr@2.0.5: {} + detect-browser@5.3.0: {} + detect-indent@6.1.0: {} detect-indent@7.0.1: {} @@ -17509,6 +18762,8 @@ snapshots: diff@8.0.2: {} + dijkstrajs@1.0.3: {} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -17592,6 +18847,8 @@ snapshots: empathic@2.0.0: {} + encode-utf8@1.0.3: {} + end-of-stream@1.4.5: dependencies: once: 1.4.0 @@ -17782,6 +19039,8 @@ snapshots: is-date-object: 1.1.0 is-symbol: 1.1.1 + es-toolkit@1.39.3: {} + esast-util-from-estree@2.0.0: dependencies: '@types/estree-jsx': 1.0.5 @@ -18274,6 +19533,8 @@ snapshots: event-target-shim@5.0.1: {} + eventemitter3@5.0.1: {} + events@3.3.0: {} expect-type@1.2.2: {} @@ -18310,6 +19571,8 @@ snapshots: fast-levenshtein@2.0.6: {} + fast-redact@3.5.0: {} + fast-sha256@1.3.0: {} fastq@1.18.0: @@ -18367,6 +19630,8 @@ snapshots: dependencies: to-regex-range: 5.0.1 + filter-obj@1.1.0: {} + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -18767,13 +20032,13 @@ snapshots: graphemer@1.4.0: {} - graphql-config@5.1.5(@types/node@22.15.29)(graphql@16.11.0)(typescript@5.9.2): + graphql-config@5.1.5(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2): dependencies: '@graphql-tools/graphql-file-loader': 8.0.20(graphql@16.11.0) '@graphql-tools/json-file-loader': 8.0.18(graphql@16.11.0) '@graphql-tools/load': 8.1.0(graphql@16.11.0) '@graphql-tools/merge': 9.0.24(graphql@16.11.0) - '@graphql-tools/url-loader': 8.0.31(@types/node@22.15.29)(graphql@16.11.0) + '@graphql-tools/url-loader': 8.0.31(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0) '@graphql-tools/utils': 10.8.6(graphql@16.11.0) cosmiconfig: 8.3.6(typescript@5.9.2) graphql: 16.11.0 @@ -18790,13 +20055,13 @@ snapshots: - uWebSockets.js - utf-8-validate - graphql-config@5.1.5(@types/node@24.3.1)(graphql@16.11.0)(typescript@5.9.2): + graphql-config@5.1.5(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2): dependencies: '@graphql-tools/graphql-file-loader': 8.0.20(graphql@16.11.0) '@graphql-tools/json-file-loader': 8.0.18(graphql@16.11.0) '@graphql-tools/load': 8.1.0(graphql@16.11.0) '@graphql-tools/merge': 9.0.24(graphql@16.11.0) - '@graphql-tools/url-loader': 8.0.31(@types/node@24.3.1)(graphql@16.11.0) + '@graphql-tools/url-loader': 8.0.31(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0) '@graphql-tools/utils': 10.8.6(graphql@16.11.0) cosmiconfig: 8.3.6(typescript@5.9.2) graphql: 16.11.0 @@ -18826,10 +20091,11 @@ snapshots: graphql: 16.11.0 tslib: 2.8.1 - graphql-ws@6.0.5(graphql@16.11.0)(ws@8.18.3): + graphql-ws@6.0.5(crossws@0.3.5)(graphql@16.11.0)(ws@8.18.3): dependencies: graphql: 16.11.0 optionalDependencies: + crossws: 0.3.5 ws: 8.18.3 graphql@16.11.0: {} @@ -18849,6 +20115,18 @@ snapshots: - encoding - supports-color + h3@1.15.4: + dependencies: + cookie-es: 1.2.2 + crossws: 0.3.5 + defu: 6.1.4 + destr: 2.0.5 + iron-webcrypto: 1.2.1 + node-mock-http: 1.0.3 + radix3: 1.1.2 + ufo: 1.6.1 + uncrypto: 0.1.3 + handlebars@4.7.8: dependencies: minimist: 1.2.8 @@ -19076,6 +20354,8 @@ snapshots: dependencies: loose-envify: 1.4.0 + iron-webcrypto@1.2.1: {} + is-absolute@1.0.0: dependencies: is-relative: 1.0.0 @@ -19284,6 +20564,14 @@ snapshots: dependencies: ws: 8.18.3 + isows@1.0.7(ws@8.18.2): + dependencies: + ws: 8.18.2 + + isows@1.0.7(ws@8.18.3): + dependencies: + ws: 8.18.3 + iterator.prototype@1.1.5: dependencies: define-data-property: 1.1.4 @@ -19420,6 +20708,8 @@ snapshots: dependencies: json-buffer: 3.0.1 + keyvaluestorage-interface@1.0.0: {} + kind-of@6.0.3: {} ky@1.10.0: {} @@ -19515,6 +20805,12 @@ snapshots: dependencies: '@types/trusted-types': 2.0.7 + lit@3.3.0: + dependencies: + '@lit/reactive-element': 2.1.1 + lit-element: 4.2.1 + lit-html: 3.3.1 + lit@3.3.1: dependencies: '@lit/reactive-element': 2.1.1 @@ -19797,9 +21093,9 @@ snapshots: optionalDependencies: '@types/node': 22.15.29 - meros@1.3.0(@types/node@24.3.1): + meros@1.3.0(@types/node@22.16.5): optionalDependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 micromark-core-commonmark@2.0.2: dependencies: @@ -20196,11 +21492,11 @@ snapshots: transitivePeerDependencies: - '@types/node' - msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2): + msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2): dependencies: '@bundled-es-modules/cookie': 2.0.1 '@bundled-es-modules/statuses': 1.0.1 - '@inquirer/confirm': 5.1.16(@types/node@24.3.1) + '@inquirer/confirm': 5.1.16(@types/node@22.16.5) '@mswjs/interceptors': 0.39.6 '@open-draft/deferred-promise': 2.2.0 '@open-draft/until': 2.1.0 @@ -20224,6 +21520,8 @@ snapshots: muggle-string@0.4.1: {} + multiformats@9.9.0: {} + mute-stream@0.0.8: {} mute-stream@2.0.0: {} @@ -20300,6 +21598,8 @@ snapshots: node-int64@0.4.0: {} + node-mock-http@1.0.3: {} + node-releases@2.0.19: {} normalize-path@2.1.1: @@ -20370,8 +21670,16 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.1.1 + ofetch@1.4.1: + dependencies: + destr: 2.0.5 + node-fetch-native: 1.6.7 + ufo: 1.6.1 + ohash@1.1.6: {} + on-exit-leak-free@0.2.0: {} + once@1.4.0: dependencies: wrappy: 1.0.2 @@ -20434,6 +21742,51 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 + ox@0.7.1(typescript@5.9.2)(zod@3.25.67): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/ciphers': 1.3.0 + '@noble/curves': 1.9.4 + '@noble/hashes': 1.8.0 + '@scure/bip32': 1.7.0 + '@scure/bip39': 1.6.0 + abitype: 1.1.0(typescript@5.9.2)(zod@3.25.67) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - zod + + ox@0.9.3(typescript@5.9.2)(zod@3.22.4): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/ciphers': 1.3.0 + '@noble/curves': 1.9.1 + '@noble/hashes': 1.8.0 + '@scure/bip32': 1.7.0 + '@scure/bip39': 1.6.0 + abitype: 1.1.0(typescript@5.9.2)(zod@3.22.4) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - zod + + ox@0.9.3(typescript@5.9.2)(zod@3.25.67): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/ciphers': 1.3.0 + '@noble/curves': 1.9.1 + '@noble/hashes': 1.8.0 + '@scure/bip32': 1.7.0 + '@scure/bip39': 1.6.0 + abitype: 1.1.0(typescript@5.9.2)(zod@3.25.67) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - zod + oxc-transform@0.82.3: optionalDependencies: '@oxc-transform/binding-android-arm64': 0.82.3 @@ -20605,12 +21958,35 @@ snapshots: pify@4.0.1: {} + pino-abstract-transport@0.5.0: + dependencies: + duplexify: 4.1.3 + split2: 4.2.0 + + pino-std-serializers@4.0.0: {} + + pino@7.11.0: + dependencies: + atomic-sleep: 1.0.0 + fast-redact: 3.5.0 + on-exit-leak-free: 0.2.0 + pino-abstract-transport: 0.5.0 + pino-std-serializers: 4.0.0 + process-warning: 1.0.0 + quick-format-unescaped: 4.0.4 + real-require: 0.1.0 + safe-stable-stringify: 2.5.0 + sonic-boom: 2.8.0 + thread-stream: 0.15.2 + pkg-types@1.3.1: dependencies: confbox: 0.1.8 mlly: 1.7.4 pathe: 2.0.3 + pngjs@5.0.0: {} + polished@4.3.1: dependencies: '@babel/runtime': 7.27.4 @@ -20666,6 +22042,8 @@ snapshots: process-nextick-args@2.0.1: {} + process-warning@1.0.0: {} + process@0.11.10: {} promise@7.3.1: @@ -20723,9 +22101,11 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 24.3.1 + '@types/node': 22.16.5 long: 5.3.2 + proxy-compare@3.0.1: {} + proxy-from-env@1.1.0: {} pump@3.0.3: @@ -20737,10 +22117,26 @@ snapshots: punycode@2.3.1: {} + qrcode@1.5.3: + dependencies: + dijkstrajs: 1.0.3 + encode-utf8: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + quansync@0.2.11: {} + query-string@7.1.3: + dependencies: + decode-uri-component: 0.2.2 + filter-obj: 1.1.0 + split-on-first: 1.1.0 + strict-uri-encode: 2.0.0 + queue-microtask@1.2.3: {} + quick-format-unescaped@4.0.4: {} + radix-ui@1.1.3(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@radix-ui/primitive': 1.1.1 @@ -20799,6 +22195,8 @@ snapshots: '@types/react': 18.3.18 '@types/react-dom': 18.3.5(@types/react@18.3.18) + radix3@1.1.2: {} + rc9@2.1.2: dependencies: defu: 6.1.4 @@ -20901,6 +22299,8 @@ snapshots: readdirp@4.1.2: {} + real-require@0.1.0: {} + recast@0.23.11: dependencies: ast-types: 0.16.1 @@ -21084,6 +22484,8 @@ snapshots: require-like@0.1.2: {} + require-main-filename@2.0.0: {} + resolve-from@4.0.0: {} resolve-from@5.0.0: {} @@ -21131,7 +22533,7 @@ snapshots: dependencies: glob: 7.2.3 - rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.36)(typescript@5.9.2): + rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.38)(typescript@5.9.2): dependencies: '@babel/generator': 7.28.3 '@babel/parser': 7.28.3 @@ -21141,34 +22543,33 @@ snapshots: debug: 4.4.1 dts-resolver: 2.1.2 get-tsconfig: 4.10.1 - rolldown: 1.0.0-beta.36 + rolldown: 1.0.0-beta.38 optionalDependencies: typescript: 5.9.2 transitivePeerDependencies: - oxc-resolver - supports-color - rolldown@1.0.0-beta.36: + rolldown@1.0.0-beta.38: dependencies: - '@oxc-project/runtime': 0.87.0 - '@oxc-project/types': 0.87.0 - '@rolldown/pluginutils': 1.0.0-beta.36 + '@oxc-project/types': 0.89.0 + '@rolldown/pluginutils': 1.0.0-beta.38 ansis: 4.1.0 optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-beta.36 - '@rolldown/binding-darwin-arm64': 1.0.0-beta.36 - '@rolldown/binding-darwin-x64': 1.0.0-beta.36 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.36 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.36 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.36 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.36 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.36 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.36 - '@rolldown/binding-openharmony-arm64': 1.0.0-beta.36 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.36 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.36 - '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.36 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.36 + '@rolldown/binding-android-arm64': 1.0.0-beta.38 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.38 + '@rolldown/binding-darwin-x64': 1.0.0-beta.38 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.38 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.38 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.38 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.38 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.38 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.38 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.38 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.38 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.38 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.38 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.38 rollup@4.45.1: dependencies: @@ -21297,6 +22698,8 @@ snapshots: tslib: 2.8.1 upper-case-first: 2.0.2 + set-blocking@2.0.0: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -21440,6 +22843,10 @@ snapshots: dot-case: 3.0.4 tslib: 2.8.1 + sonic-boom@2.8.0: + dependencies: + atomic-sleep: 1.0.0 + source-map-js@1.2.1: {} source-map@0.6.1: {} @@ -21455,6 +22862,10 @@ snapshots: split-ca@1.0.1: {} + split-on-first@1.1.0: {} + + split2@4.2.0: {} + sponge-case@1.0.1: dependencies: tslib: 2.8.1 @@ -21512,6 +22923,8 @@ snapshots: strict-event-emitter@0.5.1: {} + strict-uri-encode@2.0.0: {} + string-env-interpolation@1.0.1: {} string-natural-compare@3.0.1: {} @@ -21755,6 +23168,10 @@ snapshots: text-table@0.2.0: {} + thread-stream@0.15.2: + dependencies: + real-require: 0.1.0 + through@2.3.8: {} timeout-signal@2.0.0: {} @@ -21911,8 +23328,8 @@ snapshots: diff: 8.0.2 empathic: 2.0.0 hookable: 5.5.3 - rolldown: 1.0.0-beta.36 - rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.36)(typescript@5.9.2) + rolldown: 1.0.0-beta.38 + rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.38)(typescript@5.9.2) semver: 7.7.2 tinyexec: 1.0.1 tinyglobby: 0.2.14 @@ -22061,6 +23478,10 @@ snapshots: uglify-js@3.19.3: optional: true + uint8arrays@3.1.1: + dependencies: + multiformats: 9.9.0 + unbox-primitive@1.1.0: dependencies: call-bound: 1.0.4 @@ -22077,12 +23498,12 @@ snapshots: jiti: 2.5.1 quansync: 0.2.11 + uncrypto@0.1.3: {} + undici-types@5.26.5: {} undici-types@6.21.0: {} - undici-types@7.10.0: {} - undici@7.15.0: {} unicode-canonical-property-names-ecmascript@2.0.1: {} @@ -22146,6 +23567,19 @@ snapshots: acorn: 8.14.1 webpack-virtual-modules: 0.6.2 + unstorage@1.17.1(idb-keyval@6.2.2): + dependencies: + anymatch: 3.1.3 + chokidar: 4.0.3 + destr: 2.0.5 + h3: 1.15.4 + lru-cache: 10.4.3 + node-fetch-native: 1.6.7 + ofetch: 1.4.1 + ufo: 1.6.1 + optionalDependencies: + idb-keyval: 6.2.2 + update-browserslist-db@1.1.3(browserslist@4.24.4): dependencies: browserslist: 4.24.4 @@ -22211,6 +23645,13 @@ snapshots: validate-npm-package-name@6.0.2: {} + valtio@2.1.7(@types/react@18.3.18)(react@18.3.1): + dependencies: + proxy-compare: 3.0.1 + optionalDependencies: + '@types/react': 18.3.18 + react: 18.3.1 + vfile-message@4.0.2: dependencies: '@types/unist': 3.0.3 @@ -22226,6 +23667,57 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 + viem@2.31.0(typescript@5.9.2)(zod@3.25.67): + dependencies: + '@noble/curves': 1.9.1 + '@noble/hashes': 1.8.0 + '@scure/bip32': 1.7.0 + '@scure/bip39': 1.6.0 + abitype: 1.0.8(typescript@5.9.2)(zod@3.25.67) + isows: 1.0.7(ws@8.18.2) + ox: 0.7.1(typescript@5.9.2)(zod@3.25.67) + ws: 8.18.2 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + + viem@2.37.5(typescript@5.9.2)(zod@3.22.4): + dependencies: + '@noble/curves': 1.9.1 + '@noble/hashes': 1.8.0 + '@scure/bip32': 1.7.0 + '@scure/bip39': 1.6.0 + abitype: 1.1.0(typescript@5.9.2)(zod@3.22.4) + isows: 1.0.7(ws@8.18.3) + ox: 0.9.3(typescript@5.9.2)(zod@3.22.4) + ws: 8.18.3 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + + viem@2.37.5(typescript@5.9.2)(zod@3.25.67): + dependencies: + '@noble/curves': 1.9.1 + '@noble/hashes': 1.8.0 + '@scure/bip32': 1.7.0 + '@scure/bip39': 1.6.0 + abitype: 1.1.0(typescript@5.9.2)(zod@3.25.67) + isows: 1.0.7(ws@8.18.3) + ox: 0.9.3(typescript@5.9.2)(zod@3.25.67) + ws: 8.18.3 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + vite-node@3.2.4(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: cac: 6.7.14 @@ -22247,13 +23739,13 @@ snapshots: - tsx - yaml - vite-node@3.2.4(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + vite-node@3.2.4(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: cac: 6.7.14 debug: 4.4.1 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.0.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - jiti @@ -22295,7 +23787,7 @@ snapshots: tsx: 4.20.5 yaml: 2.8.1 - vite@7.0.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + vite@7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: esbuild: 0.25.9 fdir: 6.4.6(picomatch@4.0.3) @@ -22304,7 +23796,7 @@ snapshots: rollup: 4.45.1 tinyglobby: 0.2.14 optionalDependencies: - '@types/node': 24.3.1 + '@types/node': 22.16.5 fsevents: 2.3.3 jiti: 2.5.1 lightningcss: 1.30.1 @@ -22357,22 +23849,6 @@ snapshots: tsx: 4.20.5 yaml: 2.8.1 - vite@7.1.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): - dependencies: - esbuild: 0.25.9 - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 - postcss: 8.5.6 - rollup: 4.50.1 - tinyglobby: 0.2.15 - optionalDependencies: - '@types/node': 24.3.1 - fsevents: 2.3.3 - jiti: 2.5.1 - lightningcss: 1.30.1 - tsx: 4.20.5 - yaml: 2.8.1 - vitest@3.2.4(@types/debug@4.1.12)(@types/node@22.15.29)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1): dependencies: '@types/chai': 5.2.2 @@ -22417,11 +23893,11 @@ snapshots: - tsx - yaml - vitest@3.2.4(@types/debug@4.1.12)(@types/node@24.3.1)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1): + vitest@3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(msw@2.11.1(@types/node@24.3.1)(typescript@5.9.2))(vite@7.0.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + '@vitest/mocker': 3.2.4(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(vite@7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -22439,12 +23915,12 @@ snapshots: tinyglobby: 0.2.14 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.0.5(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) - vite-node: 3.2.4(@types/node@24.3.1)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite-node: 3.2.4(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 - '@types/node': 24.3.1 + '@types/node': 22.16.5 happy-dom: 18.0.1 jsdom: 26.1.0 transitivePeerDependencies: @@ -22560,6 +24036,8 @@ snapshots: is-weakmap: 2.0.2 is-weakset: 2.0.4 + which-module@2.0.1: {} + which-typed-array@1.1.18: dependencies: available-typed-arrays: 1.0.7 @@ -22612,6 +24090,8 @@ snapshots: wrappy@1.0.2: {} + ws@7.5.10: {} + ws@8.18.2: {} ws@8.18.3: {} @@ -22620,6 +24100,8 @@ snapshots: xmlchars@2.2.0: {} + y18n@4.0.3: {} + y18n@5.0.8: {} yallist@3.1.1: {} @@ -22634,8 +24116,27 @@ snapshots: yaml@2.8.1: {} + yargs-parser@18.1.3: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + yargs-parser@21.1.1: {} + yargs@15.4.1: + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 + yargs@17.7.2: dependencies: cliui: 8.0.1 @@ -22660,6 +24161,8 @@ snapshots: compress-commons: 6.0.2 readable-stream: 4.7.0 + zod@3.22.4: {} + zod@3.25.67: {} zod@4.1.5: {} From 0faabdca34e65a4439fe926275a7c936150e0309 Mon Sep 17 00:00:00 2001 From: jnicoulaud-ledger <102984500+jnicoulaud-ledger@users.noreply.github.com> Date: Thu, 18 Sep 2025 18:42:23 +0200 Subject: [PATCH 06/36] expose Ledger signer utility functions (#548) * expose Ledger signer utility functions * export from index.ts module * export only selected whitelist * Update packages/signers/src/ledger/objects.ts Co-authored-by: William Robertson * Update packages/signers/src/ledger/objects.ts Co-authored-by: William Robertson * Add release note --------- Co-authored-by: William Robertson Co-authored-by: Jordan Gensler --- .changeset/funny-apples-exist.md | 5 +++ packages/signers/src/ledger/index.ts | 61 ++++---------------------- packages/signers/src/ledger/objects.ts | 56 +++++++++++++++++++++++ 3 files changed, 69 insertions(+), 53 deletions(-) create mode 100644 .changeset/funny-apples-exist.md create mode 100644 packages/signers/src/ledger/objects.ts diff --git a/.changeset/funny-apples-exist.md b/.changeset/funny-apples-exist.md new file mode 100644 index 000000000..c3ae5d855 --- /dev/null +++ b/.changeset/funny-apples-exist.md @@ -0,0 +1,5 @@ +--- +'@mysten/signers': minor +--- + +Expose ledger signing utilities for external consumers. diff --git a/packages/signers/src/ledger/index.ts b/packages/signers/src/ledger/index.ts index c6c3698f6..5d4c7d4f1 100644 --- a/packages/signers/src/ledger/index.ts +++ b/packages/signers/src/ledger/index.ts @@ -9,8 +9,11 @@ import { Ed25519PublicKey } from '@mysten/sui/keypairs/ed25519'; import { Transaction } from '@mysten/sui/transactions'; import { toBase64 } from '@mysten/sui/utils'; -import { SuiMoveObject } from './bcs.js'; import { bcs } from '@mysten/sui/bcs'; +import { getInputObjects } from './objects.js'; + +export { SuiMoveObject } from './bcs.js'; +export { getInputObjects } from './objects.js'; /** * Configuration options for initializing the LedgerSigner. @@ -66,7 +69,10 @@ export class LedgerSigner extends Signer { * @returns The signed transaction bytes and signature. */ override async signTransaction(bytes: Uint8Array): Promise { - const transactionOptions = await this.#getClearSigningOptions(bytes).catch(() => ({ + const transactionOptions = await getInputObjects( + Transaction.from(bytes), + this.#suiClient, + ).catch(() => ({ // Fail gracefully so network errors or serialization issues don't break transaction signing: bcsObjects: [], })); @@ -135,57 +141,6 @@ export class LedgerSigner extends Signer { }); } - async #getClearSigningOptions(transactionBytes: Uint8Array) { - const transaction = Transaction.from(transactionBytes); - const data = transaction.getData(); - - const gasObjectIds = data.gasData.payment?.map((object) => object.objectId) ?? []; - const inputObjectIds = data.inputs - .map((input) => { - return input.$kind === 'Object' && input.Object.$kind === 'ImmOrOwnedObject' - ? input.Object.ImmOrOwnedObject.objectId - : null; - }) - .filter((objectId): objectId is string => !!objectId); - - const objects = await this.#suiClient.multiGetObjects({ - ids: [...gasObjectIds, ...inputObjectIds], - options: { - showBcs: true, - showPreviousTransaction: true, - showStorageRebate: true, - showOwner: true, - }, - }); - - // NOTE: We should probably get rid of this manual serialization logic in favor of using the - // already serialized object bytes from the GraphQL API once there is more mainstream support - // for it + we can enforce the transport type on the Sui client. - const bcsObjects = objects - .map((object) => { - if (object.error || !object.data || object.data.bcs?.dataType !== 'moveObject') { - return null; - } - - return SuiMoveObject.serialize({ - data: { - MoveObject: { - type: object.data.bcs.type, - hasPublicTransfer: object.data.bcs.hasPublicTransfer, - version: object.data.bcs.version, - contents: object.data.bcs.bcsBytes, - }, - }, - owner: object.data.owner!, - previousTransaction: object.data.previousTransaction!, - storageRebate: object.data.storageRebate!, - }).toBytes(); - }) - .filter((bcsBytes): bcsBytes is Uint8Array => !!bcsBytes); - - return { bcsObjects }; - } - /** * Generic signing is not supported by Ledger. * @throws Always throws an error indicating generic signing is unsupported. diff --git a/packages/signers/src/ledger/objects.ts b/packages/signers/src/ledger/objects.ts new file mode 100644 index 000000000..829c30d2d --- /dev/null +++ b/packages/signers/src/ledger/objects.ts @@ -0,0 +1,56 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Transaction } from '@mysten/sui/transactions'; +import type { SuiClient } from '@mysten/sui/client'; +import { SuiMoveObject } from './bcs.js'; + +export const getInputObjects = async (transaction: Transaction, client: SuiClient) => { + const data = transaction.getData(); + + const gasObjectIds = data.gasData.payment?.map((object) => object.objectId) ?? []; + const inputObjectIds = data.inputs + .map((input) => { + return input.$kind === 'Object' && input.Object.$kind === 'ImmOrOwnedObject' + ? input.Object.ImmOrOwnedObject.objectId + : null; + }) + .filter((objectId): objectId is string => !!objectId); + + const objects = await client.multiGetObjects({ + ids: [...gasObjectIds, ...inputObjectIds], + options: { + showBcs: true, + showPreviousTransaction: true, + showStorageRebate: true, + showOwner: true, + }, + }); + + // NOTE: We should probably get rid of this manual serialization logic in favor of using the + // already serialized object bytes from the GraphQL API once there is more mainstream support + // for it + we can enforce the transport type on the Sui client. + const bcsObjects = objects + .map((object) => { + if (object.error || !object.data || object.data.bcs?.dataType !== 'moveObject') { + return null; + } + + return SuiMoveObject.serialize({ + data: { + MoveObject: { + type: object.data.bcs.type, + hasPublicTransfer: object.data.bcs.hasPublicTransfer, + version: object.data.bcs.version, + contents: object.data.bcs.bcsBytes, + }, + }, + owner: object.data.owner!, + previousTransaction: object.data.previousTransaction!, + storageRebate: object.data.storageRebate!, + }).toBytes(); + }) + .filter((bcsBytes): bcsBytes is Uint8Array => !!bcsBytes); + + return { bcsObjects }; +}; From 3a2639bb9160dc5e865caef4bcca4305c2a89192 Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Thu, 18 Sep 2025 11:59:33 -0500 Subject: [PATCH 07/36] Upgrade pnpm and harden dependencies (#550) --- .github/workflows/changesets-ci.yml | 2 -- .github/workflows/changesets.yml | 2 -- .github/workflows/seal-ci.yml | 2 -- .github/workflows/turborepo.yml | 4 ---- .npmrc | 3 --- package.json | 6 +++--- pnpm-workspace.yaml | 9 ++++++++- 7 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 .npmrc diff --git a/.github/workflows/changesets-ci.yml b/.github/workflows/changesets-ci.yml index 5228438f9..eda3aae09 100644 --- a/.github/workflows/changesets-ci.yml +++ b/.github/workflows/changesets-ci.yml @@ -9,8 +9,6 @@ jobs: with: fetch-depth: 0 - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 - with: - version: 9.1.1 - name: Install Nodejs uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 with: diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index 651398d62..cf1811541 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -28,8 +28,6 @@ jobs: with: fetch-depth: 0 - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 - with: - version: 9.1.1 - name: Install Nodejs uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 with: diff --git a/.github/workflows/seal-ci.yml b/.github/workflows/seal-ci.yml index 80ad1c787..212ebcfba 100644 --- a/.github/workflows/seal-ci.yml +++ b/.github/workflows/seal-ci.yml @@ -15,8 +15,6 @@ jobs: - name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1 - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 - with: - version: 9.1.1 - name: Install Node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 with: diff --git a/.github/workflows/turborepo.yml b/.github/workflows/turborepo.yml index bfe78492c..2f0a99d69 100644 --- a/.github/workflows/turborepo.yml +++ b/.github/workflows/turborepo.yml @@ -14,8 +14,6 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 - with: - version: 9.1.1 - name: Install Nodejs uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 with: @@ -37,8 +35,6 @@ jobs: with: fetch-depth: 2 - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 - with: - version: 9.1.1 - name: Install Nodejs uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 with: diff --git a/.npmrc b/.npmrc deleted file mode 100644 index d410ce495..000000000 --- a/.npmrc +++ /dev/null @@ -1,3 +0,0 @@ -strict-peer-dependencies=false -auto-install-peers=false -public-hoist-pattern[]=*storybook* diff --git a/package.json b/package.json index ae471558c..9faf266be 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix", "build": "turbo run build" }, + "packageManager": "pnpm@10.17.0", "pnpm": { "overrides": { "node-notifier": "10.0.0", @@ -30,7 +31,7 @@ } }, "engines": { - "pnpm": ">=9.0.0" + "pnpm": ">=10.17.0" }, "manypkg": { "ignoredRules": [ @@ -64,6 +65,5 @@ "tsx": "^4.20.5", "turbo": "^2.5.6", "typescript": "^5.9.2" - }, - "packageManager": "pnpm@9.1.1+sha512.14e915759c11f77eac07faba4d019c193ec8637229e62ec99eefb7cf3c3b75c64447882b7c485142451ee3a6b408059cdfb7b7fa0341b975f12d0f7629c71195" + } } diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d0fdd8020..5426d4cfb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,11 @@ +autoInstallPeers: false +publicHoistPattern: + - '*storybook*' + +# Enforce that packages must be at least 2 days old before they're installed +# This reduces the risk of supply chain attacks from newly published packages +minimumReleaseAge: 2880 + packages: - 'packages/**' - '!**/dist/**' @@ -8,7 +16,6 @@ packages: - '!packages/typescript/transactions' - '!packages/typescript/cryptography' - '!packages/typescript/faucet' - - '!packages/typescript/transactions' - '!packages/typescript/client' - '!packages/typescript/verify' - '!packages/typescript/multisig' From da034e2c3ee6b603458719f1751a740c8e42efdd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:03:05 -0500 Subject: [PATCH 08/36] Version Packages (#551) Co-authored-by: github-actions[bot] --- .changeset/funny-apples-exist.md | 5 ----- .changeset/three-numbers-dress.md | 5 ----- packages/enoki/CHANGELOG.md | 7 +++++++ packages/enoki/package.json | 2 +- packages/signers/CHANGELOG.md | 6 ++++++ packages/signers/package.json | 2 +- packages/walletconnect-wallet/CHANGELOG.md | 7 +++++++ packages/walletconnect-wallet/package.json | 2 +- 8 files changed, 23 insertions(+), 13 deletions(-) delete mode 100644 .changeset/funny-apples-exist.md delete mode 100644 .changeset/three-numbers-dress.md create mode 100644 packages/walletconnect-wallet/CHANGELOG.md diff --git a/.changeset/funny-apples-exist.md b/.changeset/funny-apples-exist.md deleted file mode 100644 index c3ae5d855..000000000 --- a/.changeset/funny-apples-exist.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/signers': minor ---- - -Expose ledger signing utilities for external consumers. diff --git a/.changeset/three-numbers-dress.md b/.changeset/three-numbers-dress.md deleted file mode 100644 index c5e49e901..000000000 --- a/.changeset/three-numbers-dress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/walletconnect-wallet': minor ---- - -Initial Release diff --git a/packages/enoki/CHANGELOG.md b/packages/enoki/CHANGELOG.md index c9471a4ea..c7552ea54 100644 --- a/packages/enoki/CHANGELOG.md +++ b/packages/enoki/CHANGELOG.md @@ -1,5 +1,12 @@ # @mysten/enoki +## 0.12.1 + +### Patch Changes + +- Updated dependencies [0faabdc] + - @mysten/signers@0.5.0 + ## 0.12.0 ### Minor Changes diff --git a/packages/enoki/package.json b/packages/enoki/package.json index 056221d08..73dd50d7f 100644 --- a/packages/enoki/package.json +++ b/packages/enoki/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/enoki", - "version": "0.12.0", + "version": "0.12.1", "description": "TODO: Description", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/signers/CHANGELOG.md b/packages/signers/CHANGELOG.md index 78fe9b50b..729775283 100644 --- a/packages/signers/CHANGELOG.md +++ b/packages/signers/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/signers +## 0.5.0 + +### Minor Changes + +- 0faabdc: Expose ledger signing utilities for external consumers. + ## 0.4.0 ### Minor Changes diff --git a/packages/signers/package.json b/packages/signers/package.json index 1ce9bfff4..78582c4e4 100644 --- a/packages/signers/package.json +++ b/packages/signers/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/signers", - "version": "0.4.0", + "version": "0.5.0", "description": "A collection of signers for various providers", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/walletconnect-wallet/CHANGELOG.md b/packages/walletconnect-wallet/CHANGELOG.md new file mode 100644 index 000000000..57145e168 --- /dev/null +++ b/packages/walletconnect-wallet/CHANGELOG.md @@ -0,0 +1,7 @@ +# @mysten/walletconnect-wallet + +## 0.1.0 + +### Minor Changes + +- bda17bf: Initial Release diff --git a/packages/walletconnect-wallet/package.json b/packages/walletconnect-wallet/package.json index f8807a7b9..cb77a6437 100644 --- a/packages/walletconnect-wallet/package.json +++ b/packages/walletconnect-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/walletconnect-wallet", - "version": "0.0.0", + "version": "0.1.0", "description": "Wallet adapter for WalletConnect on Sui", "license": "Apache-2.0", "author": "Mysten Labs ", From 7c623e591336ead8100368f9ff525bc254a533dc Mon Sep 17 00:00:00 2001 From: Joy Wang <108701016+joyqvq@users.noreply.github.com> Date: Fri, 19 Sep 2025 10:11:31 -0400 Subject: [PATCH 09/36] [seal] export DemType (#552) --- .changeset/thick-mails-marry.md | 5 +++++ packages/seal/src/index.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/thick-mails-marry.md diff --git a/.changeset/thick-mails-marry.md b/.changeset/thick-mails-marry.md new file mode 100644 index 000000000..59cd0fa1d --- /dev/null +++ b/.changeset/thick-mails-marry.md @@ -0,0 +1,5 @@ +--- +'@mysten/seal': minor +--- + +[seal] export DemType diff --git a/packages/seal/src/index.ts b/packages/seal/src/index.ts index 89cebeec9..36c9ae91b 100644 --- a/packages/seal/src/index.ts +++ b/packages/seal/src/index.ts @@ -15,3 +15,4 @@ export type { FetchKeysOptions, GetDerivedKeysOptions, } from './types.js'; +export { DemType } from './encrypt.js'; From ee962b94453ecaa2211d9c82c33150db5839915b Mon Sep 17 00:00:00 2001 From: William Robertson Date: Fri, 19 Sep 2025 17:45:17 -0400 Subject: [PATCH 10/36] [dapp-kit-next] add backward compatible auto-connect functionality (#554) --- .../src/core/actions/connect-wallet.ts | 40 ++++++++++++------- .../packages/dapp-kit-core/src/core/index.ts | 2 +- .../core/initializers/autoconnect-wallet.ts | 40 ++++++++++++++----- .../initializers/sync-state-to-storage.ts | 4 +- 4 files changed, 61 insertions(+), 25 deletions(-) diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts index d79d3562d..5afa892b0 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts @@ -13,8 +13,8 @@ import { getWalletForHandle_DO_NOT_USE_OR_YOU_WILL_BE_FIRED as getWalletForHandle, } from '@wallet-standard/ui-registry'; import { WalletAccountNotFoundError, WalletNoAccountsConnectedError } from '../../utils/errors.js'; -import type { Experimental_SuiClientTypes } from '@mysten/sui/experimental'; import { getChain } from '../../utils/networks.js'; +import type { Networks } from '../../utils/networks.js'; export type ConnectWalletArgs = { /** The wallet to connect to. */ @@ -29,7 +29,7 @@ export type ConnectWalletArgs = { export function connectWalletCreator( { $baseConnection }: DAppKitStores, - supportedNetworks: readonly Experimental_SuiClientTypes.Network[], + supportedNetworks: Networks, ) { /** * Prompts the specified wallet to connect and authorize new accounts for the current domain. @@ -46,19 +46,11 @@ export function connectWalletCreator( try { $baseConnection.setKey('status', isAlreadyConnected ? 'reconnecting' : 'connecting'); - const { connect } = getWalletFeature( + const suiAccounts = await internalConnectWallet( wallet, - StandardConnect, - ) as StandardConnectFeature[typeof StandardConnect]; - - const result = await connect(standardConnectArgs); - - const underlyingWallet = getWalletForHandle(wallet); - const supportedChains = supportedNetworks.map(getChain); - - const suiAccounts = result.accounts - .filter((account) => account.chains.some((chain) => supportedChains.includes(chain))) - .map(getOrCreateUiWalletAccountForStandardWalletAccount.bind(null, underlyingWallet)); + supportedNetworks, + standardConnectArgs, + ); if (!isAlreadyConnected && suiAccounts.length === 0) { throw new WalletNoAccountsConnectedError('No accounts were authorized.'); @@ -83,3 +75,23 @@ export function connectWalletCreator( }); }; } + +export async function internalConnectWallet( + wallet: UiWallet, + supportedNetworks: Networks, + args: StandardConnectInput, +) { + const { connect } = getWalletFeature( + wallet, + StandardConnect, + ) as StandardConnectFeature[typeof StandardConnect]; + + const result = await connect(args); + + const underlyingWallet = getWalletForHandle(wallet); + const supportedChains = supportedNetworks.map(getChain); + + return result.accounts + .filter((account) => account.chains.some((chain) => supportedChains.includes(chain))) + .map(getOrCreateUiWalletAccountForStandardWalletAccount.bind(null, underlyingWallet)); +} diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/index.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/index.ts index 5e333900e..b36758dc9 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/index.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/index.ts @@ -88,7 +88,7 @@ export function createDAppKit< manageWalletConnection(stores); if (autoConnect) { - autoConnectWallet({ stores, storageKey, storage }); + autoConnectWallet({ networks, stores, storageKey, storage }); } registerAdditionalWallets( diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts index bce8d8f6c..7a672690d 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts @@ -7,14 +7,19 @@ import type { StateStorage } from '../../utils/storage.js'; import type { UiWallet } from '@wallet-standard/ui'; import { getWalletUniqueIdentifier } from '../../utils/wallets.js'; +import { internalConnectWallet } from '../actions/connect-wallet.js'; +import type { Networks } from '../../utils/networks.js'; + /** * Attempts to connect to a previously authorized wallet account on mount and when new wallets are registered. */ export function autoConnectWallet({ + networks, stores: { $baseConnection, $compatibleWallets }, storage, storageKey, }: { + networks: Networks; stores: DAppKitStores; storage: StateStorage; storageKey: string; @@ -29,6 +34,7 @@ export function autoConnectWallet({ const savedWalletAccount = await task(() => { return getSavedWalletAccount({ + networks, storage, storageKey, wallets, @@ -47,10 +53,12 @@ export function autoConnectWallet({ } async function getSavedWalletAccount({ + networks, storage, storageKey, wallets, }: { + networks: Networks; storage: StateStorage; storageKey: string; wallets: readonly UiWallet[]; @@ -65,15 +73,29 @@ async function getSavedWalletAccount({ return null; } - for (const wallet of wallets) { - if (getWalletUniqueIdentifier(wallet) === savedWalletId) { - for (const account of wallet.accounts) { - if (account.address === savedAccountAddress) { - return account; - } - } - } + const targetWallet = wallets.find( + (wallet) => getWalletUniqueIdentifier(wallet) === savedWalletId, + ); + + if (!targetWallet) { + return null; } - return null; + const existingAccount = targetWallet.accounts.find( + (account) => account.address === savedAccountAddress, + ); + + if (existingAccount) { + return existingAccount; + } + + // For wallets that don't pre-populate the accounts array on page load, + // we need to silently request authorization and get the account directly. + const alreadyAuthorizedAccounts = await internalConnectWallet(targetWallet, networks, { + silent: true, + }); + + return ( + alreadyAuthorizedAccounts.find((account) => account.address === savedAccountAddress) ?? null + ); } diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts index 10cedd6fb..e4b0968f4 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts @@ -20,7 +20,9 @@ export function syncStateToStorage({ storageKey: string; }) { onMount($connection, () => { - return $connection.listen((connection) => { + return $connection.listen((connection, oldConnection) => { + if (!oldConnection || oldConnection.status === connection.status) return; + if (connection.account) { storage.setItem(storageKey, getSavedAccountStorageKey(connection.account)); } else { From 5af536e473cb271957befee8b635844a19617691 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 12:34:27 -0400 Subject: [PATCH 11/36] Version Packages (#553) Co-authored-by: github-actions[bot] --- .changeset/thick-mails-marry.md | 5 ----- packages/seal/CHANGELOG.md | 6 ++++++ packages/seal/package.json | 2 +- packages/seal/src/version.ts | 2 +- packages/typescript/src/version.ts | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 .changeset/thick-mails-marry.md diff --git a/.changeset/thick-mails-marry.md b/.changeset/thick-mails-marry.md deleted file mode 100644 index 59cd0fa1d..000000000 --- a/.changeset/thick-mails-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/seal': minor ---- - -[seal] export DemType diff --git a/packages/seal/CHANGELOG.md b/packages/seal/CHANGELOG.md index 523084496..0069b2298 100644 --- a/packages/seal/CHANGELOG.md +++ b/packages/seal/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/seal +## 0.7.0 + +### Minor Changes + +- 7c623e5: [seal] export DemType + ## 0.6.0 ### Minor Changes diff --git a/packages/seal/package.json b/packages/seal/package.json index b3fc8a57c..ebe20ec42 100644 --- a/packages/seal/package.json +++ b/packages/seal/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/seal", - "version": "0.6.0", + "version": "0.7.0", "description": "Seal SDK", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/seal/src/version.ts b/packages/seal/src/version.ts index 203f46c91..c46acd68e 100644 --- a/packages/seal/src/version.ts +++ b/packages/seal/src/version.ts @@ -3,4 +3,4 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '0.6.0'; +export const PACKAGE_VERSION = '0.7.0'; diff --git a/packages/typescript/src/version.ts b/packages/typescript/src/version.ts index 78dc58b0c..e8e0596c2 100644 --- a/packages/typescript/src/version.ts +++ b/packages/typescript/src/version.ts @@ -4,4 +4,4 @@ // This file is generated by genversion.mjs. Do not edit it directly. export const PACKAGE_VERSION = '1.38.0'; -export const TARGETED_RPC_VERSION = '1.57.0'; +export const TARGETED_RPC_VERSION = '1.58.0'; From c88feaa62ab89d4227dc9d359d02446d744875ee Mon Sep 17 00:00:00 2001 From: Tony Lee Date: Wed, 24 Sep 2025 09:38:23 -0400 Subject: [PATCH 12/36] Suins SDK to support BBB (#558) * update bbb sdk * changeset * cleanup --- .changeset/wicked-bananas-dream.md | 5 +++++ packages/suins/src/constants.ts | 12 ++++++++++-- packages/suins/src/suins-transaction.ts | 8 +++++++- packages/suins/src/types.ts | 4 ++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .changeset/wicked-bananas-dream.md diff --git a/.changeset/wicked-bananas-dream.md b/.changeset/wicked-bananas-dream.md new file mode 100644 index 000000000..0a9097f9d --- /dev/null +++ b/.changeset/wicked-bananas-dream.md @@ -0,0 +1,5 @@ +--- +'@mysten/suins': minor +--- + +Update payments package to support buy back and burn diff --git a/packages/suins/src/constants.ts b/packages/suins/src/constants.ts index 433d560bd..925e408d0 100644 --- a/packages/suins/src/constants.ts +++ b/packages/suins/src/constants.ts @@ -31,7 +31,11 @@ export const mainPackage: Config = { packageId: '0xb162340524e0697461c307b9dc530c17e837b0f2c6d7f787da40d29d29681e5e', }, payments: { - packageId: '0x863d5f9760f302495398c8e4c6e9784bc17c44b079c826a1813715ef08cbe41a', + packageId: '0xdd0a4a34152a80d7841710e916a407b2a62961eee5b2188dcfdaa24194f66286', + }, + bbb: { + packageId: '0x6268d072063a311f6f0a1db516d06d97c06a3fa6d10e797cad578937a47b3992', + vault: '0x869f5100c0ecc0b35c7edad87ba3d488fd291bdba4a7aae84b70d188f440f393', }, pyth: { pythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8', @@ -69,7 +73,11 @@ export const mainPackage: Config = { packageId: '0x63029aae8abbefae4f4ac6c5e3e0021159ea93a94ba648681fd64caf5b40677a', }, payments: { - packageId: '0x9e8b85270cf5e7ec0ae44c745abe000b6dd7d8b54ca2d367e044d8baccefc10c', + packageId: '0xc391c200188dd1a363ff12dcffe07eaac5cf28ad1cd8dc0fcc18f2f8625f0da2', + }, + bbb: { + packageId: '0xed9b18147ca81c8f3f60192c8d0630574e42387cd200a6e39b3e4e07df1ce6e6', + vault: '0xa0b7a4dcbb85209c9096a4e0e85e43b716377c605743193abe915e9c9f3043e5', }, pyth: { pythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c', diff --git a/packages/suins/src/suins-transaction.ts b/packages/suins/src/suins-transaction.ts index d335293d3..127e9ab99 100644 --- a/packages/suins/src/suins-transaction.ts +++ b/packages/suins/src/suins-transaction.ts @@ -144,7 +144,12 @@ export class SuinsTransaction { const config = this.suinsClient.config; return this.transaction.moveCall({ target: `${config.payments.packageId}::payments::handle_base_payment`, - arguments: [this.transaction.object(config.suins), paymentIntent, payment], + arguments: [ + this.transaction.object(config.suins), + this.transaction.object(config.bbb.vault), + paymentIntent, + payment, + ], typeArguments: [paymentType], }); } @@ -161,6 +166,7 @@ export class SuinsTransaction { target: `${config.payments.packageId}::payments::handle_payment`, arguments: [ this.transaction.object(config.suins), + this.transaction.object(config.bbb.vault), paymentIntent, payment, this.transaction.object.clock(), diff --git a/packages/suins/src/types.ts b/packages/suins/src/types.ts index cf397ddc4..ee2eba87d 100644 --- a/packages/suins/src/types.ts +++ b/packages/suins/src/types.ts @@ -34,6 +34,10 @@ export interface PackageInfo { payments: { packageId: string; }; + bbb: { + packageId: string; + vault: string; + }; registryTableId?: string; pyth: { pythStateId: string; From ea13ae17483fc174fcade2302c296d0a73cd65e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Sep 2025 09:49:13 -0400 Subject: [PATCH 13/36] Version Packages (#561) Co-authored-by: github-actions[bot] --- .changeset/wicked-bananas-dream.md | 5 ----- packages/suins/CHANGELOG.md | 6 ++++++ packages/suins/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/wicked-bananas-dream.md diff --git a/.changeset/wicked-bananas-dream.md b/.changeset/wicked-bananas-dream.md deleted file mode 100644 index 0a9097f9d..000000000 --- a/.changeset/wicked-bananas-dream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/suins': minor ---- - -Update payments package to support buy back and burn diff --git a/packages/suins/CHANGELOG.md b/packages/suins/CHANGELOG.md index 368148794..e39e4490a 100644 --- a/packages/suins/CHANGELOG.md +++ b/packages/suins/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/suins +## 0.9.0 + +### Minor Changes + +- c88feaa: Update payments package to support buy back and burn + ## 0.8.0 ### Minor Changes diff --git a/packages/suins/package.json b/packages/suins/package.json index 2c76a2748..426e31973 100644 --- a/packages/suins/package.json +++ b/packages/suins/package.json @@ -2,7 +2,7 @@ "name": "@mysten/suins", "author": "Mysten Labs ", "description": "SuiNS SDK", - "version": "0.8.0", + "version": "0.9.0", "license": "Apache-2.0", "private": false, "type": "commonjs", From 4c53e73e35abf8fc613f84fd7461142473ec1820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Lindstr=C3=B8m?= Date: Fri, 26 Sep 2025 09:19:40 +0200 Subject: [PATCH 14/36] =?UTF-8?q?[seal]=C2=A0Check=20for=20little-endian?= =?UTF-8?q?=20encoding=20for=20BLS=20scalars=20(#560)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Check for little-endian encoding for BLS scalars * changeset * use raw functions * Update .changeset/bitter-actors-matter.md Co-authored-by: benr-ml <112846738+benr-ml@users.noreply.github.com> * Check with both encodings * clean up * simplify * errs * unit tests * more tests * Also add le nonce check when consistency is checked (although it'll probably fail) * default * default * error in elgamal * No default values * Fix versions + more tests * Fix unit tests and throw errors on invalid points * lock * changeset * docs * Handle invalid randomness * release notes * Update .changeset/bitter-actors-matter.md Co-authored-by: benr-ml <112846738+benr-ml@users.noreply.github.com> * Name + clean up * manypkg warning * lint * Changeset + revert lock * comment * simplify + lint * docs * docs * lint --------- Co-authored-by: benr-ml <112846738+benr-ml@users.noreply.github.com> --- .changeset/bitter-actors-matter.md | 6 ++ packages/seal/src/bls12381.ts | 67 ++++++++----- packages/seal/src/client.ts | 18 +++- packages/seal/src/decrypt.ts | 11 ++- packages/seal/src/elgamal.ts | 2 + packages/seal/src/ibe.ts | 62 ++++++++++-- packages/seal/src/types.ts | 2 + packages/seal/test/unit/bls12381.test.ts | 102 ++++++++++++++++++++ packages/seal/test/unit/encrypt.test.ts | 4 +- packages/seal/test/unit/integration.test.ts | 69 +++++++++++++ 10 files changed, 306 insertions(+), 37 deletions(-) create mode 100644 .changeset/bitter-actors-matter.md create mode 100644 packages/seal/test/unit/bls12381.test.ts diff --git a/.changeset/bitter-actors-matter.md b/.changeset/bitter-actors-matter.md new file mode 100644 index 000000000..902d4826f --- /dev/null +++ b/.changeset/bitter-actors-matter.md @@ -0,0 +1,6 @@ +--- +'@mysten/seal': minor +--- + +Force scalar encoding in BLS to big-endian since versions >=1.9.6 of noble/curves changed the default encoding to little-endian. +Encryptions created by previous versions of Seal SDK and with noble/curves versions >=1.9.6 might fail to `decrypt` with the default call arguments. In case you need to decrypt such ciphertexts, set `checkShareConsistency=false` and `checkLEEncoding=true` on `DecryptOptions`. diff --git a/packages/seal/src/bls12381.ts b/packages/seal/src/bls12381.ts index 5d31eec3f..bc821db91 100644 --- a/packages/seal/src/bls12381.ts +++ b/packages/seal/src/bls12381.ts @@ -1,26 +1,30 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { toHex } from '@mysten/bcs'; import type { Fp2, Fp12 } from '@noble/curves/abstract/tower'; -import type { ProjPointType } from '@noble/curves/abstract/weierstrass'; -import { bls12_381 } from '@noble/curves/bls12-381'; +import type { WeierstrassPoint } from '@noble/curves/abstract/weierstrass'; +import { bls12_381, bls12_381_Fr } from '@noble/curves/bls12-381'; +import { bytesToNumberBE, bytesToNumberLE, numberToBytesBE } from '@noble/curves/utils'; export class G1Element { - point: ProjPointType; + point: WeierstrassPoint; public static readonly SIZE = 48; - constructor(point: ProjPointType) { + constructor(point: WeierstrassPoint) { this.point = point; } static generator(): G1Element { - return new G1Element(bls12_381.G1.ProjectivePoint.BASE); + return new G1Element(bls12_381.G1.Point.BASE); } static fromBytes(bytes: Uint8Array): G1Element { - return new G1Element(bls12_381.G1.ProjectivePoint.fromHex(toHex(bytes))); + try { + return new G1Element(bls12_381.G1.Point.fromBytes(bytes)); + } catch { + throw new Error('Invalid G1 point'); + } } toBytes(): Uint8Array { @@ -40,9 +44,7 @@ export class G1Element { } static hashToCurve(data: Uint8Array): G1Element { - return new G1Element( - bls12_381.G1.ProjectivePoint.fromAffine(bls12_381.G1.hashToCurve(data).toAffine()), - ); + return new G1Element(bls12_381.G1.Point.fromAffine(bls12_381.G1.hashToCurve(data).toAffine())); } pairing(other: G2Element): GTElement { @@ -51,20 +53,24 @@ export class G1Element { } export class G2Element { - point: ProjPointType; + point: WeierstrassPoint; public static readonly SIZE = 96; - constructor(point: ProjPointType) { + constructor(point: WeierstrassPoint) { this.point = point; } static generator(): G2Element { - return new G2Element(bls12_381.G2.ProjectivePoint.BASE); + return new G2Element(bls12_381.G2.Point.BASE); } static fromBytes(bytes: Uint8Array): G2Element { - return new G2Element(bls12_381.G2.ProjectivePoint.fromHex(toHex(bytes))); + try { + return new G2Element(bls12_381.G2.Point.fromBytes(bytes)); + } catch { + throw new Error('Invalid G2 point'); + } } toBytes(): Uint8Array { @@ -80,9 +86,7 @@ export class G2Element { } static hashToCurve(data: Uint8Array): G2Element { - return new G2Element( - bls12_381.G2.ProjectivePoint.fromAffine(bls12_381.G2.hashToCurve(data).toAffine()), - ); + return new G2Element(bls12_381.G2.Point.fromAffine(bls12_381.G2.hashToCurve(data).toAffine())); } equals(other: G2Element): boolean { @@ -138,19 +142,36 @@ export class Scalar { this.scalar = scalar; } + static fromBigint(scalar: bigint): Scalar { + if (scalar < 0n || scalar >= bls12_381.fields.Fr.ORDER) { + throw new Error('Scalar out of range'); + } + return new Scalar(scalar); + } + static random(): Scalar { - return Scalar.fromBytes(bls12_381.utils.randomPrivateKey()); + const randomSecretKey = bls12_381.utils.randomSecretKey(); + if (bls12_381_Fr.isLE) { + return Scalar.fromBytesLE(randomSecretKey)!; + } + return Scalar.fromBytes(randomSecretKey)!; } - toBytes(): Uint8Array { - return new Uint8Array(bls12_381.fields.Fr.toBytes(this.scalar)) as Uint8Array; + toBytes(): Uint8Array { + return numberToBytesBE(this.scalar, Scalar.SIZE); } static fromBytes(bytes: Uint8Array): Scalar { - return new Scalar(bls12_381.fields.Fr.fromBytes(bytes)); + if (bytes.length !== Scalar.SIZE) { + throw new Error('Invalid scalar length'); + } + return this.fromBigint(bytesToNumberBE(bytes)); } - static fromNumber(num: number): Scalar { - return new Scalar(BigInt(num)); + static fromBytesLE(bytes: Uint8Array): Scalar { + if (bytes.length !== Scalar.SIZE) { + throw new Error('Invalid scalar length'); + } + return this.fromBigint(bytesToNumberLE(bytes)); } } diff --git a/packages/seal/src/client.ts b/packages/seal/src/client.ts index 193280044..9f0e51779 100644 --- a/packages/seal/src/client.ts +++ b/packages/seal/src/client.ts @@ -155,9 +155,16 @@ export class SealClient { * @param sessionKey - The session key to use. * @param txBytes - The transaction bytes to use (that calls seal_approve* functions). * @param checkShareConsistency - If true, the shares are checked for consistency. + * @param checkLEEncoding - If true, the encryption is also checked using an LE encoded nonce. * @returns - The decrypted plaintext corresponding to ciphertext. */ - async decrypt({ data, sessionKey, txBytes, checkShareConsistency }: DecryptOptions) { + async decrypt({ + data, + sessionKey, + txBytes, + checkShareConsistency, + checkLEEncoding, + }: DecryptOptions) { const encryptedObject = EncryptedObject.parse(data); this.#validateEncryptionServices( @@ -176,9 +183,14 @@ export class SealClient { const publicKeys = await this.getPublicKeys( encryptedObject.services.map(([objectId, _]) => objectId), ); - return decrypt({ encryptedObject, keys: this.#cachedKeys, publicKeys }); + return decrypt({ + encryptedObject, + keys: this.#cachedKeys, + publicKeys, + checkLEEncoding: false, // We intentionally do not support other encodings here + }); } - return decrypt({ encryptedObject, keys: this.#cachedKeys }); + return decrypt({ encryptedObject, keys: this.#cachedKeys, checkLEEncoding }); } #weight(objectId: string) { diff --git a/packages/seal/src/decrypt.ts b/packages/seal/src/decrypt.ts index 7db806b8b..db0d27647 100644 --- a/packages/seal/src/decrypt.ts +++ b/packages/seal/src/decrypt.ts @@ -8,7 +8,12 @@ import type { G1Element } from './bls12381.js'; import { G2Element } from './bls12381.js'; import { AesGcm256, Hmac256Ctr } from './dem.js'; import { InvalidCiphertextError, UnsupportedFeatureError } from './error.js'; -import { BonehFranklinBLS12381Services, decryptRandomness, verifyNonce } from './ibe.js'; +import { + BonehFranklinBLS12381Services, + decryptRandomness, + verifyNonce, + verifyNonceWithLE, +} from './ibe.js'; import { deriveKey, KeyPurpose } from './kdf.js'; import type { KeyCacheKey } from './types.js'; import { createFullId, equals } from './utils.js'; @@ -18,6 +23,7 @@ export interface DecryptOptions { encryptedObject: typeof EncryptedObject.$inferType; keys: Map; publicKeys?: G2Element[]; + checkLEEncoding?: boolean; } /** @@ -35,6 +41,7 @@ export async function decrypt({ encryptedObject, keys, publicKeys, + checkLEEncoding, }: DecryptOptions): Promise { if (!encryptedObject.encryptedShares.BonehFranklinBLS12381) { throw new UnsupportedFeatureError('Encryption mode not supported'); @@ -91,7 +98,7 @@ export async function decrypt({ ); // Verify that the nonce was created with the randomness. - if (!verifyNonce(nonce, randomness)) { + if (!(checkLEEncoding ? verifyNonceWithLE(nonce, randomness) : verifyNonce(nonce, randomness))) { throw new InvalidCiphertextError('Invalid nonce'); } diff --git a/packages/seal/src/elgamal.ts b/packages/seal/src/elgamal.ts index 66ca72c1f..875581bdb 100644 --- a/packages/seal/src/elgamal.ts +++ b/packages/seal/src/elgamal.ts @@ -6,6 +6,8 @@ import { G1Element, G2Element, Scalar } from './bls12381.js'; /** * Decrypt a ciphertext with a given secret key. The secret key must be a 32-byte scalar. * The ciphertext is a pair of G1Elements (48 bytes). + * + * Throws an error if the secret key is not a valid scalar or if the ciphertext elements are not valid G1 points. */ export function elgamalDecrypt(sk: Uint8Array, [c0, c1]: [Uint8Array, Uint8Array]): Uint8Array { return decrypt(Scalar.fromBytes(sk), [ diff --git a/packages/seal/src/ibe.ts b/packages/seal/src/ibe.ts index 47ffd1a6c..dc4339561 100644 --- a/packages/seal/src/ibe.ts +++ b/packages/seal/src/ibe.ts @@ -10,6 +10,7 @@ import { deriveKey, hashToG1, kdf, KeyPurpose } from './kdf.js'; import type { KeyServer } from './key-server.js'; import { xor } from './utils.js'; import type { Share } from './shamir.js'; +import { InvalidCiphertextError } from './error.js'; /** * The domain separation tag for the signing proof of possession. @@ -131,7 +132,7 @@ export class BonehFranklinBLS12381Services extends IBEServers { * @returns All decrypted shares. */ static decryptAllSharesUsingRandomness( - randomness: Scalar, + randomness: Uint8Array, encryptedShares: Uint8Array[], services: [string, number][], publicKeys: G2Element[], @@ -141,7 +142,13 @@ export class BonehFranklinBLS12381Services extends IBEServers { if (publicKeys.length !== encryptedShares.length || publicKeys.length !== services.length) { throw new Error('The number of public keys, encrypted shares and services must be the same'); } - const gid_r = hashToG1(id).multiply(randomness); + let r; + try { + r = Scalar.fromBytes(randomness); + } catch { + throw new InvalidCiphertextError('Invalid randomness'); + } + const gid_r = hashToG1(id).multiply(r); return services.map(([objectId, index], i) => { return { index, @@ -184,13 +191,32 @@ function decap(nonce: G2Element, usk: G1Element): GTElement { /** * Verify that the given randomness was used to crate the nonce. + * Throws an error if the given randomness is invalid (not a BLS scalar). * * @param randomness - The randomness. * @param nonce - The nonce. + * @param useBE - Flag to indicate if BE encoding is used for the randomness. Defaults to true. * @returns True if the randomness was used to create the nonce, false otherwise. */ -export function verifyNonce(nonce: G2Element, randomness: Scalar): boolean { - return G2Element.generator().multiply(randomness).equals(nonce); +export function verifyNonce( + nonce: G2Element, + randomness: Uint8Array, + useBE: boolean = true, +): boolean { + try { + const r = decodeRandomness(randomness, useBE); + return G2Element.generator().multiply(r).equals(nonce); + } catch { + throw new InvalidCiphertextError('Invalid randomness'); + } +} + +function decodeRandomness(bytes: Uint8Array, useBE: boolean): Scalar { + if (useBE) { + return Scalar.fromBytes(bytes); + } else { + return Scalar.fromBytesLE(bytes); + } } /** @@ -198,11 +224,33 @@ export function verifyNonce(nonce: G2Element, randomness: Scalar): boolean { * * @param encrypted_randomness - The encrypted randomness. * @param derived_key - The derived key. - * @returns The randomness. + * @returns The randomness. Returns both the scalar interpreted in big-endian and little-endian encoding. */ export function decryptRandomness( encryptedRandomness: Uint8Array, randomnessKey: Uint8Array, -): Scalar { - return Scalar.fromBytes(xor(encryptedRandomness, randomnessKey)); +): Uint8Array { + return xor(encryptedRandomness, randomnessKey); +} + +/** + * Verify that the given randomness was used to crate the nonce. + * Check using both big-endian and little-endian encoding of the randomness. + * + * Throws an error if the nonce check doesn't pass using LE encoding _and_ the randomness is invalid as a BE encoded scalar. + * + * @param randomness - The randomness. + * @param nonce - The nonce. + * @returns True if the randomness was used to create the nonce using either LE or BE encoding, false otherwise. + */ +export function verifyNonceWithLE(nonce: G2Element, randomness: Uint8Array): boolean { + try { + // First try little-endian encoding + if (verifyNonce(nonce, randomness, false)) { + return true; + } + } catch { + // Ignore error and try big-endian encoding + } + return verifyNonce(nonce, randomness, true); } diff --git a/packages/seal/src/types.ts b/packages/seal/src/types.ts index 976a8a520..8155db0db 100644 --- a/packages/seal/src/types.ts +++ b/packages/seal/src/types.ts @@ -57,6 +57,8 @@ export interface DecryptOptions { txBytes: Uint8Array; /** Whether to check share consistency. */ checkShareConsistency?: boolean; + /** Whether to check also using an LE encoded nonce. */ + checkLEEncoding?: boolean; } export interface FetchKeysOptions { diff --git a/packages/seal/test/unit/bls12381.test.ts b/packages/seal/test/unit/bls12381.test.ts new file mode 100644 index 000000000..2491fb35c --- /dev/null +++ b/packages/seal/test/unit/bls12381.test.ts @@ -0,0 +1,102 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, expect, it } from 'vitest'; + +import { G1Element, G2Element, Scalar } from '../../src/bls12381'; +import { bls12_381 } from '@noble/curves/bls12-381'; +import { fromHex, toHex } from '@mysten/bcs'; + +describe('BLS12-381', () => { + it('Scalar encoding', () => { + const bytes = new Uint8Array([ + 38, 196, 73, 8, 169, 135, 223, 142, 36, 222, 81, 40, 235, 6, 33, 37, 228, 11, 43, 93, 234, 37, + 214, 125, 130, 138, 225, 251, 123, 98, 10, 19, + ]); + const expectedBE = + 17534694331877247445378328100165814381144285655212774018840362823117283920403n; + const expectedLE = + 8612292307471438173884862806171156776133559907408652485196507992924388705318n; + + const s1 = Scalar.fromBytesLE(bytes); + const s2 = Scalar.fromBytes(bytes); + expect(s1).toBeDefined(); + expect(s2).toBeDefined(); + expect(s1!.scalar).toEqual(expectedLE); + expect(s2!.scalar).toEqual(expectedBE); + expect(s2!.toBytes()).toEqual(bytes); + + expect(Scalar.fromBytesLE(new Uint8Array(Scalar.SIZE))).toBeDefined(); + expect(Scalar.fromBytes(new Uint8Array(Scalar.SIZE))).toBeDefined(); + + expect(() => Scalar.fromBytesLE(new Uint8Array([]))).toThrowError(); + expect(() => Scalar.fromBytes(new Uint8Array([]))).toThrowError(); + expect(() => Scalar.fromBytesLE(new Uint8Array([1, 2, 3]))).toThrowError(); + expect(() => Scalar.fromBytes(new Uint8Array([1, 2, 3]))).toThrowError(); + expect(() => Scalar.fromBytesLE(new Uint8Array(Scalar.SIZE + 1))).toThrowError(); + expect(() => Scalar.fromBytes(new Uint8Array(Scalar.SIZE + 1))).toThrowError(); + expect(() => Scalar.fromBytesLE(new Uint8Array(Scalar.SIZE - 1))).toThrowError(); + expect(() => Scalar.fromBytes(new Uint8Array(Scalar.SIZE - 1))).toThrowError(); + }); + + it('Canonical scalars', () => { + const ORDER = bls12_381.fields.Fr.ORDER; + expect(Scalar.fromBigint(0n)).toBeDefined(); + expect(Scalar.fromBigint(1n)).toBeDefined(); + expect(Scalar.fromBigint(ORDER - 1n)).toBeDefined(); + + expect(() => Scalar.fromBigint(-1n)).toThrowError(); + expect(() => Scalar.fromBigint(ORDER)).toThrowError(); + expect(() => Scalar.fromBigint(ORDER + 1n)).toThrowError(); + }); + + it('G1 encoding', () => { + expect(toHex(G1Element.generator().toBytes())).toEqual( + '97f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb', + ); + expect(G1Element.fromBytes(G1Element.generator().toBytes())).toEqual(G1Element.generator()); + + const sevenG = G1Element.generator().multiply(Scalar.fromBigint(7n)!); + expect(toHex(sevenG.toBytes())).toEqual( + 'b928f3beb93519eecf0145da903b40a4c97dca00b21f12ac0df3be9116ef2ef27b2ae6bcd4c5bc2d54ef5a70627efcb7', + ); + expect(G1Element.fromBytes(sevenG.toBytes())).toEqual(sevenG); + + // Invalid point (not on curve) + const invalidBytes = fromHex( + 'b928f3beb93519eecf0145da903b40a4c97dca00b21f12ac0df3be9116ef2ef27b2ae6bcd4c5bc2d54ef5a70627efcb6', + ); + expect(() => G1Element.fromBytes(invalidBytes)).toThrowError(); + + // Wrong length + const wrongLengthInput = fromHex( + 'b928f3beb93519eecf0145da903b40a4c97dca00b21f12ac0df3be9116ef2ef27b2ae6bcd4c5bc2d54ef5a70627efcb7ff', + ); + expect(() => G1Element.fromBytes(wrongLengthInput)).toThrowError(); + }); + + it('G2 encoding', () => { + expect(toHex(G2Element.generator().toBytes())).toEqual( + '93e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8', + ); + expect(G2Element.fromBytes(G2Element.generator().toBytes())).toEqual(G2Element.generator()); + + const sevenG = G2Element.generator().multiply(Scalar.fromBigint(7n)!); + expect(toHex(sevenG.toBytes())).toEqual( + '8d0273f6bf31ed37c3b8d68083ec3d8e20b5f2cc170fa24b9b5be35b34ed013f9a921f1cad1644d4bdb14674247234c8049cd1dbb2d2c3581e54c088135fef36505a6823d61b859437bfc79b617030dc8b40e32bad1fa85b9c0f368af6d38d3c', + ); + expect(G2Element.fromBytes(sevenG.toBytes())).toEqual(sevenG); + + // Invalid point (not on curve) + const invalidBytes = fromHex( + '8d0273f6bf31ed37c3b8d68083ec3d8e20b5f2cc170fa24b9b5be35b34ed013f9a921f1cad1644d4bdb14674247234c8049cd1dbb2d2c3581e54c088135fef36505a6823d61b859437bfc79b617030dc8b40e32bad1fa85b9c0f368af6d38d3d', + ); + expect(() => G2Element.fromBytes(invalidBytes)).toThrowError(); + + // Wrong length + const wrongLengthInput = fromHex( + '8d0273f6bf31ed37c3b8d68083ec3d8e20b5f2cc170fa24b9b5be35b34ed013f9a921f1cad1644d4bdb14674247234c8049cd1dbb2d2c3581e54c088135fef36505a6823d61b859437bfc79b617030dc8b40e32bad1fa85b9c0f368af6d38d3cff', + ); + expect(() => G2Element.fromBytes(wrongLengthInput)).toThrowError(); + }); +}); diff --git a/packages/seal/test/unit/encrypt.test.ts b/packages/seal/test/unit/encrypt.test.ts index 3a7b35832..2c7292209 100644 --- a/packages/seal/test/unit/encrypt.test.ts +++ b/packages/seal/test/unit/encrypt.test.ts @@ -277,9 +277,9 @@ describe('Seal encryption tests', () => { it('kdf regression test', () => { const x = G1Element.generator().pairing( - G2Element.generator().multiply(Scalar.fromNumber(12345)), + G2Element.generator().multiply(Scalar.fromBigint(12345n)!), ); - const nonce = G2Element.generator().multiply(Scalar.fromNumber(12345)); + const nonce = G2Element.generator().multiply(Scalar.fromBigint(12345n)!); const key = kdf( x, nonce, diff --git a/packages/seal/test/unit/integration.test.ts b/packages/seal/test/unit/integration.test.ts index 1cec8adef..d7ec1a766 100644 --- a/packages/seal/test/unit/integration.test.ts +++ b/packages/seal/test/unit/integration.test.ts @@ -316,6 +316,75 @@ describe('Integration test', () => { expect(decryptedData).toEqual(data); }); + it('test decryption with LE nonce', { timeout: 12000 }, async () => { + const whitelistId = '0xf770c0cdd00388c31ecfb815dd9cb41d6dcbebb1a6f766c02027c3bdcfdb2a21'; + const data = new Uint8Array([0, 1, 2, 3]); + + // This was created with a version of the Seal SDK where the 'noble/curves' version was >=1.9.6 and thus the scalars were encoded in LE. + const encryptedBytesWithLE = fromHex( + '008afa5d31dbaa0a8fb07082692940ca3d56b5e856c5126cb5a3693f0a4de63b8220f770c0cdd00388c31ecfb815dd9cb41d6dcbebb1a6f766c02027c3bdcfdb2a21023cf2a38f061ede3239c1629cb80a9be0e0676b1c15d34c94d104d4ba9d99076f0181aeaa8c25d2c912e1dc23b4372305b7a602c4ec4cc3e510963bc635e500aa37020100816cb541200bf806e462a4ebe2e04c0ddbe3f69ea13508886eb03d76f0e13ac6bc6bf736d56994a4b745d98c0f96a11a0bc4e83de053c7795b95f45ed3bd0c7afe304873958a1b1a10feeedb15b8ca1aacf9c0a79da941c0c67270b3a9c0bc6a025fb0433cca22f51ef88f3c9273169a2505b8eb09bf15ed1fc1ad98ba68c71424e5d915ca010f07add19b7a54584ec014885e5ca757ccc352d4c8cf4c1f3b66a318e5aaa3eb3cab741ded10abbcbc4e35ecd0d874e8b756551ad47383a566b3f6001418a7571fbbd6e240fd6863b533b2c18cf7b74b6d0100', + ); + + // This was created with a version of the Seal SDK where the 'noble/curves' version was <1.9.6 and thus the scalars were encoded in BE (as expected). + const encryptedBytesWithBE = fromHex( + '008afa5d31dbaa0a8fb07082692940ca3d56b5e856c5126cb5a3693f0a4de63b8220f770c0cdd00388c31ecfb815dd9cb41d6dcbebb1a6f766c02027c3bdcfdb2a21023cf2a38f061ede3239c1629cb80a9be0e0676b1c15d34c94d104d4ba9d99076f0181aeaa8c25d2c912e1dc23b4372305b7a602c4ec4cc3e510963bc635e500aa37020100b9fa32e74dcc2a7a785907ac92a32117a695aed1931116e8915899985a3757c2bbdc3f163f97af2f712f4afc798db6d20c96f1c00415ad417ab90962a6b48c8e89123ac10a9b29dfc5175cd611e21fd64513789fb333271278c19b02573f148f02a5dfc8cb6040286eed7765b25ab938e4510e5f62a2c90a5a78e7ec7efbbe70a58fae83d140fe474d599e30d40b949df525e86dafdc25bedf883c026a3d3543b87ed5dbf0af5f2a89b296fa1205f88239fa1c1627e63f88c2c7ad20e7c479dcf900149b06d038004ced64cf18410a2ea25f4ac7c2a3630100', + ); + + const client = new SealClient({ + suiClient, + serverConfigs: objectIds, + verifyKeyServers: false, + }); + + const txBytes = await constructTxBytes(TESTNET_PACKAGE_ID, 'allowlist', suiClient, [ + whitelistId, + ]); + + const sessionKey = await SessionKey.create({ + address: suiAddress, + packageId: TESTNET_PACKAGE_ID, + ttlMin: 10, + signer: keypair, + suiClient, + }); + + // Decryption without checkLENonce should fail + await expect( + client.decrypt({ + data: encryptedBytesWithLE, + sessionKey, + txBytes, + }), + ).rejects.toThrow(); + + // But if checkLENonce is true, it should succeed + await expect( + client.decrypt({ + data: encryptedBytesWithLE, + sessionKey, + txBytes, + checkLEEncoding: true, + }), + ).resolves.toEqual(data); + + // For an encrypted object with BE nonce, decryption should work regardless of checkLENonce + await expect( + client.decrypt({ + data: encryptedBytesWithBE, + sessionKey, + txBytes, + }), + ).resolves.toEqual(data); + await expect( + client.decrypt({ + data: encryptedBytesWithBE, + sessionKey, + txBytes, + checkLEEncoding: true, + }), + ).resolves.toEqual(data); + }); + it('test getDerivedKeys with MVR name', { timeout: 12000 }, async () => { // Both whitelists contain address 0xb743cafeb5da4914cef0cf0a32400c9adfedc5cdb64209f9e740e56d23065100 const packageId = '0xc5ce2742cac46421b62028557f1d7aea8a4c50f651379a79afdf12cd88628807'; From bac074d2a8a57673f18f0ccc1922b1d82ca0ae5a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 09:45:10 +0200 Subject: [PATCH 15/36] Version Packages (#564) Co-authored-by: github-actions[bot] --- .changeset/bitter-actors-matter.md | 6 ------ packages/seal/CHANGELOG.md | 10 ++++++++++ packages/seal/package.json | 2 +- packages/seal/src/version.ts | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 .changeset/bitter-actors-matter.md diff --git a/.changeset/bitter-actors-matter.md b/.changeset/bitter-actors-matter.md deleted file mode 100644 index 902d4826f..000000000 --- a/.changeset/bitter-actors-matter.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@mysten/seal': minor ---- - -Force scalar encoding in BLS to big-endian since versions >=1.9.6 of noble/curves changed the default encoding to little-endian. -Encryptions created by previous versions of Seal SDK and with noble/curves versions >=1.9.6 might fail to `decrypt` with the default call arguments. In case you need to decrypt such ciphertexts, set `checkShareConsistency=false` and `checkLEEncoding=true` on `DecryptOptions`. diff --git a/packages/seal/CHANGELOG.md b/packages/seal/CHANGELOG.md index 0069b2298..369633c55 100644 --- a/packages/seal/CHANGELOG.md +++ b/packages/seal/CHANGELOG.md @@ -1,5 +1,15 @@ # @mysten/seal +## 0.8.0 + +### Minor Changes + +- 4c53e73: Force scalar encoding in BLS to big-endian since versions >=1.9.6 of noble/curves changed + the default encoding to little-endian. Encryptions created by previous versions of Seal SDK and + with noble/curves versions >=1.9.6 might fail to `decrypt` with the default call arguments. In + case you need to decrypt such ciphertexts, set `checkShareConsistency=false` and + `checkLEEncoding=true` on `DecryptOptions`. + ## 0.7.0 ### Minor Changes diff --git a/packages/seal/package.json b/packages/seal/package.json index ebe20ec42..b3d768fe0 100644 --- a/packages/seal/package.json +++ b/packages/seal/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/seal", - "version": "0.7.0", + "version": "0.8.0", "description": "Seal SDK", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/seal/src/version.ts b/packages/seal/src/version.ts index c46acd68e..268516eaa 100644 --- a/packages/seal/src/version.ts +++ b/packages/seal/src/version.ts @@ -3,4 +3,4 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '0.7.0'; +export const PACKAGE_VERSION = '0.8.0'; From 7d8bc0812c2c7e646e4fc56e7f4fcf196150b3b2 Mon Sep 17 00:00:00 2001 From: Tony Lee Date: Mon, 29 Sep 2025 13:48:49 -0400 Subject: [PATCH 16/36] Deepbook core contract functions (#566) * temp fix * manager function updates * mint and set referral * cleanup * more referral functions * register manager and init map * balance manager ids * referral owner * ewma setting params * enable state * new package * final functions * referral balances * cleanup * update dep * revert testing changes * changeset * cleanup * update definition * typo --- .changeset/cyan-eels-say.md | 5 + packages/deepbook-v3/src/client.ts | 78 + .../src/transactions/balanceManager.ts | 78 +- .../deepbook-v3/src/transactions/deepbook.ts | 165 +- .../src/transactions/deepbookAdmin.ts | 65 +- packages/deepbook-v3/src/types/index.ts | 6 + packages/deepbook-v3/src/utils/constants.ts | 2 +- pnpm-lock.yaml | 1398 ++++++++++++----- 8 files changed, 1358 insertions(+), 439 deletions(-) create mode 100644 .changeset/cyan-eels-say.md diff --git a/.changeset/cyan-eels-say.md b/.changeset/cyan-eels-say.md new file mode 100644 index 000000000..4a11a1709 --- /dev/null +++ b/.changeset/cyan-eels-say.md @@ -0,0 +1,5 @@ +--- +'@mysten/deepbook-v3': minor +--- + +Support core package upgrade changes on testnet diff --git a/packages/deepbook-v3/src/client.ts b/packages/deepbook-v3/src/client.ts index 1acd35911..8ffefb916 100644 --- a/packages/deepbook-v3/src/client.ts +++ b/packages/deepbook-v3/src/client.ts @@ -666,4 +666,82 @@ export class DeepBookClient { return { isBid, price, orderId }; } + + /** + * @description Get all balance manager IDs for a given owner + * @param {string} owner The owner address to get balance manager IDs for + * @returns {Promise} Array of balance manager ID strings + */ + async getBalanceManagerIds(owner: string): Promise { + const tx = new Transaction(); + tx.add(this.deepBook.getBalanceManagerIds(owner)); + + const res = await this.client.devInspectTransactionBlock({ + sender: normalizeSuiAddress(this.#address), + transactionBlock: tx, + }); + + const bytes = res.results![0].returnValues![0][0]; + const vecOfAddresses = bcs.vector(bcs.Address).parse(new Uint8Array(bytes)); + + return vecOfAddresses.map((id: string) => normalizeSuiAddress(id)); + } + + /** + * @description Get the owner of the referral + * @param {string} referral The ID of the referral to get the owner of + * @returns {Promise} The owner of the referral + */ + async referralOwner(referral: string) { + const tx = new Transaction(); + tx.add(this.balanceManager.referralOwner(referral)); + + const res = await this.client.devInspectTransactionBlock({ + sender: normalizeSuiAddress(this.#address), + transactionBlock: tx, + }); + + const bytes = res.results![0].returnValues![0][0]; + const owner = bcs.Address.parse(new Uint8Array(bytes)); + + return owner; + } + + /** + * @description Get the referral balances for a pool and referral + * @param {string} poolKey Key of the pool + * @param {string} referral The referral ID to get balances for + * @returns {Promise<{ base: number, quote: number, deep: number }>} Object with base, quote, and deep balances + */ + async getReferralBalances( + poolKey: string, + referral: string, + ): Promise<{ base: number; quote: number; deep: number }> { + const tx = new Transaction(); + const pool = this.#config.getPool(poolKey); + const baseScalar = this.#config.getCoin(pool.baseCoin).scalar; + const quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar; + + tx.add(this.deepBook.getReferralBalances(poolKey, referral)); + + const res = await this.client.devInspectTransactionBlock({ + sender: normalizeSuiAddress(this.#address), + transactionBlock: tx, + }); + + // The function returns three u64 values: (base, quote, deep) + const baseBytes = res.results![0].returnValues![0][0]; + const quoteBytes = res.results![0].returnValues![1][0]; + const deepBytes = res.results![0].returnValues![2][0]; + + const baseBalance = Number(bcs.U64.parse(new Uint8Array(baseBytes))); + const quoteBalance = Number(bcs.U64.parse(new Uint8Array(quoteBytes))); + const deepBalance = Number(bcs.U64.parse(new Uint8Array(deepBytes))); + + return { + base: baseBalance / baseScalar, + quote: quoteBalance / quoteScalar, + deep: deepBalance / DEEP_SCALAR, + }; + } } diff --git a/packages/deepbook-v3/src/transactions/balanceManager.ts b/packages/deepbook-v3/src/transactions/balanceManager.ts index 02c42a16d..13605ad07 100644 --- a/packages/deepbook-v3/src/transactions/balanceManager.ts +++ b/packages/deepbook-v3/src/transactions/balanceManager.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { coinWithBalance } from '@mysten/sui/transactions'; -import type { Transaction } from '@mysten/sui/transactions'; +import type { Transaction, TransactionArgument } from '@mysten/sui/transactions'; import type { DeepBookConfig } from '../utils/config.js'; @@ -35,15 +35,35 @@ export class BalanceManagerContract { }; /** - * @description Create and share a new BalanceManager, manually set the owner + * @description Create a new BalanceManager, manually set the owner. Returns the manager. * @returns A function that takes a Transaction object */ - createAndShareBalanceManagerWithOwner = (ownerAddress: string) => (tx: Transaction) => { - const manager = tx.moveCall({ + createBalanceManagerWithOwner = (ownerAddress: string) => (tx: Transaction) => { + return tx.moveCall({ target: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new_with_custom_owner`, arguments: [tx.pure.address(ownerAddress)], }); + }; + + /** + * @description Create a new BalanceManager, manually set the owner. Returns the manager, depositCap, withdrawCap, and tradeCap. + * @returns A function that takes a Transaction object + */ + createBalanceManagerWithOwnerAndCaps = (ownerAddress: string) => (tx: Transaction) => { + const [manager, depositCap, withdrawCap, tradeCap] = tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new_with_custom_owner_and_caps`, + arguments: [tx.pure.address(ownerAddress)], + }); + + return { manager, depositCap, withdrawCap, tradeCap }; + }; + /** + * @description Share the BalanceManager + * @param {TransactionArgument} manager The BalanceManager to share + * @returns A function that takes a Transaction object + */ + shareBalanceManager = (manager: TransactionArgument) => (tx: Transaction) => { tx.moveCall({ target: '0x2::transfer::public_share_object', arguments: [manager], @@ -270,6 +290,44 @@ export class BalanceManagerContract { }); }; + /** + * @description Set the referral for the BalanceManager + * @param {string} managerKey The name of the BalanceManager + * @param {string} referral The referral to set the BalanceManager to + * @param {TransactionArgument} tradeCap The tradeCap for permission checking + * @returns A function that takes a Transaction object + */ + setReferral = + (managerKey: string, referral: string, tradeCap: TransactionArgument) => (tx: Transaction) => { + const managerId = this.#config.getBalanceManager(managerKey).address; + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::set_referral`, + arguments: [tx.object(managerId), tx.object(referral), tradeCap], + }); + }; + + /** + * @description Unset the referral for the BalanceManager + * @param {string} managerKey The name of the BalanceManager + * @param {TransactionArgument} tradeCap The tradeCap for permission checking + * @returns A function that takes a Transaction object + */ + unsetReferral = (managerKey: string, tradeCap: TransactionArgument) => (tx: Transaction) => { + const managerId = this.#config.getBalanceManager(managerKey).address; + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::unset_referral`, + arguments: [tx.object(managerId), tradeCap], + }); + }; + + registerManager = (managerKey: string) => (tx: Transaction) => { + const managerId = this.#config.getBalanceManager(managerKey).address; + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::register_manager`, + arguments: [tx.object(managerId), tx.object(this.#config.REGISTRY_ID)], + }); + }; + /** * @description Get the owner of the BalanceManager * @param {string} managerKey The key of the BalanceManager @@ -295,4 +353,16 @@ export class BalanceManagerContract { arguments: [tx.object(managerId)], }); }; + + /** + * @description Get the owner of the referral + * @param {string} referral_id The ID of the referral to get the owner of + * @returns A function that takes a Transaction object + */ + referralOwner = (referral_id: string) => (tx: Transaction) => { + return tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::referral_owner`, + arguments: [tx.object(referral_id)], + }); + }; } diff --git a/packages/deepbook-v3/src/transactions/deepbook.ts b/packages/deepbook-v3/src/transactions/deepbook.ts index b6e591007..926eb4f96 100644 --- a/packages/deepbook-v3/src/transactions/deepbook.ts +++ b/packages/deepbook-v3/src/transactions/deepbook.ts @@ -279,6 +279,81 @@ export class DeepBookContract { }); }; + /** + * @description Mint a referral for a pool + * @param {string} poolKey The key to identify the pool + * @param {number} multiplier The multiplier for the referral + * @returns A function that takes a Transaction object + */ + mintReferral = (poolKey: string, multiplier: number) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const adjustedNumber = Math.round(multiplier * FLOAT_SCALAR); + + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::mint_referral`, + arguments: [tx.object(pool.address), tx.pure.u64(adjustedNumber)], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Update the referral multiplier for a pool + * @param {string} poolKey The key to identify the pool + * @param {number} multiplier The multiplier for the referral + * @returns A function that takes a Transaction object + */ + updateReferralMultiplier = + (poolKey: string, referral: string, multiplier: number) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const adjustedNumber = Math.round(multiplier * FLOAT_SCALAR); + + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_referral_multiplier`, + arguments: [tx.object(pool.address), tx.object(referral), tx.pure.u64(adjustedNumber)], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Claim the rewards for a referral + * @param {string} poolKey The key to identify the pool + * @param {string} referral The referral to claim the rewards for + * @returns A function that takes a Transaction object + */ + claimReferralRewards = (poolKey: string, referral: string) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + + const [baseRewards, quoteRewards, deepRewards] = tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::claim_referral_rewards`, + arguments: [tx.object(pool.address), tx.object(referral)], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + + return { baseRewards, quoteRewards, deepRewards }; + }; + + /** + * @description Update the allowed versions for a pool + * @param {string} poolKey The key of the pool to be updated + * @returns A function that takes a Transaction object + */ + updatePoolAllowedVersions = (poolKey: string) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_pool_allowed_versions`, + arguments: [tx.object(pool.address), tx.object(this.#config.REGISTRY_ID)], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + /** * @description Gets an order * @param {string} poolKey The key to identify the pool @@ -625,6 +700,45 @@ export class DeepBookContract { return [baseCoinResult, quoteCoinResult, deepCoinResult] as const; }; + /** + * @description Create a new pool permissionlessly + * @param {CreatePermissionlessPoolParams} params Parameters for creating permissionless pool + * @returns A function that takes a Transaction object + */ + createPermissionlessPool = (params: CreatePermissionlessPoolParams) => (tx: Transaction) => { + tx.setSenderIfNotSet(this.#config.address); + const { baseCoinKey, quoteCoinKey, tickSize, lotSize, minSize, deepCoin } = params; + const baseCoin = this.#config.getCoin(baseCoinKey); + const quoteCoin = this.#config.getCoin(quoteCoinKey); + const deepCoinType = this.#config.getCoin('DEEP').type; + + const baseScalar = baseCoin.scalar; + const quoteScalar = quoteCoin.scalar; + + const adjustedTickSize = Math.round((tickSize * FLOAT_SCALAR * quoteScalar) / baseScalar); + const adjustedLotSize = Math.round(lotSize * baseScalar); + const adjustedMinSize = Math.round(minSize * baseScalar); + + const deepCoinInput = + deepCoin ?? + coinWithBalance({ + type: deepCoinType, + balance: POOL_CREATION_FEE, + }); + + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::create_permissionless_pool`, + arguments: [ + tx.object(this.#config.REGISTRY_ID), // registry_id + tx.pure.u64(adjustedTickSize), // adjusted tick_size + tx.pure.u64(adjustedLotSize), // adjusted lot_size + tx.pure.u64(adjustedMinSize), // adjusted min_size + deepCoinInput, + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + /** * @description Get the trade parameters for a given pool, including taker fee, maker fee, and stake required. * @param {string} poolKey Key of the pool @@ -715,40 +829,31 @@ export class DeepBookContract { }; /** - * @description Create a new pool permissionlessly - * @param {CreatePermissionlessPoolParams} params Parameters for creating permissionless pool + * @description Get the balance manager IDs for a given owner + * @param {string} owner The owner address to get balance manager IDs for * @returns A function that takes a Transaction object */ - createPermissionlessPool = (params: CreatePermissionlessPoolParams) => (tx: Transaction) => { - tx.setSenderIfNotSet(this.#config.address); - const { baseCoinKey, quoteCoinKey, tickSize, lotSize, minSize, deepCoin } = params; - const baseCoin = this.#config.getCoin(baseCoinKey); - const quoteCoin = this.#config.getCoin(quoteCoinKey); - const deepCoinType = this.#config.getCoin('DEEP').type; - - const baseScalar = baseCoin.scalar; - const quoteScalar = quoteCoin.scalar; - - const adjustedTickSize = Math.round((tickSize * FLOAT_SCALAR * quoteScalar) / baseScalar); - const adjustedLotSize = Math.round(lotSize * baseScalar); - const adjustedMinSize = Math.round(minSize * baseScalar); + getBalanceManagerIds = (owner: string) => (tx: Transaction) => { + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::registry::get_balance_manager_ids`, + arguments: [tx.object(this.#config.REGISTRY_ID), tx.pure.address(owner)], + }); + }; - const deepCoinInput = - deepCoin ?? - coinWithBalance({ - type: deepCoinType, - balance: POOL_CREATION_FEE, - }); + /** + * @description Get the balances for a referral + * @param {string} poolKey The key to identify the pool + * @param {string} referral The referral to get the balances for + * @returns A function that takes a Transaction object + */ + getReferralBalances = (poolKey: string, referral: string) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); - tx.moveCall({ - target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::create_permissionless_pool`, - arguments: [ - tx.object(this.#config.REGISTRY_ID), // registry_id - tx.pure.u64(adjustedTickSize), // adjusted tick_size - tx.pure.u64(adjustedLotSize), // adjusted lot_size - tx.pure.u64(adjustedMinSize), // adjusted min_size - deepCoinInput, - ], + return tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_referral_balances`, + arguments: [tx.object(pool.address), tx.object(referral)], typeArguments: [baseCoin.type, quoteCoin.type], }); }; diff --git a/packages/deepbook-v3/src/transactions/deepbookAdmin.ts b/packages/deepbook-v3/src/transactions/deepbookAdmin.ts index 8f979d461..589ac74bd 100644 --- a/packages/deepbook-v3/src/transactions/deepbookAdmin.ts +++ b/packages/deepbook-v3/src/transactions/deepbookAdmin.ts @@ -3,7 +3,7 @@ import type { Transaction } from '@mysten/sui/transactions'; -import type { CreatePoolAdminParams } from '../types/index.js'; +import type { CreatePoolAdminParams, SetEwmaParamsParams } from '../types/index.js'; import type { DeepBookConfig } from '../utils/config.js'; import { FLOAT_SCALAR } from '../utils/config.js'; @@ -242,4 +242,67 @@ export class DeepBookAdminContract { typeArguments: [baseCoin.type, quoteCoin.type], }); }; + + /** + * @description Initialize the balance manager map + * @returns A function that takes a Transaction object + */ + initBalanceManagerMap = () => (tx: Transaction) => { + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::registry::init_balance_manager_map`, + arguments: [tx.object(this.#config.REGISTRY_ID), tx.object(this.#adminCap())], + }); + }; + + /** + * @description Set the EWMA parameters for a pool + * @param {string} poolKey The key to identify the pool + * @param {SetEwmaParamsParams} params The parameters to set + * @returns A function that takes a Transaction object + */ + setEwmaParams = (poolKey: string, params: SetEwmaParamsParams) => (tx: Transaction) => { + const { alpha, zScoreThreshold, additionalTakerFee } = params; + const adjustedAlpha = Math.round(alpha * FLOAT_SCALAR); + const adjustedZScoreThreshold = Math.round(zScoreThreshold * FLOAT_SCALAR); + const adjustedAdditionalTakerFee = Math.round(additionalTakerFee * FLOAT_SCALAR); + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::set_ewma_params`, + arguments: [ + tx.object(pool.address), + tx.object(this.#adminCap()), + tx.pure.u64(adjustedAlpha), + tx.pure.u64(adjustedZScoreThreshold), + tx.pure.u64(adjustedAdditionalTakerFee), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Enable or disable the EWMA state for a pool + * @param {string} poolKey The key to identify the pool + * @param {boolean} enable Whether to enable or disable the EWMA state + * @returns A function that takes a Transaction object + */ + enableEwmaState = (poolKey: string, enable: boolean) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + + tx.moveCall({ + target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::enable_ewma_state`, + arguments: [ + tx.object(pool.address), + tx.object(this.#adminCap()), + tx.pure.bool(enable), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; } diff --git a/packages/deepbook-v3/src/types/index.ts b/packages/deepbook-v3/src/types/index.ts index e26599e28..68cff559c 100644 --- a/packages/deepbook-v3/src/types/index.ts +++ b/packages/deepbook-v3/src/types/index.ts @@ -98,6 +98,12 @@ export interface CreatePermissionlessPoolParams { deepCoin?: TransactionObjectArgument; } +export interface SetEwmaParamsParams { + alpha: number; + zScoreThreshold: number; + additionalTakerFee: number; +} + export interface Config { DEEPBOOK_PACKAGE_ID: string; REGISTRY_ID: string; diff --git a/packages/deepbook-v3/src/utils/constants.ts b/packages/deepbook-v3/src/utils/constants.ts index df108ddf1..33cb78cd1 100644 --- a/packages/deepbook-v3/src/utils/constants.ts +++ b/packages/deepbook-v3/src/utils/constants.ts @@ -12,7 +12,7 @@ export interface DeepbookPackageIds { } export const testnetPackageIds = { - DEEPBOOK_PACKAGE_ID: '0xa3886aaa8aa831572dd39549242ca004a438c3a55967af9f0387ad2b01595068', + DEEPBOOK_PACKAGE_ID: '0xc483dba510597205749f2e8410c23f19be31a710aef251f353bc1b97755efd4d', REGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1', DEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb', } satisfies DeepbookPackageIds; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cef0b9f56..2f3aacd70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: devDependencies: '@changesets/cli': specifier: ^2.29.6 - version: 2.29.6(@types/node@22.16.5) + version: 2.29.6(@types/node@22.18.6) '@ianvs/prettier-plugin-sort-imports': specifier: ^4.7.0 version: 4.7.0(@vue/compiler-sfc@3.5.21)(prettier@3.6.2) @@ -52,7 +52,7 @@ importers: version: 8.10.0(eslint@8.57.1) eslint-config-react-app: specifier: ^7.0.1 - version: 7.0.1(@babel/plugin-syntax-flow@7.26.0(@babel/core@7.28.4))(@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.28.4))(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1)(typescript@5.9.2) + version: 7.0.1(@babel/plugin-syntax-flow@7.26.0(@babel/core@7.28.4))(@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.28.4))(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1)(typescript@5.9.2) eslint-import-resolver-typescript: specifier: ^3.6.1 version: 3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1) @@ -76,7 +76,7 @@ importers: version: 3.2.0(@typescript-eslint/eslint-plugin@8.43.0(@typescript-eslint/parser@8.43.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1) graphql-config: specifier: ^5.1.5 - version: 5.1.5(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2) + version: 5.1.5(@types/node@22.18.6)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2) prettier: specifier: ^3.6.2 version: 3.6.2 @@ -119,7 +119,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/build-scripts: dependencies: @@ -255,7 +255,7 @@ importers: version: 8.43.0(eslint@9.17.0(jiti@2.5.1))(typescript@5.9.2) '@vitejs/plugin-react-swc': specifier: ^3.11.0 - version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 3.11.0(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) eslint: specifier: ^9.17.0 version: 9.17.0(jiti@2.5.1) @@ -273,7 +273,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/create-dapp/templates/react-e2e-counter: dependencies: @@ -319,7 +319,7 @@ importers: version: 8.43.0(eslint@9.17.0(jiti@2.5.1))(typescript@5.9.2) '@vitejs/plugin-react-swc': specifier: ^3.11.0 - version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 3.11.0(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) eslint: specifier: ^9.17.0 version: 9.17.0(jiti@2.5.1) @@ -337,7 +337,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit: dependencies: @@ -404,10 +404,10 @@ importers: version: 18.3.18 '@vanilla-extract/esbuild-plugin': specifier: ^2.3.18 - version: 2.3.18(babel-plugin-macros@3.1.0)(esbuild@0.25.9) + version: 2.3.18(babel-plugin-macros@3.1.0)(esbuild@0.25.10) '@vanilla-extract/vite-plugin': specifier: ^5.1.1 - version: 5.1.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1) + version: 5.1.1(@types/node@22.18.6)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1) happy-dom: specifier: ^18.0.1 version: 18.0.1 @@ -428,10 +428,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/examples/next-js/simple: dependencies: @@ -493,7 +493,7 @@ importers: version: 18.3.5(@types/react@18.3.18) '@vitejs/plugin-react': specifier: ^5.0.2 - version: 5.0.2(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 5.0.2(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) globals: specifier: ^16.3.0 version: 16.3.0 @@ -502,7 +502,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/examples/vanilla/simple: dependencies: @@ -518,7 +518,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/examples/vue/simple: dependencies: @@ -610,7 +610,7 @@ importers: version: 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2)) '@storybook/web-components-vite': specifier: ^8.6.12 - version: 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) storybook: specifier: ^8.6.12 version: 8.6.12(prettier@3.6.2) @@ -622,7 +622,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/dapp-kit-next/packages/dapp-kit-react: dependencies: @@ -706,13 +706,13 @@ importers: version: link:../codegen '@types/node': specifier: ^22.15.29 - version: 22.15.29 + version: 22.18.6 tmp: specifier: ^0.2.5 version: 0.2.5 ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.13.1)(@types/node@22.15.29)(typescript@5.9.2) + version: 10.9.2(@swc/core@1.13.1)(@types/node@22.18.6)(typescript@5.9.2) ts-retry-promise: specifier: ^0.8.1 version: 0.8.1 @@ -721,13 +721,13 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.15.29)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: specifier: ^8.0.4 - version: 8.0.4 + version: 8.0.5 packages/docs: dependencies: @@ -805,7 +805,7 @@ importers: version: 3.0.0(fumadocs-core@15.7.10(@types/react@18.3.18)(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) fumadocs-mdx: specifier: 11.9.0 - version: 11.9.0(fumadocs-core@15.7.10(@types/react@18.3.18)(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(vite@7.1.5(@types/node@22.15.29)(tsx@4.20.5)) + version: 11.9.0(fumadocs-core@15.7.10(@types/react@18.3.18)(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(vite@7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) fumadocs-typescript: specifier: ^4.0.6 version: 4.0.8(@types/react@18.3.18)(fumadocs-core@15.7.10(@types/react@18.3.18)(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(fumadocs-ui@15.7.10(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tailwindcss@4.1.13))(typescript@5.9.2) @@ -1010,7 +1010,7 @@ importers: version: 8.43.0(eslint@8.57.1)(typescript@5.9.2) '@vitejs/plugin-react-swc': specifier: ^3.11.0 - version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 3.11.0(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) eslint: specifier: ^8.45.0 version: 8.57.1 @@ -1028,7 +1028,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/graphql-transport: dependencies: @@ -1111,10 +1111,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: specifier: ^8.0.4 version: 8.0.4 @@ -1163,7 +1163,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wasm-pack: specifier: ^0.13.1 version: 0.13.1 @@ -1327,7 +1327,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/suins: dependencies: @@ -1355,10 +1355,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/suins-v2: dependencies: @@ -1383,10 +1383,10 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/typescript: dependencies: @@ -1514,7 +1514,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/wallet-standard: dependencies: @@ -1616,7 +1616,7 @@ importers: version: 8.43.0(eslint@8.57.1)(typescript@5.9.2) '@vitejs/plugin-react-swc': specifier: ^3.11.0 - version: 3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + version: 3.11.0(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) eslint: specifier: ^8.45.0 version: 8.57.1 @@ -1634,7 +1634,7 @@ importers: version: 5.9.2 vite: specifier: ^7.1.5 - version: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + version: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) packages/walrus: dependencies: @@ -1728,7 +1728,7 @@ importers: version: 5.9.2 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@22.16.5)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) packages/zksend: dependencies: @@ -2676,156 +2676,312 @@ packages: resolution: {integrity: sha512-CsFmA3u3c2QoLDTfEpGr4t25fjMU31nyvse7IzWTvb0ZycuPjMjb0fjlheh+PbhBYb9YLugnT2uY6Mwcg1o+Zg==} engines: {node: '>=18.0.0'} + '@esbuild/aix-ppc64@0.25.10': + resolution: {integrity: sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/aix-ppc64@0.25.9': resolution: {integrity: sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.25.10': + resolution: {integrity: sha512-LSQa7eDahypv/VO6WKohZGPSJDq5OVOo3UoFR1E4t4Gj1W7zEQMUhI+lo81H+DtB+kP+tDgBp+M4oNCwp6kffg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.25.9': resolution: {integrity: sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==} engines: {node: '>=18'} cpu: [arm64] os: [android] + '@esbuild/android-arm@0.25.10': + resolution: {integrity: sha512-dQAxF1dW1C3zpeCDc5KqIYuZ1tgAdRXNoZP7vkBIRtKZPYe2xVr/d3SkirklCHudW1B45tGiUlz2pUWDfbDD4w==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.25.9': resolution: {integrity: sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==} engines: {node: '>=18'} cpu: [arm] os: [android] + '@esbuild/android-x64@0.25.10': + resolution: {integrity: sha512-MiC9CWdPrfhibcXwr39p9ha1x0lZJ9KaVfvzA0Wxwz9ETX4v5CHfF09bx935nHlhi+MxhA63dKRRQLiVgSUtEg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.25.9': resolution: {integrity: sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==} engines: {node: '>=18'} cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.25.10': + resolution: {integrity: sha512-JC74bdXcQEpW9KkV326WpZZjLguSZ3DfS8wrrvPMHgQOIEIG/sPXEN/V8IssoJhbefLRcRqw6RQH2NnpdprtMA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.25.9': resolution: {integrity: sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.25.10': + resolution: {integrity: sha512-tguWg1olF6DGqzws97pKZ8G2L7Ig1vjDmGTwcTuYHbuU6TTjJe5FXbgs5C1BBzHbJ2bo1m3WkQDbWO2PvamRcg==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.25.9': resolution: {integrity: sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.25.10': + resolution: {integrity: sha512-3ZioSQSg1HT2N05YxeJWYR+Libe3bREVSdWhEEgExWaDtyFbbXWb49QgPvFH8u03vUPX10JhJPcz7s9t9+boWg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.25.9': resolution: {integrity: sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.25.10': + resolution: {integrity: sha512-LLgJfHJk014Aa4anGDbh8bmI5Lk+QidDmGzuC2D+vP7mv/GeSN+H39zOf7pN5N8p059FcOfs2bVlrRr4SK9WxA==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.25.9': resolution: {integrity: sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.25.10': + resolution: {integrity: sha512-5luJWN6YKBsawd5f9i4+c+geYiVEw20FVW5x0v1kEMWNq8UctFjDiMATBxLvmmHA4bf7F6hTRaJgtghFr9iziQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.25.9': resolution: {integrity: sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==} engines: {node: '>=18'} cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.25.10': + resolution: {integrity: sha512-oR31GtBTFYCqEBALI9r6WxoU/ZofZl962pouZRTEYECvNF/dtXKku8YXcJkhgK/beU+zedXfIzHijSRapJY3vg==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.25.9': resolution: {integrity: sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==} engines: {node: '>=18'} cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.25.10': + resolution: {integrity: sha512-NrSCx2Kim3EnnWgS4Txn0QGt0Xipoumb6z6sUtl5bOEZIVKhzfyp/Lyw4C1DIYvzeW/5mWYPBFJU3a/8Yr75DQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.25.9': resolution: {integrity: sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==} engines: {node: '>=18'} cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.25.10': + resolution: {integrity: sha512-xoSphrd4AZda8+rUDDfD9J6FUMjrkTz8itpTITM4/xgerAZZcFW7Dv+sun7333IfKxGG8gAq+3NbfEMJfiY+Eg==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.25.9': resolution: {integrity: sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==} engines: {node: '>=18'} cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.25.10': + resolution: {integrity: sha512-ab6eiuCwoMmYDyTnyptoKkVS3k8fy/1Uvq7Dj5czXI6DF2GqD2ToInBI0SHOp5/X1BdZ26RKc5+qjQNGRBelRA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.25.9': resolution: {integrity: sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.25.10': + resolution: {integrity: sha512-NLinzzOgZQsGpsTkEbdJTCanwA5/wozN9dSgEl12haXJBzMTpssebuXR42bthOF3z7zXFWH1AmvWunUCkBE4EA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.25.9': resolution: {integrity: sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.25.10': + resolution: {integrity: sha512-FE557XdZDrtX8NMIeA8LBJX3dC2M8VGXwfrQWU7LB5SLOajfJIxmSdyL/gU1m64Zs9CBKvm4UAuBp5aJ8OgnrA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.25.9': resolution: {integrity: sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.25.10': + resolution: {integrity: sha512-3BBSbgzuB9ajLoVZk0mGu+EHlBwkusRmeNYdqmznmMc9zGASFjSsxgkNsqmXugpPk00gJ0JNKh/97nxmjctdew==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.25.9': resolution: {integrity: sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==} engines: {node: '>=18'} cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.25.10': + resolution: {integrity: sha512-QSX81KhFoZGwenVyPoberggdW1nrQZSvfVDAIUXr3WqLRZGZqWk/P4T8p2SP+de2Sr5HPcvjhcJzEiulKgnxtA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.25.9': resolution: {integrity: sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==} engines: {node: '>=18'} cpu: [x64] os: [linux] + '@esbuild/netbsd-arm64@0.25.10': + resolution: {integrity: sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + '@esbuild/netbsd-arm64@0.25.9': resolution: {integrity: sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-x64@0.25.10': + resolution: {integrity: sha512-7RTytDPGU6fek/hWuN9qQpeGPBZFfB4zZgcz2VK2Z5VpdUxEI8JKYsg3JfO0n/Z1E/6l05n0unDCNc4HnhQGig==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.25.9': resolution: {integrity: sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] + '@esbuild/openbsd-arm64@0.25.10': + resolution: {integrity: sha512-5Se0VM9Wtq797YFn+dLimf2Zx6McttsH2olUBsDml+lm0GOCRVebRWUvDtkY4BWYv/3NgzS8b/UM3jQNh5hYyw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-arm64@0.25.9': resolution: {integrity: sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.25.10': + resolution: {integrity: sha512-XkA4frq1TLj4bEMB+2HnI0+4RnjbuGZfet2gs/LNs5Hc7D89ZQBHQ0gL2ND6Lzu1+QVkjp3x1gIcPKzRNP8bXw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.25.9': resolution: {integrity: sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] + '@esbuild/openharmony-arm64@0.25.10': + resolution: {integrity: sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + '@esbuild/openharmony-arm64@0.25.9': resolution: {integrity: sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] + '@esbuild/sunos-x64@0.25.10': + resolution: {integrity: sha512-fswk3XT0Uf2pGJmOpDB7yknqhVkJQkAQOcW/ccVOtfx05LkbWOaRAtn5SaqXypeKQra1QaEa841PgrSL9ubSPQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.25.9': resolution: {integrity: sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==} engines: {node: '>=18'} cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.25.10': + resolution: {integrity: sha512-ah+9b59KDTSfpaCg6VdJoOQvKjI33nTaQr4UluQwW7aEwZQsbMCfTmfEO4VyewOxx4RaDT/xCy9ra2GPWmO7Kw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.25.9': resolution: {integrity: sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==} engines: {node: '>=18'} cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.25.10': + resolution: {integrity: sha512-QHPDbKkrGO8/cz9LKVnJU22HOi4pxZnZhhA2HYHez5Pz4JeffhDjf85E57Oyco163GnzNCVkZK0b/n4Y0UHcSw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.25.9': resolution: {integrity: sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==} engines: {node: '>=18'} cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.25.10': + resolution: {integrity: sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.25.9': resolution: {integrity: sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==} engines: {node: '>=18'} @@ -3205,6 +3361,7 @@ packages: '@graphql-tools/prisma-loader@8.0.17': resolution: {integrity: sha512-fnuTLeQhqRbA156pAyzJYN0KxCjKYRU5bz1q/SKOwElSnAU4k7/G1kyVsWLh7fneY78LoMNH5n+KlFV8iQlnyg==} engines: {node: '>=16.0.0'} + deprecated: 'This package was intended to be used with an older versions of Prisma.\nThe newer versions of Prisma has a different approach to GraphQL integration.\nTherefore, this package is no longer needed and has been deprecated and removed.\nLearn more: https://www.prisma.io/graphql' peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 @@ -3276,12 +3433,32 @@ packages: engines: {node: '>=6'} hasBin: true + '@hapi/address@5.1.1': + resolution: {integrity: sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==} + engines: {node: '>=14.0.0'} + + '@hapi/formula@3.0.2': + resolution: {integrity: sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==} + + '@hapi/hoek@11.0.7': + resolution: {integrity: sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==} + '@hapi/hoek@9.3.0': resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} + '@hapi/pinpoint@2.0.1': + resolution: {integrity: sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==} + + '@hapi/tlds@1.1.3': + resolution: {integrity: sha512-QIvUMB5VZ8HMLZF9A2oWr3AFM430QC8oGd0L35y2jHpuW6bIIca6x/xL7zUf4J7L9WJ3qjz+iJII8ncaeMbpSg==} + engines: {node: '>=14.0.0'} + '@hapi/topo@5.1.0': resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@hapi/topo@6.0.2': + resolution: {integrity: sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==} + '@hey-api/codegen-core@0.0.1': resolution: {integrity: sha512-Q7vUF7n2gYSL6Z16XFweIm6O7uh9sBGty05X6T5lYBKTMv1K31P2iSTxyhzW04M2r/s3dAE1bCpW+h9di0Ux7w==} engines: {node: ^18.18.0 || ^20.9.0 || >=22.10.0} @@ -3381,78 +3558,92 @@ packages: resolution: {integrity: sha512-RXwd0CgG+uPRX5YYrkzKyalt2OJYRiJQ8ED/fi1tq9WQW2jsQIn0tqrlR5l5dr/rjqq6AHAxURhj2DVjyQWSOA==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.0': resolution: {integrity: sha512-mWd2uWvDtL/nvIzThLq3fr2nnGfyr/XMXlq8ZJ9WMR6PXijHlC3ksp0IpuhK6bougvQrchUAfzRLnbsen0Cqvw==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.0': resolution: {integrity: sha512-Xod/7KaDDHkYu2phxxfeEPXfVXFKx70EAFZ0qyUdOjCcxbjqyJOEUpDe6RIyaunGxT34Anf9ue/wuWOqBW2WcQ==} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.0': resolution: {integrity: sha512-eMKfzDxLGT8mnmPJTNMcjfO33fLiTDsrMlUVcp6b96ETbnJmd4uvZxVJSKPQfS+odwfVaGifhsB07J1LynFehw==} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.0': resolution: {integrity: sha512-ZW3FPWIc7K1sH9E3nxIGB3y3dZkpJlMnkk7z5tu1nSkBoCgw2nSRTFHI5pB/3CQaJM0pdzMF3paf9ckKMSE9Tg==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.0': resolution: {integrity: sha512-UG+LqQJbf5VJ8NWJ5Z3tdIe/HXjuIdo4JeVNADXBFuG7z9zjoegpzzGIyV5zQKi4zaJjnAd2+g2nna8TZvuW9Q==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.0': resolution: {integrity: sha512-SRYOLR7CXPgNze8akZwjoGBoN1ThNZoqpOgfnOxmWsklTGVfJiGJoC/Lod7aNMGA1jSsKWM1+HRX43OP6p9+6Q==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.34.3': resolution: {integrity: sha512-QdrKe3EvQrqwkDrtuTIjI0bu6YEJHTgEeqdzI3uWJOH6G1O8Nl1iEeVYRGdj1h5I21CqxSvQp1Yv7xeU3ZewbA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.34.3': resolution: {integrity: sha512-oBK9l+h6KBN0i3dC8rYntLiVfW8D8wH+NPNT3O/WBHeW0OQWCjfWksLUaPidsrDKpJgXp3G3/hkmhptAW0I3+A==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-ppc64@0.34.3': resolution: {integrity: sha512-GLtbLQMCNC5nxuImPR2+RgrviwKwVql28FWZIW1zWruy6zLgA5/x2ZXk3mxj58X/tszVF69KK0Is83V8YgWhLA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-linux-s390x@0.34.3': resolution: {integrity: sha512-3gahT+A6c4cdc2edhsLHmIOXMb17ltffJlxR0aC2VPZfwKoTGZec6u5GrFgdR7ciJSsHT27BD3TIuGcuRT0KmQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.34.3': resolution: {integrity: sha512-8kYso8d806ypnSq3/Ly0QEw90V5ZoHh10yH0HnrzOCr6DKAPI6QVHvwleqMkVQ0m+fc7EH8ah0BB0QPuWY6zJQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.3': resolution: {integrity: sha512-vAjbHDlr4izEiXM1OTggpCcPg9tn4YriK5vAjowJsHwdBIdx0fYRsURkxLG2RLm9gyBq66gwtWI8Gx0/ov+JKQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.34.3': resolution: {integrity: sha512-gCWUn9547K5bwvOn9l5XGAEjVTTRji4aPTqLzGXHvIr6bIDZKNTA34seMPgM0WmSf+RYBH411VavCejp3PkOeQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-wasm32@0.34.3': resolution: {integrity: sha512-+CyRcpagHMGteySaWos8IbnXcHgfDn7pO2fiC2slJxvNq9gDipYBN42/RagzctVRKgxATmfqOSulgZv5e1RdMg==} @@ -3557,9 +3748,6 @@ packages: '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} - '@jridgewell/sourcemap-codec@1.5.4': - resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==} - '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} @@ -3704,24 +3892,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@next/swc-linux-arm64-musl@15.5.2': resolution: {integrity: sha512-s6N8k8dF9YGc5T01UPQ08yxsK6fUow5gG1/axWc1HVVBYQBgOjca4oUZF7s4p+kwhkB1bDSGR8QznWrFZ/Rt5g==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@next/swc-linux-x64-gnu@15.5.2': resolution: {integrity: sha512-o1RV/KOODQh6dM6ZRJGZbc+MOAHww33Vbs5JC9Mp1gDk8cpEO+cYC/l7rweiEalkSm5/1WGa4zY7xrNwObN4+Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@next/swc-linux-x64-musl@15.5.2': resolution: {integrity: sha512-/VUnh7w8RElYZ0IV83nUcP/J4KJ6LLYliiBIri3p3aW2giF+PAVgZb6mk8jbQSB3WlTai8gEmCAr7kptFa1H6g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@next/swc-win32-arm64-msvc@15.5.2': resolution: {integrity: sha512-sMPyTvRcNKXseNQ/7qRfVRLa0VhR0esmQ29DD6pqvG71+JdVnESJaHPA8t7bc67KD5spP3+DOCNLhqlEI2ZgQg==} @@ -3795,8 +3987,8 @@ packages: resolution: {integrity: sha512-O0hdKt4K31i8fpq8Bw5RfdPVAqm0EdduBUcluPo2MRcfCOwUEf5JlnvRhf/J0ezOYOD8jQ/LumYZxOVi/XK/BA==} engines: {node: '>= 20.0.0'} - '@oxc-project/types@0.89.0': - resolution: {integrity: sha512-yuo+ECPIW5Q9mSeNmCDC2im33bfKuwW18mwkaHMQh8KakHYDzj4ci/q7wxf2qS3dMlVVCIyrs3kFtH5LmnlYnw==} + '@oxc-project/types@0.92.0': + resolution: {integrity: sha512-PDLfCbwgXjGdTBxzcuDOUxJYNBl6P8dOp3eDKWw54dYvqONan9rwGDRQU0zrkdEMiItfXQQUOI17uOcMX5Zm7A==} '@oxc-transform/binding-android-arm64@0.82.3': resolution: {integrity: sha512-25Wh8wRSVMNiGJHeT1kIOKynrXbMoSR5vkhL+j7GyXs+R7tA3Vah574NK86y7k8Ayz7bmddSepue+Mp4/B2bqg==} @@ -3839,36 +4031,42 @@ packages: engines: {node: '>=14.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-arm64-musl@0.82.3': resolution: {integrity: sha512-//hl3Xe36+fwyBrzKpTSMgSDqscbqpkeQ1TTvfkZS7IKuLoSM7lVbU+fpaOslDXUezLg9SwN6Cn2sL61OX7IaA==} engines: {node: '>=14.0.0'} cpu: [arm64] os: [linux] + libc: [musl] '@oxc-transform/binding-linux-riscv64-gnu@0.82.3': resolution: {integrity: sha512-iOPpMG0EAvOOZ048OdmuUhWV5NRXERDVj/+k5IUIOzXuxZSjrJK/NjirdpYnXXLMx3lDIm2muMR1ESg0f8eb+A==} engines: {node: '>=14.0.0'} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-s390x-gnu@0.82.3': resolution: {integrity: sha512-pdgFqoFoqs6JNoaV540RZSMq4uaArlL1ZnjT1rsL662K4CejOAFmyuroCw98DdF/TQsuFQV1a4At7jHlF1H+0Q==} engines: {node: '>=14.0.0'} cpu: [s390x] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-x64-gnu@0.82.3': resolution: {integrity: sha512-OJ9k0xIqejBNp+6dn1V/QZk0iHBqJsq/Jm/+9wjg3gJyDOZFq0qU/zHAuUzObro6JGFBmPvAZsVi4qEaYZLIQA==} engines: {node: '>=14.0.0'} cpu: [x64] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-x64-musl@0.82.3': resolution: {integrity: sha512-nPaIuIm0OM2Xylt3suhiLw6POklE8KlpO2hRuGtiLQTFWORPgB3SzDTrp2Trxob40bsbCTVyeWHB/VsC/vw5Gw==} engines: {node: '>=14.0.0'} cpu: [x64] os: [linux] + libc: [musl] '@oxc-transform/binding-wasm32-wasi@0.82.3': resolution: {integrity: sha512-srV5VaR6cgs808dm/gBDAuqUaPqgWsoLMPbmojMt/qGu2fEOSQzv5i3X0b5V6OyHM9k53BK449k22JHTCzpyAg==} @@ -3916,36 +4114,42 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm-musl@2.5.1': resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.5.1': resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.5.1': resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [musl] '@parcel/watcher-linux-x64-glibc@2.5.1': resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-x64-musl@2.5.1': resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [musl] '@parcel/watcher-win32-arm64@2.5.1': resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==} @@ -5124,85 +5328,89 @@ packages: '@repeaterjs/repeater@3.0.6': resolution: {integrity: sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==} - '@rolldown/binding-android-arm64@1.0.0-beta.38': - resolution: {integrity: sha512-AE3HFQrjWCKLFZD1Vpiy+qsqTRwwoil1oM5WsKPSmfQ5fif/A+ZtOZetF32erZdsR7qyvns6qHEteEsF6g6rsQ==} + '@rolldown/binding-android-arm64@1.0.0-beta.40': + resolution: {integrity: sha512-9Ii9phC7QU6Lb+ncMfG1Xlosq0NBB1N/4sw+EGZ3y0BBWGy02TOb5ghWZalphAKv9rn1goqo5WkBjyd2YvsLmA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.0.0-beta.38': - resolution: {integrity: sha512-RaoWOKc0rrFsVmKOjQpebMY6c6/I7GR1FBc25v7L/R7NlM0166mUotwGEv7vxu7ruXH4SJcFeVrfADFUUXUmmQ==} + '@rolldown/binding-darwin-arm64@1.0.0-beta.40': + resolution: {integrity: sha512-5O6d0y2tBQTL+ecQY3qXIwSnF1/Zik8q7LZMKeyF+VJ9l194d0IdMhl2zUF0cqWbYHuF4Pnxplk4OhurPQ/Z9Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-beta.38': - resolution: {integrity: sha512-Ymojqc2U35iUc8NFU2XX1WQPfBRRHN6xHcrxAf9WS8BFFBn8pDrH5QPvH1tYs3lDkw6UGGbanr1RGzARqdUp1g==} + '@rolldown/binding-darwin-x64@1.0.0-beta.40': + resolution: {integrity: sha512-izB9jygt3miPQbOTZfSu5K51isUplqa8ysByOKQqcJHgrBWmbTU8TM9eouv6tRmBR0kjcEcID9xhmA1CeZ1VIg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-beta.38': - resolution: {integrity: sha512-0ermTQ//WzSI0nOL3z/LUWMNiE9xeM5cLGxjewPFEexqxV/0uM8/lNp9QageQ8jfc/VO1OURsGw34HYO5PaL8w==} + '@rolldown/binding-freebsd-x64@1.0.0-beta.40': + resolution: {integrity: sha512-2fdpEpKT+wwP0vig9dqxu+toTeWmVSjo3psJQVDeLJ51rO+GXcCJ1IkCXjhMKVEevNtZS7B8T8Z2vvmRV9MAdA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.38': - resolution: {integrity: sha512-GADxzVUTCTp6EWI52831A29Tt7PukFe94nhg/SUsfkI33oTiNQtPxyLIT/3oRegizGuPSZSlrdBurkjDwxyEUQ==} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.40': + resolution: {integrity: sha512-HP2lo78OWULN+8TewpLbS9PS00jh0CaF04tA2u8z2I+6QgVgrYOYKvX+T0hlO5smgso4+qb3YchzumWJl3yCPQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.38': - resolution: {integrity: sha512-SKO7Exl5Yem/OSNoA5uLHzyrptUQ8Hg70kHDxuwEaH0+GUg+SQe9/7PWmc4hFKBMrJGdQtii8WZ0uIz9Dofg5Q==} + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.40': + resolution: {integrity: sha512-ng00gfr9BhA2NPAOU5RWAlTiL+JcwAD+L+4yUD1sbBy6tgHdLiNBOvKtHISIF9RM9/eQeS0tAiWOYZGIH9JMew==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.38': - resolution: {integrity: sha512-SOo6+WqhXPBaShLxLT0eCgH17d3Yu1lMAe4mFP0M9Bvr/kfMSOPQXuLxBcbBU9IFM9w3N6qP9xWOHO+oUJvi8Q==} + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.40': + resolution: {integrity: sha512-mF0R1l9kLcaag/9cLEiYYdNZ4v1uuX4jklSDZ1s6vJE4RB3LirUney0FavdVRwCJ5sDvfvsPgXgtBXWYr2M2tQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.38': - resolution: {integrity: sha512-yvsQ3CyrodOX+lcoi+lejZGCOvJZa9xTsNB8OzpMDmHeZq3QzJfpYjXSAS6vie70fOkLVJb77UqYO193Cl8XBQ==} + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.40': + resolution: {integrity: sha512-+wi08S7wT5iLPHRZb0USrS6n+T6m+yY++dePYedE5uvKIpWCJJioFTaRtWjpm0V6dVNLcq2OukrvfdlGtH9Wgg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.0.0-beta.38': - resolution: {integrity: sha512-84qzKMwUwikfYeOuJ4Kxm/3z15rt0nFGGQArHYIQQNSTiQdxGHxOkqXtzPFqrVfBJUdxBAf+jYzR1pttFJuWyg==} + '@rolldown/binding-linux-x64-musl@1.0.0-beta.40': + resolution: {integrity: sha512-W5qBGAemUocIBKCcOsDjlV9GUt28qhl/+M6etWBeLS5gQK0J6XDg0YVzfOQdvq57ZGjYNP0NvhYzqhOOnEx+4g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] - '@rolldown/binding-openharmony-arm64@1.0.0-beta.38': - resolution: {integrity: sha512-QrNiWlce01DYH0rL8K3yUBu+lNzY+B0DyCbIc2Atan6/S6flxOL0ow5DLQvMamOI/oKhrJ4xG+9MkMb9dDHbLQ==} + '@rolldown/binding-openharmony-arm64@1.0.0-beta.40': + resolution: {integrity: sha512-vJwoDehtt+yqj2zacq1AqNc2uE/oh7mnRGqAUbuldV6pgvU01OSQUJ7Zu+35hTopnjFoDNN6mIezkYlGAv5RFA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.0.0-beta.38': - resolution: {integrity: sha512-fnLtHyjwEsG4/aNV3Uv3Qd1ZbdH+CopwJNoV0RgBqrcQB8V6/Qdikd5JKvnO23kb3QvIpP+dAMGZMv1c2PJMzw==} + '@rolldown/binding-wasm32-wasi@1.0.0-beta.40': + resolution: {integrity: sha512-Oj3YyqVUPurr1FlMpEE/bJmMC+VWAWPM/SGUfklO5KUX97bk5Q/733nPg4RykK8q8/TluJoQYvRc05vL/B74dw==} engines: {node: '>=14.0.0'} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.38': - resolution: {integrity: sha512-19cTfnGedem+RY+znA9J6ARBOCEFD4YSjnx0p5jiTm9tR6pHafRfFIfKlTXhun+NL0WWM/M0eb2IfPPYUa8+wg==} + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.40': + resolution: {integrity: sha512-0ZtO6yN8XjVoFfN4HDWQj4nDu3ndMybr7jIM00DJqOmc+yFhly7rdOy7fNR9Sky3leCpBtsXfepVqRmVpYKPVA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.38': - resolution: {integrity: sha512-HcICm4YzFJZV+fI0O0bFLVVlsWvRNo/AB9EfUXvNYbtAxakCnQZ15oq22deFdz6sfi9Y4/SagH2kPU723dhCFA==} + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.40': + resolution: {integrity: sha512-BPl1inoJXPpIe38Ja46E4y11vXlJyuleo+9Rmu//pYL5fIDYJkXUj/oAXqjSuwLcssrcwnuPgzvzvlz9++cr3w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.38': - resolution: {integrity: sha512-4Qx6cgEPXLb0XsCyLoQcUgYBpfL0sjugftob+zhUH0EOk/NVCAIT+h0NJhY+jn7pFpeKxhNMqhvTNx3AesxIAQ==} + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.40': + resolution: {integrity: sha512-UguA4ltbAk+nbwHRxqaUP/etpTbR0HjyNlsu4Zjbh/ytNbFsbw8CA4tEBkwDyjgI5NIPea6xY11zpl7R2/ddVA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -5219,22 +5427,17 @@ packages: '@rolldown/pluginutils@1.0.0-beta.36': resolution: {integrity: sha512-qa+gfzhv0/Xv52zZInENLu6JbsnSjSExD7kTaNm7Qn5LUIH6IQb7l9pB+NrsU5/Bvt9aqcBTdRGc7x1DYMTiqQ==} - '@rolldown/pluginutils@1.0.0-beta.38': - resolution: {integrity: sha512-N/ICGKleNhA5nc9XXQG/kkKHJ7S55u0x0XUJbbkmdCnFuoRkM1Il12q9q0eX19+M7KKUEPw/daUPIRnxhcxAIw==} - - '@rollup/rollup-android-arm-eabi@4.45.1': - resolution: {integrity: sha512-NEySIFvMY0ZQO+utJkgoMiCAjMrGvnbDLHvcmlA33UXJpYBCvlBEbMMtV837uCkS+plG2umfhn0T5mMAxGrlRA==} - cpu: [arm] - os: [android] + '@rolldown/pluginutils@1.0.0-beta.40': + resolution: {integrity: sha512-s3GeJKSQOwBlzdUrj4ISjJj5SfSh+aqn0wjOar4Bx95iV1ETI7F6S/5hLcfAxZ9kXDcyrAkxPlqmd1ZITttf+w==} '@rollup/rollup-android-arm-eabi@4.50.1': resolution: {integrity: sha512-HJXwzoZN4eYTdD8bVV22DN8gsPCAj3V20NHKOs8ezfXanGpmVPR7kalUHd+Y31IJp9stdB87VKPFbsGY3H/2ag==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.45.1': - resolution: {integrity: sha512-ujQ+sMXJkg4LRJaYreaVx7Z/VMgBBd89wGS4qMrdtfUFZ+TSY5Rs9asgjitLwzeIbhwdEhyj29zhst3L1lKsRQ==} - cpu: [arm64] + '@rollup/rollup-android-arm-eabi@4.52.2': + resolution: {integrity: sha512-o3pcKzJgSGt4d74lSZ+OCnHwkKBeAbFDmbEm5gg70eA8VkyCuC/zV9TwBnmw6VjDlRdF4Pshfb+WE9E6XY1PoQ==} + cpu: [arm] os: [android] '@rollup/rollup-android-arm64@4.50.1': @@ -5242,19 +5445,19 @@ packages: cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.45.1': - resolution: {integrity: sha512-FSncqHvqTm3lC6Y13xncsdOYfxGSLnP+73k815EfNmpewPs+EyM49haPS105Rh4aF5mJKywk9X0ogzLXZzN9lA==} + '@rollup/rollup-android-arm64@4.52.2': + resolution: {integrity: sha512-cqFSWO5tX2vhC9hJTK8WAiPIm4Q8q/cU8j2HQA0L3E1uXvBYbOZMhE2oFL8n2pKB5sOCHY6bBuHaRwG7TkfJyw==} cpu: [arm64] - os: [darwin] + os: [android] '@rollup/rollup-darwin-arm64@4.50.1': resolution: {integrity: sha512-xc6i2AuWh++oGi4ylOFPmzJOEeAa2lJeGUGb4MudOtgfyyjr4UPNK+eEWTPLvmPJIY/pgw6ssFIox23SyrkkJw==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.45.1': - resolution: {integrity: sha512-2/vVn/husP5XI7Fsf/RlhDaQJ7x9zjvC81anIVbr4b/f0xtSmXQTFcGIQ/B1cXIYM6h2nAhJkdMHTnD7OtQ9Og==} - cpu: [x64] + '@rollup/rollup-darwin-arm64@4.52.2': + resolution: {integrity: sha512-vngduywkkv8Fkh3wIZf5nFPXzWsNsVu1kvtLETWxTFf/5opZmflgVSeLgdHR56RQh71xhPhWoOkEBvbehwTlVA==} + cpu: [arm64] os: [darwin] '@rollup/rollup-darwin-x64@4.50.1': @@ -5262,19 +5465,19 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.45.1': - resolution: {integrity: sha512-4g1kaDxQItZsrkVTdYQ0bxu4ZIQ32cotoQbmsAnW1jAE4XCMbcBPDirX5fyUzdhVCKgPcrwWuucI8yrVRBw2+g==} - cpu: [arm64] - os: [freebsd] + '@rollup/rollup-darwin-x64@4.52.2': + resolution: {integrity: sha512-h11KikYrUCYTrDj6h939hhMNlqU2fo/X4NB0OZcys3fya49o1hmFaczAiJWVAFgrM1NCP6RrO7lQKeVYSKBPSQ==} + cpu: [x64] + os: [darwin] '@rollup/rollup-freebsd-arm64@4.50.1': resolution: {integrity: sha512-wOsE6H2u6PxsHY/BeFHA4VGQN3KUJFZp7QJBmDYI983fgxq5Th8FDkVuERb2l9vDMs1D5XhOrhBrnqcEY6l8ZA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.45.1': - resolution: {integrity: sha512-L/6JsfiL74i3uK1Ti2ZFSNsp5NMiM4/kbbGEcOCps99aZx3g8SJMO1/9Y0n/qKlWZfn6sScf98lEOUe2mBvW9A==} - cpu: [x64] + '@rollup/rollup-freebsd-arm64@4.52.2': + resolution: {integrity: sha512-/eg4CI61ZUkLXxMHyVlmlGrSQZ34xqWlZNW43IAU4RmdzWEx0mQJ2mN/Cx4IHLVZFL6UBGAh+/GXhgvGb+nVxw==} + cpu: [arm64] os: [freebsd] '@rollup/rollup-freebsd-x64@4.50.1': @@ -5282,134 +5485,161 @@ packages: cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.45.1': - resolution: {integrity: sha512-RkdOTu2jK7brlu+ZwjMIZfdV2sSYHK2qR08FUWcIoqJC2eywHbXr0L8T/pONFwkGukQqERDheaGTeedG+rra6Q==} - cpu: [arm] - os: [linux] + '@rollup/rollup-freebsd-x64@4.52.2': + resolution: {integrity: sha512-QOWgFH5X9+p+S1NAfOqc0z8qEpJIoUHf7OWjNUGOeW18Mx22lAUOiA9b6r2/vpzLdfxi/f+VWsYjUOMCcYh0Ng==} + cpu: [x64] + os: [freebsd] '@rollup/rollup-linux-arm-gnueabihf@4.50.1': resolution: {integrity: sha512-54v4okehwl5TaSIkpp97rAHGp7t3ghinRd/vyC1iXqXMfjYUTm7TfYmCzXDoHUPTTf36L8pr0E7YsD3CfB3ZDg==} cpu: [arm] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.45.1': - resolution: {integrity: sha512-3kJ8pgfBt6CIIr1o+HQA7OZ9mp/zDk3ctekGl9qn/pRBgrRgfwiffaUmqioUGN9hv0OHv2gxmvdKOkARCtRb8Q==} + '@rollup/rollup-linux-arm-gnueabihf@4.52.2': + resolution: {integrity: sha512-kDWSPafToDd8LcBYd1t5jw7bD5Ojcu12S3uT372e5HKPzQt532vW+rGFFOaiR0opxePyUkHrwz8iWYEyH1IIQA==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.50.1': resolution: {integrity: sha512-p/LaFyajPN/0PUHjv8TNyxLiA7RwmDoVY3flXHPSzqrGcIp/c2FjwPPP5++u87DGHtw+5kSH5bCJz0mvXngYxw==} cpu: [arm] os: [linux] + libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.45.1': - resolution: {integrity: sha512-k3dOKCfIVixWjG7OXTCOmDfJj3vbdhN0QYEqB+OuGArOChek22hn7Uy5A/gTDNAcCy5v2YcXRJ/Qcnm4/ma1xw==} - cpu: [arm64] + '@rollup/rollup-linux-arm-musleabihf@4.52.2': + resolution: {integrity: sha512-gKm7Mk9wCv6/rkzwCiUC4KnevYhlf8ztBrDRT9g/u//1fZLapSRc+eDZj2Eu2wpJ+0RzUKgtNijnVIB4ZxyL+w==} + cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.50.1': resolution: {integrity: sha512-2AbMhFFkTo6Ptna1zO7kAXXDLi7H9fGTbVaIq2AAYO7yzcAsuTNWPHhb2aTA6GPiP+JXh85Y8CiS54iZoj4opw==} cpu: [arm64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.45.1': - resolution: {integrity: sha512-PmI1vxQetnM58ZmDFl9/Uk2lpBBby6B6rF4muJc65uZbxCs0EA7hhKCk2PKlmZKuyVSHAyIw3+/SiuMLxKxWog==} + '@rollup/rollup-linux-arm64-gnu@4.52.2': + resolution: {integrity: sha512-66lA8vnj5mB/rtDNwPgrrKUOtCLVQypkyDa2gMfOefXK6rcZAxKLO9Fy3GkW8VkPnENv9hBkNOFfGLf6rNKGUg==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.50.1': resolution: {integrity: sha512-Cgef+5aZwuvesQNw9eX7g19FfKX5/pQRIyhoXLCiBOrWopjo7ycfB292TX9MDcDijiuIJlx1IzJz3IoCPfqs9w==} cpu: [arm64] os: [linux] + libc: [musl] - '@rollup/rollup-linux-loongarch64-gnu@4.45.1': - resolution: {integrity: sha512-9UmI0VzGmNJ28ibHW2GpE2nF0PBQqsyiS4kcJ5vK+wuwGnV5RlqdczVocDSUfGX/Na7/XINRVoUgJyFIgipoRg==} + '@rollup/rollup-linux-arm64-musl@4.52.2': + resolution: {integrity: sha512-s+OPucLNdJHvuZHuIz2WwncJ+SfWHFEmlC5nKMUgAelUeBUnlB4wt7rXWiyG4Zn07uY2Dd+SGyVa9oyLkVGOjA==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-loong64-gnu@4.52.2': + resolution: {integrity: sha512-8wTRM3+gVMDLLDdaT6tKmOE3lJyRy9NpJUS/ZRWmLCmOPIJhVyXwjBo+XbrrwtV33Em1/eCTd5TuGJm4+DmYjw==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-loongarch64-gnu@4.50.1': resolution: {integrity: sha512-RPhTwWMzpYYrHrJAS7CmpdtHNKtt2Ueo+BlLBjfZEhYBhK00OsEqM08/7f+eohiF6poe0YRDDd8nAvwtE/Y62Q==} cpu: [loong64] os: [linux] - - '@rollup/rollup-linux-powerpc64le-gnu@4.45.1': - resolution: {integrity: sha512-7nR2KY8oEOUTD3pBAxIBBbZr0U7U+R9HDTPNy+5nVVHDXI4ikYniH1oxQz9VoB5PbBU1CZuDGHkLJkd3zLMWsg==} - cpu: [ppc64] - os: [linux] + libc: [glibc] '@rollup/rollup-linux-ppc64-gnu@4.50.1': resolution: {integrity: sha512-eSGMVQw9iekut62O7eBdbiccRguuDgiPMsw++BVUg+1K7WjZXHOg/YOT9SWMzPZA+w98G+Fa1VqJgHZOHHnY0Q==} cpu: [ppc64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.45.1': - resolution: {integrity: sha512-nlcl3jgUultKROfZijKjRQLUu9Ma0PeNv/VFHkZiKbXTBQXhpytS8CIj5/NfBeECZtY2FJQubm6ltIxm/ftxpw==} - cpu: [riscv64] + '@rollup/rollup-linux-ppc64-gnu@4.52.2': + resolution: {integrity: sha512-6yqEfgJ1anIeuP2P/zhtfBlDpXUb80t8DpbYwXQ3bQd95JMvUaqiX+fKqYqUwZXqdJDd8xdilNtsHM2N0cFm6A==} + cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.50.1': resolution: {integrity: sha512-S208ojx8a4ciIPrLgazF6AgdcNJzQE4+S9rsmOmDJkusvctii+ZvEuIC4v/xFqzbuP8yDjn73oBlNDgF6YGSXQ==} cpu: [riscv64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.45.1': - resolution: {integrity: sha512-HJV65KLS51rW0VY6rvZkiieiBnurSzpzore1bMKAhunQiECPuxsROvyeaot/tcK3A3aGnI+qTHqisrpSgQrpgA==} + '@rollup/rollup-linux-riscv64-gnu@4.52.2': + resolution: {integrity: sha512-sshYUiYVSEI2B6dp4jMncwxbrUqRdNApF2c3bhtLAU0qA8Lrri0p0NauOsTWh3yCCCDyBOjESHMExonp7Nzc0w==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.50.1': resolution: {integrity: sha512-3Ag8Ls1ggqkGUvSZWYcdgFwriy2lWo+0QlYgEFra/5JGtAd6C5Hw59oojx1DeqcA2Wds2ayRgvJ4qxVTzCHgzg==} cpu: [riscv64] os: [linux] + libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.45.1': - resolution: {integrity: sha512-NITBOCv3Qqc6hhwFt7jLV78VEO/il4YcBzoMGGNxznLgRQf43VQDae0aAzKiBeEPIxnDrACiMgbqjuihx08OOw==} - cpu: [s390x] + '@rollup/rollup-linux-riscv64-musl@4.52.2': + resolution: {integrity: sha512-duBLgd+3pqC4MMwBrKkFxaZerUxZcYApQVC5SdbF5/e/589GwVvlRUnyqMFbM8iUSb1BaoX/3fRL7hB9m2Pj8Q==} + cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.50.1': resolution: {integrity: sha512-t9YrKfaxCYe7l7ldFERE1BRg/4TATxIg+YieHQ966jwvo7ddHJxPj9cNFWLAzhkVsbBvNA4qTbPVNsZKBO4NSg==} cpu: [s390x] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.45.1': - resolution: {integrity: sha512-+E/lYl6qu1zqgPEnTrs4WysQtvc/Sh4fC2nByfFExqgYrqkKWp1tWIbe+ELhixnenSpBbLXNi6vbEEJ8M7fiHw==} - cpu: [x64] + '@rollup/rollup-linux-s390x-gnu@4.52.2': + resolution: {integrity: sha512-tzhYJJidDUVGMgVyE+PmxENPHlvvqm1KILjjZhB8/xHYqAGeizh3GBGf9u6WdJpZrz1aCpIIHG0LgJgH9rVjHQ==} + cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.50.1': resolution: {integrity: sha512-MCgtFB2+SVNuQmmjHf+wfI4CMxy3Tk8XjA5Z//A0AKD7QXUYFMQcns91K6dEHBvZPCnhJSyDWLApk40Iq/H3tA==} cpu: [x64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.45.1': - resolution: {integrity: sha512-a6WIAp89p3kpNoYStITT9RbTbTnqarU7D8N8F2CV+4Cl9fwCOZraLVuVFvlpsW0SbIiYtEnhCZBPLoNdRkjQFw==} + '@rollup/rollup-linux-x64-gnu@4.52.2': + resolution: {integrity: sha512-opH8GSUuVcCSSyHHcl5hELrmnk4waZoVpgn/4FDao9iyE4WpQhyWJ5ryl5M3ocp4qkRuHfyXnGqg8M9oKCEKRA==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.50.1': resolution: {integrity: sha512-nEvqG+0jeRmqaUMuwzlfMKwcIVffy/9KGbAGyoa26iu6eSngAYQ512bMXuqqPrlTyfqdlB9FVINs93j534UJrg==} cpu: [x64] os: [linux] + libc: [musl] + + '@rollup/rollup-linux-x64-musl@4.52.2': + resolution: {integrity: sha512-LSeBHnGli1pPKVJ79ZVJgeZWWZXkEe/5o8kcn23M8eMKCUANejchJbF/JqzM4RRjOJfNRhKJk8FuqL1GKjF5oQ==} + cpu: [x64] + os: [linux] + libc: [musl] '@rollup/rollup-openharmony-arm64@4.50.1': resolution: {integrity: sha512-RDsLm+phmT3MJd9SNxA9MNuEAO/J2fhW8GXk62G/B4G7sLVumNFbRwDL6v5NrESb48k+QMqdGbHgEtfU0LCpbA==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.45.1': - resolution: {integrity: sha512-T5Bi/NS3fQiJeYdGvRpTAP5P02kqSOpqiopwhj0uaXB6nzs5JVi2XMJb18JUSKhCOX8+UE1UKQufyD6Or48dJg==} + '@rollup/rollup-openharmony-arm64@4.52.2': + resolution: {integrity: sha512-uPj7MQ6/s+/GOpolavm6BPo+6CbhbKYyZHUDvZ/SmJM7pfDBgdGisFX3bY/CBDMg2ZO4utfhlApkSfZ92yXw7Q==} cpu: [arm64] - os: [win32] + os: [openharmony] '@rollup/rollup-win32-arm64-msvc@4.50.1': resolution: {integrity: sha512-hpZB/TImk2FlAFAIsoElM3tLzq57uxnGYwplg6WDyAxbYczSi8O2eQ+H2Lx74504rwKtZ3N2g4bCUkiamzS6TQ==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.45.1': - resolution: {integrity: sha512-lxV2Pako3ujjuUe9jiU3/s7KSrDfH6IgTSQOnDWr9aJ92YsFd7EurmClK0ly/t8dzMkDtd04g60WX6yl0sGfdw==} - cpu: [ia32] + '@rollup/rollup-win32-arm64-msvc@4.52.2': + resolution: {integrity: sha512-Z9MUCrSgIaUeeHAiNkm3cQyst2UhzjPraR3gYYfOjAuZI7tcFRTOD+4cHLPoS/3qinchth+V56vtqz1Tv+6KPA==} + cpu: [arm64] os: [win32] '@rollup/rollup-win32-ia32-msvc@4.50.1': @@ -5417,8 +5647,13 @@ packages: cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.45.1': - resolution: {integrity: sha512-M/fKi4sasCdM8i0aWJjCSFm2qEnYRR8AMLG2kxp6wD13+tMGA4Z1tVAuHkNRjud5SW2EM3naLuK35w9twvf6aA==} + '@rollup/rollup-win32-ia32-msvc@4.52.2': + resolution: {integrity: sha512-+GnYBmpjldD3XQd+HMejo+0gJGwYIOfFeoBQv32xF/RUIvccUz20/V6Otdv+57NE70D5pa8W/jVGDoGq0oON4A==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.52.2': + resolution: {integrity: sha512-ApXFKluSB6kDQkAqZOKXBjiaqdF1BlKi+/eqnYe9Ee7U2K3pUDKsIyr8EYm/QDHTJIM+4X+lI0gJc3TTRhd+dA==} cpu: [x64] os: [win32] @@ -5427,6 +5662,11 @@ packages: cpu: [x64] os: [win32] + '@rollup/rollup-win32-x64-msvc@4.52.2': + resolution: {integrity: sha512-ARz+Bs8kY6FtitYM96PqPEVvPXqEZmPZsSkXvyX19YzDqkCaIlhCieLLMI5hxO9SRZ2XtCtm8wxhy0iJ2jxNfw==} + cpu: [x64] + os: [win32] + '@rtsao/scc@1.1.0': resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} @@ -5664,24 +5904,28 @@ packages: engines: {node: '>=10'} cpu: [arm64] os: [linux] + libc: [glibc] '@swc/core-linux-arm64-musl@1.13.1': resolution: {integrity: sha512-JaqFdBCarIBKiMu5bbAp+kWPMNGg97ej+7KzbKOzWP5pRptqKi86kCDZT3WmjPe8hNG6dvBwbm7Y8JNry5LebQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] + libc: [musl] '@swc/core-linux-x64-gnu@1.13.1': resolution: {integrity: sha512-t4cLkku10YECDaakWUH0452WJHIZtrLPRwezt6BdoMntVMwNjvXRX7C8bGuYcKC3YxRW7enZKFpozLhQIQ37oA==} engines: {node: '>=10'} cpu: [x64] os: [linux] + libc: [glibc] '@swc/core-linux-x64-musl@1.13.1': resolution: {integrity: sha512-fSMwZOaG+3ukUucbEbzz9GhzGhUhXoCPqHe9qW0/Vc2IZRp538xalygKyZynYweH5d9EHux1aj3+IO8/xBaoiA==} engines: {node: '>=10'} cpu: [x64] os: [linux] + libc: [musl] '@swc/core-win32-arm64-msvc@1.13.1': resolution: {integrity: sha512-tweCXK/79vAwj1NhAsYgICy8T1z2QEairmN2BFEBYFBFNMEB1iI1YlXwBkBtuihRvgZrTh1ORusKa4jLYzLCZA==} @@ -5757,24 +6001,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.1.13': resolution: {integrity: sha512-hZQrmtLdhyqzXHB7mkXfq0IYbxegaqTmfa1p9MBj72WPoDD3oNOh1Lnxf6xZLY9C3OV6qiCYkO1i/LrzEdW2mg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.1.13': resolution: {integrity: sha512-uaZTYWxSXyMWDJZNY1Ul7XkJTCBRFZ5Fo6wtjrgBKzZLoJNrG+WderJwAjPzuNZOnmdrVg260DKwXCFtJ/hWRQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.1.13': resolution: {integrity: sha512-oXiPj5mi4Hdn50v5RdnuuIms0PVPI/EG4fxAfFiIKQh5TgQgX7oSuDWntHW7WNIi/yVLAiS+CRGW4RkoGSSgVQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.1.13': resolution: {integrity: sha512-+LC2nNtPovtrDwBc/nqnIKYh/W2+R69FA0hgoeOn64BdCX522u19ryLh3Vf3F8W49XBcMIxSe665kwy21FkhvA==} @@ -5958,14 +6206,11 @@ packages: '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - '@types/node@18.19.120': - resolution: {integrity: sha512-WtCGHFXnVI8WHLxDAt5TbnCM4eSE+nI0QN2NJtwzcgMhht2eNz6V9evJrk+lwC8bCY8OWV5Ym8Jz7ZEyGnKnMA==} - - '@types/node@18.19.124': - resolution: {integrity: sha512-hY4YWZFLs3ku6D2Gqo3RchTd9VRCcrjqp/I0mmohYeUVA5Y8eCXKJEasHxLAJVZRJuQogfd1GiJ9lgogBgKeuQ==} + '@types/node@18.19.127': + resolution: {integrity: sha512-gSjxjrnKXML/yo0BO099uPixMqfpJU0TKYjpfLU7TrtA2WWDki412Np/RSTPRil1saKBhvVVKzVx/p/6p94nVA==} - '@types/node@20.19.9': - resolution: {integrity: sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==} + '@types/node@20.19.17': + resolution: {integrity: sha512-gfehUI8N1z92kygssiuWvLiwcbOB3IRktR6hTDgJlXMYh5OvkPSRmgfoBUmfZt+vhwJtX7v1Yw4KvvAf7c5QKQ==} '@types/node@22.15.29': resolution: {integrity: sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==} @@ -5973,6 +6218,9 @@ packages: '@types/node@22.16.5': resolution: {integrity: sha512-bJFoMATwIGaxxx8VJPeM8TonI8t579oRvgAuT8zFugJsJZgzqv0Fu8Mhp68iecjzG7cnN3mO2dJQ5uUM2EFrgQ==} + '@types/node@22.18.6': + resolution: {integrity: sha512-r8uszLPpeIWbNKtvWRt/DbVi5zbqZyj1PTmhRMqBMvDnaz1QpmSKujUtJLrqGZeoM8v72MfYggDceY4K1itzWQ==} + '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} @@ -6518,11 +6766,6 @@ packages: resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} engines: {node: '>=0.4.0'} - acorn@8.14.1: - resolution: {integrity: sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==} - engines: {node: '>=0.4.0'} - hasBin: true - acorn@8.15.0: resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} @@ -6719,8 +6962,8 @@ packages: peerDependencies: axios: ^0.30.0 - axios@0.30.0: - resolution: {integrity: sha512-Z4F3LjCgfjZz8BMYalWdMgAQUnEtKDmpwNHjh/C8pQZWde32TF64cqnSeyL3xD/aTIASRU30RHTNzRiV/NpGMg==} + axios@0.30.1: + resolution: {integrity: sha512-2XabsR1u0/B6OoKy57/xJmPkQiUvdoV93oW4ww+Xjee7C2er/O5U77lvqycDkT2VQDtfjYcjw8ZV8GDaoqwjHQ==} axios@1.11.0: resolution: {integrity: sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==} @@ -6822,6 +7065,7 @@ packages: binary-install@1.1.0: resolution: {integrity: sha512-rkwNGW+3aQVSZoD0/o3mfPN6Yxh3Id0R/xzTVBVVpGNlVz8EGwusksxRlbk/A5iKTZt9zkMn3qIqmAt3vpfbzg==} engines: {node: '>=10'} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. birpc@2.5.0: resolution: {integrity: sha512-VSWO/W6nNQdyP520F1mhf+Lc2f8pjGQOtoHHm7Ze8Go1kX7akpVIrtTa0fn+HB0QJEDVacl6aO08YE0PgXfdnQ==} @@ -6944,8 +7188,8 @@ packages: ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} - chai@5.2.1: - resolution: {integrity: sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==} + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} engines: {node: '>=18'} chalk@4.1.2: @@ -7284,6 +7528,15 @@ packages: supports-color: optional: true + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} @@ -7581,6 +7834,11 @@ packages: peerDependencies: esbuild: '>=0.12 <1' + esbuild@0.25.10: + resolution: {integrity: sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ==} + engines: {node: '>=18'} + hasBin: true + esbuild@0.25.9: resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==} engines: {node: '>=18'} @@ -8789,6 +9047,10 @@ packages: joi@17.13.3: resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} + joi@18.0.1: + resolution: {integrity: sha512-IiQpRyypSnLisQf3PwuN2eIHAsAIGZIrLZkd4zdvIar2bDyhM91ubRjy8a3eYablXsh9BeI/c7dmPYHca5qtoA==} + engines: {node: '>= 20'} + jose@5.10.0: resolution: {integrity: sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==} @@ -8931,24 +9193,28 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-musl@1.30.1: resolution: {integrity: sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-x64-gnu@1.30.1: resolution: {integrity: sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-musl@1.30.1: resolution: {integrity: sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-win32-arm64-msvc@1.30.1: resolution: {integrity: sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==} @@ -9045,8 +9311,8 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - loupe@3.1.4: - resolution: {integrity: sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==} + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} lower-case-first@2.0.2: resolution: {integrity: sha512-EVm/rR94FJTZi3zefZ82fLWab+GX14LJN4HrWBcuo6Evmsl9hEfnqxgcHCKb9q+mNf6EVdsjx/qucYFIIB84pg==} @@ -10298,18 +10564,18 @@ packages: vue-tsc: optional: true - rolldown@1.0.0-beta.38: - resolution: {integrity: sha512-58frPNX55Je1YsyrtPJv9rOSR3G5efUZpRqok94Efsj0EUa8dnqJV3BldShyI7A+bVPleucOtzXHwVpJRcR0kQ==} + rolldown@1.0.0-beta.40: + resolution: {integrity: sha512-VqEHbKpOgTPmQrZ4fVn4eshDQS/6g/fRpNE7cFSJY+eQLDZn4B9X61J6L+hnlt1u2uRI+pF7r1USs6S5fuWCvw==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - rollup@4.45.1: - resolution: {integrity: sha512-4iya7Jb76fVpQyLoiVpzUrsjQ12r3dM7fIVz+4NwoYvZOShknRmiv+iu9CClZml5ZLGb0XMcYLutK6w9tgxHDw==} + rollup@4.50.1: + resolution: {integrity: sha512-78E9voJHwnXQMiQdiqswVLZwJIzdBKJ1GdI5Zx6XwoFKUIk09/sSrr+05QFzvYb8q6Y9pPV45zzDuYa3907TZA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rollup@4.50.1: - resolution: {integrity: sha512-78E9voJHwnXQMiQdiqswVLZwJIzdBKJ1GdI5Zx6XwoFKUIk09/sSrr+05QFzvYb8q6Y9pPV45zzDuYa3907TZA==} + rollup@4.52.2: + resolution: {integrity: sha512-I25/2QgoROE1vYV+NQ1En9T9UFB9Cmfm2CJ83zZOlaDpvz29wGQSZXWKw7MiNXau7wYgB/T9fVIdIuEQ+KbiiA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -10783,8 +11049,8 @@ packages: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} - tinyspy@4.0.3: - resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + tinyspy@4.0.4: + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} title-case@3.0.3: @@ -11313,8 +11579,8 @@ packages: vite: optional: true - vite@7.0.5: - resolution: {integrity: sha512-1mncVwJxy2C9ThLwz0+2GKZyEXuC3MyWtAAlNftlZZXZDP3AJt5FmwcMit/IGGaNZ8ZOB2BNO/HFUB+CpN0NQw==} + vite@7.1.5: + resolution: {integrity: sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -11353,8 +11619,8 @@ packages: yaml: optional: true - vite@7.1.5: - resolution: {integrity: sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ==} + vite@7.1.7: + resolution: {integrity: sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -11447,6 +11713,11 @@ packages: engines: {node: '>=12.0.0'} hasBin: true + wait-on@8.0.5: + resolution: {integrity: sha512-J3WlS0txVHkhLRb2FsmRg3dkMTCV1+M6Xra3Ho7HzZDHpE7DCOnoSoCJsZotrmW3uRMhvIJGSKUKrh/MeF4iag==} + engines: {node: '>=12.0.0'} + hasBin: true + wasm-pack@0.13.1: resolution: {integrity: sha512-P9exD4YkjpDbw68xUhF3MDm/CC/3eTmmthyG5bHJ56kalxOTewOunxTke4SyF8MTXV6jUtNjXggPgrGmMtczGg==} hasBin: true @@ -11746,7 +12017,7 @@ snapshots: '@babel/traverse': 7.28.4 '@babel/types': 7.28.4 convert-source-map: 2.0.0 - debug: 4.4.1 + debug: 4.4.3 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 7.7.2 @@ -11766,7 +12037,7 @@ snapshots: '@babel/traverse': 7.28.4 '@babel/types': 7.28.4 convert-source-map: 2.0.0 - debug: 4.4.1 + debug: 4.4.3 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 7.7.2 @@ -11786,7 +12057,7 @@ snapshots: '@babel/types': 7.28.4 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.1 + debug: 4.4.3 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 7.7.2 @@ -11879,7 +12150,7 @@ snapshots: '@babel/core': 7.26.10 '@babel/helper-compilation-targets': 7.27.2 '@babel/helper-plugin-utils': 7.27.1 - debug: 4.4.1 + debug: 4.4.3 lodash.debounce: 4.0.8 resolve: 1.22.10 transitivePeerDependencies: @@ -12747,7 +13018,7 @@ snapshots: '@babel/parser': 7.28.0 '@babel/template': 7.27.2 '@babel/types': 7.28.1 - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -12759,7 +13030,7 @@ snapshots: '@babel/parser': 7.28.4 '@babel/template': 7.27.2 '@babel/types': 7.28.4 - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -12832,7 +13103,7 @@ snapshots: dependencies: '@changesets/types': 6.1.0 - '@changesets/cli@2.29.6(@types/node@22.16.5)': + '@changesets/cli@2.29.6(@types/node@22.18.6)': dependencies: '@changesets/apply-release-plan': 7.0.12 '@changesets/assemble-release-plan': 6.0.9 @@ -12848,7 +13119,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@changesets/write': 0.4.0 - '@inquirer/external-editor': 1.0.1(@types/node@22.16.5) + '@inquirer/external-editor': 1.0.1(@types/node@22.18.6) '@manypkg/get-packages': 1.1.3 ansi-colors: 4.1.3 ci-info: 3.9.0 @@ -13006,81 +13277,159 @@ snapshots: '@whatwg-node/promise-helpers': 1.3.2 tslib: 2.8.1 + '@esbuild/aix-ppc64@0.25.10': + optional: true + '@esbuild/aix-ppc64@0.25.9': optional: true + '@esbuild/android-arm64@0.25.10': + optional: true + '@esbuild/android-arm64@0.25.9': optional: true + '@esbuild/android-arm@0.25.10': + optional: true + '@esbuild/android-arm@0.25.9': optional: true + '@esbuild/android-x64@0.25.10': + optional: true + '@esbuild/android-x64@0.25.9': optional: true + '@esbuild/darwin-arm64@0.25.10': + optional: true + '@esbuild/darwin-arm64@0.25.9': optional: true + '@esbuild/darwin-x64@0.25.10': + optional: true + '@esbuild/darwin-x64@0.25.9': optional: true + '@esbuild/freebsd-arm64@0.25.10': + optional: true + '@esbuild/freebsd-arm64@0.25.9': optional: true + '@esbuild/freebsd-x64@0.25.10': + optional: true + '@esbuild/freebsd-x64@0.25.9': optional: true + '@esbuild/linux-arm64@0.25.10': + optional: true + '@esbuild/linux-arm64@0.25.9': optional: true + '@esbuild/linux-arm@0.25.10': + optional: true + '@esbuild/linux-arm@0.25.9': optional: true + '@esbuild/linux-ia32@0.25.10': + optional: true + '@esbuild/linux-ia32@0.25.9': optional: true + '@esbuild/linux-loong64@0.25.10': + optional: true + '@esbuild/linux-loong64@0.25.9': optional: true + '@esbuild/linux-mips64el@0.25.10': + optional: true + '@esbuild/linux-mips64el@0.25.9': optional: true + '@esbuild/linux-ppc64@0.25.10': + optional: true + '@esbuild/linux-ppc64@0.25.9': optional: true + '@esbuild/linux-riscv64@0.25.10': + optional: true + '@esbuild/linux-riscv64@0.25.9': optional: true + '@esbuild/linux-s390x@0.25.10': + optional: true + '@esbuild/linux-s390x@0.25.9': optional: true + '@esbuild/linux-x64@0.25.10': + optional: true + '@esbuild/linux-x64@0.25.9': optional: true - '@esbuild/netbsd-arm64@0.25.9': + '@esbuild/netbsd-arm64@0.25.10': optional: true - '@esbuild/netbsd-x64@0.25.9': + '@esbuild/netbsd-arm64@0.25.9': optional: true - '@esbuild/openbsd-arm64@0.25.9': + '@esbuild/netbsd-x64@0.25.10': + optional: true + + '@esbuild/netbsd-x64@0.25.9': + optional: true + + '@esbuild/openbsd-arm64@0.25.10': + optional: true + + '@esbuild/openbsd-arm64@0.25.9': + optional: true + + '@esbuild/openbsd-x64@0.25.10': optional: true '@esbuild/openbsd-x64@0.25.9': optional: true + '@esbuild/openharmony-arm64@0.25.10': + optional: true + '@esbuild/openharmony-arm64@0.25.9': optional: true + '@esbuild/sunos-x64@0.25.10': + optional: true + '@esbuild/sunos-x64@0.25.9': optional: true + '@esbuild/win32-arm64@0.25.10': + optional: true + '@esbuild/win32-arm64@0.25.9': optional: true + '@esbuild/win32-ia32@0.25.10': + optional: true + '@esbuild/win32-ia32@0.25.9': optional: true + '@esbuild/win32-x64@0.25.10': + optional: true + '@esbuild/win32-x64@0.25.9': optional: true @@ -13109,7 +13458,7 @@ snapshots: '@eslint/config-array@0.19.1': dependencies: '@eslint/object-schema': 2.1.5 - debug: 4.4.1 + debug: 4.4.0 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -13125,7 +13474,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.4.1 + debug: 4.4.0 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.2 @@ -13139,7 +13488,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.4.1 + debug: 4.4.0 espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -13515,7 +13864,7 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@graphql-tools/executor-http@1.3.3(@types/node@22.16.5)(graphql@16.11.0)': + '@graphql-tools/executor-http@1.3.3(@types/node@22.18.6)(graphql@16.11.0)': dependencies: '@graphql-hive/signal': 1.0.0 '@graphql-tools/executor-common': 0.0.4(graphql@16.11.0) @@ -13525,7 +13874,7 @@ snapshots: '@whatwg-node/fetch': 0.10.8 '@whatwg-node/promise-helpers': 1.3.2 graphql: 16.11.0 - meros: 1.3.0(@types/node@22.16.5) + meros: 1.3.0(@types/node@22.18.6) tslib: 2.8.1 transitivePeerDependencies: - '@types/node' @@ -13706,7 +14055,7 @@ snapshots: '@types/js-yaml': 4.0.9 '@whatwg-node/fetch': 0.10.9 chalk: 4.1.2 - debug: 4.4.1 + debug: 4.4.3 dotenv: 16.6.1 graphql: 16.11.0 graphql-request: 6.1.0(graphql@16.11.0) @@ -13774,10 +14123,10 @@ snapshots: - uWebSockets.js - utf-8-validate - '@graphql-tools/url-loader@8.0.31(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0)': + '@graphql-tools/url-loader@8.0.31(@types/node@22.18.6)(crossws@0.3.5)(graphql@16.11.0)': dependencies: '@graphql-tools/executor-graphql-ws': 2.0.5(crossws@0.3.5)(graphql@16.11.0) - '@graphql-tools/executor-http': 1.3.3(@types/node@22.16.5)(graphql@16.11.0) + '@graphql-tools/executor-http': 1.3.3(@types/node@22.18.6)(graphql@16.11.0) '@graphql-tools/executor-legacy-ws': 1.1.17(graphql@16.11.0) '@graphql-tools/utils': 10.8.6(graphql@16.11.0) '@graphql-tools/wrap': 10.1.0(graphql@16.11.0) @@ -13872,12 +14221,28 @@ snapshots: protobufjs: 7.5.3 yargs: 17.7.2 + '@hapi/address@5.1.1': + dependencies: + '@hapi/hoek': 11.0.7 + + '@hapi/formula@3.0.2': {} + + '@hapi/hoek@11.0.7': {} + '@hapi/hoek@9.3.0': {} + '@hapi/pinpoint@2.0.1': {} + + '@hapi/tlds@1.1.3': {} + '@hapi/topo@5.1.0': dependencies: '@hapi/hoek': 9.3.0 + '@hapi/topo@6.0.2': + dependencies: + '@hapi/hoek': 11.0.7 + '@hey-api/codegen-core@0.0.1(typescript@5.9.2)': dependencies: typescript: 5.9.2 @@ -13919,7 +14284,7 @@ snapshots: '@humanwhocodes/config-array@0.13.0': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.4.1 + debug: 4.4.0 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -14048,6 +14413,14 @@ snapshots: '@types/node': 22.16.5 optional: true + '@inquirer/confirm@5.1.16(@types/node@22.18.6)': + dependencies: + '@inquirer/core': 10.2.0(@types/node@22.18.6) + '@inquirer/type': 3.0.8(@types/node@22.18.6) + optionalDependencies: + '@types/node': 22.18.6 + optional: true + '@inquirer/core@10.2.0(@types/node@22.15.29)': dependencies: '@inquirer/figures': 1.0.13 @@ -14075,12 +14448,26 @@ snapshots: '@types/node': 22.16.5 optional: true - '@inquirer/external-editor@1.0.1(@types/node@22.16.5)': + '@inquirer/core@10.2.0(@types/node@22.18.6)': + dependencies: + '@inquirer/figures': 1.0.13 + '@inquirer/type': 3.0.8(@types/node@22.18.6) + ansi-escapes: 4.3.2 + cli-width: 4.1.0 + mute-stream: 2.0.0 + signal-exit: 4.1.0 + wrap-ansi: 6.2.0 + yoctocolors-cjs: 2.1.3 + optionalDependencies: + '@types/node': 22.18.6 + optional: true + + '@inquirer/external-editor@1.0.1(@types/node@22.18.6)': dependencies: chardet: 2.1.0 iconv-lite: 0.6.3 optionalDependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 '@inquirer/figures@1.0.13': {} @@ -14093,6 +14480,11 @@ snapshots: '@types/node': 22.16.5 optional: true + '@inquirer/type@3.0.8(@types/node@22.18.6)': + optionalDependencies: + '@types/node': 22.18.6 + optional: true + '@isaacs/balanced-match@4.0.1': {} '@isaacs/brace-expansion@5.0.0': @@ -14114,7 +14506,7 @@ snapshots: '@jridgewell/gen-mapping@0.3.12': dependencies: - '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.29 '@jridgewell/gen-mapping@0.3.13': @@ -14139,8 +14531,6 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.0': {} - '@jridgewell/sourcemap-codec@1.5.4': {} - '@jridgewell/sourcemap-codec@1.5.5': {} '@jridgewell/trace-mapping@0.3.25': @@ -14151,7 +14541,7 @@ snapshots: '@jridgewell/trace-mapping@0.3.29': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping@0.3.30': dependencies: @@ -14161,7 +14551,7 @@ snapshots: '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@js-sdsl/ordered-map@4.4.2': {} @@ -14418,7 +14808,7 @@ snapshots: '@orama/orama@3.1.13': {} - '@oxc-project/types@0.89.0': {} + '@oxc-project/types@0.92.0': {} '@oxc-transform/binding-android-arm64@0.82.3': optional: true @@ -16003,48 +16393,48 @@ snapshots: '@repeaterjs/repeater@3.0.6': {} - '@rolldown/binding-android-arm64@1.0.0-beta.38': + '@rolldown/binding-android-arm64@1.0.0-beta.40': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-beta.38': + '@rolldown/binding-darwin-arm64@1.0.0-beta.40': optional: true - '@rolldown/binding-darwin-x64@1.0.0-beta.38': + '@rolldown/binding-darwin-x64@1.0.0-beta.40': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-beta.38': + '@rolldown/binding-freebsd-x64@1.0.0-beta.40': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.38': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.40': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.38': + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.40': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.38': + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.40': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.38': + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.40': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-beta.38': + '@rolldown/binding-linux-x64-musl@1.0.0-beta.40': optional: true - '@rolldown/binding-openharmony-arm64@1.0.0-beta.38': + '@rolldown/binding-openharmony-arm64@1.0.0-beta.40': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-beta.38': + '@rolldown/binding-wasm32-wasi@1.0.0-beta.40': dependencies: '@napi-rs/wasm-runtime': 1.0.5 optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.38': + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.40': optional: true - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.38': + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.40': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.38': + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.40': optional: true '@rolldown/pluginutils@1.0.0-beta.27': {} @@ -16055,131 +16445,137 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.36': {} - '@rolldown/pluginutils@1.0.0-beta.38': {} - - '@rollup/rollup-android-arm-eabi@4.45.1': - optional: true + '@rolldown/pluginutils@1.0.0-beta.40': {} '@rollup/rollup-android-arm-eabi@4.50.1': optional: true - '@rollup/rollup-android-arm64@4.45.1': + '@rollup/rollup-android-arm-eabi@4.52.2': optional: true '@rollup/rollup-android-arm64@4.50.1': optional: true - '@rollup/rollup-darwin-arm64@4.45.1': + '@rollup/rollup-android-arm64@4.52.2': optional: true '@rollup/rollup-darwin-arm64@4.50.1': optional: true - '@rollup/rollup-darwin-x64@4.45.1': + '@rollup/rollup-darwin-arm64@4.52.2': optional: true '@rollup/rollup-darwin-x64@4.50.1': optional: true - '@rollup/rollup-freebsd-arm64@4.45.1': + '@rollup/rollup-darwin-x64@4.52.2': optional: true '@rollup/rollup-freebsd-arm64@4.50.1': optional: true - '@rollup/rollup-freebsd-x64@4.45.1': + '@rollup/rollup-freebsd-arm64@4.52.2': optional: true '@rollup/rollup-freebsd-x64@4.50.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.45.1': + '@rollup/rollup-freebsd-x64@4.52.2': optional: true '@rollup/rollup-linux-arm-gnueabihf@4.50.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.45.1': + '@rollup/rollup-linux-arm-gnueabihf@4.52.2': optional: true '@rollup/rollup-linux-arm-musleabihf@4.50.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.45.1': + '@rollup/rollup-linux-arm-musleabihf@4.52.2': optional: true '@rollup/rollup-linux-arm64-gnu@4.50.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.45.1': + '@rollup/rollup-linux-arm64-gnu@4.52.2': optional: true '@rollup/rollup-linux-arm64-musl@4.50.1': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.45.1': + '@rollup/rollup-linux-arm64-musl@4.52.2': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.50.1': + '@rollup/rollup-linux-loong64-gnu@4.52.2': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.45.1': + '@rollup/rollup-linux-loongarch64-gnu@4.50.1': optional: true '@rollup/rollup-linux-ppc64-gnu@4.50.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.45.1': + '@rollup/rollup-linux-ppc64-gnu@4.52.2': optional: true '@rollup/rollup-linux-riscv64-gnu@4.50.1': optional: true - '@rollup/rollup-linux-riscv64-musl@4.45.1': + '@rollup/rollup-linux-riscv64-gnu@4.52.2': optional: true '@rollup/rollup-linux-riscv64-musl@4.50.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.45.1': + '@rollup/rollup-linux-riscv64-musl@4.52.2': optional: true '@rollup/rollup-linux-s390x-gnu@4.50.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.45.1': + '@rollup/rollup-linux-s390x-gnu@4.52.2': optional: true '@rollup/rollup-linux-x64-gnu@4.50.1': optional: true - '@rollup/rollup-linux-x64-musl@4.45.1': + '@rollup/rollup-linux-x64-gnu@4.52.2': optional: true '@rollup/rollup-linux-x64-musl@4.50.1': optional: true + '@rollup/rollup-linux-x64-musl@4.52.2': + optional: true + '@rollup/rollup-openharmony-arm64@4.50.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.45.1': + '@rollup/rollup-openharmony-arm64@4.52.2': optional: true '@rollup/rollup-win32-arm64-msvc@4.50.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.45.1': + '@rollup/rollup-win32-arm64-msvc@4.52.2': optional: true '@rollup/rollup-win32-ia32-msvc@4.50.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.45.1': + '@rollup/rollup-win32-ia32-msvc@4.52.2': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.52.2': optional: true '@rollup/rollup-win32-x64-msvc@4.50.1': optional: true + '@rollup/rollup-win32-x64-msvc@4.52.2': + optional: true + '@rtsao/scc@1.1.0': {} '@rushstack/eslint-patch@1.10.4': {} @@ -16254,7 +16650,7 @@ snapshots: '@size-limit/esbuild@11.2.0(size-limit@11.2.0)': dependencies: - esbuild: 0.25.9 + esbuild: 0.25.10 nanoid: 5.1.5 size-limit: 11.2.0 @@ -16357,13 +16753,13 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/builder-vite@8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@storybook/builder-vite@8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@storybook/csf-plugin': 8.6.12(storybook@8.6.12(prettier@3.6.2)) browser-assert: 1.2.1 storybook: 8.6.12(prettier@3.6.2) ts-dedent: 2.2.0 - vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) '@storybook/components@8.6.12(storybook@8.6.12(prettier@3.6.2))': dependencies: @@ -16374,8 +16770,8 @@ snapshots: '@storybook/theming': 8.6.12(storybook@8.6.12(prettier@3.6.2)) better-opn: 3.0.2 browser-assert: 1.2.1 - esbuild: 0.25.9 - esbuild-register: 3.6.0(esbuild@0.25.9) + esbuild: 0.25.10 + esbuild-register: 3.6.0(esbuild@0.25.10) jsdoc-type-pratt-parser: 4.1.0 process: 0.11.10 recast: 0.23.11 @@ -16425,9 +16821,9 @@ snapshots: dependencies: storybook: 8.6.12(prettier@3.6.2) - '@storybook/web-components-vite@8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@storybook/web-components-vite@8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2))(vite@7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: - '@storybook/builder-vite': 8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + '@storybook/builder-vite': 8.6.12(storybook@8.6.12(prettier@3.6.2))(vite@7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) '@storybook/web-components': 8.6.12(lit@3.3.1)(storybook@8.6.12(prettier@3.6.2)) magic-string: 0.30.17 storybook: 8.6.12(prettier@3.6.2) @@ -16714,18 +17110,18 @@ snapshots: '@types/docker-modem@3.0.6': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 '@types/ssh2': 1.15.5 '@types/dockerode@3.3.43': dependencies: '@types/docker-modem': 3.0.6 - '@types/node': 22.16.5 + '@types/node': 22.18.6 '@types/ssh2': 1.15.5 '@types/estree-jsx@1.0.5': dependencies: - '@types/estree': 1.0.7 + '@types/estree': 1.0.8 '@types/estree@1.0.7': {} @@ -16753,15 +17149,11 @@ snapshots: '@types/node@12.20.55': {} - '@types/node@18.19.120': + '@types/node@18.19.127': dependencies: undici-types: 5.26.5 - '@types/node@18.19.124': - dependencies: - undici-types: 5.26.5 - - '@types/node@20.19.9': + '@types/node@20.19.17': dependencies: undici-types: 6.21.0 @@ -16773,6 +17165,10 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/node@22.18.6': + dependencies: + undici-types: 6.21.0 + '@types/parse-json@4.0.2': {} '@types/postcss-prefix-selector@1.16.3': @@ -16793,7 +17189,7 @@ snapshots: '@types/request@2.48.12': dependencies: '@types/caseless': 0.12.5 - '@types/node': 22.16.5 + '@types/node': 22.18.6 '@types/tough-cookie': 4.0.5 form-data: 2.5.5 @@ -16801,16 +17197,16 @@ snapshots: '@types/ssh2-streams@0.1.12': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 '@types/ssh2@0.5.52': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 '@types/ssh2-streams': 0.1.12 '@types/ssh2@1.15.5': dependencies: - '@types/node': 18.19.124 + '@types/node': 18.19.127 '@types/statuses@2.0.6': {} @@ -16830,7 +17226,7 @@ snapshots: '@types/ws@8.18.1': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1)(typescript@5.9.2)': dependencies: @@ -16839,7 +17235,7 @@ snapshots: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.1)(typescript@5.9.2) '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.9.2) - debug: 4.4.1 + debug: 4.4.3 eslint: 8.57.1 graphemer: 1.4.0 ignore: 5.3.2 @@ -16898,7 +17294,7 @@ snapshots: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.2) - debug: 4.4.1 + debug: 4.4.3 eslint: 8.57.1 optionalDependencies: typescript: 5.9.2 @@ -16956,7 +17352,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.2) '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.9.2) - debug: 4.4.1 + debug: 4.4.3 eslint: 8.57.1 tsutils: 3.21.0(typescript@5.9.2) optionalDependencies: @@ -16969,7 +17365,7 @@ snapshots: '@typescript-eslint/types': 8.43.0 '@typescript-eslint/typescript-estree': 8.43.0(typescript@5.9.2) '@typescript-eslint/utils': 8.43.0(eslint@8.57.1)(typescript@5.9.2) - debug: 4.4.1 + debug: 4.4.3 eslint: 8.57.1 ts-api-utils: 2.1.0(typescript@5.9.2) typescript: 5.9.2 @@ -16981,7 +17377,7 @@ snapshots: '@typescript-eslint/types': 8.43.0 '@typescript-eslint/typescript-estree': 8.43.0(typescript@5.9.2) '@typescript-eslint/utils': 8.43.0(eslint@9.17.0(jiti@2.5.1))(typescript@5.9.2) - debug: 4.4.1 + debug: 4.4.3 eslint: 9.17.0(jiti@2.5.1) ts-api-utils: 2.1.0(typescript@5.9.2) typescript: 5.9.2 @@ -16996,7 +17392,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.4.1 + debug: 4.4.3 globby: 11.1.0 is-glob: 4.0.3 semver: 7.7.2 @@ -17071,7 +17467,7 @@ snapshots: '@typescript/vfs@1.6.1(typescript@5.4.5)': dependencies: - debug: 4.4.1 + debug: 4.4.3 typescript: 5.4.5 transitivePeerDependencies: - supports-color @@ -17084,12 +17480,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@vanilla-extract/compiler@0.3.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)': + '@vanilla-extract/compiler@0.3.1(@types/node@22.18.6)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)': dependencies: '@vanilla-extract/css': 1.17.4(babel-plugin-macros@3.1.0) '@vanilla-extract/integration': 8.0.4(babel-plugin-macros@3.1.0) - vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) - vite-node: 3.2.4(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite-node: 3.2.4(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -17126,6 +17522,15 @@ snapshots: dependencies: '@vanilla-extract/private': 1.0.9 + '@vanilla-extract/esbuild-plugin@2.3.18(babel-plugin-macros@3.1.0)(esbuild@0.25.10)': + dependencies: + '@vanilla-extract/integration': 8.0.4(babel-plugin-macros@3.1.0) + optionalDependencies: + esbuild: 0.25.10 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + '@vanilla-extract/esbuild-plugin@2.3.18(babel-plugin-macros@3.1.0)(esbuild@0.25.9)': dependencies: '@vanilla-extract/integration': 8.0.4(babel-plugin-macros@3.1.0) @@ -17157,11 +17562,11 @@ snapshots: dependencies: '@vanilla-extract/css': 1.17.4(babel-plugin-macros@3.1.0) - '@vanilla-extract/vite-plugin@5.1.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1)': + '@vanilla-extract/vite-plugin@5.1.1(@types/node@22.18.6)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))(yaml@2.8.1)': dependencies: - '@vanilla-extract/compiler': 0.3.1(@types/node@22.16.5)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + '@vanilla-extract/compiler': 0.3.1(@types/node@22.18.6)(babel-plugin-macros@3.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) '@vanilla-extract/integration': 8.0.4(babel-plugin-macros@3.1.0) - vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -17185,11 +17590,11 @@ snapshots: transitivePeerDependencies: - '@swc/helpers' - '@vitejs/plugin-react-swc@3.11.0(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@vitejs/plugin-react-swc@3.11.0(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@rolldown/pluginutils': 1.0.0-beta.27 '@swc/core': 1.13.1 - vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@swc/helpers' @@ -17205,7 +17610,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@5.0.2(vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@vitejs/plugin-react@5.0.2(vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@babel/core': 7.28.4 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.4) @@ -17213,7 +17618,7 @@ snapshots: '@rolldown/pluginutils': 1.0.0-beta.34 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - supports-color @@ -17240,26 +17645,35 @@ snapshots: '@types/chai': 5.2.2 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 - chai: 5.2.1 + chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(vite@7.0.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@vitest/mocker@3.2.4(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(vite@7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.19 optionalDependencies: msw: 2.11.1(@types/node@22.15.29)(typescript@5.9.2) - vite: 7.0.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) - '@vitest/mocker@3.2.4(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(vite@7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + '@vitest/mocker@3.2.4(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(vite@7.1.7(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 - magic-string: 0.30.17 + magic-string: 0.30.19 optionalDependencies: msw: 2.11.1(@types/node@22.16.5)(typescript@5.9.2) - vite: 7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + + '@vitest/mocker@3.2.4(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(vite@7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.19 + optionalDependencies: + msw: 2.11.1(@types/node@22.18.6)(typescript@5.9.2) + vite: 7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) '@vitest/pretty-format@3.2.4': dependencies: @@ -17274,17 +17688,17 @@ snapshots: '@vitest/snapshot@3.2.4': dependencies: '@vitest/pretty-format': 3.2.4 - magic-string: 0.30.17 + magic-string: 0.30.19 pathe: 2.0.3 '@vitest/spy@3.2.4': dependencies: - tinyspy: 4.0.3 + tinyspy: 4.0.4 '@vitest/utils@3.2.4': dependencies: '@vitest/pretty-format': 3.2.4 - loupe: 3.1.4 + loupe: 3.2.1 tinyrainbow: 2.0.0 '@volar/language-core@2.4.15': @@ -17840,25 +18254,19 @@ snapshots: dependencies: event-target-shim: 5.0.1 - acorn-jsx@5.3.2(acorn@8.14.1): - dependencies: - acorn: 8.14.1 - acorn-jsx@5.3.2(acorn@8.15.0): dependencies: acorn: 8.15.0 acorn-walk@8.3.4: dependencies: - acorn: 8.14.1 - - acorn@8.14.1: {} + acorn: 8.15.0 acorn@8.15.0: {} agent-base@6.0.2: dependencies: - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -18077,7 +18485,7 @@ snapshots: axios: 1.12.2 is-retry-allowed: 2.2.0 - axios@0.30.0: + axios@0.30.1: dependencies: follow-redirects: 1.15.9 form-data: 4.0.4 @@ -18210,7 +18618,7 @@ snapshots: binary-install@1.1.0: dependencies: - axios: 0.30.0 + axios: 0.30.1 rimraf: 3.0.2 tar: 6.2.1 transitivePeerDependencies: @@ -18350,12 +18758,12 @@ snapshots: ccount@2.0.1: {} - chai@5.2.1: + chai@5.3.3: dependencies: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.4 + loupe: 3.2.1 pathval: 2.0.1 chalk@4.1.2: @@ -18677,6 +19085,10 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.4.3: + dependencies: + ms: 2.1.3 + decamelize@1.2.0: {} decimal.js@10.5.0: {} @@ -19055,13 +19467,42 @@ snapshots: esast-util-from-estree: 2.0.0 vfile-message: 4.0.3 - esbuild-register@3.6.0(esbuild@0.25.9): + esbuild-register@3.6.0(esbuild@0.25.10): dependencies: - debug: 4.4.1 - esbuild: 0.25.9 + debug: 4.4.3 + esbuild: 0.25.10 transitivePeerDependencies: - supports-color + esbuild@0.25.10: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.10 + '@esbuild/android-arm': 0.25.10 + '@esbuild/android-arm64': 0.25.10 + '@esbuild/android-x64': 0.25.10 + '@esbuild/darwin-arm64': 0.25.10 + '@esbuild/darwin-x64': 0.25.10 + '@esbuild/freebsd-arm64': 0.25.10 + '@esbuild/freebsd-x64': 0.25.10 + '@esbuild/linux-arm': 0.25.10 + '@esbuild/linux-arm64': 0.25.10 + '@esbuild/linux-ia32': 0.25.10 + '@esbuild/linux-loong64': 0.25.10 + '@esbuild/linux-mips64el': 0.25.10 + '@esbuild/linux-ppc64': 0.25.10 + '@esbuild/linux-riscv64': 0.25.10 + '@esbuild/linux-s390x': 0.25.10 + '@esbuild/linux-x64': 0.25.10 + '@esbuild/netbsd-arm64': 0.25.10 + '@esbuild/netbsd-x64': 0.25.10 + '@esbuild/openbsd-arm64': 0.25.10 + '@esbuild/openbsd-x64': 0.25.10 + '@esbuild/openharmony-arm64': 0.25.10 + '@esbuild/sunos-x64': 0.25.10 + '@esbuild/win32-arm64': 0.25.10 + '@esbuild/win32-ia32': 0.25.10 + '@esbuild/win32-x64': 0.25.10 + esbuild@0.25.9: optionalDependencies: '@esbuild/aix-ppc64': 0.25.9 @@ -19103,7 +19544,7 @@ snapshots: dependencies: eslint: 8.57.1 - eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.26.0(@babel/core@7.28.4))(@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.28.4))(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1)(typescript@5.9.2): + eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.26.0(@babel/core@7.28.4))(@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.28.4))(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1)(typescript@5.9.2): dependencies: '@babel/core': 7.26.10 '@babel/eslint-parser': 7.25.9(@babel/core@7.26.10)(eslint@8.57.1) @@ -19114,7 +19555,7 @@ snapshots: confusing-browser-globals: 1.0.11 eslint: 8.57.1 eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.26.0(@babel/core@7.28.4))(@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.28.4))(eslint@8.57.1) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1) eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1)(typescript@5.9.2) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.57.1) eslint-plugin-react: 7.37.3(eslint@8.57.1) @@ -19154,7 +19595,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.1(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: @@ -19165,7 +19606,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.43.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.43.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: @@ -19188,7 +19629,7 @@ snapshots: dependencies: eslint: 8.57.1 - eslint-plugin-import@2.32.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -19199,7 +19640,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -19228,7 +19669,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.43.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.32.0)(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.43.0(eslint@8.57.1)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -19467,8 +19908,8 @@ snapshots: espree@9.6.1: dependencies: - acorn: 8.14.1 - acorn-jsx: 5.3.2(acorn@8.14.1) + acorn: 8.15.0 + acorn-jsx: 5.3.2(acorn@8.15.0) eslint-visitor-keys: 3.4.3 esprima@4.0.1: {} @@ -19528,7 +19969,7 @@ snapshots: eval@0.1.8: dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 require-like: 0.1.2 event-target-shim@5.0.1: {} @@ -19759,7 +20200,7 @@ snapshots: unist-util-visit: 5.0.0 zod: 4.1.5 - fumadocs-mdx@11.9.0(fumadocs-core@15.7.10(@types/react@18.3.18)(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(vite@7.1.5(@types/node@22.15.29)(tsx@4.20.5)): + fumadocs-mdx@11.9.0(fumadocs-core@15.7.10(@types/react@18.3.18)(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(next@15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(vite@7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)): dependencies: '@mdx-js/mdx': 3.1.1 '@standard-schema/spec': 1.0.0 @@ -19780,7 +20221,7 @@ snapshots: optionalDependencies: next: 15.5.2(@babel/core@7.28.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 - vite: 7.1.5(@types/node@22.15.29)(tsx@4.20.5) + vite: 7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - supports-color @@ -20055,13 +20496,13 @@ snapshots: - uWebSockets.js - utf-8-validate - graphql-config@5.1.5(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2): + graphql-config@5.1.5(@types/node@22.18.6)(crossws@0.3.5)(graphql@16.11.0)(typescript@5.9.2): dependencies: '@graphql-tools/graphql-file-loader': 8.0.20(graphql@16.11.0) '@graphql-tools/json-file-loader': 8.0.18(graphql@16.11.0) '@graphql-tools/load': 8.1.0(graphql@16.11.0) '@graphql-tools/merge': 9.0.24(graphql@16.11.0) - '@graphql-tools/url-loader': 8.0.31(@types/node@22.16.5)(crossws@0.3.5)(graphql@16.11.0) + '@graphql-tools/url-loader': 8.0.31(@types/node@22.18.6)(crossws@0.3.5)(graphql@16.11.0) '@graphql-tools/utils': 10.8.6(graphql@16.11.0) cosmiconfig: 8.3.6(typescript@5.9.2) graphql: 16.11.0 @@ -20138,7 +20579,7 @@ snapshots: happy-dom@18.0.1: dependencies: - '@types/node': 20.19.9 + '@types/node': 20.19.17 '@types/whatwg-mimetype': 3.0.2 whatwg-mimetype: 3.0.0 @@ -20252,28 +20693,28 @@ snapshots: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.3 - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.3 - debug: 4.4.1 + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -20609,6 +21050,16 @@ snapshots: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 + joi@18.0.1: + dependencies: + '@hapi/address': 5.1.1 + '@hapi/formula': 3.0.2 + '@hapi/hoek': 11.0.7 + '@hapi/pinpoint': 2.0.1 + '@hapi/tlds': 1.1.3 + '@hapi/topo': 6.0.2 + '@standard-schema/spec': 1.0.0 + jose@5.10.0: {} jose@6.1.0: {} @@ -20861,7 +21312,7 @@ snapshots: dependencies: js-tokens: 4.0.0 - loupe@3.1.4: {} + loupe@3.2.1: {} lower-case-first@2.0.2: dependencies: @@ -21093,9 +21544,9 @@ snapshots: optionalDependencies: '@types/node': 22.15.29 - meros@1.3.0(@types/node@22.16.5): + meros@1.3.0(@types/node@22.18.6): optionalDependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 micromark-core-commonmark@2.0.2: dependencies: @@ -21370,7 +21821,7 @@ snapshots: micromark@4.0.1: dependencies: '@types/debug': 4.1.12 - debug: 4.4.1 + debug: 4.4.3 decode-named-character-reference: 1.0.2 devlop: 1.1.0 micromark-core-commonmark: 2.0.2 @@ -21518,6 +21969,32 @@ snapshots: - '@types/node' optional: true + msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2): + dependencies: + '@bundled-es-modules/cookie': 2.0.1 + '@bundled-es-modules/statuses': 1.0.1 + '@inquirer/confirm': 5.1.16(@types/node@22.18.6) + '@mswjs/interceptors': 0.39.6 + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/until': 2.1.0 + '@types/cookie': 0.6.0 + '@types/statuses': 2.0.6 + graphql: 16.11.0 + headers-polyfill: 4.0.3 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + picocolors: 1.1.1 + strict-event-emitter: 0.5.1 + tough-cookie: 6.0.0 + type-fest: 4.41.0 + yargs: 17.7.2 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - '@types/node' + optional: true + muggle-string@0.4.1: {} multiformats@9.9.0: {} @@ -22086,7 +22563,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.16.5 + '@types/node': 22.18.6 long: 5.3.2 protobufjs@7.5.4: @@ -22101,7 +22578,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.16.5 + '@types/node': 22.18.6 long: 5.3.2 proxy-compare@3.0.1: {} @@ -22533,7 +23010,7 @@ snapshots: dependencies: glob: 7.2.3 - rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.38)(typescript@5.9.2): + rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.40)(typescript@5.9.2): dependencies: '@babel/generator': 7.28.3 '@babel/parser': 7.28.3 @@ -22543,59 +23020,33 @@ snapshots: debug: 4.4.1 dts-resolver: 2.1.2 get-tsconfig: 4.10.1 - rolldown: 1.0.0-beta.38 + rolldown: 1.0.0-beta.40 optionalDependencies: typescript: 5.9.2 transitivePeerDependencies: - oxc-resolver - supports-color - rolldown@1.0.0-beta.38: + rolldown@1.0.0-beta.40: dependencies: - '@oxc-project/types': 0.89.0 - '@rolldown/pluginutils': 1.0.0-beta.38 + '@oxc-project/types': 0.92.0 + '@rolldown/pluginutils': 1.0.0-beta.40 ansis: 4.1.0 optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-beta.38 - '@rolldown/binding-darwin-arm64': 1.0.0-beta.38 - '@rolldown/binding-darwin-x64': 1.0.0-beta.38 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.38 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.38 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.38 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.38 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.38 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.38 - '@rolldown/binding-openharmony-arm64': 1.0.0-beta.38 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.38 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.38 - '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.38 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.38 - - rollup@4.45.1: - dependencies: - '@types/estree': 1.0.8 - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.45.1 - '@rollup/rollup-android-arm64': 4.45.1 - '@rollup/rollup-darwin-arm64': 4.45.1 - '@rollup/rollup-darwin-x64': 4.45.1 - '@rollup/rollup-freebsd-arm64': 4.45.1 - '@rollup/rollup-freebsd-x64': 4.45.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.45.1 - '@rollup/rollup-linux-arm-musleabihf': 4.45.1 - '@rollup/rollup-linux-arm64-gnu': 4.45.1 - '@rollup/rollup-linux-arm64-musl': 4.45.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.45.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.45.1 - '@rollup/rollup-linux-riscv64-gnu': 4.45.1 - '@rollup/rollup-linux-riscv64-musl': 4.45.1 - '@rollup/rollup-linux-s390x-gnu': 4.45.1 - '@rollup/rollup-linux-x64-gnu': 4.45.1 - '@rollup/rollup-linux-x64-musl': 4.45.1 - '@rollup/rollup-win32-arm64-msvc': 4.45.1 - '@rollup/rollup-win32-ia32-msvc': 4.45.1 - '@rollup/rollup-win32-x64-msvc': 4.45.1 - fsevents: 2.3.3 + '@rolldown/binding-android-arm64': 1.0.0-beta.40 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.40 + '@rolldown/binding-darwin-x64': 1.0.0-beta.40 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.40 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.40 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.40 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.40 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.40 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.40 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.40 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.40 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.40 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.40 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.40 rollup@4.50.1: dependencies: @@ -22624,6 +23075,34 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.50.1 fsevents: 2.3.3 + rollup@4.52.2: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.52.2 + '@rollup/rollup-android-arm64': 4.52.2 + '@rollup/rollup-darwin-arm64': 4.52.2 + '@rollup/rollup-darwin-x64': 4.52.2 + '@rollup/rollup-freebsd-arm64': 4.52.2 + '@rollup/rollup-freebsd-x64': 4.52.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.52.2 + '@rollup/rollup-linux-arm-musleabihf': 4.52.2 + '@rollup/rollup-linux-arm64-gnu': 4.52.2 + '@rollup/rollup-linux-arm64-musl': 4.52.2 + '@rollup/rollup-linux-loong64-gnu': 4.52.2 + '@rollup/rollup-linux-ppc64-gnu': 4.52.2 + '@rollup/rollup-linux-riscv64-gnu': 4.52.2 + '@rollup/rollup-linux-riscv64-musl': 4.52.2 + '@rollup/rollup-linux-s390x-gnu': 4.52.2 + '@rollup/rollup-linux-x64-gnu': 4.52.2 + '@rollup/rollup-linux-x64-musl': 4.52.2 + '@rollup/rollup-openharmony-arm64': 4.52.2 + '@rollup/rollup-win32-arm64-msvc': 4.52.2 + '@rollup/rollup-win32-ia32-msvc': 4.52.2 + '@rollup/rollup-win32-x64-gnu': 4.52.2 + '@rollup/rollup-win32-x64-msvc': 4.52.2 + fsevents: 2.3.3 + rrweb-cssom@0.8.0: {} run-applescript@7.0.0: {} @@ -23203,7 +23682,7 @@ snapshots: tinyrainbow@2.0.0: {} - tinyspy@4.0.3: {} + tinyspy@4.0.4: {} title-case@3.0.3: dependencies: @@ -23266,15 +23745,15 @@ snapshots: '@ts-morph/common': 0.27.0 code-block-writer: 13.0.3 - ts-node@10.9.2(@swc/core@1.13.1)(@types/node@18.19.120)(typescript@5.5.4): + ts-node@10.9.2(@swc/core@1.13.1)(@types/node@18.19.127)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 18.19.120 - acorn: 8.14.1 + '@types/node': 18.19.127 + acorn: 8.15.0 acorn-walk: 8.3.4 arg: 4.1.3 create-require: 1.1.1 @@ -23294,7 +23773,27 @@ snapshots: '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 '@types/node': 22.15.29 - acorn: 8.14.1 + acorn: 8.15.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.9.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.13.1 + + ts-node@10.9.2(@swc/core@1.13.1)(@types/node@22.18.6)(typescript@5.9.2): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.18.6 + acorn: 8.15.0 acorn-walk: 8.3.4 arg: 4.1.3 create-require: 1.1.1 @@ -23328,8 +23827,8 @@ snapshots: diff: 8.0.2 empathic: 2.0.0 hookable: 5.5.3 - rolldown: 1.0.0-beta.38 - rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.38)(typescript@5.9.2) + rolldown: 1.0.0-beta.40 + rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.40)(typescript@5.9.2) semver: 7.7.2 tinyexec: 1.0.1 tinyglobby: 0.2.14 @@ -23450,11 +23949,11 @@ snapshots: typescript-json-schema@0.65.1(@swc/core@1.13.1): dependencies: '@types/json-schema': 7.0.15 - '@types/node': 18.19.120 + '@types/node': 18.19.127 glob: 7.2.3 path-equal: 1.2.5 safe-stable-stringify: 2.5.0 - ts-node: 10.9.2(@swc/core@1.13.1)(@types/node@18.19.120)(typescript@5.5.4) + ts-node: 10.9.2(@swc/core@1.13.1)(@types/node@18.19.127)(typescript@5.5.4) typescript: 5.5.4 yargs: 17.7.2 transitivePeerDependencies: @@ -23564,7 +24063,7 @@ snapshots: unplugin@1.16.1: dependencies: - acorn: 8.14.1 + acorn: 8.15.0 webpack-virtual-modules: 0.6.2 unstorage@1.17.1(idb-keyval@6.2.2): @@ -23721,10 +24220,10 @@ snapshots: vite-node@3.2.4(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: cac: 6.7.14 - debug: 4.4.1 + debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.1.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - jiti @@ -23742,10 +24241,31 @@ snapshots: vite-node@3.2.4(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: cac: 6.7.14 - debug: 4.4.1 + debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite-node@3.2.4(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + dependencies: + cac: 6.7.14 + debug: 4.4.3 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - jiti @@ -23771,14 +24291,14 @@ snapshots: - supports-color - typescript - vite@7.0.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + vite@7.1.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: esbuild: 0.25.9 - fdir: 6.4.6(picomatch@4.0.3) + fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.45.1 - tinyglobby: 0.2.14 + rollup: 4.50.1 + tinyglobby: 0.2.15 optionalDependencies: '@types/node': 22.15.29 fsevents: 2.3.3 @@ -23787,14 +24307,14 @@ snapshots: tsx: 4.20.5 yaml: 2.8.1 - vite@7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: esbuild: 0.25.9 - fdir: 6.4.6(picomatch@4.0.3) + fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.45.1 - tinyglobby: 0.2.14 + rollup: 4.50.1 + tinyglobby: 0.2.15 optionalDependencies: '@types/node': 22.16.5 fsevents: 2.3.3 @@ -23803,7 +24323,7 @@ snapshots: tsx: 4.20.5 yaml: 2.8.1 - vite@7.1.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + vite@7.1.5(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: esbuild: 0.25.9 fdir: 6.5.0(picomatch@4.0.3) @@ -23812,34 +24332,36 @@ snapshots: rollup: 4.50.1 tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 22.15.29 + '@types/node': 22.18.6 fsevents: 2.3.3 jiti: 2.5.1 lightningcss: 1.30.1 tsx: 4.20.5 yaml: 2.8.1 - vite@7.1.5(@types/node@22.15.29)(tsx@4.20.5): + vite@7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: - esbuild: 0.25.9 + esbuild: 0.25.10 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.50.1 + rollup: 4.52.2 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 22.15.29 fsevents: 2.3.3 + jiti: 2.5.1 + lightningcss: 1.30.1 tsx: 4.20.5 - optional: true + yaml: 2.8.1 - vite@7.1.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + vite@7.1.7(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): dependencies: - esbuild: 0.25.9 + esbuild: 0.25.10 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.50.1 + rollup: 4.52.2 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 22.16.5 @@ -23849,29 +24371,45 @@ snapshots: tsx: 4.20.5 yaml: 2.8.1 + vite@7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1): + dependencies: + esbuild: 0.25.10 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.52.2 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 22.18.6 + fsevents: 2.3.3 + jiti: 2.5.1 + lightningcss: 1.30.1 + tsx: 4.20.5 + yaml: 2.8.1 + vitest@3.2.4(@types/debug@4.1.12)(@types/node@22.15.29)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(vite@7.0.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + '@vitest/mocker': 3.2.4(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(vite@7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 - chai: 5.2.1 - debug: 4.4.1 + chai: 5.3.3 + debug: 4.4.3 expect-type: 1.2.2 - magic-string: 0.30.17 + magic-string: 0.30.19 pathe: 2.0.3 picomatch: 4.0.3 std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.0.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vite-node: 3.2.4(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) why-is-node-running: 2.3.0 optionalDependencies: @@ -23897,25 +24435,25 @@ snapshots: dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(vite@7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + '@vitest/mocker': 3.2.4(msw@2.11.1(@types/node@22.16.5)(typescript@5.9.2))(vite@7.1.7(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 - chai: 5.2.1 - debug: 4.4.1 + chai: 5.3.3 + debug: 4.4.3 expect-type: 1.2.2 - magic-string: 0.30.17 + magic-string: 0.30.19 pathe: 2.0.3 picomatch: 4.0.3 std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.0.5(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite: 7.1.7(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) vite-node: 3.2.4(@types/node@22.16.5)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) why-is-node-running: 2.3.0 optionalDependencies: @@ -23937,6 +24475,50 @@ snapshots: - tsx - yaml + vitest@3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(vite@7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.2.2 + magic-string: 0.30.19 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.15 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.1.7(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + vite-node: 3.2.4(@types/node@22.18.6)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/debug': 4.1.12 + '@types/node': 22.18.6 + happy-dom: 18.0.1 + jsdom: 26.1.0 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + vscode-uri@3.1.0: {} vue-tsc@2.2.12(typescript@5.9.2): @@ -23969,6 +24551,16 @@ snapshots: transitivePeerDependencies: - debug + wait-on@8.0.5: + dependencies: + axios: 1.12.2 + joi: 18.0.1 + lodash: 4.17.21 + minimist: 1.2.8 + rxjs: 7.8.2 + transitivePeerDependencies: + - debug + wasm-pack@0.13.1: dependencies: binary-install: 1.1.0 From 3baacfcd2076c26afc16f123c4c625f25f39ecdc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 13:55:45 -0400 Subject: [PATCH 17/36] Version Packages (#568) Co-authored-by: github-actions[bot] --- .changeset/cyan-eels-say.md | 5 ----- packages/deepbook-v3/CHANGELOG.md | 6 ++++++ packages/deepbook-v3/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/cyan-eels-say.md diff --git a/.changeset/cyan-eels-say.md b/.changeset/cyan-eels-say.md deleted file mode 100644 index 4a11a1709..000000000 --- a/.changeset/cyan-eels-say.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/deepbook-v3': minor ---- - -Support core package upgrade changes on testnet diff --git a/packages/deepbook-v3/CHANGELOG.md b/packages/deepbook-v3/CHANGELOG.md index 706975343..18136c53f 100644 --- a/packages/deepbook-v3/CHANGELOG.md +++ b/packages/deepbook-v3/CHANGELOG.md @@ -1,5 +1,11 @@ # @mysten/deepbook-v3 +## 0.18.0 + +### Minor Changes + +- 7d8bc08: Support core package upgrade changes on testnet + ## 0.17.0 ### Minor Changes diff --git a/packages/deepbook-v3/package.json b/packages/deepbook-v3/package.json index f11fac47c..19c9eee23 100644 --- a/packages/deepbook-v3/package.json +++ b/packages/deepbook-v3/package.json @@ -2,7 +2,7 @@ "name": "@mysten/deepbook-v3", "author": "Mysten Labs ", "description": "Sui Deepbook SDK", - "version": "0.17.0", + "version": "0.18.0", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", From 8d577a16ce8b2566b0f729abf17d3326036966f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Lindstr=C3=B8m?= Date: Tue, 30 Sep 2025 18:45:45 +0200 Subject: [PATCH 18/36] [seal] Endianess of randomness (#570) * Endianess... * changeset * notes --- .changeset/strong-hounds-greet.md | 5 +++++ packages/seal/src/bls12381.ts | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .changeset/strong-hounds-greet.md diff --git a/.changeset/strong-hounds-greet.md b/.changeset/strong-hounds-greet.md new file mode 100644 index 000000000..201a150fb --- /dev/null +++ b/.changeset/strong-hounds-greet.md @@ -0,0 +1,5 @@ +--- +'@mysten/seal': patch +--- + +Fix generation of random BLS scalars which would fail, and likely cause encryption to fail, for some versions of the @noble/curves dependency. diff --git a/packages/seal/src/bls12381.ts b/packages/seal/src/bls12381.ts index bc821db91..4d10a4b86 100644 --- a/packages/seal/src/bls12381.ts +++ b/packages/seal/src/bls12381.ts @@ -3,7 +3,7 @@ import type { Fp2, Fp12 } from '@noble/curves/abstract/tower'; import type { WeierstrassPoint } from '@noble/curves/abstract/weierstrass'; -import { bls12_381, bls12_381_Fr } from '@noble/curves/bls12-381'; +import { bls12_381 } from '@noble/curves/bls12-381'; import { bytesToNumberBE, bytesToNumberLE, numberToBytesBE } from '@noble/curves/utils'; export class G1Element { @@ -151,9 +151,6 @@ export class Scalar { static random(): Scalar { const randomSecretKey = bls12_381.utils.randomSecretKey(); - if (bls12_381_Fr.isLE) { - return Scalar.fromBytesLE(randomSecretKey)!; - } return Scalar.fromBytes(randomSecretKey)!; } From 4dbe921f77e78275918c504dbf5346c77347a311 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 13:08:01 -0400 Subject: [PATCH 19/36] Version Packages (#572) Co-authored-by: github-actions[bot] --- .changeset/strong-hounds-greet.md | 5 ----- packages/seal/CHANGELOG.md | 7 +++++++ packages/seal/package.json | 2 +- packages/seal/src/version.ts | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 .changeset/strong-hounds-greet.md diff --git a/.changeset/strong-hounds-greet.md b/.changeset/strong-hounds-greet.md deleted file mode 100644 index 201a150fb..000000000 --- a/.changeset/strong-hounds-greet.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/seal': patch ---- - -Fix generation of random BLS scalars which would fail, and likely cause encryption to fail, for some versions of the @noble/curves dependency. diff --git a/packages/seal/CHANGELOG.md b/packages/seal/CHANGELOG.md index 369633c55..1d63a7188 100644 --- a/packages/seal/CHANGELOG.md +++ b/packages/seal/CHANGELOG.md @@ -1,5 +1,12 @@ # @mysten/seal +## 0.8.1 + +### Patch Changes + +- 8d577a1: Fix generation of random BLS scalars which would fail, and likely cause encryption to + fail, for some versions of the @noble/curves dependency. + ## 0.8.0 ### Minor Changes diff --git a/packages/seal/package.json b/packages/seal/package.json index b3d768fe0..0e05f80f7 100644 --- a/packages/seal/package.json +++ b/packages/seal/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/seal", - "version": "0.8.0", + "version": "0.8.1", "description": "Seal SDK", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/seal/src/version.ts b/packages/seal/src/version.ts index 268516eaa..51ed354af 100644 --- a/packages/seal/src/version.ts +++ b/packages/seal/src/version.ts @@ -3,4 +3,4 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '0.8.0'; +export const PACKAGE_VERSION = '0.8.1'; From 24e6b36f5b238a416d1cf0d4ecf4d14f786d7630 Mon Sep 17 00:00:00 2001 From: Will Roeder Date: Tue, 30 Sep 2025 11:45:38 -0700 Subject: [PATCH 20/36] [Codegen] Use `bcs.option` instead of `bcs.vector` (#573) * Updating codegen to use `bcs.option` insteadf of `bcs.vector` when generating for optional structs * Added `bbbVault` to `handleBasePayment` and `handlePayment` --- .changeset/sad-showers-pay.md | 5 + packages/codegen/src/generate-utils.ts | 2 +- .../codegen/tests/generated/utils/index.ts | 2 +- packages/suins-v2/src/calls.ts | 2 + .../src/contracts/suins_payments/payments.ts | 24 ++++- .../subdomain_proxy.ts | 101 +++++++++++++++--- .../suins-v2/src/contracts/utils/index.ts | 2 +- packages/walrus/src/contracts/utils/index.ts | 2 +- 8 files changed, 119 insertions(+), 21 deletions(-) create mode 100644 .changeset/sad-showers-pay.md diff --git a/.changeset/sad-showers-pay.md b/.changeset/sad-showers-pay.md new file mode 100644 index 000000000..7d446ed53 --- /dev/null +++ b/.changeset/sad-showers-pay.md @@ -0,0 +1,5 @@ +--- +'@mysten/codegen': patch +--- + +Optional struct generation should be bcs.option instead of bcs.vector diff --git a/packages/codegen/src/generate-utils.ts b/packages/codegen/src/generate-utils.ts index c9017dbbe..3632f59d9 100644 --- a/packages/codegen/src/generate-utils.ts +++ b/packages/codegen/src/generate-utils.ts @@ -48,7 +48,7 @@ export function getPureBcsSchema(typeTag: string | TypeTag): BcsType | null if (structTag.module === 'option' && structTag.name === 'Option') { const type = getPureBcsSchema(structTag.typeParams[0]!); - return type ? bcs.vector(type) : null; + return type ? bcs.option(type) : null; } } diff --git a/packages/codegen/tests/generated/utils/index.ts b/packages/codegen/tests/generated/utils/index.ts index f1fb3e2b6..6cdde84d0 100644 --- a/packages/codegen/tests/generated/utils/index.ts +++ b/packages/codegen/tests/generated/utils/index.ts @@ -52,7 +52,7 @@ export function getPureBcsSchema(typeTag: string | TypeTag): BcsType | null if (structTag.module === 'option' && structTag.name === 'Option') { const type = getPureBcsSchema(structTag.typeParams[0]!); - return type ? bcs.vector(type) : null; + return type ? bcs.option(type) : null; } } diff --git a/packages/suins-v2/src/calls.ts b/packages/suins-v2/src/calls.ts index 62baca532..b46ace7eb 100644 --- a/packages/suins-v2/src/calls.ts +++ b/packages/suins-v2/src/calls.ts @@ -241,6 +241,7 @@ export class SuiNsCalls { arguments: { suins: this.#objectIds.suins, intent: options.arguments.intent, + bbbVault: options.arguments.bbbVault, payment: options.arguments.payment, }, typeArguments: options.typeArguments, @@ -253,6 +254,7 @@ export class SuiNsCalls { arguments: { suins: this.#objectIds.suins, intent: options.arguments.intent, + bbbVault: options.arguments.bbbVault, payment: options.arguments.payment, priceInfoObject: options.arguments.priceInfoObject, userPriceGuard: options.arguments.userPriceGuard, diff --git a/packages/suins-v2/src/contracts/suins_payments/payments.ts b/packages/suins-v2/src/contracts/suins_payments/payments.ts index 8b2ba8f8a..58a3faa06 100644 --- a/packages/suins-v2/src/contracts/suins_payments/payments.ts +++ b/packages/suins-v2/src/contracts/suins_payments/payments.ts @@ -27,10 +27,13 @@ export const PaymentsConfig = new MoveStruct({ currencies: vec_map.VecMap(type_name.TypeName, CoinTypeData), base_currency: type_name.TypeName, max_age: bcs.u64(), + /** The percentage of the payment that gets burned, in basis points. */ + burn_bps: bcs.u64(), }, }); export interface HandleBasePaymentArguments { suins: RawTransactionArgument; + bbbVault: RawTransactionArgument; intent: RawTransactionArgument; payment: RawTransactionArgument; } @@ -40,6 +43,7 @@ export interface HandleBasePaymentOptions { | HandleBasePaymentArguments | [ suins: RawTransactionArgument, + bbbVault: RawTransactionArgument, intent: RawTransactionArgument, payment: RawTransactionArgument, ]; @@ -54,10 +58,11 @@ export function handleBasePayment(options: HandleBasePaymentOptions) { const packageAddress = options.package ?? '@suins/payments'; const argumentsTypes = [ `${packageAddress}::suins::SuiNS`, + `${packageAddress}::bbb_vault::BBBVault`, `${packageAddress}::payment::PaymentIntent`, `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`, ] satisfies string[]; - const parameterNames = ['suins', 'intent', 'payment']; + const parameterNames = ['suins', 'bbbVault', 'intent', 'payment']; return (tx: Transaction) => tx.moveCall({ package: packageAddress, @@ -69,6 +74,7 @@ export function handleBasePayment(options: HandleBasePaymentOptions) { } export interface HandlePaymentArguments { suins: RawTransactionArgument; + bbbVault: RawTransactionArgument; intent: RawTransactionArgument; payment: RawTransactionArgument; priceInfoObject: RawTransactionArgument; @@ -80,6 +86,7 @@ export interface HandlePaymentOptions { | HandlePaymentArguments | [ suins: RawTransactionArgument, + bbbVault: RawTransactionArgument, intent: RawTransactionArgument, payment: RawTransactionArgument, priceInfoObject: RawTransactionArgument, @@ -103,13 +110,21 @@ export function handlePayment(options: HandlePaymentOptions) { const packageAddress = options.package ?? '@suins/payments'; const argumentsTypes = [ `${packageAddress}::suins::SuiNS`, + `${packageAddress}::bbb_vault::BBBVault`, `${packageAddress}::payment::PaymentIntent`, `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`, '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', '0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_info::PriceInfoObject', 'u64', ] satisfies string[]; - const parameterNames = ['suins', 'intent', 'payment', 'priceInfoObject', 'userPriceGuard']; + const parameterNames = [ + 'suins', + 'bbbVault', + 'intent', + 'payment', + 'priceInfoObject', + 'userPriceGuard', + ]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, @@ -228,6 +243,7 @@ export interface NewPaymentsConfigArguments { setups: RawTransactionArgument; baseCurrency: RawTransactionArgument; maxAge: RawTransactionArgument; + burnBps: RawTransactionArgument; } export interface NewPaymentsConfigOptions { package?: string; @@ -237,6 +253,7 @@ export interface NewPaymentsConfigOptions { setups: RawTransactionArgument, baseCurrency: RawTransactionArgument, maxAge: RawTransactionArgument, + burnBps: RawTransactionArgument, ]; } /** @@ -249,8 +266,9 @@ export function newPaymentsConfig(options: NewPaymentsConfigOptions) { `vector<${packageAddress}::payments::CoinTypeData>`, '0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName', 'u64', + 'u64', ] satisfies string[]; - const parameterNames = ['setups', 'baseCurrency', 'maxAge']; + const parameterNames = ['setups', 'baseCurrency', 'maxAge', 'burnBps']; return (tx: Transaction) => tx.moveCall({ package: packageAddress, diff --git a/packages/suins-v2/src/contracts/suins_temp_subdomain_proxy/subdomain_proxy.ts b/packages/suins-v2/src/contracts/suins_temp_subdomain_proxy/subdomain_proxy.ts index b89505536..ea153fe8c 100644 --- a/packages/suins-v2/src/contracts/suins_temp_subdomain_proxy/subdomain_proxy.ts +++ b/packages/suins-v2/src/contracts/suins_temp_subdomain_proxy/subdomain_proxy.ts @@ -38,8 +38,8 @@ export interface NewOptions { export function _new(options: NewOptions) { const packageAddress = options.package ?? '@suins/subdomain-proxy'; const argumentsTypes = [ - '0x0000000000000000000000000000000000000000000000000000000000000000::suins::SuiNS', - '0x0000000000000000000000000000000000000000000000000000000000000000::subdomain_registration::SubDomainRegistration', + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', 'u64', @@ -82,8 +82,8 @@ export interface NewLeafOptions { export function newLeaf(options: NewLeafOptions) { const packageAddress = options.package ?? '@suins/subdomain-proxy'; const argumentsTypes = [ - '0x0000000000000000000000000000000000000000000000000000000000000000::suins::SuiNS', - '0x0000000000000000000000000000000000000000000000000000000000000000::subdomain_registration::SubDomainRegistration', + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', 'address', @@ -115,8 +115,8 @@ export interface RemoveLeafOptions { export function removeLeaf(options: RemoveLeafOptions) { const packageAddress = options.package ?? '@suins/subdomain-proxy'; const argumentsTypes = [ - '0x0000000000000000000000000000000000000000000000000000000000000000::suins::SuiNS', - '0x0000000000000000000000000000000000000000000000000000000000000000::subdomain_registration::SubDomainRegistration', + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', ] satisfies string[]; @@ -129,6 +129,79 @@ export function removeLeaf(options: RemoveLeafOptions) { arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), }); } +export interface AddLeafMetadataArguments { + suins: RawTransactionArgument; + parent: RawTransactionArgument; + subdomainName: RawTransactionArgument; + key: RawTransactionArgument; + value: RawTransactionArgument; +} +export interface AddLeafMetadataOptions { + package?: string; + arguments: + | AddLeafMetadataArguments + | [ + suins: RawTransactionArgument, + parent: RawTransactionArgument, + subdomainName: RawTransactionArgument, + key: RawTransactionArgument, + value: RawTransactionArgument, + ]; +} +export function addLeafMetadata(options: AddLeafMetadataOptions) { + const packageAddress = options.package ?? '@suins/subdomain-proxy'; + const argumentsTypes = [ + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, + '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + ] satisfies string[]; + const parameterNames = ['suins', 'parent', 'subdomainName', 'key', 'value']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'subdomain_proxy', + function: 'add_leaf_metadata', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface RemoveLeafMetadataArguments { + suins: RawTransactionArgument; + parent: RawTransactionArgument; + subdomainName: RawTransactionArgument; + key: RawTransactionArgument; +} +export interface RemoveLeafMetadataOptions { + package?: string; + arguments: + | RemoveLeafMetadataArguments + | [ + suins: RawTransactionArgument, + parent: RawTransactionArgument, + subdomainName: RawTransactionArgument, + key: RawTransactionArgument, + ]; +} +export function removeLeafMetadata(options: RemoveLeafMetadataOptions) { + const packageAddress = options.package ?? '@suins/subdomain-proxy'; + const argumentsTypes = [ + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, + '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + ] satisfies string[]; + const parameterNames = ['suins', 'parent', 'subdomainName', 'key']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'subdomain_proxy', + function: 'remove_leaf_metadata', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} export interface EditSetupArguments { suins: RawTransactionArgument; parent: RawTransactionArgument; @@ -151,8 +224,8 @@ export interface EditSetupOptions { export function editSetup(options: EditSetupOptions) { const packageAddress = options.package ?? '@suins/subdomain-proxy'; const argumentsTypes = [ - '0x0000000000000000000000000000000000000000000000000000000000000000::suins::SuiNS', - '0x0000000000000000000000000000000000000000000000000000000000000000::subdomain_registration::SubDomainRegistration', + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', 'bool', @@ -191,8 +264,8 @@ export interface SetTargetAddressOptions { export function setTargetAddress(options: SetTargetAddressOptions) { const packageAddress = options.package ?? '@suins/subdomain-proxy'; const argumentsTypes = [ - '0x0000000000000000000000000000000000000000000000000000000000000000::suins::SuiNS', - '0x0000000000000000000000000000000000000000000000000000000000000000::subdomain_registration::SubDomainRegistration', + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, '0x0000000000000000000000000000000000000000000000000000000000000001::option::Option
', '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', ] satisfies string[]; @@ -225,8 +298,8 @@ export interface SetUserDataOptions { export function setUserData(options: SetUserDataOptions) { const packageAddress = options.package ?? '@suins/subdomain-proxy'; const argumentsTypes = [ - '0x0000000000000000000000000000000000000000000000000000000000000000::suins::SuiNS', - '0x0000000000000000000000000000000000000000000000000000000000000000::subdomain_registration::SubDomainRegistration', + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', @@ -258,8 +331,8 @@ export interface UnsetUserDataOptions { export function unsetUserData(options: UnsetUserDataOptions) { const packageAddress = options.package ?? '@suins/subdomain-proxy'; const argumentsTypes = [ - '0x0000000000000000000000000000000000000000000000000000000000000000::suins::SuiNS', - '0x0000000000000000000000000000000000000000000000000000000000000000::subdomain_registration::SubDomainRegistration', + `${packageAddress}::suins::SuiNS`, + `${packageAddress}::subdomain_registration::SubDomainRegistration`, '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', ] satisfies string[]; diff --git a/packages/suins-v2/src/contracts/utils/index.ts b/packages/suins-v2/src/contracts/utils/index.ts index db331c48b..84246b816 100644 --- a/packages/suins-v2/src/contracts/utils/index.ts +++ b/packages/suins-v2/src/contracts/utils/index.ts @@ -48,7 +48,7 @@ export function getPureBcsSchema(typeTag: string | TypeTag): BcsType | null if (structTag.module === 'option' && structTag.name === 'Option') { const type = getPureBcsSchema(structTag.typeParams[0]!); - return type ? bcs.vector(type) : null; + return type ? bcs.option(type) : null; } } diff --git a/packages/walrus/src/contracts/utils/index.ts b/packages/walrus/src/contracts/utils/index.ts index db331c48b..84246b816 100644 --- a/packages/walrus/src/contracts/utils/index.ts +++ b/packages/walrus/src/contracts/utils/index.ts @@ -48,7 +48,7 @@ export function getPureBcsSchema(typeTag: string | TypeTag): BcsType | null if (structTag.module === 'option' && structTag.name === 'Option') { const type = getPureBcsSchema(structTag.typeParams[0]!); - return type ? bcs.vector(type) : null; + return type ? bcs.option(type) : null; } } From 436de2ed5a43278d2ccc1fcf20df0d354e0ec6f7 Mon Sep 17 00:00:00 2001 From: Will Roeder Date: Tue, 30 Sep 2025 15:04:05 -0700 Subject: [PATCH 21/36] [Payment Kit] Initial Codegen + Skeleton Client (#571) * `payment-kit` codegen * Added `codegen` change for `process_registry_payment` * Updated `pnpm-lock.yaml` * Updated `pnpm-lock.yaml` * Added skeleton client * Fixed import issue * Fixed `pnpm-lock.yaml` explosion * Mark `packages/payment-kit/src/contracts/**` as generated * Addressing nits/comments * Updated `eslint` ignore line * Resolving lint issues * Temporarily make `PaymentKitClient` private --- .gitattributes | 1 + packages/payment-kit/package.json | 43 ++ packages/payment-kit/src/client.ts | 44 ++ packages/payment-kit/src/constants.ts | 11 + .../src/contracts/payment_kit/config.ts | 18 + .../payment_kit/deps/std/type_name.ts | 23 ++ .../contracts/payment_kit/deps/sui/object.ts | 14 + .../contracts/payment_kit/deps/sui/vec_map.ts | 33 ++ .../src/contracts/payment_kit/payment_kit.ts | 377 ++++++++++++++++++ .../payment-kit/src/contracts/utils/index.ts | 168 ++++++++ packages/payment-kit/src/error.ts | 4 + packages/payment-kit/src/index.ts | 9 + packages/payment-kit/src/types.ts | 16 + packages/payment-kit/sui-codegen.config.ts | 16 + packages/payment-kit/tsconfig.esm.json | 7 + packages/payment-kit/tsconfig.json | 10 + packages/payment-kit/typedoc.json | 6 + pnpm-lock.yaml | 204 +++++----- 18 files changed, 899 insertions(+), 105 deletions(-) create mode 100644 packages/payment-kit/package.json create mode 100644 packages/payment-kit/src/client.ts create mode 100644 packages/payment-kit/src/constants.ts create mode 100644 packages/payment-kit/src/contracts/payment_kit/config.ts create mode 100644 packages/payment-kit/src/contracts/payment_kit/deps/std/type_name.ts create mode 100644 packages/payment-kit/src/contracts/payment_kit/deps/sui/object.ts create mode 100644 packages/payment-kit/src/contracts/payment_kit/deps/sui/vec_map.ts create mode 100644 packages/payment-kit/src/contracts/payment_kit/payment_kit.ts create mode 100644 packages/payment-kit/src/contracts/utils/index.ts create mode 100644 packages/payment-kit/src/error.ts create mode 100644 packages/payment-kit/src/index.ts create mode 100644 packages/payment-kit/src/types.ts create mode 100644 packages/payment-kit/sui-codegen.config.ts create mode 100644 packages/payment-kit/tsconfig.esm.json create mode 100644 packages/payment-kit/tsconfig.json create mode 100644 packages/payment-kit/typedoc.json diff --git a/.gitattributes b/.gitattributes index fa7e95f4c..37180d153 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,4 @@ packages/suins-v2/src/contracts/** linguist-generated=true packages/codegen/tests/generated/** linguist-generated=true packages/walrus/src/contracts/** linguist-generated=true packages/deepbook-v3/src/contracts/** linguist-generated=true +packages/payment-kit/src/contracts/** linguist-generated=true \ No newline at end of file diff --git a/packages/payment-kit/package.json b/packages/payment-kit/package.json new file mode 100644 index 000000000..4151d5776 --- /dev/null +++ b/packages/payment-kit/package.json @@ -0,0 +1,43 @@ +{ + "name": "@mysten/payment-kit", + "version": "0.0.1", + "private": false, + "description": "Sui Payment Kit", + "license": "Apache-2.0", + "author": "Mysten Labs ", + "type": "commonjs", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/cjs/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + } + }, + "sideEffects": false, + "files": [ + "dist" + ], + "scripts": { + "clean": "rm -rf tsconfig.tsbuildinfo ./dist", + "build": "build-package", + "codegen": "sui-ts-codegen generate && pnpm lint:fix", + "prepublishOnly": "pnpm turbo build", + "prettier:check": "prettier -c --ignore-unknown .", + "prettier:fix": "prettier -w --ignore-unknown .", + "eslint:check": "eslint --max-warnings=0 .", + "eslint:fix": "pnpm run eslint:check --fix", + "lint": "pnpm run eslint:check && pnpm run prettier:check", + "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix" + }, + "devDependencies": { + "@mysten/build-scripts": "workspace:*", + "@mysten/codegen": "workspace:*", + "typescript": "^5.9.2" + }, + "dependencies": { + "@mysten/bcs": "workspace:*", + "@mysten/sui": "workspace:*" + } +} diff --git a/packages/payment-kit/src/client.ts b/packages/payment-kit/src/client.ts new file mode 100644 index 000000000..ec3ef55d4 --- /dev/null +++ b/packages/payment-kit/src/client.ts @@ -0,0 +1,44 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { PaymentKitClientError } from './error.js'; + +import { + MAINNET_PAYMENT_KIT_PACKAGE_CONFIG, + TESTNET_PAYMENT_KIT_PACKAGE_CONFIG, +} from './constants.js'; +import type { + PaymentKitClientConfig, + PaymentKitCompatibleClient, + PaymentKitPackageConfig, +} from './types.js'; + +export class PaymentKitClient { + #packageConfig: PaymentKitPackageConfig; + // @ts-expect-error - suiClient will be used in a later PR + #suiClient: PaymentKitCompatibleClient; + + private constructor(config: PaymentKitClientConfig) { + if (config.suiClient) { + this.#suiClient = config.suiClient; + } else { + throw new PaymentKitClientError('suiClient must be provided'); + } + + const network = config.suiClient.network; + switch (network) { + case 'testnet': + this.#packageConfig = TESTNET_PAYMENT_KIT_PACKAGE_CONFIG; + break; + case 'mainnet': + this.#packageConfig = MAINNET_PAYMENT_KIT_PACKAGE_CONFIG; + break; + default: + throw new PaymentKitClientError(`Unsupported network: ${network}`); + } + } + + get packageConfig() { + return this.#packageConfig; + } +} diff --git a/packages/payment-kit/src/constants.ts b/packages/payment-kit/src/constants.ts new file mode 100644 index 000000000..9e710db7c --- /dev/null +++ b/packages/payment-kit/src/constants.ts @@ -0,0 +1,11 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import type { PaymentKitPackageConfig } from './types.js'; + +export const TESTNET_PAYMENT_KIT_PACKAGE_CONFIG = { + packageId: '0x6d40694388297e1fae93ddbb7ef575ca961af225727c2a389259b29903d0fced', +} satisfies PaymentKitPackageConfig; + +export const MAINNET_PAYMENT_KIT_PACKAGE_CONFIG = { + packageId: '0x73cdadfc6c49df26d90055fd40a2b487fbe3021c8a8efed1696fb9cd51d23130', +} satisfies PaymentKitPackageConfig; diff --git a/packages/payment-kit/src/contracts/payment_kit/config.ts b/packages/payment-kit/src/contracts/payment_kit/config.ts new file mode 100644 index 000000000..9d1023950 --- /dev/null +++ b/packages/payment-kit/src/contracts/payment_kit/config.ts @@ -0,0 +1,18 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { MoveEnum } from '../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +import * as type_name from './deps/std/type_name.js'; +const $moduleName = '@local-pkg/payment-kit::config'; +export const Value = new MoveEnum({ + name: `${$moduleName}::Value`, + fields: { + U64: bcs.u64(), + Address: bcs.Address, + String: bcs.string(), + AsciiString: bcs.string(), + Bool: bcs.bool(), + Bytes: bcs.vector(bcs.u8()), + Type: type_name.TypeName, + }, +}); diff --git a/packages/payment-kit/src/contracts/payment_kit/deps/std/type_name.ts b/packages/payment-kit/src/contracts/payment_kit/deps/std/type_name.ts new file mode 100644 index 000000000..9f00e1a9b --- /dev/null +++ b/packages/payment-kit/src/contracts/payment_kit/deps/std/type_name.ts @@ -0,0 +1,23 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** Functionality for converting Move types into values. Use with care! */ + +import { MoveStruct } from '../../../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +const $moduleName = 'std::type_name'; +export const TypeName = new MoveStruct({ + name: `${$moduleName}::TypeName`, + fields: { + /** + * String representation of the type. All types are represented using their source + * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types. + * Struct types are represented as fully qualified type names; e.g. + * `00000000000000000000000000000001::string::String` or + * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2>` + * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or + * 32 depending on the Move platform) + */ + name: bcs.string(), + }, +}); diff --git a/packages/payment-kit/src/contracts/payment_kit/deps/sui/object.ts b/packages/payment-kit/src/contracts/payment_kit/deps/sui/object.ts new file mode 100644 index 000000000..e3f20da16 --- /dev/null +++ b/packages/payment-kit/src/contracts/payment_kit/deps/sui/object.ts @@ -0,0 +1,14 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** Sui object identifiers */ + +import { MoveStruct } from '../../../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +const $moduleName = '0x2::object'; +export const UID = new MoveStruct({ + name: `${$moduleName}::UID`, + fields: { + id: bcs.Address, + }, +}); diff --git a/packages/payment-kit/src/contracts/payment_kit/deps/sui/vec_map.ts b/packages/payment-kit/src/contracts/payment_kit/deps/sui/vec_map.ts new file mode 100644 index 000000000..e6e7f0448 --- /dev/null +++ b/packages/payment-kit/src/contracts/payment_kit/deps/sui/vec_map.ts @@ -0,0 +1,33 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { bcs } from '@mysten/sui/bcs'; +import type { BcsType } from '@mysten/sui/bcs'; +import { MoveStruct } from '../../../utils/index.js'; +const $moduleName = '0x2::vec_map'; +/** An entry in the map */ +export function Entry, V extends BcsType>(...typeParameters: [K, V]) { + return new MoveStruct({ + name: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, + fields: { + key: typeParameters[0], + value: typeParameters[1], + }, + }); +} +/** + * A map data structure backed by a vector. The map is guaranteed not to contain + * duplicate keys, but entries are _not_ sorted by key--entries are included in + * insertion order. All operations are O(N) in the size of the map--the intention + * of this data structure is only to provide the convenience of programming against + * a map API. Large maps should use handwritten parent/child relationships instead. + * Maps that need sorted iteration rather than insertion order iteration should + * also be handwritten. + */ +export function VecMap, V extends BcsType>(...typeParameters: [K, V]) { + return new MoveStruct({ + name: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, + fields: { + contents: bcs.vector(Entry(typeParameters[0], typeParameters[1])), + }, + }); +} diff --git a/packages/payment-kit/src/contracts/payment_kit/payment_kit.ts b/packages/payment-kit/src/contracts/payment_kit/payment_kit.ts new file mode 100644 index 000000000..d5ddc6930 --- /dev/null +++ b/packages/payment-kit/src/contracts/payment_kit/payment_kit.ts @@ -0,0 +1,377 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { MoveStruct, MoveEnum, MoveTuple, normalizeMoveArguments } from '../utils/index.js'; +import type { RawTransactionArgument } from '../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +import type { Transaction } from '@mysten/sui/transactions'; +import * as object from './deps/sui/object.js'; +import * as vec_map from './deps/sui/vec_map.js'; +import * as config from './config.js'; +const $moduleName = '@local-pkg/payment-kit::payment_kit'; +export const Namespace = new MoveStruct({ + name: `${$moduleName}::Namespace`, + fields: { + id: object.UID, + }, +}); +export const PaymentRegistry = new MoveStruct({ + name: `${$moduleName}::PaymentRegistry`, + fields: { + id: object.UID, + cap_id: bcs.Address, + config: vec_map.VecMap(bcs.string(), config.Value), + version: bcs.u16(), + }, +}); +export const RegistryAdminCap = new MoveStruct({ + name: `${$moduleName}::RegistryAdminCap`, + fields: { + id: object.UID, + registry_id: bcs.Address, + }, +}); +/** + * Enum representing the type of payment: Ephemeral (one-time) or Registry (tracked + * in a registry). + */ +export const PaymentType = new MoveEnum({ + name: `${$moduleName}::PaymentType`, + fields: { + Ephemeral: null, + Registry: bcs.Address, + }, +}); +export const PaymentReceipt = new MoveStruct({ + name: `${$moduleName}::PaymentReceipt`, + fields: { + payment_type: PaymentType, + nonce: bcs.string(), + payment_amount: bcs.u64(), + receiver: bcs.Address, + coin_type: bcs.string(), + timestamp_ms: bcs.u64(), + }, +}); +export const PaymentKey = new MoveStruct({ + name: `${$moduleName}::PaymentKey`, + fields: { + nonce: bcs.string(), + payment_amount: bcs.u64(), + receiver: bcs.Address, + }, +}); +export const PaymentRecord = new MoveStruct({ + name: `${$moduleName}::PaymentRecord`, + fields: { + epoch_at_time_of_record: bcs.u64(), + }, +}); +export const BalanceKey = new MoveTuple({ + name: `${$moduleName}::BalanceKey`, + fields: [bcs.bool()], +}); +export interface CreateRegistryArguments { + namespace: RawTransactionArgument; + name: RawTransactionArgument; +} +export interface CreateRegistryOptions { + package?: string; + arguments: + | CreateRegistryArguments + | [namespace: RawTransactionArgument, name: RawTransactionArgument]; +} +/** + * Creates a new payment registry with a supplied label. Label is used to derive + * the registry's ID. + */ +export function createRegistry(options: CreateRegistryOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + `${packageAddress}::payment_kit::Namespace`, + '0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String', + ] satisfies string[]; + const parameterNames = ['namespace', 'name']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'create_registry', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface ProcessEphemeralPaymentArguments { + nonce: RawTransactionArgument; + paymentAmount: RawTransactionArgument; + coin: RawTransactionArgument; + receiver: RawTransactionArgument; +} +export interface ProcessEphemeralPaymentOptions { + package?: string; + arguments: + | ProcessEphemeralPaymentArguments + | [ + nonce: RawTransactionArgument, + paymentAmount: RawTransactionArgument, + coin: RawTransactionArgument, + receiver: RawTransactionArgument, + ]; + typeArguments: [string]; +} +/** + * Processes a payment (without the use of a Registry), emitting a payment receipt + * event. + */ +export function processEphemeralPayment(options: ProcessEphemeralPaymentOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + '0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String', + 'u64', + `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`, + 'address', + '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', + ] satisfies string[]; + const parameterNames = ['nonce', 'paymentAmount', 'coin', 'receiver']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'process_ephemeral_payment', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + typeArguments: options.typeArguments, + }); +} +export interface ProcessRegistryPaymentArguments { + registry: RawTransactionArgument; + nonce: RawTransactionArgument; + paymentAmount: RawTransactionArgument; + coin: RawTransactionArgument; + receiver: RawTransactionArgument; +} +export interface ProcessRegistryPaymentOptions { + package?: string; + arguments: + | ProcessRegistryPaymentArguments + | [ + registry: RawTransactionArgument, + nonce: RawTransactionArgument, + paymentAmount: RawTransactionArgument, + coin: RawTransactionArgument, + receiver: RawTransactionArgument, + ]; + typeArguments: [string]; +} +/** + * Processes a payment via a payment registry, writing a receipt to the registry + * and protecting from double spending for the same key. + */ +export function processRegistryPayment(options: ProcessRegistryPaymentOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + `${packageAddress}::payment_kit::PaymentRegistry`, + '0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String', + 'u64', + `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`, + '0x0000000000000000000000000000000000000000000000000000000000000001::option::Option
', + '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock', + ] satisfies string[]; + const parameterNames = ['registry', 'nonce', 'paymentAmount', 'coin', 'receiver']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'process_registry_payment', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + typeArguments: options.typeArguments, + }); +} +export interface WithdrawFromRegistryArguments { + registry: RawTransactionArgument; + cap: RawTransactionArgument; +} +export interface WithdrawFromRegistryOptions { + package?: string; + arguments: + | WithdrawFromRegistryArguments + | [registry: RawTransactionArgument, cap: RawTransactionArgument]; + typeArguments: [string]; +} +/** + * If the registry is configured to manage funds, withdraw all funds of the + * specified coin from the registry. + */ +export function withdrawFromRegistry(options: WithdrawFromRegistryOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + `${packageAddress}::payment_kit::PaymentRegistry`, + `${packageAddress}::payment_kit::RegistryAdminCap`, + ] satisfies string[]; + const parameterNames = ['registry', 'cap']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'withdraw_from_registry', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + typeArguments: options.typeArguments, + }); +} +export interface DeletePaymentRecordArguments { + registry: RawTransactionArgument; + paymentKey: RawTransactionArgument; +} +export interface DeletePaymentRecordOptions { + package?: string; + arguments: + | DeletePaymentRecordArguments + | [registry: RawTransactionArgument, paymentKey: RawTransactionArgument]; + typeArguments: [string]; +} +/** Removes an expired Payment Record from the Registry. */ +export function deletePaymentRecord(options: DeletePaymentRecordOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + `${packageAddress}::payment_kit::PaymentRegistry`, + `${packageAddress}::payment_kit::PaymentKey<${options.typeArguments[0]}>`, + ] satisfies string[]; + const parameterNames = ['registry', 'paymentKey']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'delete_payment_record', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + typeArguments: options.typeArguments, + }); +} +export interface CreatePaymentKeyArguments { + nonce: RawTransactionArgument; + paymentAmount: RawTransactionArgument; + receiver: RawTransactionArgument; +} +export interface CreatePaymentKeyOptions { + package?: string; + arguments: + | CreatePaymentKeyArguments + | [ + nonce: RawTransactionArgument, + paymentAmount: RawTransactionArgument, + receiver: RawTransactionArgument, + ]; + typeArguments: [string]; +} +/** Creates a PaymentKey from payment parameters. */ +export function createPaymentKey(options: CreatePaymentKeyOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + '0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String', + 'u64', + 'address', + ] satisfies string[]; + const parameterNames = ['nonce', 'paymentAmount', 'receiver']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'create_payment_key', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + typeArguments: options.typeArguments, + }); +} +export interface SetConfigEpochExpirationDurationArguments { + registry: RawTransactionArgument; + cap: RawTransactionArgument; + epochExpirationDuration: RawTransactionArgument; +} +export interface SetConfigEpochExpirationDurationOptions { + package?: string; + arguments: + | SetConfigEpochExpirationDurationArguments + | [ + registry: RawTransactionArgument, + cap: RawTransactionArgument, + epochExpirationDuration: RawTransactionArgument, + ]; +} +/** + * Sets the epoch expiration duration configuration for the registry. If set, + * payment records will expire after the specified number of epochs. If not set, + * payment records will expire 30 epochs after their creation. + */ +export function setConfigEpochExpirationDuration(options: SetConfigEpochExpirationDurationOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + `${packageAddress}::payment_kit::PaymentRegistry`, + `${packageAddress}::payment_kit::RegistryAdminCap`, + 'u64', + ] satisfies string[]; + const parameterNames = ['registry', 'cap', 'epochExpirationDuration']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'set_config_epoch_expiration_duration', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface SetConfigRegistryManagedFundsArguments { + registry: RawTransactionArgument; + cap: RawTransactionArgument; + registryManagedFunds: RawTransactionArgument; +} +export interface SetConfigRegistryManagedFundsOptions { + package?: string; + arguments: + | SetConfigRegistryManagedFundsArguments + | [ + registry: RawTransactionArgument, + cap: RawTransactionArgument, + registryManagedFunds: RawTransactionArgument, + ]; +} +/** + * Sets whether the registry should manage funds itself. If true, payments + * processed via the registry will be collected into the registry's balance. If + * false, payments will be transferred directly to the specified receiver. + */ +export function setConfigRegistryManagedFunds(options: SetConfigRegistryManagedFundsOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [ + `${packageAddress}::payment_kit::PaymentRegistry`, + `${packageAddress}::payment_kit::RegistryAdminCap`, + 'bool', + ] satisfies string[]; + const parameterNames = ['registry', 'cap', 'registryManagedFunds']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'set_config_registry_managed_funds', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface ShareArguments { + registry: RawTransactionArgument; +} +export interface ShareOptions { + package?: string; + arguments: ShareArguments | [registry: RawTransactionArgument]; +} +/** + * Enforce that a registry will always be shared. + * + * # Parameters + * + * - `registry` - The PaymentRegistry to share + */ +export function share(options: ShareOptions) { + const packageAddress = options.package ?? '@local-pkg/payment-kit'; + const argumentsTypes = [`${packageAddress}::payment_kit::PaymentRegistry`] satisfies string[]; + const parameterNames = ['registry']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'payment_kit', + function: 'share', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} diff --git a/packages/payment-kit/src/contracts/utils/index.ts b/packages/payment-kit/src/contracts/utils/index.ts new file mode 100644 index 000000000..84246b816 --- /dev/null +++ b/packages/payment-kit/src/contracts/utils/index.ts @@ -0,0 +1,168 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import type { BcsType, TypeTag } from '@mysten/sui/bcs'; +import { bcs, TypeTagSerializer, BcsStruct, BcsEnum, BcsTuple } from '@mysten/sui/bcs'; +import { normalizeSuiAddress } from '@mysten/sui/utils'; +import type { TransactionArgument } from '@mysten/sui/transactions'; +import { isArgument } from '@mysten/sui/transactions'; + +const MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1'); +const SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2'); +const SUI_SYSTEM_ADDRESS = normalizeSuiAddress('0x3'); + +export type RawTransactionArgument = T | TransactionArgument; + +export function getPureBcsSchema(typeTag: string | TypeTag): BcsType | null { + const parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag; + + if ('u8' in parsedTag) { + return bcs.U8; + } else if ('u16' in parsedTag) { + return bcs.U16; + } else if ('u32' in parsedTag) { + return bcs.U32; + } else if ('u64' in parsedTag) { + return bcs.U64; + } else if ('u128' in parsedTag) { + return bcs.U128; + } else if ('u256' in parsedTag) { + return bcs.U256; + } else if ('address' in parsedTag) { + return bcs.Address; + } else if ('bool' in parsedTag) { + return bcs.Bool; + } else if ('vector' in parsedTag) { + const type = getPureBcsSchema(parsedTag.vector); + return type ? bcs.vector(type) : null; + } else if ('struct' in parsedTag) { + const structTag = parsedTag.struct; + const pkg = normalizeSuiAddress(parsedTag.struct.address); + + if (pkg === MOVE_STDLIB_ADDRESS) { + if ( + (structTag.module === 'ascii' || structTag.module === 'string') && + structTag.name === 'String' + ) { + return bcs.String; + } + + if (structTag.module === 'option' && structTag.name === 'Option') { + const type = getPureBcsSchema(structTag.typeParams[0]!); + return type ? bcs.option(type) : null; + } + } + + if (pkg === SUI_FRAMEWORK_ADDRESS && structTag.module === 'Object' && structTag.name === 'ID') { + return bcs.Address; + } + } + + return null; +} + +export function normalizeMoveArguments( + args: unknown[] | object, + argTypes: string[], + parameterNames?: string[], +) { + const argLen = Array.isArray(args) ? args.length : Object.keys(args).length; + if (parameterNames && argLen !== parameterNames.length) { + throw new Error( + `Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`, + ); + } + + const normalizedArgs: TransactionArgument[] = []; + + let index = 0; + for (const [i, argType] of argTypes.entries()) { + if (argType === `${SUI_FRAMEWORK_ADDRESS}::deny_list::DenyList`) { + normalizedArgs.push((tx) => tx.object.denyList()); + continue; + } + + if (argType === `${SUI_FRAMEWORK_ADDRESS}::random::Random`) { + normalizedArgs.push((tx) => tx.object.random()); + continue; + } + + if (argType === `${SUI_FRAMEWORK_ADDRESS}::clock::Clock`) { + normalizedArgs.push((tx) => tx.object.clock()); + continue; + } + + if (argType === `${SUI_SYSTEM_ADDRESS}::sui_system::SuiSystemState`) { + normalizedArgs.push((tx) => tx.object.system()); + continue; + } + + let arg; + if (Array.isArray(args)) { + if (index >= args.length) { + throw new Error( + `Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`, + ); + } + arg = args[index]; + } else { + if (!parameterNames) { + throw new Error(`Expected arguments to be passed as an array`); + } + const name = parameterNames[index]; + arg = args[name as keyof typeof args]; + + if (arg == null) { + throw new Error(`Parameter ${name} is required`); + } + } + + index += 1; + + if (typeof arg === 'function' || isArgument(arg)) { + normalizedArgs.push(arg as TransactionArgument); + continue; + } + + const type = argTypes[i]!; + const bcsType = getPureBcsSchema(type); + + if (bcsType) { + const bytes = bcsType.serialize(arg as never); + normalizedArgs.push((tx) => tx.pure(bytes)); + continue; + } else if (typeof arg === 'string') { + normalizedArgs.push((tx) => tx.object(arg)); + continue; + } + + throw new Error(`Invalid argument ${stringify(arg)} for type ${type}`); + } + + return normalizedArgs; +} + +export class MoveStruct< + T extends Record>, + const Name extends string = string, +> extends BcsStruct {} + +export class MoveEnum< + T extends Record | null>, + const Name extends string, +> extends BcsEnum {} + +export class MoveTuple< + T extends readonly BcsType[], + const Name extends string, +> extends BcsTuple {} + +function stringify(val: unknown) { + if (typeof val === 'object') { + return JSON.stringify(val, (val: unknown) => val); + } + if (typeof val === 'bigint') { + return val.toString(); + } + + return val; +} diff --git a/packages/payment-kit/src/error.ts b/packages/payment-kit/src/error.ts new file mode 100644 index 000000000..e5ac1625f --- /dev/null +++ b/packages/payment-kit/src/error.ts @@ -0,0 +1,4 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +export class PaymentKitClientError extends Error {} diff --git a/packages/payment-kit/src/index.ts b/packages/payment-kit/src/index.ts new file mode 100644 index 000000000..8a33a47eb --- /dev/null +++ b/packages/payment-kit/src/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +export { PaymentKitClient } from './client.js'; +export type { + PaymentKitCompatibleClient, + PaymentKitClientConfig, + PaymentKitPackageConfig, +} from './types.js'; diff --git a/packages/payment-kit/src/types.ts b/packages/payment-kit/src/types.ts new file mode 100644 index 000000000..3d3613805 --- /dev/null +++ b/packages/payment-kit/src/types.ts @@ -0,0 +1,16 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { ClientWithExtensions, Experimental_CoreClient } from '@mysten/sui/experimental'; + +export type PaymentKitPackageConfig = { + packageId: string; +}; + +export type PaymentKitCompatibleClient = ClientWithExtensions<{ + core: Experimental_CoreClient; +}>; + +export interface PaymentKitClientConfig { + suiClient: PaymentKitCompatibleClient; +} diff --git a/packages/payment-kit/sui-codegen.config.ts b/packages/payment-kit/sui-codegen.config.ts new file mode 100644 index 000000000..cbea9f6ce --- /dev/null +++ b/packages/payment-kit/sui-codegen.config.ts @@ -0,0 +1,16 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { SuiCodegenConfig } from '@mysten/codegen'; + +const config: SuiCodegenConfig = { + output: './src/contracts', + packages: [ + { + package: '@mysten/payment-kit', + path: '../../../sui-payment-kit', + }, + ], +}; + +export default config; diff --git a/packages/payment-kit/tsconfig.esm.json b/packages/payment-kit/tsconfig.esm.json new file mode 100644 index 000000000..5048bdf8f --- /dev/null +++ b/packages/payment-kit/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ESNext", + "outDir": "dist/esm" + } +} diff --git a/packages/payment-kit/tsconfig.json b/packages/payment-kit/tsconfig.json new file mode 100644 index 000000000..4453986bf --- /dev/null +++ b/packages/payment-kit/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../build-scripts/tsconfig.shared.json", + "include": ["src"], + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist/cjs", + "isolatedModules": true, + "rootDir": "src" + } +} diff --git a/packages/payment-kit/typedoc.json b/packages/payment-kit/typedoc.json new file mode 100644 index 000000000..ccb323f01 --- /dev/null +++ b/packages/payment-kit/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["src"], + "excludeInternal": true, + "excludePrivate": true, + "intentionallyNotExported": [] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2f3aacd70..3f95be9dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1196,6 +1196,25 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.15.29)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + packages/payment-kit: + dependencies: + '@mysten/bcs': + specifier: workspace:* + version: link:../bcs + '@mysten/sui': + specifier: workspace:* + version: link:../typescript + devDependencies: + '@mysten/build-scripts': + specifier: workspace:* + version: link:../build-scripts + '@mysten/codegen': + specifier: workspace:* + version: link:../codegen + typescript: + specifier: ^5.9.2 + version: 5.9.2 + packages/seal: dependencies: '@mysten/bcs': @@ -3866,12 +3885,12 @@ packages: nanostores: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^1.0.0 react: '>=18.0.0' + '@napi-rs/wasm-runtime@0.2.12': + resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} + '@napi-rs/wasm-runtime@1.0.3': resolution: {integrity: sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==} - '@napi-rs/wasm-runtime@1.0.5': - resolution: {integrity: sha512-TBr9Cf9onSAS2LQ2+QHx6XcC6h9+RIzJgbqG3++9TUZSH204AwEy5jg3BTQ0VATsyoGj4ee49tN/y6rvaOOtcg==} - '@next/env@15.5.2': resolution: {integrity: sha512-Qe06ew4zt12LeO6N7j8/nULSOe3fMXE4dM6xgpBQNvdzyK1sv5y4oAP3bq4LamrvGCZtmRYnW8URFCeX5nFgGg==} @@ -3987,8 +4006,12 @@ packages: resolution: {integrity: sha512-O0hdKt4K31i8fpq8Bw5RfdPVAqm0EdduBUcluPo2MRcfCOwUEf5JlnvRhf/J0ezOYOD8jQ/LumYZxOVi/XK/BA==} engines: {node: '>= 20.0.0'} - '@oxc-project/types@0.92.0': - resolution: {integrity: sha512-PDLfCbwgXjGdTBxzcuDOUxJYNBl6P8dOp3eDKWw54dYvqONan9rwGDRQU0zrkdEMiItfXQQUOI17uOcMX5Zm7A==} + '@oxc-project/runtime@0.71.0': + resolution: {integrity: sha512-QwoF5WUXIGFQ+hSxWEib4U/aeLoiDN9JlP18MnBgx9LLPRDfn1iICtcow7Jgey6HLH4XFceWXQD5WBJ39dyJcw==} + engines: {node: '>=6.9.0'} + + '@oxc-project/types@0.71.0': + resolution: {integrity: sha512-5CwQ4MI+P4MQbjLWXgNurA+igGwu/opNetIE13LBs9+V93R64MLvDKOOLZIXSzEfovU3Zef3q3GjPnMTgJTn2w==} '@oxc-transform/binding-android-arm64@0.82.3': resolution: {integrity: sha512-25Wh8wRSVMNiGJHeT1kIOKynrXbMoSR5vkhL+j7GyXs+R7tA3Vah574NK86y7k8Ayz7bmddSepue+Mp4/B2bqg==} @@ -5328,90 +5351,67 @@ packages: '@repeaterjs/repeater@3.0.6': resolution: {integrity: sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==} - '@rolldown/binding-android-arm64@1.0.0-beta.40': - resolution: {integrity: sha512-9Ii9phC7QU6Lb+ncMfG1Xlosq0NBB1N/4sw+EGZ3y0BBWGy02TOb5ghWZalphAKv9rn1goqo5WkBjyd2YvsLmA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@rolldown/binding-darwin-arm64@1.0.0-beta.40': - resolution: {integrity: sha512-5O6d0y2tBQTL+ecQY3qXIwSnF1/Zik8q7LZMKeyF+VJ9l194d0IdMhl2zUF0cqWbYHuF4Pnxplk4OhurPQ/Z9Q==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-darwin-arm64@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-Mp0/gqiPdepHjjVm7e0yL1acWvI0rJVVFQEADSezvAjon9sjQ7CEg9JnXICD4B1YrPmN9qV/e7cQZCp87tTV4w==} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-beta.40': - resolution: {integrity: sha512-izB9jygt3miPQbOTZfSu5K51isUplqa8ysByOKQqcJHgrBWmbTU8TM9eouv6tRmBR0kjcEcID9xhmA1CeZ1VIg==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-darwin-x64@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-40re4rMNrsi57oavRzIOpRGmg3QRlW6Ea8Q3znaqgOuJuKVrrm2bIQInTfkZJG7a4/5YMX7T951d0+toGLTdCA==} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-beta.40': - resolution: {integrity: sha512-2fdpEpKT+wwP0vig9dqxu+toTeWmVSjo3psJQVDeLJ51rO+GXcCJ1IkCXjhMKVEevNtZS7B8T8Z2vvmRV9MAdA==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-freebsd-x64@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-8BDM939bbMariZupiHp3OmP5N+LXPT4mULA0hZjDaq970PCxv4krZOSMG+HkWUUwmuQROtV+/00xw39EO0P+8g==} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.40': - resolution: {integrity: sha512-HP2lo78OWULN+8TewpLbS9PS00jh0CaF04tA2u8z2I+6QgVgrYOYKvX+T0hlO5smgso4+qb3YchzumWJl3yCPQ==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-sntsPaPgrECpBB/+2xrQzVUt0r493TMPI+4kWRMhvMsmrxOqH1Ep5lM0Wua/ZdbfZNwm1aVa5pcESQfNfM4Fhw==} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.40': - resolution: {integrity: sha512-ng00gfr9BhA2NPAOU5RWAlTiL+JcwAD+L+4yUD1sbBy6tgHdLiNBOvKtHISIF9RM9/eQeS0tAiWOYZGIH9JMew==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-5clBW/I+er9F2uM1OFjJFWX86y7Lcy0M+NqsN4s3o07W+8467Zk8oQa4B45vdaXoNUF/yqIAgKkA/OEdQDxZqA==} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.40': - resolution: {integrity: sha512-mF0R1l9kLcaag/9cLEiYYdNZ4v1uuX4jklSDZ1s6vJE4RB3LirUney0FavdVRwCJ5sDvfvsPgXgtBXWYr2M2tQ==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-wv+rnAfQDk9p/CheX8/Kmqk2o1WaFa4xhWI9gOyDMk/ljvOX0u0ubeM8nI1Qfox7Tnh71eV5AjzSePXUhFOyOg==} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.40': - resolution: {integrity: sha512-+wi08S7wT5iLPHRZb0USrS6n+T6m+yY++dePYedE5uvKIpWCJJioFTaRtWjpm0V6dVNLcq2OukrvfdlGtH9Wgg==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-gxD0/xhU4Py47IH3bKZbWtvB99tMkUPGPJFRfSc5UB9Osoje0l0j1PPbxpUtXIELurYCqwLBKXIMTQGifox1BQ==} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.0.0-beta.40': - resolution: {integrity: sha512-W5qBGAemUocIBKCcOsDjlV9GUt28qhl/+M6etWBeLS5gQK0J6XDg0YVzfOQdvq57ZGjYNP0NvhYzqhOOnEx+4g==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-linux-x64-musl@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-HotuVe3XUjDwqqEMbm3o3IRkP9gdm8raY/btd/6KE3JGLF/cv4+3ff1l6nOhAZI8wulWDPEXPtE7v+HQEaTXnA==} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-openharmony-arm64@1.0.0-beta.40': - resolution: {integrity: sha512-vJwoDehtt+yqj2zacq1AqNc2uE/oh7mnRGqAUbuldV6pgvU01OSQUJ7Zu+35hTopnjFoDNN6mIezkYlGAv5RFA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@rolldown/binding-wasm32-wasi@1.0.0-beta.40': - resolution: {integrity: sha512-Oj3YyqVUPurr1FlMpEE/bJmMC+VWAWPM/SGUfklO5KUX97bk5Q/733nPg4RykK8q8/TluJoQYvRc05vL/B74dw==} - engines: {node: '>=14.0.0'} + '@rolldown/binding-wasm32-wasi@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-8Cx+ucbd8n2dIr21FqBh6rUvTVL0uTgEtKR7l+MUZ5BgY4dFh1e4mPVX8oqmoYwOxBiXrsD2JIOCz4AyKLKxWA==} + engines: {node: '>=14.21.3'} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.40': - resolution: {integrity: sha512-0ZtO6yN8XjVoFfN4HDWQj4nDu3ndMybr7jIM00DJqOmc+yFhly7rdOy7fNR9Sky3leCpBtsXfepVqRmVpYKPVA==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-Vhq5vikrVDxAa75fxsyqj0c0Y/uti/TwshXI71Xb8IeUQJOBnmLUsn5dgYf5ljpYYkNa0z9BPAvUDIDMmyDi+w==} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.40': - resolution: {integrity: sha512-BPl1inoJXPpIe38Ja46E4y11vXlJyuleo+9Rmu//pYL5fIDYJkXUj/oAXqjSuwLcssrcwnuPgzvzvlz9++cr3w==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-lN7RIg9Iugn08zP2aZN9y/MIdG8iOOCE93M1UrFlrxMTqPf8X+fDzmR/OKhTSd1A2pYNipZHjyTcb5H8kyQSow==} cpu: [ia32] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.40': - resolution: {integrity: sha512-UguA4ltbAk+nbwHRxqaUP/etpTbR0HjyNlsu4Zjbh/ytNbFsbw8CA4tEBkwDyjgI5NIPea6xY11zpl7R2/ddVA==} - engines: {node: ^20.19.0 || >=22.12.0} + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-7/7cLIn48Y+EpQ4CePvf8reFl63F15yPUlg4ZAhl+RXJIfydkdak1WD8Ir3AwAO+bJBXzrfNL+XQbxm0mcQZmw==} cpu: [x64] os: [win32] @@ -5427,8 +5427,8 @@ packages: '@rolldown/pluginutils@1.0.0-beta.36': resolution: {integrity: sha512-qa+gfzhv0/Xv52zZInENLu6JbsnSjSExD7kTaNm7Qn5LUIH6IQb7l9pB+NrsU5/Bvt9aqcBTdRGc7x1DYMTiqQ==} - '@rolldown/pluginutils@1.0.0-beta.40': - resolution: {integrity: sha512-s3GeJKSQOwBlzdUrj4ISjJj5SfSh+aqn0wjOar4Bx95iV1ETI7F6S/5hLcfAxZ9kXDcyrAkxPlqmd1ZITttf+w==} + '@rolldown/pluginutils@1.0.0-beta.9-commit.d91dfb5': + resolution: {integrity: sha512-8sExkWRK+zVybw3+2/kBkYBFeLnEUWz1fT7BLHplpzmtqkOfTbAQ9gkt4pzwGIIZmg4Qn5US5ACjUBenrhezwQ==} '@rollup/rollup-android-arm-eabi@4.50.1': resolution: {integrity: sha512-HJXwzoZN4eYTdD8bVV22DN8gsPCAj3V20NHKOs8ezfXanGpmVPR7kalUHd+Y31IJp9stdB87VKPFbsGY3H/2ag==} @@ -10564,9 +10564,8 @@ packages: vue-tsc: optional: true - rolldown@1.0.0-beta.40: - resolution: {integrity: sha512-VqEHbKpOgTPmQrZ4fVn4eshDQS/6g/fRpNE7cFSJY+eQLDZn4B9X61J6L+hnlt1u2uRI+pF7r1USs6S5fuWCvw==} - engines: {node: ^20.19.0 || >=22.12.0} + rolldown@1.0.0-beta.9-commit.d91dfb5: + resolution: {integrity: sha512-FHkj6gGEiEgmAXQchglofvUUdwj2Oiw603Rs+zgFAnn9Cb7T7z3fiaEc0DbN3ja4wYkW6sF2rzMEtC1V4BGx/g==} hasBin: true rollup@4.50.1: @@ -14046,7 +14045,7 @@ snapshots: '@graphql-tools/optimize@2.0.0(graphql@16.11.0)': dependencies: graphql: 16.11.0 - tslib: 2.6.3 + tslib: 2.8.1 '@graphql-tools/prisma-loader@8.0.17(@types/node@22.15.29)(crossws@0.3.5)(graphql@16.11.0)': dependencies: @@ -14717,18 +14716,18 @@ snapshots: nanostores: 1.0.1 react: 18.3.1 - '@napi-rs/wasm-runtime@1.0.3': + '@napi-rs/wasm-runtime@0.2.12': dependencies: '@emnapi/core': 1.5.0 '@emnapi/runtime': 1.5.0 - '@tybys/wasm-util': 0.10.0 + '@tybys/wasm-util': 0.10.1 optional: true - '@napi-rs/wasm-runtime@1.0.5': + '@napi-rs/wasm-runtime@1.0.3': dependencies: '@emnapi/core': 1.5.0 '@emnapi/runtime': 1.5.0 - '@tybys/wasm-util': 0.10.1 + '@tybys/wasm-util': 0.10.0 optional: true '@next/env@15.5.2': {} @@ -14808,7 +14807,9 @@ snapshots: '@orama/orama@3.1.13': {} - '@oxc-project/types@0.92.0': {} + '@oxc-project/runtime@0.71.0': {} + + '@oxc-project/types@0.71.0': {} '@oxc-transform/binding-android-arm64@0.82.3': optional: true @@ -16393,48 +16394,42 @@ snapshots: '@repeaterjs/repeater@3.0.6': {} - '@rolldown/binding-android-arm64@1.0.0-beta.40': - optional: true - - '@rolldown/binding-darwin-arm64@1.0.0-beta.40': - optional: true - - '@rolldown/binding-darwin-x64@1.0.0-beta.40': + '@rolldown/binding-darwin-arm64@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-beta.40': + '@rolldown/binding-darwin-x64@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.40': + '@rolldown/binding-freebsd-x64@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.40': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.40': + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.40': + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-beta.40': + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-openharmony-arm64@1.0.0-beta.40': + '@rolldown/binding-linux-x64-musl@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-beta.40': + '@rolldown/binding-wasm32-wasi@1.0.0-beta.9-commit.d91dfb5': dependencies: - '@napi-rs/wasm-runtime': 1.0.5 + '@napi-rs/wasm-runtime': 0.2.12 optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.40': + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.40': + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.9-commit.d91dfb5': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.40': + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.9-commit.d91dfb5': optional: true '@rolldown/pluginutils@1.0.0-beta.27': {} @@ -16445,7 +16440,7 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.36': {} - '@rolldown/pluginutils@1.0.0-beta.40': {} + '@rolldown/pluginutils@1.0.0-beta.9-commit.d91dfb5': {} '@rollup/rollup-android-arm-eabi@4.50.1': optional: true @@ -23010,7 +23005,7 @@ snapshots: dependencies: glob: 7.2.3 - rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.40)(typescript@5.9.2): + rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.9-commit.d91dfb5)(typescript@5.9.2): dependencies: '@babel/generator': 7.28.3 '@babel/parser': 7.28.3 @@ -23020,33 +23015,32 @@ snapshots: debug: 4.4.1 dts-resolver: 2.1.2 get-tsconfig: 4.10.1 - rolldown: 1.0.0-beta.40 + rolldown: 1.0.0-beta.9-commit.d91dfb5 optionalDependencies: typescript: 5.9.2 transitivePeerDependencies: - oxc-resolver - supports-color - rolldown@1.0.0-beta.40: + rolldown@1.0.0-beta.9-commit.d91dfb5: dependencies: - '@oxc-project/types': 0.92.0 - '@rolldown/pluginutils': 1.0.0-beta.40 + '@oxc-project/runtime': 0.71.0 + '@oxc-project/types': 0.71.0 + '@rolldown/pluginutils': 1.0.0-beta.9-commit.d91dfb5 ansis: 4.1.0 optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-beta.40 - '@rolldown/binding-darwin-arm64': 1.0.0-beta.40 - '@rolldown/binding-darwin-x64': 1.0.0-beta.40 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.40 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.40 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.40 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.40 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.40 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.40 - '@rolldown/binding-openharmony-arm64': 1.0.0-beta.40 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.40 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.40 - '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.40 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.40 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-darwin-x64': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.9-commit.d91dfb5 rollup@4.50.1: dependencies: @@ -23827,8 +23821,8 @@ snapshots: diff: 8.0.2 empathic: 2.0.0 hookable: 5.5.3 - rolldown: 1.0.0-beta.40 - rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.40)(typescript@5.9.2) + rolldown: 1.0.0-beta.9-commit.d91dfb5 + rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.9-commit.d91dfb5)(typescript@5.9.2) semver: 7.7.2 tinyexec: 1.0.1 tinyglobby: 0.2.14 From d69c51b7871feaa9310c569814588ebd88e51c8c Mon Sep 17 00:00:00 2001 From: Will Roeder Date: Wed, 1 Oct 2025 10:55:54 -0700 Subject: [PATCH 22/36] [Payment Kit] Added an initial README (#575) * Added an initial README * Resolving `README` comments * More README updates --- packages/payment-kit/README.md | 126 +++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 packages/payment-kit/README.md diff --git a/packages/payment-kit/README.md b/packages/payment-kit/README.md new file mode 100644 index 000000000..f49451d43 --- /dev/null +++ b/packages/payment-kit/README.md @@ -0,0 +1,126 @@ +# `@mysten/payment-kit` + +> ⚠️ **Warning** - This package is in active development. APIs are experimental and subject to +> breaking changes without notice. We recommend thoroughly testing any implementation before using +> in production environments. + +## Installation + +```bash +npm install --save @mysten/payment-kit @mysten/sui +``` + +## Setup + +In order to use the Payment Kit SDK you will first need to create an instance of SuiClient from the +Typescript SDK, and a client instance of the Payment Kit SDK. + +```ts +import { getFullnodeUrl, SuiClient } from '@mysten/sui/client'; +import { PaymentKitClient } from '@mysten/payment-kit'; + +const suiClient = new SuiClient({ + url: getFullnodeUrl('testnet'), + network: 'testnet', +}); + +const paymentKitClient = new PaymentKitClient({ + suiClient, +}); +``` + +The Payment Kit SDK already includes all relevant package and object IDs to operate against +`mainnet` and `testnet`. No other environments are currently supported. By default, all registry +based payments are routed through a default payment registry, but more on that later. + +## SDK Overview + +The Payment Kit SDK is designed to allow for direct interactions with the +[sui-payment-kit](https://github.com/MystenLabs/sui-payment-kit) Move Package. This includes: + +- Processing payments +- Creating and managing `PaymentRegistry` instances +- Claiming `PaymentRecord` storage fees +- Querying the state of a `PaymentRecord` +- Constructing relevant Object IDs + +These operations are exposed via a `PaymentKitClient` which provides relevant APIs so an application +doesn't need to know how payments are processed, receipts are created and registry configurations +are stored. + +### Payment Processing + +There are two distinct ways in which payments are processed. Registry based payments and Ephemeral +payments. + +#### Registry Processed Payments + +When using a `PaymentRegistry` to process a payment a registry must always be specified. A registry +has the ability to specify where funds must be sent and how long a `PaymentRecord` can live before +being eligible for deletion. In addition to registry configurations, a `PaymentRecord` is always +created when using a registry to process a payment. A `PaymentRecord` enforces that a payment +request cannot be fulfilled more than once. The existence of a `PaymentRecord` also guarantees that +a payment has been made. Once a payment has been fulfilled a `PaymentReceipt` is emitted that can be +used as you please. + +#### Ephemeral Payments + +Unlike Registry processed payments, an ephemeral payment does not leverage a registry and does not +write a `PaymentRecord`. This means duplicate payments are not implicitly prevented. Although, a +`PaymentReceipt` is still emitted once completed, similar to registry based payments. + +### Payment Registries + +At the core of Payment Kit is the `PaymentRegistry`. Currently, a registry is used to process +one-time payments, manage how funds are collected and specify the expiration of a `PaymentRecord`. +While there is a default registry to leverage, entities are encouraged to create and manage their +own registries. This enables easier indexing of relevant payments and reduces the potential for +object congestion. Registries are created via personalized name. This name is then used to derive an +Object ID. This means registry names must be unique. + +#### Registry Configuration + +Configurations are applied to an instance of a `PaymentRegistry`. There are currently two +configurations offered: + +1. Receipt Epoch Expiration: The number of epochs that must elapse before a `PaymentReceipt` is + eligible to be deleted. Deleting expired receipts is a permissionless operation that anyone can + perform and will result in a small storage rebate for each deleted record, incentivizing + automatic cleanup up of registries. + +2. Registry Managed Funds: A configuration that specifies if payment funds must be sent to the + registry itself. If a `PaymentRegistry` has set this configuration, the `receiver` must be the + registry itself. Funds can later be claimed by the registry admin. An added benefit to this + configuration is avoiding complicated coin merging, when dealing with high thoroughput payments. + This is because the destination is always the same coin object when the registry is set as the + fund manager. + +### Payment Records + +As mentioned above, a `PaymentRecord` is only written when using a registry to process a payment. +This payment record is used to guarantee a payment has been made. But note records can be deleted +based on a registries epoch expiration duration (the default expiration is 30 epochs after +creation). + +#### Payment Keys + +A `PaymentRecord` is a Dynamic Field owned by the `PaymentRegistry`. This record is derived via a +`PaymentKey`. A `PaymentKey` is a hash of request payment. This includes the `PaymentID`, +`PaymentAmount`, `CoinType`, and `ReceiverAddress`. + +### Payment Receipts + +When processing an ephemeral, or registry based, payment a `PaymentReceipt` is always emitted and +returned. This payment receipt can be stored, off-chain, for whateve purpose it may serve to your +application. + +```ts +type PaymentReceipt = { + paymentType: PaymentType; + paymentId: string; + amount: number; + receiver: string; + coinType: string; + timestampMs: number; +}; +``` From 566b9ae8e2fdd3c017a91593b47c3162a419b759 Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Wed, 1 Oct 2025 11:03:16 -0700 Subject: [PATCH 23/36] add sui:supportedIntents wallet-standard feature (#562) Co-authored-by: Michael Hayes --- .changeset/every-rocks-see.md | 5 +++ .changeset/slimy-bees-play.md | 5 +++ .../src/core/actions/connect-wallet.ts | 28 +++++++++++++--- .../actions/sign-and-execute-transaction.ts | 5 ++- .../src/core/actions/sign-transaction.ts | 5 ++- .../core/initializers/autoconnect-wallet.ts | 33 ++++++++++++++----- .../initializers/sync-state-to-storage.ts | 12 +++++-- .../packages/dapp-kit-core/src/core/store.ts | 5 +++ .../actions/connect-wallet.test.ts | 3 ++ .../actions/disconnect-wallet.test.ts | 2 ++ .../test/unit/stores/connection.test.ts | 10 ++++++ .../src/hooks/wallet/useConnectWallet.ts | 13 ++++---- .../wallet-standard/src/features/index.ts | 5 ++- .../src/features/suiGetSupportedIntents.ts | 21 ++++++++++++ 14 files changed, 123 insertions(+), 29 deletions(-) create mode 100644 .changeset/every-rocks-see.md create mode 100644 .changeset/slimy-bees-play.md create mode 100644 packages/wallet-standard/src/features/suiGetSupportedIntents.ts diff --git a/.changeset/every-rocks-see.md b/.changeset/every-rocks-see.md new file mode 100644 index 000000000..28ed3e33d --- /dev/null +++ b/.changeset/every-rocks-see.md @@ -0,0 +1,5 @@ +--- +'@mysten/wallet-standard': minor +--- + +Add sui:getSupportedIntents feature diff --git a/.changeset/slimy-bees-play.md b/.changeset/slimy-bees-play.md new file mode 100644 index 000000000..55976c798 --- /dev/null +++ b/.changeset/slimy-bees-play.md @@ -0,0 +1,5 @@ +--- +'@mysten/dapp-kit': minor +--- + +Add support for sui:getSupportedIntents diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts index 5afa892b0..4937a7500 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/connect-wallet.ts @@ -4,7 +4,7 @@ import type { DAppKitStores } from '../store.js'; import { task } from 'nanostores'; import type { UiWallet, UiWalletAccount } from '@wallet-standard/ui'; -import type { StandardConnectInput } from '@mysten/wallet-standard'; +import type { StandardConnectInput, SuiWalletFeatures } from '@mysten/wallet-standard'; import type { StandardConnectFeature } from '@mysten/wallet-standard'; import { StandardConnect } from '@mysten/wallet-standard'; import { getWalletFeature, uiWalletAccountBelongsToUiWallet } from '@wallet-standard/ui'; @@ -46,7 +46,7 @@ export function connectWalletCreator( try { $baseConnection.setKey('status', isAlreadyConnected ? 'reconnecting' : 'connecting'); - const suiAccounts = await internalConnectWallet( + const { accounts: suiAccounts, supportedIntents } = await internalConnectWallet( wallet, supportedNetworks, standardConnectArgs, @@ -65,6 +65,7 @@ export function connectWalletCreator( $baseConnection.set({ status: 'connected', currentAccount: account ?? suiAccounts[0], + supportedIntents: supportedIntents ?? [], }); return { accounts: suiAccounts }; @@ -90,8 +91,27 @@ export async function internalConnectWallet( const underlyingWallet = getWalletForHandle(wallet); const supportedChains = supportedNetworks.map(getChain); - - return result.accounts + const supportedIntents = + result.supportedIntents ?? (await getSupportedIntentsFromFeature(wallet)); + const accounts = result.accounts .filter((account) => account.chains.some((chain) => supportedChains.includes(chain))) .map(getOrCreateUiWalletAccountForStandardWalletAccount.bind(null, underlyingWallet)); + + return { + accounts, + supportedIntents, + }; +} + +export async function getSupportedIntentsFromFeature(wallet: UiWallet) { + if (!wallet.features.includes('sui:getSupportedIntents')) { + return []; + } + + const getSupportedIntentsFeature = getWalletFeature( + wallet, + 'sui:getSupportedIntents', + ) as SuiWalletFeatures['sui:getSupportedIntents']; + + return (await getSupportedIntentsFeature?.getSupportedIntents())?.supportedIntents ?? []; } diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-and-execute-transaction.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-and-execute-transaction.ts index 16bc1457a..3a83f98ef 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-and-execute-transaction.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-and-execute-transaction.ts @@ -31,7 +31,7 @@ export function signAndExecuteTransactionCreator({ $connection, $currentClient } transaction, ...standardArgs }: SignAndExecuteTransactionArgs) { - const { account } = $connection.get(); + const { account, supportedIntents } = $connection.get(); if (!account) { throw new WalletNotConnectedError('No wallet is connected.'); } @@ -46,9 +46,8 @@ export function signAndExecuteTransactionCreator({ $connection, $currentClient } return transaction; } - // TODO: Fix passing through the supported intents for plugins. transaction.setSenderIfNotSet(account.address); - return await transaction.toJSON({ client: suiClient }); + return await transaction.toJSON({ client: suiClient, supportedIntents }); }, }; diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-transaction.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-transaction.ts index 115921b35..c21b91909 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-transaction.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/actions/sign-transaction.ts @@ -23,7 +23,7 @@ export function signTransactionCreator({ $connection, $currentClient }: DAppKitS * Prompts the specified wallet account to sign a transaction. */ return async function signTransaction({ transaction, ...standardArgs }: SignTransactionArgs) { - const { account } = $connection.get(); + const { account, supportedIntents } = $connection.get(); if (!account) { throw new WalletNotConnectedError('No wallet is connected.'); } @@ -38,9 +38,8 @@ export function signTransactionCreator({ $connection, $currentClient }: DAppKitS return transaction; } - // TODO: Fix passing through the supported intents for plugins. transaction.setSenderIfNotSet(account.address); - return await transaction.toJSON({ client: suiClient }); + return await transaction.toJSON({ client: suiClient, supportedIntents }); }, }; diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts index 7a672690d..03c7e50aa 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/autoconnect-wallet.ts @@ -7,7 +7,10 @@ import type { StateStorage } from '../../utils/storage.js'; import type { UiWallet } from '@wallet-standard/ui'; import { getWalletUniqueIdentifier } from '../../utils/wallets.js'; -import { internalConnectWallet } from '../actions/connect-wallet.js'; +import { + getSupportedIntentsFromFeature, + internalConnectWallet, +} from '../actions/connect-wallet.js'; import type { Networks } from '../../utils/networks.js'; /** @@ -44,7 +47,8 @@ export function autoConnectWallet({ if (savedWalletAccount) { $baseConnection.set({ status: 'connected', - currentAccount: savedWalletAccount, + currentAccount: savedWalletAccount.account, + supportedIntents: savedWalletAccount.supportedIntents, }); } }, @@ -68,7 +72,7 @@ async function getSavedWalletAccount({ return null; } - const [savedWalletId, savedAccountAddress] = savedWalletIdAndAddress.split(':'); + const [savedWalletId, savedAccountAddress, savedIntents] = savedWalletIdAndAddress.split(':'); if (!savedWalletId || !savedAccountAddress) { return null; } @@ -86,16 +90,27 @@ async function getSavedWalletAccount({ ); if (existingAccount) { - return existingAccount; + const supportedIntents = savedIntents ? savedIntents.split(',') : null; + + return { + account: existingAccount, + supportedIntents: supportedIntents ?? (await getSupportedIntentsFromFeature(targetWallet)), + }; } // For wallets that don't pre-populate the accounts array on page load, // we need to silently request authorization and get the account directly. - const alreadyAuthorizedAccounts = await internalConnectWallet(targetWallet, networks, { - silent: true, - }); + const { accounts: alreadyAuthorizedAccounts, supportedIntents } = await internalConnectWallet( + targetWallet, + networks, + { + silent: true, + }, + ); - return ( - alreadyAuthorizedAccounts.find((account) => account.address === savedAccountAddress) ?? null + const account = alreadyAuthorizedAccounts.find( + (account) => account.address === savedAccountAddress, ); + + return account ? { account, supportedIntents } : null; } diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts index e4b0968f4..f313da238 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/initializers/sync-state-to-storage.ts @@ -24,7 +24,10 @@ export function syncStateToStorage({ if (!oldConnection || oldConnection.status === connection.status) return; if (connection.account) { - storage.setItem(storageKey, getSavedAccountStorageKey(connection.account)); + storage.setItem( + storageKey, + getSavedAccountStorageKey(connection.account, connection.supportedIntents), + ); } else { storage.removeItem(storageKey); } @@ -32,7 +35,10 @@ export function syncStateToStorage({ }); } -export function getSavedAccountStorageKey(account: UiWalletAccount) { +export function getSavedAccountStorageKey( + account: UiWalletAccount, + supportedIntents: string[], +): string { const walletIdentifier = getWalletUniqueIdentifier(account); - return `${walletIdentifier.replace(':', '_')}:${account.address}`; + return `${walletIdentifier.replace(':', '_')}:${account.address}:${supportedIntents.join(',')}:`; } diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/store.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/store.ts index 2779e9882..dd13f0d53 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/core/store.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/core/store.ts @@ -21,6 +21,7 @@ type InternalWalletConnection = | { status: 'reconnecting' | 'connected'; currentAccount: UiWalletAccount; + supportedIntents: string[]; }; export type DAppKitStores< @@ -82,6 +83,7 @@ export function createStores< wallet: getAssociatedWalletOrThrow(connection.currentAccount, wallets), account: connection.currentAccount, status: connection.status, + supportedIntents: connection.supportedIntents, isConnected: true, isConnecting: false, isReconnecting: false, @@ -92,6 +94,7 @@ export function createStores< wallet: null, account: connection.currentAccount, status: connection.status, + supportedIntents: [], isConnected: false, isConnecting: true, isReconnecting: false, @@ -102,6 +105,7 @@ export function createStores< wallet: getAssociatedWalletOrThrow(connection.currentAccount, wallets), account: connection.currentAccount, status: connection.status, + supportedIntents: connection.supportedIntents, isConnected: false, isConnecting: false, isReconnecting: true, @@ -112,6 +116,7 @@ export function createStores< wallet: null, account: connection.currentAccount, status: connection.status, + supportedIntents: [], isConnected: false, isConnecting: false, isReconnecting: false, diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/connect-wallet.test.ts b/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/connect-wallet.test.ts index d9fcf0c63..30ff78500 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/connect-wallet.test.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/connect-wallet.test.ts @@ -64,6 +64,7 @@ describe('[Integration] connectWallet action', () => { wallet: null, account: null, status: 'disconnected', + supportedIntents: [], isConnected: false, isConnecting: false, isReconnecting: false, @@ -73,6 +74,7 @@ describe('[Integration] connectWallet action', () => { wallet: null, account: null, status: 'connecting', + supportedIntents: [], isConnected: false, isConnecting: true, isReconnecting: false, @@ -82,6 +84,7 @@ describe('[Integration] connectWallet action', () => { wallet: uiWallet, account: uiWallet.accounts[0], status: 'connected', + supportedIntents: [], isConnected: true, isConnecting: false, isReconnecting: false, diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/disconnect-wallet.test.ts b/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/disconnect-wallet.test.ts index 1f1691305..0d4372e13 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/disconnect-wallet.test.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/test/integration/actions/disconnect-wallet.test.ts @@ -67,6 +67,7 @@ describe('[Integration] disconnectWallet action', () => { wallet: uiWallet, account: uiWallet.accounts[0], status: 'connected', + supportedIntents: [], isConnected: true, isConnecting: false, isReconnecting: false, @@ -76,6 +77,7 @@ describe('[Integration] disconnectWallet action', () => { wallet: null, account: null, status: 'disconnected', + supportedIntents: [], isConnected: false, isConnecting: false, isReconnecting: false, diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/test/unit/stores/connection.test.ts b/packages/dapp-kit-next/packages/dapp-kit-core/test/unit/stores/connection.test.ts index dccb646d4..cf2b6cb56 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/test/unit/stores/connection.test.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/test/unit/stores/connection.test.ts @@ -15,6 +15,7 @@ describe('[Unit] $connection', () => { wallet: null, account: null, status: 'disconnected', + supportedIntents: [], isConnected: false, isConnecting: false, isReconnecting: false, @@ -24,12 +25,14 @@ describe('[Unit] $connection', () => { stores.$baseConnection.set({ status: 'connected', currentAccount: uiWalletAccount, + supportedIntents: ['testIntent'], }); expect(stores.$connection.get()).toStrictEqual({ wallet: uiWallet, account: uiWalletAccount, status: 'connected', + supportedIntents: ['testIntent'], isConnected: true, isConnecting: false, isReconnecting: false, @@ -47,6 +50,7 @@ describe('[Unit] $connection', () => { stores.$baseConnection.set({ status: 'connected', currentAccount: uiWalletAccount, + supportedIntents: [], }); stores.$baseConnection.set({ @@ -58,6 +62,7 @@ describe('[Unit] $connection', () => { wallet: null, account: null, status: 'disconnected', + supportedIntents: [], isConnected: false, isConnecting: false, isReconnecting: false, @@ -78,6 +83,7 @@ describe('[Unit] $connection', () => { wallet: null, account: null, status: 'connecting', + supportedIntents: [], isConnected: false, isConnecting: true, isReconnecting: false, @@ -94,12 +100,14 @@ describe('[Unit] $connection', () => { stores.$baseConnection.set({ status: 'reconnecting', currentAccount: uiWalletAccount, + supportedIntents: [], }); expect(stores.$connection.get()).toStrictEqual({ wallet: uiWallet, account: uiWalletAccount, status: 'reconnecting', + supportedIntents: [], isConnected: false, isConnecting: false, isReconnecting: true, @@ -152,12 +160,14 @@ describe('[Unit] $connection', () => { stores.$baseConnection.set({ status: 'connected', currentAccount: uiWalletAccount, + supportedIntents: [], }); expect(notificationCount).toBe(3); stores.$baseConnection.set({ status: 'reconnecting', currentAccount: uiWalletAccount, + supportedIntents: [], }); expect(notificationCount).toBe(4); diff --git a/packages/dapp-kit/src/hooks/wallet/useConnectWallet.ts b/packages/dapp-kit/src/hooks/wallet/useConnectWallet.ts index c24d88ce3..5f39ca3a7 100644 --- a/packages/dapp-kit/src/hooks/wallet/useConnectWallet.ts +++ b/packages/dapp-kit/src/hooks/wallet/useConnectWallet.ts @@ -50,17 +50,18 @@ export function useConnectWallet({ setConnectionStatus('connecting'); const connectResult = await wallet.features['standard:connect'].connect(connectArgs); + let supportedIntents = connectResult.supportedIntents; + if (!supportedIntents && wallet.features['sui:getSupportedIntents']) { + supportedIntents = ( + await wallet.features['sui:getSupportedIntents'].getSupportedIntents() + ).supportedIntents; + } const connectedSuiAccounts = connectResult.accounts.filter((account) => account.chains.some((chain) => chain.split(':')[0] === 'sui'), ); const selectedAccount = getSelectedAccount(connectedSuiAccounts, accountAddress); - setWalletConnected( - wallet, - connectedSuiAccounts, - selectedAccount, - connectResult.supportedIntents, - ); + setWalletConnected(wallet, connectedSuiAccounts, selectedAccount, supportedIntents); return { accounts: connectedSuiAccounts }; } catch (error) { diff --git a/packages/wallet-standard/src/features/index.ts b/packages/wallet-standard/src/features/index.ts index c277cbcc1..7654c130a 100644 --- a/packages/wallet-standard/src/features/index.ts +++ b/packages/wallet-standard/src/features/index.ts @@ -16,6 +16,7 @@ import type { SuiSignMessageFeature } from './suiSignMessage.js'; import type { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage.js'; import type { SuiSignTransactionFeature } from './suiSignTransaction.js'; import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock.js'; +import type { SuiGetSupportedIntentsFeature } from './suiGetSupportedIntents.js'; /** * Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement. @@ -27,7 +28,8 @@ export type SuiFeatures = Partial & SuiSignTransactionFeature & // This deprecated feature should be removed once wallets update to the new method: Partial & - Partial; + Partial & + Partial; export type SuiWalletFeatures = StandardConnectFeature & StandardEventsFeature & @@ -56,3 +58,4 @@ export * from './suiSignAndExecuteTransactionBlock.js'; export * from './suiSignAndExecuteTransaction.js'; export * from './suiSignPersonalMessage.js'; export * from './suiReportTransactionEffects.js'; +export * from './suiGetSupportedIntents.js'; diff --git a/packages/wallet-standard/src/features/suiGetSupportedIntents.ts b/packages/wallet-standard/src/features/suiGetSupportedIntents.ts new file mode 100644 index 000000000..069e86112 --- /dev/null +++ b/packages/wallet-standard/src/features/suiGetSupportedIntents.ts @@ -0,0 +1,21 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +export const SuiGetSupportedIntents = 'sui:getSupportedIntents'; + +/** The latest API version of the getSupportedIntents API. */ +export type SuiGetSupportedIntentsVersion = '1.0.0'; + +/** + * A Wallet Standard feature for reporting intents supported by the wallet. + */ +export type SuiGetSupportedIntentsFeature = { + [SuiGetSupportedIntents]: { + version: SuiGetSupportedIntentsVersion; + getSupportedIntents: SuiGetSupportedIntentsMethod; + }; +}; + +export type SuiGetSupportedIntentsMethod = () => Promise<{ + supportedIntents: string[]; +}>; From ca9248758ec8f5feacd37ceec21a2b0ce298bd23 Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Wed, 1 Oct 2025 13:50:43 -0700 Subject: [PATCH 24/36] improve mvr support (#577) Co-authored-by: Michael Hayes --- .changeset/heavy-loops-hunt.md | 5 +++ .changeset/seven-boats-teach.md | 5 +++ packages/sui-grpc/src/core.ts | 41 +++++++++++++++---- packages/typescript/src/experimental/core.ts | 11 +++-- packages/typescript/src/experimental/mvr.ts | 6 +++ .../src/experimental/transports/graphql.ts | 11 +++-- 6 files changed, 63 insertions(+), 16 deletions(-) create mode 100644 .changeset/heavy-loops-hunt.md create mode 100644 .changeset/seven-boats-teach.md diff --git a/.changeset/heavy-loops-hunt.md b/.changeset/heavy-loops-hunt.md new file mode 100644 index 000000000..90d6395f4 --- /dev/null +++ b/.changeset/heavy-loops-hunt.md @@ -0,0 +1,5 @@ +--- +'@mysten/sui-grpc': minor +--- + +Add balance methods and mvr support diff --git a/.changeset/seven-boats-teach.md b/.changeset/seven-boats-teach.md new file mode 100644 index 000000000..4c459d809 --- /dev/null +++ b/.changeset/seven-boats-teach.md @@ -0,0 +1,5 @@ +--- +'@mysten/sui': minor +--- + +Add mvr support to more core API methods diff --git a/packages/sui-grpc/src/core.ts b/packages/sui-grpc/src/core.ts index fb55ac1cf..a5f3d7a73 100644 --- a/packages/sui-grpc/src/core.ts +++ b/packages/sui-grpc/src/core.ts @@ -79,7 +79,9 @@ export class GrpcCoreClient extends Experimental_CoreClient { ): Promise { const response = await this.#client.liveDataService.listOwnedObjects({ owner: options.address, - objectType: options.type, + objectType: options.type + ? (await this.mvr.resolveType({ type: options.type })).type + : undefined, pageToken: options.cursor ? fromBase64(options.cursor) : undefined, }); @@ -108,10 +110,9 @@ export class GrpcCoreClient extends Experimental_CoreClient { async getCoins( options: Experimental_SuiClientTypes.GetCoinsOptions, ): Promise { - // TODO: we need coins sorted by balance const response = await this.#client.liveDataService.listOwnedObjects({ owner: options.address, - objectType: `0x2::coin::Coin<${options.coinType}>`, + objectType: `0x2::coin::Coin<${(await this.mvr.resolveType({ type: options.coinType })).type}>`, pageToken: options.cursor ? fromBase64(options.cursor) : undefined, }); @@ -138,16 +139,38 @@ export class GrpcCoreClient extends Experimental_CoreClient { } async getBalance( - _options: Experimental_SuiClientTypes.GetBalanceOptions, + options: Experimental_SuiClientTypes.GetBalanceOptions, ): Promise { - // TODO: GRPC doesn't expose balances yet - throw new Error('Not implemented'); + const result = await this.#client.liveDataService.getBalance({ + owner: options.address, + coinType: (await this.mvr.resolveType({ type: options.coinType })).type, + }); + + return { + balance: { + balance: result.response.balance?.balance?.toString() ?? '0', + coinType: result.response.balance?.coinType ?? options.coinType, + }, + }; } + async getAllBalances( - _options: Experimental_SuiClientTypes.GetAllBalancesOptions, + options: Experimental_SuiClientTypes.GetAllBalancesOptions, ): Promise { - // TODO: GRPC doesn't expose balances yet - throw new Error('Not implemented'); + const result = await this.#client.liveDataService.listBalances({ + owner: options.address, + pageToken: options.cursor ? fromBase64(options.cursor) : undefined, + pageSize: options.limit, + }); + + return { + hasNextPage: !!result.response.nextPageToken, + cursor: result.response.nextPageToken ? toBase64(result.response.nextPageToken) : null, + balances: result.response.balances.map((balance) => ({ + balance: balance.balance?.toString() ?? '0', + coinType: balance.coinType!, + })), + }; } async getTransaction( options: Experimental_SuiClientTypes.GetTransactionOptions, diff --git a/packages/typescript/src/experimental/core.ts b/packages/typescript/src/experimental/core.ts index cb6629b27..b4f76710d 100644 --- a/packages/typescript/src/experimental/core.ts +++ b/packages/typescript/src/experimental/core.ts @@ -104,11 +104,14 @@ export abstract class Experimental_CoreClient async getDynamicField( options: Experimental_SuiClientTypes.GetDynamicFieldOptions, ): Promise { - const fieldId = deriveDynamicFieldID( - options.parentId, - TypeTagSerializer.parseFromStr(options.name.type), - options.name.bcs, + const normalizedNameType = TypeTagSerializer.parseFromStr( + ( + await this.core.mvr.resolveType({ + type: options.name.type, + }) + ).type, ); + const fieldId = deriveDynamicFieldID(options.parentId, normalizedNameType, options.name.bcs); const { objects: [fieldObject], } = await this.getObjects({ diff --git a/packages/typescript/src/experimental/mvr.ts b/packages/typescript/src/experimental/mvr.ts index 9dc586acb..0e800e642 100644 --- a/packages/typescript/src/experimental/mvr.ts +++ b/packages/typescript/src/experimental/mvr.ts @@ -195,6 +195,12 @@ export class MvrClient implements Experimental_SuiClientTypes.MvrMethods { async resolveType({ type, }: Experimental_SuiClientTypes.MvrResolveTypeOptions): Promise { + if (!hasMvrName(type)) { + return { + type, + }; + } + const mvrTypes = [...extractMvrTypes(type)]; const resolvedTypes = await this.#mvrTypeDataLoader.loadMany(mvrTypes); diff --git a/packages/typescript/src/experimental/transports/graphql.ts b/packages/typescript/src/experimental/transports/graphql.ts index 10ef16069..b2507e420 100644 --- a/packages/typescript/src/experimental/transports/graphql.ts +++ b/packages/typescript/src/experimental/transports/graphql.ts @@ -127,7 +127,9 @@ export class GraphQLTransport extends Experimental_CoreClient { owner: options.address, limit: options.limit, cursor: options.cursor, - filter: options.type ? { type: options.type } : undefined, + filter: options.type + ? { type: (await this.mvr.resolveType({ type: options.type })).type } + : undefined, }, }, (result) => result.address?.objects, @@ -158,7 +160,7 @@ export class GraphQLTransport extends Experimental_CoreClient { owner: options.address, cursor: options.cursor, first: options.limit, - type: options.coinType, + type: (await this.mvr.resolveType({ type: options.coinType })).type, }, }, (result) => result.address?.coins, @@ -187,7 +189,10 @@ export class GraphQLTransport extends Experimental_CoreClient { const result = await this.#graphqlQuery( { query: GetBalanceDocument, - variables: { owner: options.address, type: options.coinType }, + variables: { + owner: options.address, + type: (await this.mvr.resolveType({ type: options.coinType })).type, + }, }, (result) => result.address?.balance, ); From 6fcc517bc75b65beb4d7b43008c8a3106e7626e4 Mon Sep 17 00:00:00 2001 From: Will Roeder Date: Wed, 1 Oct 2025 14:48:38 -0700 Subject: [PATCH 25/36] [Payment Kit] Added `asClientExtension` (#578) * Added `asClientExtension` * Updated export * Resolving lint errors * Removed `PaymentKitClientExtensionOptions` * Renamed to `paymentkit` * Made the name camel case --- packages/payment-kit/src/client.ts | 26 ++++++++++++++++++++------ packages/payment-kit/src/index.ts | 2 +- packages/payment-kit/src/types.ts | 10 ++++------ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/packages/payment-kit/src/client.ts b/packages/payment-kit/src/client.ts index ec3ef55d4..846cda570 100644 --- a/packages/payment-kit/src/client.ts +++ b/packages/payment-kit/src/client.ts @@ -8,24 +8,25 @@ import { TESTNET_PAYMENT_KIT_PACKAGE_CONFIG, } from './constants.js'; import type { - PaymentKitClientConfig, PaymentKitCompatibleClient, PaymentKitPackageConfig, + PaymentKitClientOptions, } from './types.js'; +import type { SuiClientRegistration } from '@mysten/sui/experimental'; export class PaymentKitClient { #packageConfig: PaymentKitPackageConfig; // @ts-expect-error - suiClient will be used in a later PR - #suiClient: PaymentKitCompatibleClient; + #client: PaymentKitCompatibleClient; - private constructor(config: PaymentKitClientConfig) { - if (config.suiClient) { - this.#suiClient = config.suiClient; + private constructor(options: PaymentKitClientOptions) { + if (options.client) { + this.#client = options.client; } else { throw new PaymentKitClientError('suiClient must be provided'); } - const network = config.suiClient.network; + const network = options.client.network; switch (network) { case 'testnet': this.#packageConfig = TESTNET_PAYMENT_KIT_PACKAGE_CONFIG; @@ -38,6 +39,19 @@ export class PaymentKitClient { } } + static asClientExtension(): SuiClientRegistration< + PaymentKitCompatibleClient, + 'paymentKit', + PaymentKitClient + > { + return { + name: 'paymentKit' as const, + register: (client) => { + return new PaymentKitClient({ client }); + }, + }; + } + get packageConfig() { return this.#packageConfig; } diff --git a/packages/payment-kit/src/index.ts b/packages/payment-kit/src/index.ts index 8a33a47eb..0ad9ea0f4 100644 --- a/packages/payment-kit/src/index.ts +++ b/packages/payment-kit/src/index.ts @@ -4,6 +4,6 @@ export { PaymentKitClient } from './client.js'; export type { PaymentKitCompatibleClient, - PaymentKitClientConfig, + PaymentKitClientOptions, PaymentKitPackageConfig, } from './types.js'; diff --git a/packages/payment-kit/src/types.ts b/packages/payment-kit/src/types.ts index 3d3613805..fe22d5ecb 100644 --- a/packages/payment-kit/src/types.ts +++ b/packages/payment-kit/src/types.ts @@ -1,16 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { ClientWithExtensions, Experimental_CoreClient } from '@mysten/sui/experimental'; +import type { ClientWithCoreApi } from '@mysten/sui/experimental'; export type PaymentKitPackageConfig = { packageId: string; }; -export type PaymentKitCompatibleClient = ClientWithExtensions<{ - core: Experimental_CoreClient; -}>; +export interface PaymentKitCompatibleClient extends ClientWithCoreApi {} -export interface PaymentKitClientConfig { - suiClient: PaymentKitCompatibleClient; +export interface PaymentKitClientOptions { + client: PaymentKitCompatibleClient; } From f700dcd280cf0dffaf2a8e85543db272909a38ae Mon Sep 17 00:00:00 2001 From: Will Roeder Date: Wed, 1 Oct 2025 15:26:19 -0700 Subject: [PATCH 26/36] [Payment Kit] Updated README (#579) Updated README to show correct way to instantiate a client --- packages/payment-kit/README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/payment-kit/README.md b/packages/payment-kit/README.md index f49451d43..ae545cb79 100644 --- a/packages/payment-kit/README.md +++ b/packages/payment-kit/README.md @@ -19,14 +19,10 @@ Typescript SDK, and a client instance of the Payment Kit SDK. import { getFullnodeUrl, SuiClient } from '@mysten/sui/client'; import { PaymentKitClient } from '@mysten/payment-kit'; -const suiClient = new SuiClient({ +const client = new SuiClient({ url: getFullnodeUrl('testnet'), network: 'testnet', -}); - -const paymentKitClient = new PaymentKitClient({ - suiClient, -}); +}).$extend(PaymentKitClient.asClientExtension()); ``` The Payment Kit SDK already includes all relevant package and object IDs to operate against From 5ab3c0aaf8e8f4f56febd150f2b5dcf3a2288d8b Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Thu, 2 Oct 2025 10:16:49 -0700 Subject: [PATCH 27/36] add client.core.getMoveFunction (#557) * [core-client] update schemas and add getMoveFunction method * add changeset and fix npm audit * update package and module to function response * fix build * add mvr resolution * add previousTransaction --------- Co-authored-by: Michael Hayes --- .changeset/sweet-wasps-deny.md | 5 + .../dapp-kit-core/src/utils/signer.ts | 2 +- packages/deepbook-v3/package.json | 2 +- packages/deepbook/package.json | 2 +- packages/graphql-transport/package.json | 2 +- packages/kiosk/package.json | 2 +- packages/move-bytecode-template/package.json | 3 +- packages/sui-grpc/src/core.ts | 199 ++++++- .../sui/rpc/v2beta2/checkpoint_summary.ts | 6 + .../src/proto/sui/rpc/v2beta2/effects.ts | 80 +-- .../proto/sui/rpc/v2beta2/execution_status.ts | 20 +- .../proto/sui/rpc/v2beta2/ledger_service.ts | 4 +- .../sui/rpc/v2beta2/live_data_service.ts | 151 ++++- .../sui/rpc/v2beta2/name_service.client.ts | 74 +++ .../src/proto/sui/rpc/v2beta2/name_service.ts | 534 ++++++++++++++++++ .../src/proto/sui/rpc/v2beta2/transaction.ts | 2 +- .../transaction_execution_service.client.ts | 6 + packages/typescript/graphql-codegen.ts | 15 + packages/typescript/package.json | 2 +- .../typescript/src/cryptography/keypair.ts | 4 +- packages/typescript/src/experimental/core.ts | 4 + packages/typescript/src/experimental/mvr.ts | 5 + .../src/experimental/transports/graphql.ts | 177 +++++- .../src/experimental/transports/jsonRPC.ts | 183 +++++- .../src/experimental/transports/utils.ts | 4 +- packages/typescript/src/experimental/types.ts | 147 ++++- .../graphql/generated/latest/schema.graphql | 170 +++--- .../src/graphql/generated/latest/tada-env.ts | 396 ++++++++----- .../src/graphql/generated/queries.ts | 350 ++++++++---- .../src/graphql/queries/getCoins.graphql | 3 + .../graphql/queries/getMoveFunction.graphql | 20 + .../src/graphql/queries/objects.graphql | 6 + .../src/graphql/queries/transactions.graphql | 18 +- packages/walrus/package.json | 4 +- pnpm-lock.yaml | 153 +---- 35 files changed, 2221 insertions(+), 534 deletions(-) create mode 100644 .changeset/sweet-wasps-deny.md create mode 100644 packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.client.ts create mode 100644 packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts create mode 100644 packages/typescript/src/graphql/queries/getMoveFunction.graphql diff --git a/.changeset/sweet-wasps-deny.md b/.changeset/sweet-wasps-deny.md new file mode 100644 index 000000000..bcbcde8b0 --- /dev/null +++ b/.changeset/sweet-wasps-deny.md @@ -0,0 +1,5 @@ +--- +'@mysten/sui': minor +--- + +Update graphql schema and add getMoveFunction to core client API diff --git a/packages/dapp-kit-next/packages/dapp-kit-core/src/utils/signer.ts b/packages/dapp-kit-next/packages/dapp-kit-core/src/utils/signer.ts index ae0a542cd..ebdf83a27 100644 --- a/packages/dapp-kit-next/packages/dapp-kit-core/src/utils/signer.ts +++ b/packages/dapp-kit-next/packages/dapp-kit-core/src/utils/signer.ts @@ -68,7 +68,7 @@ export class CurrentAccountSigner extends Signer { transaction, }: { transaction: Transaction; - }): Promise { + }): Promise> { const { bytes, signature, digest, effects } = await this.#dAppKit.signAndExecuteTransaction({ transaction, }); diff --git a/packages/deepbook-v3/package.json b/packages/deepbook-v3/package.json index 19c9eee23..0dd4a3da1 100644 --- a/packages/deepbook-v3/package.json +++ b/packages/deepbook-v3/package.json @@ -49,6 +49,6 @@ "typescript": "^5.9.2", "vite": "^7.1.5", "vitest": "^3.2.4", - "wait-on": "^8.0.4" + "wait-on": "^9.0.1" } } diff --git a/packages/deepbook/package.json b/packages/deepbook/package.json index 46e3687d7..f7bcd53b9 100644 --- a/packages/deepbook/package.json +++ b/packages/deepbook/package.json @@ -45,6 +45,6 @@ "typescript": "^5.9.2", "vite": "^7.1.5", "vitest": "^3.2.4", - "wait-on": "^8.0.4" + "wait-on": "^9.0.1" } } diff --git a/packages/graphql-transport/package.json b/packages/graphql-transport/package.json index 53c68a996..0db59c93c 100644 --- a/packages/graphql-transport/package.json +++ b/packages/graphql-transport/package.json @@ -53,7 +53,7 @@ "graphql-config": "^5.1.5", "typescript": "^5.9.2", "vitest": "^3.2.4", - "wait-on": "^8.0.4" + "wait-on": "^9.0.1" }, "dependencies": { "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/kiosk/package.json b/packages/kiosk/package.json index 90081eb97..7e6b2a270 100644 --- a/packages/kiosk/package.json +++ b/packages/kiosk/package.json @@ -48,6 +48,6 @@ "typescript": "^5.9.2", "vite": "^7.1.5", "vitest": "^3.2.4", - "wait-on": "^8.0.4" + "wait-on": "^9.0.1" } } diff --git a/packages/move-bytecode-template/package.json b/packages/move-bytecode-template/package.json index 4542a7690..7088e98d5 100644 --- a/packages/move-bytecode-template/package.json +++ b/packages/move-bytecode-template/package.json @@ -35,7 +35,6 @@ "@mysten/bcs": "workspace:*", "@mysten/build-scripts": "workspace:*", "typescript": "^5.9.2", - "vitest": "^3.2.4", - "wasm-pack": "^0.13.1" + "vitest": "^3.2.4" } } diff --git a/packages/sui-grpc/src/core.ts b/packages/sui-grpc/src/core.ts index a5f3d7a73..a366ecfd5 100644 --- a/packages/sui-grpc/src/core.ts +++ b/packages/sui-grpc/src/core.ts @@ -12,14 +12,21 @@ import { Owner_OwnerKind } from './proto/sui/rpc/v2beta2/owner.js'; import { chunk, fromBase64, toBase64 } from '@mysten/utils'; import type { ExecutedTransaction } from './proto/sui/rpc/v2beta2/executed_transaction.js'; import type { TransactionEffects } from './proto/sui/rpc/v2beta2/effects.js'; +import { UnchangedConsensusObject_UnchangedConsensusObjectKind } from './proto/sui/rpc/v2beta2/effects.js'; import { ChangedObject_IdOperation, ChangedObject_InputObjectState, ChangedObject_OutputObjectState, - UnchangedSharedObject_UnchangedSharedObjectKind, } from './proto/sui/rpc/v2beta2/effects.js'; import { TransactionDataBuilder } from '@mysten/sui/transactions'; import { bcs } from '@mysten/sui/bcs'; +import type { OpenSignature, OpenSignatureBody } from './proto/sui/rpc/v2beta2/move_package.js'; +import { + Ability, + FunctionDescriptor_Visibility, + OpenSignature_Reference, + OpenSignatureBody_Type, +} from './proto/sui/rpc/v2beta2/move_package.js'; export interface GrpcCoreClientOptions extends Experimental_CoreClientOptions { client: SuiGrpcClient; } @@ -40,7 +47,15 @@ export class GrpcCoreClient extends Experimental_CoreClient { const response = await this.#client.ledgerService.batchGetObjects({ requests: batch.map((id) => ({ objectId: id })), readMask: { - paths: ['owner', 'object_type', 'bcs', 'digest', 'version', 'object_id'], + paths: [ + 'owner', + 'object_type', + 'bcs', + 'digest', + 'version', + 'object_id', + 'previous_transaction', + ], }, }); @@ -64,6 +79,7 @@ export class GrpcCoreClient extends Experimental_CoreClient { content: Promise.resolve(object.result.object.bcs?.value!), owner: mapOwner(object.result.object.owner)!, type: object.result.object.objectType!, + previousTransaction: object.result.object.previousTransaction ?? null, }; }, ), @@ -83,6 +99,17 @@ export class GrpcCoreClient extends Experimental_CoreClient { ? (await this.mvr.resolveType({ type: options.type })).type : undefined, pageToken: options.cursor ? fromBase64(options.cursor) : undefined, + readMask: { + paths: [ + 'owner', + 'object_type', + 'bcs', + 'digest', + 'version', + 'object_id', + 'previous_transaction', + ], + }, }); const objects = response.response.objects.map( @@ -98,6 +125,7 @@ export class GrpcCoreClient extends Experimental_CoreClient { }, owner: mapOwner(object.owner)!, type: object.objectType!, + previousTransaction: object.previousTransaction ?? null, }), ); @@ -114,6 +142,18 @@ export class GrpcCoreClient extends Experimental_CoreClient { owner: options.address, objectType: `0x2::coin::Coin<${(await this.mvr.resolveType({ type: options.coinType })).type}>`, pageToken: options.cursor ? fromBase64(options.cursor) : undefined, + readMask: { + paths: [ + 'owner', + 'object_type', + 'bcs', + 'digest', + 'version', + 'object_id', + 'balance', + 'previous_transaction', + ], + }, }); return { @@ -131,6 +171,7 @@ export class GrpcCoreClient extends Experimental_CoreClient { owner: mapOwner(object.owner)!, type: object.objectType!, balance: object.balance?.toString()!, + previousTransaction: object.previousTransaction ?? null, }), ), cursor: response.response.nextPageToken ? toBase64(response.response.nextPageToken) : null, @@ -178,7 +219,7 @@ export class GrpcCoreClient extends Experimental_CoreClient { const { response } = await this.#client.ledgerService.getTransaction({ digest: options.digest, readMask: { - paths: ['digest', 'transaction', 'effects', 'signatures'], + paths: ['digest', 'transaction', 'effects', 'signatures', 'balance_changes'], }, }); @@ -209,6 +250,7 @@ export class GrpcCoreClient extends Experimental_CoreClient { 'transaction.transaction', 'transaction.effects', 'transaction.signatures', + 'transaction.balance_changes', ], }, }); @@ -231,6 +273,7 @@ export class GrpcCoreClient extends Experimental_CoreClient { 'transaction.transaction', 'transaction.effects', 'transaction.signatures', + 'transaction.balance_changes', ], }, }); @@ -296,6 +339,62 @@ export class GrpcCoreClient extends Experimental_CoreClient { }; } + async getMoveFunction( + options: Experimental_SuiClientTypes.GetMoveFunctionOptions, + ): Promise { + const { response } = await this.#client.movePackageService.getFunction({ + packageId: (await this.mvr.resolvePackage({ package: options.packageId })).package, + moduleName: options.moduleName, + name: options.name, + }); + + let visibility: 'public' | 'private' | 'friend' | 'unknown' = 'unknown'; + + switch (response.function?.visibility) { + case FunctionDescriptor_Visibility.PUBLIC: + visibility = 'public'; + break; + case FunctionDescriptor_Visibility.PRIVATE: + visibility = 'private'; + break; + case FunctionDescriptor_Visibility.FRIEND: + visibility = 'friend'; + break; + } + + return { + function: { + packageId: options.packageId, + moduleName: options.moduleName, + name: response.function?.name!, + visibility, + isEntry: response.function?.isEntry ?? false, + typeParameters: + response.function?.typeParameters?.map(({ constraints }) => ({ + isPhantom: false, + constraints: + constraints.map((constraint) => { + switch (constraint) { + case Ability.COPY: + return 'copy'; + case Ability.DROP: + return 'drop'; + case Ability.STORE: + return 'store'; + case Ability.KEY: + return 'key'; + default: + return 'unknown'; + } + }) ?? [], + })) ?? [], + parameters: + response.function?.parameters?.map((param) => parseNormalizedSuiMoveType(param)) ?? [], + returns: response.function?.returns?.map((ret) => parseNormalizedSuiMoveType(ret)) ?? [], + }, + }; + } + resolveTransactionPlugin(): never { throw new Error('GRPC client does not support transaction resolution yet'); } @@ -405,24 +504,24 @@ function mapOutputObjectState( } } -function mapUnchangedSharedObjectKind( - kind: UnchangedSharedObject_UnchangedSharedObjectKind | undefined, -): null | Experimental_SuiClientTypes.UnchangedSharedObject['kind'] { +function mapUnchangedConsensusObjectKind( + kind: UnchangedConsensusObject_UnchangedConsensusObjectKind | undefined, +): null | Experimental_SuiClientTypes.UnchangedConsensusObject['kind'] { if (kind == null) { return null; } switch (kind) { - case UnchangedSharedObject_UnchangedSharedObjectKind.UNCHANGED_SHARED_OBJECT_KIND_UNKNOWN: + case UnchangedConsensusObject_UnchangedConsensusObjectKind.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN: return 'Unknown'; - case UnchangedSharedObject_UnchangedSharedObjectKind.READ_ONLY_ROOT: + case UnchangedConsensusObject_UnchangedConsensusObjectKind.READ_ONLY_ROOT: return 'ReadOnlyRoot'; - case UnchangedSharedObject_UnchangedSharedObjectKind.MUTATE_CONSENSUS_STREAM_ENDED: + case UnchangedConsensusObject_UnchangedConsensusObjectKind.MUTATE_CONSENSUS_STREAM_ENDED: return 'MutateConsensusStreamEnded'; - case UnchangedSharedObject_UnchangedSharedObjectKind.READ_CONSENSUS_STREAM_ENDED: + case UnchangedConsensusObject_UnchangedConsensusObjectKind.READ_CONSENSUS_STREAM_ENDED: return 'ReadConsensusStreamEnded'; - case UnchangedSharedObject_UnchangedSharedObjectKind.CANCELED: + case UnchangedConsensusObject_UnchangedConsensusObjectKind.CANCELED: return 'Cancelled'; - case UnchangedSharedObject_UnchangedSharedObjectKind.PER_EPOCH_CONFIG: + case UnchangedConsensusObject_UnchangedConsensusObjectKind.PER_EPOCH_CONFIG: return 'PerEpochConfig'; default: kind satisfies never; @@ -493,10 +592,10 @@ export function parseTransactionEffects({ dependencies: effects.dependencies, lamportVersion: effects.lamportVersion?.toString() ?? null, changedObjects, - unchangedSharedObjects: effects.unchangedSharedObjects.map( - (object): Experimental_SuiClientTypes.UnchangedSharedObject => { + unchangedConsensusObjects: effects.unchangedConsensusObjects.map( + (object): Experimental_SuiClientTypes.UnchangedConsensusObject => { return { - kind: mapUnchangedSharedObjectKind(object.kind)!, + kind: mapUnchangedConsensusObjectKind(object.kind)!, // TODO: we are inconsistent about id vs objectId objectId: object.objectId!, version: object.version?.toString() ?? null, @@ -549,5 +648,75 @@ function parseTransaction( bcs: bytes, }, signatures: parsedTx.txSignatures, + balanceChanges: + transaction.balanceChanges?.map((change) => ({ + coinType: change.coinType!, + address: change.address!, + amount: change.amount!, + })) ?? [], }; } + +function parseNormalizedSuiMoveType( + type: OpenSignature, +): Experimental_SuiClientTypes.OpenSignature { + let reference: 'mutable' | 'immutable' | null = null; + + if (type.reference === OpenSignature_Reference.IMMUTABLE) { + reference = 'immutable'; + } else if (type.reference === OpenSignature_Reference.MUTABLE) { + reference = 'mutable'; + } + + return { + reference, + body: parseNormalizedSuiMoveTypeBody(type.body!), + }; +} + +function parseNormalizedSuiMoveTypeBody( + type: OpenSignatureBody, +): Experimental_SuiClientTypes.OpenSignatureBody { + switch (type.type) { + case OpenSignatureBody_Type.TYPE_UNKNOWN: + return { $kind: 'unknown' }; + case OpenSignatureBody_Type.ADDRESS: + return { $kind: 'address' }; + case OpenSignatureBody_Type.BOOL: + return { $kind: 'bool' }; + case OpenSignatureBody_Type.U8: + return { $kind: 'u8' }; + case OpenSignatureBody_Type.U16: + return { $kind: 'u16' }; + case OpenSignatureBody_Type.U32: + return { $kind: 'u32' }; + case OpenSignatureBody_Type.U64: + return { $kind: 'u64' }; + case OpenSignatureBody_Type.U128: + return { $kind: 'u128' }; + case OpenSignatureBody_Type.U256: + return { $kind: 'u256' }; + case OpenSignatureBody_Type.VECTOR: + return { + $kind: 'vector', + vector: parseNormalizedSuiMoveTypeBody(type.typeParameterInstantiation[0]), + }; + case OpenSignatureBody_Type.DATATYPE: + return { + $kind: 'datatype', + datatype: { + typeName: type.typeName!, + typeParameters: type.typeParameterInstantiation.map((t) => + parseNormalizedSuiMoveTypeBody(t), + ), + }, + }; + case OpenSignatureBody_Type.TYPE_PARAMETER: + return { + $kind: 'typeParameter', + index: type.typeParameter!, + }; + default: + return { $kind: 'unknown' }; + } +} diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts index 7fca1ae4f..5586e8f12 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts @@ -174,6 +174,12 @@ export enum CheckpointCommitment_CheckpointCommitmentKind { * @generated from protobuf enum value: ECMH_LIVE_OBJECT_SET = 1; */ ECMH_LIVE_OBJECT_SET = 1, + /** + * Digest of the checkpoint artifacts. + * + * @generated from protobuf enum value: CHECKPOINT_ARTIFACTS = 2; + */ + CHECKPOINT_ARTIFACTS = 2, } // @generated message type with reflection information, may provide speed optimized methods class CheckpointSummary$Type extends MessageType { diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts index 1a33e44cb..4be9b11bf 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts @@ -95,14 +95,14 @@ export interface TransactionEffects { */ changedObjects: ChangedObject[]; /** - * Shared objects that are not mutated in this transaction. Unlike owned objects, - * read-only shared objects' version are not committed in the transaction, + * Consensus objects that are not mutated in this transaction. Unlike owned objects, + * read-only consensus objects' version are not committed in the transaction, * and in order for a node to catch up and execute it without consensus sequencing, * the version needs to be committed in the effects. * - * @generated from protobuf field: repeated sui.rpc.v2beta2.UnchangedSharedObject unchanged_shared_objects = 13 + * @generated from protobuf field: repeated sui.rpc.v2beta2.UnchangedConsensusObject unchanged_consensus_objects = 13 */ - unchangedSharedObjects: UnchangedSharedObject[]; + unchangedConsensusObjects: UnchangedConsensusObject[]; /** * Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately. * Storing it separately allows us to avoid bloating the effects with data that are not critical. @@ -242,29 +242,29 @@ export enum ChangedObject_IdOperation { DELETED = 3, } /** - * A shared object that wasn't changed during execution. + * A consensus object that wasn't changed during execution. * - * @generated from protobuf message sui.rpc.v2beta2.UnchangedSharedObject + * @generated from protobuf message sui.rpc.v2beta2.UnchangedConsensusObject */ -export interface UnchangedSharedObject { +export interface UnchangedConsensusObject { /** - * @generated from protobuf field: optional sui.rpc.v2beta2.UnchangedSharedObject.UnchangedSharedObjectKind kind = 1 + * @generated from protobuf field: optional sui.rpc.v2beta2.UnchangedConsensusObject.UnchangedConsensusObjectKind kind = 1 */ - kind?: UnchangedSharedObject_UnchangedSharedObjectKind; + kind?: UnchangedConsensusObject_UnchangedConsensusObjectKind; /** - * ObjectId of the shared object. + * ObjectId of the consensus object. * * @generated from protobuf field: optional string object_id = 2 */ objectId?: string; /** - * Version of the shared object. + * Version of the consensus object. * * @generated from protobuf field: optional uint64 version = 3 */ version?: bigint; /** - * Digest of the shared object. + * Digest of the consensus object. * * @generated from protobuf field: optional string digest = 4 */ @@ -278,15 +278,15 @@ export interface UnchangedSharedObject { objectType?: string; } /** - * @generated from protobuf enum sui.rpc.v2beta2.UnchangedSharedObject.UnchangedSharedObjectKind + * @generated from protobuf enum sui.rpc.v2beta2.UnchangedConsensusObject.UnchangedConsensusObjectKind */ -export enum UnchangedSharedObject_UnchangedSharedObjectKind { +export enum UnchangedConsensusObject_UnchangedConsensusObjectKind { /** - * @generated from protobuf enum value: UNCHANGED_SHARED_OBJECT_KIND_UNKNOWN = 0; + * @generated from protobuf enum value: UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN = 0; */ - UNCHANGED_SHARED_OBJECT_KIND_UNKNOWN = 0, + UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN = 0, /** - * Read-only shared object from the input. + * Read-only consensus object from the input. * * @generated from protobuf enum value: READ_ONLY_ROOT = 1; */ @@ -363,10 +363,10 @@ class TransactionEffects$Type extends MessageType { }, { no: 13, - name: 'unchanged_shared_objects', + name: 'unchanged_consensus_objects', kind: 'message', repeat: 2 /*RepeatType.UNPACKED*/, - T: () => UnchangedSharedObject, + T: () => UnchangedConsensusObject, }, { no: 14, @@ -381,7 +381,7 @@ class TransactionEffects$Type extends MessageType { const message = globalThis.Object.create(this.messagePrototype!); message.dependencies = []; message.changedObjects = []; - message.unchangedSharedObjects = []; + message.unchangedConsensusObjects = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } @@ -449,9 +449,9 @@ class TransactionEffects$Type extends MessageType { ChangedObject.internalBinaryRead(reader, reader.uint32(), options), ); break; - case /* repeated sui.rpc.v2beta2.UnchangedSharedObject unchanged_shared_objects */ 13: - message.unchangedSharedObjects.push( - UnchangedSharedObject.internalBinaryRead(reader, reader.uint32(), options), + case /* repeated sui.rpc.v2beta2.UnchangedConsensusObject unchanged_consensus_objects */ 13: + message.unchangedConsensusObjects.push( + UnchangedConsensusObject.internalBinaryRead(reader, reader.uint32(), options), ); break; case /* optional string auxiliary_data_digest */ 14: @@ -535,10 +535,10 @@ class TransactionEffects$Type extends MessageType { writer.tag(12, WireType.LengthDelimited).fork(), options, ).join(); - /* repeated sui.rpc.v2beta2.UnchangedSharedObject unchanged_shared_objects = 13; */ - for (let i = 0; i < message.unchangedSharedObjects.length; i++) - UnchangedSharedObject.internalBinaryWrite( - message.unchangedSharedObjects[i], + /* repeated sui.rpc.v2beta2.UnchangedConsensusObject unchanged_consensus_objects = 13; */ + for (let i = 0; i < message.unchangedConsensusObjects.length; i++) + UnchangedConsensusObject.internalBinaryWrite( + message.unchangedConsensusObjects[i], writer.tag(13, WireType.LengthDelimited).fork(), options, ).join(); @@ -744,17 +744,17 @@ class ChangedObject$Type extends MessageType { */ export const ChangedObject = new ChangedObject$Type(); // @generated message type with reflection information, may provide speed optimized methods -class UnchangedSharedObject$Type extends MessageType { +class UnchangedConsensusObject$Type extends MessageType { constructor() { - super('sui.rpc.v2beta2.UnchangedSharedObject', [ + super('sui.rpc.v2beta2.UnchangedConsensusObject', [ { no: 1, name: 'kind', kind: 'enum', opt: true, T: () => [ - 'sui.rpc.v2beta2.UnchangedSharedObject.UnchangedSharedObjectKind', - UnchangedSharedObject_UnchangedSharedObjectKind, + 'sui.rpc.v2beta2.UnchangedConsensusObject.UnchangedConsensusObjectKind', + UnchangedConsensusObject_UnchangedConsensusObjectKind, ], }, { no: 2, name: 'object_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, @@ -770,23 +770,23 @@ class UnchangedSharedObject$Type extends MessageType { { no: 5, name: 'object_type', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): UnchangedSharedObject { + create(value?: PartialMessage): UnchangedConsensusObject { const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); + if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead( reader: IBinaryReader, length: number, options: BinaryReadOptions, - target?: UnchangedSharedObject, - ): UnchangedSharedObject { + target?: UnchangedConsensusObject, + ): UnchangedConsensusObject { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* optional sui.rpc.v2beta2.UnchangedSharedObject.UnchangedSharedObjectKind kind */ 1: + case /* optional sui.rpc.v2beta2.UnchangedConsensusObject.UnchangedConsensusObjectKind kind */ 1: message.kind = reader.int32(); break; case /* optional string object_id */ 2: @@ -821,11 +821,11 @@ class UnchangedSharedObject$Type extends MessageType { return message; } internalBinaryWrite( - message: UnchangedSharedObject, + message: UnchangedConsensusObject, writer: IBinaryWriter, options: BinaryWriteOptions, ): IBinaryWriter { - /* optional sui.rpc.v2beta2.UnchangedSharedObject.UnchangedSharedObjectKind kind = 1; */ + /* optional sui.rpc.v2beta2.UnchangedConsensusObject.UnchangedConsensusObjectKind kind = 1; */ if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); /* optional string object_id = 2; */ if (message.objectId !== undefined) @@ -844,6 +844,6 @@ class UnchangedSharedObject$Type extends MessageType { } } /** - * @generated MessageType for protobuf message sui.rpc.v2beta2.UnchangedSharedObject + * @generated MessageType for protobuf message sui.rpc.v2beta2.UnchangedConsensusObject */ -export const UnchangedSharedObject = new UnchangedSharedObject$Type(); +export const UnchangedConsensusObject = new UnchangedConsensusObject$Type(); diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts index 1901fd63d..26ddcbe2f 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts @@ -328,23 +328,23 @@ export enum ExecutionError_ExecutionErrorKind { */ SUI_MOVE_VERIFICATION_TIMEDOUT = 31, /** - * The requested shared object operation is not allowed. + * The requested consensus object operation is not allowed. * - * @generated from protobuf enum value: SHARED_OBJECT_OPERATION_NOT_ALLOWED = 32; + * @generated from protobuf enum value: CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED = 32; */ - SHARED_OBJECT_OPERATION_NOT_ALLOWED = 32, + CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED = 32, /** - * Requested shared object has been deleted. + * Requested consensus object has been deleted. * * @generated from protobuf enum value: INPUT_OBJECT_DELETED = 33; */ INPUT_OBJECT_DELETED = 33, /** - * Certificate is canceled due to congestion on shared objects. + * Certificate is canceled due to congestion on consensus objects. * - * @generated from protobuf enum value: EXECUTION_CANCELED_DUE_TO_SHARED_OBJECT_CONGESTION = 34; + * @generated from protobuf enum value: EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION = 34; */ - EXECUTION_CANCELED_DUE_TO_SHARED_OBJECT_CONGESTION = 34, + EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION = 34, /** * Address is denied for this coin type. * @@ -647,12 +647,12 @@ export enum CommandArgumentError_CommandArgumentErrorKind { */ INVALID_OBJECT_BY_MUT_REF = 11, /** - * Shared object operations such as wrapping, freezing, or converting to owned are not + * Consensus object operations such as wrapping, freezing, or converting to owned are not * allowed. * - * @generated from protobuf enum value: SHARED_OBJECT_OPERATION_NOT_ALLOWED = 12; + * @generated from protobuf enum value: CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED = 12; */ - SHARED_OBJECT_OPERATION_NOT_ALLOWED = 12, + CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED = 12, /** * Invalid argument arity. Expected a single argument but found a result that expanded to * multiple arguments. diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts index 004250f0f..30e66e538 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts @@ -204,7 +204,7 @@ export interface BatchGetTransactionsRequest { digests: string[]; /** * Mask specifying which fields to read. - * If no mask is specified, defaults to `object_id,version,digest`. + * If no mask is specified, defaults to `digest`. * * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2 */ @@ -278,7 +278,7 @@ export interface GetCheckpointRequest { }; /** * Mask specifying which fields to read. - * If no mask is specified, defaults to `object_id,version,digest`. + * If no mask is specified, defaults to `sequence_number,digest`. * * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 3 */ diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts index 766f03908..2b4cc7286 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts @@ -58,8 +58,12 @@ export interface GetCoinInfoResponse { treasury?: CoinTreasury; /** * If this coin type is a regulated coin, this field will be - * populated with information about its `0x2::coin::RegulatedCoinMetadata` - * object. + * populated with information either from its Currency object + * in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata` + * object for coins that have not been migrated to the CoinRegistry + * + * If this coin is not known to be regulated, only the + * coin_regulated_state field will be populated. * * @generated from protobuf field: optional sui.rpc.v2beta2.RegulatedCoinMetadata regulated_metadata = 4 */ @@ -73,7 +77,7 @@ export interface GetCoinInfoResponse { export interface CoinMetadata { /** * ObjectId of the `0x2::coin::CoinMetadata` object or - * 0x2::sui::coin_registry::CoinData object (when registered with CoinRegistry). + * 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry). * * @generated from protobuf field: optional string id = 1 */ @@ -116,6 +120,44 @@ export interface CoinMetadata { * @generated from protobuf field: optional string metadata_cap_id = 7 */ metadataCapId?: string; + /** + * State of the MetadataCap for this coin type. + * + * @generated from protobuf field: optional sui.rpc.v2beta2.CoinMetadata.MetadataCapState metadata_cap_state = 8 + */ + metadataCapState?: CoinMetadata_MetadataCapState; +} +/** + * Information about the state of the coin's MetadataCap + * + * @generated from protobuf enum sui.rpc.v2beta2.CoinMetadata.MetadataCapState + */ +export enum CoinMetadata_MetadataCapState { + /** + * Indicates the state of the MetadataCap is unknown. + * Set when the coin has not been migrated to the CoinRegistry. + * + * @generated from protobuf enum value: METADATA_CAP_STATE_UNKNOWN = 0; + */ + METADATA_CAP_STATE_UNKNOWN = 0, + /** + * Indicates the MetadataCap has been claimed. + * + * @generated from protobuf enum value: CLAIMED = 1; + */ + CLAIMED = 1, + /** + * Indicates the MetadataCap has not been claimed. + * + * @generated from protobuf enum value: UNCLAIMED = 2; + */ + UNCLAIMED = 2, + /** + * Indicates the MetadataCap has been deleted. + * + * @generated from protobuf enum value: DELETED = 3; + */ + DELETED = 3, } /** * Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply @@ -160,6 +202,12 @@ export enum CoinTreasury_SupplyState { * @generated from protobuf enum value: FIXED = 1; */ FIXED = 1, + /** + * Supply can only decrease (burning allowed, minting not allowed) + * + * @generated from protobuf enum value: BURN_ONLY = 2; + */ + BURN_ONLY = 2, } /** * Information about a regulated coin, which indicates that it makes use of the transfer deny list. @@ -169,6 +217,7 @@ export enum CoinTreasury_SupplyState { export interface RegulatedCoinMetadata { /** * ObjectId of the `0x2::coin::RegulatedCoinMetadata` object. + * Only present for coins that have not been migrated to CoinRegistry. * * @generated from protobuf field: optional string id = 1 */ @@ -185,6 +234,52 @@ export interface RegulatedCoinMetadata { * @generated from protobuf field: optional string deny_cap_object = 3 */ denyCapObject?: string; + /** + * Whether the coin can be globally paused + * + * @generated from protobuf field: optional bool allow_global_pause = 4 + */ + allowGlobalPause?: boolean; + /** + * Variant of the regulated coin metadata + * + * @generated from protobuf field: optional uint32 variant = 5 + */ + variant?: number; + /** + * Indicates the coin's regulated state. + * + * @generated from protobuf field: optional sui.rpc.v2beta2.RegulatedCoinMetadata.CoinRegulatedState coin_regulated_state = 6 + */ + coinRegulatedState?: RegulatedCoinMetadata_CoinRegulatedState; +} +/** + * Indicates the state of the regulation of the coin. + * + * @generated from protobuf enum sui.rpc.v2beta2.RegulatedCoinMetadata.CoinRegulatedState + */ +export enum RegulatedCoinMetadata_CoinRegulatedState { + /** + * Indicates the regulation state of the coin is unknown. + * This is set when a coin has not been migrated to the + * coin registry and has no `0x2::coin::RegulatedCoinMetadata` + * object. + * + * @generated from protobuf enum value: COIN_REGULATED_STATE_UNKNOWN = 0; + */ + COIN_REGULATED_STATE_UNKNOWN = 0, + /** + * Indicates a coin is regulated. RegulatedCoinMetadata will be populated. + * + * @generated from protobuf enum value: REGULATED = 1; + */ + REGULATED = 1, + /** + * Indicates a coin is unregulated. + * + * @generated from protobuf enum value: UNREGULATED = 2; + */ + UNREGULATED = 2, } /** * Request message for `LiveDataService.GetBalance`. @@ -321,6 +416,9 @@ export interface ListDynamicFieldsRequest { */ pageToken?: Uint8Array; /** + * Mask specifying which fields to read. + * If no mask is specified, defaults to `parent,field_id`. + * * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 4 */ readMask?: FieldMask; @@ -430,6 +528,8 @@ export interface SimulateTransactionRequest { */ transaction?: Transaction; /** + * Mask specifying which fields to read. + * * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2 */ readMask?: FieldMask; @@ -540,6 +640,9 @@ export interface ListOwnedObjectsRequest { */ pageToken?: Uint8Array; /** + * Mask specifying which fields to read. + * If no mask is specified, defaults to `object_id,version,object_type`. + * * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 4 */ readMask?: FieldMask; @@ -758,6 +861,13 @@ class CoinMetadata$Type extends MessageType { { no: 5, name: 'description', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 6, name: 'icon_url', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 7, name: 'metadata_cap_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { + no: 8, + name: 'metadata_cap_state', + kind: 'enum', + opt: true, + T: () => ['sui.rpc.v2beta2.CoinMetadata.MetadataCapState', CoinMetadata_MetadataCapState], + }, ]); } create(value?: PartialMessage): CoinMetadata { @@ -797,6 +907,9 @@ class CoinMetadata$Type extends MessageType { case /* optional string metadata_cap_id */ 7: message.metadataCapId = reader.string(); break; + case /* optional sui.rpc.v2beta2.CoinMetadata.MetadataCapState metadata_cap_state */ 8: + message.metadataCapState = reader.int32(); + break; default: let u = options.readUnknownField; if (u === 'throw') @@ -839,6 +952,9 @@ class CoinMetadata$Type extends MessageType { /* optional string metadata_cap_id = 7; */ if (message.metadataCapId !== undefined) writer.tag(7, WireType.LengthDelimited).string(message.metadataCapId); + /* optional sui.rpc.v2beta2.CoinMetadata.MetadataCapState metadata_cap_state = 8; */ + if (message.metadataCapState !== undefined) + writer.tag(8, WireType.Varint).int32(message.metadataCapState); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; @@ -949,6 +1065,18 @@ class RegulatedCoinMetadata$Type extends MessageType { T: 9 /*ScalarType.STRING*/, }, { no: 3, name: 'deny_cap_object', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'allow_global_pause', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: 'variant', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ }, + { + no: 6, + name: 'coin_regulated_state', + kind: 'enum', + opt: true, + T: () => [ + 'sui.rpc.v2beta2.RegulatedCoinMetadata.CoinRegulatedState', + RegulatedCoinMetadata_CoinRegulatedState, + ], + }, ]); } create(value?: PartialMessage): RegulatedCoinMetadata { @@ -976,6 +1104,15 @@ class RegulatedCoinMetadata$Type extends MessageType { case /* optional string deny_cap_object */ 3: message.denyCapObject = reader.string(); break; + case /* optional bool allow_global_pause */ 4: + message.allowGlobalPause = reader.bool(); + break; + case /* optional uint32 variant */ 5: + message.variant = reader.uint32(); + break; + case /* optional sui.rpc.v2beta2.RegulatedCoinMetadata.CoinRegulatedState coin_regulated_state */ 6: + message.coinRegulatedState = reader.int32(); + break; default: let u = options.readUnknownField; if (u === 'throw') @@ -1008,6 +1145,14 @@ class RegulatedCoinMetadata$Type extends MessageType { /* optional string deny_cap_object = 3; */ if (message.denyCapObject !== undefined) writer.tag(3, WireType.LengthDelimited).string(message.denyCapObject); + /* optional bool allow_global_pause = 4; */ + if (message.allowGlobalPause !== undefined) + writer.tag(4, WireType.Varint).bool(message.allowGlobalPause); + /* optional uint32 variant = 5; */ + if (message.variant !== undefined) writer.tag(5, WireType.Varint).uint32(message.variant); + /* optional sui.rpc.v2beta2.RegulatedCoinMetadata.CoinRegulatedState coin_regulated_state = 6; */ + if (message.coinRegulatedState !== undefined) + writer.tag(6, WireType.Varint).int32(message.coinRegulatedState); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.client.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.client.ts new file mode 100644 index 000000000..3aaee62f4 --- /dev/null +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.client.ts @@ -0,0 +1,74 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import type { RpcTransport } from '@protobuf-ts/runtime-rpc'; +import type { ServiceInfo } from '@protobuf-ts/runtime-rpc'; +import { NameService } from './name_service.js'; +import type { ReverseLookupNameResponse } from './name_service.js'; +import type { ReverseLookupNameRequest } from './name_service.js'; +import { stackIntercept } from '@protobuf-ts/runtime-rpc'; +import type { LookupNameResponse } from './name_service.js'; +import type { LookupNameRequest } from './name_service.js'; +import type { UnaryCall } from '@protobuf-ts/runtime-rpc'; +import type { RpcOptions } from '@protobuf-ts/runtime-rpc'; +/** + * @generated from protobuf service sui.rpc.v2beta2.NameService + */ +export interface INameServiceClient { + /** + * @generated from protobuf rpc: LookupName + */ + lookupName( + input: LookupNameRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * @generated from protobuf rpc: ReverseLookupName + */ + reverseLookupName( + input: ReverseLookupNameRequest, + options?: RpcOptions, + ): UnaryCall; +} +/** + * @generated from protobuf service sui.rpc.v2beta2.NameService + */ +export class NameServiceClient implements INameServiceClient, ServiceInfo { + typeName = NameService.typeName; + methods = NameService.methods; + options = NameService.options; + constructor(private readonly _transport: RpcTransport) {} + /** + * @generated from protobuf rpc: LookupName + */ + lookupName( + input: LookupNameRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[0], + opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * @generated from protobuf rpc: ReverseLookupName + */ + reverseLookupName( + input: ReverseLookupNameRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[1], + opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } +} diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts new file mode 100644 index 000000000..deb09cce8 --- /dev/null +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts @@ -0,0 +1,534 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { ServiceType } from '@protobuf-ts/runtime-rpc'; +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { Timestamp } from '../../../google/protobuf/timestamp.js'; +/** + * @generated from protobuf message sui.rpc.v2beta2.LookupNameRequest + */ +export interface LookupNameRequest { + /** + * Required. The SuiNS name to lookup. + * + * Supports both `@name` as well as `name.sui` formats. + * + * @generated from protobuf field: optional string name = 1 + */ + name?: string; +} +/** + * @generated from protobuf message sui.rpc.v2beta2.LookupNameResponse + */ +export interface LookupNameResponse { + /** + * The record for the requested name + * + * @generated from protobuf field: optional sui.rpc.v2beta2.NameRecord record = 1 + */ + record?: NameRecord; +} +/** + * @generated from protobuf message sui.rpc.v2beta2.ReverseLookupNameRequest + */ +export interface ReverseLookupNameRequest { + /** + * Required. The address to perform a reverse lookup for. + * + * @generated from protobuf field: optional string address = 1 + */ + address?: string; +} +/** + * @generated from protobuf message sui.rpc.v2beta2.ReverseLookupNameResponse + */ +export interface ReverseLookupNameResponse { + /** + * The record for the SuiNS name linked to the requested address + * + * @generated from protobuf field: optional sui.rpc.v2beta2.NameRecord record = 1 + */ + record?: NameRecord; +} +/** + * @generated from protobuf message sui.rpc.v2beta2.NameRecord + */ +export interface NameRecord { + /** + * Id of this record. + * + * Note that records are stored on chain as dynamic fields of the type + * `Field`. + * + * @generated from protobuf field: optional string id = 1 + */ + id?: string; + /** + * The SuiNS name of this record + * + * @generated from protobuf field: optional string name = 2 + */ + name?: string; + /** + * The ID of the `RegistrationNFT` assigned to this record. + * + * The owner of the corrisponding `RegistrationNFT` has the rights to + * be able to change and adjust the `target_address` of this domain. + * + * It is possible that the ID changes if the record expires and is + * purchased by someone else. + * + * @generated from protobuf field: optional string registration_nft_id = 3 + */ + registrationNftId?: string; + /** + * Timestamp when the record expires. + * + * This is either the expiration of the record itself or the expiration of + * this record's parent if this is a leaf record. + * + * @generated from protobuf field: optional google.protobuf.Timestamp expiration_timestamp = 4 + */ + expirationTimestamp?: Timestamp; + /** + * The target address that this name points to + * + * @generated from protobuf field: optional string target_address = 5 + */ + targetAddress?: string; + /** + * Additional data which may be stored in a record + * + * @generated from protobuf field: map data = 6 + */ + data: { + [key: string]: string; + }; +} +// @generated message type with reflection information, may provide speed optimized methods +class LookupNameRequest$Type extends MessageType { + constructor() { + super('sui.rpc.v2beta2.LookupNameRequest', [ + { no: 1, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): LookupNameRequest { + const message = globalThis.Object.create(this.messagePrototype!); + if (value !== undefined) reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LookupNameRequest, + ): LookupNameRequest { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LookupNameRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message sui.rpc.v2beta2.LookupNameRequest + */ +export const LookupNameRequest = new LookupNameRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LookupNameResponse$Type extends MessageType { + constructor() { + super('sui.rpc.v2beta2.LookupNameResponse', [ + { no: 1, name: 'record', kind: 'message', T: () => NameRecord }, + ]); + } + create(value?: PartialMessage): LookupNameResponse { + const message = globalThis.Object.create(this.messagePrototype!); + if (value !== undefined) reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LookupNameResponse, + ): LookupNameResponse { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional sui.rpc.v2beta2.NameRecord record */ 1: + message.record = NameRecord.internalBinaryRead( + reader, + reader.uint32(), + options, + message.record, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LookupNameResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional sui.rpc.v2beta2.NameRecord record = 1; */ + if (message.record) + NameRecord.internalBinaryWrite( + message.record, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message sui.rpc.v2beta2.LookupNameResponse + */ +export const LookupNameResponse = new LookupNameResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReverseLookupNameRequest$Type extends MessageType { + constructor() { + super('sui.rpc.v2beta2.ReverseLookupNameRequest', [ + { no: 1, name: 'address', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): ReverseLookupNameRequest { + const message = globalThis.Object.create(this.messagePrototype!); + if (value !== undefined) reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ReverseLookupNameRequest, + ): ReverseLookupNameRequest { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ReverseLookupNameRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string address = 1; */ + if (message.address !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message sui.rpc.v2beta2.ReverseLookupNameRequest + */ +export const ReverseLookupNameRequest = new ReverseLookupNameRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReverseLookupNameResponse$Type extends MessageType { + constructor() { + super('sui.rpc.v2beta2.ReverseLookupNameResponse', [ + { no: 1, name: 'record', kind: 'message', T: () => NameRecord }, + ]); + } + create(value?: PartialMessage): ReverseLookupNameResponse { + const message = globalThis.Object.create(this.messagePrototype!); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ReverseLookupNameResponse, + ): ReverseLookupNameResponse { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional sui.rpc.v2beta2.NameRecord record */ 1: + message.record = NameRecord.internalBinaryRead( + reader, + reader.uint32(), + options, + message.record, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ReverseLookupNameResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional sui.rpc.v2beta2.NameRecord record = 1; */ + if (message.record) + NameRecord.internalBinaryWrite( + message.record, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message sui.rpc.v2beta2.ReverseLookupNameResponse + */ +export const ReverseLookupNameResponse = new ReverseLookupNameResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NameRecord$Type extends MessageType { + constructor() { + super('sui.rpc.v2beta2.NameRecord', [ + { no: 1, name: 'id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: 'registration_nft_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'expiration_timestamp', kind: 'message', T: () => Timestamp }, + { no: 5, name: 'target_address', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { + no: 6, + name: 'data', + kind: 'map', + K: 9 /*ScalarType.STRING*/, + V: { kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + }, + ]); + } + create(value?: PartialMessage): NameRecord { + const message = globalThis.Object.create(this.messagePrototype!); + message.data = {}; + if (value !== undefined) reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NameRecord, + ): NameRecord { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string id */ 1: + message.id = reader.string(); + break; + case /* optional string name */ 2: + message.name = reader.string(); + break; + case /* optional string registration_nft_id */ 3: + message.registrationNftId = reader.string(); + break; + case /* optional google.protobuf.Timestamp expiration_timestamp */ 4: + message.expirationTimestamp = Timestamp.internalBinaryRead( + reader, + reader.uint32(), + options, + message.expirationTimestamp, + ); + break; + case /* optional string target_address */ 5: + message.targetAddress = reader.string(); + break; + case /* map data */ 6: + this.binaryReadMap6(message.data, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + private binaryReadMap6( + map: NameRecord['data'], + reader: IBinaryReader, + options: BinaryReadOptions, + ): void { + let len = reader.uint32(), + end = reader.pos + len, + key: keyof NameRecord['data'] | undefined, + val: NameRecord['data'][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: + throw new globalThis.Error('unknown map entry field for sui.rpc.v2beta2.NameRecord.data'); + } + } + map[key ?? ''] = val ?? ''; + } + internalBinaryWrite( + message: NameRecord, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string id = 1; */ + if (message.id !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.id); + /* optional string name = 2; */ + if (message.name !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.name); + /* optional string registration_nft_id = 3; */ + if (message.registrationNftId !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.registrationNftId); + /* optional google.protobuf.Timestamp expiration_timestamp = 4; */ + if (message.expirationTimestamp) + Timestamp.internalBinaryWrite( + message.expirationTimestamp, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional string target_address = 5; */ + if (message.targetAddress !== undefined) + writer.tag(5, WireType.LengthDelimited).string(message.targetAddress); + /* map data = 6; */ + for (let k of globalThis.Object.keys(message.data)) + writer + .tag(6, WireType.LengthDelimited) + .fork() + .tag(1, WireType.LengthDelimited) + .string(k) + .tag(2, WireType.LengthDelimited) + .string(message.data[k]) + .join(); + let u = options.writeUnknownFields; + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message sui.rpc.v2beta2.NameRecord + */ +export const NameRecord = new NameRecord$Type(); +/** + * @generated ServiceType for protobuf service sui.rpc.v2beta2.NameService + */ +export const NameService = new ServiceType('sui.rpc.v2beta2.NameService', [ + { name: 'LookupName', options: {}, I: LookupNameRequest, O: LookupNameResponse }, + { + name: 'ReverseLookupName', + options: {}, + I: ReverseLookupNameRequest, + O: ReverseLookupNameResponse, + }, +]); diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts index 17075098e..9cb5ffe71 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts @@ -713,7 +713,7 @@ export interface ConsensusCommitPrologue { */ subDagIndex?: bigint; /** - * Stores consensus handler determined shared object version assignments. + * Stores consensus handler determined consensus object version assignments. * * Present in V3, V4. * diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.client.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.client.ts index 5b743f612..0a813a1eb 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.client.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.client.ts @@ -13,6 +13,9 @@ import type { RpcOptions } from '@protobuf-ts/runtime-rpc'; */ export interface ITransactionExecutionServiceClient { /** + * TODO move simulate transaction here for GA release + * rpc SimulateTransaction(SimulateTransactionRequest) returns (SimulateTransactionResponse); + * * @generated from protobuf rpc: ExecuteTransaction */ executeTransaction( @@ -31,6 +34,9 @@ export class TransactionExecutionServiceClient options = TransactionExecutionService.options; constructor(private readonly _transport: RpcTransport) {} /** + * TODO move simulate transaction here for GA release + * rpc SimulateTransaction(SimulateTransactionRequest) returns (SimulateTransactionResponse); + * * @generated from protobuf rpc: ExecuteTransaction */ executeTransaction( diff --git a/packages/typescript/graphql-codegen.ts b/packages/typescript/graphql-codegen.ts index b96229133..02f4988b0 100644 --- a/packages/typescript/graphql-codegen.ts +++ b/packages/typescript/graphql-codegen.ts @@ -17,6 +17,21 @@ const config: CodegenConfig = { ignoreNoDocuments: true, generates: { 'src/graphql/generated/queries.ts': { + config: { + scalars: { + BigInt: 'string', + Base64: 'string', + DateTime: 'string', + ObjectID: 'string', + Address: 'string', + JSON: 'unknown', + UInt53: 'number', + MoveData: '../types.js#MoveData', + MoveTypeLayout: '../types.js#MoveTypeLayout', + MoveTypeSignature: '../types.js#MoveTypeSignature', + OpenMoveTypeSignature: '../types.js#OpenMoveTypeSignature', + }, + }, plugins: [ { add: { diff --git a/packages/typescript/package.json b/packages/typescript/package.json index f557ed873..9a91dadbb 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -156,7 +156,7 @@ "vite": "^7.1.5", "vite-tsconfig-paths": "^5.1.4", "vitest": "^3.2.4", - "wait-on": "^8.0.4", + "wait-on": "^9.0.1", "ws": "^8.18.3" }, "dependencies": { diff --git a/packages/typescript/src/cryptography/keypair.ts b/packages/typescript/src/cryptography/keypair.ts index b5a329f57..881952641 100644 --- a/packages/typescript/src/cryptography/keypair.ts +++ b/packages/typescript/src/cryptography/keypair.ts @@ -83,7 +83,9 @@ export abstract class Signer { async signAndExecuteTransaction({ transaction, client, - }: SignAndExecuteOptions): Promise { + }: SignAndExecuteOptions): Promise< + Omit + > { const bytes = await transaction.build({ client }); const { signature } = await this.signTransaction(bytes); const response = await client.core.executeTransaction({ diff --git a/packages/typescript/src/experimental/core.ts b/packages/typescript/src/experimental/core.ts index b4f76710d..95df93328 100644 --- a/packages/typescript/src/experimental/core.ts +++ b/packages/typescript/src/experimental/core.ts @@ -101,6 +101,10 @@ export abstract class Experimental_CoreClient options: Experimental_SuiClientTypes.VerifyZkLoginSignatureOptions, ): Promise; + abstract getMoveFunction( + options: Experimental_SuiClientTypes.GetMoveFunctionOptions, + ): Promise; + async getDynamicField( options: Experimental_SuiClientTypes.GetDynamicFieldOptions, ): Promise { diff --git a/packages/typescript/src/experimental/mvr.ts b/packages/typescript/src/experimental/mvr.ts index 0e800e642..d0af1aa56 100644 --- a/packages/typescript/src/experimental/mvr.ts +++ b/packages/typescript/src/experimental/mvr.ts @@ -186,6 +186,11 @@ export class MvrClient implements Experimental_SuiClientTypes.MvrMethods { async resolvePackage({ package: name, }: Experimental_SuiClientTypes.MvrResolvePackageOptions): Promise { + if (!hasMvrName(name)) { + return { + package: name, + }; + } const resolved = await this.#mvrPackageDataLoader.load(name); return { package: resolved, diff --git a/packages/typescript/src/experimental/transports/graphql.ts b/packages/typescript/src/experimental/transports/graphql.ts index b2507e420..64ffc4856 100644 --- a/packages/typescript/src/experimental/transports/graphql.ts +++ b/packages/typescript/src/experimental/transports/graphql.ts @@ -16,6 +16,7 @@ import { GetBalanceDocument, GetCoinsDocument, GetDynamicFieldsDocument, + GetMoveFunctionDocument, GetOwnedObjectsDocument, GetReferenceGasPriceDocument, GetTransactionBlockDocument, @@ -29,6 +30,7 @@ import { fromBase64, toBase64 } from '@mysten/utils'; import { normalizeStructTag, normalizeSuiAddress } from '../../utils/sui-types.js'; import { deriveDynamicFieldID } from '../../utils/dynamic-fields.js'; import { parseTransactionBcs, parseTransactionEffectsBcs } from './utils.js'; +import type { OpenMoveTypeSignatureBody, OpenMoveTypeSignature } from '../../graphql/types.js'; export class GraphQLTransport extends Experimental_CoreClient { #graphqlClient: SuiGraphQLClient; @@ -113,6 +115,7 @@ export class GraphQLTransport extends Experimental_CoreClient { ? fromBase64(obj.asMoveObject.contents.bcs) : new Uint8Array(), ), + previousTransaction: obj.previousTransactionBlock?.digest ?? null, }; }), }; @@ -145,6 +148,7 @@ export class GraphQLTransport extends Experimental_CoreClient { content: Promise.resolve( obj.contents?.bcs ? fromBase64(obj.contents.bcs) : new Uint8Array(), ), + previousTransaction: obj.previousTransactionBlock?.digest ?? null, })), hasNextPage: objects.pageInfo.hasNextPage, cursor: objects.pageInfo.endCursor ?? null, @@ -175,10 +179,11 @@ export class GraphQLTransport extends Experimental_CoreClient { digest: coin.digest!, owner: mapOwner(coin.owner!), type: coin.contents?.type?.repr!, - balance: coin.coinBalance, + balance: coin.coinBalance!, content: Promise.resolve( coin.contents?.bcs ? fromBase64(coin.contents.bcs) : new Uint8Array(), ), + previousTransaction: coin.previousTransactionBlock?.digest ?? null, })), }; } @@ -200,7 +205,7 @@ export class GraphQLTransport extends Experimental_CoreClient { return { balance: { coinType: result.coinType.repr, - balance: result.totalBalance, + balance: result.totalBalance!, }, }; } @@ -220,7 +225,7 @@ export class GraphQLTransport extends Experimental_CoreClient { hasNextPage: balances.pageInfo.hasNextPage, balances: balances.nodes.map((balance) => ({ coinType: balance.coinType.repr, - balance: balance.totalBalance, + balance: balance.totalBalance!, })), }; } @@ -289,7 +294,7 @@ export class GraphQLTransport extends Experimental_CoreClient { ); return { - referenceGasPrice: result.referenceGasPrice, + referenceGasPrice: result, }; } @@ -314,7 +319,7 @@ export class GraphQLTransport extends Experimental_CoreClient { id: deriveDynamicFieldID( options.parentId, dynamicField.name?.type.repr!, - dynamicField.name?.bcs!, + fromBase64(dynamicField.name?.bcs!), ), type: normalizeStructTag( dynamicField.value?.__typename === 'MoveObject' @@ -383,6 +388,70 @@ export class GraphQLTransport extends Experimental_CoreClient { }; } + async getMoveFunction( + options: Experimental_SuiClientTypes.GetMoveFunctionOptions, + ): Promise { + const moveFunction = await this.#graphqlQuery( + { + query: GetMoveFunctionDocument, + variables: { + package: (await this.mvr.resolvePackage({ package: options.packageId })).package, + module: options.moduleName, + function: options.name, + }, + }, + (result) => result.package?.module?.function, + ); + + let visibility: 'public' | 'private' | 'friend' | 'unknown' = 'unknown'; + + switch (moveFunction.visibility) { + case 'PUBLIC': + visibility = 'public'; + break; + case 'PRIVATE': + visibility = 'private'; + break; + case 'FRIEND': + visibility = 'friend'; + break; + } + + return { + function: { + packageId: normalizeSuiAddress(options.packageId), + moduleName: options.moduleName, + name: moveFunction.name, + visibility, + isEntry: moveFunction.isEntry ?? false, + typeParameters: + moveFunction.typeParameters?.map(({ constraints }) => ({ + isPhantom: false, + constraints: + constraints.map((constraint) => { + switch (constraint) { + case 'COPY': + return 'copy'; + case 'DROP': + return 'drop'; + case 'STORE': + return 'store'; + case 'KEY': + return 'key'; + default: + return 'unknown'; + } + }) ?? [], + })) ?? [], + parameters: + moveFunction.parameters?.map((param) => parseNormalizedSuiMoveType(param.signature)) ?? + [], + returns: + moveFunction.return?.map(({ signature }) => parseNormalizedSuiMoveType(signature)) ?? [], + }, + }; + } + resolveTransactionPlugin(): never { throw new Error('GraphQL client does not support transaction resolution yet'); } @@ -423,7 +492,7 @@ function mapOwner(owner: Object_Owner_FieldsFragment): Experimental_SuiClientTyp $kind: 'ConsensusAddressOwner', ConsensusAddressOwner: { owner: owner.owner?.address, - startVersion: owner.startVersion, + startVersion: String(owner.startVersion), }, }; case 'Immutable': @@ -431,7 +500,10 @@ function mapOwner(owner: Object_Owner_FieldsFragment): Experimental_SuiClientTyp case 'Parent': return { $kind: 'ObjectOwner', ObjectOwner: owner.parent?.address }; case 'Shared': - return { $kind: 'Shared', Shared: owner.initialSharedVersion }; + return { + $kind: 'Shared', + Shared: { initialSharedVersion: String(owner.initialSharedVersion) }, + }; } } @@ -440,8 +512,8 @@ function parseTransaction( ): Experimental_SuiClientTypes.TransactionResponse { const objectTypes: Record = {}; - transaction.effects?.unchangedSharedObjects.nodes.forEach((node) => { - if (node.__typename === 'SharedObjectRead') { + transaction.effects?.unchangedConsensusObjects.nodes.forEach((node) => { + if (node.__typename === 'ConsensusObjectRead') { const type = node.object?.asMoveObject?.contents?.type.repr; const address = node.object?.asMoveObject?.address; @@ -462,12 +534,93 @@ function parseTransaction( } }); + if (transaction.effects?.balanceChanges.pageInfo.hasNextPage) { + throw new Error('Pagination for balance changes is not supported'); + } + return { digest: transaction.digest!, - effects: parseTransactionEffectsBcs(new Uint8Array(transaction.effects?.bcs!)), - epoch: transaction.effects?.epoch?.epochId ?? null, + effects: parseTransactionEffectsBcs(fromBase64(transaction.effects?.bcs!)), + epoch: transaction.effects?.epoch?.epochId?.toString() ?? null, objectTypes: Promise.resolve(objectTypes), - transaction: parseTransactionBcs(transaction.bcs!), + transaction: parseTransactionBcs(fromBase64(transaction.bcs!)), signatures: transaction.signatures!, + balanceChanges: + transaction.effects?.balanceChanges.nodes.map((change) => ({ + coinType: change?.coinType?.repr!, + address: change.owner?.address!, + amount: change.amount!, + })) ?? [], + // events: transaction.events?.pageInfo.hasNextPage }; } + +function parseNormalizedSuiMoveType( + type: OpenMoveTypeSignature, +): Experimental_SuiClientTypes.OpenSignature { + let reference: 'mutable' | 'immutable' | null = null; + + if (type.ref === '&') { + reference = 'immutable'; + } else if (type.ref === '&mut') { + reference = 'mutable'; + } + + return { + reference, + body: parseNormalizedSuiMoveTypeBody(type.body), + }; +} + +function parseNormalizedSuiMoveTypeBody( + type: OpenMoveTypeSignatureBody, +): Experimental_SuiClientTypes.OpenSignatureBody { + switch (type) { + case 'address': + return { $kind: 'address' }; + case 'bool': + return { $kind: 'bool' }; + case 'u8': + return { $kind: 'u8' }; + case 'u16': + return { $kind: 'u16' }; + case 'u32': + return { $kind: 'u32' }; + case 'u64': + return { $kind: 'u64' }; + case 'u128': + return { $kind: 'u128' }; + case 'u256': + return { $kind: 'u256' }; + } + + if (typeof type === 'string') { + throw new Error(`Unknown type: ${type}`); + } + + if ('vector' in type) { + return { + $kind: 'vector', + vector: parseNormalizedSuiMoveTypeBody(type.vector), + }; + } + + if ('datatype' in type) { + return { + $kind: 'datatype', + datatype: { + typeName: `${normalizeSuiAddress(type.datatype.package)}::${type.datatype.module}::${type.datatype.type}`, + typeParameters: type.datatype.typeParameters.map((t) => parseNormalizedSuiMoveTypeBody(t)), + }, + }; + } + + if ('typeParameter' in type) { + return { + $kind: 'typeParameter', + index: type.typeParameter, + }; + } + + throw new Error(`Unknown type: ${JSON.stringify(type)}`); +} diff --git a/packages/typescript/src/experimental/transports/jsonRPC.ts b/packages/typescript/src/experimental/transports/jsonRPC.ts index efaa94eb4..10360b040 100644 --- a/packages/typescript/src/experimental/transports/jsonRPC.ts +++ b/packages/typescript/src/experimental/transports/jsonRPC.ts @@ -7,6 +7,9 @@ import { bcs } from '../../bcs/index.js'; import type { ObjectOwner, SuiClient, + SuiMoveAbilitySet, + SuiMoveNormalizedType, + SuiMoveVisibility, SuiObjectChange, SuiObjectData, SuiTransactionBlockResponse, @@ -20,6 +23,7 @@ import { parseTransactionBcs, parseTransactionEffectsBcs } from './utils.js'; import { suiClientResolveTransactionPlugin } from './json-rpc-resolver.js'; import { TransactionDataBuilder } from '../../transactions/TransactionData.js'; import { chunk } from '@mysten/utils'; +import { normalizeSuiAddress } from '../../utils/sui-types.js'; export class JSONRpcTransport extends Experimental_CoreClient { #jsonRpcClient: SuiClient; @@ -46,6 +50,7 @@ export class JSONRpcTransport extends Experimental_CoreClient { showOwner: true, showType: true, showBcs: true, + showPreviousTransaction: true, }, signal: options.signal, }); @@ -72,6 +77,7 @@ export class JSONRpcTransport extends Experimental_CoreClient { showOwner: true, showType: true, showBcs: true, + showPreviousTransaction: true, }, filter: options.type ? { StructType: options.type } : null, signal: options.signal, @@ -119,6 +125,7 @@ export class JSONRpcTransport extends Experimental_CoreClient { $kind: 'ObjectOwner' as const, ObjectOwner: options.address, }, + previousTransaction: coin.previousTransaction, }; }), hasNextPage: coins.hasNextPage, @@ -164,6 +171,7 @@ export class JSONRpcTransport extends Experimental_CoreClient { showRawEffects: true, showEvents: true, showEffects: true, + showBalanceChanges: true, }, signal: options.signal, }); @@ -182,6 +190,7 @@ export class JSONRpcTransport extends Experimental_CoreClient { showObjectChanges: true, showRawInput: true, showEffects: true, + showBalanceChanges: true, }, signal: options.signal, }); @@ -210,6 +219,11 @@ export class JSONRpcTransport extends Experimental_CoreClient { objectTypes: Promise.resolve(objectTypes), signatures: [], transaction: parseTransactionBcs(options.transaction), + balanceChanges: result.balanceChanges.map((change) => ({ + coinType: change.coinType, + address: parseOwnerAddress(change.owner)!, + amount: change.amount, + })), }, }; } @@ -268,6 +282,32 @@ export class JSONRpcTransport extends Experimental_CoreClient { resolveTransactionPlugin() { return suiClientResolveTransactionPlugin(this.#jsonRpcClient); } + + async getMoveFunction( + options: Experimental_SuiClientTypes.GetMoveFunctionOptions, + ): Promise { + const result = await this.#jsonRpcClient.getNormalizedMoveFunction({ + package: (await this.mvr.resolvePackage({ package: options.packageId })).package, + module: options.moduleName, + function: options.name, + }); + + return { + function: { + packageId: normalizeSuiAddress(options.packageId), + moduleName: options.moduleName, + name: options.name, + visibility: parseVisibility(result.visibility), + isEntry: result.isEntry, + typeParameters: result.typeParameters.map((abilities) => ({ + isPhantom: false, + constraints: parseAbilities(abilities), + })), + parameters: result.parameters.map((param) => parseNormalizedSuiMoveType(param)), + returns: result.return.map((ret) => parseNormalizedSuiMoveType(ret)), + }, + }; + } } function parseObject(object: SuiObjectData): Experimental_SuiClientTypes.ObjectResponse { @@ -280,6 +320,7 @@ function parseObject(object: SuiObjectData): Experimental_SuiClientTypes.ObjectR object.bcs?.dataType === 'moveObject' ? fromBase64(object.bcs.bcsBytes) : new Uint8Array(), ), owner: parseOwner(object.owner!), + previousTransaction: object.previousTransaction ?? null, }; } @@ -327,6 +368,30 @@ function parseOwner(owner: ObjectOwner): Experimental_SuiClientTypes.ObjectOwner throw new Error(`Unknown owner type: ${JSON.stringify(owner)}`); } +function parseOwnerAddress(owner: ObjectOwner): string | null { + if (owner === 'Immutable') { + return null; + } + + if ('ConsensusAddressOwner' in owner) { + return owner.ConsensusAddressOwner.owner; + } + + if ('AddressOwner' in owner) { + return owner.AddressOwner; + } + + if ('ObjectOwner' in owner) { + return owner.ObjectOwner; + } + + if ('Shared' in owner) { + return null; + } + + throw new Error(`Unknown owner type: ${JSON.stringify(owner)}`); +} + function parseTransaction( transaction: SuiTransactionBlockResponse, ): Experimental_SuiClientTypes.TransactionResponse { @@ -360,6 +425,12 @@ function parseTransaction( bcs: bytes, }, signatures: parsedTx.txSignatures, + balanceChanges: + transaction.balanceChanges?.map((change) => ({ + coinType: change.coinType, + address: parseOwnerAddress(change.owner)!, + amount: change.amount, + })) ?? [], }; } @@ -376,7 +447,7 @@ function parseTransactionEffectsJson({ objectTypes: Record; } { const changedObjects: Experimental_SuiClientTypes.ChangedObject[] = []; - const unchangedSharedObjects: Experimental_SuiClientTypes.UnchangedSharedObject[] = []; + const unchangedConsensusObjects: Experimental_SuiClientTypes.UnchangedConsensusObject[] = []; const objectTypes: Record = {}; objectChanges?.forEach((change) => { @@ -511,7 +582,7 @@ function parseTransactionEffectsJson({ dependencies: effects.dependencies ?? [], lamportVersion: effects.gasObject.reference.version, changedObjects, - unchangedSharedObjects, + unchangedConsensusObjects, auxiliaryDataDigest: null, }, }; @@ -525,3 +596,111 @@ const Coin = bcs.struct('Coin', { id: bcs.Address, balance: Balance, }); + +function parseNormalizedSuiMoveType( + type: SuiMoveNormalizedType, +): Experimental_SuiClientTypes.OpenSignature { + if (typeof type !== 'string') { + if ('Reference' in type) { + return { + reference: 'immutable', + body: parseNormalizedSuiMoveTypeBody(type.Reference), + }; + } + + if ('MutableReference' in type) { + return { + reference: 'mutable', + body: parseNormalizedSuiMoveTypeBody(type.MutableReference), + }; + } + } + + return { + reference: null, + body: parseNormalizedSuiMoveTypeBody(type), + }; +} + +function parseNormalizedSuiMoveTypeBody( + type: SuiMoveNormalizedType, +): Experimental_SuiClientTypes.OpenSignatureBody { + switch (type) { + case 'Address': + return { $kind: 'address' }; + case 'Bool': + return { $kind: 'bool' }; + case 'U8': + return { $kind: 'u8' }; + case 'U16': + return { $kind: 'u16' }; + case 'U32': + return { $kind: 'u32' }; + case 'U64': + return { $kind: 'u64' }; + case 'U128': + return { $kind: 'u128' }; + case 'U256': + return { $kind: 'u256' }; + } + + if (typeof type === 'string') { + throw new Error(`Unknown type: ${type}`); + } + + if ('Vector' in type) { + return { + $kind: 'vector', + vector: parseNormalizedSuiMoveTypeBody(type.Vector), + }; + } + + if ('Struct' in type) { + return { + $kind: 'datatype', + datatype: { + typeName: `${normalizeSuiAddress(type.Struct.address)}::${type.Struct.module}::${type.Struct.name}`, + typeParameters: type.Struct.typeArguments.map((t) => parseNormalizedSuiMoveTypeBody(t)), + }, + }; + } + + if ('TypeParameter' in type) { + return { + $kind: 'typeParameter', + index: type.TypeParameter, + }; + } + + throw new Error(`Unknown type: ${JSON.stringify(type)}`); +} + +function parseAbilities(abilitySet: SuiMoveAbilitySet): Experimental_SuiClientTypes.Ability[] { + return abilitySet.abilities.map((ability) => { + switch (ability) { + case 'Copy': + return 'copy'; + case 'Drop': + return 'drop'; + case 'Store': + return 'store'; + case 'Key': + return 'key'; + default: + return 'unknown'; + } + }); +} + +function parseVisibility(visibility: SuiMoveVisibility): Experimental_SuiClientTypes.Visibility { + switch (visibility) { + case 'Public': + return 'public'; + case 'Private': + return 'private'; + case 'Friend': + return 'friend'; + default: + return 'unknown'; + } +} diff --git a/packages/typescript/src/experimental/transports/utils.ts b/packages/typescript/src/experimental/transports/utils.ts index 2af42276f..f5692b4b3 100644 --- a/packages/typescript/src/experimental/transports/utils.ts +++ b/packages/typescript/src/experimental/transports/utils.ts @@ -94,8 +94,8 @@ function parseTransactionEffectsV2({ dependencies: effects.dependencies, lamportVersion: effects.lamportVersion, changedObjects, - unchangedSharedObjects: effects.unchangedSharedObjects.map( - ([objectId, object]): Experimental_SuiClientTypes.UnchangedSharedObject => { + unchangedConsensusObjects: effects.unchangedSharedObjects.map( + ([objectId, object]): Experimental_SuiClientTypes.UnchangedConsensusObject => { return { kind: object.$kind === 'MutateDeleted' diff --git a/packages/typescript/src/experimental/types.ts b/packages/typescript/src/experimental/types.ts index c163e5720..304d7fa1e 100644 --- a/packages/typescript/src/experimental/types.ts +++ b/packages/typescript/src/experimental/types.ts @@ -124,6 +124,7 @@ export namespace Experimental_SuiClientTypes { owner: ObjectOwner; type: string; content: PromiseLike; + previousTransaction: string | null; } export interface CoinResponse extends ObjectResponse { @@ -208,10 +209,17 @@ export namespace Experimental_SuiClientTypes { effects: TransactionEffects; objectTypes: PromiseLike>; transaction: TransactionData; + balanceChanges: BalanceChange[]; // TODO: add events // events?: Uint8Array; } + export interface BalanceChange { + coinType: string; + address: string; + amount: string; + } + export interface TransactionData extends SerializedTransactionDataV2 { bcs: Uint8Array; } @@ -339,6 +347,134 @@ export namespace Experimental_SuiClientTypes { >; } + /** Move package methods */ + + export interface TransportMethods { + getMoveFunction: (options: GetMoveFunctionOptions) => Promise; + } + + export interface GetMovePackageOptions extends CoreClientMethodOptions { + packageId: string; + } + + export interface GetMovePackageResponse { + package: PackageResponse; + } + + export interface PackageResponse { + storageId: string; + originalId: string; + version: string; + modules: ModuleResponse[]; + } + + export interface ModuleResponse { + name: string; + datatypes: DatatypeResponse[]; + functions: FunctionResponse[]; + } + + export type DatatypeResponse = + | { + $kind: 'struct'; + typeName: string; + definingId: string; + moduleName: string; + name: string; + abilities: Ability[]; + typeParameters: TypeParameter[]; + fields: FieldDescriptor[]; + } + | { + $kind: 'enum'; + typeName: string; + definingId: string; + moduleName: string; + name: string; + abilities: Ability[]; + typeParameters: TypeParameter[]; + variants: VariantDescriptor[]; + }; + + export type Ability = 'copy' | 'drop' | 'store' | 'key' | 'unknown'; + export type DatatypeKind = 'struct' | 'enum' | 'unknown'; + + export interface TypeParameter { + constraints: Ability[]; + isPhantom: boolean; + } + + export interface FieldDescriptor { + name: string; + position: number; + type: OpenSignatureBody; + } + + export interface VariantDescriptor { + name: string; + position: number; + fields: FieldDescriptor[]; + } + + export interface GetMoveFunctionOptions extends CoreClientMethodOptions { + packageId: string; + moduleName: string; + name: string; + } + + export interface GetMoveFunctionResponse { + function: FunctionResponse; + } + + export interface GetMoveDatatypeOptions extends CoreClientMethodOptions { + packageId: string; + moduleName: string; + name: string; + } + + export interface GetMoveDatatypeResponse { + datatype: DatatypeResponse; + } + + export type Visibility = 'public' | 'friend' | 'private' | 'unknown'; + + export interface FunctionResponse { + packageId: string; + moduleName: string; + name: string; + visibility: Visibility; + isEntry: boolean; + typeParameters: TypeParameter[]; + parameters: OpenSignature[]; + returns: OpenSignature[]; + } + + export type ReferenceType = 'mutable' | 'immutable' | 'unknown'; + export type OpenSignature = { + reference: ReferenceType | null; + body: OpenSignatureBody; + }; + + export type OpenSignatureBody = + | { + $kind: 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'bool' | 'address' | 'unknown'; + } + | { + $kind: 'vector'; + vector: OpenSignatureBody; + } + | { + $kind: 'datatype'; + datatype: { + typeName: string; + typeParameters: OpenSignatureBody[]; + }; + } + | { + $kind: 'typeParameter'; + index: number; + }; + /** ObjectOwner types */ export interface AddressOwner { @@ -371,12 +507,17 @@ export namespace Experimental_SuiClientTypes { }; } + export interface UnknownOwner { + $kind: 'Unknown'; + } + export type ObjectOwner = | AddressOwner | ParentOwner | SharedOwner | ImmutableOwner - | ConsensusAddressOwner; + | ConsensusAddressOwner + | UnknownOwner; /** Effects */ @@ -392,7 +533,7 @@ export namespace Experimental_SuiClientTypes { dependencies: string[]; lamportVersion: string | null; changedObjects: ChangedObject[]; - unchangedSharedObjects: UnchangedSharedObject[]; + unchangedConsensusObjects: UnchangedConsensusObject[]; auxiliaryDataDigest: string | null; } @@ -427,7 +568,7 @@ export namespace Experimental_SuiClientTypes { error: string; }; - export interface UnchangedSharedObject { + export interface UnchangedConsensusObject { kind: | 'Unknown' | 'ReadOnlyRoot' diff --git a/packages/typescript/src/graphql/generated/latest/schema.graphql b/packages/typescript/src/graphql/generated/latest/schema.graphql index ec6abda74..cde655dd4 100644 --- a/packages/typescript/src/graphql/generated/latest/schema.graphql +++ b/packages/typescript/src/graphql/generated/latest/schema.graphql @@ -1,3 +1,10 @@ +type AccumulatorRootCreateTransaction { + """ + A workaround to define an empty variant of a GraphQL union. + """ + _: Boolean +} + type ActiveJwk { """ The string (Issuing Authority) that identifies the OIDC provider. @@ -452,6 +459,11 @@ type Checkpoint { The Base64 serialized BCS bytes of CheckpointSummary for this checkpoint. """ bcs: Base64 + """ + A commitment by the committee on the artifacts of the checkpoint. + e.g., object checkpoint states + """ + artifactsDigest: String } type CheckpointConnection { @@ -860,6 +872,65 @@ type ConsensusCommitPrologueTransaction { consensusCommitDigest: String } +""" +The transaction accpeted a consensus object as input, but its execution was cancelled. +""" +type ConsensusObjectCancelled { + """ + ID of the consensus object. + """ + address: SuiAddress! + """ + The assigned consensus object version. It is a special version indicating transaction cancellation reason. + """ + version: UInt53! +} + +""" +The transaction accepted a consensus object as input, but only to read it. +""" +type ConsensusObjectRead { + """ + ID of the object being read. + """ + address: SuiAddress! + """ + Version of the object being read. + """ + version: UInt53! + """ + 32-byte hash that identifies the object's contents at this version, encoded as a Base58 + string. + """ + digest: String! + """ + The object at this version. May not be available due to pruning. + """ + object: Object +} + +""" +The transaction accepted a consensus object as input, but its consensus stream ended before the +transaction executed. This can happen for ConsensusAddressOwner objects where the stream ends +but the object itself is not deleted. +""" +type ConsensusObjectStreamEnded { + """ + ID of the consensus object. + """ + address: SuiAddress! + """ + The version of the consensus object that was assigned to this transaction during by consensus, + during sequencing. + """ + version: UInt53! + """ + Whether this transaction intended to use this consensus object mutably or not. See + `SharedInput.mutable` for further details. + """ + mutable: Boolean! +} + """ ISO-8601 Date and Time: RFC3339 in UTC with format: YYYY-MM-DDTHH:MM:SS.mmmZ. Note that the milliseconds part is optional, and it may be omitted if its value is 0. """ @@ -1039,7 +1110,7 @@ type EndOfEpochTransaction { transactions(first: Int, before: String, last: Int, after: String): EndOfEpochTransactionKindConnection! } -union EndOfEpochTransactionKind = ChangeEpochTransaction | AuthenticatorStateCreateTransaction | AuthenticatorStateExpireTransaction | RandomnessStateCreateTransaction | CoinDenyListStateCreateTransaction | BridgeStateCreateTransaction | BridgeCommitteeInitTransaction | StoreExecutionTimeObservationsTransaction +union EndOfEpochTransactionKind = ChangeEpochTransaction | AuthenticatorStateCreateTransaction | AuthenticatorStateExpireTransaction | RandomnessStateCreateTransaction | CoinDenyListStateCreateTransaction | BridgeStateCreateTransaction | BridgeCommitteeInitTransaction | StoreExecutionTimeObservationsTransaction | AccumulatorRootCreateTransaction type EndOfEpochTransactionKindConnection { """ @@ -3092,6 +3163,21 @@ type Parent { parent: Owner } +""" +ProgrammableSystemTransactionBlock is identical to ProgrammableTransactionBlock, but graphql +does not allow multiple variants with the same type. +""" +type ProgrammableSystemTransactionBlock { + """ + Input objects or primitive values. + """ + inputs(first: Int, after: String, last: Int, before: String): TransactionInputConnection! + """ + The transaction commands, executed sequentially. + """ + transactions(first: Int, after: String, last: Int, before: String): ProgrammableTransactionConnection! +} + """ A single transaction, or command, in the programmable transaction block. """ @@ -3628,64 +3714,6 @@ type SharedInput { mutable: Boolean! } -""" -The transaction accpeted a shared object as input, but its execution was cancelled. -""" -type SharedObjectCancelled { - """ - ID of the shared object. - """ - address: SuiAddress! - """ - The assigned shared object version. It is a special version indicating transaction cancellation reason. - """ - version: UInt53! -} - -""" -The transaction accepted a shared object as input, but it was deleted before the transaction -executed. -""" -type SharedObjectDelete { - """ - ID of the shared object. - """ - address: SuiAddress! - """ - The version of the shared object that was assigned to this transaction during by consensus, - during sequencing. - """ - version: UInt53! - """ - Whether this transaction intended to use this shared object mutably or not. See - `SharedInput.mutable` for further details. - """ - mutable: Boolean! -} - -""" -The transaction accepted a shared object as input, but only to read it. -""" -type SharedObjectRead { - """ - ID of the object being read. - """ - address: SuiAddress! - """ - Version of the object being read. - """ - version: UInt53! - """ - 32-byte hash that identifies the object's contents at this version, encoded as a Base58 - string. - """ - digest: String! - """ - The object at this version. May not be available due to pruning. - """ - object: Object -} - """ Splits off coins with denominations in `amounts` from `coin`, returning multiple results (as many as there are amounts.) @@ -3961,7 +3989,7 @@ type StorageFund { The portion of the storage fund that will never be refunded through storage rebates. The system maintains an invariant that the sum of all storage fees into the storage fund is - equal to the sum of of all storage rebates out, the total storage rebates remaining, and the + equal to the sum of all storage rebates out, the total storage rebates remaining, and the non-refundable balance. """ nonRefundableBalance: BigInt @@ -4304,9 +4332,9 @@ type TransactionBlockEffects { """ gasEffects: GasEffects """ - Shared objects that are referenced by but not changed by this transaction. + Consensus objects that are referenced by but not changed by this transaction. """ - unchangedSharedObjects(first: Int, after: String, last: Int, before: String): UnchangedSharedObjectConnection! + unchangedConsensusObjects(first: Int, after: String, last: Int, before: String): UnchangedConsensusObjectConnection! """ The effect this transaction had on objects on-chain. """ @@ -4394,7 +4422,7 @@ input TransactionBlockFilter { """ The kind of transaction block, either a programmable transaction or a system transaction. """ -union TransactionBlockKind = ConsensusCommitPrologueTransaction | GenesisTransaction | ChangeEpochTransaction | ProgrammableTransactionBlock | AuthenticatorStateUpdateTransaction | RandomnessStateUpdateTransaction | EndOfEpochTransaction +union TransactionBlockKind = ConsensusCommitPrologueTransaction | GenesisTransaction | ChangeEpochTransaction | ProgrammableTransactionBlock | AuthenticatorStateUpdateTransaction | RandomnessStateUpdateTransaction | EndOfEpochTransaction | ProgrammableSystemTransactionBlock """ An input filter selecting for either system or programmable transactions. @@ -4497,14 +4525,14 @@ but it is guaranteed to be non-negative, and it may be larger than 2^32 - 1. scalar UInt53 """ -Details pertaining to shared objects that are referenced by but not changed by a transaction. +Details pertaining to consensus objects that are referenced by but not changed by a transaction. This information is considered part of the effects, because although the transaction specifies -the shared object as input, consensus must schedule it and pick the version that is actually +the consensus object as input, consensus must schedule it and pick the version that is actually used. """ -union UnchangedSharedObject = SharedObjectRead | SharedObjectDelete | SharedObjectCancelled +union UnchangedConsensusObject = ConsensusObjectRead | ConsensusObjectStreamEnded | ConsensusObjectCancelled -type UnchangedSharedObjectConnection { +type UnchangedConsensusObjectConnection { """ Information to aid in pagination. """ @@ -4512,21 +4540,21 @@ type UnchangedSharedObjectConnection { """ A list of edges. """ - edges: [UnchangedSharedObjectEdge!]! + edges: [UnchangedConsensusObjectEdge!]! """ A list of nodes. """ - nodes: [UnchangedSharedObject!]! + nodes: [UnchangedConsensusObject!]! } """ An edge in a connection. """ -type UnchangedSharedObjectEdge { +type UnchangedConsensusObjectEdge { """ The item at the end of the edge """ - node: UnchangedSharedObject! + node: UnchangedConsensusObject! """ A cursor for use in pagination """ diff --git a/packages/typescript/src/graphql/generated/latest/tada-env.ts b/packages/typescript/src/graphql/generated/latest/tada-env.ts index 2ce7ecf0b..8299fcfdc 100644 --- a/packages/typescript/src/graphql/generated/latest/tada-env.ts +++ b/packages/typescript/src/graphql/generated/latest/tada-env.ts @@ -32,6 +32,22 @@ const introspection = { }, "subscriptionType": null, "types": [ + { + "kind": "OBJECT", + "name": "AccumulatorRootCreateTransaction", + "fields": [ + { + "name": "_", + "type": { + "kind": "SCALAR", + "name": "Boolean" + }, + "args": [], + "isDeprecated": false + } + ], + "interfaces": [] + }, { "kind": "OBJECT", "name": "ActiveJwk", @@ -1237,6 +1253,15 @@ const introspection = { "kind": "OBJECT", "name": "Checkpoint", "fields": [ + { + "name": "artifactsDigest", + "type": { + "kind": "SCALAR", + "name": "String" + }, + "args": [], + "isDeprecated": false + }, { "name": "bcs", "type": { @@ -2789,6 +2814,132 @@ const introspection = { ], "interfaces": [] }, + { + "kind": "OBJECT", + "name": "ConsensusObjectCancelled", + "fields": [ + { + "name": "address", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "SuiAddress" + } + }, + "args": [], + "isDeprecated": false + }, + { + "name": "version", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "UInt53" + } + }, + "args": [], + "isDeprecated": false + } + ], + "interfaces": [] + }, + { + "kind": "OBJECT", + "name": "ConsensusObjectRead", + "fields": [ + { + "name": "address", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "SuiAddress" + } + }, + "args": [], + "isDeprecated": false + }, + { + "name": "digest", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "String" + } + }, + "args": [], + "isDeprecated": false + }, + { + "name": "object", + "type": { + "kind": "OBJECT", + "name": "Object" + }, + "args": [], + "isDeprecated": false + }, + { + "name": "version", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "UInt53" + } + }, + "args": [], + "isDeprecated": false + } + ], + "interfaces": [] + }, + { + "kind": "OBJECT", + "name": "ConsensusObjectStreamEnded", + "fields": [ + { + "name": "address", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "SuiAddress" + } + }, + "args": [], + "isDeprecated": false + }, + { + "name": "mutable", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "Boolean" + } + }, + "args": [], + "isDeprecated": false + }, + { + "name": "version", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "UInt53" + } + }, + "args": [], + "isDeprecated": false + } + ], + "interfaces": [] + }, { "kind": "SCALAR", "name": "DateTime" @@ -3282,6 +3433,10 @@ const introspection = { "kind": "UNION", "name": "EndOfEpochTransactionKind", "possibleTypes": [ + { + "kind": "OBJECT", + "name": "AccumulatorRootCreateTransaction" + }, { "kind": "OBJECT", "name": "AuthenticatorStateCreateTransaction" @@ -9418,6 +9573,95 @@ const introspection = { ], "interfaces": [] }, + { + "kind": "OBJECT", + "name": "ProgrammableSystemTransactionBlock", + "fields": [ + { + "name": "inputs", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "OBJECT", + "name": "TransactionInputConnection" + } + }, + "args": [ + { + "name": "after", + "type": { + "kind": "SCALAR", + "name": "String" + } + }, + { + "name": "before", + "type": { + "kind": "SCALAR", + "name": "String" + } + }, + { + "name": "first", + "type": { + "kind": "SCALAR", + "name": "Int" + } + }, + { + "name": "last", + "type": { + "kind": "SCALAR", + "name": "Int" + } + } + ], + "isDeprecated": false + }, + { + "name": "transactions", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "OBJECT", + "name": "ProgrammableTransactionConnection" + } + }, + "args": [ + { + "name": "after", + "type": { + "kind": "SCALAR", + "name": "String" + } + }, + { + "name": "before", + "type": { + "kind": "SCALAR", + "name": "String" + } + }, + { + "name": "first", + "type": { + "kind": "SCALAR", + "name": "Int" + } + }, + { + "name": "last", + "type": { + "kind": "SCALAR", + "name": "Int" + } + } + ], + "isDeprecated": false + } + ], + "interfaces": [] + }, { "kind": "UNION", "name": "ProgrammableTransaction", @@ -11183,132 +11427,6 @@ const introspection = { ], "interfaces": [] }, - { - "kind": "OBJECT", - "name": "SharedObjectCancelled", - "fields": [ - { - "name": "address", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "SuiAddress" - } - }, - "args": [], - "isDeprecated": false - }, - { - "name": "version", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "UInt53" - } - }, - "args": [], - "isDeprecated": false - } - ], - "interfaces": [] - }, - { - "kind": "OBJECT", - "name": "SharedObjectDelete", - "fields": [ - { - "name": "address", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "SuiAddress" - } - }, - "args": [], - "isDeprecated": false - }, - { - "name": "mutable", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "Boolean" - } - }, - "args": [], - "isDeprecated": false - }, - { - "name": "version", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "UInt53" - } - }, - "args": [], - "isDeprecated": false - } - ], - "interfaces": [] - }, - { - "kind": "OBJECT", - "name": "SharedObjectRead", - "fields": [ - { - "name": "address", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "SuiAddress" - } - }, - "args": [], - "isDeprecated": false - }, - { - "name": "digest", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "String" - } - }, - "args": [], - "isDeprecated": false - }, - { - "name": "object", - "type": { - "kind": "OBJECT", - "name": "Object" - }, - "args": [], - "isDeprecated": false - }, - { - "name": "version", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "UInt53" - } - }, - "args": [], - "isDeprecated": false - } - ], - "interfaces": [] - }, { "kind": "OBJECT", "name": "SplitCoinsTransaction", @@ -13291,12 +13409,12 @@ const introspection = { "isDeprecated": false }, { - "name": "unchangedSharedObjects", + "name": "unchangedConsensusObjects", "type": { "kind": "NON_NULL", "ofType": { "kind": "OBJECT", - "name": "UnchangedSharedObjectConnection" + "name": "UnchangedConsensusObjectConnection" } }, "args": [ @@ -13441,6 +13559,10 @@ const introspection = { "kind": "OBJECT", "name": "GenesisTransaction" }, + { + "kind": "OBJECT", + "name": "ProgrammableSystemTransactionBlock" + }, { "kind": "OBJECT", "name": "ProgrammableTransactionBlock" @@ -13707,25 +13829,25 @@ const introspection = { }, { "kind": "UNION", - "name": "UnchangedSharedObject", + "name": "UnchangedConsensusObject", "possibleTypes": [ { "kind": "OBJECT", - "name": "SharedObjectCancelled" + "name": "ConsensusObjectCancelled" }, { "kind": "OBJECT", - "name": "SharedObjectDelete" + "name": "ConsensusObjectRead" }, { "kind": "OBJECT", - "name": "SharedObjectRead" + "name": "ConsensusObjectStreamEnded" } ] }, { "kind": "OBJECT", - "name": "UnchangedSharedObjectConnection", + "name": "UnchangedConsensusObjectConnection", "fields": [ { "name": "edges", @@ -13737,7 +13859,7 @@ const introspection = { "kind": "NON_NULL", "ofType": { "kind": "OBJECT", - "name": "UnchangedSharedObjectEdge" + "name": "UnchangedConsensusObjectEdge" } } } @@ -13755,7 +13877,7 @@ const introspection = { "kind": "NON_NULL", "ofType": { "kind": "UNION", - "name": "UnchangedSharedObject" + "name": "UnchangedConsensusObject" } } } @@ -13780,7 +13902,7 @@ const introspection = { }, { "kind": "OBJECT", - "name": "UnchangedSharedObjectEdge", + "name": "UnchangedConsensusObjectEdge", "fields": [ { "name": "cursor", @@ -13800,7 +13922,7 @@ const introspection = { "kind": "NON_NULL", "ofType": { "kind": "UNION", - "name": "UnchangedSharedObject" + "name": "UnchangedConsensusObject" } }, "args": [], diff --git a/packages/typescript/src/graphql/generated/queries.ts b/packages/typescript/src/graphql/generated/queries.ts index 284a8fccd..614fa9178 100644 --- a/packages/typescript/src/graphql/generated/queries.ts +++ b/packages/typescript/src/graphql/generated/queries.ts @@ -2,6 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 /* eslint-disable */ +import { MoveData } from '../types.js'; +import { MoveTypeLayout } from '../types.js'; +import { MoveTypeSignature } from '../types.js'; +import { OpenMoveTypeSignature } from '../types.js'; import { DocumentTypeDecoration } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; @@ -18,13 +22,13 @@ export type Scalars = { Int: { input: number; output: number; } Float: { input: number; output: number; } /** String containing Base64-encoded binary data. */ - Base64: { input: any; output: any; } + Base64: { input: string; output: string; } /** String representation of an arbitrary width, possibly signed integer. */ - BigInt: { input: any; output: any; } + BigInt: { input: string; output: string; } /** ISO-8601 Date and Time: RFC3339 in UTC with format: YYYY-MM-DDTHH:MM:SS.mmmZ. Note that the milliseconds part is optional, and it may be omitted if its value is 0. */ - DateTime: { input: any; output: any; } + DateTime: { input: string; output: string; } /** Arbitrary JSON data. */ - JSON: { input: any; output: any; } + JSON: { input: unknown; output: unknown; } /** * The contents of a Move Value, corresponding to the following recursive type: * @@ -43,7 +47,7 @@ export type Scalars = { * fields: [{ name: string, value: MoveData }], * } */ - MoveData: { input: any; output: any; } + MoveData: { input: MoveData; output: MoveData; } /** * The shape of a concrete Move Type (a type with all its type parameters instantiated with concrete types), corresponding to the following recursive type: * @@ -67,7 +71,7 @@ export type Scalars = { * }] * } */ - MoveTypeLayout: { input: any; output: any; } + MoveTypeLayout: { input: MoveTypeLayout; output: MoveTypeLayout; } /** * The signature of a concrete Move Type (a type with all its type parameters instantiated with concrete types, that contains no references), corresponding to the following recursive type: * @@ -85,7 +89,7 @@ export type Scalars = { * } * } */ - MoveTypeSignature: { input: any; output: any; } + MoveTypeSignature: { input: MoveTypeSignature; output: MoveTypeSignature; } /** * The shape of an abstract Move Type (a type that can contain free type parameters, and can optionally be taken by reference), corresponding to the following recursive type: * @@ -109,14 +113,20 @@ export type Scalars = { * } * | { typeParameter: number } */ - OpenMoveTypeSignature: { input: any; output: any; } + OpenMoveTypeSignature: { input: OpenMoveTypeSignature; output: OpenMoveTypeSignature; } /** String containing 32B hex-encoded address, with a leading "0x". Leading zeroes can be omitted on input but will always appear in outputs (SuiAddress in output is guaranteed to be 66 characters long). */ SuiAddress: { input: any; output: any; } /** * An unsigned integer that can hold values up to 2^53 - 1. This can be treated similarly to `Int`, * but it is guaranteed to be non-negative, and it may be larger than 2^32 - 1. */ - UInt53: { input: any; output: any; } + UInt53: { input: number; output: number; } +}; + +export type AccumulatorRootCreateTransaction = { + __typename?: 'AccumulatorRootCreateTransaction'; + /** A workaround to define an empty variant of a GraphQL union. */ + _?: Maybe; }; export type ActiveJwk = { @@ -490,6 +500,11 @@ export type ChangeEpochTransactionSystemPackagesArgs = { */ export type Checkpoint = { __typename?: 'Checkpoint'; + /** + * A commitment by the committee on the artifacts of the checkpoint. + * e.g., object checkpoint states + */ + artifactsDigest?: Maybe; /** The Base64 serialized BCS bytes of CheckpointSummary for this checkpoint. */ bcs?: Maybe; /** @@ -1049,6 +1064,12 @@ export type CoinMetadataSuinsRegistrationsArgs = { last?: InputMaybe; }; +export type CoinRegistryCreateTransaction = { + __typename?: 'CoinRegistryCreateTransaction'; + /** A workaround to define an empty variant of a GraphQL union. */ + _?: Maybe; +}; + /** Same as AddressOwner, but the object is versioned by consensus. */ export type ConsensusAddressOwner = { __typename?: 'ConsensusAddressOwner'; @@ -1075,6 +1096,52 @@ export type ConsensusCommitPrologueTransaction = { round: Scalars['UInt53']['output']; }; +/** The transaction accpeted a consensus object as input, but its execution was cancelled. */ +export type ConsensusObjectCancelled = { + __typename?: 'ConsensusObjectCancelled'; + /** ID of the consensus object. */ + address: Scalars['SuiAddress']['output']; + /** The assigned consensus object version. It is a special version indicating transaction cancellation reason. */ + version: Scalars['UInt53']['output']; +}; + +/** The transaction accepted a consensus object as input, but only to read it. */ +export type ConsensusObjectRead = { + __typename?: 'ConsensusObjectRead'; + /** ID of the object being read. */ + address: Scalars['SuiAddress']['output']; + /** + * 32-byte hash that identifies the object's contents at this version, encoded as a Base58 + * string. + */ + digest: Scalars['String']['output']; + /** The object at this version. May not be available due to pruning. */ + object?: Maybe; + /** Version of the object being read. */ + version: Scalars['UInt53']['output']; +}; + +/** + * The transaction accepted a consensus object as input, but its consensus stream ended before the + * transaction executed. This can happen for ConsensusAddressOwner objects where the stream ends + * but the object itself is not deleted. + */ +export type ConsensusObjectStreamEnded = { + __typename?: 'ConsensusObjectStreamEnded'; + /** ID of the consensus object. */ + address: Scalars['SuiAddress']['output']; + /** + * Whether this transaction intended to use this consensus object mutably or not. See + * `SharedInput.mutable` for further details. + */ + mutable: Scalars['Boolean']['output']; + /** + * The version of the consensus object that was assigned to this transaction during by consensus, + * during sequencing. + */ + version: Scalars['UInt53']['output']; +}; + export type DependencyConnection = { __typename?: 'DependencyConnection'; /** A list of edges. */ @@ -1231,7 +1298,7 @@ export type EndOfEpochTransactionTransactionsArgs = { last?: InputMaybe; }; -export type EndOfEpochTransactionKind = AuthenticatorStateCreateTransaction | AuthenticatorStateExpireTransaction | BridgeCommitteeInitTransaction | BridgeStateCreateTransaction | ChangeEpochTransaction | CoinDenyListStateCreateTransaction | RandomnessStateCreateTransaction | StoreExecutionTimeObservationsTransaction; +export type EndOfEpochTransactionKind = AccumulatorRootCreateTransaction | AuthenticatorStateCreateTransaction | AuthenticatorStateExpireTransaction | BridgeCommitteeInitTransaction | BridgeStateCreateTransaction | ChangeEpochTransaction | CoinDenyListStateCreateTransaction | CoinRegistryCreateTransaction | RandomnessStateCreateTransaction | StoreExecutionTimeObservationsTransaction; export type EndOfEpochTransactionKindConnection = { __typename?: 'EndOfEpochTransactionKindConnection'; @@ -3548,6 +3615,42 @@ export type Parent = { parent?: Maybe; }; +/** + * ProgrammableSystemTransactionBlock is identical to ProgrammableTransactionBlock, but graphql + * does not allow multiple variants with the same type. + */ +export type ProgrammableSystemTransactionBlock = { + __typename?: 'ProgrammableSystemTransactionBlock'; + /** Input objects or primitive values. */ + inputs: TransactionInputConnection; + /** The transaction commands, executed sequentially. */ + transactions: ProgrammableTransactionConnection; +}; + + +/** + * ProgrammableSystemTransactionBlock is identical to ProgrammableTransactionBlock, but graphql + * does not allow multiple variants with the same type. + */ +export type ProgrammableSystemTransactionBlockInputsArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** + * ProgrammableSystemTransactionBlock is identical to ProgrammableTransactionBlock, but graphql + * does not allow multiple variants with the same type. + */ +export type ProgrammableSystemTransactionBlockTransactionsArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + /** A single transaction, or command, in the programmable transaction block. */ export type ProgrammableTransaction = MakeMoveVecTransaction | MergeCoinsTransaction | MoveCallTransaction | PublishTransaction | SplitCoinsTransaction | TransferObjectsTransaction | UpgradeTransaction; @@ -4204,51 +4307,6 @@ export type SharedInput = { mutable: Scalars['Boolean']['output']; }; -/** The transaction accpeted a shared object as input, but its execution was cancelled. */ -export type SharedObjectCancelled = { - __typename?: 'SharedObjectCancelled'; - /** ID of the shared object. */ - address: Scalars['SuiAddress']['output']; - /** The assigned shared object version. It is a special version indicating transaction cancellation reason. */ - version: Scalars['UInt53']['output']; -}; - -/** - * The transaction accepted a shared object as input, but it was deleted before the transaction - * executed. - */ -export type SharedObjectDelete = { - __typename?: 'SharedObjectDelete'; - /** ID of the shared object. */ - address: Scalars['SuiAddress']['output']; - /** - * Whether this transaction intended to use this shared object mutably or not. See - * `SharedInput.mutable` for further details. - */ - mutable: Scalars['Boolean']['output']; - /** - * The version of the shared object that was assigned to this transaction during by consensus, - * during sequencing. - */ - version: Scalars['UInt53']['output']; -}; - -/** The transaction accepted a shared object as input, but only to read it. */ -export type SharedObjectRead = { - __typename?: 'SharedObjectRead'; - /** ID of the object being read. */ - address: Scalars['SuiAddress']['output']; - /** - * 32-byte hash that identifies the object's contents at this version, encoded as a Base58 - * string. - */ - digest: Scalars['String']['output']; - /** The object at this version. May not be available due to pruning. */ - object?: Maybe; - /** Version of the object being read. */ - version: Scalars['UInt53']['output']; -}; - /** * Splits off coins with denominations in `amounts` from `coin`, returning multiple results (as * many as there are amounts.) @@ -4559,7 +4617,7 @@ export type StorageFund = { * The portion of the storage fund that will never be refunded through storage rebates. * * The system maintains an invariant that the sum of all storage fees into the storage fund is - * equal to the sum of of all storage rebates out, the total storage rebates remaining, and the + * equal to the sum of all storage rebates out, the total storage rebates remaining, and the * non-refundable balance. */ nonRefundableBalance?: Maybe; @@ -4929,8 +4987,8 @@ export type TransactionBlockEffects = { timestamp?: Maybe; /** The transaction that ran to produce these effects. */ transactionBlock?: Maybe; - /** Shared objects that are referenced by but not changed by this transaction. */ - unchangedSharedObjects: UnchangedSharedObjectConnection; + /** Consensus objects that are referenced by but not changed by this transaction. */ + unchangedConsensusObjects: UnchangedConsensusObjectConnection; }; @@ -4971,7 +5029,7 @@ export type TransactionBlockEffectsObjectChangesArgs = { /** The effects representing the result of executing a transaction block. */ -export type TransactionBlockEffectsUnchangedSharedObjectsArgs = { +export type TransactionBlockEffectsUnchangedConsensusObjectsArgs = { after?: InputMaybe; before?: InputMaybe; first?: InputMaybe; @@ -5020,7 +5078,7 @@ export type TransactionBlockFilter = { }; /** The kind of transaction block, either a programmable transaction or a system transaction. */ -export type TransactionBlockKind = AuthenticatorStateUpdateTransaction | ChangeEpochTransaction | ConsensusCommitPrologueTransaction | EndOfEpochTransaction | GenesisTransaction | ProgrammableTransactionBlock | RandomnessStateUpdateTransaction; +export type TransactionBlockKind = AuthenticatorStateUpdateTransaction | ChangeEpochTransaction | ConsensusCommitPrologueTransaction | EndOfEpochTransaction | GenesisTransaction | ProgrammableSystemTransactionBlock | ProgrammableTransactionBlock | RandomnessStateUpdateTransaction; /** An input filter selecting for either system or programmable transactions. */ export enum TransactionBlockKindInput { @@ -5093,30 +5151,30 @@ export type TypeOrigin = { }; /** - * Details pertaining to shared objects that are referenced by but not changed by a transaction. + * Details pertaining to consensus objects that are referenced by but not changed by a transaction. * This information is considered part of the effects, because although the transaction specifies - * the shared object as input, consensus must schedule it and pick the version that is actually + * the consensus object as input, consensus must schedule it and pick the version that is actually * used. */ -export type UnchangedSharedObject = SharedObjectCancelled | SharedObjectDelete | SharedObjectRead; +export type UnchangedConsensusObject = ConsensusObjectCancelled | ConsensusObjectRead | ConsensusObjectStreamEnded; -export type UnchangedSharedObjectConnection = { - __typename?: 'UnchangedSharedObjectConnection'; +export type UnchangedConsensusObjectConnection = { + __typename?: 'UnchangedConsensusObjectConnection'; /** A list of edges. */ - edges: Array; + edges: Array; /** A list of nodes. */ - nodes: Array; + nodes: Array; /** Information to aid in pagination. */ pageInfo: PageInfo; }; /** An edge in a connection. */ -export type UnchangedSharedObjectEdge = { - __typename?: 'UnchangedSharedObjectEdge'; +export type UnchangedConsensusObjectEdge = { + __typename?: 'UnchangedConsensusObjectEdge'; /** A cursor for use in pagination */ cursor: Scalars['String']['output']; /** The item at the end of the edge */ - node: UnchangedSharedObject; + node: UnchangedConsensusObject; }; /** Upgrades a Move Package. */ @@ -5329,7 +5387,7 @@ export type GetAllBalancesQueryVariables = Exact<{ }>; -export type GetAllBalancesQuery = { __typename?: 'Query', address?: { __typename?: 'Address', balances: { __typename?: 'BalanceConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'Balance', coinObjectCount?: any | null, totalBalance?: any | null, coinType: { __typename?: 'MoveType', repr: string } }> } } | null }; +export type GetAllBalancesQuery = { __typename?: 'Query', address?: { __typename?: 'Address', balances: { __typename?: 'BalanceConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'Balance', coinObjectCount?: number | null, totalBalance?: string | null, coinType: { __typename?: 'MoveType', repr: string } }> } } | null }; export type GetBalanceQueryVariables = Exact<{ owner: Scalars['SuiAddress']['input']; @@ -5337,7 +5395,7 @@ export type GetBalanceQueryVariables = Exact<{ }>; -export type GetBalanceQuery = { __typename?: 'Query', address?: { __typename?: 'Address', balance?: { __typename?: 'Balance', coinObjectCount?: any | null, totalBalance?: any | null, coinType: { __typename?: 'MoveType', repr: string } } | null } | null }; +export type GetBalanceQuery = { __typename?: 'Query', address?: { __typename?: 'Address', balance?: { __typename?: 'Balance', coinObjectCount?: number | null, totalBalance?: string | null, coinType: { __typename?: 'MoveType', repr: string } } | null } | null }; export type GetCoinsQueryVariables = Exact<{ owner: Scalars['SuiAddress']['input']; @@ -5347,7 +5405,7 @@ export type GetCoinsQueryVariables = Exact<{ }>; -export type GetCoinsQuery = { __typename?: 'Query', address?: { __typename?: 'Address', address: any, coins: { __typename?: 'CoinConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'Coin', coinBalance?: any | null, address: any, version: any, digest?: string | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: any, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: any } | null, contents?: { __typename?: 'MoveValue', bcs: any, type: { __typename?: 'MoveType', repr: string } } | null }> } } | null }; +export type GetCoinsQuery = { __typename?: 'Query', address?: { __typename?: 'Address', address: any, coins: { __typename?: 'CoinConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'Coin', coinBalance?: string | null, address: any, version: number, digest?: string | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: number, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: number } | null, contents?: { __typename?: 'MoveValue', bcs: string, type: { __typename?: 'MoveType', repr: string } } | null, previousTransactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null } | null }> } } | null }; export type GetDynamicFieldsQueryVariables = Exact<{ parentId: Scalars['SuiAddress']['input']; @@ -5356,12 +5414,21 @@ export type GetDynamicFieldsQueryVariables = Exact<{ }>; -export type GetDynamicFieldsQuery = { __typename?: 'Query', owner?: { __typename?: 'Owner', dynamicFields: { __typename?: 'DynamicFieldConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'DynamicField', name?: { __typename?: 'MoveValue', bcs: any, type: { __typename?: 'MoveType', repr: string } } | null, value?: { __typename: 'MoveObject', contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | { __typename: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null }> } } | null }; +export type GetDynamicFieldsQuery = { __typename?: 'Query', owner?: { __typename?: 'Owner', dynamicFields: { __typename?: 'DynamicFieldConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'DynamicField', name?: { __typename?: 'MoveValue', bcs: string, type: { __typename?: 'MoveType', repr: string } } | null, value?: { __typename: 'MoveObject', contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | { __typename: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null }> } } | null }; + +export type GetMoveFunctionQueryVariables = Exact<{ + package: Scalars['SuiAddress']['input']; + module: Scalars['String']['input']; + function: Scalars['String']['input']; +}>; + + +export type GetMoveFunctionQuery = { __typename?: 'Query', package?: { __typename?: 'MovePackage', module?: { __typename?: 'MoveModule', function?: { __typename?: 'MoveFunction', name: string, visibility?: MoveVisibility | null, isEntry?: boolean | null, typeParameters?: Array<{ __typename?: 'MoveFunctionTypeParameter', constraints: Array }> | null, parameters?: Array<{ __typename?: 'OpenMoveType', signature: OpenMoveTypeSignature }> | null, return?: Array<{ __typename?: 'OpenMoveType', signature: OpenMoveTypeSignature }> | null } | null } | null } | null }; export type GetReferenceGasPriceQueryVariables = Exact<{ [key: string]: never; }>; -export type GetReferenceGasPriceQuery = { __typename?: 'Query', epoch?: { __typename?: 'Epoch', referenceGasPrice?: any | null } | null }; +export type GetReferenceGasPriceQuery = { __typename?: 'Query', epoch?: { __typename?: 'Epoch', referenceGasPrice?: string | null } | null }; export type ResolveNameServiceNamesQueryVariables = Exact<{ address: Scalars['SuiAddress']['input']; @@ -5380,7 +5447,7 @@ export type GetOwnedObjectsQueryVariables = Exact<{ }>; -export type GetOwnedObjectsQuery = { __typename?: 'Query', address?: { __typename?: 'Address', objects: { __typename?: 'MoveObjectConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'MoveObject', address: any, digest?: string | null, version: any, contents?: { __typename?: 'MoveValue', bcs: any, type: { __typename?: 'MoveType', repr: string } } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: any, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: any } | null }> } } | null }; +export type GetOwnedObjectsQuery = { __typename?: 'Query', address?: { __typename?: 'Address', objects: { __typename?: 'MoveObjectConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'MoveObject', address: any, digest?: string | null, version: number, contents?: { __typename?: 'MoveValue', bcs: string, type: { __typename?: 'MoveType', repr: string } } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: number, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: number } | null, previousTransactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null } | null }> } } | null }; export type MultiGetObjectsQueryVariables = Exact<{ objectIds: Array | Scalars['SuiAddress']['input']; @@ -5389,21 +5456,21 @@ export type MultiGetObjectsQueryVariables = Exact<{ }>; -export type MultiGetObjectsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'Object', address: any, digest?: string | null, version: any, asMoveObject?: { __typename?: 'MoveObject', contents?: { __typename?: 'MoveValue', bcs: any, type: { __typename?: 'MoveType', repr: string } } | null } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: any, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: any } | null }> } }; +export type MultiGetObjectsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, nodes: Array<{ __typename?: 'Object', address: any, digest?: string | null, version: number, asMoveObject?: { __typename?: 'MoveObject', contents?: { __typename?: 'MoveValue', bcs: string, type: { __typename?: 'MoveType', repr: string } } | null } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: number, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: number } | null, previousTransactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null } | null }> } }; -export type Object_FieldsFragment = { __typename?: 'Object', address: any, digest?: string | null, version: any, asMoveObject?: { __typename?: 'MoveObject', contents?: { __typename?: 'MoveValue', bcs: any, type: { __typename?: 'MoveType', repr: string } } | null } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: any, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: any } | null }; +export type Object_FieldsFragment = { __typename?: 'Object', address: any, digest?: string | null, version: number, asMoveObject?: { __typename?: 'MoveObject', contents?: { __typename?: 'MoveValue', bcs: string, type: { __typename?: 'MoveType', repr: string } } | null } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: number, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: number } | null, previousTransactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null } | null }; -export type Move_Object_FieldsFragment = { __typename?: 'MoveObject', address: any, digest?: string | null, version: any, contents?: { __typename?: 'MoveValue', bcs: any, type: { __typename?: 'MoveType', repr: string } } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: any, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: any } | null }; +export type Move_Object_FieldsFragment = { __typename?: 'MoveObject', address: any, digest?: string | null, version: number, contents?: { __typename?: 'MoveValue', bcs: string, type: { __typename?: 'MoveType', repr: string } } | null, owner?: { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null } | { __typename: 'ConsensusAddressOwner', startVersion: number, owner?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Immutable' } | { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null } | { __typename: 'Shared', initialSharedVersion: number } | null, previousTransactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null } | null }; type Object_Owner_Fields_AddressOwner_Fragment = { __typename: 'AddressOwner', owner?: { __typename?: 'Owner', asObject?: { __typename?: 'Object', address: any } | null, asAddress?: { __typename?: 'Address', address: any } | null } | null }; -type Object_Owner_Fields_ConsensusAddressOwner_Fragment = { __typename: 'ConsensusAddressOwner', startVersion: any, owner?: { __typename?: 'Owner', address: any } | null }; +type Object_Owner_Fields_ConsensusAddressOwner_Fragment = { __typename: 'ConsensusAddressOwner', startVersion: number, owner?: { __typename?: 'Owner', address: any } | null }; type Object_Owner_Fields_Immutable_Fragment = { __typename: 'Immutable' }; type Object_Owner_Fields_Parent_Fragment = { __typename: 'Parent', parent?: { __typename?: 'Owner', address: any } | null }; -type Object_Owner_Fields_Shared_Fragment = { __typename: 'Shared', initialSharedVersion: any }; +type Object_Owner_Fields_Shared_Fragment = { __typename: 'Shared', initialSharedVersion: number }; export type Object_Owner_FieldsFragment = Object_Owner_Fields_AddressOwner_Fragment | Object_Owner_Fields_ConsensusAddressOwner_Fragment | Object_Owner_Fields_Immutable_Fragment | Object_Owner_Fields_Parent_Fragment | Object_Owner_Fields_Shared_Fragment; @@ -5412,7 +5479,7 @@ export type DryRunTransactionBlockQueryVariables = Exact<{ }>; -export type DryRunTransactionBlockQuery = { __typename?: 'Query', dryRunTransactionBlock: { __typename?: 'DryRunResult', error?: string | null, transaction?: { __typename?: 'TransactionBlock', digest?: string | null, bcs?: any | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: any, epoch?: { __typename?: 'Epoch', epochId: any } | null, unchangedSharedObjects: { __typename?: 'UnchangedSharedObjectConnection', nodes: Array<{ __typename: 'SharedObjectCancelled' } | { __typename: 'SharedObjectDelete' } | { __typename: 'SharedObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: any, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> } } | null } | null } }; +export type DryRunTransactionBlockQuery = { __typename?: 'Query', dryRunTransactionBlock: { __typename?: 'DryRunResult', error?: string | null, transaction?: { __typename?: 'TransactionBlock', digest?: string | null, bcs?: string | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: string, epoch?: { __typename?: 'Epoch', epochId: number } | null, unchangedConsensusObjects: { __typename?: 'UnchangedConsensusObjectConnection', nodes: Array<{ __typename: 'ConsensusObjectCancelled' } | { __typename: 'ConsensusObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null } | { __typename: 'ConsensusObjectStreamEnded' }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: number, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, balanceChanges: { __typename?: 'BalanceChangeConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean }, nodes: Array<{ __typename?: 'BalanceChange', amount?: string | null, owner?: { __typename?: 'Owner', address: any } | null, coinType?: { __typename?: 'MoveType', repr: string } | null }> } } | null } | null } }; export type ExecuteTransactionBlockMutationVariables = Exact<{ txBytes: Scalars['String']['input']; @@ -5420,16 +5487,16 @@ export type ExecuteTransactionBlockMutationVariables = Exact<{ }>; -export type ExecuteTransactionBlockMutation = { __typename?: 'Mutation', executeTransactionBlock: { __typename?: 'ExecutionResult', errors?: Array | null, effects: { __typename?: 'TransactionBlockEffects', transactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null, bcs?: any | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: any, epoch?: { __typename?: 'Epoch', epochId: any } | null, unchangedSharedObjects: { __typename?: 'UnchangedSharedObjectConnection', nodes: Array<{ __typename: 'SharedObjectCancelled' } | { __typename: 'SharedObjectDelete' } | { __typename: 'SharedObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: any, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> } } | null } | null } } }; +export type ExecuteTransactionBlockMutation = { __typename?: 'Mutation', executeTransactionBlock: { __typename?: 'ExecutionResult', errors?: Array | null, effects: { __typename?: 'TransactionBlockEffects', transactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null, bcs?: string | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: string, epoch?: { __typename?: 'Epoch', epochId: number } | null, unchangedConsensusObjects: { __typename?: 'UnchangedConsensusObjectConnection', nodes: Array<{ __typename: 'ConsensusObjectCancelled' } | { __typename: 'ConsensusObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null } | { __typename: 'ConsensusObjectStreamEnded' }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: number, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, balanceChanges: { __typename?: 'BalanceChangeConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean }, nodes: Array<{ __typename?: 'BalanceChange', amount?: string | null, owner?: { __typename?: 'Owner', address: any } | null, coinType?: { __typename?: 'MoveType', repr: string } | null }> } } | null } | null } } }; export type GetTransactionBlockQueryVariables = Exact<{ digest: Scalars['String']['input']; }>; -export type GetTransactionBlockQuery = { __typename?: 'Query', transactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null, bcs?: any | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: any, epoch?: { __typename?: 'Epoch', epochId: any } | null, unchangedSharedObjects: { __typename?: 'UnchangedSharedObjectConnection', nodes: Array<{ __typename: 'SharedObjectCancelled' } | { __typename: 'SharedObjectDelete' } | { __typename: 'SharedObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: any, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> } } | null } | null }; +export type GetTransactionBlockQuery = { __typename?: 'Query', transactionBlock?: { __typename?: 'TransactionBlock', digest?: string | null, bcs?: string | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: string, epoch?: { __typename?: 'Epoch', epochId: number } | null, unchangedConsensusObjects: { __typename?: 'UnchangedConsensusObjectConnection', nodes: Array<{ __typename: 'ConsensusObjectCancelled' } | { __typename: 'ConsensusObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null } | { __typename: 'ConsensusObjectStreamEnded' }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: number, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, balanceChanges: { __typename?: 'BalanceChangeConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean }, nodes: Array<{ __typename?: 'BalanceChange', amount?: string | null, owner?: { __typename?: 'Owner', address: any } | null, coinType?: { __typename?: 'MoveType', repr: string } | null }> } } | null } | null }; -export type Transaction_FieldsFragment = { __typename?: 'TransactionBlock', digest?: string | null, bcs?: any | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: any, epoch?: { __typename?: 'Epoch', epochId: any } | null, unchangedSharedObjects: { __typename?: 'UnchangedSharedObjectConnection', nodes: Array<{ __typename: 'SharedObjectCancelled' } | { __typename: 'SharedObjectDelete' } | { __typename: 'SharedObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: any, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> } } | null }; +export type Transaction_FieldsFragment = { __typename?: 'TransactionBlock', digest?: string | null, bcs?: string | null, signatures?: Array | null, effects?: { __typename?: 'TransactionBlockEffects', bcs: string, epoch?: { __typename?: 'Epoch', epochId: number } | null, unchangedConsensusObjects: { __typename?: 'UnchangedConsensusObjectConnection', nodes: Array<{ __typename: 'ConsensusObjectCancelled' } | { __typename: 'ConsensusObjectRead', object?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null } | { __typename: 'ConsensusObjectStreamEnded' }> }, objectChanges: { __typename?: 'ObjectChangeConnection', nodes: Array<{ __typename?: 'ObjectChange', address: any, inputState?: { __typename?: 'Object', version: number, asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null, outputState?: { __typename?: 'Object', asMoveObject?: { __typename?: 'MoveObject', address: any, contents?: { __typename?: 'MoveValue', type: { __typename?: 'MoveType', repr: string } } | null } | null } | null }> }, balanceChanges: { __typename?: 'BalanceChangeConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean }, nodes: Array<{ __typename?: 'BalanceChange', amount?: string | null, owner?: { __typename?: 'Owner', address: any } | null, coinType?: { __typename?: 'MoveType', repr: string } | null }> } } | null }; export type VerifyZkLoginSignatureQueryVariables = Exact<{ bytes: Scalars['Base64']['input']; @@ -5445,7 +5512,7 @@ export class TypedDocumentString extends String implements DocumentTypeDecoration { - __apiType?: DocumentTypeDecoration['__apiType']; + __apiType?: NonNullable['__apiType']>; private value: string; public __meta__?: Record | undefined; @@ -5455,7 +5522,7 @@ export class TypedDocumentString this.__meta__ = __meta__; } - toString(): string & DocumentTypeDecoration { + override toString(): string & DocumentTypeDecoration { return this.value; } } @@ -5504,6 +5571,9 @@ export const Object_FieldsFragmentDoc = new TypedDocumentString(` owner { ...OBJECT_OWNER_FIELDS } + previousTransactionBlock { + digest + } } fragment OBJECT_OWNER_FIELDS on ObjectOwner { __typename @@ -5546,6 +5616,9 @@ export const Move_Object_FieldsFragmentDoc = new TypedDocumentString(` owner { ...OBJECT_OWNER_FIELDS } + previousTransactionBlock { + digest + } } fragment OBJECT_OWNER_FIELDS on ObjectOwner { __typename @@ -5584,10 +5657,10 @@ export const Transaction_FieldsFragmentDoc = new TypedDocumentString(` epoch { epochId } - unchangedSharedObjects { + unchangedConsensusObjects { nodes { __typename - ... on SharedObjectRead { + ... on ConsensusObjectRead { object { asMoveObject { address @@ -5627,6 +5700,20 @@ export const Transaction_FieldsFragmentDoc = new TypedDocumentString(` } } } + balanceChanges(first: 50) { + pageInfo { + hasNextPage + } + nodes { + owner { + address + } + coinType { + repr + } + amount + } + } } } `, {"fragmentName":"TRANSACTION_FIELDS"}) as unknown as TypedDocumentString; @@ -5685,6 +5772,9 @@ export const GetCoinsDocument = new TypedDocumentString(` address version digest + previousTransactionBlock { + digest + } } } } @@ -5751,6 +5841,28 @@ export const GetDynamicFieldsDocument = new TypedDocumentString(` } } `) as unknown as TypedDocumentString; +export const GetMoveFunctionDocument = new TypedDocumentString(` + query getMoveFunction($package: SuiAddress!, $module: String!, $function: String!) { + package(address: $package) { + module(name: $module) { + function(name: $function) { + name + visibility + isEntry + typeParameters { + constraints + } + parameters { + signature + } + return { + signature + } + } + } + } +} + `) as unknown as TypedDocumentString; export const GetReferenceGasPriceDocument = new TypedDocumentString(` query getReferenceGasPrice { epoch { @@ -5800,6 +5912,9 @@ export const GetOwnedObjectsDocument = new TypedDocumentString(` owner { ...OBJECT_OWNER_FIELDS } + previousTransactionBlock { + digest + } } fragment OBJECT_OWNER_FIELDS on ObjectOwner { __typename @@ -5855,6 +5970,9 @@ export const MultiGetObjectsDocument = new TypedDocumentString(` owner { ...OBJECT_OWNER_FIELDS } + previousTransactionBlock { + digest + } } fragment OBJECT_OWNER_FIELDS on ObjectOwner { __typename @@ -5901,10 +6019,10 @@ export const DryRunTransactionBlockDocument = new TypedDocumentString(` epoch { epochId } - unchangedSharedObjects { + unchangedConsensusObjects { nodes { __typename - ... on SharedObjectRead { + ... on ConsensusObjectRead { object { asMoveObject { address @@ -5944,6 +6062,20 @@ export const DryRunTransactionBlockDocument = new TypedDocumentString(` } } } + balanceChanges(first: 50) { + pageInfo { + hasNextPage + } + nodes { + owner { + address + } + coinType { + repr + } + amount + } + } } }`) as unknown as TypedDocumentString; export const ExecuteTransactionBlockDocument = new TypedDocumentString(` @@ -5966,10 +6098,10 @@ export const ExecuteTransactionBlockDocument = new TypedDocumentString(` epoch { epochId } - unchangedSharedObjects { + unchangedConsensusObjects { nodes { __typename - ... on SharedObjectRead { + ... on ConsensusObjectRead { object { asMoveObject { address @@ -6009,6 +6141,20 @@ export const ExecuteTransactionBlockDocument = new TypedDocumentString(` } } } + balanceChanges(first: 50) { + pageInfo { + hasNextPage + } + nodes { + owner { + address + } + coinType { + repr + } + amount + } + } } }`) as unknown as TypedDocumentString; export const GetTransactionBlockDocument = new TypedDocumentString(` @@ -6026,10 +6172,10 @@ export const GetTransactionBlockDocument = new TypedDocumentString(` epoch { epochId } - unchangedSharedObjects { + unchangedConsensusObjects { nodes { __typename - ... on SharedObjectRead { + ... on ConsensusObjectRead { object { asMoveObject { address @@ -6069,6 +6215,20 @@ export const GetTransactionBlockDocument = new TypedDocumentString(` } } } + balanceChanges(first: 50) { + pageInfo { + hasNextPage + } + nodes { + owner { + address + } + coinType { + repr + } + amount + } + } } }`) as unknown as TypedDocumentString; export const VerifyZkLoginSignatureDocument = new TypedDocumentString(` diff --git a/packages/typescript/src/graphql/queries/getCoins.graphql b/packages/typescript/src/graphql/queries/getCoins.graphql index c59eb207f..2efcbdaef 100644 --- a/packages/typescript/src/graphql/queries/getCoins.graphql +++ b/packages/typescript/src/graphql/queries/getCoins.graphql @@ -23,6 +23,9 @@ query getCoins($owner: SuiAddress!, $first: Int, $cursor: String, $type: String address version digest + previousTransactionBlock { + digest + } } } } diff --git a/packages/typescript/src/graphql/queries/getMoveFunction.graphql b/packages/typescript/src/graphql/queries/getMoveFunction.graphql new file mode 100644 index 000000000..11467d1aa --- /dev/null +++ b/packages/typescript/src/graphql/queries/getMoveFunction.graphql @@ -0,0 +1,20 @@ +query getMoveFunction($package: SuiAddress!, $module: String!, $function: String!) { + package(address: $package) { + module(name: $module) { + function(name: $function) { + name + visibility + isEntry + typeParameters { + constraints + } + parameters { + signature + } + return { + signature + } + } + } + } +} diff --git a/packages/typescript/src/graphql/queries/objects.graphql b/packages/typescript/src/graphql/queries/objects.graphql index b61c487d8..abdb77c77 100644 --- a/packages/typescript/src/graphql/queries/objects.graphql +++ b/packages/typescript/src/graphql/queries/objects.graphql @@ -42,6 +42,9 @@ fragment OBJECT_FIELDS on Object { owner { ...OBJECT_OWNER_FIELDS } + previousTransactionBlock { + digest + } } fragment MOVE_OBJECT_FIELDS on MoveObject { @@ -57,6 +60,9 @@ fragment MOVE_OBJECT_FIELDS on MoveObject { owner { ...OBJECT_OWNER_FIELDS } + previousTransactionBlock { + digest + } } fragment OBJECT_OWNER_FIELDS on ObjectOwner { diff --git a/packages/typescript/src/graphql/queries/transactions.graphql b/packages/typescript/src/graphql/queries/transactions.graphql index 494119a5c..e1f6ac186 100644 --- a/packages/typescript/src/graphql/queries/transactions.graphql +++ b/packages/typescript/src/graphql/queries/transactions.graphql @@ -36,10 +36,10 @@ fragment TRANSACTION_FIELDS on TransactionBlock { epoch { epochId } - unchangedSharedObjects { + unchangedConsensusObjects { nodes { __typename - ... on SharedObjectRead { + ... on ConsensusObjectRead { object { asMoveObject { address @@ -79,5 +79,19 @@ fragment TRANSACTION_FIELDS on TransactionBlock { } } } + balanceChanges(first: 50) { + pageInfo { + hasNextPage + } + nodes { + owner { + address + } + coinType { + repr + } + amount + } + } } } diff --git a/packages/walrus/package.json b/packages/walrus/package.json index 86b0601ee..a730497d6 100644 --- a/packages/walrus/package.json +++ b/packages/walrus/package.json @@ -43,7 +43,7 @@ }, "homepage": "https://sdk.mystenlabs.com/walrus", "devDependencies": { - "@hono/node-server": "^1.19.1", + "@hono/node-server": "^1.19.3", "@mysten/build-scripts": "workspace:*", "@mysten/codegen": "workspace:*", "@mysten/dapp-kit-core": "workspace:*", @@ -53,7 +53,7 @@ "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^5.0.2", - "hono": "^4.9.6", + "hono": "^4.9.8", "react": "^18.3.1", "react-dom": "^18.3.1", "typescript": "^5.9.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f95be9dd..1ba949014 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -683,8 +683,8 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.15.29)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^9.0.1 + version: 9.0.1 packages/deepbook-v3: dependencies: @@ -726,8 +726,8 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: - specifier: ^8.0.4 - version: 8.0.5 + specifier: ^9.0.1 + version: 9.0.1 packages/docs: dependencies: @@ -1082,8 +1082,8 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.15.29)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^9.0.1 + version: 9.0.1 packages/kiosk: dependencies: @@ -1116,8 +1116,8 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^9.0.1 + version: 9.0.1 packages/ledgerjs-hw-app-sui: dependencies: @@ -1164,9 +1164,6 @@ importers: vitest: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) - wasm-pack: - specifier: ^0.13.1 - version: 0.13.1 packages/mvr-static: dependencies: @@ -1513,8 +1510,8 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.15.29)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.15.29)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) wait-on: - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^9.0.1 + version: 9.0.1 ws: specifier: ^8.18.3 version: 8.18.3 @@ -1674,8 +1671,8 @@ importers: version: 2.2.3 devDependencies: '@hono/node-server': - specifier: ^1.19.1 - version: 1.19.1(hono@4.9.6) + specifier: ^1.19.3 + version: 1.19.5(hono@4.9.9) '@mysten/build-scripts': specifier: workspace:* version: link:../build-scripts @@ -1704,8 +1701,8 @@ importers: specifier: ^5.0.2 version: 5.0.2(vite@7.1.5(@types/node@22.15.29)(jiti@2.5.1)(lightningcss@1.30.1)(tsx@4.20.5)(yaml@2.8.1)) hono: - specifier: ^4.9.6 - version: 4.9.6 + specifier: ^4.9.8 + version: 4.9.9 react: specifier: ^18.3.1 version: 18.3.1 @@ -3462,9 +3459,6 @@ packages: '@hapi/hoek@11.0.7': resolution: {integrity: sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==} - '@hapi/hoek@9.3.0': - resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} - '@hapi/pinpoint@2.0.1': resolution: {integrity: sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==} @@ -3472,9 +3466,6 @@ packages: resolution: {integrity: sha512-QIvUMB5VZ8HMLZF9A2oWr3AFM430QC8oGd0L35y2jHpuW6bIIca6x/xL7zUf4J7L9WJ3qjz+iJII8ncaeMbpSg==} engines: {node: '>=14.0.0'} - '@hapi/topo@5.1.0': - resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} - '@hapi/topo@6.0.2': resolution: {integrity: sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==} @@ -3495,8 +3486,8 @@ packages: peerDependencies: typescript: '>=5.5.3' - '@hono/node-server@1.19.1': - resolution: {integrity: sha512-h44e5s+ByUriaRIbeS/C74O8v90m0A95luyYQGMF7KEn96KkYMXO7bZAwombzTpjQTU4e0TkU8U1WBIXlwuwtA==} + '@hono/node-server@1.19.5': + resolution: {integrity: sha512-iBuhh+uaaggeAuf+TftcjZyWh2GEgZcVGXkNtskLVoWaXhnJtC5HLHrU8W1KHDoucqO1MswwglmkWLFyiDn4WQ==} engines: {node: '>=18.14.1'} peerDependencies: hono: ^4 @@ -5709,15 +5700,6 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} - '@sideway/address@4.1.5': - resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} - - '@sideway/formula@3.0.1': - resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} - - '@sideway/pinpoint@2.0.0': - resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} - '@size-limit/esbuild@11.2.0': resolution: {integrity: sha512-vSg9H0WxGQPRzDnBzeDyD9XT0Zdq0L+AI3+77/JhxznbSCMJMMr8ndaWVQRhOsixl97N0oD4pRFw2+R1Lcvi6A==} engines: {node: ^18.0.0 || >=20.0.0} @@ -6962,12 +6944,6 @@ packages: peerDependencies: axios: ^0.30.0 - axios@0.30.1: - resolution: {integrity: sha512-2XabsR1u0/B6OoKy57/xJmPkQiUvdoV93oW4ww+Xjee7C2er/O5U77lvqycDkT2VQDtfjYcjw8ZV8GDaoqwjHQ==} - - axios@1.11.0: - resolution: {integrity: sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==} - axios@1.12.2: resolution: {integrity: sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==} @@ -7062,11 +7038,6 @@ packages: bignumber.js@9.3.1: resolution: {integrity: sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==} - binary-install@1.1.0: - resolution: {integrity: sha512-rkwNGW+3aQVSZoD0/o3mfPN6Yxh3Id0R/xzTVBVVpGNlVz8EGwusksxRlbk/A5iKTZt9zkMn3qIqmAt3vpfbzg==} - engines: {node: '>=10'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - birpc@2.5.0: resolution: {integrity: sha512-VSWO/W6nNQdyP520F1mhf+Lc2f8pjGQOtoHHm7Ze8Go1kX7akpVIrtTa0fn+HB0QJEDVacl6aO08YE0PgXfdnQ==} @@ -8665,8 +8636,8 @@ packages: headers-polyfill@4.0.3: resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} - hono@4.9.6: - resolution: {integrity: sha512-doVjXhSFvYZ7y0dNokjwwSahcrAfdz+/BCLvAMa/vHLzjj8+CFyV5xteThGUsKdkaasgN+gF2mUxao+SGLpUeA==} + hono@4.9.9: + resolution: {integrity: sha512-Hxw4wT6zjJGZJdkJzAx9PyBdf7ZpxaTSA0NfxqjLghwMrLBX8p33hJBzoETRakF3UJu6OdNQBZAlNSkGqKFukw==} engines: {node: '>=16.9.0'} hookable@5.5.3: @@ -9044,9 +9015,6 @@ packages: jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} - joi@17.13.3: - resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} - joi@18.0.1: resolution: {integrity: sha512-IiQpRyypSnLisQf3PwuN2eIHAsAIGZIrLZkd4zdvIar2bDyhM91ubRjy8a3eYablXsh9BeI/c7dmPYHca5qtoA==} engines: {node: '>= 20'} @@ -11707,18 +11675,9 @@ packages: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} - wait-on@8.0.4: - resolution: {integrity: sha512-8f9LugAGo4PSc0aLbpKVCVtzayd36sSCp4WLpVngkYq6PK87H79zt77/tlCU6eKCLqR46iFvcl0PU5f+DmtkwA==} - engines: {node: '>=12.0.0'} - hasBin: true - - wait-on@8.0.5: - resolution: {integrity: sha512-J3WlS0txVHkhLRb2FsmRg3dkMTCV1+M6Xra3Ho7HzZDHpE7DCOnoSoCJsZotrmW3uRMhvIJGSKUKrh/MeF4iag==} - engines: {node: '>=12.0.0'} - hasBin: true - - wasm-pack@0.13.1: - resolution: {integrity: sha512-P9exD4YkjpDbw68xUhF3MDm/CC/3eTmmthyG5bHJ56kalxOTewOunxTke4SyF8MTXV6jUtNjXggPgrGmMtczGg==} + wait-on@9.0.1: + resolution: {integrity: sha512-noeCAI+XbqWMXY23sKril0BSURhuLYarkVXwJv1uUWwoojZJE7pmX3vJ7kh7SZaNgPGzfsCSQIZM/AGvu0Q9pA==} + engines: {node: '>=20.0.0'} hasBin: true wcwidth@1.0.1: @@ -14228,16 +14187,10 @@ snapshots: '@hapi/hoek@11.0.7': {} - '@hapi/hoek@9.3.0': {} - '@hapi/pinpoint@2.0.1': {} '@hapi/tlds@1.1.3': {} - '@hapi/topo@5.1.0': - dependencies: - '@hapi/hoek': 9.3.0 - '@hapi/topo@6.0.2': dependencies: '@hapi/hoek': 11.0.7 @@ -14269,9 +14222,9 @@ snapshots: transitivePeerDependencies: - magicast - '@hono/node-server@1.19.1(hono@4.9.6)': + '@hono/node-server@1.19.5(hono@4.9.9)': dependencies: - hono: 4.9.6 + hono: 4.9.9 '@humanfs/core@0.19.1': {} @@ -16635,14 +16588,6 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} - '@sideway/address@4.1.5': - dependencies: - '@hapi/hoek': 9.3.0 - - '@sideway/formula@3.0.1': {} - - '@sideway/pinpoint@2.0.0': {} - '@size-limit/esbuild@11.2.0(size-limit@11.2.0)': dependencies: esbuild: 0.25.10 @@ -18480,22 +18425,6 @@ snapshots: axios: 1.12.2 is-retry-allowed: 2.2.0 - axios@0.30.1: - dependencies: - follow-redirects: 1.15.9 - form-data: 4.0.4 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - axios@1.11.0: - dependencies: - follow-redirects: 1.15.9 - form-data: 4.0.4 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - axios@1.12.2: dependencies: follow-redirects: 1.15.9 @@ -18611,14 +18540,6 @@ snapshots: bignumber.js@9.3.1: {} - binary-install@1.1.0: - dependencies: - axios: 0.30.1 - rimraf: 3.0.2 - tar: 6.2.1 - transitivePeerDependencies: - - debug - birpc@2.5.0: {} bl@4.1.0: @@ -20672,7 +20593,7 @@ snapshots: headers-polyfill@4.0.3: {} - hono@4.9.6: {} + hono@4.9.9: {} hookable@5.5.3: {} @@ -21037,14 +20958,6 @@ snapshots: jju@1.4.0: {} - joi@17.13.3: - dependencies: - '@hapi/hoek': 9.3.0 - '@hapi/topo': 5.1.0 - '@sideway/address': 4.1.5 - '@sideway/formula': 3.0.1 - '@sideway/pinpoint': 2.0.0 - joi@18.0.1: dependencies: '@hapi/address': 5.1.1 @@ -24535,17 +24448,7 @@ snapshots: dependencies: xml-name-validator: 5.0.0 - wait-on@8.0.4: - dependencies: - axios: 1.11.0 - joi: 17.13.3 - lodash: 4.17.21 - minimist: 1.2.8 - rxjs: 7.8.2 - transitivePeerDependencies: - - debug - - wait-on@8.0.5: + wait-on@9.0.1: dependencies: axios: 1.12.2 joi: 18.0.1 @@ -24555,12 +24458,6 @@ snapshots: transitivePeerDependencies: - debug - wasm-pack@0.13.1: - dependencies: - binary-install: 1.1.0 - transitivePeerDependencies: - - debug - wcwidth@1.0.1: dependencies: defaults: 1.0.4 From fd91249c57684641fd6dde315e1a3d8453925fe6 Mon Sep 17 00:00:00 2001 From: Tony Lee Date: Thu, 2 Oct 2025 14:45:50 -0400 Subject: [PATCH 28/36] Margin SDK v1 (#580) * margin admin functions * margin admin functions complete * price feeds added * fix admin functions * basic registration flow * enable pool for loan * update configs * margin pool basic functions * withdraw * cleanup * basic manager functions * margin manager deposit * pyth feeds * oracle * refresh max age * borrow functions * borrow and repay * liquidate * pool proxy * function comments * axios version * changeset * new package * margin proposal params * cleanup * cleanup * cleanup * sort packages --- .changeset/few-points-switch.md | 5 + packages/deepbook-v3/package.json | 5 +- packages/deepbook-v3/src/client.ts | 96 +++- packages/deepbook-v3/src/index.ts | 61 ++- .../src/pyth/PriceServiceConnection.ts | 48 ++ packages/deepbook-v3/src/pyth/pyth-helpers.ts | 23 + packages/deepbook-v3/src/pyth/pyth.ts | 305 ++++++++++++ .../deepbook-v3/src/transactions/deepbook.ts | 33 +- .../src/transactions/deepbookAdmin.ts | 4 +- .../src/transactions/marginAdmin.ts | 309 ++++++++++++ .../src/transactions/marginMaintainer.ts | 214 +++++++++ .../src/transactions/marginManager.ts | 389 ++++++++++++++++ .../src/transactions/marginPool.ts | 105 +++++ .../deepbook-v3/src/transactions/poolProxy.ts | 438 ++++++++++++++++++ packages/deepbook-v3/src/types/index.ts | 67 ++- packages/deepbook-v3/src/utils/config.ts | 62 ++- packages/deepbook-v3/src/utils/constants.ts | 53 ++- pnpm-lock.yaml | 206 ++++---- 18 files changed, 2304 insertions(+), 119 deletions(-) create mode 100644 .changeset/few-points-switch.md create mode 100644 packages/deepbook-v3/src/pyth/PriceServiceConnection.ts create mode 100644 packages/deepbook-v3/src/pyth/pyth-helpers.ts create mode 100644 packages/deepbook-v3/src/pyth/pyth.ts create mode 100644 packages/deepbook-v3/src/transactions/marginAdmin.ts create mode 100644 packages/deepbook-v3/src/transactions/marginMaintainer.ts create mode 100644 packages/deepbook-v3/src/transactions/marginManager.ts create mode 100644 packages/deepbook-v3/src/transactions/marginPool.ts create mode 100644 packages/deepbook-v3/src/transactions/poolProxy.ts diff --git a/.changeset/few-points-switch.md b/.changeset/few-points-switch.md new file mode 100644 index 000000000..00f98b391 --- /dev/null +++ b/.changeset/few-points-switch.md @@ -0,0 +1,5 @@ +--- +'@mysten/deepbook-v3': minor +--- + +Margin package functionality diff --git a/packages/deepbook-v3/package.json b/packages/deepbook-v3/package.json index 0dd4a3da1..9114d4444 100644 --- a/packages/deepbook-v3/package.json +++ b/packages/deepbook-v3/package.json @@ -36,7 +36,10 @@ }, "dependencies": { "@mysten/bcs": "workspace:*", - "@mysten/sui": "workspace:*" + "@mysten/sui": "workspace:*", + "@noble/hashes": "^1.8.0", + "axios": "^1.12.2", + "axios-retry": "^4.5.0" }, "devDependencies": { "@iarna/toml": "^2.2.5", diff --git a/packages/deepbook-v3/src/client.ts b/packages/deepbook-v3/src/client.ts index 8ffefb916..f3ef3e24d 100644 --- a/packages/deepbook-v3/src/client.ts +++ b/packages/deepbook-v3/src/client.ts @@ -11,9 +11,21 @@ import { DeepBookContract } from './transactions/deepbook.js'; import { DeepBookAdminContract } from './transactions/deepbookAdmin.js'; import { FlashLoanContract } from './transactions/flashLoans.js'; import { GovernanceContract } from './transactions/governance.js'; -import type { BalanceManager, Environment } from './types/index.js'; -import { DEEP_SCALAR, DeepBookConfig, FLOAT_SCALAR } from './utils/config.js'; +import type { BalanceManager, Environment, MarginManager } from './types/index.js'; +import { + DEEP_SCALAR, + DeepBookConfig, + FLOAT_SCALAR, + PRICE_INFO_OBJECT_MAX_AGE, +} from './utils/config.js'; import type { CoinMap, PoolMap } from './utils/constants.js'; +import { MarginAdminContract } from './transactions/marginAdmin.js'; +import { MarginMaintainerContract } from './transactions/marginMaintainer.js'; +import { MarginPoolContract } from './transactions/marginPool.js'; +import { MarginManagerContract } from './transactions/marginManager.js'; +import { SuiPriceServiceConnection } from './pyth/pyth.js'; +import { SuiPythClient } from './pyth/pyth.js'; +import { PoolProxyContract } from './transactions/poolProxy.js'; /** * DeepBookClient class for managing DeepBook operations. @@ -27,32 +39,46 @@ export class DeepBookClient { deepBookAdmin: DeepBookAdminContract; flashLoans: FlashLoanContract; governance: GovernanceContract; + marginAdmin: MarginAdminContract; + marginMaintainer: MarginMaintainerContract; + marginPool: MarginPoolContract; + marginManager: MarginManagerContract; + poolProxy: PoolProxyContract; /** * @param {SuiClient} client SuiClient instance * @param {string} address Address of the client * @param {Environment} env Environment configuration * @param {Object.} [balanceManagers] Optional initial BalanceManager map + * @param {Object.} [marginManagers] Optional initial MarginManager map * @param {CoinMap} [coins] Optional initial CoinMap * @param {PoolMap} [pools] Optional initial PoolMap * @param {string} [adminCap] Optional admin capability + * @param {string} [marginAdminCap] Optional margin admin capability + * @param {string} [marginMaintainerCap] Optional margin maintainer capability */ constructor({ client, address, env, balanceManagers, + marginManagers, coins, pools, adminCap, + marginAdminCap, + marginMaintainerCap, }: { client: SuiClient; address: string; env: Environment; balanceManagers?: { [key: string]: BalanceManager }; + marginManagers?: { [key: string]: MarginManager }; coins?: CoinMap; pools?: PoolMap; adminCap?: string; + marginAdminCap?: string; + marginMaintainerCap?: string; }) { this.client = client; this.#address = normalizeSuiAddress(address); @@ -60,15 +86,23 @@ export class DeepBookClient { address: this.#address, env, balanceManagers, + marginManagers, coins, pools, adminCap, + marginAdminCap, + marginMaintainerCap, }); this.balanceManager = new BalanceManagerContract(this.#config); this.deepBook = new DeepBookContract(this.#config); this.deepBookAdmin = new DeepBookAdminContract(this.#config); this.flashLoans = new FlashLoanContract(this.#config); this.governance = new GovernanceContract(this.#config); + this.marginAdmin = new MarginAdminContract(this.#config); + this.marginMaintainer = new MarginMaintainerContract(this.#config); + this.marginPool = new MarginPoolContract(this.#config); + this.marginManager = new MarginManagerContract(this.#config); + this.poolProxy = new PoolProxyContract(this.#config); } /** @@ -744,4 +778,62 @@ export class DeepBookClient { deep: deepBalance / DEEP_SCALAR, }; } + + async getPriceInfoObject(tx: Transaction, coinKey: string): Promise { + const currentTime = Date.now(); + const dbusdcPriceInfoObjectAge = (await this.getPriceInfoObjectAge(coinKey)) * 1000; + if (currentTime - dbusdcPriceInfoObjectAge < PRICE_INFO_OBJECT_MAX_AGE) { + return await this.#config.getCoin(coinKey).priceInfoObjectId!; + } + + // Initialize connection to the Sui Price Service + const endpoint = + this.#config.env === 'testnet' + ? 'https://hermes-beta.pyth.network' + : 'https://hermes.pyth.network'; + const connection = new SuiPriceServiceConnection(endpoint); + + // List of price feed IDs + const priceIDs = [ + this.#config.getCoin(coinKey).feed!, // ASSET/USD price ID + ]; + + // Fetch price feed update data + const priceUpdateData = await connection.getPriceFeedsUpdateData(priceIDs); + + // Initialize Sui Client and Pyth Client + const wormholeStateId = this.#config.pyth.wormholeStateId; + const pythStateId = this.#config.pyth.pythStateId; + + const client = new SuiPythClient(this.client, pythStateId, wormholeStateId); + + return (await client.updatePriceFeeds(tx, priceUpdateData, priceIDs))[0]; // returns priceInfoObjectIds + } + + /** + * @description Get the age of the price info object for a specific coin + * @param {string} coinKey Key of the coin + * @returns {Promise} The arrival time of the price info object + */ + async getPriceInfoObjectAge(coinKey: string) { + const priceInfoObjectId = this.#config.getCoin(coinKey).priceInfoObjectId!; + const res = await this.client.getObject({ + id: priceInfoObjectId, + options: { + showContent: true, + }, + }); + + if (!res.data?.content) { + throw new Error(`Price info object not found for ${coinKey}`); + } + + // Type guard to check if content has fields property + if ('fields' in res.data.content) { + const fields = res.data.content.fields as any; + return fields.price_info?.fields?.arrival_time; + } else { + throw new Error(`Invalid price info object structure for ${coinKey}`); + } + } } diff --git a/packages/deepbook-v3/src/index.ts b/packages/deepbook-v3/src/index.ts index e0e101066..f3b791ce9 100644 --- a/packages/deepbook-v3/src/index.ts +++ b/packages/deepbook-v3/src/index.ts @@ -1,13 +1,68 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +// Main client and configuration export { DeepBookClient } from './client.js'; +export { DeepBookConfig } from './utils/config.js'; + +// Core contract classes export { BalanceManagerContract } from './transactions/balanceManager.js'; export { DeepBookContract } from './transactions/deepbook.js'; export { DeepBookAdminContract } from './transactions/deepbookAdmin.js'; export { FlashLoanContract } from './transactions/flashLoans.js'; export { GovernanceContract } from './transactions/governance.js'; -export { DeepBookConfig } from './utils/config.js'; + +// Margin trading contracts +export { MarginAdminContract } from './transactions/marginAdmin.js'; +export { MarginMaintainerContract } from './transactions/marginMaintainer.js'; +export { MarginManagerContract } from './transactions/marginManager.js'; +export { MarginPoolContract } from './transactions/marginPool.js'; +export { PoolProxyContract } from './transactions/poolProxy.js'; + +// Pyth price feed integration +export { SuiPythClient, SuiPriceServiceConnection } from './pyth/pyth.js'; + +// BCS types for parsing on-chain data export { Account, Balances, Order, OrderDeepPrice, VecSet } from './types/bcs.js'; -export type { BalanceManager, Coin, Pool } from './types/index.js'; -export type { CoinMap, PoolMap } from './utils/constants.js'; + +// TypeScript interfaces and types +export type { + BalanceManager, + Coin, + Pool, + MarginManager, + MarginPool, + Environment, + Config, +} from './types/index.js'; + +// Trading parameter interfaces +export type { + PlaceLimitOrderParams, + PlaceMarketOrderParams, + PlaceMarginLimitOrderParams, + PlaceMarginMarketOrderParams, + SwapParams, + ProposalParams, + MarginProposalParams, + CreatePoolAdminParams, + CreatePermissionlessPoolParams, + SetEwmaParams, + PoolConfigParams, + MarginPoolConfigParams, + InterestConfigParams, +} from './types/index.js'; + +// Enums for trading +export { OrderType, SelfMatchingOptions } from './types/index.js'; + +// Constants and configuration maps +export type { CoinMap, PoolMap, MarginPoolMap } from './utils/constants.js'; +export { + DEEP_SCALAR, + FLOAT_SCALAR, + GAS_BUDGET, + MAX_TIMESTAMP, + POOL_CREATION_FEE, + PRICE_INFO_OBJECT_MAX_AGE, +} from './utils/config.js'; diff --git a/packages/deepbook-v3/src/pyth/PriceServiceConnection.ts b/packages/deepbook-v3/src/pyth/PriceServiceConnection.ts new file mode 100644 index 000000000..b9327dd64 --- /dev/null +++ b/packages/deepbook-v3/src/pyth/PriceServiceConnection.ts @@ -0,0 +1,48 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import axios from 'axios'; +import type { AxiosInstance } from 'axios'; +import axiosRetry from 'axios-retry'; + +export type HexString = string; +export type PriceFeedRequestConfig = { + verbose?: boolean; + binary?: boolean; +}; +export type PriceServiceConnectionConfig = { + timeout?: number; + httpRetries?: number; +}; +export class PriceServiceConnection { + private httpClient: AxiosInstance; + /** + * Constructs a new Connection. + * + * @param endpoint endpoint URL to the price service. + * @param config Optional configuration for custom setups. + */ + constructor(endpoint: string, config?: PriceServiceConnectionConfig) { + this.httpClient = axios.create({ + baseURL: endpoint, + timeout: config?.timeout || 5000, + }); + axiosRetry(this.httpClient, { + retries: config?.httpRetries || 3, + retryDelay: axiosRetry.exponentialDelay, + }); + } + /** + * Fetch latest VAAs of given price IDs. + * + * @param priceIds Array of hex-encoded price IDs. + * @returns Array of base64 encoded VAAs. + */ + async getLatestVaas(priceIds: HexString[]): Promise { + const response = await this.httpClient.get('/api/latest_vaas', { + params: { + ids: priceIds, + }, + }); + return response.data; + } +} diff --git a/packages/deepbook-v3/src/pyth/pyth-helpers.ts b/packages/deepbook-v3/src/pyth/pyth-helpers.ts new file mode 100644 index 000000000..a4c09ea0d --- /dev/null +++ b/packages/deepbook-v3/src/pyth/pyth-helpers.ts @@ -0,0 +1,23 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** + * Extracts the VAA bytes embedded in an accumulator message. + * + * @param accumulatorMessage The accumulator price update message as a Uint8Array. + * @returns VAA bytes as a Uint8Array. + */ +export function extractVaaBytesFromAccumulatorMessage(accumulatorMessage: Uint8Array): Uint8Array { + const dataView = new DataView( + accumulatorMessage.buffer, + accumulatorMessage.byteOffset, + accumulatorMessage.byteLength, + ); + + const trailingPayloadSize = dataView.getUint8(6); + const vaaSizeOffset = 7 + trailingPayloadSize + 1; // Header (7 bytes), trailing payload size, proof type + const vaaSize = dataView.getUint16(vaaSizeOffset, false); // Read 2 bytes for VAA size (big-endian) + const vaaOffset = vaaSizeOffset + 2; // VAA size is 2 bytes + + return accumulatorMessage.subarray(vaaOffset, vaaOffset + vaaSize); +} diff --git a/packages/deepbook-v3/src/pyth/pyth.ts b/packages/deepbook-v3/src/pyth/pyth.ts new file mode 100644 index 000000000..305ae520b --- /dev/null +++ b/packages/deepbook-v3/src/pyth/pyth.ts @@ -0,0 +1,305 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { bcs } from '@mysten/sui/bcs'; +import type { SuiClient } from '@mysten/sui/client'; +import type { Transaction } from '@mysten/sui/transactions'; +import { coinWithBalance } from '@mysten/sui/transactions'; +import { fromBase64, fromHex, parseStructTag } from '@mysten/sui/utils'; + +import type { HexString } from './PriceServiceConnection.js'; +import { PriceServiceConnection } from './PriceServiceConnection.js'; +import { extractVaaBytesFromAccumulatorMessage } from './pyth-helpers.js'; + +const MAX_ARGUMENT_SIZE = 16 * 1024; +export type ObjectId = string; +export class SuiPriceServiceConnection extends PriceServiceConnection { + /** + * Fetch price feed update data. + * + * @param priceIds Array of hex-encoded price IDs. + * @returns Array of buffers containing the price update data. + */ + async getPriceFeedsUpdateData(priceIds: HexString[]): Promise { + const latestVaas = await this.getLatestVaas(priceIds); + return latestVaas.map((vaa) => fromBase64(vaa)); + } +} +export class SuiPythClient { + #pythPackageId?: Promise; + #wormholePackageId?: Promise; + #priceFeedObjectIdCache: Map> = new Map(); + #priceTableInfo?: Promise<{ id: ObjectId; fieldType: ObjectId }>; + #baseUpdateFee?: Promise; + provider: SuiClient; + pythStateId: ObjectId; + wormholeStateId: ObjectId; + + constructor(provider: SuiClient, pythStateId: ObjectId, wormholeStateId: ObjectId) { + this.provider = provider; + this.pythStateId = pythStateId; + this.wormholeStateId = wormholeStateId; + } + /** + * Verifies the VAAs using the Wormhole contract. + * + * @param vaas Array of VAA buffers to verify. + * @param tx Transaction block to add commands to. + * @returns Array of verified VAAs. + */ + async verifyVaas(vaas: Uint8Array[], tx: Transaction) { + const wormholePackageId = await this.getWormholePackageId(); + const verifiedVaas = []; + for (const vaa of vaas) { + const [verifiedVaa] = tx.moveCall({ + target: `${wormholePackageId}::vaa::parse_and_verify`, + arguments: [tx.object(this.wormholeStateId), tx.pure.vector('u8', vaa), tx.object.clock()], + }); + verifiedVaas.push(verifiedVaa); + } + return verifiedVaas; + } + /** + * Adds the necessary commands for updating the Pyth price feeds to the transaction block. + * + * @param tx Transaction block to add commands to. + * @param updates Array of price feed updates received from the price service. + * @param feedIds Array of feed IDs to update (in hex format). + */ + async updatePriceFeeds( + tx: Transaction, + updates: Uint8Array[], + feedIds: HexString[], + ): Promise { + const packageId = await this.getPythPackageId(); + let priceUpdatesHotPotato; + if (updates.length > 1) { + throw new Error( + 'SDK does not support sending multiple accumulator messages in a single transaction', + ); + } + const vaa = extractVaaBytesFromAccumulatorMessage(updates[0]); + const verifiedVaas = await this.verifyVaas([vaa], tx); + [priceUpdatesHotPotato] = tx.moveCall({ + target: `${packageId}::pyth::create_authenticated_price_infos_using_accumulator`, + arguments: [ + tx.object(this.pythStateId), + tx.pure( + bcs + .vector(bcs.U8) + .serialize(Array.from(updates[0]), { + maxSize: MAX_ARGUMENT_SIZE, + }) + .toBytes(), + ), + verifiedVaas[0], + tx.object.clock(), + ], + }); + const priceInfoObjects: ObjectId[] = []; + const baseUpdateFee = await this.getBaseUpdateFee(); + for (const feedId of feedIds) { + const priceInfoObjectId = await this.getPriceFeedObjectId(feedId); + if (!priceInfoObjectId) { + throw new Error(`Price feed ${feedId} not found, please create it first`); + } + priceInfoObjects.push(priceInfoObjectId); + [priceUpdatesHotPotato] = tx.moveCall({ + target: `${packageId}::pyth::update_single_price_feed`, + arguments: [ + tx.object(this.pythStateId), + priceUpdatesHotPotato, + tx.object(priceInfoObjectId), + coinWithBalance({ balance: baseUpdateFee }), + tx.object.clock(), + ], + }); + } + tx.moveCall({ + target: `${packageId}::hot_potato_vector::destroy`, + arguments: [priceUpdatesHotPotato], + typeArguments: [`${packageId}::price_info::PriceInfo`], + }); + return priceInfoObjects; + } + /** + * Get the price feed object ID for a given feed ID, caching the promise. + * @param feedId + */ + getPriceFeedObjectId(feedId: HexString): Promise { + if (!this.#priceFeedObjectIdCache.has(feedId)) { + this.#priceFeedObjectIdCache.set( + feedId, + this.#fetchPriceFeedObjectId(feedId).catch((err) => { + // Remove failed promises from the cache to allow retries + this.#priceFeedObjectIdCache.delete(feedId); + throw err; + }), + ); + } + + return this.#priceFeedObjectIdCache.get(feedId)!; + } + + /** + * Fetches the price feed object ID for a given feed ID (no caching). + * Throws an error if the object is not found. + */ + async #fetchPriceFeedObjectId(feedId: HexString): Promise { + const { id: tableId, fieldType } = await this.getPriceTableInfo(); + const result = await this.provider.getDynamicFieldObject({ + parentId: tableId, + name: { + type: `${fieldType}::price_identifier::PriceIdentifier`, + value: { + bytes: Array.from(fromHex(feedId)), + }, + }, + }); + + if (!result.data || !result.data.content) { + throw new Error(`Price feed object ID for feed ID ${feedId} not found.`); + } + if (result.data.content.dataType !== 'moveObject') { + throw new Error('Price feed type mismatch'); + } + + const fields = result.data.content.fields as { value: string }; + return fields.value; + } + + /** + * Fetches the price table object ID for the current state ID, caching the promise. + * @returns Price table object ID and field type + */ + getPriceTableInfo(): Promise<{ id: ObjectId; fieldType: ObjectId }> { + if (!this.#priceTableInfo) { + const promise = this.#fetchPriceTableInfo().catch((err) => { + // Clear the cached promise on error + this.#priceTableInfo = undefined; + throw err; + }); + + this.#priceTableInfo = promise; + } + + return this.#priceTableInfo; + } + + /** + * Fetches the price table object ID and field type (no caching). + * @returns Price table object ID and field type + */ + async #fetchPriceTableInfo(): Promise<{ id: ObjectId; fieldType: ObjectId }> { + const result = await this.provider.getDynamicFieldObject({ + parentId: this.pythStateId, + name: { + type: 'vector', + value: 'price_info', + }, + }); + + if (!result.data || !result.data.type) { + throw new Error('Price Table not found, contract may not be initialized'); + } + + const priceIdentifier = parseStructTag(result.data.type).typeParams[0]; + if ( + typeof priceIdentifier === 'object' && + priceIdentifier !== null && + priceIdentifier.name === 'PriceIdentifier' && + 'address' in priceIdentifier + ) { + return { id: result.data.objectId, fieldType: priceIdentifier.address }; + } else { + throw new Error('fieldType not found'); + } + } + /** + * Fetches the package ID for the Wormhole contract, with caching. + */ + getWormholePackageId(): Promise { + if (!this.#wormholePackageId) { + this.#wormholePackageId = this.#fetchWormholePackageId(); + } + return this.#wormholePackageId; + } + + /** + * Fetches the package ID for the Wormhole contract (no caching). + */ + async #fetchWormholePackageId(): Promise { + return await this.#getPackageId(this.wormholeStateId); + } + + /** + * Fetches the package ID for the Pyth contract, with caching. + */ + getPythPackageId(): Promise { + if (!this.#pythPackageId) { + this.#pythPackageId = this.#fetchPythPackageId(); + } + return this.#pythPackageId; + } + + /** + * Fetches the package ID for the Pyth contract (no caching). + */ + async #fetchPythPackageId(): Promise { + return await this.#getPackageId(this.pythStateId); + } + + /** + * Fetches the package ID for a given object. + * + * @param objectId Object ID to fetch the package ID for. + */ + async #getPackageId(objectId: ObjectId): Promise { + const result = await this.provider.getObject({ + id: objectId, + options: { showContent: true }, + }); + + if ( + result.data?.content?.dataType === 'moveObject' && + 'upgrade_cap' in result.data.content.fields + ) { + const fields = result.data.content.fields as { + upgrade_cap: { + fields: { + package: ObjectId; + }; + }; + }; + return fields.upgrade_cap.fields.package; + } + + throw new Error(`Cannot fetch package ID for object ${objectId}`); + } + /** + * Gets the base update fee from the Pyth state object. + */ + async #fetchBaseUpdateFee(): Promise { + const result = await this.provider.getObject({ + id: this.pythStateId, + options: { showContent: true }, + }); + + if (!result.data || result.data.content?.dataType !== 'moveObject') { + throw new Error('Unable to fetch Pyth state object'); + } + + const fields = result.data.content.fields as { base_update_fee: number }; + return fields.base_update_fee; + } + + /** + * Returns the cached base update fee, fetching it if necessary. + */ + getBaseUpdateFee(): Promise { + if (!this.#baseUpdateFee) { + this.#baseUpdateFee = this.#fetchBaseUpdateFee(); + } + return this.#baseUpdateFee; + } +} diff --git a/packages/deepbook-v3/src/transactions/deepbook.ts b/packages/deepbook-v3/src/transactions/deepbook.ts index 926eb4f96..7f1beea18 100644 --- a/packages/deepbook-v3/src/transactions/deepbook.ts +++ b/packages/deepbook-v3/src/transactions/deepbook.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { coinWithBalance } from '@mysten/sui/transactions'; import type { Transaction } from '@mysten/sui/transactions'; -import { SUI_CLOCK_OBJECT_ID } from '@mysten/sui/utils'; import { OrderType, SelfMatchingOptions } from '../types/index.js'; import type { @@ -76,7 +75,7 @@ export class DeepBookContract { tx.pure.bool(isBid), tx.pure.bool(payWithDeep), tx.pure.u64(expiration), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -117,7 +116,7 @@ export class DeepBookContract { tx.pure.u64(inputQuantity), tx.pure.bool(isBid), tx.pure.bool(payWithDeep), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -149,7 +148,7 @@ export class DeepBookContract { tradeProof, tx.pure.u128(orderId), tx.pure.u64(inputQuantity), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -178,7 +177,7 @@ export class DeepBookContract { tx.object(balanceManager.address), tradeProof, tx.pure.u128(orderId), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -204,7 +203,7 @@ export class DeepBookContract { tx.object(pool.address), tx.object(balanceManager.address), tradeProof, - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -248,7 +247,7 @@ export class DeepBookContract { arguments: [ tx.object(targetPool.address), tx.object(referencePool.address), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [ targetBaseCoin.type, @@ -418,7 +417,7 @@ export class DeepBookContract { tx.moveCall({ target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::mid_price`, - arguments: [tx.object(pool.address), tx.object(SUI_CLOCK_OBJECT_ID)], + arguments: [tx.object(pool.address), tx.object.clock()], typeArguments: [baseCoin.type, quoteCoin.type], }); }; @@ -455,7 +454,7 @@ export class DeepBookContract { arguments: [ tx.object(pool.address), tx.pure.u64(baseQuantity * baseCoin.scalar), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -478,7 +477,7 @@ export class DeepBookContract { arguments: [ tx.object(pool.address), tx.pure.u64(quoteQuantity * quoteScalar), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -504,7 +503,7 @@ export class DeepBookContract { tx.object(pool.address), tx.pure.u64(baseQuantity * baseCoin.scalar), tx.pure.u64(quoteQuantity * quoteScalar), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -550,7 +549,7 @@ export class DeepBookContract { tx.pure.u64((priceLow * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar), tx.pure.u64((priceHigh * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar), tx.pure.bool(isBid), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -569,11 +568,7 @@ export class DeepBookContract { tx.moveCall({ target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_level2_ticks_from_mid`, - arguments: [ - tx.object(pool.address), - tx.pure.u64(tickFromMid), - tx.object(SUI_CLOCK_OBJECT_ID), - ], + arguments: [tx.object(pool.address), tx.pure.u64(tickFromMid), tx.object.clock()], typeArguments: [baseCoin.type, quoteCoin.type], }); }; @@ -645,7 +640,7 @@ export class DeepBookContract { baseCoinInput, deepCoin, tx.pure.u64(minQuoteInput), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); @@ -692,7 +687,7 @@ export class DeepBookContract { quoteCoinInput, deepCoin, tx.pure.u64(minBaseInput), - tx.object(SUI_CLOCK_OBJECT_ID), + tx.object.clock(), ], typeArguments: [baseCoin.type, quoteCoin.type], }); diff --git a/packages/deepbook-v3/src/transactions/deepbookAdmin.ts b/packages/deepbook-v3/src/transactions/deepbookAdmin.ts index 589ac74bd..6b4299f79 100644 --- a/packages/deepbook-v3/src/transactions/deepbookAdmin.ts +++ b/packages/deepbook-v3/src/transactions/deepbookAdmin.ts @@ -3,7 +3,7 @@ import type { Transaction } from '@mysten/sui/transactions'; -import type { CreatePoolAdminParams, SetEwmaParamsParams } from '../types/index.js'; +import type { CreatePoolAdminParams, SetEwmaParams } from '../types/index.js'; import type { DeepBookConfig } from '../utils/config.js'; import { FLOAT_SCALAR } from '../utils/config.js'; @@ -260,7 +260,7 @@ export class DeepBookAdminContract { * @param {SetEwmaParamsParams} params The parameters to set * @returns A function that takes a Transaction object */ - setEwmaParams = (poolKey: string, params: SetEwmaParamsParams) => (tx: Transaction) => { + setEwmaParams = (poolKey: string, params: SetEwmaParams) => (tx: Transaction) => { const { alpha, zScoreThreshold, additionalTakerFee } = params; const adjustedAlpha = Math.round(alpha * FLOAT_SCALAR); const adjustedZScoreThreshold = Math.round(zScoreThreshold * FLOAT_SCALAR); diff --git a/packages/deepbook-v3/src/transactions/marginAdmin.ts b/packages/deepbook-v3/src/transactions/marginAdmin.ts new file mode 100644 index 000000000..5fae8e66d --- /dev/null +++ b/packages/deepbook-v3/src/transactions/marginAdmin.ts @@ -0,0 +1,309 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Transaction } from '@mysten/sui/transactions'; + +import type { DeepBookConfig } from '../utils/config.js'; +import type { TransactionArgument } from '@mysten/sui/transactions'; +import type { PoolConfigParams } from '../types/index.js'; +import { FLOAT_SCALAR } from '../utils/config.js'; +import { hexToBytes } from '@noble/hashes/utils'; + +/** + * MarginAdminContract class for managing admin actions. + */ +export class MarginAdminContract { + #config: DeepBookConfig; + + /** + * @param {DeepBookConfig} config Configuration for MarginAdminContract + */ + constructor(config: DeepBookConfig) { + this.#config = config; + } + + /** + * @returns The admin capability required for admin operations + * @throws Error if the admin capability is not set + */ + #marginAdminCap() { + const marginAdminCap = this.#config.marginAdminCap; + if (!marginAdminCap) { + throw new Error('MARGIN_ADMIN_CAP environment variable not set'); + } + return marginAdminCap; + } + + /** + * @description Mint a maintainer cap + * @returns A function that takes a Transaction object + */ + mintMaintainerCap = () => (tx: Transaction) => { + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::mint_maintainer_cap`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(this.#marginAdminCap()), + tx.object.clock(), + ], + }); + }; + + /** + * @description Revoke a maintainer cap + * @returns A function that takes a Transaction object + */ + revokeMaintainerCap = (maintainerCapId: string) => (tx: Transaction) => { + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::revoke_maintainer_cap`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(this.#marginAdminCap()), + tx.object(maintainerCapId), + tx.object.clock(), + ], + }); + }; + + /** + * @description Register a deepbook pool + * @param {string} poolKey The key of the pool to be registered + * @param {TransactionArgument} poolConfig The configuration of the pool + * @returns A function that takes a Transaction object + */ + registerDeepbookPool = + (poolKey: string, poolConfig: TransactionArgument) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::register_deepbook_pool`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(this.#marginAdminCap()), + tx.object(pool.address), + poolConfig, + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Enable a deepbook pool for margin trading + * @param {string} poolKey The key of the pool to be enabled + * @returns A function that takes a Transaction object + */ + enableDeepbookPool = (poolKey: string) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::enable_deepbook_pool`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(this.#marginAdminCap()), + tx.object(pool.address), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Disable a deepbook pool from margin trading + * @param {string} poolKey The key of the pool to be disabled + * @returns A function that takes a Transaction object + */ + disableDeepbookPool = (poolKey: string) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::disable_deepbook_pool`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(this.#marginAdminCap()), + tx.object(pool.address), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Update the risk parameters for a margin + * @param {string} poolKey The key of the pool to be updated + * @param {TransactionArgument} poolConfig The configuration of the pool + * @returns A function that takes a Transaction object + */ + updateRiskParams = (poolKey: string, poolConfig: TransactionArgument) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::update_risk_params`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(this.#marginAdminCap()), + tx.object(pool.address), + poolConfig, + tx.object.clock(), + ], + }); + }; + + /** + * @description Add the PythConfig to the margin registry + * @param {Transaction} tx The transaction object + * @param {TransactionArgument} config The config to be added + * @returns A function that takes a Transaction object + */ + addConfig = (config: TransactionArgument) => (tx: Transaction) => { + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::add_config`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(this.#marginAdminCap()), + config, + ], + typeArguments: [`${this.#config.MARGIN_PACKAGE_ID}::oracle::PythConfig`], + }); + }; + + /** + * @description Remove the PythConfig from the margin registry + * @param {Transaction} tx The transaction object + * @returns A function that takes a Transaction object + */ + removeConfig = () => (tx: Transaction) => { + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::remove_config`, + arguments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.object(this.#marginAdminCap())], + typeArguments: [`${this.#config.MARGIN_PACKAGE_ID}::oracle::PythConfig`], + }); + }; + + /** + * @description Enable a specific version + * @param {number} version The version to be enabled + * @returns A function that takes a Transaction object + */ + enableVersion = (version: number) => (tx: Transaction) => { + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::enable_version`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.pure.u64(version), + tx.object(this.#marginAdminCap()), + ], + }); + }; + + /** + * @description Disable a specific version + * @param {number} version The version to be disabled + * @returns A function that takes a Transaction object + */ + disableVersion = (version: number) => (tx: Transaction) => { + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::disable_version`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.pure.u64(version), + tx.object(this.#marginAdminCap()), + ], + }); + }; + + /** + * @description Create a new pool config + * @param {string} poolKey The key to identify the pool + * @param {PoolConfigParams} poolConfigParams The parameters for the pool config + * @returns A function that takes a Transaction object + */ + newPoolConfig = (poolKey: string, poolConfigParams: PoolConfigParams) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const { + minWithdrawRiskRatio, + minBorrowRiskRatio, + liquidationRiskRatio, + targetLiquidationRiskRatio, + userLiquidationReward, + poolLiquidationReward, + } = poolConfigParams; + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::new_pool_config`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.pure.u64(minWithdrawRiskRatio * FLOAT_SCALAR), + tx.pure.u64(minBorrowRiskRatio * FLOAT_SCALAR), + tx.pure.u64(liquidationRiskRatio * FLOAT_SCALAR), + tx.pure.u64(targetLiquidationRiskRatio * FLOAT_SCALAR), + tx.pure.u64(userLiquidationReward * FLOAT_SCALAR), + tx.pure.u64(poolLiquidationReward * FLOAT_SCALAR), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Create a new pool config with leverage + * @param {string} poolKey The key to identify the pool + * @param {number} leverage The leverage for the pool + * @returns A function that takes a Transaction object + */ + newPoolConfigWithLeverage = (poolKey: string, leverage: number) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::new_pool_config_with_leverage`, + arguments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.u64(leverage * FLOAT_SCALAR)], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Create a new coin type data + * @param {string} coinKey The key to identify the coin + * @returns A function that takes a Transaction object + */ + newCoinTypeData = (coinKey: string) => (tx: Transaction) => { + const coin = this.#config.getCoin(coinKey); + if (!coin.feed) { + throw new Error('Coin feed not found'); + } + const priceFeedInput = new Uint8Array( + hexToBytes(coin['feed']!.startsWith('0x') ? coin.feed!.slice(2) : coin['feed']), + ); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::oracle::new_coin_type_data`, + arguments: [tx.object(coin.metadataId!), tx.pure.vector('u8', priceFeedInput)], + typeArguments: [coin.type], + }); + }; + + /** + * @description Create a new Pyth config + * @param {string[]} coins The coins to be added to the Pyth config + * @param {number} maxAgeSeconds The max age in seconds for the Pyth config + * @returns A function that takes a Transaction object + */ + newPythConfig = (coins: string[], maxAgeSeconds: number) => (tx: Transaction) => { + const coinTypeDataList = []; + for (const coin of coins) { + coinTypeDataList.push(this.newCoinTypeData(coin)(tx)); + } + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::oracle::new_pyth_config`, + arguments: [ + tx.makeMoveVec({ + elements: coinTypeDataList, + type: `${this.#config.MARGIN_PACKAGE_ID}::oracle::CoinTypeData`, + }), + tx.pure.u64(maxAgeSeconds), + ], + }); + }; +} diff --git a/packages/deepbook-v3/src/transactions/marginMaintainer.ts b/packages/deepbook-v3/src/transactions/marginMaintainer.ts new file mode 100644 index 000000000..618f7b537 --- /dev/null +++ b/packages/deepbook-v3/src/transactions/marginMaintainer.ts @@ -0,0 +1,214 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Transaction } from '@mysten/sui/transactions'; + +import type { DeepBookConfig } from '../utils/config.js'; +import type { TransactionArgument } from '@mysten/sui/transactions'; +import type { MarginPoolConfigParams, InterestConfigParams } from '../types/index.js'; +import { FLOAT_SCALAR } from '../utils/config.js'; + +/** + * DeepBookMaintainerContract class for managing maintainer actions. + */ +export class MarginMaintainerContract { + #config: DeepBookConfig; + + /** + * @param {DeepBookConfig} config Configuration for MarginMaintainerContract + */ + constructor(config: DeepBookConfig) { + this.#config = config; + } + + /** + * @returns The admin capability required for admin operations + * @throws Error if the admin capability is not set + */ + #marginMaintainerCap() { + const marginMaintainerCap = this.#config.marginMaintainerCap; + if (!marginMaintainerCap) { + throw new Error('MARGIN_ADMIN_CAP environment variable not set'); + } + return marginMaintainerCap; + } + + /** + * @description Create a new margin pool + * @param {string} coinKey The key to identify the coin + * @param {TransactionArgument} poolConfig The configuration for the pool + * @returns A function that takes a Transaction object + */ + createMarginPool = (coinKey: string, poolConfig: TransactionArgument) => (tx: Transaction) => { + const coin = this.#config.getCoin(coinKey); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::create_margin_pool`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + poolConfig, + tx.object(this.#marginMaintainerCap()), + tx.object.clock(), + ], + typeArguments: [coin.type], + }); + }; + + /** + * @description Create a new protocol config + * @param {string} coinKey The key to identify the coin + * @param {MarginPoolConfigParams} marginPoolConfig The configuration for the margin pool + * @param {InterestConfigParams} interestConfig The configuration for the interest + * @returns A function that takes a Transaction object + */ + newProtocolConfig = + ( + coinKey: string, + marginPoolConfig: MarginPoolConfigParams, + interestConfig: InterestConfigParams, + ) => + (tx: Transaction) => { + const marginPoolConfigObject = this.newMarginPoolConfig(coinKey, marginPoolConfig)(tx); + const interestConfigObject = this.newInterestConfig(interestConfig)(tx); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::protocol_config::new_protocol_config`, + arguments: [marginPoolConfigObject, interestConfigObject], + }); + }; + + /** + * @description Create a new margin pool config + * @param {string} coinKey The key to identify the coin + * @param {MarginPoolConfigParams} marginPoolConfig The configuration for the margin pool + * @returns A function that takes a Transaction object + */ + newMarginPoolConfig = + (coinKey: string, marginPoolConfig: MarginPoolConfigParams) => (tx: Transaction) => { + const coin = this.#config.getCoin(coinKey); + const { supplyCap, maxUtilizationRate, referralSpread, minBorrow } = marginPoolConfig; + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::protocol_config::new_margin_pool_config`, + arguments: [ + tx.pure.u64(supplyCap * coin.scalar), + tx.pure.u64(maxUtilizationRate * FLOAT_SCALAR), + tx.pure.u64(referralSpread * FLOAT_SCALAR), + tx.pure.u64(minBorrow * coin.scalar), + ], + }); + }; + + /** + * @description Create a new interest config + * @param {InterestConfigParams} interestConfig The configuration for the interest + * @returns A function that takes a Transaction object + */ + newInterestConfig = (interestConfig: InterestConfigParams) => (tx: Transaction) => { + const { baseRate, baseSlope, optimalUtilization, excessSlope } = interestConfig; + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::protocol_config::new_interest_config`, + arguments: [ + tx.pure.u64(baseRate * FLOAT_SCALAR), + tx.pure.u64(baseSlope * FLOAT_SCALAR), + tx.pure.u64(optimalUtilization * FLOAT_SCALAR), + tx.pure.u64(excessSlope * FLOAT_SCALAR), + ], + }); + }; + + /** + * @description Enable a deepbook pool for loan + * @param {string} deepbookPoolKey The key to identify the deepbook pool + * @param {string} coinKey The key to identify the margin pool + * @param {string} marginPoolCap The margin pool cap + * @returns A function that takes a Transaction object + */ + enableDeepbookPoolForLoan = + (deepbookPoolKey: string, coinKey: string, marginPoolCap: string) => (tx: Transaction) => { + const deepbookPool = this.#config.getPool(deepbookPoolKey); + const marginPool = this.#config.getMarginPool(coinKey); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::enable_deepbook_pool_for_loan`, + arguments: [ + tx.object(marginPool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.pure.id(deepbookPool.address), + tx.object(marginPoolCap), + tx.object.clock(), + ], + typeArguments: [marginPool.type], + }); + }; + + /** + * @description Disable a deepbook pool for loan + * @param {string} deepbookPoolKey The key to identify the deepbook pool + * @param {string} coinKey The key to identify the margin pool + * @param {string} marginPoolCap The margin pool cap + * @returns A function that takes a Transaction object + */ + disableDeepbookPoolForLoan = + (deepbookPoolKey: string, coinKey: string, marginPoolCap: string) => (tx: Transaction) => { + const deepbookPool = this.#config.getPool(deepbookPoolKey); + const marginPool = this.#config.getMarginPool(coinKey); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::disable_deepbook_pool_for_loan`, + arguments: [ + tx.object(marginPool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.pure.id(deepbookPool.address), + tx.object(marginPoolCap), + tx.object.clock(), + ], + typeArguments: [marginPool.type], + }); + }; + + /** + * @description Update the interest params + * @param {string} coinKey The key to identify the margin pool + * @param {string} marginPoolCap The margin pool cap + * @param {InterestConfigParams} interestConfig The configuration for the interest + * @returns A function that takes a Transaction object + */ + updateInterestParams = + (coinKey: string, marginPoolCap: string, interestConfig: InterestConfigParams) => + (tx: Transaction) => { + const marginPool = this.#config.getMarginPool(coinKey); + const interestConfigObject = this.newInterestConfig(interestConfig)(tx); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::update_interest_params`, + arguments: [ + tx.object(marginPool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + interestConfigObject, + tx.object(marginPoolCap), + tx.object.clock(), + ], + typeArguments: [marginPool.type], + }); + }; + + /** + * @description Update the margin pool config + * @param {string} coinKey The key to identify the margin pool + * @param {string} marginPoolCap The margin pool cap + * @param {MarginPoolConfigParams} marginPoolConfig The configuration for the margin pool + * @returns A function that takes a Transaction object + */ + updateMarginPoolConfig = + (coinKey: string, marginPoolCap: string, marginPoolConfig: MarginPoolConfigParams) => + (tx: Transaction) => { + const marginPool = this.#config.getMarginPool(coinKey); + const marginPoolConfigObject = this.newMarginPoolConfig(coinKey, marginPoolConfig)(tx); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::update_margin_pool_config`, + arguments: [ + tx.object(marginPool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + marginPoolConfigObject, + tx.object(marginPoolCap), + tx.object.clock(), + ], + typeArguments: [marginPool.type], + }); + }; +} diff --git a/packages/deepbook-v3/src/transactions/marginManager.ts b/packages/deepbook-v3/src/transactions/marginManager.ts new file mode 100644 index 000000000..e7bfacebd --- /dev/null +++ b/packages/deepbook-v3/src/transactions/marginManager.ts @@ -0,0 +1,389 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import type { Transaction, TransactionArgument } from '@mysten/sui/transactions'; +import { coinWithBalance } from '@mysten/sui/transactions'; + +import type { DeepBookConfig } from '../utils/config.js'; + +/** + * MarginManagerContract class for managing MarginManager operations. + */ +export class MarginManagerContract { + #config: DeepBookConfig; + + /** + * @param {DeepBookConfig} config Configuration for MarginManagerContract + */ + constructor(config: DeepBookConfig) { + this.#config = config; + } + + /** + * @description Create a new margin manager + * @param {string} poolKey The key to identify the pool + * @returns A function that takes a Transaction object + */ + newMarginManager = (poolKey: string) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::new`, + arguments: [ + tx.object(pool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Create a new margin manager with an initializer + * @param {string} poolKey The key to identify the pool + * @returns A function that takes a Transaction object + */ + newMarginManagerWithInitializer = (poolKey: string) => (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const [manager, initializer] = tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::new_with_initializer`, + arguments: [ + tx.object(pool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + return { manager, initializer }; + }; + + /** + * @description Share a margin manager + * @param {string} poolKey The key to identify the pool + * @param {TransactionArgument} manager The margin manager to share + * @param {TransactionArgument} initializer The initializer for the manager + * @returns A function that takes a Transaction object + */ + shareMarginManager = + (poolKey: string, manager: TransactionArgument, initializer: TransactionArgument) => + (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::share`, + arguments: [manager, initializer], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Deposit base into a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to deposit + * @returns A function that takes a Transaction object + */ + depositBase = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const coin = coinWithBalance({ + type: baseCoin.type, + balance: amount * baseCoin.scalar, + }); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`, + arguments: [tx.object(manager.address), tx.object(this.#config.MARGIN_REGISTRY_ID), coin], + typeArguments: [baseCoin.type, quoteCoin.type, baseCoin.type], + }); + }; + + /** + * @description Deposit quote into a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to deposit + * @returns A function that takes a Transaction object + */ + depositQuote = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const coin = coinWithBalance({ + type: quoteCoin.type, + balance: amount * quoteCoin.scalar, + }); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`, + arguments: [tx.object(manager.address), tx.object(this.#config.MARGIN_REGISTRY_ID), coin], + typeArguments: [baseCoin.type, quoteCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Deposit deep into a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to deposit + * @returns A function that takes a Transaction object + */ + depositDeep = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const deepCoin = this.#config.getCoin('DEEP'); + const coin = coinWithBalance({ + type: deepCoin.type, + balance: amount * deepCoin.scalar, + }); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`, + arguments: [tx.object(manager.address), tx.object(this.#config.MARGIN_REGISTRY_ID), coin], + typeArguments: [baseCoin.type, quoteCoin.type, deepCoin.type], + }); + }; + + /** + * @description Withdraw base from a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to withdraw + * @returns A function that takes a Transaction object + */ + withdrawBase = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const baseMarginPool = this.#config.getMarginPool(pool.baseCoin); + const quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`, + arguments: [ + tx.object(manager.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(baseMarginPool.address), + tx.object(quoteMarginPool.address), + tx.object(baseCoin.priceInfoObjectId!), + tx.object(quoteCoin.priceInfoObjectId!), + tx.object(pool.address), + tx.pure.u64(amount * baseCoin.scalar), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type, baseCoin.type], + }); + }; + + /** + * @description Withdraw quote from a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to withdraw + * @returns A function that takes a Transaction object + */ + withdrawQuote = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const baseMarginPool = this.#config.getMarginPool(pool.baseCoin); + const quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`, + arguments: [ + tx.object(manager.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(baseMarginPool.address), + tx.object(quoteMarginPool.address), + tx.object(baseCoin.priceInfoObjectId!), + tx.object(quoteCoin.priceInfoObjectId!), + tx.object(pool.address), + tx.pure.u64(amount * quoteCoin.scalar), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Withdraw deep from a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to withdraw + * @returns A function that takes a Transaction object + */ + withdrawDeep = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const deepCoin = this.#config.getCoin('DEEP'); + const baseMarginPool = this.#config.getMarginPool(pool.baseCoin); + const quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`, + arguments: [ + tx.object(manager.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(baseMarginPool.address), + tx.object(quoteMarginPool.address), + tx.object(baseCoin.priceInfoObjectId!), + tx.object(quoteCoin.priceInfoObjectId!), + tx.object(pool.address), + tx.pure.u64(amount * deepCoin.scalar), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type, deepCoin.type], + }); + }; + + /** + * @description Borrow base from a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to borrow + * @returns A function that takes a Transaction object + */ + borrowBase = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const baseMarginPool = this.#config.getMarginPool(pool.baseCoin); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrow_base`, + arguments: [ + tx.object(manager.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(baseMarginPool.address), + tx.object(baseCoin.priceInfoObjectId!), + tx.object(quoteCoin.priceInfoObjectId!), + tx.object(pool.address), + tx.pure.u64(amount * baseCoin.scalar), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Borrow quote from a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to borrow + * @returns A function that takes a Transaction object + */ + borrowQuote = (managerKey: string, amount: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrow_quote`, + arguments: [ + tx.object(manager.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(quoteMarginPool.address), + tx.object(baseCoin.priceInfoObjectId!), + tx.object(quoteCoin.priceInfoObjectId!), + tx.object(pool.address), + tx.pure.u64(amount * quoteCoin.scalar), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Repay base from a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to repay + * @returns A function that takes a Transaction object + */ + repayBase = (managerKey: string, amount?: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const baseMarginPool = this.#config.getMarginPool(pool.baseCoin); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::repay_base`, + arguments: [ + tx.object(manager.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(baseMarginPool.address), + tx.object.option({ + type: 'u64', + value: amount ? tx.pure.u64(amount * baseCoin.scalar) : null, + }), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Repay quote from a margin manager + * @param {string} managerKey The key to identify the manager + * @param {number} amount The amount to repay + * @returns A function that takes a Transaction object + */ + repayQuote = (managerKey: string, amount?: number) => (tx: Transaction) => { + const manager = this.#config.getMarginManager(managerKey); + const pool = this.#config.getPool(manager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::repay_quote`, + arguments: [ + tx.object(manager.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(quoteMarginPool.address), + tx.object.option({ + type: 'u64', + value: amount ? tx.pure.u64(amount * quoteCoin.scalar) : null, + }), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Liquidate a margin manager + * @param {string} managerAddress The address of the manager to liquidate + * @param {string} poolKey The key to identify the pool + * @param {boolean} debtIsBase Whether the debt is in base + * @param {TransactionArgument} repayCoin The coin to repay + * @returns A function that takes a Transaction object + */ + liquidate = + ( + managerAddress: string, + poolKey: string, + debtIsBase: boolean, + repayCoin: TransactionArgument, + ) => + (tx: Transaction) => { + const pool = this.#config.getPool(poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const baseMarginPool = this.#config.getMarginPool(pool.baseCoin); + const quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin); + const marginPool = debtIsBase ? baseMarginPool : quoteMarginPool; + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::liquidate`, + arguments: [ + tx.object(managerAddress), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(baseCoin.priceInfoObjectId!), + tx.object(quoteCoin.priceInfoObjectId!), + tx.object(marginPool.address), + tx.object(pool.address), + repayCoin, + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; +} diff --git a/packages/deepbook-v3/src/transactions/marginPool.ts b/packages/deepbook-v3/src/transactions/marginPool.ts new file mode 100644 index 000000000..a6c6b1f40 --- /dev/null +++ b/packages/deepbook-v3/src/transactions/marginPool.ts @@ -0,0 +1,105 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { coinWithBalance } from '@mysten/sui/transactions'; +import type { Transaction } from '@mysten/sui/transactions'; + +import type { DeepBookConfig } from '../utils/config.js'; + +/** + * MarginPoolContract class for managing MarginPool operations. + */ +export class MarginPoolContract { + #config: DeepBookConfig; + + /** + * @param {DeepBookConfig} config Configuration for MarginPoolContract + */ + constructor(config: DeepBookConfig) { + this.#config = config; + } + + /** + * @description Supply to a margin pool + * @param {string} coinKey The key to identify the pool + * @param {number} amountToDeposit The amount to deposit + * @param {string} referralId The ID of the referral + * @returns A function that takes a Transaction object + */ + supplyToMarginPool = + (coinKey: string, amountToDeposit: number, referralId?: string) => (tx: Transaction) => { + tx.setSenderIfNotSet(this.#config.address); + const marginPool = this.#config.getMarginPool(coinKey); + const coin = this.#config.getCoin(coinKey); + const depositInput = Math.round(amountToDeposit * coin.scalar); + const referralIdInput = referralId ? tx.object(referralId) : null; + const supply = coinWithBalance({ + type: coin.type, + balance: depositInput, + }); + + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::supply`, + arguments: [ + tx.object(marginPool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + supply, + tx.object.option({ type: 'address', value: referralIdInput }), + tx.object.clock(), + ], + typeArguments: [marginPool.type], + }); + }; + + /** + * @description Withdraw from a margin pool + * @param {string} coinKey The key to identify the pool + * @param {number} amountToWithdraw The amount to withdraw + * @returns A function that takes a Transaction object + */ + withdrawFromMarginPool = (coinKey: string, amountToWithdraw?: number) => (tx: Transaction) => { + const marginPool = this.#config.getMarginPool(coinKey); + const coin = this.#config.getCoin(coinKey); + const withdrawInput = amountToWithdraw + ? tx.pure.u64(Math.round(amountToWithdraw * coin.scalar)) + : null; + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::withdraw`, + arguments: [ + tx.object(marginPool.address), + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object.option({ type: 'u64', value: withdrawInput }), + tx.object.clock(), + ], + typeArguments: [marginPool.type], + }); + }; + + /** + * @description Mint a referral for a margin pool + * @param {string} coinKey The key to identify the pool + * @returns A function that takes a Transaction object + */ + mintReferral = (coinKey: string) => (tx: Transaction) => { + const marginPool = this.#config.getMarginPool(coinKey); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::mint_referral`, + arguments: [tx.object(marginPool.address), tx.object.clock()], + typeArguments: [marginPool.type], + }); + }; + + /** + * @description Withdraw referral fees from a margin pool + * @param {string} coinKey The key to identify the pool + * @param {string} referralId The ID of the referral + * @returns A function that takes a Transaction object + */ + withdrawReferralFees = (coinKey: string, referralId: string) => (tx: Transaction) => { + const marginPool = this.#config.getMarginPool(coinKey); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::margin_pool::withdraw_referral_fees`, + arguments: [tx.object(marginPool.address), tx.object(referralId), tx.object.clock()], + typeArguments: [marginPool.type], + }); + }; +} diff --git a/packages/deepbook-v3/src/transactions/poolProxy.ts b/packages/deepbook-v3/src/transactions/poolProxy.ts new file mode 100644 index 000000000..146e84678 --- /dev/null +++ b/packages/deepbook-v3/src/transactions/poolProxy.ts @@ -0,0 +1,438 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import type { Transaction } from '@mysten/sui/transactions'; +import type { + PlaceMarginLimitOrderParams, + PlaceMarginMarketOrderParams, + MarginProposalParams, +} from '../types/index.js'; + +import type { DeepBookConfig } from '../utils/config.js'; +import { OrderType, SelfMatchingOptions } from '../types/index.js'; +import { MAX_TIMESTAMP, FLOAT_SCALAR } from '../utils/config.js'; + +/** + * PoolProxyContract class for managing PoolProxy operations. + */ +export class PoolProxyContract { + #config: DeepBookConfig; + + /** + * @param {DeepBookConfig} config Configuration for PoolProxyContract + */ + constructor(config: DeepBookConfig) { + this.#config = config; + } + + /** + * @description Place a limit order + * @param {PlaceMarginLimitOrderParams} params Parameters for placing a limit order + * @returns A function that takes a Transaction object + */ + placeLimitOrder = (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => { + const { + poolKey, + marginManagerKey, + clientOrderId, + price, + quantity, + isBid, + expiration = MAX_TIMESTAMP, + orderType = OrderType.NO_RESTRICTION, + selfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED, + payWithDeep = true, + } = params; + const pool = this.#config.getPool(poolKey); + const manager = this.#config.getMarginManager(marginManagerKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar); + const inputQuantity = Math.round(quantity * baseCoin.scalar); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_limit_order`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(manager.address), + tx.object(pool.address), + tx.pure.u64(clientOrderId), + tx.pure.u8(orderType), + tx.pure.u8(selfMatchingOption), + tx.pure.u64(inputPrice), + tx.pure.u64(inputQuantity), + tx.pure.bool(isBid), + tx.pure.bool(payWithDeep), + tx.pure.u64(expiration), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Place a market order + * @param {PlaceMarginMarketOrderParams} params Parameters for placing a market order + * @returns A function that takes a Transaction object + */ + placeMarketOrder = (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => { + const { + poolKey, + marginManagerKey, + clientOrderId, + quantity, + isBid, + selfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED, + payWithDeep = true, + } = params; + const pool = this.#config.getPool(poolKey); + const manager = this.#config.getMarginManager(marginManagerKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const inputQuantity = Math.round(quantity * baseCoin.scalar); + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_market_order`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(manager.address), + tx.object(pool.address), + tx.pure.u64(clientOrderId), + tx.pure.u8(selfMatchingOption), + tx.pure.u64(inputQuantity), + tx.pure.bool(isBid), + tx.pure.bool(payWithDeep), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Place a reduce only limit order + * @param {PlaceMarginLimitOrderParams} params Parameters for placing a reduce only limit order + * @returns A function that takes a Transaction object + */ + placeReduceOnlyLimitOrder = (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => { + const { + poolKey, + marginManagerKey, + clientOrderId, + price, + quantity, + isBid, + expiration = MAX_TIMESTAMP, + orderType = OrderType.NO_RESTRICTION, + selfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED, + payWithDeep = true, + } = params; + const pool = this.#config.getPool(poolKey); + const manager = this.#config.getMarginManager(marginManagerKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar); + const inputQuantity = Math.round(quantity * baseCoin.scalar); + const marginPool = isBid + ? this.#config.getMarginPool(pool.baseCoin) + : this.#config.getMarginPool(pool.quoteCoin); + const debtType = isBid ? baseCoin.type : quoteCoin.type; + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_reduce_only_limit_order`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(manager.address), + tx.object(pool.address), + tx.object(marginPool.address), + tx.pure.u64(clientOrderId), + tx.pure.u8(orderType), + tx.pure.u8(selfMatchingOption), + tx.pure.u64(inputPrice), + tx.pure.u64(inputQuantity), + tx.pure.bool(isBid), + tx.pure.bool(payWithDeep), + tx.pure.u64(expiration), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type, debtType], + }); + }; + + /** + * @description Place a reduce only market order + * @param {PlaceMarginMarketOrderParams} params Parameters for placing a reduce only market order + * @returns A function that takes a Transaction object + */ + placeReduceOnlyMarketOrder = (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => { + const { + poolKey, + marginManagerKey, + clientOrderId, + quantity, + isBid, + selfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED, + payWithDeep = true, + } = params; + const pool = this.#config.getPool(poolKey); + const manager = this.#config.getMarginManager(marginManagerKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const inputQuantity = Math.round(quantity * baseCoin.scalar); + const marginPool = isBid + ? this.#config.getMarginPool(pool.baseCoin) + : this.#config.getMarginPool(pool.quoteCoin); + const debtType = isBid ? baseCoin.type : quoteCoin.type; + return tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_reduce_only_market_order`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(manager.address), + tx.object(pool.address), + tx.object(marginPool.address), + tx.pure.u64(clientOrderId), + tx.pure.u8(selfMatchingOption), + tx.pure.u64(inputQuantity), + tx.pure.bool(isBid), + tx.pure.bool(payWithDeep), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type, debtType], + }); + }; + + /** + * @description Modify an existing order + * @param {string} marginManagerKey The key to identify the MarginManager + * @param {string} orderId Order ID to modify + * @param {number} newQuantity New quantity for the order + * @returns A function that takes a Transaction object + */ + modifyOrder = + (marginManagerKey: string, orderId: string, newQuantity: number) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const inputQuantity = Math.round(newQuantity * baseCoin.scalar); + + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::modify_order`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + tx.pure.u128(orderId), + tx.pure.u64(inputQuantity), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Cancel an existing order + * @param {string} marginManagerKey The key to identify the MarginManager + * @param {string} orderId Order ID to cancel + * @returns A function that takes a Transaction object + */ + cancelOrder = (marginManagerKey: string, orderId: string) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::cancel_order`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + tx.pure.u128(orderId), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Cancel multiple existing orders + * @param {string} marginManagerKey The key to identify the MarginManager + * @param {string[]} orderIds Order IDs to cancel + * @returns A function that takes a Transaction object + */ + cancelOrders = (marginManagerKey: string, orderIds: string[]) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::cancel_orders`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + tx.pure.vector('u128', orderIds), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Cancel all existing orders + * @param {string} marginManagerKey The key to identify the MarginManager + * @returns A function that takes a Transaction object + */ + cancelAllOrders = (marginManagerKey: string) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::cancel_all_orders`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + tx.object.clock(), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Withdraw settled amounts + * @param {string} marginManagerKey The key to identify the MarginManager + * @returns A function that takes a Transaction object + */ + withdrawSettledAmounts = (marginManagerKey: string) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::withdraw_settled_amounts`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Stake in the pool + * @param {string} marginManagerKey The key to identify the MarginManager + * @param {number} stakeAmount The amount to stake + * @returns A function that takes a Transaction object + */ + stake = (marginManagerKey: string, stakeAmount: number) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const deepCoin = this.#config.getCoin('DEEP'); + const stakeInput = Math.round(stakeAmount * deepCoin.scalar); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::stake`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + tx.pure.u64(stakeInput), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Unstake from the pool + * @param {string} marginManagerKey The key to identify the MarginManager + * @returns A function that takes a Transaction object + */ + unstake = (marginManagerKey: string) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::unstake`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Submit a proposal + * @param {string} marginManagerKey The key to identify the MarginManager + * @param {MarginProposalParams} params Parameters for the proposal + * @returns A function that takes a Transaction object + */ + submitProposal = + (marginManagerKey: string, params: MarginProposalParams) => (tx: Transaction) => { + const { takerFee, makerFee, stakeRequired } = params; + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + const stakeInput = Math.round(stakeRequired * FLOAT_SCALAR); + const takerFeeInput = Math.round(takerFee * FLOAT_SCALAR); + const makerFeeInput = Math.round(makerFee * FLOAT_SCALAR); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::submit_proposal`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + tx.pure.u64(takerFeeInput), + tx.pure.u64(makerFeeInput), + tx.pure.u64(stakeInput), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Vote on a proposal + * @param {string} marginManagerKey The key to identify the MarginManager + * @param {string} proposalId The ID of the proposal to vote on + * @returns A function that takes a Transaction object + */ + vote = (marginManagerKey: string, proposalId: string) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::vote`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + tx.pure.id(proposalId), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; + + /** + * @description Claim a rebate from a pool + * @param {string} marginManagerKey The key to identify the MarginManager + * @returns A function that takes a Transaction object + */ + claimRebate = (marginManagerKey: string) => (tx: Transaction) => { + const marginManager = this.#config.getMarginManager(marginManagerKey); + const pool = this.#config.getPool(marginManager.poolKey); + const baseCoin = this.#config.getCoin(pool.baseCoin); + const quoteCoin = this.#config.getCoin(pool.quoteCoin); + tx.moveCall({ + target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::claim_rebate`, + arguments: [ + tx.object(this.#config.MARGIN_REGISTRY_ID), + tx.object(marginManager.address), + tx.object(pool.address), + ], + typeArguments: [baseCoin.type, quoteCoin.type], + }); + }; +} diff --git a/packages/deepbook-v3/src/types/index.ts b/packages/deepbook-v3/src/types/index.ts index 68cff559c..e9cdb9da7 100644 --- a/packages/deepbook-v3/src/types/index.ts +++ b/packages/deepbook-v3/src/types/index.ts @@ -11,10 +11,18 @@ export interface BalanceManager { withdrawCap?: string; } +export interface MarginManager { + address: string; + poolKey: string; +} + export interface Coin { address: string; type: string; scalar: number; + feed?: string; + metadataId?: string; + priceInfoObjectId?: string; } export interface Pool { @@ -23,6 +31,11 @@ export interface Pool { quoteCoin: string; } +export interface MarginPool { + address: string; + type: string; +} + // Trading constants export enum OrderType { NO_RESTRICTION, @@ -61,6 +74,29 @@ export interface PlaceMarketOrderParams { payWithDeep?: boolean; } +export interface PlaceMarginLimitOrderParams { + poolKey: string; + marginManagerKey: string; + clientOrderId: string; + price: number; + quantity: number; + isBid: boolean; + expiration?: number | bigint; + orderType?: OrderType; + selfMatchingOption?: SelfMatchingOptions; + payWithDeep?: boolean; +} + +export interface PlaceMarginMarketOrderParams { + poolKey: string; + marginManagerKey: string; + clientOrderId: string; + quantity: number; + isBid: boolean; + selfMatchingOption?: SelfMatchingOptions; + payWithDeep?: boolean; +} + export interface ProposalParams { poolKey: string; balanceManagerKey: string; @@ -69,6 +105,12 @@ export interface ProposalParams { stakeRequired: number; } +export interface MarginProposalParams { + takerFee: number; + makerFee: number; + stakeRequired: number; +} + export interface SwapParams { poolKey: string; amount: number; @@ -98,12 +140,35 @@ export interface CreatePermissionlessPoolParams { deepCoin?: TransactionObjectArgument; } -export interface SetEwmaParamsParams { +export interface SetEwmaParams { alpha: number; zScoreThreshold: number; additionalTakerFee: number; } +export interface PoolConfigParams { + minWithdrawRiskRatio: number; + minBorrowRiskRatio: number; + liquidationRiskRatio: number; + targetLiquidationRiskRatio: number; + userLiquidationReward: number; + poolLiquidationReward: number; +} + +export interface MarginPoolConfigParams { + supplyCap: number; + maxUtilizationRate: number; + referralSpread: number; + minBorrow: number; +} + +export interface InterestConfigParams { + baseRate: number; + baseSlope: number; + optimalUtilization: number; + excessSlope: number; +} + export interface Config { DEEPBOOK_PACKAGE_ID: string; REGISTRY_ID: string; diff --git a/packages/deepbook-v3/src/utils/config.ts b/packages/deepbook-v3/src/utils/config.ts index 100d1f66c..6ae3f751c 100644 --- a/packages/deepbook-v3/src/utils/config.ts +++ b/packages/deepbook-v3/src/utils/config.ts @@ -3,8 +3,8 @@ import { normalizeSuiAddress } from '@mysten/sui/utils'; import { BalanceManagerContract } from '../transactions/balanceManager.js'; -import type { BalanceManager, Environment } from '../types/index.js'; -import type { CoinMap, PoolMap } from './constants.js'; +import type { BalanceManager, Environment, MarginManager } from '../types/index.js'; +import type { CoinMap, PoolMap, MarginPoolMap } from './constants.js'; import { mainnetCoins, mainnetPackageIds, @@ -12,6 +12,10 @@ import { testnetCoins, testnetPackageIds, testnetPools, + mainnetMarginPools, + testnetMarginPools, + mainnetPythConfigs, + testnetPythConfigs, } from './constants.js'; export const FLOAT_SCALAR = 1000000000; @@ -19,17 +23,29 @@ export const MAX_TIMESTAMP = 1844674407370955161n; export const GAS_BUDGET = 0.5 * 500000000; // Adjust based on benchmarking export const DEEP_SCALAR = 1000000; export const POOL_CREATION_FEE = 500 * 1_000_000; // 500 DEEP +export const PRICE_INFO_OBJECT_MAX_AGE = 30 * 1000; export class DeepBookConfig { #coins: CoinMap; #pools: PoolMap; + #marginPools: MarginPoolMap; + env: Environment; balanceManagers: { [key: string]: BalanceManager }; + marginManagers: { [key: string]: MarginManager }; address: string; + pyth: { + pythStateId: string; + wormholeStateId: string; + }; DEEPBOOK_PACKAGE_ID: string; REGISTRY_ID: string; DEEP_TREASURY_ID: string; + MARGIN_PACKAGE_ID: string; + MARGIN_REGISTRY_ID: string; adminCap?: string; + marginAdminCap?: string; + marginMaintainerCap?: string; balanceManager: BalanceManagerContract; @@ -37,33 +53,53 @@ export class DeepBookConfig { env, address, adminCap, + marginAdminCap, + marginMaintainerCap, balanceManagers, + marginManagers, coins, pools, + marginPools, }: { env: Environment; address: string; adminCap?: string; + marginAdminCap?: string; + marginMaintainerCap?: string; balanceManagers?: { [key: string]: BalanceManager }; + marginManagers?: { [key: string]: MarginManager }; coins?: CoinMap; pools?: PoolMap; + marginPools?: MarginPoolMap; }) { + this.env = env; this.address = normalizeSuiAddress(address); this.adminCap = adminCap; + this.marginAdminCap = marginAdminCap; + this.marginMaintainerCap = marginMaintainerCap; this.balanceManagers = balanceManagers || {}; + this.marginManagers = marginManagers || {}; if (env === 'mainnet') { this.#coins = coins || mainnetCoins; this.#pools = pools || mainnetPools; + this.#marginPools = marginPools || mainnetMarginPools; this.DEEPBOOK_PACKAGE_ID = mainnetPackageIds.DEEPBOOK_PACKAGE_ID; this.REGISTRY_ID = mainnetPackageIds.REGISTRY_ID; this.DEEP_TREASURY_ID = mainnetPackageIds.DEEP_TREASURY_ID; + this.MARGIN_PACKAGE_ID = mainnetPackageIds.MARGIN_PACKAGE_ID; + this.MARGIN_REGISTRY_ID = mainnetPackageIds.MARGIN_REGISTRY_ID; + this.pyth = mainnetPythConfigs; } else { this.#coins = coins || testnetCoins; this.#pools = pools || testnetPools; + this.#marginPools = marginPools || testnetMarginPools; this.DEEPBOOK_PACKAGE_ID = testnetPackageIds.DEEPBOOK_PACKAGE_ID; this.REGISTRY_ID = testnetPackageIds.REGISTRY_ID; this.DEEP_TREASURY_ID = testnetPackageIds.DEEP_TREASURY_ID; + this.MARGIN_PACKAGE_ID = testnetPackageIds.MARGIN_PACKAGE_ID; + this.MARGIN_REGISTRY_ID = testnetPackageIds.MARGIN_REGISTRY_ID; + this.pyth = testnetPythConfigs; } this.balanceManager = new BalanceManagerContract(this); @@ -88,6 +124,15 @@ export class DeepBookConfig { return pool; } + getMarginPool(key: string) { + const pool = this.#marginPools[key]; + if (!pool) { + throw new Error(`Margin pool not found for key: ${key}`); + } + + return pool; + } + /** * @description Get the balance manager by key * @param managerKey Key of the balance manager @@ -100,4 +145,17 @@ export class DeepBookConfig { return this.balanceManagers[managerKey]; } + + /** + * @description Get the margin manager by key + * @param managerKey Key of the margin manager + * @returns The MarginManager object + */ + getMarginManager(managerKey: string): MarginManager { + if (!Object.hasOwn(this.marginManagers, managerKey)) { + throw new Error(`Margin manager with key ${managerKey} not found.`); + } + + return this.marginManagers[managerKey]; + } } diff --git a/packages/deepbook-v3/src/utils/constants.ts b/packages/deepbook-v3/src/utils/constants.ts index 33cb78cd1..749e690d6 100644 --- a/packages/deepbook-v3/src/utils/constants.ts +++ b/packages/deepbook-v3/src/utils/constants.ts @@ -1,27 +1,34 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { Coin, Pool } from '../types/index.js'; +import type { Coin, Pool, MarginPool } from '../types/index.js'; export type CoinMap = Record; export type PoolMap = Record; +export type MarginPoolMap = Record; export interface DeepbookPackageIds { DEEPBOOK_PACKAGE_ID: string; REGISTRY_ID: string; DEEP_TREASURY_ID: string; + MARGIN_PACKAGE_ID: string; + MARGIN_REGISTRY_ID: string; } export const testnetPackageIds = { DEEPBOOK_PACKAGE_ID: '0xc483dba510597205749f2e8410c23f19be31a710aef251f353bc1b97755efd4d', REGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1', DEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb', + MARGIN_PACKAGE_ID: '0x442d21fd044b90274934614c3c41416c83582f42eaa8feb4fecea301aa6bdd54', + MARGIN_REGISTRY_ID: '0x851e63bd0a3e25a12f02df82f0a1683064ee7ed0b1297dcd18707aa22b382ad3', } satisfies DeepbookPackageIds; export const mainnetPackageIds = { DEEPBOOK_PACKAGE_ID: '0xb29d83c26cdd2a64959263abbcfc4a6937f0c9fccaf98580ca56faded65be244', REGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d', DEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe', -}; + MARGIN_PACKAGE_ID: '', + MARGIN_REGISTRY_ID: '', +} satisfies DeepbookPackageIds; export const testnetCoins: CoinMap = { DEEP: { @@ -33,11 +40,17 @@ export const testnetCoins: CoinMap = { address: `0x0000000000000000000000000000000000000000000000000000000000000002`, type: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`, scalar: 1000000000, + feed: '0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266', + metadataId: '0x587c29de216efd4219573e08a1f6964d4fa7cb714518c2c8a0f29abfa264327d', + priceInfoObjectId: '0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0', }, DBUSDC: { address: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`, type: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`, scalar: 1000000, + feed: '0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722', + metadataId: '0xa68a066e8a9cf7217722a150bacb993c424e7ad42d50d204b4e482ba5aeb8e00', + priceInfoObjectId: '0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81', }, DBUSDT: { address: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`, @@ -61,11 +74,15 @@ export const mainnetCoins: CoinMap = { address: `0x0000000000000000000000000000000000000000000000000000000000000002`, type: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`, scalar: 1000000000, + feed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744', + metadataId: '0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3', }, USDC: { address: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`, type: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`, scalar: 1000000, + feed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a', + metadataId: '0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6', }, WUSDC: { address: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`, @@ -270,3 +287,35 @@ export const mainnetPools: PoolMap = { quoteCoin: 'SUI', }, }; + +export const testnetMarginPools = { + SUI: { + address: '0x52fae759e70a7fd35f2a4538589a949ad120dc67fa1bda7bf0b12dcc650b173a', + type: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + }, + DBUSDC: { + address: '0xfca47443db2177b3e7d93fdb4b3a7d33c3102688419146c9bac2628d735a7545', + type: '0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC', + }, +}; + +export const mainnetMarginPools = { + SUI: { + address: '', + type: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + }, + USDC: { + address: '', + type: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC', + }, +}; + +export const testnetPythConfigs = { + pythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c', + wormholeStateId: '0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790', +}; + +export const mainnetPythConfigs = { + pythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8', + wormholeStateId: '0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c', +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ba949014..a2b6150ff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -694,6 +694,15 @@ importers: '@mysten/sui': specifier: workspace:* version: link:../typescript + '@noble/hashes': + specifier: ^1.8.0 + version: 1.8.0 + axios: + specifier: ^1.12.2 + version: 1.12.2 + axios-retry: + specifier: ^4.5.0 + version: 4.5.0(axios@1.12.2) devDependencies: '@iarna/toml': specifier: ^2.2.5 @@ -3876,12 +3885,12 @@ packages: nanostores: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^1.0.0 react: '>=18.0.0' - '@napi-rs/wasm-runtime@0.2.12': - resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} - '@napi-rs/wasm-runtime@1.0.3': resolution: {integrity: sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==} + '@napi-rs/wasm-runtime@1.0.5': + resolution: {integrity: sha512-TBr9Cf9onSAS2LQ2+QHx6XcC6h9+RIzJgbqG3++9TUZSH204AwEy5jg3BTQ0VATsyoGj4ee49tN/y6rvaOOtcg==} + '@next/env@15.5.2': resolution: {integrity: sha512-Qe06ew4zt12LeO6N7j8/nULSOe3fMXE4dM6xgpBQNvdzyK1sv5y4oAP3bq4LamrvGCZtmRYnW8URFCeX5nFgGg==} @@ -3997,12 +4006,8 @@ packages: resolution: {integrity: sha512-O0hdKt4K31i8fpq8Bw5RfdPVAqm0EdduBUcluPo2MRcfCOwUEf5JlnvRhf/J0ezOYOD8jQ/LumYZxOVi/XK/BA==} engines: {node: '>= 20.0.0'} - '@oxc-project/runtime@0.71.0': - resolution: {integrity: sha512-QwoF5WUXIGFQ+hSxWEib4U/aeLoiDN9JlP18MnBgx9LLPRDfn1iICtcow7Jgey6HLH4XFceWXQD5WBJ39dyJcw==} - engines: {node: '>=6.9.0'} - - '@oxc-project/types@0.71.0': - resolution: {integrity: sha512-5CwQ4MI+P4MQbjLWXgNurA+igGwu/opNetIE13LBs9+V93R64MLvDKOOLZIXSzEfovU3Zef3q3GjPnMTgJTn2w==} + '@oxc-project/types@0.93.0': + resolution: {integrity: sha512-yNtwmWZIBtJsMr5TEfoZFDxIWV6OdScOpza/f5YxbqUMJk+j6QX3Cf3jgZShGEFYWQJ5j9mJ6jM0tZHu2J9Yrg==} '@oxc-transform/binding-android-arm64@0.82.3': resolution: {integrity: sha512-25Wh8wRSVMNiGJHeT1kIOKynrXbMoSR5vkhL+j7GyXs+R7tA3Vah574NK86y7k8Ayz7bmddSepue+Mp4/B2bqg==} @@ -5342,67 +5347,90 @@ packages: '@repeaterjs/repeater@3.0.6': resolution: {integrity: sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==} - '@rolldown/binding-darwin-arm64@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-Mp0/gqiPdepHjjVm7e0yL1acWvI0rJVVFQEADSezvAjon9sjQ7CEg9JnXICD4B1YrPmN9qV/e7cQZCp87tTV4w==} + '@rolldown/binding-android-arm64@1.0.0-beta.41': + resolution: {integrity: sha512-Edflndd9lU7JVhVIvJlZhdCj5DkhYDJPIRn4Dx0RUdfc8asP9xHOI5gMd8MesDDx+BJpdIT/uAmVTearteU/mQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-beta.41': + resolution: {integrity: sha512-XGCzqfjdk7550PlyZRTBKbypXrB7ATtXhw/+bjtxnklLQs0mKP/XkQVOKyn9qGKSlvH8I56JLYryVxl0PCvSNw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-40re4rMNrsi57oavRzIOpRGmg3QRlW6Ea8Q3znaqgOuJuKVrrm2bIQInTfkZJG7a4/5YMX7T951d0+toGLTdCA==} + '@rolldown/binding-darwin-x64@1.0.0-beta.41': + resolution: {integrity: sha512-Ho6lIwGJed98zub7n0xcRKuEtnZgbxevAmO4x3zn3C3N4GVXZD5xvCvTVxSMoeBJwTcIYzkVDRTIhylQNsTgLQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-8BDM939bbMariZupiHp3OmP5N+LXPT4mULA0hZjDaq970PCxv4krZOSMG+HkWUUwmuQROtV+/00xw39EO0P+8g==} + '@rolldown/binding-freebsd-x64@1.0.0-beta.41': + resolution: {integrity: sha512-ijAZETywvL+gACjbT4zBnCp5ez1JhTRs6OxRN4J+D6AzDRbU2zb01Esl51RP5/8ZOlvB37xxsRQ3X4YRVyYb3g==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-sntsPaPgrECpBB/+2xrQzVUt0r493TMPI+4kWRMhvMsmrxOqH1Ep5lM0Wua/ZdbfZNwm1aVa5pcESQfNfM4Fhw==} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.41': + resolution: {integrity: sha512-EgIOZt7UildXKFEFvaiLNBXm+4ggQyGe3E5Z1QP9uRcJJs9omihOnm897FwOBQdCuMvI49iBgjFrkhH+wMJ2MA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-5clBW/I+er9F2uM1OFjJFWX86y7Lcy0M+NqsN4s3o07W+8467Zk8oQa4B45vdaXoNUF/yqIAgKkA/OEdQDxZqA==} + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.41': + resolution: {integrity: sha512-F8bUwJq8v/JAU8HSwgF4dztoqJ+FjdyjuvX4//3+Fbe2we9UktFeZ27U4lRMXF1vxWtdV4ey6oCSqI7yUrSEeg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-wv+rnAfQDk9p/CheX8/Kmqk2o1WaFa4xhWI9gOyDMk/ljvOX0u0ubeM8nI1Qfox7Tnh71eV5AjzSePXUhFOyOg==} + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.41': + resolution: {integrity: sha512-MioXcCIX/wB1pBnBoJx8q4OGucUAfC1+/X1ilKFsjDK05VwbLZGRgOVD5OJJpUQPK86DhQciNBrfOKDiatxNmg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-gxD0/xhU4Py47IH3bKZbWtvB99tMkUPGPJFRfSc5UB9Osoje0l0j1PPbxpUtXIELurYCqwLBKXIMTQGifox1BQ==} + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.41': + resolution: {integrity: sha512-m66M61fizvRCwt5pOEiZQMiwBL9/y0bwU/+Kc4Ce/Pef6YfoEkR28y+DzN9rMdjo8Z28NXjsDPq9nH4mXnAP0g==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-HotuVe3XUjDwqqEMbm3o3IRkP9gdm8raY/btd/6KE3JGLF/cv4+3ff1l6nOhAZI8wulWDPEXPtE7v+HQEaTXnA==} + '@rolldown/binding-linux-x64-musl@1.0.0-beta.41': + resolution: {integrity: sha512-yRxlSfBvWnnfrdtJfvi9lg8xfG5mPuyoSHm0X01oiE8ArmLRvoJGHUTJydCYz+wbK2esbq5J4B4Tq9WAsOlP1Q==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-wasm32-wasi@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-8Cx+ucbd8n2dIr21FqBh6rUvTVL0uTgEtKR7l+MUZ5BgY4dFh1e4mPVX8oqmoYwOxBiXrsD2JIOCz4AyKLKxWA==} - engines: {node: '>=14.21.3'} + '@rolldown/binding-openharmony-arm64@1.0.0-beta.41': + resolution: {integrity: sha512-PHVxYhBpi8UViS3/hcvQQb9RFqCtvFmFU1PvUoTRiUdBtgHA6fONNHU4x796lgzNlVSD3DO/MZNk1s5/ozSMQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.41': + resolution: {integrity: sha512-OAfcO37ME6GGWmj9qTaDT7jY4rM0T2z0/8ujdQIJQ2x2nl+ztO32EIwURfmXOK0U1tzkyuaKYvE34Pug/ucXlQ==} + engines: {node: '>=14.0.0'} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-Vhq5vikrVDxAa75fxsyqj0c0Y/uti/TwshXI71Xb8IeUQJOBnmLUsn5dgYf5ljpYYkNa0z9BPAvUDIDMmyDi+w==} + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.41': + resolution: {integrity: sha512-NIYGuCcuXaq5BC4Q3upbiMBvmZsTsEPG9k/8QKQdmrch+ocSy5Jv9tdpdmXJyighKqm182nh/zBt+tSJkYoNlg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-lN7RIg9Iugn08zP2aZN9y/MIdG8iOOCE93M1UrFlrxMTqPf8X+fDzmR/OKhTSd1A2pYNipZHjyTcb5H8kyQSow==} + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.41': + resolution: {integrity: sha512-kANdsDbE5FkEOb5NrCGBJBCaZ2Sabp3D7d4PRqMYJqyLljwh9mDyYyYSv5+QNvdAmifj+f3lviNEUUuUZPEFPw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-7/7cLIn48Y+EpQ4CePvf8reFl63F15yPUlg4ZAhl+RXJIfydkdak1WD8Ir3AwAO+bJBXzrfNL+XQbxm0mcQZmw==} + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.41': + resolution: {integrity: sha512-UlpxKmFdik0Y2VjZrgUCgoYArZJiZllXgIipdBRV1hw6uK45UbQabSTW6Kp6enuOu7vouYWftwhuxfpE8J2JAg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -5418,8 +5446,8 @@ packages: '@rolldown/pluginutils@1.0.0-beta.36': resolution: {integrity: sha512-qa+gfzhv0/Xv52zZInENLu6JbsnSjSExD7kTaNm7Qn5LUIH6IQb7l9pB+NrsU5/Bvt9aqcBTdRGc7x1DYMTiqQ==} - '@rolldown/pluginutils@1.0.0-beta.9-commit.d91dfb5': - resolution: {integrity: sha512-8sExkWRK+zVybw3+2/kBkYBFeLnEUWz1fT7BLHplpzmtqkOfTbAQ9gkt4pzwGIIZmg4Qn5US5ACjUBenrhezwQ==} + '@rolldown/pluginutils@1.0.0-beta.41': + resolution: {integrity: sha512-ycMEPrS3StOIeb87BT3/+bu+blEtyvwQ4zmo2IcJQy0Rd1DAAhKksA0iUZ3MYSpJtjlPhg0Eo6mvVS6ggPhRbw==} '@rollup/rollup-android-arm-eabi@4.50.1': resolution: {integrity: sha512-HJXwzoZN4eYTdD8bVV22DN8gsPCAj3V20NHKOs8ezfXanGpmVPR7kalUHd+Y31IJp9stdB87VKPFbsGY3H/2ag==} @@ -6110,9 +6138,6 @@ packages: '@tsconfig/node22@22.0.2': resolution: {integrity: sha512-Kmwj4u8sDRDrMYRoN9FDEcXD8UpBSaPQQ24Gz+Gamqfm7xxn+GBR7ge/Z7pK8OXNGyUzbSwJj+TH6B+DS/epyA==} - '@tybys/wasm-util@0.10.0': - resolution: {integrity: sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==} - '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} @@ -6803,6 +6828,10 @@ packages: resolution: {integrity: sha512-BGcItUBWSMRgOCe+SVZJ+S7yTRG0eGt9cXAHev72yuGcY23hnLA7Bky5L/xLyPINoSN95geovfBkqoTlNZYa7w==} engines: {node: '>=14'} + ansis@4.2.0: + resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==} + engines: {node: '>=14'} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -10532,8 +10561,9 @@ packages: vue-tsc: optional: true - rolldown@1.0.0-beta.9-commit.d91dfb5: - resolution: {integrity: sha512-FHkj6gGEiEgmAXQchglofvUUdwj2Oiw603Rs+zgFAnn9Cb7T7z3fiaEc0DbN3ja4wYkW6sF2rzMEtC1V4BGx/g==} + rolldown@1.0.0-beta.41: + resolution: {integrity: sha512-U+NPR0Bkg3wm61dteD2L4nAM1U9dtaqVrpDXwC36IKRHpEO/Ubpid4Nijpa2imPchcVNHfxVFwSSMJdwdGFUbg==} + engines: {node: ^20.19.0 || >=22.12.0} hasBin: true rollup@4.50.1: @@ -14669,18 +14699,18 @@ snapshots: nanostores: 1.0.1 react: 18.3.1 - '@napi-rs/wasm-runtime@0.2.12': + '@napi-rs/wasm-runtime@1.0.3': dependencies: '@emnapi/core': 1.5.0 '@emnapi/runtime': 1.5.0 '@tybys/wasm-util': 0.10.1 optional: true - '@napi-rs/wasm-runtime@1.0.3': + '@napi-rs/wasm-runtime@1.0.5': dependencies: '@emnapi/core': 1.5.0 '@emnapi/runtime': 1.5.0 - '@tybys/wasm-util': 0.10.0 + '@tybys/wasm-util': 0.10.1 optional: true '@next/env@15.5.2': {} @@ -14760,9 +14790,7 @@ snapshots: '@orama/orama@3.1.13': {} - '@oxc-project/runtime@0.71.0': {} - - '@oxc-project/types@0.71.0': {} + '@oxc-project/types@0.93.0': {} '@oxc-transform/binding-android-arm64@0.82.3': optional: true @@ -16347,42 +16375,48 @@ snapshots: '@repeaterjs/repeater@3.0.6': {} - '@rolldown/binding-darwin-arm64@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-android-arm64@1.0.0-beta.41': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-beta.41': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.41': optional: true - '@rolldown/binding-darwin-x64@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-freebsd-x64@1.0.0-beta.41': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.41': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.41': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.41': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.41': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-linux-x64-musl@1.0.0-beta.41': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-openharmony-arm64@1.0.0-beta.41': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-wasm32-wasi@1.0.0-beta.41': dependencies: - '@napi-rs/wasm-runtime': 0.2.12 + '@napi-rs/wasm-runtime': 1.0.5 optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.41': optional: true - '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.41': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.9-commit.d91dfb5': + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.41': optional: true '@rolldown/pluginutils@1.0.0-beta.27': {} @@ -16393,7 +16427,7 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.36': {} - '@rolldown/pluginutils@1.0.0-beta.9-commit.d91dfb5': {} + '@rolldown/pluginutils@1.0.0-beta.41': {} '@rollup/rollup-android-arm-eabi@4.50.1': optional: true @@ -17001,11 +17035,6 @@ snapshots: '@tsconfig/node22@22.0.2': {} - '@tybys/wasm-util@0.10.0': - dependencies: - tslib: 2.8.1 - optional: true - '@tybys/wasm-util@0.10.1': dependencies: tslib: 2.8.1 @@ -18246,6 +18275,8 @@ snapshots: ansis@4.1.0: {} + ansis@4.2.0: {} + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 @@ -22918,7 +22949,7 @@ snapshots: dependencies: glob: 7.2.3 - rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.9-commit.d91dfb5)(typescript@5.9.2): + rolldown-plugin-dts@0.15.10(rolldown@1.0.0-beta.41)(typescript@5.9.2): dependencies: '@babel/generator': 7.28.3 '@babel/parser': 7.28.3 @@ -22928,32 +22959,33 @@ snapshots: debug: 4.4.1 dts-resolver: 2.1.2 get-tsconfig: 4.10.1 - rolldown: 1.0.0-beta.9-commit.d91dfb5 + rolldown: 1.0.0-beta.41 optionalDependencies: typescript: 5.9.2 transitivePeerDependencies: - oxc-resolver - supports-color - rolldown@1.0.0-beta.9-commit.d91dfb5: + rolldown@1.0.0-beta.41: dependencies: - '@oxc-project/runtime': 0.71.0 - '@oxc-project/types': 0.71.0 - '@rolldown/pluginutils': 1.0.0-beta.9-commit.d91dfb5 - ansis: 4.1.0 + '@oxc-project/types': 0.93.0 + '@rolldown/pluginutils': 1.0.0-beta.41 + ansis: 4.2.0 optionalDependencies: - '@rolldown/binding-darwin-arm64': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-darwin-x64': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.9-commit.d91dfb5 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.9-commit.d91dfb5 + '@rolldown/binding-android-arm64': 1.0.0-beta.41 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.41 + '@rolldown/binding-darwin-x64': 1.0.0-beta.41 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.41 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.41 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.41 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.41 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.41 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.41 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.41 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.41 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.41 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.41 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.41 rollup@4.50.1: dependencies: @@ -23734,8 +23766,8 @@ snapshots: diff: 8.0.2 empathic: 2.0.0 hookable: 5.5.3 - rolldown: 1.0.0-beta.9-commit.d91dfb5 - rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.9-commit.d91dfb5)(typescript@5.9.2) + rolldown: 1.0.0-beta.41 + rolldown-plugin-dts: 0.15.10(rolldown@1.0.0-beta.41)(typescript@5.9.2) semver: 7.7.2 tinyexec: 1.0.1 tinyglobby: 0.2.14 From 6431429e1032568be18d6661f44d1f09b3ac1bfb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:04:55 -0400 Subject: [PATCH 29/36] Version Packages (#574) Co-authored-by: github-actions[bot] --- .changeset/every-rocks-see.md | 5 ----- .changeset/few-points-switch.md | 5 ----- .changeset/heavy-loops-hunt.md | 5 ----- .changeset/sad-showers-pay.md | 5 ----- .changeset/seven-boats-teach.md | 5 ----- .changeset/slimy-bees-play.md | 5 ----- .changeset/sweet-wasps-deny.md | 5 ----- packages/codegen/CHANGELOG.md | 9 +++++++++ packages/codegen/package.json | 2 +- packages/create-dapp/CHANGELOG.md | 10 ++++++++++ packages/create-dapp/package.json | 2 +- packages/dapp-kit/CHANGELOG.md | 15 +++++++++++++++ packages/dapp-kit/package.json | 2 +- packages/deepbook-v3/CHANGELOG.md | 12 ++++++++++++ packages/deepbook-v3/package.json | 2 +- packages/deepbook/CHANGELOG.md | 8 ++++++++ packages/deepbook/package.json | 2 +- packages/enoki-connect/CHANGELOG.md | 10 ++++++++++ packages/enoki-connect/package.json | 2 +- packages/enoki/CHANGELOG.md | 11 +++++++++++ packages/enoki/package.json | 2 +- packages/graphql-transport/CHANGELOG.md | 8 ++++++++ packages/graphql-transport/package.json | 2 +- packages/kiosk/CHANGELOG.md | 8 ++++++++ packages/kiosk/package.json | 2 +- packages/mvr-static/CHANGELOG.md | 8 ++++++++ packages/mvr-static/package.json | 2 +- packages/payment-kit/CHANGELOG.md | 9 +++++++++ packages/payment-kit/package.json | 2 +- packages/seal/CHANGELOG.md | 8 ++++++++ packages/seal/package.json | 2 +- packages/seal/src/version.ts | 2 +- packages/signers/CHANGELOG.md | 8 ++++++++ packages/signers/package.json | 2 +- packages/slush-wallet/CHANGELOG.md | 10 ++++++++++ packages/slush-wallet/package.json | 2 +- packages/sui-grpc/CHANGELOG.md | 12 ++++++++++++ packages/sui-grpc/package.json | 2 +- packages/suins/CHANGELOG.md | 8 ++++++++ packages/suins/package.json | 2 +- packages/typescript/CHANGELOG.md | 7 +++++++ packages/typescript/package.json | 2 +- packages/typescript/src/version.ts | 2 +- packages/wallet-standard/CHANGELOG.md | 12 ++++++++++++ packages/wallet-standard/package.json | 2 +- packages/walletconnect-wallet/CHANGELOG.md | 10 ++++++++++ packages/walletconnect-wallet/package.json | 2 +- packages/walrus/CHANGELOG.md | 8 ++++++++ packages/walrus/package.json | 2 +- packages/zksend/CHANGELOG.md | 10 ++++++++++ packages/zksend/package.json | 2 +- 51 files changed, 224 insertions(+), 58 deletions(-) delete mode 100644 .changeset/every-rocks-see.md delete mode 100644 .changeset/few-points-switch.md delete mode 100644 .changeset/heavy-loops-hunt.md delete mode 100644 .changeset/sad-showers-pay.md delete mode 100644 .changeset/seven-boats-teach.md delete mode 100644 .changeset/slimy-bees-play.md delete mode 100644 .changeset/sweet-wasps-deny.md create mode 100644 packages/payment-kit/CHANGELOG.md diff --git a/.changeset/every-rocks-see.md b/.changeset/every-rocks-see.md deleted file mode 100644 index 28ed3e33d..000000000 --- a/.changeset/every-rocks-see.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/wallet-standard': minor ---- - -Add sui:getSupportedIntents feature diff --git a/.changeset/few-points-switch.md b/.changeset/few-points-switch.md deleted file mode 100644 index 00f98b391..000000000 --- a/.changeset/few-points-switch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/deepbook-v3': minor ---- - -Margin package functionality diff --git a/.changeset/heavy-loops-hunt.md b/.changeset/heavy-loops-hunt.md deleted file mode 100644 index 90d6395f4..000000000 --- a/.changeset/heavy-loops-hunt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui-grpc': minor ---- - -Add balance methods and mvr support diff --git a/.changeset/sad-showers-pay.md b/.changeset/sad-showers-pay.md deleted file mode 100644 index 7d446ed53..000000000 --- a/.changeset/sad-showers-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/codegen': patch ---- - -Optional struct generation should be bcs.option instead of bcs.vector diff --git a/.changeset/seven-boats-teach.md b/.changeset/seven-boats-teach.md deleted file mode 100644 index 4c459d809..000000000 --- a/.changeset/seven-boats-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui': minor ---- - -Add mvr support to more core API methods diff --git a/.changeset/slimy-bees-play.md b/.changeset/slimy-bees-play.md deleted file mode 100644 index 55976c798..000000000 --- a/.changeset/slimy-bees-play.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/dapp-kit': minor ---- - -Add support for sui:getSupportedIntents diff --git a/.changeset/sweet-wasps-deny.md b/.changeset/sweet-wasps-deny.md deleted file mode 100644 index bcbcde8b0..000000000 --- a/.changeset/sweet-wasps-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mysten/sui': minor ---- - -Update graphql schema and add getMoveFunction to core client API diff --git a/packages/codegen/CHANGELOG.md b/packages/codegen/CHANGELOG.md index 1f844a4ce..0efbae64c 100644 --- a/packages/codegen/CHANGELOG.md +++ b/packages/codegen/CHANGELOG.md @@ -1,5 +1,14 @@ # @mysten/codegen +## 0.5.1 + +### Patch Changes + +- 24e6b36: Optional struct generation should be bcs.option instead of bcs.vector +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.5.0 ### Minor Changes diff --git a/packages/codegen/package.json b/packages/codegen/package.json index e43e2f26a..4b2f7ea3c 100644 --- a/packages/codegen/package.json +++ b/packages/codegen/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/codegen", - "version": "0.5.0", + "version": "0.5.1", "description": "typescript codegen for sui move", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/create-dapp/CHANGELOG.md b/packages/create-dapp/CHANGELOG.md index fc5e09bcd..c8f63419f 100644 --- a/packages/create-dapp/CHANGELOG.md +++ b/packages/create-dapp/CHANGELOG.md @@ -1,5 +1,15 @@ # @mysten/create-dapp +## 0.5.1 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [566b9ae] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + - @mysten/dapp-kit@0.19.0 + ## 0.5.0 ### Minor Changes diff --git a/packages/create-dapp/package.json b/packages/create-dapp/package.json index 7d691cab1..70ff0d182 100644 --- a/packages/create-dapp/package.json +++ b/packages/create-dapp/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "A CLI for creating new Sui dApps", "homepage": "https://sdk.mystenlabs.com", - "version": "0.5.0", + "version": "0.5.1", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/packages/dapp-kit/CHANGELOG.md b/packages/dapp-kit/CHANGELOG.md index ceed90d77..457bacdf7 100644 --- a/packages/dapp-kit/CHANGELOG.md +++ b/packages/dapp-kit/CHANGELOG.md @@ -1,5 +1,20 @@ # @mysten/dapp-kit +## 0.19.0 + +### Minor Changes + +- 566b9ae: Add support for sui:getSupportedIntents + +### Patch Changes + +- Updated dependencies [566b9ae] +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/wallet-standard@0.18.0 + - @mysten/sui@1.39.0 + - @mysten/slush-wallet@0.2.1 + ## 0.18.0 ### Minor Changes diff --git a/packages/dapp-kit/package.json b/packages/dapp-kit/package.json index c67c4cff6..c989bd715 100644 --- a/packages/dapp-kit/package.json +++ b/packages/dapp-kit/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "A collection of React hooks and components for interacting with the Sui blockchain and wallets.", "homepage": "https://sdk.mystenlabs.com/typescript", - "version": "0.18.0", + "version": "0.19.0", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/packages/deepbook-v3/CHANGELOG.md b/packages/deepbook-v3/CHANGELOG.md index 18136c53f..4b0d66907 100644 --- a/packages/deepbook-v3/CHANGELOG.md +++ b/packages/deepbook-v3/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/deepbook-v3 +## 0.19.0 + +### Minor Changes + +- fd91249: Margin package functionality + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.18.0 ### Minor Changes diff --git a/packages/deepbook-v3/package.json b/packages/deepbook-v3/package.json index 9114d4444..083d4b6e0 100644 --- a/packages/deepbook-v3/package.json +++ b/packages/deepbook-v3/package.json @@ -2,7 +2,7 @@ "name": "@mysten/deepbook-v3", "author": "Mysten Labs ", "description": "Sui Deepbook SDK", - "version": "0.18.0", + "version": "0.19.0", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/packages/deepbook/CHANGELOG.md b/packages/deepbook/CHANGELOG.md index 533e775c9..db578d4a3 100644 --- a/packages/deepbook/CHANGELOG.md +++ b/packages/deepbook/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/deepbook +## 0.9.1 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.9.0 ### Minor Changes diff --git a/packages/deepbook/package.json b/packages/deepbook/package.json index f7bcd53b9..ac90bd5f4 100644 --- a/packages/deepbook/package.json +++ b/packages/deepbook/package.json @@ -2,7 +2,7 @@ "name": "@mysten/deepbook", "author": "Mysten Labs ", "description": "Sui Deepbook SDK", - "version": "0.9.0", + "version": "0.9.1", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/packages/enoki-connect/CHANGELOG.md b/packages/enoki-connect/CHANGELOG.md index 07fbc20da..22cd8cc70 100644 --- a/packages/enoki-connect/CHANGELOG.md +++ b/packages/enoki-connect/CHANGELOG.md @@ -1,5 +1,15 @@ # @mysten/enoki-connect +## 0.1.1 + +### Patch Changes + +- Updated dependencies [566b9ae] +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/wallet-standard@0.18.0 + - @mysten/sui@1.39.0 + ## 0.1.0 ### Minor Changes diff --git a/packages/enoki-connect/package.json b/packages/enoki-connect/package.json index 9e751d915..2aa2ef4ca 100644 --- a/packages/enoki-connect/package.json +++ b/packages/enoki-connect/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/enoki-connect", - "version": "0.1.0", + "version": "0.1.1", "description": "Enoki Connect Wallet-Standard implementation", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/enoki/CHANGELOG.md b/packages/enoki/CHANGELOG.md index c7552ea54..a836d1575 100644 --- a/packages/enoki/CHANGELOG.md +++ b/packages/enoki/CHANGELOG.md @@ -1,5 +1,16 @@ # @mysten/enoki +## 0.12.2 + +### Patch Changes + +- Updated dependencies [566b9ae] +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/wallet-standard@0.18.0 + - @mysten/sui@1.39.0 + - @mysten/signers@0.5.1 + ## 0.12.1 ### Patch Changes diff --git a/packages/enoki/package.json b/packages/enoki/package.json index 73dd50d7f..a9cdae2b8 100644 --- a/packages/enoki/package.json +++ b/packages/enoki/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/enoki", - "version": "0.12.1", + "version": "0.12.2", "description": "TODO: Description", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/graphql-transport/CHANGELOG.md b/packages/graphql-transport/CHANGELOG.md index 0a9f4d675..4f1acbbe5 100644 --- a/packages/graphql-transport/CHANGELOG.md +++ b/packages/graphql-transport/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/graphql-transport +## 0.4.1 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.4.0 ### Minor Changes diff --git a/packages/graphql-transport/package.json b/packages/graphql-transport/package.json index 0db59c93c..2b3e412f4 100644 --- a/packages/graphql-transport/package.json +++ b/packages/graphql-transport/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/graphql-transport", - "version": "0.4.0", + "version": "0.4.1", "description": "A GraphQL transport to allow SuiClient to work with RPC 2.0", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/kiosk/CHANGELOG.md b/packages/kiosk/CHANGELOG.md index 58584cc55..f885fa9d6 100644 --- a/packages/kiosk/CHANGELOG.md +++ b/packages/kiosk/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/kiosk +## 0.13.2 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.13.1 ### Patch Changes diff --git a/packages/kiosk/package.json b/packages/kiosk/package.json index 7e6b2a270..7a4a40055 100644 --- a/packages/kiosk/package.json +++ b/packages/kiosk/package.json @@ -2,7 +2,7 @@ "name": "@mysten/kiosk", "author": "Mysten Labs ", "description": "Sui Kiosk library", - "version": "0.13.1", + "version": "0.13.2", "license": "Apache-2.0", "type": "commonjs", "main": "./dist/cjs/index.js", diff --git a/packages/mvr-static/CHANGELOG.md b/packages/mvr-static/CHANGELOG.md index 60c67b1d9..d45ea5786 100644 --- a/packages/mvr-static/CHANGELOG.md +++ b/packages/mvr-static/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/mvr-static +## 0.2.1 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.2.0 ### Minor Changes diff --git a/packages/mvr-static/package.json b/packages/mvr-static/package.json index 000e285b3..1663742d2 100644 --- a/packages/mvr-static/package.json +++ b/packages/mvr-static/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "The static generation tool for Move Registry (mvr)", "homepage": "https://sdk.mystenlabs.com", - "version": "0.2.0", + "version": "0.2.1", "license": "Apache-2.0", "files": [ "CHANGELOG.md", diff --git a/packages/payment-kit/CHANGELOG.md b/packages/payment-kit/CHANGELOG.md new file mode 100644 index 000000000..b7e9311b1 --- /dev/null +++ b/packages/payment-kit/CHANGELOG.md @@ -0,0 +1,9 @@ +# @mysten/payment-kit + +## 0.0.2 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 diff --git a/packages/payment-kit/package.json b/packages/payment-kit/package.json index 4151d5776..b00e22519 100644 --- a/packages/payment-kit/package.json +++ b/packages/payment-kit/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/payment-kit", - "version": "0.0.1", + "version": "0.0.2", "private": false, "description": "Sui Payment Kit", "license": "Apache-2.0", diff --git a/packages/seal/CHANGELOG.md b/packages/seal/CHANGELOG.md index 1d63a7188..148c38077 100644 --- a/packages/seal/CHANGELOG.md +++ b/packages/seal/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/seal +## 0.8.2 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.8.1 ### Patch Changes diff --git a/packages/seal/package.json b/packages/seal/package.json index 0e05f80f7..e137fd311 100644 --- a/packages/seal/package.json +++ b/packages/seal/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/seal", - "version": "0.8.1", + "version": "0.8.2", "description": "Seal SDK", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/seal/src/version.ts b/packages/seal/src/version.ts index 51ed354af..3ae42ff6b 100644 --- a/packages/seal/src/version.ts +++ b/packages/seal/src/version.ts @@ -3,4 +3,4 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '0.8.1'; +export const PACKAGE_VERSION = '0.8.2'; diff --git a/packages/signers/CHANGELOG.md b/packages/signers/CHANGELOG.md index 729775283..338c5e331 100644 --- a/packages/signers/CHANGELOG.md +++ b/packages/signers/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/signers +## 0.5.1 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.5.0 ### Minor Changes diff --git a/packages/signers/package.json b/packages/signers/package.json index 78582c4e4..d887ce378 100644 --- a/packages/signers/package.json +++ b/packages/signers/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/signers", - "version": "0.5.0", + "version": "0.5.1", "description": "A collection of signers for various providers", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/slush-wallet/CHANGELOG.md b/packages/slush-wallet/CHANGELOG.md index cd72654c7..f900791b3 100644 --- a/packages/slush-wallet/CHANGELOG.md +++ b/packages/slush-wallet/CHANGELOG.md @@ -1,5 +1,15 @@ # @mysten/slush-wallet +## 0.2.1 + +### Patch Changes + +- Updated dependencies [566b9ae] +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/wallet-standard@0.18.0 + - @mysten/sui@1.39.0 + ## 0.2.0 ### Minor Changes diff --git a/packages/slush-wallet/package.json b/packages/slush-wallet/package.json index eff1af7b7..9a9f2c897 100644 --- a/packages/slush-wallet/package.json +++ b/packages/slush-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/slush-wallet", - "version": "0.2.0", + "version": "0.2.1", "description": "Wallet adapter for Slush web wallet", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/sui-grpc/CHANGELOG.md b/packages/sui-grpc/CHANGELOG.md index 8f863dcf2..77aa11793 100644 --- a/packages/sui-grpc/CHANGELOG.md +++ b/packages/sui-grpc/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/sui-grpc +## 0.2.0 + +### Minor Changes + +- ca92487: Add balance methods and mvr support + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.1.0 ### Minor Changes diff --git a/packages/sui-grpc/package.json b/packages/sui-grpc/package.json index ac8cadc86..8386908d7 100644 --- a/packages/sui-grpc/package.json +++ b/packages/sui-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/sui-grpc", - "version": "0.1.0", + "version": "0.2.0", "description": "A typescript GRPC client for sui", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/suins/CHANGELOG.md b/packages/suins/CHANGELOG.md index e39e4490a..3592a160d 100644 --- a/packages/suins/CHANGELOG.md +++ b/packages/suins/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/suins +## 0.9.1 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.9.0 ### Minor Changes diff --git a/packages/suins/package.json b/packages/suins/package.json index 426e31973..73d268fdf 100644 --- a/packages/suins/package.json +++ b/packages/suins/package.json @@ -2,7 +2,7 @@ "name": "@mysten/suins", "author": "Mysten Labs ", "description": "SuiNS SDK", - "version": "0.9.0", + "version": "0.9.1", "license": "Apache-2.0", "private": false, "type": "commonjs", diff --git a/packages/typescript/CHANGELOG.md b/packages/typescript/CHANGELOG.md index 42bf9e669..8c1bcd882 100644 --- a/packages/typescript/CHANGELOG.md +++ b/packages/typescript/CHANGELOG.md @@ -1,5 +1,12 @@ # @mysten/sui.js +## 1.39.0 + +### Minor Changes + +- ca92487: Add mvr support to more core API methods +- 5ab3c0a: Update graphql schema and add getMoveFunction to core client API + ## 1.38.0 ### Minor Changes diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 9a91dadbb..94915da86 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -3,7 +3,7 @@ "author": "Mysten Labs ", "description": "Sui TypeScript API", "homepage": "https://sdk.mystenlabs.com", - "version": "1.38.0", + "version": "1.39.0", "license": "Apache-2.0", "sideEffects": false, "files": [ diff --git a/packages/typescript/src/version.ts b/packages/typescript/src/version.ts index e8e0596c2..234d5f5e2 100644 --- a/packages/typescript/src/version.ts +++ b/packages/typescript/src/version.ts @@ -3,5 +3,5 @@ // This file is generated by genversion.mjs. Do not edit it directly. -export const PACKAGE_VERSION = '1.38.0'; +export const PACKAGE_VERSION = '1.39.0'; export const TARGETED_RPC_VERSION = '1.58.0'; diff --git a/packages/wallet-standard/CHANGELOG.md b/packages/wallet-standard/CHANGELOG.md index 975832a16..39584b522 100644 --- a/packages/wallet-standard/CHANGELOG.md +++ b/packages/wallet-standard/CHANGELOG.md @@ -1,5 +1,17 @@ # @mysten/wallet-standard +## 0.18.0 + +### Minor Changes + +- 566b9ae: Add sui:getSupportedIntents feature + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.17.0 ### Minor Changes diff --git a/packages/wallet-standard/package.json b/packages/wallet-standard/package.json index 0d8b8241b..767fc781e 100644 --- a/packages/wallet-standard/package.json +++ b/packages/wallet-standard/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/wallet-standard", - "version": "0.17.0", + "version": "0.18.0", "description": "A suite of standard utilities for implementing wallets based on the Wallet Standard.", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/walletconnect-wallet/CHANGELOG.md b/packages/walletconnect-wallet/CHANGELOG.md index 57145e168..16abba5f6 100644 --- a/packages/walletconnect-wallet/CHANGELOG.md +++ b/packages/walletconnect-wallet/CHANGELOG.md @@ -1,5 +1,15 @@ # @mysten/walletconnect-wallet +## 0.1.1 + +### Patch Changes + +- Updated dependencies [566b9ae] +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/wallet-standard@0.18.0 + - @mysten/sui@1.39.0 + ## 0.1.0 ### Minor Changes diff --git a/packages/walletconnect-wallet/package.json b/packages/walletconnect-wallet/package.json index cb77a6437..c17e2f252 100644 --- a/packages/walletconnect-wallet/package.json +++ b/packages/walletconnect-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/walletconnect-wallet", - "version": "0.1.0", + "version": "0.1.1", "description": "Wallet adapter for WalletConnect on Sui", "license": "Apache-2.0", "author": "Mysten Labs ", diff --git a/packages/walrus/CHANGELOG.md b/packages/walrus/CHANGELOG.md index 26c01b1bc..6aaefd094 100644 --- a/packages/walrus/CHANGELOG.md +++ b/packages/walrus/CHANGELOG.md @@ -1,5 +1,13 @@ # @mysten/walrus +## 0.7.1 + +### Patch Changes + +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/sui@1.39.0 + ## 0.7.0 ### Minor Changes diff --git a/packages/walrus/package.json b/packages/walrus/package.json index a730497d6..3c9cae20e 100644 --- a/packages/walrus/package.json +++ b/packages/walrus/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/walrus", - "version": "0.7.0", + "version": "0.7.1", "private": false, "description": "Walrus SDK", "license": "Apache-2.0", diff --git a/packages/zksend/CHANGELOG.md b/packages/zksend/CHANGELOG.md index d27a3bb23..9a6be2c1f 100644 --- a/packages/zksend/CHANGELOG.md +++ b/packages/zksend/CHANGELOG.md @@ -1,5 +1,15 @@ # @mysten/zksend +## 0.14.1 + +### Patch Changes + +- Updated dependencies [566b9ae] +- Updated dependencies [ca92487] +- Updated dependencies [5ab3c0a] + - @mysten/wallet-standard@0.18.0 + - @mysten/sui@1.39.0 + ## 0.14.0 ### Minor Changes diff --git a/packages/zksend/package.json b/packages/zksend/package.json index fbea549b5..d1ca31e9b 100644 --- a/packages/zksend/package.json +++ b/packages/zksend/package.json @@ -1,6 +1,6 @@ { "name": "@mysten/zksend", - "version": "0.14.0", + "version": "0.14.1", "description": "TODO: Write Description", "license": "Apache-2.0", "author": "Mysten Labs ", From b992f2d70b2465ab836775cb53f89349e4c825dd Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:36:49 -0700 Subject: [PATCH 30/36] transaction analyzer (#559) * Add transaction analyzer * add transaction analyzer tests * Add transaction analyzer * update some tests * fix balances lookup * fix coinflows merge logic * make package private * analyzer fixes * update analyzer API * hande dep issues before running analysis * update tests --------- Co-authored-by: Michael Hayes --- packages/wallet-sdk/.prettierignore | 2 + packages/wallet-sdk/README.md | 1 + packages/wallet-sdk/package.json | 60 +++ .../src/transaction-analyzer/analyzer.ts | 169 ++++++ .../src/transaction-analyzer/index.ts | 4 + .../transaction-analyzer/rules/accessLevel.ts | 98 ++++ .../transaction-analyzer/rules/coin-flows.ts | 203 ++++++++ .../transaction-analyzer/rules/coin-value.ts | 75 +++ .../src/transaction-analyzer/rules/coins.ts | 72 +++ .../transaction-analyzer/rules/commands.ts | 216 ++++++++ .../src/transaction-analyzer/rules/core.ts | 66 +++ .../transaction-analyzer/rules/functions.ts | 48 ++ .../src/transaction-analyzer/rules/inputs.ts | 52 ++ .../src/transaction-analyzer/rules/objects.ts | 132 +++++ .../wallet-sdk/test/mocks/MockSuiClient.ts | 492 ++++++++++++++++++ packages/wallet-sdk/test/mocks/mockData.ts | 461 ++++++++++++++++ .../transaction-analyzer/coin-flows.test.ts | 442 ++++++++++++++++ .../transaction-analyzer/coin-value.test.ts | 309 +++++++++++ .../test/transaction-analyzer/coins.test.ts | 174 +++++++ .../transaction-analyzer/commands.test.ts | 274 ++++++++++ .../transaction-analyzer/functions.test.ts | 272 ++++++++++ .../test/transaction-analyzer/inputs.test.ts | 233 +++++++++ .../test/transaction-analyzer/objects.test.ts | 250 +++++++++ packages/wallet-sdk/test/tsconfig.json | 9 + packages/wallet-sdk/tsconfig.esm.json | 7 + packages/wallet-sdk/tsconfig.json | 10 + packages/wallet-sdk/typedoc.json | 6 + packages/wallet-sdk/vitest.config.mts | 6 + pnpm-lock.yaml | 38 +- 29 files changed, 4177 insertions(+), 4 deletions(-) create mode 100644 packages/wallet-sdk/.prettierignore create mode 100644 packages/wallet-sdk/README.md create mode 100644 packages/wallet-sdk/package.json create mode 100644 packages/wallet-sdk/src/transaction-analyzer/analyzer.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/index.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/accessLevel.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/coin-flows.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/coins.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/commands.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/core.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/functions.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/inputs.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/objects.ts create mode 100644 packages/wallet-sdk/test/mocks/MockSuiClient.ts create mode 100644 packages/wallet-sdk/test/mocks/mockData.ts create mode 100644 packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts create mode 100644 packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts create mode 100644 packages/wallet-sdk/test/transaction-analyzer/coins.test.ts create mode 100644 packages/wallet-sdk/test/transaction-analyzer/commands.test.ts create mode 100644 packages/wallet-sdk/test/transaction-analyzer/functions.test.ts create mode 100644 packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts create mode 100644 packages/wallet-sdk/test/transaction-analyzer/objects.test.ts create mode 100644 packages/wallet-sdk/test/tsconfig.json create mode 100644 packages/wallet-sdk/tsconfig.esm.json create mode 100644 packages/wallet-sdk/tsconfig.json create mode 100644 packages/wallet-sdk/typedoc.json create mode 100644 packages/wallet-sdk/vitest.config.mts diff --git a/packages/wallet-sdk/.prettierignore b/packages/wallet-sdk/.prettierignore new file mode 100644 index 000000000..a3414d0fd --- /dev/null +++ b/packages/wallet-sdk/.prettierignore @@ -0,0 +1,2 @@ +dist +CHANGELOG.md diff --git a/packages/wallet-sdk/README.md b/packages/wallet-sdk/README.md new file mode 100644 index 000000000..2412da0a7 --- /dev/null +++ b/packages/wallet-sdk/README.md @@ -0,0 +1 @@ +# `@mysten/wallet-sdk` diff --git a/packages/wallet-sdk/package.json b/packages/wallet-sdk/package.json new file mode 100644 index 000000000..7b1ce84b2 --- /dev/null +++ b/packages/wallet-sdk/package.json @@ -0,0 +1,60 @@ +{ + "name": "@mysten/wallet-sdk", + "version": "0.0.0", + "private": true, + "description": "Utilities for building Sui wallets", + "license": "Apache-2.0", + "author": "Mysten Labs ", + "type": "commonjs", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/cjs/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + } + }, + "sideEffects": false, + "files": [ + "CHANGELOG.md", + "dist" + ], + "scripts": { + "clean": "rm -rf tsconfig.tsbuildinfo ./dist", + "build": "build-package", + "vitest": "vitest", + "test": "pnpm test:typecheck && pnpm test:unit", + "test:typecheck": "tsc -p ./test", + "test:unit": "vitest run", + "prepublishOnly": "pnpm turbo build", + "prettier:check": "prettier -c --ignore-unknown .", + "prettier:fix": "prettier -w --ignore-unknown .", + "eslint:check": "eslint --max-warnings=0 .", + "eslint:fix": "pnpm run eslint:check --fix", + "lint": "pnpm run eslint:check && pnpm run prettier:check", + "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mystenlabs/ts-sdks.git" + }, + "bugs": { + "url": "https://github.com/mystenlabs/ts-sdks/issues" + }, + "homepage": "https://github.com/MystenLabs/ts-sdks/packages/wallet-sdk#readme", + "devDependencies": { + "@mysten/build-scripts": "workspace:*", + "@types/node": "^22.15.29", + "msw": "^2.11.1", + "typescript": "^5.9.2", + "vitest": "^3.2.4" + }, + "dependencies": { + "@mysten/bcs": "workspace:*", + "@mysten/dapp-kit-react": "workspace:*", + "@mysten/sui": "workspace:*", + "@mysten/wallet-standard": "workspace:*", + "valibot": "^0.36.0" + } +} diff --git a/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts b/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts new file mode 100644 index 000000000..d6994a9f2 --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts @@ -0,0 +1,169 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +/* eslint-disable @typescript-eslint/ban-types */ + +import { Transaction } from '@mysten/sui/transactions'; + +export function createAnalyzer< + T extends Defined, + Deps extends Record> = {}, + Options = object, +>({ + cacheKey, + dependencies, + analyze, +}: { + cacheKey?: unknown; + dependencies?: Deps; + analyze: ( + options: Options, + transaction: Transaction, + ) => (analysis: { + [k in keyof Deps]: Deps[k] extends Analyzer ? R : never; + }) => Promise> | AnalyzerResult; +}) { + return { + cacheKey, + dependencies, + analyze: analyze, + } as Analyzer< + T, + Simplify< + UnionToIntersection< + | Options + | { + [k in keyof Deps]: Deps[k] extends Analyzer ? O : never; + }[keyof Deps] + > + >, + { + [k in keyof Deps]: Deps[k] extends Analyzer ? R : never; + } + >; +} + +type OptionsFromAnalyzers>> = Simplify< + { + [K in keyof T]: T[K] extends Analyzer ? O : never; + }[keyof T] & { + transactionJson: string; + } +>; + +export async function analyze>>( + analyzers: T, + { transactionJson, ...options }: OptionsFromAnalyzers, +) { + const transaction = Transaction.from(transactionJson); + const analyzerMap = new Map< + unknown, + (analysis: object) => AnalyzerResult | Promise + >(); + + function initializeAnalyzer(analyzer: Analyzer) { + const cacheKey = analyzer.cacheKey ?? analyzer; + + if (!analyzerMap.has(cacheKey)) { + const deps: Record> = analyzer.dependencies || {}; + analyzerMap.set(cacheKey, analyzer.analyze(options, transaction)); + + Object.values(deps).forEach((dep) => initializeAnalyzer(dep)); + } + + return analyzerMap.get(cacheKey)!; + } + + Object.values(analyzers).forEach((analyzer) => initializeAnalyzer(analyzer)); + + const analysisMap = new Map>(); + + async function runAnalyzer(analyzer: Analyzer): Promise { + const deps: Record = Object.fromEntries( + await Promise.all( + Object.entries((analyzer.dependencies || {}) as Record>).map( + async ([key, dep]) => [key, await getAnalysis(dep)], + ), + ), + ); + + const issues = new Set(); + + for (const dep of Object.values(deps)) { + if (dep.issues) { + dep.issues.forEach((issue) => issues.add(issue)); + } + } + + if (issues.size) { + return { issues: [...issues] }; + } + + try { + const result = await analyzerMap.get(analyzer.cacheKey ?? analyzer)!( + Object.fromEntries(Object.entries(deps).map(([key, dep]) => [key, dep.result])), + ); + + return result; + } catch (error) { + return { + issues: [ + { message: `Unexpected error while analyzing transaction: ${(error as Error).message}` }, + ], + }; + } + } + + function getAnalysis(analyzer: Analyzer): Promise { + const cacheKey = analyzer.cacheKey ?? analyzer; + + if (!analysisMap.has(cacheKey)) { + analysisMap.set(cacheKey, runAnalyzer(analyzer)); + } + + return analysisMap.get(cacheKey)!; + } + + return Object.fromEntries( + await Promise.all( + Object.entries(analyzers).map(async ([key, analyzer]) => [key, await getAnalysis(analyzer)]), + ), + ) as { + [k in keyof T]: T[k] extends Analyzer ? AnalyzerResult : never; + }; +} + +type Defined = {} | null; +type Simplify = { [K in keyof T]: T[K] } & {}; +type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void + ? I + : never; + +type Analyzer< + T extends Defined, + Options = object, + Analysis extends Record = {}, +> = { + cacheKey?: unknown; + dependencies: { + [k in keyof Analysis]: Analyzer; + }; + analyze: ( + options: Options, + transaction: Transaction, + ) => (analysis: Analysis) => AnalyzerResult | Promise>; +}; + +export type AnalyzerResult = + | { + result: T; + issues?: never; + } + | { + issues: TransactionAnalysisIssue[]; + result?: never; + }; + +export interface TransactionAnalysisIssue { + message: string; + error?: Error; +} diff --git a/packages/wallet-sdk/src/transaction-analyzer/index.ts b/packages/wallet-sdk/src/transaction-analyzer/index.ts new file mode 100644 index 000000000..070e35eed --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/index.ts @@ -0,0 +1,4 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +// TODO: figure out exports diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/accessLevel.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/accessLevel.ts new file mode 100644 index 000000000..2b8a366aa --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/accessLevel.ts @@ -0,0 +1,98 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { TransactionAnalysisIssue } from '../analyzer.js'; +import { createAnalyzer } from '../analyzer.js'; +import { gasCoins } from './coins.js'; +import type { AnalyzedCommandArgument } from './commands.js'; +import { commands } from './commands.js'; +import { objects } from './objects.js'; + +export const accessLevel = createAnalyzer({ + dependencies: { commands, objects, gasCoins }, + analyze: + () => + async ({ commands, objects, gasCoins }) => { + const issues: TransactionAnalysisIssue[] = []; + + const gasCoinIds = new Set(gasCoins.map((g) => g.id)); + + const accessLevels: Record = Object.fromEntries( + objects.map((obj) => [obj.id, 'read' as const]), + ); + + for (const id of gasCoinIds) { + accessLevels[id] = 'mutate'; + } + + for (const command of commands) { + switch (command.$kind) { + case 'TransferObjects': + for (const obj of command.objects) { + updateFromArgument(obj); + } + break; + case 'MoveCall': + for (const arg of command.arguments) { + updateFromArgument(arg); + } + break; + case 'SplitCoins': + updateFromArgument(command.coin); + break; + case 'MergeCoins': + updateFromArgument(command.destination); + for (const src of command.sources) { + updateFromArgument(src); + } + break; + case 'MakeMoveVec': + for (const el of command.elements) { + updateFromArgument(el); + } + break; + case 'Upgrade': + updateFromArgument(command.ticket); + break; + case 'Publish': + break; + default: + issues.push({ message: `Unknown command type: ${JSON.stringify(command)}` }); + } + } + + if (issues.length) { + return { issues }; + } + + return { + result: accessLevels, + }; + + function updateFromArgument(arg: AnalyzedCommandArgument) { + switch (arg.$kind) { + case 'GasCoin': + for (const id of gasCoinIds) { + updateAccessLevel(id, arg.accessLevel); + } + break; + case 'Object': + updateAccessLevel(arg.object.id, arg.accessLevel); + break; + } + } + + function updateAccessLevel(id: string, level: 'read' | 'mutate' | 'transfer') { + const current = accessLevels[id]; + if (current === 'transfer') { + return; + } else if (current === 'mutate') { + if (level === 'transfer') { + accessLevels[id] = 'transfer'; + } + } else { + accessLevels[id] = level; + } + } + }, +}); diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/coin-flows.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/coin-flows.ts new file mode 100644 index 000000000..c55bba4ba --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/coin-flows.ts @@ -0,0 +1,203 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { normalizeStructTag } from '@mysten/sui/utils'; +import type { TransactionAnalysisIssue } from '../analyzer.js'; +import { createAnalyzer } from '../analyzer.js'; +import { bcs } from '@mysten/sui/bcs'; +import { commands } from './commands.js'; +import type { AnalyzedCommand, AnalyzedCommandArgument } from './commands.js'; +import { data } from './core.js'; +import { inputs } from './inputs.js'; +import { coins, gasCoins } from './coins.js'; + +export interface CoinFlow { + coinType: string; + amount: bigint; +} + +export const coinFlows = createAnalyzer({ + dependencies: { data, commands, inputs, coins, gasCoins }, + analyze: + () => + async ({ data, commands, inputs, coins, gasCoins }) => { + const getTrackedCoin = (ref: AnalyzedCommandArgument): TrackedCoin | null => { + switch (ref.$kind) { + case 'GasCoin': + return trackedCoins.get('gas') ?? null; + case 'Object': + return trackedCoins.get(`input:${ref.index}`) ?? null; + case 'Result': + return trackedCoins.get(`result:${ref.index[0]},${ref.index[1]}`) ?? null; + case 'Unknown': + case 'Pure': + return null; + } + }; + + const splitCoin = (command: Extract) => { + const coin = getTrackedCoin(command.coin); + + if (!coin) { + return; + } + // If any amounts are dynamic we need to assume the coin is fully consumed + if (!command.amounts.every((a) => a.$kind === 'Pure')) { + coin.consume(); + return; + } + + const amounts = command.amounts.map((a) => { + if (a.$kind !== 'Pure') { + throw new Error('Expected pure value'); + } + return BigInt(bcs.u64().fromBase64(a.bytes)); + }); + + coin.remainingBalance -= amounts.reduce((a, b) => a + b, 0n); + + amounts.forEach((amount, i) => { + trackedCoins.set( + `result:${command.index},${i}`, + new TrackedCoin(coin.coinType, amount, false), + ); + }); + }; + + const mergeCoins = (command: Extract) => { + const sources = command.sources.map(getTrackedCoin); + const amount = sources.reduce((a, c) => a + (c?.remainingBalance ?? 0n), 0n); + + for (const src of sources) { + src?.consume(); + } + + const dest = getTrackedCoin(command.destination); + + if (!dest) { + return; + } + + dest.remainingBalance += amount; + }; + + const transferObjects = (command: Extract) => { + const address = + command.address.$kind === 'Pure' ? bcs.Address.fromBase64(command.address.bytes) : null; + + for (const obj of command.objects) { + const tracked = getTrackedCoin(obj); + + // If coin is transferred to the sender, we can track the transfer in the gas coin + if (tracked && address && data.sender === address) { + trackedCoins.get('gas')!.remainingBalance += tracked.remainingBalance; + } + + tracked?.consume(); + } + }; + + const issues: TransactionAnalysisIssue[] = []; + + const trackedCoins = new Map(); + + trackedCoins.set( + 'gas', + new TrackedCoin( + normalizeStructTag('0x2::sui::SUI'), + gasCoins.reduce((a, c) => a + c.balance, 0n), + true, + ), + ); + + if (data.gasData.budget) { + trackedCoins.get('gas')!.remainingBalance -= BigInt(data.gasData.budget); + } else { + issues.push({ message: 'Gas budget not set in Transaction' }); + } + + for (const input of inputs) { + if (input.$kind === 'Object' && coins[input.object.id]) { + const coin = coins[input.object.id]; + trackedCoins.set( + `input:${input.index}`, + new TrackedCoin(coin.coinType, coin.balance, true), + ); + } + } + + for (const command of commands) { + switch (command.$kind) { + case 'SplitCoins': + splitCoin(command); + break; + case 'MergeCoins': + mergeCoins(command); + break; + case 'TransferObjects': + transferObjects(command); + break; + case 'MakeMoveVec': + command.elements.forEach((el) => { + const tracked = getTrackedCoin(el); + tracked?.consume(); + }); + break; + case 'MoveCall': + command.arguments.forEach((arg) => { + const tracked = getTrackedCoin(arg); + tracked?.consume(); + }); + break; + case 'Upgrade': + case 'Publish': + break; + default: + throw new Error(`Unsupported command type: ${command.$kind}`); + } + } + + const outflows: Record = {}; + + for (const coin of trackedCoins.values()) { + if (!coin.owned) { + continue; + } + if (!outflows[coin.coinType]) { + outflows[coin.coinType] = { coinType: coin.coinType, amount: 0n }; + } + + outflows[coin.coinType].amount += coin.initialBalance - coin.remainingBalance; + } + + if (issues.length) { + return { issues }; + } + + return { + result: { + outflows: Object.values(outflows), + }, + }; + }, +}); + +class TrackedCoin { + coinType: string; + initialBalance: bigint; + remainingBalance: bigint; + owned: boolean; + consumed = false; + + constructor(coinType: string, balance: bigint, owned: boolean) { + this.coinType = coinType; + this.initialBalance = balance; + this.remainingBalance = balance; + this.owned = owned; + } + + consume() { + this.remainingBalance = 0n; + this.consumed = true; + } +} diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts new file mode 100644 index 000000000..6eae922d1 --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts @@ -0,0 +1,75 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { createAnalyzer } from '../analyzer.js'; +import { coinFlows } from './coin-flows.js'; + +export interface CoinValueAnalyzerOptions { + getCoinPrices: (coinTypes: string[]) => Promise< + { + coinType: string; + decimals: number; + price: number | null; + }[] + >; +} + +export interface CoinValueAnalysis { + coinTypesWithoutPrice: string[]; + total: number; + coinTypes: { + coinType: string; + decimals: number; + price: number; + amount: bigint; + convertedAmount: number; + }[]; +} + +export const coinValue = createAnalyzer({ + dependencies: { coinFlows }, + analyze: + ({ getCoinPrices }: CoinValueAnalyzerOptions) => + async ({ coinFlows }) => { + const prices = await getCoinPrices(coinFlows.outflows.map((cf) => cf.coinType)); + + let total = 0; + const coinTypesWithoutPrice: string[] = []; + + const coinTypes: { + coinType: string; + decimals: number; + price: number; + amount: bigint; + convertedAmount: number; + }[] = []; + + for (const flow of coinFlows.outflows) { + if (flow.amount > 0n) { + const result = prices.find((p) => p.coinType === flow.coinType); + + if (result?.price != null) { + const amount = (Number(flow.amount) / 10 ** result.decimals) * result.price; + total += amount; + coinTypes.push({ + coinType: flow.coinType, + decimals: result.decimals, + price: result.price, + amount: flow.amount, + convertedAmount: amount, + }); + } else { + coinTypesWithoutPrice.push(flow.coinType); + } + } + } + + return { + result: { + total: total, + coinTypesWithoutPrice, + coinTypes: coinTypes, + }, + }; + }, +}); diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/coins.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/coins.ts new file mode 100644 index 000000000..661812d6c --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/coins.ts @@ -0,0 +1,72 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { bcs } from '@mysten/sui/bcs'; +import { objects, objectsById } from './objects.js'; +import type { AnalyzedObject } from './objects.js'; +import { createAnalyzer } from '../analyzer.js'; +import { normalizeStructTag, parseStructTag } from '@mysten/sui/utils'; +import { data } from './core.js'; + +export type AnalyzedCoin = AnalyzedObject & { balance: bigint; coinType: string }; + +export const Coin = bcs.struct('Coin', { + id: bcs.Address, + balance: bcs.U64, +}); +const parsedCoinStruct = parseStructTag('0x2::coin::Coin<0x2::sui::SUI>'); + +export const coins = createAnalyzer({ + dependencies: { objects }, + analyze: + () => + async ({ objects }) => { + return { + result: Object.fromEntries( + await Promise.all( + objects + .filter((obj) => { + const parsed = parseStructTag(obj.type); + return ( + parsed.address === parsedCoinStruct.address && + parsed.module === parsedCoinStruct.module && + parsed.name === parsedCoinStruct.name && + parsed.typeParams.length === 1 + ); + }) + .map(async (obj) => { + return [ + obj.id, + { + ...obj, + coinType: normalizeStructTag(parseStructTag(obj.type).typeParams[0]), + balance: BigInt(Coin.parse(await obj.content).balance), + }, + ]; + }), + ), + ), + }; + }, +}); + +export const gasCoins = createAnalyzer({ + dependencies: { objectsById, data }, + analyze: + () => + async ({ objectsById, data }) => { + return { + result: await Promise.all( + (data.gasData.payment ?? []).map(async (coin) => { + const obj = objectsById.get(coin.objectId)!; + const content = Coin.parse(await obj.content); + return { + ...obj, + coinType: normalizeStructTag(parseStructTag(obj.type).typeParams[0]), + balance: BigInt(content.balance), + }; + }), + ), + }; + }, +}); diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/commands.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/commands.ts new file mode 100644 index 000000000..a411be06c --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/commands.ts @@ -0,0 +1,216 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Argument, Command } from '@mysten/sui/transactions'; +import type { Experimental_SuiClientTypes } from '@mysten/sui/experimental'; +import { inputs } from './inputs.js'; +import type { AnalyzedCommandInput } from './inputs.js'; +import type { TransactionAnalysisIssue } from '../analyzer.js'; +import { createAnalyzer } from '../analyzer.js'; +import { data } from './core.js'; +import { moveFunctions } from './functions.js'; + +export type AnalyzedCommandArgument = + | AnalyzedCommandInput + | { + $kind: 'Unknown'; + accessLevel: 'read' | 'mutate' | 'transfer'; + } + | { + $kind: 'GasCoin'; + accessLevel: 'read' | 'mutate' | 'transfer'; + } + | { + $kind: 'Result'; + index: [number, number]; + accessLevel: 'read' | 'mutate' | 'transfer'; + }; + +export type AnalyzedCommand = + | { + $kind: 'MoveCall'; + index: number; + arguments: AnalyzedCommandArgument[]; + function: Experimental_SuiClientTypes.FunctionResponse; + command: Extract['MoveCall']; + } + | { + $kind: 'TransferObjects'; + index: number; + objects: AnalyzedCommandArgument[]; + address: AnalyzedCommandArgument; + command: Extract['TransferObjects']; + } + | { + $kind: 'MergeCoins'; + index: number; + sources: AnalyzedCommandArgument[]; + destination: AnalyzedCommandArgument; + command: Extract['MergeCoins']; + } + | { + $kind: 'SplitCoins'; + index: number; + coin: AnalyzedCommandArgument; + amounts: AnalyzedCommandArgument[]; + command: Extract['SplitCoins']; + } + | { + $kind: 'MakeMoveVec'; + index: number; + elements: AnalyzedCommandArgument[]; + command: Extract['MakeMoveVec']; + } + | { + $kind: 'Upgrade'; + index: number; + ticket: AnalyzedCommandArgument; + command: Extract['Upgrade']; + } + | { + $kind: 'Publish'; + index: number; + command: Extract['Publish']; + } + | { + $kind: 'Unknown'; + index: number; + command: Extract['Unknown']; + }; + +export const commands = createAnalyzer({ + dependencies: { + data, + moveFunctions, + inputs, + }, + analyze: + () => + ({ data, moveFunctions, inputs }) => { + const issues: TransactionAnalysisIssue[] = []; + const commands: AnalyzedCommand[] = []; + + const mapInput = ( + arg: Argument, + accessLevel: 'read' | 'mutate' | 'transfer' = 'transfer', + ): AnalyzedCommandArgument => { + switch (arg.$kind) { + case 'Input': + break; + case 'GasCoin': + return { $kind: 'GasCoin', accessLevel }; + case 'Result': + return { $kind: 'Result', index: [arg.Result, 0], accessLevel }; + case 'NestedResult': + return { $kind: 'Result', index: arg.NestedResult, accessLevel }; + default: + issues.push({ message: `Unexpected input type: ${JSON.stringify(arg)}` }); + return { $kind: 'Unknown', accessLevel }; + } + + const input = inputs[arg.Input]; + + if (!input) { + issues.push({ message: `Missing input for index ${arg.Input}` }); + return { $kind: 'Unknown', accessLevel }; + } + + return { ...input, accessLevel }; + }; + + for (let index = 0; index < data.commands.length; index++) { + const command = data.commands[index]; + switch (command.$kind) { + case '$Intent': + issues.push({ message: `Unexpected $Intent command: ${JSON.stringify(command)}` }); + break; + case 'MakeMoveVec': + commands.push({ + $kind: 'MakeMoveVec', + index, + elements: command.MakeMoveVec.elements.map((el) => mapInput(el)), + command: command.MakeMoveVec, + }); + break; + case 'TransferObjects': + commands.push({ + $kind: 'TransferObjects', + index, + address: mapInput(command.TransferObjects.address), + objects: command.TransferObjects.objects.map((obj) => mapInput(obj)), + command: command.TransferObjects, + }); + break; + case 'MergeCoins': + commands.push({ + $kind: 'MergeCoins', + index, + sources: command.MergeCoins.sources.map((src) => mapInput(src)), + destination: mapInput(command.MergeCoins.destination, 'mutate'), + command: command.MergeCoins, + }); + break; + case 'SplitCoins': + commands.push({ + $kind: 'SplitCoins', + index, + coin: mapInput(command.SplitCoins.coin, 'mutate'), + amounts: command.SplitCoins.amounts.map((amt) => mapInput(amt, 'transfer')), + command: command.SplitCoins, + }); + break; + case 'MoveCall': { + const func = moveFunctions.find( + (fn) => + fn.packageId === command.MoveCall.package && + fn.moduleName === command.MoveCall.module && + fn.name === command.MoveCall.function, + )!; + commands.push({ + $kind: 'MoveCall', + index, + arguments: command.MoveCall.arguments.map((arg, i) => { + let accessLevel: 'read' | 'mutate' | 'transfer' = 'transfer'; + switch (func.parameters[i].reference) { + case 'mutable': + accessLevel = 'mutate'; + break; + case 'immutable': + accessLevel = 'read'; + break; + } + + return mapInput(arg, accessLevel); + }), + command: command.MoveCall, + function: func, + }); + break; + } + case 'Publish': + commands.push({ + $kind: 'Publish', + index, + command: command.Publish, + }); + break; + case 'Upgrade': + commands.push({ + $kind: 'Upgrade', + index, + ticket: mapInput(command.Upgrade.ticket), + command: command.Upgrade, + }); + break; + default: + throw new Error('Unknown command type: ' + (command as { $kind: string }).$kind); + } + } + + if (issues.length) { + return { issues }; + } + + return { result: commands }; + }, +}); diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/core.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/core.ts new file mode 100644 index 000000000..4e37f3e2a --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/core.ts @@ -0,0 +1,66 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Transaction } from '@mysten/sui/transactions'; +import { TransactionDataBuilder } from '@mysten/sui/transactions'; +import type { ClientWithCoreApi, Experimental_SuiClientTypes } from '@mysten/sui/experimental'; +import type { AnalyzerResult } from '../analyzer.js'; +import { createAnalyzer } from '../analyzer.js'; + +export const bytes = createAnalyzer({ + cacheKey: 'bytes@1.0.0', + analyze: + (options: { client: ClientWithCoreApi }, transaction: Transaction) => + async (): Promise> => { + try { + return { + result: await transaction.build({ client: options.client }), + }; + } catch { + return { issues: [{ message: 'Failed to build transaction' }] }; + } + }, +}); + +export const data = createAnalyzer({ + dependencies: { bytes }, + analyze: (_, tx) => () => { + return { result: tx.getData() }; + }, +}); + +export const digest = createAnalyzer({ + dependencies: { bytes }, + analyze: + () => + ({ bytes }) => { + return { result: TransactionDataBuilder.getDigestFromBytes(bytes) }; + }, +}); + +export const dryRun = createAnalyzer({ + cacheKey: 'dryRun@1.0.0', + dependencies: { bytes }, + analyze: + (options: { client: ClientWithCoreApi }) => + async ({ + bytes, + }): Promise> => { + try { + return { + result: await options.client.core.dryRunTransaction({ transaction: bytes }), + }; + } catch { + return { issues: [{ message: 'Failed to dry run transaction' }] }; + } + }, +}); + +export const balanceChanges = createAnalyzer({ + dependencies: { dryRun }, + analyze: + () => + ({ dryRun }) => { + return { result: dryRun.transaction.balanceChanges || [] }; + }, +}); diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/functions.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/functions.ts new file mode 100644 index 000000000..4a783fc34 --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/functions.ts @@ -0,0 +1,48 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { ClientWithCoreApi, Experimental_SuiClientTypes } from '@mysten/sui/experimental'; +import type { TransactionAnalysisIssue } from '../analyzer.js'; +import { createAnalyzer } from '../analyzer.js'; +import { data } from './core.js'; + +export const moveFunctions = createAnalyzer({ + cacheKey: 'moveFunctions@1.0.0', + dependencies: { data }, + analyze: + ({ client }: { client: ClientWithCoreApi }) => + async ({ data }) => { + const issues: TransactionAnalysisIssue[] = []; + + const functions = new Set( + data.commands + .filter((cmd) => cmd.$kind === 'MoveCall') + .map( + (cmd) => `${cmd.MoveCall.package}::${cmd.MoveCall.module}::${cmd.MoveCall.function}`, + ), + ); + + const results = await Promise.all( + Array.from(functions).map(async (functionId) => { + const [packageId, moduleName, name] = functionId.split('::'); + try { + const res = await client.core.getMoveFunction({ packageId, moduleName, name }); + return res.function; + } catch { + issues.push({ message: `Failed to fetch Move function: ${functionId}` }); + return null; + } + }), + ); + + if (issues.length) { + return { issues }; + } + + return { + result: results.filter( + (fn): fn is Experimental_SuiClientTypes.FunctionResponse => fn !== null, + ), + }; + }, +}); diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/inputs.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/inputs.ts new file mode 100644 index 000000000..41a1318ce --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/inputs.ts @@ -0,0 +1,52 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Experimental_SuiClientTypes } from '@mysten/sui/experimental'; +import { createAnalyzer } from '../analyzer.js'; +import { data } from './core.js'; +import { objectsById } from './objects.js'; + +export type AnalyzedCommandInput = + | { + $kind: 'Pure'; + index: number; + bytes: string; // base64 encoded + // TODO: add parsed value and type + accessLevel: 'read' | 'mutate' | 'transfer'; + } + | { + $kind: 'Object'; + index: number; + object: Experimental_SuiClientTypes.ObjectResponse; + accessLevel: 'read' | 'mutate' | 'transfer'; + }; + +export const inputs = createAnalyzer({ + dependencies: { data, objectsById }, + analyze: + () => + ({ data, objectsById }) => { + return { + result: data.inputs.map((input, index): AnalyzedCommandInput => { + switch (input.$kind) { + case 'Pure': + return { $kind: 'Pure', index, bytes: input.Pure.bytes!, accessLevel: 'transfer' }; + case 'Object': + const objectId = + input.Object.ImmOrOwnedObject?.objectId ?? + input.Object.Receiving?.objectId ?? + input.Object.SharedObject?.objectId!; + + const object = objectsById.get(objectId)!; + if (!object) { + throw new Error(`Missing object for id ${objectId}`); + } + + return { $kind: 'Object', index, object, accessLevel: 'read' }; + default: + throw new Error(`Unknown input type: ${JSON.stringify(input)}`); + } + }), + }; + }, +}); diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/objects.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/objects.ts new file mode 100644 index 000000000..f6e6cb680 --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/objects.ts @@ -0,0 +1,132 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { ClientWithCoreApi, Experimental_SuiClientTypes } from '@mysten/sui/experimental'; +import { createAnalyzer } from '../analyzer.js'; +import type { TransactionAnalysisIssue } from '../analyzer.js'; + +import { data } from './core.js'; + +export type AnalyzedObject = Experimental_SuiClientTypes.ObjectResponse & { + ownerAddress: string | null; +}; + +export const objectIds = createAnalyzer({ + dependencies: { data }, + analyze: + () => + ({ data }) => { + const issues: TransactionAnalysisIssue[] = []; + + const inputs = data.inputs + .filter((input): input is Extract => { + switch (input.$kind) { + case 'UnresolvedObject': + case 'UnresolvedPure': + issues.push({ message: `Unexpected unresolved input: ${JSON.stringify(input)}` }); + return false; + case 'Pure': + return false; + case 'Object': + return true; + default: + issues.push({ message: `Unknown input type: ${JSON.stringify(input)}` }); + return false; + } + }) + .map((input) => { + switch (input.Object.$kind) { + case 'ImmOrOwnedObject': + return input.Object.ImmOrOwnedObject.objectId; + case 'SharedObject': + return input.Object.SharedObject.objectId; + case 'Receiving': + return input.Object.Receiving.objectId; + default: + throw new Error(`Unknown object type: ${JSON.stringify(input)}`); + } + }); + + if (issues.length) { + return { issues }; + } + + const gasObjects = data.gasData.payment?.map((obj) => obj.objectId) || []; + + return { + result: Array.from(new Set([...inputs, ...gasObjects])), + }; + }, +}); + +export const objects = createAnalyzer({ + cacheKey: 'objects@1.0.0', + dependencies: { objectIds }, + analyze: + ({ client }: { client: ClientWithCoreApi }) => + async ({ objectIds }) => { + const { objects } = await client.core.getObjects({ + objectIds, + }); + + const issues: TransactionAnalysisIssue[] = []; + + const foundObjects = objects.filter( + (obj): obj is Experimental_SuiClientTypes.ObjectResponse => { + if (obj instanceof Error) { + issues.push({ message: `Failed to fetch object: ${obj.message}`, error: obj }); + return false; + } + + return true; + }, + ); + + const result = foundObjects.map((obj) => { + let ownerAddress: string | null = null; + switch (obj.owner.$kind) { + case 'AddressOwner': + ownerAddress = obj.owner.AddressOwner; + break; + case 'ObjectOwner': + ownerAddress = obj.owner.ObjectOwner; + break; + case 'ConsensusAddressOwner': + ownerAddress = obj.owner.ConsensusAddressOwner.owner; + break; + case 'Shared': + case 'Immutable': + ownerAddress = null; + break; + default: + issues.push({ message: `Unknown owner type: ${JSON.stringify(obj.owner)}` }); + } + + return { ...obj, ownerAddress }; + }); + + if (issues.length) { + return { issues }; + } + + return { result }; + }, +}); + +export const ownedObjects = createAnalyzer({ + dependencies: { objects }, + analyze: + () => + ({ objects }) => { + return { result: objects.filter((obj) => obj.ownerAddress !== null) }; + }, +}); + +export const objectsById = createAnalyzer({ + dependencies: { objects }, + analyze: + () => + ({ objects }) => ({ + result: new Map(objects.map((obj) => [obj.id, obj])), + }), +}); diff --git a/packages/wallet-sdk/test/mocks/MockSuiClient.ts b/packages/wallet-sdk/test/mocks/MockSuiClient.ts new file mode 100644 index 000000000..83cfc9fcb --- /dev/null +++ b/packages/wallet-sdk/test/mocks/MockSuiClient.ts @@ -0,0 +1,492 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Experimental_SuiClientTypes } from '@mysten/sui/experimental'; +import { Experimental_CoreClient } from '@mysten/sui/experimental'; +import { normalizeSuiAddress, normalizeStructTag, parseStructTag } from '@mysten/sui/utils'; +import type { TransactionPlugin } from '@mysten/sui/transactions'; +import { Inputs } from '@mysten/sui/transactions'; +import { + DEFAULT_OBJECTS, + DEFAULT_MOVE_FUNCTIONS, + DEFAULT_GAS_PRICE, + CoinStruct, + createMockCoin, + createMockNFT, + createMockObject, + createMockMoveFunction, +} from './mockData.js'; + +export class MockSuiClient extends Experimental_CoreClient { + #objects = new Map(); + #moveFunctions = new Map(); + #gasPrice = DEFAULT_GAS_PRICE; + #nextDryRunResult: Experimental_SuiClientTypes.DryRunTransactionResponse | null = null; + + constructor(network: Experimental_SuiClientTypes.Network = 'testnet') { + super({ + network, + base: null as unknown as Experimental_CoreClient, + }); + this.base = this; + + this.#initializeDefaults(); + } + + #initializeDefaults() { + // Add all default objects + for (const obj of DEFAULT_OBJECTS) { + this.#objects.set(obj.id, obj); + } + + // Add all default move functions + for (const fn of DEFAULT_MOVE_FUNCTIONS) { + const normalizedPackageId = normalizeSuiAddress(fn.packageId); + const key = `${normalizedPackageId}::${fn.moduleName}::${fn.name}`; + this.#moveFunctions.set(key, fn); + } + } + + // Helper methods to add objects during tests + addCoin(params: { + objectId: string; + coinType: string; + balance: bigint; + owner: Experimental_SuiClientTypes.ObjectOwner; + version?: string; + digest?: string; + }): void { + const coin = createMockCoin(params); + this.#objects.set(coin.id, coin); + } + + addNFT(params: { + objectId: string; + nftType: string; + owner: Experimental_SuiClientTypes.ObjectOwner; + version?: string; + digest?: string; + }): void { + const nft = createMockNFT(params); + this.#objects.set(nft.id, nft); + } + + addObject(params: { + objectId: string; + objectType: string; + owner: Experimental_SuiClientTypes.ObjectOwner; + version?: string; + digest?: string; + content?: Uint8Array; + }): void { + const obj = createMockObject(params); + this.#objects.set(obj.id, obj); + } + + addMoveFunction(params: { + packageId: string; + moduleName: string; + name: string; + visibility: Experimental_SuiClientTypes.Visibility; + isEntry: boolean; + typeParameters?: Experimental_SuiClientTypes.TypeParameter[]; + parameters: Experimental_SuiClientTypes.OpenSignature[]; + returns?: Experimental_SuiClientTypes.OpenSignature[]; + }): void { + const fn = createMockMoveFunction(params); + const normalizedPackageId = normalizeSuiAddress(fn.packageId); + const key = `${normalizedPackageId}::${fn.moduleName}::${fn.name}`; + this.#moveFunctions.set(key, fn); + } + + setNextDryRunResult(result: Experimental_SuiClientTypes.DryRunTransactionResponse): void { + this.#nextDryRunResult = result; + } + + setGasPrice(price: string): void { + this.#gasPrice = price; + } + + // Helper function to check if an object is owned by the given address + #isOwnedByAddress(obj: Experimental_SuiClientTypes.ObjectResponse, address: string): boolean { + switch (obj.owner.$kind) { + case 'AddressOwner': + return obj.owner.AddressOwner === address; + case 'ObjectOwner': + return obj.owner.ObjectOwner === address; + case 'ConsensusAddressOwner': + return obj.owner.ConsensusAddressOwner.owner === address; + case 'Shared': + case 'Immutable': + case 'Unknown': + default: + return false; + } + } + + async getObjects( + options: Experimental_SuiClientTypes.GetObjectsOptions, + ): Promise { + const objects = options.objectIds.map( + (id): Experimental_SuiClientTypes.ObjectResponse | Error => { + const normalizedId = normalizeSuiAddress(id); + const obj = this.#objects.get(normalizedId); + + if (!obj) { + return new Error(`Object not found: ${id}`); + } + + return obj; + }, + ); + + return { objects }; + } + + async getCoins( + options: Experimental_SuiClientTypes.GetCoinsOptions, + ): Promise { + const coinObjects = Array.from(this.#objects.values()).filter((obj) => { + const parsedType = parseStructTag(obj.type); + const parsedCoinType = parseStructTag('0x2::coin::Coin'); + + const isCoin = + parsedType.address === parsedCoinType.address && + parsedType.module === parsedCoinType.module && + parsedType.name === parsedCoinType.name; + + if (!isCoin) return false; + + // Filter by owner using helper function + const isOwnedByAddress = this.#isOwnedByAddress(obj, options.address); + if (!isOwnedByAddress) return false; + + // Filter by coin type + const coinType = obj.type.match(/0x2::coin::Coin<(.+)>/)?.[1]; + return coinType === options.coinType; + }); + + const objects: Experimental_SuiClientTypes.CoinResponse[] = await Promise.all( + coinObjects.map(async (obj) => { + // Parse balance from BCS content + let balance = '0'; + try { + const content = await obj.content; + const parsedCoin = CoinStruct.parse(content); + balance = parsedCoin.balance.value.toString(); + } catch { + // Fallback to 0 if parsing fails + } + + return { + ...obj, + balance, + }; + }), + ); + + return { + objects, + hasNextPage: false, + cursor: null, + }; + } + + async getOwnedObjects( + options: Experimental_SuiClientTypes.GetOwnedObjectsOptions, + ): Promise { + const ownedObjects = Array.from(this.#objects.values()).filter((obj) => { + return this.#isOwnedByAddress(obj, options.address); + }); + + return { + objects: ownedObjects, + hasNextPage: false, + cursor: null, + }; + } + + async getBalance( + options: Experimental_SuiClientTypes.GetBalanceOptions, + ): Promise { + const coins = await this.getCoins({ + address: options.address, + coinType: options.coinType, + }); + + const totalBalance = coins.objects.reduce( + (sum: bigint, coin: Experimental_SuiClientTypes.CoinResponse) => { + return sum + BigInt(coin.balance); + }, + 0n, + ); + + return { + balance: { + coinType: options.coinType, + balance: totalBalance.toString(), + }, + }; + } + + async getAllBalances( + options: Experimental_SuiClientTypes.GetAllBalancesOptions, + ): Promise { + const parsedCoinType = parseStructTag('0x2::coin::Coin'); + const allObjects = Array.from(this.#objects.values()).filter((obj) => { + const parsedType = parseStructTag(obj.type); + + const isCoin = + parsedType.address === parsedCoinType.address && + parsedType.module === parsedCoinType.module && + parsedType.name === parsedCoinType.name; + const isOwnedByAddress = this.#isOwnedByAddress(obj, options.address); + return isCoin && isOwnedByAddress; + }); + + const balancesByType = new Map(); + + for (const obj of allObjects) { + const coinType = obj.type.match(/0x2::coin::Coin<(.+)>/)?.[1]; + if (!coinType) continue; + + try { + const content = await obj.content; + const parsedCoin = CoinStruct.parse(content); + const balance = BigInt(parsedCoin.balance.value); + const current = balancesByType.get(coinType) || 0n; + balancesByType.set(coinType, current + balance); + } catch { + // Skip if parsing fails + } + } + + const balances: Experimental_SuiClientTypes.CoinBalance[] = Array.from( + balancesByType.entries(), + ).map(([coinType, totalBalance]) => ({ + coinType, + balance: totalBalance.toString(), + })); + + return { + balances, + hasNextPage: false, + cursor: null, + }; + } + + async getTransaction( + _options: Experimental_SuiClientTypes.GetTransactionOptions, + ): Promise { + throw new Error('getTransaction not implemented in MockSuiClient'); + } + + async executeTransaction( + _options: Experimental_SuiClientTypes.ExecuteTransactionOptions, + ): Promise { + throw new Error('executeTransaction not implemented in MockSuiClient'); + } + + async dryRunTransaction( + _options: Experimental_SuiClientTypes.DryRunTransactionOptions, + ): Promise { + if (this.#nextDryRunResult) { + const result = this.#nextDryRunResult; + this.#nextDryRunResult = null; + return result; + } + + // Default dry run response - minimal valid structure + return { + transaction: { + digest: 'mockTransactionDigest', + signatures: [], + epoch: '1', + effects: { + bcs: new Uint8Array(), + digest: 'mockEffectsDigest', + version: 1, + transactionDigest: 'mockTransactionDigest', + status: { success: true, error: null }, + gasUsed: { + computationCost: '100000', + storageCost: '100000', + storageRebate: '0', + nonRefundableStorageFee: '0', + }, + gasObject: { + id: normalizeSuiAddress('0xa5c01'), + inputState: 'Exists', + inputVersion: '100', + inputDigest: '11111111111111111111111111111111', + inputOwner: { + $kind: 'AddressOwner', + AddressOwner: '0x0000000000000000000000000000000000000000000000000000000000000123', + }, + outputState: 'ObjectWrite', + outputVersion: '101', + outputDigest: '11111111111111111111111111111112', + outputOwner: { + $kind: 'AddressOwner', + AddressOwner: '0x0000000000000000000000000000000000000000000000000000000000000123', + }, + idOperation: 'None', + }, + eventsDigest: null, + dependencies: [], + lamportVersion: '1', + changedObjects: [], + unchangedConsensusObjects: [], + auxiliaryDataDigest: null, + }, + objectTypes: Promise.resolve({}), + transaction: { + bcs: new Uint8Array(), + } as Experimental_SuiClientTypes.TransactionData, + balanceChanges: [], + }, + }; + } + + async getReferenceGasPrice( + _options?: Experimental_SuiClientTypes.GetReferenceGasPriceOptions, + ): Promise { + return { referenceGasPrice: this.#gasPrice }; + } + + async getDynamicFields( + _options: Experimental_SuiClientTypes.GetDynamicFieldsOptions, + ): Promise { + return { + dynamicFields: [], + hasNextPage: false, + cursor: null, + }; + } + + resolveTransactionPlugin(): TransactionPlugin { + // For mock purposes, return a plugin that automatically sets up gas configuration and resolves objects + return async (transactionData, _options, next) => { + // Resolve UnresolvedObject inputs + await this.#resolveObjectReferences(transactionData); + + // Set up gas configuration if not already set + if (!transactionData.gasData.budget) { + transactionData.gasData.budget = '10000000'; + } + if (!transactionData.gasData.price) { + transactionData.gasData.price = this.#gasPrice; + } + if (!transactionData.gasData.payment || transactionData.gasData.payment.length === 0) { + // Use the first SUI coin from default objects + const suiCoinType = normalizeStructTag('0x2::coin::Coin<0x2::sui::SUI>'); + const firstSuiCoin = Array.from(this.#objects.values()).find( + (obj) => + obj.type === suiCoinType && + obj.owner.$kind === 'AddressOwner' && + obj.owner.AddressOwner === transactionData.sender, + ); + + if (firstSuiCoin) { + transactionData.gasData.payment = [ + { + objectId: firstSuiCoin.id, + version: firstSuiCoin.version, + digest: firstSuiCoin.digest, + }, + ]; + transactionData.gasData.owner = transactionData.sender; + } + } + + // Proceed to the next plugin + await next(); + }; + } + + async #resolveObjectReferences(transactionData: { + inputs: Array<{ + UnresolvedObject?: { + objectId: string; + version?: string | number | null; + initialSharedVersion?: string | number | null; + mutable?: boolean | null; + }; + [key: string]: unknown; + }>; + }) { + // Find all UnresolvedObject inputs that need resolution + const objectsToResolve = transactionData.inputs.filter((input) => { + return ( + input.UnresolvedObject && + !(input.UnresolvedObject.version || input.UnresolvedObject?.initialSharedVersion) + ); + }); + + if (objectsToResolve.length === 0) { + return; + } + + // Get unique object IDs + const dedupedIds = [ + ...new Set( + objectsToResolve.map((input) => normalizeSuiAddress(input.UnresolvedObject!.objectId)), + ), + ] as string[]; + + // Fetch objects using our multiGetObjects + const resolved = await this.getObjects({ objectIds: dedupedIds }); + + const objectsById = new Map(dedupedIds.map((id, index) => [id, resolved.objects[index]])); + + // Update each UnresolvedObject input + for (const [index, input] of transactionData.inputs.entries()) { + if (!input.UnresolvedObject) { + continue; + } + + const id = normalizeSuiAddress(input.UnresolvedObject.objectId); + const resolvedObject = objectsById.get(id); + + if (!resolvedObject || resolvedObject instanceof Error) { + throw new Error(`Failed to resolve object: ${id}`); + } + + // Determine the type of reference based on owner + if (resolvedObject.owner.$kind === 'Shared') { + transactionData.inputs[index] = Inputs.SharedObjectRef({ + objectId: id, + initialSharedVersion: resolvedObject.owner.Shared.initialSharedVersion, + mutable: input.UnresolvedObject.mutable ?? true, + }); + } else { + // For owned objects, use ObjectRef + transactionData.inputs[index] = Inputs.ObjectRef({ + objectId: id, + digest: resolvedObject.digest, + version: resolvedObject.version, + }); + } + } + } + + async verifyZkLoginSignature( + _options: Experimental_SuiClientTypes.VerifyZkLoginSignatureOptions, + ): Promise { + throw new Error('verifyZkLoginSignature not implemented in MockSuiClient'); + } + + async getMoveFunction( + options: Experimental_SuiClientTypes.GetMoveFunctionOptions, + ): Promise { + const normalizedPackageId = normalizeSuiAddress(options.packageId); + const key = `${normalizedPackageId}::${options.moduleName}::${options.name}`; + const fn = this.#moveFunctions.get(key); + + if (!fn) { + throw new Error(`Move function not found: ${key}`); + } + + return { function: fn }; + } +} diff --git a/packages/wallet-sdk/test/mocks/mockData.ts b/packages/wallet-sdk/test/mocks/mockData.ts new file mode 100644 index 000000000..9985309e8 --- /dev/null +++ b/packages/wallet-sdk/test/mocks/mockData.ts @@ -0,0 +1,461 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { bcs } from '@mysten/sui/bcs'; +import { normalizeSuiAddress, normalizeStructTag } from '@mysten/sui/utils'; +import type { Experimental_SuiClientTypes } from '@mysten/sui/experimental'; + +export const DEFAULT_SENDER = '0x0000000000000000000000000000000000000000000000000000000000000123'; + +// Named exports for common test object IDs (from DEFAULT_OBJECTS) +export const TEST_COIN_1_ID = '0xa5c000'; +export const TEST_COIN_2_ID = '0xa5c001'; +export const TEST_NFT_ID = '0xdead'; +export const TEST_SHARED_OBJECT_ID = '0xbeef'; + +// Additional object IDs from DEFAULT_OBJECTS +export const TEST_USDC_COIN_ID = '0xb0c000'; // First USDC coin +export const TEST_WETH_COIN_ID = '0xc0c000'; // First WETH coin +export const TEST_PARENT_OWNED_COIN_ID = '0xa5c004'; // Coin with ObjectOwner +export const TEST_CONSENSUS_COIN_ID = '0xa5c005'; // Coin with ConsensusAddressOwner +export const TEST_OTHER_USER_COIN_ID = '0xcafe'; // Coin owned by 0xbabe + +// Package/Module/Function names +export const TEST_PACKAGE_ID = '0x999'; +export const TEST_MODULE_NAME = 'test'; +export const TEST_TRANSFER_FUNCTION = 'transfer'; +export const TEST_BATCH_TRANSFER_FUNCTION = 'batch_transfer'; +export const TEST_TRANSFER_NFT_FUNCTION = 'transfer_nft'; +export const TEST_COMPLEX_TRANSFER_FUNCTION = 'complex_transfer'; + +// Additional package IDs for tests +export const DEFI_PACKAGE_ID = '0xabc'; +export const NFT_PACKAGE_ID = '0xdef'; + +// BCS structures for different object types +export const CoinStruct = bcs.struct('Coin', { + id: bcs.Address, + balance: bcs.struct('Balance', { value: bcs.u64() }), +}); + +// Helper functions to create owner types +export function createAddressOwner(address: string): Experimental_SuiClientTypes.AddressOwner { + return { $kind: 'AddressOwner', AddressOwner: address }; +} + +export function createSharedOwner( + initialSharedVersion: string, +): Experimental_SuiClientTypes.SharedOwner { + return { $kind: 'Shared', Shared: { initialSharedVersion } }; +} + +export function createImmutableOwner(): Experimental_SuiClientTypes.ImmutableOwner { + return { $kind: 'Immutable', Immutable: true }; +} + +export function createObjectOwner(objectId: string): Experimental_SuiClientTypes.ParentOwner { + return { $kind: 'ObjectOwner', ObjectOwner: objectId }; +} + +export function createConsensusAddressOwner( + owner: string, + startVersion: string, +): Experimental_SuiClientTypes.ConsensusAddressOwner { + return { $kind: 'ConsensusAddressOwner', ConsensusAddressOwner: { owner, startVersion } }; +} + +// Helper functions to create mock objects +export function createMockCoin(params: { + objectId: string; + coinType: string; + balance: bigint; + owner: Experimental_SuiClientTypes.ObjectOwner; + version?: string; + digest?: string; +}): Experimental_SuiClientTypes.ObjectResponse { + const normalizedId = normalizeSuiAddress(params.objectId); + const normalizedCoinType = normalizeStructTag(params.coinType); + + const content = CoinStruct.serialize({ + id: normalizedId, + balance: { value: params.balance }, + }).toBytes(); + + return { + id: normalizedId, + version: params.version || '100', + digest: params.digest || '11111111111111111111111111111111', + type: normalizeStructTag(`0x2::coin::Coin<${normalizedCoinType}>`), + owner: params.owner, + content: Promise.resolve(content), + previousTransaction: null, + }; +} + +// More realistic BCS structures +export const NFTStruct = bcs.struct('NFT', { + id: bcs.Address, + name: bcs.string(), + description: bcs.string(), + image_url: bcs.string(), +}); + +export function createMockNFT(params: { + objectId: string; + nftType: string; + owner: Experimental_SuiClientTypes.ObjectOwner; + version?: string; + digest?: string; +}): Experimental_SuiClientTypes.ObjectResponse { + const normalizedId = normalizeSuiAddress(params.objectId); + const normalizedNftType = normalizeStructTag(params.nftType); + + // More realistic NFT structure + const content = NFTStruct.serialize({ + id: normalizedId, + name: 'Test NFT', + description: 'A test NFT object', + image_url: 'https://example.com/nft.png', + }).toBytes(); + + return { + id: normalizedId, + version: params.version || '2', + digest: params.digest || 'E7YX7zmxdAVVzrGkcoss2ziUHKMa7qBChPbqg5nGQyYo', + type: normalizedNftType, + owner: params.owner, + content: Promise.resolve(content), + previousTransaction: null, + }; +} + +export function createMockObject(params: { + objectId: string; + objectType: string; + owner: Experimental_SuiClientTypes.ObjectOwner; + version?: string; + digest?: string; + content?: Uint8Array; +}): Experimental_SuiClientTypes.ObjectResponse { + const normalizedId = normalizeSuiAddress(params.objectId); + const normalizedObjectType = normalizeStructTag(params.objectType); + + // Default content is just the object ID as address + const content = params.content || bcs.Address.serialize(normalizedId).toBytes(); + + return { + id: normalizedId, + version: params.version || '1', + digest: params.digest || '11111111111111111111111111111111', + type: normalizedObjectType, + owner: params.owner, + content: Promise.resolve(content), + previousTransaction: null, + }; +} + +export function createMockMoveFunction(params: { + packageId: string; + moduleName: string; + name: string; + visibility: Experimental_SuiClientTypes.Visibility; + isEntry: boolean; + typeParameters?: Experimental_SuiClientTypes.TypeParameter[]; + parameters: Experimental_SuiClientTypes.OpenSignature[]; + returns?: Experimental_SuiClientTypes.OpenSignature[]; +}): Experimental_SuiClientTypes.FunctionResponse { + return { + packageId: normalizeSuiAddress(params.packageId), + moduleName: params.moduleName, + name: params.name, + visibility: params.visibility, + isEntry: params.isEntry, + typeParameters: params.typeParameters || [], + parameters: params.parameters, + returns: params.returns || [], + }; +} + +// Helper to create multiple coins with deterministic balance distribution +export function createMockCoins(params: { + coinType: string; + totalBalance: bigint; + numCoins: number; + owner: Experimental_SuiClientTypes.ObjectOwner; + baseObjectId?: string; +}): Experimental_SuiClientTypes.ObjectResponse[] { + const coins: Experimental_SuiClientTypes.ObjectResponse[] = []; + const baseId = params.baseObjectId || '0xc01'; + + // Split balance deterministically across coins using powers of 2 + const balances: bigint[] = []; + let remainingBalance = params.totalBalance; + + // Use a deterministic pattern: first coin gets 50%, second gets 25%, third gets 12.5%, etc. + for (let i = 0; i < params.numCoins - 1; i++) { + const divisor = 2n ** BigInt(i + 1); + const amount = params.totalBalance / divisor; + balances.push(amount); + remainingBalance -= amount; + } + // Last coin gets the remaining balance + balances.push(remainingBalance); + + for (let i = 0; i < params.numCoins; i++) { + // Generate valid hex object ID + const suffix = i.toString(16).padStart(2, '0'); + const objectId = normalizeSuiAddress(`${baseId}${suffix}`); + coins.push( + createMockCoin({ + objectId, + coinType: params.coinType, + balance: balances[i], + owner: params.owner, + version: (100 + i).toString(), + }), + ); + } + + return coins; +} + +// Default objects that the mock client knows about +export const DEFAULT_OBJECTS: Experimental_SuiClientTypes.ObjectResponse[] = [ + // 10 SUI coins for main sender (split across multiple coins) + ...createMockCoins({ + coinType: '0x2::sui::SUI', + totalBalance: 10000000000n, // 10 SUI + numCoins: 10, + owner: createAddressOwner(DEFAULT_SENDER), + baseObjectId: '0xa5c0', + }), + // 3 USDC coins for main sender + ...createMockCoins({ + coinType: '0xa0b::usdc::USDC', + totalBalance: 1000000000n, // 1000 USDC + numCoins: 3, + owner: createAddressOwner(DEFAULT_SENDER), + baseObjectId: '0xb0c0', + }), + // 2 WETH coins for main sender + ...createMockCoins({ + coinType: '0xb0c::weth::WETH', + totalBalance: 5000000000000000000n, // 5 WETH + numCoins: 2, + owner: createAddressOwner(DEFAULT_SENDER), + baseObjectId: '0xc0c0', + }), + // Coin with ObjectOwner for testing + createMockCoin({ + objectId: '0xa5c04', + coinType: '0x2::sui::SUI', + balance: 100000000n, + owner: createObjectOwner('0xparent'), + }), + // Coin with ConsensusAddressOwner for testing + createMockCoin({ + objectId: '0xa5c05', + coinType: '0x2::sui::SUI', + balance: 50000000n, + owner: createConsensusAddressOwner(DEFAULT_SENDER, '100'), + }), + // Another user's SUI coin + createMockCoin({ + objectId: '0xcafe', + coinType: '0x2::sui::SUI', + balance: 5000000n, + owner: createAddressOwner('0xbabe'), + }), + // NFT object + createMockNFT({ + objectId: '0xdead', + nftType: '0x999::nft::NFT', + owner: createAddressOwner('0xbabe'), + }), + // Shared pool object + createMockObject({ + objectId: '0xbeef', + objectType: '0x999::pool::Pool', + owner: createSharedOwner('1'), + }), +]; + +// Default move functions that the mock client knows about +export const DEFAULT_MOVE_FUNCTIONS: Experimental_SuiClientTypes.FunctionResponse[] = [ + createMockMoveFunction({ + packageId: '0x999', + moduleName: 'test', + name: TEST_TRANSFER_FUNCTION, + visibility: 'public', + isEntry: false, + parameters: [ + { + reference: 'mutable', + body: { + $kind: 'datatype', + datatype: { typeName: '0x999::nft::NFT', typeParameters: [] }, + }, + }, + { reference: null, body: { $kind: 'u64' } }, + { reference: null, body: { $kind: 'address' } }, + { reference: null, body: { $kind: 'bool' } }, + ], + }), + createMockMoveFunction({ + packageId: '0x999', + moduleName: 'test', + name: TEST_BATCH_TRANSFER_FUNCTION, + visibility: 'public', + isEntry: false, + parameters: [ + { + reference: 'mutable', + body: { + $kind: 'vector', + vector: { + $kind: 'datatype', + datatype: { + typeName: '0x2::coin::Coin', + typeParameters: [{ $kind: 'typeParameter', index: 0 }], + }, + }, + }, + }, + ], + }), + createMockMoveFunction({ + packageId: '0x999', + moduleName: 'test', + name: TEST_TRANSFER_NFT_FUNCTION, + visibility: 'public', + isEntry: false, + parameters: [ + { + reference: 'mutable', + body: { + $kind: 'datatype', + datatype: { typeName: '0x999::nft::NFT', typeParameters: [] }, + }, + }, + { reference: null, body: { $kind: 'address' } }, + ], + }), + createMockMoveFunction({ + packageId: '0x999', + moduleName: 'test', + name: TEST_COMPLEX_TRANSFER_FUNCTION, + visibility: 'public', + isEntry: false, + parameters: [ + { + reference: 'mutable', + body: { + $kind: 'vector', + vector: { + $kind: 'datatype', + datatype: { + typeName: '0x2::coin::Coin', + typeParameters: [{ $kind: 'typeParameter', index: 0 }], + }, + }, + }, + }, + { reference: null, body: { $kind: 'u64' } }, + { reference: null, body: { $kind: 'address' } }, + { reference: null, body: { $kind: 'bool' } }, + { reference: null, body: { $kind: 'vector', vector: { $kind: 'u8' } } }, + ], + }), + createMockMoveFunction({ + packageId: '0x999', + moduleName: 'test', + name: 'consume_coin', + visibility: 'public', + isEntry: false, + typeParameters: [{ constraints: [], isPhantom: false }], + parameters: [ + { + reference: 'mutable', + body: { + $kind: 'datatype', + datatype: { + typeName: '0x2::coin::Coin', + typeParameters: [{ $kind: 'typeParameter', index: 0 }], + }, + }, + }, + { + reference: null, + body: { + $kind: 'datatype', + datatype: { + typeName: '0x2::coin::Coin', + typeParameters: [{ $kind: 'typeParameter', index: 0 }], + }, + }, + }, + ], + }), + createMockMoveFunction({ + packageId: '0x999', + moduleName: 'test', + name: 'batch_operation', + visibility: 'public', + isEntry: false, + typeParameters: [{ constraints: [], isPhantom: false }], + parameters: [ + { + reference: 'mutable', + body: { + $kind: 'vector', + vector: { + $kind: 'datatype', + datatype: { + typeName: '0x2::coin::Coin', + typeParameters: [{ $kind: 'typeParameter', index: 0 }], + }, + }, + }, + }, + ], + }), + createMockMoveFunction({ + packageId: '0999', + moduleName: 'test', + name: 'create_coin', + visibility: 'public', + isEntry: false, + parameters: [], + returns: [ + { + reference: null, + body: { + $kind: 'datatype', + datatype: { + typeName: '0x2::coin::Coin', + typeParameters: [ + { + $kind: 'datatype', + datatype: { + typeName: '0x2::sui::SUI', + typeParameters: [], + }, + }, + ], + }, + }, + }, + ], + }), + createMockMoveFunction({ + packageId: '0x999', + moduleName: 'test', + name: 'get_dynamic_amount', + visibility: 'public', + isEntry: false, + parameters: [], + returns: [{ reference: null, body: { $kind: 'u64' } }], + }), +]; + +export const DEFAULT_GAS_PRICE = '1000'; diff --git a/packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts b/packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts new file mode 100644 index 000000000..497152ed6 --- /dev/null +++ b/packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts @@ -0,0 +1,442 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, it, expect } from 'vitest'; +import { Transaction } from '@mysten/sui/transactions'; +import { analyze } from '../../src/transaction-analyzer/analyzer'; +import { coinFlows } from '../../src/transaction-analyzer/rules/coin-flows'; +import { MockSuiClient } from '../mocks/MockSuiClient'; +import { + DEFAULT_SENDER, + createAddressOwner, + TEST_COIN_1_ID, + TEST_COIN_2_ID, + TEST_USDC_COIN_ID, + TEST_WETH_COIN_ID, +} from '../mocks/mockData'; + +describe('TransactionAnalyzer - Coin Flows Rule', () => { + it('should handle empty transactions with no coin flows', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Empty transaction - gas coin is tracked but no actual flows + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Gas coin is tracked with gas budget usage in empty transaction + expect(results.coinFlows.result?.outflows).toEqual([ + { + coinType: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + amount: 10000000n, // Gas budget + }, + ]); + }); + + it('should track gas coin flows when splitting and transferring', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Split gas coin and transfer it + const [gasSplit] = tx.splitCoins(tx.gas, [100000000n]); // 0.1 SUI from gas + tx.transferObjects([gasSplit], tx.pure.address('0x456')); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should have SUI outflow of 0.1 SUI + expect(results.coinFlows.result?.outflows).toHaveLength(1); + const suiFlow = results.coinFlows.result?.outflows[0]; + expect(suiFlow?.coinType).toBe( + '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + ); + expect(suiFlow?.amount).toBe(110000000n); // 0.1 SUI + 0.01 SUI gas budget + }); + + it('should track full gas coin transfer', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Transfer entire gas coin + tx.transferObjects([tx.gas], tx.pure.address('0x456')); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should have SUI outflow of full gas amount + expect(results.coinFlows.result?.outflows).toHaveLength(1); + const suiFlow = results.coinFlows.result?.outflows[0]; + expect(suiFlow?.coinType).toBe( + '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + ); + expect(suiFlow?.amount).toBe(5000000000n); // Full gas balance transferred + }); + + it('should handle merge and split operations correctly', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const coin1 = tx.object(TEST_COIN_1_ID); // 5 SUI + const coin2 = tx.object(TEST_COIN_2_ID); // 2.5 SUI + + // Merge coins + tx.mergeCoins(coin1, [coin2]); // Now coin1 has 7.5 SUI + + // Split merged coin + const [splitCoin1, splitCoin2, splitCoin3] = tx.splitCoins(coin1, [ + 1000000000n, + 500000000n, + 250000000n, + ]); // 1 SUI + 0.5 SUI + 0.25 SUI + + const [toTransfer] = tx.mergeCoins(splitCoin1, [splitCoin2]); // 1.5 SUI + + tx.mergeCoins(coin1, [splitCoin3]); // Merge back remaining .25 + + // Transfer the split + tx.transferObjects([toTransfer], tx.pure.address('0x456')); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should only count the transferred amount, not double count the merged coins + expect(results.coinFlows.result?.outflows).toHaveLength(1); + const suiFlow = results.coinFlows.result?.outflows[0]; + expect(suiFlow?.amount).toBe(1510000000n); // 1 SUI + 2.5 SUI + 0.01 gas budget + }); + + it('should track coins consumed in Move calls', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const coin = tx.object(TEST_COIN_1_ID); + const [splitCoin] = tx.splitCoins(coin, [500000000n]); // 0.5 SUI + + // Use coin in Move call (consumes it) + tx.moveCall({ + target: '0x999::test::consume_coin', + arguments: [splitCoin, tx.gas], + }); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should track both the split coin and gas coin as consumed + expect(results.coinFlows.result?.outflows).toHaveLength(1); + const suiFlow = results.coinFlows.result?.outflows[0]; + expect(suiFlow?.amount).toBe(5500000000n); // 0.5 SUI (split) + 5 SUI (gas) + }); + + it('should track coins consumed in MakeMoveVec', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const coin = tx.object(TEST_COIN_1_ID); + const [splitCoin] = tx.splitCoins(coin, [300000000n]); // 0.3 SUI + + // Create vector with coins (consumes them) + tx.makeMoveVec({ + elements: [splitCoin, tx.gas], + }); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should track both coins as consumed + expect(results.coinFlows.result?.outflows).toHaveLength(1); + const suiFlow = results.coinFlows.result?.outflows[0]; + expect(suiFlow?.amount).toBe(5300000000n); // 0.3 SUI (split) + 5 SUI (gas) + }); + + it('should track coins transferred back to sender (no outflow)', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Split and transfer back to sender (should not create outflow) + const suiCoin = tx.object(TEST_COIN_1_ID); + const [splitCoin] = tx.splitCoins(suiCoin, [100000000n]); // 0.1 SUI + tx.transferObjects([splitCoin], tx.pure.address(DEFAULT_SENDER)); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should have no outflows since coin was transferred back to sender + // But gas budget is still consumed + expect(results.coinFlows.result?.outflows).toEqual([ + { + coinType: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + amount: 10000000n, // Gas budget + }, + ]); + }); + + it('should handle dynamic split amounts (assume full consumption)', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const dynamicAmount = tx.moveCall({ target: '0x999::test::get_dynamic_amount' }); + + // Split with dynamic amount - analyzer should assume full consumption + const [splitCoin] = tx.splitCoins(tx.gas, [dynamicAmount]); + tx.transferObjects([splitCoin], tx.pure.address('0x456')); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should track the full coin balance as outflow due to dynamic amount + const suiFlow = results.coinFlows.result?.outflows.find( + (flow) => + flow.coinType === + '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + ); + expect(suiFlow?.amount).toBe(5000000000n); // assume split consumed full gas coin + }); + + it('should handle multiple coin types in single transaction', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Use different coin types + const suiCoin = tx.object(TEST_COIN_1_ID); + const usdcCoin = tx.object(TEST_USDC_COIN_ID); + const wethCoin = tx.object(TEST_WETH_COIN_ID); + + // Transfer each to different addresses + tx.transferObjects([suiCoin], tx.pure.address('0x111')); + tx.transferObjects([usdcCoin], tx.pure.address('0x222')); + tx.transferObjects([wethCoin], tx.pure.address('0x333')); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should have outflows for all three coin types + expect(results.coinFlows.result?.outflows).toHaveLength(3); + + const coinTypes = results.coinFlows.result?.outflows.map((flow) => flow.coinType).sort(); + expect(coinTypes).toEqual([ + '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + '0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC', + '0x0000000000000000000000000000000000000000000000000000000000000b0c::weth::WETH', + ]); + + expect(results.coinFlows.result?.outflows).toMatchInlineSnapshot(` + [ + { + "amount": 5010000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + }, + { + "amount": 500000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC", + }, + { + "amount": 2500000000000000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000b0c::weth::WETH", + }, + ] + `); + }); + + it('should not double count coins in split-merge chains', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const coin1 = tx.object(TEST_COIN_1_ID); // 5 SUI + const coin2 = tx.object(TEST_COIN_2_ID); // 2.5 SUI + + // Split first coin + const [splitCoin] = tx.splitCoins(coin1, [1000000000n]); // 1 SUI + + // Merge split with second coin + tx.mergeCoins(splitCoin, [coin2]); // splitCoin now has 3.5 SUI + + const [split2, split3] = tx.splitCoins(splitCoin, [1000000000n, 500000000n]); // 1 SUI, 0.5 SUI + + // Transfer the merged result (1.5 SUI) + tx.transferObjects([split2, split3], tx.pure.address('0x456')); + + tx.mergeCoins(coin1, [splitCoin]); // merge back remaining 6 sui + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + expect(results.coinFlows.result?.outflows).toHaveLength(1); + const suiFlow = results.coinFlows.result?.outflows[0]; + expect(suiFlow?.amount).toBe(1510000000n); // 1.5 SUI (split2 + split3) + 0.01 gas budget + }); + + it('should track coin flows when splitting and transferring coins', async () => { + const client = new MockSuiClient(); + + // Add additional coins for comprehensive testing + client.addCoin({ + objectId: '0xa5c010', + coinType: '0x2::sui::SUI', + balance: 5000000000n, // 5 SUI + owner: createAddressOwner(DEFAULT_SENDER), + }); + + client.addCoin({ + objectId: '0xa5c011', + coinType: '0x2::sui::SUI', + balance: 2000000000n, // 2 SUI + owner: createAddressOwner(DEFAULT_SENDER), + }); + + client.addCoin({ + objectId: '0xa5c012', + coinType: '0xa0b::usdc::USDC', + balance: 1000000000n, // 1000 USDC (6 decimals) + owner: createAddressOwner(DEFAULT_SENDER), + }); + + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Test 1: Split coins (should track outflow when transferred) + const suiCoin = tx.object('0xa5c010'); + const [splitCoin1, splitCoin2] = tx.splitCoins(suiCoin, [1000000000n, 500000000n]); // 1 SUI, 0.5 SUI + + // Test 2: Merge coins (should combine balances) + const suiCoin2 = tx.object('0xa5c011'); + tx.mergeCoins(suiCoin, [suiCoin2]); // Merge 2 SUI into main coin + + // Test 3: Use gas coin (should track gas usage) + const [gasSplit] = tx.splitCoins(tx.gas, [100000000n]); // 0.1 SUI from gas + + // Test 4: Transfer different coin types (should track outflows) + const usdcCoin = tx.object('0xa5c012'); + const [usdcSplit] = tx.splitCoins(usdcCoin, [500000000n]); // 500 USDC + + // Transfer coins to create outflows + tx.transferObjects([splitCoin1, gasSplit], tx.pure.address('0x456')); + tx.transferObjects([usdcSplit], tx.pure.address('0x789')); + + // Test 5: Use coins in Move calls (should consume them) + tx.moveCall({ + target: '0x999::test::consume_coin', + arguments: [splitCoin2], // This should consume the 0.5 SUI + }); + + // Test 6: Use coins in MakeMoveVec (should consume them) + const wethCoin = tx.object(TEST_WETH_COIN_ID); + const coinVec = tx.makeMoveVec({ + elements: [wethCoin], + }); + + tx.moveCall({ + target: '0x999::test::batch_operation', + arguments: [coinVec], + }); + + const results = await analyze( + { coinFlows }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Verify coin flows are tracked correctly + expect(results.coinFlows.result?.outflows).toMatchInlineSnapshot(` + [ + { + "amount": 1610000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + }, + { + "amount": 500000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC", + }, + { + "amount": 2500000000000000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000b0c::weth::WETH", + }, + ] + `); + + // Verify SUI outflow: 1 SUI (split1) + 0.1 SUI (gas) + 0.5 SUI (consumed in move call) = 1.6 SUI + const suiFlow = results.coinFlows.result?.outflows.find( + (flow) => + flow.coinType === + '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + ); + expect(suiFlow?.amount).toBe(1610000000n); // 1.6 SUI + 0.01 SUI gas budget + + // Verify USDC outflow: 500 USDC transferred + const usdcFlow = results.coinFlows.result?.outflows.find( + (flow) => + flow.coinType === + '0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC', + ); + expect(usdcFlow?.amount).toBe(500000000n); // Positive means outflow + + // Verify WETH outflow: entire coin consumed in MakeMoveVec + const wethFlow = results.coinFlows.result?.outflows.find( + (flow) => + flow.coinType === + '0x0000000000000000000000000000000000000000000000000000000000000b0c::weth::WETH', + ); + expect(wethFlow?.amount).toBe(2500000000000000000n); // WETH balance consumed + }); +}); diff --git a/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts b/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts new file mode 100644 index 000000000..265af65f5 --- /dev/null +++ b/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts @@ -0,0 +1,309 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, it, expect } from 'vitest'; +import { Transaction } from '@mysten/sui/transactions'; +import { analyze } from '../../src/transaction-analyzer/analyzer'; +import { coinValue } from '../../src/transaction-analyzer/rules/coin-value'; +import { MockSuiClient } from '../mocks/MockSuiClient'; +import { + DEFAULT_SENDER, + createAddressOwner, + TEST_COIN_1_ID, + TEST_USDC_COIN_ID, + TEST_WETH_COIN_ID, +} from '../mocks/mockData'; + +describe('TransactionAnalyzer - Coin Value Rule', () => { + // Mock price provider function + const mockGetCoinPrices = async (coinTypes: string[]) => { + const priceMap: Record = { + '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI': { + decimals: 9, + price: 2.5, // $2.50 per SUI + }, + '0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC': { + decimals: 6, + price: 1.0, // $1.00 per USDC + }, + '0x0000000000000000000000000000000000000000000000000000000000000b0c::weth::WETH': { + decimals: 18, + price: 3000.0, // $3000 per WETH + }, + // Unknown token without price + '0x0000000000000000000000000000000000000000000000000000000000000999::unknown::TOKEN': { + decimals: 8, + price: null, + }, + }; + + return coinTypes.map((coinType) => ({ + coinType, + decimals: priceMap[coinType]?.decimals ?? 0, + price: priceMap[coinType]?.price ?? null, + })); + }; + + it('should calculate coin values for transactions with known prices', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Create a transaction that uses multiple coin types + const suiCoin = tx.object(TEST_COIN_1_ID); // 5 SUI + const usdcCoin = tx.object(TEST_USDC_COIN_ID); // 500 USDC from default mock + const wethCoin = tx.object(TEST_WETH_COIN_ID); // 2.5 WETH from default mock + + // Transfer 1 SUI, 100 USDC, and 0.5 WETH + const [suiSplit] = tx.splitCoins(suiCoin, [1000000000n]); // 1 SUI + const [usdcSplit] = tx.splitCoins(usdcCoin, [100000000n]); // 100 USDC + const [wethSplit] = tx.splitCoins(wethCoin, [500000000000000000n]); // 0.5 WETH + + tx.transferObjects([suiSplit, usdcSplit, wethSplit], tx.pure.address('0x456')); + + const results = await analyze( + { coinValue }, + { + client, + transactionJson: await tx.toJSON(), + getCoinPrices: mockGetCoinPrices, + }, + ); + + // Verify coin value analysis + expect(results.coinValue.result).toMatchInlineSnapshot(` + { + "coinTypes": [ + { + "amount": 1010000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + "convertedAmount": 2.525, + "decimals": 9, + "price": 2.5, + }, + { + "amount": 100000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC", + "convertedAmount": 100, + "decimals": 6, + "price": 1, + }, + { + "amount": 500000000000000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000b0c::weth::WETH", + "convertedAmount": 1500, + "decimals": 18, + "price": 3000, + }, + ], + "coinTypesWithoutPrice": [], + "total": 1602.525, + } + `); + }); + + it('should handle transactions with no coin flows', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Empty transaction - no coin flows except gas budget + const results = await analyze( + { coinValue }, + { + client, + transactionJson: await tx.toJSON(), + getCoinPrices: mockGetCoinPrices, + }, + ); + + // Should have no value calculations for empty transaction + expect(results.coinValue.result).toEqual({ + coinTypes: [ + { + coinType: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', + decimals: 9, + price: 2.5, + amount: 10000000n, + convertedAmount: 0.025, + }, + ], + coinTypesWithoutPrice: [], + total: 0.025, + }); + }); + + it('should handle coins without known prices', async () => { + const client = new MockSuiClient(); + + // Add an unknown token + client.addCoin({ + objectId: '0xa5c020', + coinType: '0x999::unknown::TOKEN', + balance: 1000000000n, + owner: createAddressOwner(DEFAULT_SENDER), + }); + + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Transfer some SUI (known price) and unknown token (no price) + const suiCoin = tx.object(TEST_COIN_1_ID); + const unknownCoin = tx.object('0xa5c020'); + + const [suiSplit] = tx.splitCoins(suiCoin, [500000000n]); // 0.5 SUI + tx.transferObjects([suiSplit, unknownCoin], tx.pure.address('0x456')); + + const results = await analyze( + { coinValue }, + { + client, + transactionJson: await tx.toJSON(), + getCoinPrices: mockGetCoinPrices, + }, + ); + + // Should track coins without prices separately + expect(results.coinValue.result?.coinTypesWithoutPrice).toContain( + '0x0000000000000000000000000000000000000000000000000000000000000999::unknown::TOKEN', + ); + }); + + it('should calculate correct USD values with proper decimals', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Create precise amounts for calculation testing + const suiCoin = tx.object(TEST_COIN_1_ID); + + // Split exactly 2.5 SUI (2500000000 = 2.5 * 10^9) + // At $2.50 per SUI, this should be $6.25 total + const [suiSplit] = tx.splitCoins(suiCoin, [2500000000n]); + tx.transferObjects([suiSplit], tx.pure.address('0x456')); + + const results = await analyze( + { coinValue }, + { + client, + transactionJson: await tx.toJSON(), + getCoinPrices: mockGetCoinPrices, + }, + ); + + expect(results.coinValue.result).toMatchInlineSnapshot(` + { + "coinTypes": [ + { + "amount": 2510000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + "convertedAmount": 6.2749999999999995, + "decimals": 9, + "price": 2.5, + }, + ], + "coinTypesWithoutPrice": [], + "total": 6.2749999999999995, + } + `); + }); + + it('should handle mixed scenarios with some priced and some unpriced coins', async () => { + const client = new MockSuiClient(); + + // Add coins with and without prices + client.addCoin({ + objectId: '0xa5c021', + coinType: '0x999::unknown::TOKEN', + balance: 1000000000n, + owner: createAddressOwner(DEFAULT_SENDER), + }); + + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Use both types + const suiCoin = tx.object(TEST_COIN_1_ID); // Has price + const usdcCoin = tx.object(TEST_USDC_COIN_ID); // Has price + const unknownCoin = tx.object('0xa5c021'); // No price + + const [suiSplit] = tx.splitCoins(suiCoin, [1000000000n]); // 1 SUI = $2.50 + const [usdcSplit] = tx.splitCoins(usdcCoin, [50000000n]); // 50 USDC = $50.00 + + tx.transferObjects([suiSplit, usdcSplit, unknownCoin], tx.pure.address('0x456')); + + const results = await analyze( + { coinValue }, + { + client, + transactionJson: await tx.toJSON(), + getCoinPrices: mockGetCoinPrices, + }, + ); + + // Should have mixed results - some with prices, some without + expect(results.coinValue.result?.coinTypesWithoutPrice).toContain( + '0x0000000000000000000000000000000000000000000000000000000000000999::unknown::TOKEN', + ); + }); + + it('should handle price provider errors gracefully', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const suiCoin = tx.object(TEST_COIN_1_ID); + const [suiSplit] = tx.splitCoins(suiCoin, [1000000000n]); + tx.transferObjects([suiSplit], tx.pure.address('0x456')); + + // Price provider that throws an error + const errorGetCoinPrices = async () => { + throw new Error('Price provider unavailable'); + }; + + // Should handle the error gracefully by returning issues + const results = await analyze( + { coinValue }, + { + client, + transactionJson: await tx.toJSON(), + getCoinPrices: errorGetCoinPrices, + }, + ); + + expect(results.coinValue.issues).toBeDefined(); + expect(results.coinValue.result).toBeUndefined(); + expect(results.coinValue.issues).toMatchInlineSnapshot(` + [ + { + "message": "Unexpected error while analyzing transaction: Price provider unavailable", + }, + ] + `); + }); + + it('should only calculate values for outflow coins (spent coins)', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const suiCoin = tx.object(TEST_COIN_1_ID); + + // Split and transfer back to sender (should not create outflow) + const [suiSplit] = tx.splitCoins(suiCoin, [1000000000n]); + tx.transferObjects([suiSplit], tx.pure.address(DEFAULT_SENDER)); + + const results = await analyze( + { coinValue }, + { + client, + transactionJson: await tx.toJSON(), + getCoinPrices: mockGetCoinPrices, + }, + ); + + // Should have no value calculation since coins weren't actually spent + expect(results.coinValue.result?.total).toBe(0.025); + expect(results.coinValue.result?.coinTypes).toHaveLength(1); + }); +}); diff --git a/packages/wallet-sdk/test/transaction-analyzer/coins.test.ts b/packages/wallet-sdk/test/transaction-analyzer/coins.test.ts new file mode 100644 index 000000000..23bd652c5 --- /dev/null +++ b/packages/wallet-sdk/test/transaction-analyzer/coins.test.ts @@ -0,0 +1,174 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, it, expect } from 'vitest'; +import { Transaction } from '@mysten/sui/transactions'; +import { analyze } from '../../src/transaction-analyzer/analyzer'; +import { coins, gasCoins } from '../../src/transaction-analyzer/rules/coins'; +import { MockSuiClient } from '../mocks/MockSuiClient'; +import { + DEFAULT_SENDER, + createAddressOwner, + TEST_COIN_1_ID, + TEST_COIN_2_ID, + TEST_NFT_ID, +} from '../mocks/mockData'; + +describe('TransactionAnalyzer - Coins Rule', () => { + it('should analyze all coin-related functionality in a single transaction', async () => { + const client = new MockSuiClient(); + + // Add additional coins to exercise various features + client.addCoin({ + objectId: '0xabc123', + coinType: '0xa0b::usdc::USDC', + balance: 500000000n, + owner: createAddressOwner(DEFAULT_SENDER), + }); + + client.addCoin({ + objectId: '0xdef456', + coinType: '0x2::sui::SUI', + balance: 100000000n, + owner: { $kind: 'ObjectOwner', ObjectOwner: '0x00parent' }, + }); + + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // 1. Use SUI coins in various commands + const suiCoin1 = tx.object(TEST_COIN_1_ID); + const suiCoin2 = tx.object(TEST_COIN_2_ID); + + // 2. Use USDC coin + const usdcCoin = tx.object('0xabc123'); + + // 3. Use coin with different owner (ObjectOwner) + const parentOwnedCoin = tx.object('0xdef456'); + + // 5. Split/merge operations + tx.splitCoins(suiCoin1, [100, 200]); + tx.mergeCoins(suiCoin1, [suiCoin2]); + + // 6. Use gas coin (should appear in gasCoins, not coins) + tx.splitCoins(tx.gas, [50]); + + // 7. Create vector of coins (nested structure) + const coinVec = tx.makeMoveVec({ + elements: [suiCoin1, usdcCoin], + }); + + // 8. Use coins in multiple ways (deduplication test) + tx.moveCall({ + target: '0x999::test::transfer', + arguments: [suiCoin1, parentOwnedCoin], + }); + + tx.moveCall({ + target: '0x999::test::batch_transfer', + arguments: [coinVec, suiCoin1], // suiCoin1 used again + }); + + // 9. Include a non-coin object to verify filtering + const nft = tx.object(TEST_NFT_ID); + tx.moveCall({ + target: '0x999::test::transfer_nft', + arguments: [nft], + }); + + const results = await analyze( + { coins, gasCoins }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should detect all coin objects but not the NFT + expect(Object.keys(results.coins.result)).toHaveLength(4); + expect(results.coins.result).toMatchInlineSnapshot(` + { + "0x0000000000000000000000000000000000000000000000000000000000a5c000": { + "balance": 5000000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + "0x0000000000000000000000000000000000000000000000000000000000a5c001": { + "balance": 2500000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c001", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "101", + }, + "0x0000000000000000000000000000000000000000000000000000000000abc123": { + "balance": 500000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC", + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000abc123", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000a0b::usdc::USDC>", + "version": "100", + }, + "0x0000000000000000000000000000000000000000000000000000000000def456": { + "balance": 100000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000def456", + "owner": { + "$kind": "ObjectOwner", + "ObjectOwner": "0x00parent", + }, + "ownerAddress": "0x00parent", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + } + `); + + expect(results.gasCoins.result).toMatchInlineSnapshot(` + [ + { + "balance": 5000000000n, + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + ] + `); + }); +}); diff --git a/packages/wallet-sdk/test/transaction-analyzer/commands.test.ts b/packages/wallet-sdk/test/transaction-analyzer/commands.test.ts new file mode 100644 index 000000000..321f909ab --- /dev/null +++ b/packages/wallet-sdk/test/transaction-analyzer/commands.test.ts @@ -0,0 +1,274 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, it, expect } from 'vitest'; +import { Transaction } from '@mysten/sui/transactions'; +import { analyze } from '../../src/transaction-analyzer/analyzer'; +import { commands } from '../../src/transaction-analyzer/rules/commands'; +import { MockSuiClient } from '../mocks/MockSuiClient'; +import { DEFAULT_SENDER, TEST_COIN_1_ID, TEST_COIN_2_ID } from '../mocks/mockData'; + +describe('TransactionAnalyzer - Commands Rule', () => { + it('should analyze all types of commands in a single transaction', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // 1. MakeMoveVec command + const coin1 = tx.object(TEST_COIN_1_ID); + const coin2 = tx.object(TEST_COIN_2_ID); + const coinVec = tx.makeMoveVec({ elements: [coin1, coin2] }); + + // 2. SplitCoins command (with gas coin) + const splitResult = tx.splitCoins(tx.gas, [100]); + + // 3. MergeCoins command + tx.mergeCoins(coin1, [coin2]); + + // 4. TransferObjects command (using split result) + tx.transferObjects([splitResult], tx.pure.address('0x456')); + + // 5. MoveCall command (using vector and pure args) + tx.moveCall({ + target: '0x999::test::batch_transfer', + arguments: [coinVec], + }); + + const results = await analyze( + { commands }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + expect(results.commands.result).toMatchInlineSnapshot(` + [ + { + "$kind": "MakeMoveVec", + "command": { + "elements": [ + { + "$kind": "Input", + "Input": 0, + }, + { + "$kind": "Input", + "Input": 1, + }, + ], + "type": null, + }, + "elements": [ + { + "$kind": "Object", + "accessLevel": "transfer", + "index": 0, + "object": { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + }, + { + "$kind": "Object", + "accessLevel": "transfer", + "index": 1, + "object": { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c001", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "101", + }, + }, + ], + "index": 0, + }, + { + "$kind": "SplitCoins", + "amounts": [ + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "ZAAAAAAAAAA=", + "index": 2, + }, + ], + "coin": { + "$kind": "GasCoin", + "accessLevel": "mutate", + }, + "command": { + "amounts": [ + { + "$kind": "Input", + "Input": 2, + }, + ], + "coin": { + "$kind": "GasCoin", + "GasCoin": true, + }, + }, + "index": 1, + }, + { + "$kind": "MergeCoins", + "command": { + "destination": { + "$kind": "Input", + "Input": 0, + }, + "sources": [ + { + "$kind": "Input", + "Input": 1, + }, + ], + }, + "destination": { + "$kind": "Object", + "accessLevel": "mutate", + "index": 0, + "object": { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + }, + "index": 2, + "sources": [ + { + "$kind": "Object", + "accessLevel": "transfer", + "index": 1, + "object": { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c001", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "101", + }, + }, + ], + }, + { + "$kind": "TransferObjects", + "address": { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFY=", + "index": 3, + }, + "command": { + "address": { + "$kind": "Input", + "Input": 3, + }, + "objects": [ + { + "$kind": "Result", + "Result": 1, + }, + ], + }, + "index": 3, + "objects": [ + { + "$kind": "Result", + "accessLevel": "transfer", + "index": [ + 1, + 0, + ], + }, + ], + }, + { + "$kind": "MoveCall", + "arguments": [ + { + "$kind": "Result", + "accessLevel": "mutate", + "index": [ + 0, + 0, + ], + }, + ], + "command": { + "arguments": [ + { + "$kind": "Result", + "Result": 0, + }, + ], + "function": "batch_transfer", + "module": "test", + "package": "0x0000000000000000000000000000000000000000000000000000000000000999", + "typeArguments": [], + }, + "function": { + "isEntry": false, + "moduleName": "test", + "name": "batch_transfer", + "packageId": "0x0000000000000000000000000000000000000000000000000000000000000999", + "parameters": [ + { + "body": { + "$kind": "vector", + "vector": { + "$kind": "datatype", + "datatype": { + "typeName": "0x2::coin::Coin", + "typeParameters": [ + { + "$kind": "typeParameter", + "index": 0, + }, + ], + }, + }, + }, + "reference": "mutable", + }, + ], + "returns": [], + "typeParameters": [], + "visibility": "public", + }, + "index": 4, + }, + ] + `); + }); +}); diff --git a/packages/wallet-sdk/test/transaction-analyzer/functions.test.ts b/packages/wallet-sdk/test/transaction-analyzer/functions.test.ts new file mode 100644 index 000000000..b6a8a164a --- /dev/null +++ b/packages/wallet-sdk/test/transaction-analyzer/functions.test.ts @@ -0,0 +1,272 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, it, expect } from 'vitest'; +import { Transaction } from '@mysten/sui/transactions'; +import { analyze } from '../../src/transaction-analyzer/analyzer'; +import { moveFunctions } from '../../src/transaction-analyzer/rules/functions'; +import { MockSuiClient } from '../mocks/MockSuiClient'; +import { + DEFAULT_SENDER, + TEST_COIN_1_ID, + TEST_COIN_2_ID, + TEST_PACKAGE_ID, + DEFI_PACKAGE_ID, + NFT_PACKAGE_ID, +} from '../mocks/mockData'; + +describe('TransactionAnalyzer - Functions Rule', () => { + it('should analyze all Move functions in a single transaction', async () => { + const client = new MockSuiClient(); + + // Add additional Move functions to test various scenarios + client.addMoveFunction({ + packageId: DEFI_PACKAGE_ID, + moduleName: 'defi', + name: 'swap', + visibility: 'public', + isEntry: true, + parameters: [ + { + body: { + $kind: 'datatype', + datatype: { + typeName: '0x2::coin::Coin', + typeParameters: [{ $kind: 'typeParameter', index: 0 }], + }, + }, + reference: null, + }, + ], + returns: [], + }); + + client.addMoveFunction({ + packageId: NFT_PACKAGE_ID, + moduleName: 'nft', + name: 'mint', + visibility: 'public', + isEntry: false, + parameters: [ + { + body: { $kind: 'address' }, + reference: null, + }, + { + body: { $kind: 'vector', vector: { $kind: 'u8' } }, + reference: null, + }, + ], + returns: [ + { + body: { + $kind: 'datatype', + datatype: { + typeName: '0xdef::nft::NFT', + typeParameters: [], + }, + }, + reference: null, + }, + ], + }); + + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + const coin1 = tx.object(TEST_COIN_1_ID); + const coin2 = tx.object(TEST_COIN_2_ID); + + // 1. Call existing default function + tx.moveCall({ + target: `${TEST_PACKAGE_ID}::test::transfer`, + arguments: [coin1], + }); + + // 2. Call batch transfer function + const coinVec = tx.makeMoveVec({ elements: [coin1, coin2] }); + tx.moveCall({ + target: `${TEST_PACKAGE_ID}::test::batch_transfer`, + arguments: [coinVec], + }); + + // 3. Call custom defi swap function + tx.moveCall({ + target: `${DEFI_PACKAGE_ID}::defi::swap`, + arguments: [coin2], + }); + + // 4. Call NFT mint function + tx.moveCall({ + target: `${NFT_PACKAGE_ID}::nft::mint`, + arguments: [tx.pure.address('0x123'), tx.pure.vector('u8', [1, 2, 3])], + }); + + const results = await analyze( + { moveFunctions }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should find 4 functions (4 successfully fetched) + expect(results.moveFunctions.result).toHaveLength(4); + expect(results.moveFunctions.result).toMatchInlineSnapshot(` + [ + { + "isEntry": false, + "moduleName": "test", + "name": "transfer", + "packageId": "0x0000000000000000000000000000000000000000000000000000000000000999", + "parameters": [ + { + "body": { + "$kind": "datatype", + "datatype": { + "typeName": "0x999::nft::NFT", + "typeParameters": [], + }, + }, + "reference": "mutable", + }, + { + "body": { + "$kind": "u64", + }, + "reference": null, + }, + { + "body": { + "$kind": "address", + }, + "reference": null, + }, + { + "body": { + "$kind": "bool", + }, + "reference": null, + }, + ], + "returns": [], + "typeParameters": [], + "visibility": "public", + }, + { + "isEntry": false, + "moduleName": "test", + "name": "batch_transfer", + "packageId": "0x0000000000000000000000000000000000000000000000000000000000000999", + "parameters": [ + { + "body": { + "$kind": "vector", + "vector": { + "$kind": "datatype", + "datatype": { + "typeName": "0x2::coin::Coin", + "typeParameters": [ + { + "$kind": "typeParameter", + "index": 0, + }, + ], + }, + }, + }, + "reference": "mutable", + }, + ], + "returns": [], + "typeParameters": [], + "visibility": "public", + }, + { + "isEntry": true, + "moduleName": "defi", + "name": "swap", + "packageId": "0x0000000000000000000000000000000000000000000000000000000000000abc", + "parameters": [ + { + "body": { + "$kind": "datatype", + "datatype": { + "typeName": "0x2::coin::Coin", + "typeParameters": [ + { + "$kind": "typeParameter", + "index": 0, + }, + ], + }, + }, + "reference": null, + }, + ], + "returns": [], + "typeParameters": [], + "visibility": "public", + }, + { + "isEntry": false, + "moduleName": "nft", + "name": "mint", + "packageId": "0x0000000000000000000000000000000000000000000000000000000000000def", + "parameters": [ + { + "body": { + "$kind": "address", + }, + "reference": null, + }, + { + "body": { + "$kind": "vector", + "vector": { + "$kind": "u8", + }, + }, + "reference": null, + }, + ], + "returns": [ + { + "body": { + "$kind": "datatype", + "datatype": { + "typeName": "0xdef::nft::NFT", + "typeParameters": [], + }, + }, + "reference": null, + }, + ], + "typeParameters": [], + "visibility": "public", + }, + ] + `); + + // Verify specific function details + const transferFunc = results.moveFunctions.result?.find((f) => f.name === 'transfer'); + expect(transferFunc?.isEntry).toBe(false); + expect(transferFunc?.visibility).toBe('public'); + expect(transferFunc?.parameters).toHaveLength(4); + + const batchTransferFunc = results.moveFunctions.result?.find( + (f) => f.name === 'batch_transfer', + ); + expect(batchTransferFunc?.parameters[0]?.body?.$kind).toBe('vector'); + + const swapFunc = results.moveFunctions.result?.find((f) => f.name === 'swap'); + expect(swapFunc?.packageId).toBe( + '0x0000000000000000000000000000000000000000000000000000000000000abc', + ); + + const mintFunc = results.moveFunctions.result?.find((f) => f.name === 'mint'); + expect(mintFunc?.isEntry).toBe(false); + expect(mintFunc?.returns).toHaveLength(1); + expect(mintFunc?.parameters).toHaveLength(2); + }); +}); diff --git a/packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts b/packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts new file mode 100644 index 000000000..9d642e926 --- /dev/null +++ b/packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts @@ -0,0 +1,233 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, it, expect } from 'vitest'; +import { Transaction } from '@mysten/sui/transactions'; +import { normalizeSuiAddress } from '@mysten/sui/utils'; +import { analyze } from '../../src/transaction-analyzer/analyzer'; +import { inputs } from '../../src/transaction-analyzer/rules/inputs'; +import { bcs } from '@mysten/sui/bcs'; +import { MockSuiClient } from '../mocks/MockSuiClient'; +import { + DEFAULT_SENDER, + TEST_COIN_1_ID, + TEST_SHARED_OBJECT_ID, + TEST_NFT_ID, +} from '../mocks/mockData'; + +describe('TransactionAnalyzer - Inputs Rule', () => { + it('should analyze all input types in a single transaction', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // 1. Pure inputs - various types + const u64Value = tx.pure.u64(1000n); + const addressValue = tx.pure.address('0x456'); + const boolValue = tx.pure.bool(true); + const stringValue = tx.pure.string('hello world'); + + // 2. Complex pure inputs + const vectorValue = tx.pure.vector('u64', [100n, 200n, 300n]); + const optionValue = tx.pure(bcs.option(bcs.Address).serialize(normalizeSuiAddress('0x123'))); + + // 3. Object inputs - different types + const ownedObject = tx.object(TEST_COIN_1_ID); // Uses UnresolvedObject resolution + const sharedObject = tx.sharedObjectRef({ + objectId: TEST_SHARED_OBJECT_ID, + mutable: true, + initialSharedVersion: '1', + }); + const receivingObject = tx.receivingRef({ + objectId: TEST_NFT_ID, + digest: 'E7YX7zmxdAVVzrGkcoss2ziUHKMa7qBChPbqg5nGQyYo', + version: '2', + }); + + // 4. Gas coin usage (creates implicit pure input) + tx.splitCoins(tx.gas, [50]); + + // 5. Use all inputs in various commands to ensure they're analyzed + tx.moveCall({ + target: '0x999::test::complex_call', + arguments: [ + ownedObject, + u64Value, + addressValue, + boolValue, + stringValue, + vectorValue, + optionValue, + sharedObject, + receivingObject, + ], + }); + + const results = await analyze( + { inputs }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should have 10 inputs: 6 pure values + 1 pure for gas split + 3 objects + expect(results.inputs.result).toHaveLength(10); + expect(results.inputs.result).toMatchInlineSnapshot(` + [ + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "6AMAAAAAAAA=", + "index": 0, + }, + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFY=", + "index": 1, + }, + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "AQ==", + "index": 2, + }, + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "C2hlbGxvIHdvcmxk", + "index": 3, + }, + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "A2QAAAAAAAAAyAAAAAAAAAAsAQAAAAAAAA==", + "index": 4, + }, + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEj", + "index": 5, + }, + { + "$kind": "Object", + "accessLevel": "read", + "index": 6, + "object": { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + }, + { + "$kind": "Object", + "accessLevel": "read", + "index": 7, + "object": { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x000000000000000000000000000000000000000000000000000000000000beef", + "owner": { + "$kind": "Shared", + "Shared": { + "initialSharedVersion": "1", + }, + }, + "ownerAddress": null, + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000999::pool::Pool", + "version": "1", + }, + }, + { + "$kind": "Object", + "accessLevel": "read", + "index": 8, + "object": { + "content": Promise {}, + "digest": "E7YX7zmxdAVVzrGkcoss2ziUHKMa7qBChPbqg5nGQyYo", + "id": "0x000000000000000000000000000000000000000000000000000000000000dead", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0xbabe", + }, + "ownerAddress": "0xbabe", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000999::nft::NFT", + "version": "2", + }, + }, + { + "$kind": "Pure", + "accessLevel": "transfer", + "bytes": "MgAAAAAAAAA=", + "index": 9, + }, + ] + `); + + // Verify some specific input values + const u64Input = results.inputs.result?.[0]; + if (u64Input?.$kind === 'Pure') { + expect(BigInt(bcs.u64().fromBase64(u64Input.bytes))).toBe(1000n); + } + + const addressInput = results.inputs.result?.[1]; + if (addressInput?.$kind === 'Pure') { + expect(bcs.Address.fromBase64(addressInput.bytes)).toBe(normalizeSuiAddress('0x456')); + } + + const boolInput = results.inputs.result?.[2]; + if (boolInput?.$kind === 'Pure') { + expect(bcs.bool().fromBase64(boolInput.bytes)).toBe(true); + } + + const stringInput = results.inputs.result?.[3]; + if (stringInput?.$kind === 'Pure') { + expect(bcs.string().fromBase64(stringInput.bytes)).toBe('hello world'); + } + + const vectorInput = results.inputs.result?.[4]; + if (vectorInput?.$kind === 'Pure') { + const decoded = bcs.vector(bcs.u64()).fromBase64(vectorInput.bytes); + expect(decoded.map((v) => BigInt(v))).toEqual([100n, 200n, 300n]); + } + + // Object inputs + const ownedObjectInput = results.inputs.result?.[6]; + if (ownedObjectInput?.$kind === 'Object') { + expect(ownedObjectInput.object.id).toBe(normalizeSuiAddress(TEST_COIN_1_ID)); + expect(ownedObjectInput.object.owner.$kind).toBe('AddressOwner'); + } + + const sharedObjectInput = results.inputs.result?.[7]; + if (sharedObjectInput?.$kind === 'Object') { + expect(sharedObjectInput.object.id).toBe(normalizeSuiAddress(TEST_SHARED_OBJECT_ID)); + expect(sharedObjectInput.object.owner.$kind).toBe('Shared'); + } + + const receivingObjectInput = results.inputs.result?.[8]; + if (receivingObjectInput?.$kind === 'Object') { + expect(receivingObjectInput.object.id).toBe(normalizeSuiAddress(TEST_NFT_ID)); + expect(receivingObjectInput.object.type).toBe( + '0x0000000000000000000000000000000000000000000000000000000000000999::nft::NFT', + ); + } + + // Gas split amount + const gasAmountInput = results.inputs.result?.[9]; + if (gasAmountInput?.$kind === 'Pure') { + expect(BigInt(bcs.u64().fromBase64(gasAmountInput.bytes))).toBe(50n); + } + }); +}); diff --git a/packages/wallet-sdk/test/transaction-analyzer/objects.test.ts b/packages/wallet-sdk/test/transaction-analyzer/objects.test.ts new file mode 100644 index 000000000..38f64bb74 --- /dev/null +++ b/packages/wallet-sdk/test/transaction-analyzer/objects.test.ts @@ -0,0 +1,250 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, it, expect } from 'vitest'; +import { Transaction } from '@mysten/sui/transactions'; +import { analyze } from '../../src/transaction-analyzer/analyzer'; +import { + objectIds, + objects, + ownedObjects, + objectsById, +} from '../../src/transaction-analyzer/rules/objects'; +import { MockSuiClient } from '../mocks/MockSuiClient'; +import { + DEFAULT_SENDER, + TEST_COIN_1_ID, + TEST_SHARED_OBJECT_ID, + TEST_NFT_ID, + TEST_PARENT_OWNED_COIN_ID, + TEST_CONSENSUS_COIN_ID, +} from '../mocks/mockData'; + +describe('TransactionAnalyzer - Objects Rule', () => { + it('should analyze all object types in a single transaction', async () => { + const client = new MockSuiClient(); + const tx = new Transaction(); + tx.setSender(DEFAULT_SENDER); + + // Use existing default mock objects which cover all ownership patterns: + + // 1. Use owned objects (address owner) + const ownedCoin = tx.object(TEST_COIN_1_ID); // 0xa5c000 - AddressOwner + + // 2. Use object with ObjectOwner + const parentOwnedCoin = tx.object(TEST_PARENT_OWNED_COIN_ID); // ObjectOwner: '0xparent' + + // 3. Use shared object + const sharedObject = tx.sharedObjectRef({ + objectId: TEST_SHARED_OBJECT_ID, // 0xbeef - shared pool + mutable: true, + initialSharedVersion: '1', + }); + + // 4. Use receiving object (NFT owned by different user) + const receivingObject = tx.receivingRef({ + objectId: TEST_NFT_ID, // 0xdead - owned by 0xbabe + digest: 'E7YX7zmxdAVVzrGkcoss2ziUHKMa7qBChPbqg5nGQyYo', + version: '2', + }); + + // 5. Use coin with ConsensusAddressOwner + const consensusCoin = tx.object(TEST_CONSENSUS_COIN_ID); + + // 6. Use gas coin (should also be tracked) + tx.splitCoins(tx.gas, [100]); + + // Use all objects in various commands + tx.moveCall({ + target: '0x999::test::complex_transfer', + arguments: [ownedCoin, parentOwnedCoin, sharedObject, consensusCoin, receivingObject], + }); + + const results = await analyze( + { objectIds, objects, ownedObjects, objectsById }, + { + client, + transactionJson: await tx.toJSON(), + }, + ); + + // Should detect all object IDs (including gas payment) + expect(results.objectIds.result).toHaveLength(5); + expect(results.objectIds.result).toMatchInlineSnapshot(` + [ + "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "0x0000000000000000000000000000000000000000000000000000000000a5c004", + "0x000000000000000000000000000000000000000000000000000000000000beef", + "0x000000000000000000000000000000000000000000000000000000000000dead", + "0x0000000000000000000000000000000000000000000000000000000000a5c005", + ] + `); + + // Should have all objects with ownership info + expect(results.objects.result).toHaveLength(5); + expect(results.objects.result).toMatchInlineSnapshot(` + [ + { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c004", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "104", + }, + { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x000000000000000000000000000000000000000000000000000000000000beef", + "owner": { + "$kind": "Shared", + "Shared": { + "initialSharedVersion": "1", + }, + }, + "ownerAddress": null, + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000999::pool::Pool", + "version": "1", + }, + { + "content": Promise {}, + "digest": "E7YX7zmxdAVVzrGkcoss2ziUHKMa7qBChPbqg5nGQyYo", + "id": "0x000000000000000000000000000000000000000000000000000000000000dead", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0xbabe", + }, + "ownerAddress": "0xbabe", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000999::nft::NFT", + "version": "2", + }, + { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c005", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "105", + }, + ] + `); + + // Should filter owned objects (exclude shared and immutable) + expect(results.ownedObjects.result).toHaveLength(4); + expect(results.ownedObjects.result).toMatchInlineSnapshot(` + [ + { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c000", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "100", + }, + { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c004", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "104", + }, + { + "content": Promise {}, + "digest": "E7YX7zmxdAVVzrGkcoss2ziUHKMa7qBChPbqg5nGQyYo", + "id": "0x000000000000000000000000000000000000000000000000000000000000dead", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0xbabe", + }, + "ownerAddress": "0xbabe", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000999::nft::NFT", + "version": "2", + }, + { + "content": Promise {}, + "digest": "11111111111111111111111111111111", + "id": "0x0000000000000000000000000000000000000000000000000000000000a5c005", + "owner": { + "$kind": "AddressOwner", + "AddressOwner": "0x0000000000000000000000000000000000000000000000000000000000000123", + }, + "ownerAddress": "0x0000000000000000000000000000000000000000000000000000000000000123", + "previousTransaction": null, + "type": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>", + "version": "105", + }, + ] + `); + + // Should create objects by ID map + expect(results.objectsById.result?.size).toBe(5); + expect( + results.objectsById.result?.has( + '0x0000000000000000000000000000000000000000000000000000000000a5c000', + ), + ).toBe(true); + expect( + results.objectsById.result?.has( + '0x0000000000000000000000000000000000000000000000000000000000a5c004', + ), + ).toBe(true); + expect( + results.objectsById.result?.has( + '0x000000000000000000000000000000000000000000000000000000000000beef', + ), + ).toBe(true); + + // Verify specific object details + const ownedObject = results.objectsById.result?.get( + '0x0000000000000000000000000000000000000000000000000000000000a5c000', + ); + expect(ownedObject?.ownerAddress).toBe(DEFAULT_SENDER); + + const sharedObjectResult = results.objectsById.result?.get( + '0x000000000000000000000000000000000000000000000000000000000000beef', + ); + expect(sharedObjectResult?.ownerAddress).toBe(null); + + const nftObjectResult = results.objectsById.result?.get( + '0x000000000000000000000000000000000000000000000000000000000000dead', + ); + expect(nftObjectResult?.ownerAddress).toBe('0xbabe'); + }); +}); diff --git a/packages/wallet-sdk/test/tsconfig.json b/packages/wallet-sdk/test/tsconfig.json new file mode 100644 index 000000000..c95166e77 --- /dev/null +++ b/packages/wallet-sdk/test/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "include": ["**/*.ts", "**/*.tsx", "../src/**/*.ts"], + "compilerOptions": { + "types": ["vitest/globals", "node"], + "rootDir": "../", + "noEmit": true + } +} diff --git a/packages/wallet-sdk/tsconfig.esm.json b/packages/wallet-sdk/tsconfig.esm.json new file mode 100644 index 000000000..5048bdf8f --- /dev/null +++ b/packages/wallet-sdk/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ESNext", + "outDir": "dist/esm" + } +} diff --git a/packages/wallet-sdk/tsconfig.json b/packages/wallet-sdk/tsconfig.json new file mode 100644 index 000000000..4453986bf --- /dev/null +++ b/packages/wallet-sdk/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../build-scripts/tsconfig.shared.json", + "include": ["src"], + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist/cjs", + "isolatedModules": true, + "rootDir": "src" + } +} diff --git a/packages/wallet-sdk/typedoc.json b/packages/wallet-sdk/typedoc.json new file mode 100644 index 000000000..ccb323f01 --- /dev/null +++ b/packages/wallet-sdk/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": ["src"], + "excludeInternal": true, + "excludePrivate": true, + "intentionallyNotExported": [] +} diff --git a/packages/wallet-sdk/vitest.config.mts b/packages/wallet-sdk/vitest.config.mts new file mode 100644 index 000000000..bdc36a5e4 --- /dev/null +++ b/packages/wallet-sdk/vitest.config.mts @@ -0,0 +1,6 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { defineConfig } from 'vitest/config'; + +export default defineConfig({}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a2b6150ff..8b1f4e680 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1541,6 +1541,40 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + packages/wallet-sdk: + dependencies: + '@mysten/bcs': + specifier: workspace:* + version: link:../bcs + '@mysten/dapp-kit-react': + specifier: workspace:* + version: link:../dapp-kit-next/packages/dapp-kit-react + '@mysten/sui': + specifier: workspace:* + version: link:../typescript + '@mysten/wallet-standard': + specifier: workspace:* + version: link:../wallet-standard + valibot: + specifier: ^0.36.0 + version: 0.36.0 + devDependencies: + '@mysten/build-scripts': + specifier: workspace:* + version: link:../build-scripts + '@types/node': + specifier: ^22.15.29 + version: 22.18.6 + msw: + specifier: ^2.11.1 + version: 2.11.1(@types/node@22.18.6)(typescript@5.9.2) + typescript: + specifier: ^5.9.2 + version: 5.9.2 + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.6)(happy-dom@18.0.1)(jiti@2.5.1)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.11.1(@types/node@22.18.6)(typescript@5.9.2))(tsx@4.20.5)(yaml@2.8.1) + packages/wallet-standard: dependencies: '@mysten/sui': @@ -14401,7 +14435,6 @@ snapshots: '@inquirer/type': 3.0.8(@types/node@22.18.6) optionalDependencies: '@types/node': 22.18.6 - optional: true '@inquirer/core@10.2.0(@types/node@22.15.29)': dependencies: @@ -14442,7 +14475,6 @@ snapshots: yoctocolors-cjs: 2.1.3 optionalDependencies: '@types/node': 22.18.6 - optional: true '@inquirer/external-editor@1.0.1(@types/node@22.18.6)': dependencies: @@ -14465,7 +14497,6 @@ snapshots: '@inquirer/type@3.0.8(@types/node@22.18.6)': optionalDependencies: '@types/node': 22.18.6 - optional: true '@isaacs/balanced-match@4.0.1': {} @@ -21932,7 +21963,6 @@ snapshots: typescript: 5.9.2 transitivePeerDependencies: - '@types/node' - optional: true muggle-string@0.4.1: {} From 02b3ca9e17388f54f60ff886edcbb574b10a68ec Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:43:57 -0700 Subject: [PATCH 31/36] optimize grpc for codesize (#583) Co-authored-by: Michael Hayes --- packages/sui-grpc/package.json | 2 +- .../src/proto/sui/rpc/v2beta2/argument.ts | 72 - .../proto/sui/rpc/v2beta2/balance_change.ts | 70 - .../sui-grpc/src/proto/sui/rpc/v2beta2/bcs.ts | 62 - .../src/proto/sui/rpc/v2beta2/checkpoint.ts | 122 - .../sui/rpc/v2beta2/checkpoint_contents.ts | 156 - .../sui/rpc/v2beta2/checkpoint_summary.ts | 292 -- .../src/proto/sui/rpc/v2beta2/effects.ts | 379 --- .../src/proto/sui/rpc/v2beta2/epoch.ts | 145 - .../src/proto/sui/rpc/v2beta2/event.ts | 172 -- .../sui/rpc/v2beta2/executed_transaction.ts | 171 -- .../proto/sui/rpc/v2beta2/execution_status.ts | 934 ------ .../proto/sui/rpc/v2beta2/gas_cost_summary.ts | 76 - .../src/proto/sui/rpc/v2beta2/input.ts | 99 - .../proto/sui/rpc/v2beta2/ledger_service.ts | 1075 ------- .../sui/rpc/v2beta2/live_data_service.ts | 1359 --------- .../src/proto/sui/rpc/v2beta2/move_package.ts | 859 ------ .../sui/rpc/v2beta2/move_package_service.ts | 538 ---- .../src/proto/sui/rpc/v2beta2/name_service.ts | 345 --- .../src/proto/sui/rpc/v2beta2/object.ts | 158 - .../proto/sui/rpc/v2beta2/object_reference.ts | 69 - .../src/proto/sui/rpc/v2beta2/owner.ts | 68 - .../proto/sui/rpc/v2beta2/protocol_config.ts | 138 - .../src/proto/sui/rpc/v2beta2/signature.ts | 1309 --------- .../v2beta2/signature_verification_service.ts | 154 - .../sui/rpc/v2beta2/subscription_service.ts | 133 - .../src/proto/sui/rpc/v2beta2/system_state.ts | 1131 ------- .../src/proto/sui/rpc/v2beta2/transaction.ts | 2590 ----------------- .../v2beta2/transaction_execution_service.ts | 261 -- 29 files changed, 1 insertion(+), 12938 deletions(-) diff --git a/packages/sui-grpc/package.json b/packages/sui-grpc/package.json index 8386908d7..3b80f8e70 100644 --- a/packages/sui-grpc/package.json +++ b/packages/sui-grpc/package.json @@ -31,7 +31,7 @@ "eslint:fix": "pnpm run eslint:check --fix", "lint": "pnpm run eslint:check && pnpm run prettier:check", "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix", - "generate:proto": "protoc --ts_out ./src/proto --ts_opt server_none -I ../../../sui-apis/proto -I ../../../sui-apis/proto ../../../sui-apis/proto/sui/rpc/v2beta2/*.proto ../../../sui-apis/proto/google/*/*.proto", + "generate:proto": "protoc --ts_out ./src/proto --ts_opt force_server_none --ts_opt optimize_code_size -I ../../../sui-apis/proto -I ../../../sui-apis/proto ../../../sui-apis/proto/sui/rpc/v2beta2/*.proto ../../../sui-apis/proto/google/*/*.proto", "generate": "rm -rf src/proto && mkdir src/proto && pnpm generate:proto && pnpm lint:fix" }, "repository": { diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/argument.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/argument.ts index e0df0cbfe..fa5d558ed 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/argument.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/argument.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * An argument to a programmable transaction command. @@ -82,70 +74,6 @@ class Argument$Type extends MessageType { { no: 4, name: 'subresult', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ }, ]); } - create(value?: PartialMessage): Argument { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Argument, - ): Argument { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Argument.ArgumentKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional uint32 input */ 2: - message.input = reader.uint32(); - break; - case /* optional uint32 result */ 3: - message.result = reader.uint32(); - break; - case /* optional uint32 subresult */ 4: - message.subresult = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Argument, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Argument.ArgumentKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional uint32 input = 2; */ - if (message.input !== undefined) writer.tag(2, WireType.Varint).uint32(message.input); - /* optional uint32 result = 3; */ - if (message.result !== undefined) writer.tag(3, WireType.Varint).uint32(message.result); - /* optional uint32 subresult = 4; */ - if (message.subresult !== undefined) writer.tag(4, WireType.Varint).uint32(message.subresult); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Argument diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/balance_change.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/balance_change.ts index 8f2c5bf86..57eaacad5 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/balance_change.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/balance_change.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * The delta, or change, in balance for an address for a particular `Coin` type. @@ -43,68 +35,6 @@ class BalanceChange$Type extends MessageType { { no: 3, name: 'amount', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): BalanceChange { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: BalanceChange, - ): BalanceChange { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string address */ 1: - message.address = reader.string(); - break; - case /* optional string coin_type */ 2: - message.coinType = reader.string(); - break; - case /* optional string amount */ 3: - message.amount = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: BalanceChange, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string address = 1; */ - if (message.address !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.address); - /* optional string coin_type = 2; */ - if (message.coinType !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.coinType); - /* optional string amount = 3; */ - if (message.amount !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.amount); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.BalanceChange diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/bcs.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/bcs.ts index 0c22a4d7d..0174fbb1b 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/bcs.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/bcs.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * `Bcs` contains an arbitrary type that is serialized using the @@ -38,60 +30,6 @@ class Bcs$Type extends MessageType { { no: 2, name: 'value', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ }, ]); } - create(value?: PartialMessage): Bcs { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Bcs, - ): Bcs { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string name */ 1: - message.name = reader.string(); - break; - case /* optional bytes value */ 2: - message.value = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Bcs, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string name = 1; */ - if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); - /* optional bytes value = 2; */ - if (message.value !== undefined) writer.tag(2, WireType.LengthDelimited).bytes(message.value); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Bcs diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint.ts index 0cf92b97c..3524e131b 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { ExecutedTransaction } from './executed_transaction.js'; import { CheckpointContents } from './checkpoint_contents.js'; @@ -80,120 +72,6 @@ class Checkpoint$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Checkpoint { - const message = globalThis.Object.create(this.messagePrototype!); - message.transactions = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Checkpoint, - ): Checkpoint { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 sequence_number */ 1: - message.sequenceNumber = reader.uint64().toBigInt(); - break; - case /* optional string digest */ 2: - message.digest = reader.string(); - break; - case /* optional sui.rpc.v2beta2.CheckpointSummary summary */ 3: - message.summary = CheckpointSummary.internalBinaryRead( - reader, - reader.uint32(), - options, - message.summary, - ); - break; - case /* optional sui.rpc.v2beta2.ValidatorAggregatedSignature signature */ 4: - message.signature = ValidatorAggregatedSignature.internalBinaryRead( - reader, - reader.uint32(), - options, - message.signature, - ); - break; - case /* optional sui.rpc.v2beta2.CheckpointContents contents */ 5: - message.contents = CheckpointContents.internalBinaryRead( - reader, - reader.uint32(), - options, - message.contents, - ); - break; - case /* repeated sui.rpc.v2beta2.ExecutedTransaction transactions */ 6: - message.transactions.push( - ExecutedTransaction.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Checkpoint, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 sequence_number = 1; */ - if (message.sequenceNumber !== undefined) - writer.tag(1, WireType.Varint).uint64(message.sequenceNumber); - /* optional string digest = 2; */ - if (message.digest !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.digest); - /* optional sui.rpc.v2beta2.CheckpointSummary summary = 3; */ - if (message.summary) - CheckpointSummary.internalBinaryWrite( - message.summary, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.ValidatorAggregatedSignature signature = 4; */ - if (message.signature) - ValidatorAggregatedSignature.internalBinaryWrite( - message.signature, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.CheckpointContents contents = 5; */ - if (message.contents) - CheckpointContents.internalBinaryWrite( - message.contents, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.ExecutedTransaction transactions = 6; */ - for (let i = 0; i < message.transactions.length; i++) - ExecutedTransaction.internalBinaryWrite( - message.transactions[i], - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Checkpoint diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_contents.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_contents.ts index bbde376fe..539856fad 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_contents.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_contents.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { UserSignature } from './signature.js'; import { Bcs } from './bcs.js'; @@ -83,84 +75,6 @@ class CheckpointContents$Type extends MessageType { }, ]); } - create(value?: PartialMessage): CheckpointContents { - const message = globalThis.Object.create(this.messagePrototype!); - message.transactions = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CheckpointContents, - ): CheckpointContents { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs bcs */ 1: - message.bcs = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.bcs); - break; - case /* optional string digest */ 2: - message.digest = reader.string(); - break; - case /* optional int32 version */ 3: - message.version = reader.int32(); - break; - case /* repeated sui.rpc.v2beta2.CheckpointedTransactionInfo transactions */ 4: - message.transactions.push( - CheckpointedTransactionInfo.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CheckpointContents, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs bcs = 1; */ - if (message.bcs) - Bcs.internalBinaryWrite( - message.bcs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string digest = 2; */ - if (message.digest !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.digest); - /* optional int32 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).int32(message.version); - /* repeated sui.rpc.v2beta2.CheckpointedTransactionInfo transactions = 4; */ - for (let i = 0; i < message.transactions.length; i++) - CheckpointedTransactionInfo.internalBinaryWrite( - message.transactions[i], - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CheckpointContents @@ -181,76 +95,6 @@ class CheckpointedTransactionInfo$Type extends MessageType): CheckpointedTransactionInfo { - const message = globalThis.Object.create(this.messagePrototype!); - message.signatures = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CheckpointedTransactionInfo, - ): CheckpointedTransactionInfo { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string transaction */ 1: - message.transaction = reader.string(); - break; - case /* optional string effects */ 2: - message.effects = reader.string(); - break; - case /* repeated sui.rpc.v2beta2.UserSignature signatures */ 3: - message.signatures.push( - UserSignature.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CheckpointedTransactionInfo, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string transaction = 1; */ - if (message.transaction !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.transaction); - /* optional string effects = 2; */ - if (message.effects !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.effects); - /* repeated sui.rpc.v2beta2.UserSignature signatures = 3; */ - for (let i = 0; i < message.signatures.length; i++) - UserSignature.internalBinaryWrite( - message.signatures[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CheckpointedTransactionInfo diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts index 5586e8f12..ddd9b7aab 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/checkpoint_summary.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { ValidatorCommitteeMember } from './signature.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; @@ -232,159 +224,6 @@ class CheckpointSummary$Type extends MessageType { }, ]); } - create(value?: PartialMessage): CheckpointSummary { - const message = globalThis.Object.create(this.messagePrototype!); - message.commitments = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CheckpointSummary, - ): CheckpointSummary { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs bcs */ 1: - message.bcs = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.bcs); - break; - case /* optional string digest */ 2: - message.digest = reader.string(); - break; - case /* optional uint64 epoch */ 3: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 sequence_number */ 4: - message.sequenceNumber = reader.uint64().toBigInt(); - break; - case /* optional uint64 total_network_transactions */ 5: - message.totalNetworkTransactions = reader.uint64().toBigInt(); - break; - case /* optional string content_digest */ 6: - message.contentDigest = reader.string(); - break; - case /* optional string previous_digest */ 7: - message.previousDigest = reader.string(); - break; - case /* optional sui.rpc.v2beta2.GasCostSummary epoch_rolling_gas_cost_summary */ 8: - message.epochRollingGasCostSummary = GasCostSummary.internalBinaryRead( - reader, - reader.uint32(), - options, - message.epochRollingGasCostSummary, - ); - break; - case /* optional google.protobuf.Timestamp timestamp */ 9: - message.timestamp = Timestamp.internalBinaryRead( - reader, - reader.uint32(), - options, - message.timestamp, - ); - break; - case /* repeated sui.rpc.v2beta2.CheckpointCommitment commitments */ 10: - message.commitments.push( - CheckpointCommitment.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional sui.rpc.v2beta2.EndOfEpochData end_of_epoch_data */ 11: - message.endOfEpochData = EndOfEpochData.internalBinaryRead( - reader, - reader.uint32(), - options, - message.endOfEpochData, - ); - break; - case /* optional bytes version_specific_data */ 12: - message.versionSpecificData = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CheckpointSummary, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs bcs = 1; */ - if (message.bcs) - Bcs.internalBinaryWrite( - message.bcs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string digest = 2; */ - if (message.digest !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.digest); - /* optional uint64 epoch = 3; */ - if (message.epoch !== undefined) writer.tag(3, WireType.Varint).uint64(message.epoch); - /* optional uint64 sequence_number = 4; */ - if (message.sequenceNumber !== undefined) - writer.tag(4, WireType.Varint).uint64(message.sequenceNumber); - /* optional uint64 total_network_transactions = 5; */ - if (message.totalNetworkTransactions !== undefined) - writer.tag(5, WireType.Varint).uint64(message.totalNetworkTransactions); - /* optional string content_digest = 6; */ - if (message.contentDigest !== undefined) - writer.tag(6, WireType.LengthDelimited).string(message.contentDigest); - /* optional string previous_digest = 7; */ - if (message.previousDigest !== undefined) - writer.tag(7, WireType.LengthDelimited).string(message.previousDigest); - /* optional sui.rpc.v2beta2.GasCostSummary epoch_rolling_gas_cost_summary = 8; */ - if (message.epochRollingGasCostSummary) - GasCostSummary.internalBinaryWrite( - message.epochRollingGasCostSummary, - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional google.protobuf.Timestamp timestamp = 9; */ - if (message.timestamp) - Timestamp.internalBinaryWrite( - message.timestamp, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.CheckpointCommitment commitments = 10; */ - for (let i = 0; i < message.commitments.length; i++) - CheckpointCommitment.internalBinaryWrite( - message.commitments[i], - writer.tag(10, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.EndOfEpochData end_of_epoch_data = 11; */ - if (message.endOfEpochData) - EndOfEpochData.internalBinaryWrite( - message.endOfEpochData, - writer.tag(11, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional bytes version_specific_data = 12; */ - if (message.versionSpecificData !== undefined) - writer.tag(12, WireType.LengthDelimited).bytes(message.versionSpecificData); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CheckpointSummary @@ -418,82 +257,6 @@ class EndOfEpochData$Type extends MessageType { }, ]); } - create(value?: PartialMessage): EndOfEpochData { - const message = globalThis.Object.create(this.messagePrototype!); - message.nextEpochCommittee = []; - message.epochCommitments = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: EndOfEpochData, - ): EndOfEpochData { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.ValidatorCommitteeMember next_epoch_committee */ 1: - message.nextEpochCommittee.push( - ValidatorCommitteeMember.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional uint64 next_epoch_protocol_version */ 2: - message.nextEpochProtocolVersion = reader.uint64().toBigInt(); - break; - case /* repeated sui.rpc.v2beta2.CheckpointCommitment epoch_commitments */ 3: - message.epochCommitments.push( - CheckpointCommitment.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: EndOfEpochData, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.ValidatorCommitteeMember next_epoch_committee = 1; */ - for (let i = 0; i < message.nextEpochCommittee.length; i++) - ValidatorCommitteeMember.internalBinaryWrite( - message.nextEpochCommittee[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 next_epoch_protocol_version = 2; */ - if (message.nextEpochProtocolVersion !== undefined) - writer.tag(2, WireType.Varint).uint64(message.nextEpochProtocolVersion); - /* repeated sui.rpc.v2beta2.CheckpointCommitment epoch_commitments = 3; */ - for (let i = 0; i < message.epochCommitments.length; i++) - CheckpointCommitment.internalBinaryWrite( - message.epochCommitments[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.EndOfEpochData @@ -516,61 +279,6 @@ class CheckpointCommitment$Type extends MessageType { { no: 2, name: 'digest', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): CheckpointCommitment { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CheckpointCommitment, - ): CheckpointCommitment { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.CheckpointCommitment.CheckpointCommitmentKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional string digest */ 2: - message.digest = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CheckpointCommitment, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.CheckpointCommitment.CheckpointCommitmentKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional string digest = 2; */ - if (message.digest !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.digest); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CheckpointCommitment diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts index 4be9b11bf..e8177003c 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/effects.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Owner } from './owner.js'; import { GasCostSummary } from './gas_cost_summary.js'; @@ -377,178 +369,6 @@ class TransactionEffects$Type extends MessageType { }, ]); } - create(value?: PartialMessage): TransactionEffects { - const message = globalThis.Object.create(this.messagePrototype!); - message.dependencies = []; - message.changedObjects = []; - message.unchangedConsensusObjects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TransactionEffects, - ): TransactionEffects { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs bcs */ 1: - message.bcs = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.bcs); - break; - case /* optional string digest */ 2: - message.digest = reader.string(); - break; - case /* optional int32 version */ 3: - message.version = reader.int32(); - break; - case /* optional sui.rpc.v2beta2.ExecutionStatus status */ 4: - message.status = ExecutionStatus.internalBinaryRead( - reader, - reader.uint32(), - options, - message.status, - ); - break; - case /* optional uint64 epoch */ 5: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.GasCostSummary gas_used */ 6: - message.gasUsed = GasCostSummary.internalBinaryRead( - reader, - reader.uint32(), - options, - message.gasUsed, - ); - break; - case /* optional string transaction_digest */ 7: - message.transactionDigest = reader.string(); - break; - case /* optional sui.rpc.v2beta2.ChangedObject gas_object */ 8: - message.gasObject = ChangedObject.internalBinaryRead( - reader, - reader.uint32(), - options, - message.gasObject, - ); - break; - case /* optional string events_digest */ 9: - message.eventsDigest = reader.string(); - break; - case /* repeated string dependencies */ 10: - message.dependencies.push(reader.string()); - break; - case /* optional uint64 lamport_version */ 11: - message.lamportVersion = reader.uint64().toBigInt(); - break; - case /* repeated sui.rpc.v2beta2.ChangedObject changed_objects */ 12: - message.changedObjects.push( - ChangedObject.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* repeated sui.rpc.v2beta2.UnchangedConsensusObject unchanged_consensus_objects */ 13: - message.unchangedConsensusObjects.push( - UnchangedConsensusObject.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional string auxiliary_data_digest */ 14: - message.auxiliaryDataDigest = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TransactionEffects, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs bcs = 1; */ - if (message.bcs) - Bcs.internalBinaryWrite( - message.bcs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string digest = 2; */ - if (message.digest !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.digest); - /* optional int32 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).int32(message.version); - /* optional sui.rpc.v2beta2.ExecutionStatus status = 4; */ - if (message.status) - ExecutionStatus.internalBinaryWrite( - message.status, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 epoch = 5; */ - if (message.epoch !== undefined) writer.tag(5, WireType.Varint).uint64(message.epoch); - /* optional sui.rpc.v2beta2.GasCostSummary gas_used = 6; */ - if (message.gasUsed) - GasCostSummary.internalBinaryWrite( - message.gasUsed, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string transaction_digest = 7; */ - if (message.transactionDigest !== undefined) - writer.tag(7, WireType.LengthDelimited).string(message.transactionDigest); - /* optional sui.rpc.v2beta2.ChangedObject gas_object = 8; */ - if (message.gasObject) - ChangedObject.internalBinaryWrite( - message.gasObject, - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string events_digest = 9; */ - if (message.eventsDigest !== undefined) - writer.tag(9, WireType.LengthDelimited).string(message.eventsDigest); - /* repeated string dependencies = 10; */ - for (let i = 0; i < message.dependencies.length; i++) - writer.tag(10, WireType.LengthDelimited).string(message.dependencies[i]); - /* optional uint64 lamport_version = 11; */ - if (message.lamportVersion !== undefined) - writer.tag(11, WireType.Varint).uint64(message.lamportVersion); - /* repeated sui.rpc.v2beta2.ChangedObject changed_objects = 12; */ - for (let i = 0; i < message.changedObjects.length; i++) - ChangedObject.internalBinaryWrite( - message.changedObjects[i], - writer.tag(12, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.UnchangedConsensusObject unchanged_consensus_objects = 13; */ - for (let i = 0; i < message.unchangedConsensusObjects.length; i++) - UnchangedConsensusObject.internalBinaryWrite( - message.unchangedConsensusObjects[i], - writer.tag(13, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string auxiliary_data_digest = 14; */ - if (message.auxiliaryDataDigest !== undefined) - writer.tag(14, WireType.LengthDelimited).string(message.auxiliaryDataDigest); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TransactionEffects @@ -611,133 +431,6 @@ class ChangedObject$Type extends MessageType { { no: 11, name: 'object_type', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): ChangedObject { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ChangedObject, - ): ChangedObject { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string object_id */ 1: - message.objectId = reader.string(); - break; - case /* optional sui.rpc.v2beta2.ChangedObject.InputObjectState input_state */ 2: - message.inputState = reader.int32(); - break; - case /* optional uint64 input_version */ 3: - message.inputVersion = reader.uint64().toBigInt(); - break; - case /* optional string input_digest */ 4: - message.inputDigest = reader.string(); - break; - case /* optional sui.rpc.v2beta2.Owner input_owner */ 5: - message.inputOwner = Owner.internalBinaryRead( - reader, - reader.uint32(), - options, - message.inputOwner, - ); - break; - case /* optional sui.rpc.v2beta2.ChangedObject.OutputObjectState output_state */ 6: - message.outputState = reader.int32(); - break; - case /* optional uint64 output_version */ 7: - message.outputVersion = reader.uint64().toBigInt(); - break; - case /* optional string output_digest */ 8: - message.outputDigest = reader.string(); - break; - case /* optional sui.rpc.v2beta2.Owner output_owner */ 9: - message.outputOwner = Owner.internalBinaryRead( - reader, - reader.uint32(), - options, - message.outputOwner, - ); - break; - case /* optional sui.rpc.v2beta2.ChangedObject.IdOperation id_operation */ 10: - message.idOperation = reader.int32(); - break; - case /* optional string object_type */ 11: - message.objectType = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ChangedObject, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string object_id = 1; */ - if (message.objectId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.objectId); - /* optional sui.rpc.v2beta2.ChangedObject.InputObjectState input_state = 2; */ - if (message.inputState !== undefined) writer.tag(2, WireType.Varint).int32(message.inputState); - /* optional uint64 input_version = 3; */ - if (message.inputVersion !== undefined) - writer.tag(3, WireType.Varint).uint64(message.inputVersion); - /* optional string input_digest = 4; */ - if (message.inputDigest !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.inputDigest); - /* optional sui.rpc.v2beta2.Owner input_owner = 5; */ - if (message.inputOwner) - Owner.internalBinaryWrite( - message.inputOwner, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.ChangedObject.OutputObjectState output_state = 6; */ - if (message.outputState !== undefined) - writer.tag(6, WireType.Varint).int32(message.outputState); - /* optional uint64 output_version = 7; */ - if (message.outputVersion !== undefined) - writer.tag(7, WireType.Varint).uint64(message.outputVersion); - /* optional string output_digest = 8; */ - if (message.outputDigest !== undefined) - writer.tag(8, WireType.LengthDelimited).string(message.outputDigest); - /* optional sui.rpc.v2beta2.Owner output_owner = 9; */ - if (message.outputOwner) - Owner.internalBinaryWrite( - message.outputOwner, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.ChangedObject.IdOperation id_operation = 10; */ - if (message.idOperation !== undefined) - writer.tag(10, WireType.Varint).int32(message.idOperation); - /* optional string object_type = 11; */ - if (message.objectType !== undefined) - writer.tag(11, WireType.LengthDelimited).string(message.objectType); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ChangedObject @@ -770,78 +463,6 @@ class UnchangedConsensusObject$Type extends MessageType): UnchangedConsensusObject { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: UnchangedConsensusObject, - ): UnchangedConsensusObject { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.UnchangedConsensusObject.UnchangedConsensusObjectKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional string object_id */ 2: - message.objectId = reader.string(); - break; - case /* optional uint64 version */ 3: - message.version = reader.uint64().toBigInt(); - break; - case /* optional string digest */ 4: - message.digest = reader.string(); - break; - case /* optional string object_type */ 5: - message.objectType = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: UnchangedConsensusObject, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.UnchangedConsensusObject.UnchangedConsensusObjectKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional string object_id = 2; */ - if (message.objectId !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.objectId); - /* optional uint64 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).uint64(message.version); - /* optional string digest = 4; */ - if (message.digest !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.digest); - /* optional string object_type = 5; */ - if (message.objectType !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.objectType); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.UnchangedConsensusObject diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/epoch.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/epoch.ts index db6f24b66..6393bfa73 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/epoch.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/epoch.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { ProtocolConfig } from './protocol_config.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; @@ -105,143 +97,6 @@ class Epoch$Type extends MessageType { { no: 9, name: 'protocol_config', kind: 'message', T: () => ProtocolConfig }, ]); } - create(value?: PartialMessage): Epoch { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Epoch, - ): Epoch { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.ValidatorCommittee committee */ 2: - message.committee = ValidatorCommittee.internalBinaryRead( - reader, - reader.uint32(), - options, - message.committee, - ); - break; - case /* optional sui.rpc.v2beta2.SystemState system_state */ 3: - message.systemState = SystemState.internalBinaryRead( - reader, - reader.uint32(), - options, - message.systemState, - ); - break; - case /* optional uint64 first_checkpoint */ 4: - message.firstCheckpoint = reader.uint64().toBigInt(); - break; - case /* optional uint64 last_checkpoint */ 5: - message.lastCheckpoint = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.Timestamp start */ 6: - message.start = Timestamp.internalBinaryRead( - reader, - reader.uint32(), - options, - message.start, - ); - break; - case /* optional google.protobuf.Timestamp end */ 7: - message.end = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.end); - break; - case /* optional uint64 reference_gas_price */ 8: - message.referenceGasPrice = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.ProtocolConfig protocol_config */ 9: - message.protocolConfig = ProtocolConfig.internalBinaryRead( - reader, - reader.uint32(), - options, - message.protocolConfig, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Epoch, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* optional sui.rpc.v2beta2.ValidatorCommittee committee = 2; */ - if (message.committee) - ValidatorCommittee.internalBinaryWrite( - message.committee, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.SystemState system_state = 3; */ - if (message.systemState) - SystemState.internalBinaryWrite( - message.systemState, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 first_checkpoint = 4; */ - if (message.firstCheckpoint !== undefined) - writer.tag(4, WireType.Varint).uint64(message.firstCheckpoint); - /* optional uint64 last_checkpoint = 5; */ - if (message.lastCheckpoint !== undefined) - writer.tag(5, WireType.Varint).uint64(message.lastCheckpoint); - /* optional google.protobuf.Timestamp start = 6; */ - if (message.start) - Timestamp.internalBinaryWrite( - message.start, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional google.protobuf.Timestamp end = 7; */ - if (message.end) - Timestamp.internalBinaryWrite( - message.end, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 reference_gas_price = 8; */ - if (message.referenceGasPrice !== undefined) - writer.tag(8, WireType.Varint).uint64(message.referenceGasPrice); - /* optional sui.rpc.v2beta2.ProtocolConfig protocol_config = 9; */ - if (message.protocolConfig) - ProtocolConfig.internalBinaryWrite( - message.protocolConfig, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Epoch diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/event.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/event.ts index 15b9e1ebc..61d800027 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/event.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/event.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Value } from '../../../google/protobuf/struct.js'; import { Bcs } from './bcs.js'; @@ -90,77 +82,6 @@ class TransactionEvents$Type extends MessageType { { no: 3, name: 'events', kind: 'message', repeat: 2 /*RepeatType.UNPACKED*/, T: () => Event }, ]); } - create(value?: PartialMessage): TransactionEvents { - const message = globalThis.Object.create(this.messagePrototype!); - message.events = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TransactionEvents, - ): TransactionEvents { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs bcs */ 1: - message.bcs = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.bcs); - break; - case /* optional string digest */ 2: - message.digest = reader.string(); - break; - case /* repeated sui.rpc.v2beta2.Event events */ 3: - message.events.push(Event.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TransactionEvents, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs bcs = 1; */ - if (message.bcs) - Bcs.internalBinaryWrite( - message.bcs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string digest = 2; */ - if (message.digest !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.digest); - /* repeated sui.rpc.v2beta2.Event events = 3; */ - for (let i = 0; i < message.events.length; i++) - Event.internalBinaryWrite( - message.events[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TransactionEvents @@ -178,99 +99,6 @@ class Event$Type extends MessageType { { no: 6, name: 'json', kind: 'message', T: () => Value }, ]); } - create(value?: PartialMessage): Event { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Event, - ): Event { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package_id */ 1: - message.packageId = reader.string(); - break; - case /* optional string module */ 2: - message.module = reader.string(); - break; - case /* optional string sender */ 3: - message.sender = reader.string(); - break; - case /* optional string event_type */ 4: - message.eventType = reader.string(); - break; - case /* optional sui.rpc.v2beta2.Bcs contents */ 5: - message.contents = Bcs.internalBinaryRead( - reader, - reader.uint32(), - options, - message.contents, - ); - break; - case /* optional google.protobuf.Value json */ 6: - message.json = Value.internalBinaryRead(reader, reader.uint32(), options, message.json); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Event, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package_id = 1; */ - if (message.packageId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.packageId); - /* optional string module = 2; */ - if (message.module !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.module); - /* optional string sender = 3; */ - if (message.sender !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.sender); - /* optional string event_type = 4; */ - if (message.eventType !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.eventType); - /* optional sui.rpc.v2beta2.Bcs contents = 5; */ - if (message.contents) - Bcs.internalBinaryWrite( - message.contents, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional google.protobuf.Value json = 6; */ - if (message.json) - Value.internalBinaryWrite( - message.json, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Event diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/executed_transaction.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/executed_transaction.ts index a3e89842f..621a1fdd4 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/executed_transaction.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/executed_transaction.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Object } from './object.js'; import { BalanceChange } from './balance_change.js'; @@ -132,169 +124,6 @@ class ExecutedTransaction$Type extends MessageType { }, ]); } - create(value?: PartialMessage): ExecutedTransaction { - const message = globalThis.Object.create(this.messagePrototype!); - message.signatures = []; - message.balanceChanges = []; - message.inputObjects = []; - message.outputObjects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ExecutedTransaction, - ): ExecutedTransaction { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string digest */ 1: - message.digest = reader.string(); - break; - case /* optional sui.rpc.v2beta2.Transaction transaction */ 2: - message.transaction = Transaction.internalBinaryRead( - reader, - reader.uint32(), - options, - message.transaction, - ); - break; - case /* repeated sui.rpc.v2beta2.UserSignature signatures */ 3: - message.signatures.push( - UserSignature.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional sui.rpc.v2beta2.TransactionEffects effects */ 4: - message.effects = TransactionEffects.internalBinaryRead( - reader, - reader.uint32(), - options, - message.effects, - ); - break; - case /* optional sui.rpc.v2beta2.TransactionEvents events */ 5: - message.events = TransactionEvents.internalBinaryRead( - reader, - reader.uint32(), - options, - message.events, - ); - break; - case /* optional uint64 checkpoint */ 6: - message.checkpoint = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.Timestamp timestamp */ 7: - message.timestamp = Timestamp.internalBinaryRead( - reader, - reader.uint32(), - options, - message.timestamp, - ); - break; - case /* repeated sui.rpc.v2beta2.BalanceChange balance_changes */ 8: - message.balanceChanges.push( - BalanceChange.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* repeated sui.rpc.v2beta2.Object input_objects */ 10: - message.inputObjects.push(Object.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated sui.rpc.v2beta2.Object output_objects */ 11: - message.outputObjects.push(Object.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ExecutedTransaction, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string digest = 1; */ - if (message.digest !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.digest); - /* optional sui.rpc.v2beta2.Transaction transaction = 2; */ - if (message.transaction) - Transaction.internalBinaryWrite( - message.transaction, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.UserSignature signatures = 3; */ - for (let i = 0; i < message.signatures.length; i++) - UserSignature.internalBinaryWrite( - message.signatures[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.TransactionEffects effects = 4; */ - if (message.effects) - TransactionEffects.internalBinaryWrite( - message.effects, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.TransactionEvents events = 5; */ - if (message.events) - TransactionEvents.internalBinaryWrite( - message.events, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 checkpoint = 6; */ - if (message.checkpoint !== undefined) writer.tag(6, WireType.Varint).uint64(message.checkpoint); - /* optional google.protobuf.Timestamp timestamp = 7; */ - if (message.timestamp) - Timestamp.internalBinaryWrite( - message.timestamp, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.BalanceChange balance_changes = 8; */ - for (let i = 0; i < message.balanceChanges.length; i++) - BalanceChange.internalBinaryWrite( - message.balanceChanges[i], - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.Object input_objects = 10; */ - for (let i = 0; i < message.inputObjects.length; i++) - Object.internalBinaryWrite( - message.inputObjects[i], - writer.tag(10, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.Object output_objects = 11; */ - for (let i = 0; i < message.outputObjects.length; i++) - Object.internalBinaryWrite( - message.outputObjects[i], - writer.tag(11, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ExecutedTransaction diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts index 26ddcbe2f..fa6f673f2 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/execution_status.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * The status of an executed transaction. @@ -787,70 +779,6 @@ class ExecutionStatus$Type extends MessageType { { no: 2, name: 'error', kind: 'message', T: () => ExecutionError }, ]); } - create(value?: PartialMessage): ExecutionStatus { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ExecutionStatus, - ): ExecutionStatus { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional bool success */ 1: - message.success = reader.bool(); - break; - case /* optional sui.rpc.v2beta2.ExecutionError error */ 2: - message.error = ExecutionError.internalBinaryRead( - reader, - reader.uint32(), - options, - message.error, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ExecutionStatus, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional bool success = 1; */ - if (message.success !== undefined) writer.tag(1, WireType.Varint).bool(message.success); - /* optional sui.rpc.v2beta2.ExecutionError error = 2; */ - if (message.error) - ExecutionError.internalBinaryWrite( - message.error, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ExecutionStatus @@ -926,220 +854,6 @@ class ExecutionError$Type extends MessageType { }, ]); } - create(value?: PartialMessage): ExecutionError { - const message = globalThis.Object.create(this.messagePrototype!); - message.errorDetails = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ExecutionError, - ): ExecutionError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string description */ 1: - message.description = reader.string(); - break; - case /* optional uint64 command */ 2: - message.command = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.ExecutionError.ExecutionErrorKind kind */ 3: - message.kind = reader.int32(); - break; - case /* sui.rpc.v2beta2.MoveAbort abort */ 4: - message.errorDetails = { - oneofKind: 'abort', - abort: MoveAbort.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).abort, - ), - }; - break; - case /* sui.rpc.v2beta2.SizeError size_error */ 5: - message.errorDetails = { - oneofKind: 'sizeError', - sizeError: SizeError.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).sizeError, - ), - }; - break; - case /* sui.rpc.v2beta2.CommandArgumentError command_argument_error */ 6: - message.errorDetails = { - oneofKind: 'commandArgumentError', - commandArgumentError: CommandArgumentError.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).commandArgumentError, - ), - }; - break; - case /* sui.rpc.v2beta2.TypeArgumentError type_argument_error */ 7: - message.errorDetails = { - oneofKind: 'typeArgumentError', - typeArgumentError: TypeArgumentError.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).typeArgumentError, - ), - }; - break; - case /* sui.rpc.v2beta2.PackageUpgradeError package_upgrade_error */ 8: - message.errorDetails = { - oneofKind: 'packageUpgradeError', - packageUpgradeError: PackageUpgradeError.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).packageUpgradeError, - ), - }; - break; - case /* sui.rpc.v2beta2.IndexError index_error */ 9: - message.errorDetails = { - oneofKind: 'indexError', - indexError: IndexError.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).indexError, - ), - }; - break; - case /* string object_id */ 10: - message.errorDetails = { - oneofKind: 'objectId', - objectId: reader.string(), - }; - break; - case /* sui.rpc.v2beta2.CoinDenyListError coin_deny_list_error */ 11: - message.errorDetails = { - oneofKind: 'coinDenyListError', - coinDenyListError: CoinDenyListError.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).coinDenyListError, - ), - }; - break; - case /* sui.rpc.v2beta2.CongestedObjects congested_objects */ 12: - message.errorDetails = { - oneofKind: 'congestedObjects', - congestedObjects: CongestedObjects.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.errorDetails as any).congestedObjects, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ExecutionError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string description = 1; */ - if (message.description !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.description); - /* optional uint64 command = 2; */ - if (message.command !== undefined) writer.tag(2, WireType.Varint).uint64(message.command); - /* optional sui.rpc.v2beta2.ExecutionError.ExecutionErrorKind kind = 3; */ - if (message.kind !== undefined) writer.tag(3, WireType.Varint).int32(message.kind); - /* sui.rpc.v2beta2.MoveAbort abort = 4; */ - if (message.errorDetails.oneofKind === 'abort') - MoveAbort.internalBinaryWrite( - message.errorDetails.abort, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.SizeError size_error = 5; */ - if (message.errorDetails.oneofKind === 'sizeError') - SizeError.internalBinaryWrite( - message.errorDetails.sizeError, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.CommandArgumentError command_argument_error = 6; */ - if (message.errorDetails.oneofKind === 'commandArgumentError') - CommandArgumentError.internalBinaryWrite( - message.errorDetails.commandArgumentError, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.TypeArgumentError type_argument_error = 7; */ - if (message.errorDetails.oneofKind === 'typeArgumentError') - TypeArgumentError.internalBinaryWrite( - message.errorDetails.typeArgumentError, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.PackageUpgradeError package_upgrade_error = 8; */ - if (message.errorDetails.oneofKind === 'packageUpgradeError') - PackageUpgradeError.internalBinaryWrite( - message.errorDetails.packageUpgradeError, - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.IndexError index_error = 9; */ - if (message.errorDetails.oneofKind === 'indexError') - IndexError.internalBinaryWrite( - message.errorDetails.indexError, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - /* string object_id = 10; */ - if (message.errorDetails.oneofKind === 'objectId') - writer.tag(10, WireType.LengthDelimited).string(message.errorDetails.objectId); - /* sui.rpc.v2beta2.CoinDenyListError coin_deny_list_error = 11; */ - if (message.errorDetails.oneofKind === 'coinDenyListError') - CoinDenyListError.internalBinaryWrite( - message.errorDetails.coinDenyListError, - writer.tag(11, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.CongestedObjects congested_objects = 12; */ - if (message.errorDetails.oneofKind === 'congestedObjects') - CongestedObjects.internalBinaryWrite( - message.errorDetails.congestedObjects, - writer.tag(12, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ExecutionError @@ -1161,85 +875,6 @@ class MoveAbort$Type extends MessageType { { no: 3, name: 'clever_error', kind: 'message', T: () => CleverError }, ]); } - create(value?: PartialMessage): MoveAbort { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MoveAbort, - ): MoveAbort { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 abort_code */ 1: - message.abortCode = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.MoveLocation location */ 2: - message.location = MoveLocation.internalBinaryRead( - reader, - reader.uint32(), - options, - message.location, - ); - break; - case /* optional sui.rpc.v2beta2.CleverError clever_error */ 3: - message.cleverError = CleverError.internalBinaryRead( - reader, - reader.uint32(), - options, - message.cleverError, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MoveAbort, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 abort_code = 1; */ - if (message.abortCode !== undefined) writer.tag(1, WireType.Varint).uint64(message.abortCode); - /* optional sui.rpc.v2beta2.MoveLocation location = 2; */ - if (message.location) - MoveLocation.internalBinaryWrite( - message.location, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.CleverError clever_error = 3; */ - if (message.cleverError) - CleverError.internalBinaryWrite( - message.cleverError, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MoveAbort @@ -1256,79 +891,6 @@ class MoveLocation$Type extends MessageType { { no: 5, name: 'function_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): MoveLocation { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MoveLocation, - ): MoveLocation { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package */ 1: - message.package = reader.string(); - break; - case /* optional string module */ 2: - message.module = reader.string(); - break; - case /* optional uint32 function */ 3: - message.function = reader.uint32(); - break; - case /* optional uint32 instruction */ 4: - message.instruction = reader.uint32(); - break; - case /* optional string function_name */ 5: - message.functionName = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MoveLocation, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package = 1; */ - if (message.package !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.package); - /* optional string module = 2; */ - if (message.module !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.module); - /* optional uint32 function = 3; */ - if (message.function !== undefined) writer.tag(3, WireType.Varint).uint32(message.function); - /* optional uint32 instruction = 4; */ - if (message.instruction !== undefined) - writer.tag(4, WireType.Varint).uint32(message.instruction); - /* optional string function_name = 5; */ - if (message.functionName !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.functionName); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MoveLocation @@ -1360,91 +922,6 @@ class CleverError$Type extends MessageType { { no: 6, name: 'raw', kind: 'scalar', oneof: 'value', T: 12 /*ScalarType.BYTES*/ }, ]); } - create(value?: PartialMessage): CleverError { - const message = globalThis.Object.create(this.messagePrototype!); - message.value = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CleverError, - ): CleverError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 error_code */ 1: - message.errorCode = reader.uint64().toBigInt(); - break; - case /* optional uint64 line_number */ 2: - message.lineNumber = reader.uint64().toBigInt(); - break; - case /* optional string constant_name */ 3: - message.constantName = reader.string(); - break; - case /* optional string constant_type */ 4: - message.constantType = reader.string(); - break; - case /* string rendered */ 5: - message.value = { - oneofKind: 'rendered', - rendered: reader.string(), - }; - break; - case /* bytes raw */ 6: - message.value = { - oneofKind: 'raw', - raw: reader.bytes(), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CleverError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 error_code = 1; */ - if (message.errorCode !== undefined) writer.tag(1, WireType.Varint).uint64(message.errorCode); - /* optional uint64 line_number = 2; */ - if (message.lineNumber !== undefined) writer.tag(2, WireType.Varint).uint64(message.lineNumber); - /* optional string constant_name = 3; */ - if (message.constantName !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.constantName); - /* optional string constant_type = 4; */ - if (message.constantType !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.constantType); - /* string rendered = 5; */ - if (message.value.oneofKind === 'rendered') - writer.tag(5, WireType.LengthDelimited).string(message.value.rendered); - /* bytes raw = 6; */ - if (message.value.oneofKind === 'raw') - writer.tag(6, WireType.LengthDelimited).bytes(message.value.raw); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CleverError @@ -1472,60 +949,6 @@ class SizeError$Type extends MessageType { }, ]); } - create(value?: PartialMessage): SizeError { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SizeError, - ): SizeError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 size */ 1: - message.size = reader.uint64().toBigInt(); - break; - case /* optional uint64 max_size */ 2: - message.maxSize = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SizeError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 size = 1; */ - if (message.size !== undefined) writer.tag(1, WireType.Varint).uint64(message.size); - /* optional uint64 max_size = 2; */ - if (message.maxSize !== undefined) writer.tag(2, WireType.Varint).uint64(message.maxSize); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SizeError @@ -1539,60 +962,6 @@ class IndexError$Type extends MessageType { { no: 2, name: 'subresult', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ }, ]); } - create(value?: PartialMessage): IndexError { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: IndexError, - ): IndexError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint32 index */ 1: - message.index = reader.uint32(); - break; - case /* optional uint32 subresult */ 2: - message.subresult = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: IndexError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint32 index = 1; */ - if (message.index !== undefined) writer.tag(1, WireType.Varint).uint32(message.index); - /* optional uint32 subresult = 2; */ - if (message.subresult !== undefined) writer.tag(2, WireType.Varint).uint32(message.subresult); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.IndexError @@ -1606,62 +975,6 @@ class CoinDenyListError$Type extends MessageType { { no: 2, name: 'coin_type', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): CoinDenyListError { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CoinDenyListError, - ): CoinDenyListError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string address */ 1: - message.address = reader.string(); - break; - case /* optional string coin_type */ 2: - message.coinType = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CoinDenyListError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string address = 1; */ - if (message.address !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.address); - /* optional string coin_type = 2; */ - if (message.coinType !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.coinType); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CoinDenyListError @@ -1680,57 +993,6 @@ class CongestedObjects$Type extends MessageType { }, ]); } - create(value?: PartialMessage): CongestedObjects { - const message = globalThis.Object.create(this.messagePrototype!); - message.objects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CongestedObjects, - ): CongestedObjects { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated string objects */ 1: - message.objects.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CongestedObjects, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated string objects = 1; */ - for (let i = 0; i < message.objects.length; i++) - writer.tag(1, WireType.LengthDelimited).string(message.objects[i]); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CongestedObjects @@ -1754,75 +1016,6 @@ class CommandArgumentError$Type extends MessageType { { no: 3, name: 'index_error', kind: 'message', T: () => IndexError }, ]); } - create(value?: PartialMessage): CommandArgumentError { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CommandArgumentError, - ): CommandArgumentError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint32 argument */ 1: - message.argument = reader.uint32(); - break; - case /* optional sui.rpc.v2beta2.CommandArgumentError.CommandArgumentErrorKind kind */ 2: - message.kind = reader.int32(); - break; - case /* optional sui.rpc.v2beta2.IndexError index_error */ 3: - message.indexError = IndexError.internalBinaryRead( - reader, - reader.uint32(), - options, - message.indexError, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CommandArgumentError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint32 argument = 1; */ - if (message.argument !== undefined) writer.tag(1, WireType.Varint).uint32(message.argument); - /* optional sui.rpc.v2beta2.CommandArgumentError.CommandArgumentErrorKind kind = 2; */ - if (message.kind !== undefined) writer.tag(2, WireType.Varint).int32(message.kind); - /* optional sui.rpc.v2beta2.IndexError index_error = 3; */ - if (message.indexError) - IndexError.internalBinaryWrite( - message.indexError, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CommandArgumentError @@ -1848,78 +1041,6 @@ class PackageUpgradeError$Type extends MessageType { { no: 5, name: 'ticket_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): PackageUpgradeError { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: PackageUpgradeError, - ): PackageUpgradeError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.PackageUpgradeError.PackageUpgradeErrorKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional string package_id */ 2: - message.packageId = reader.string(); - break; - case /* optional string digest */ 3: - message.digest = reader.string(); - break; - case /* optional uint32 policy */ 4: - message.policy = reader.uint32(); - break; - case /* optional string ticket_id */ 5: - message.ticketId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: PackageUpgradeError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.PackageUpgradeError.PackageUpgradeErrorKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional string package_id = 2; */ - if (message.packageId !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.packageId); - /* optional string digest = 3; */ - if (message.digest !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.digest); - /* optional uint32 policy = 4; */ - if (message.policy !== undefined) writer.tag(4, WireType.Varint).uint32(message.policy); - /* optional string ticket_id = 5; */ - if (message.ticketId !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.ticketId); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.PackageUpgradeError @@ -1942,61 +1063,6 @@ class TypeArgumentError$Type extends MessageType { }, ]); } - create(value?: PartialMessage): TypeArgumentError { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TypeArgumentError, - ): TypeArgumentError { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint32 type_argument */ 1: - message.typeArgument = reader.uint32(); - break; - case /* optional sui.rpc.v2beta2.TypeArgumentError.TypeArgumentErrorKind kind */ 2: - message.kind = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TypeArgumentError, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint32 type_argument = 1; */ - if (message.typeArgument !== undefined) - writer.tag(1, WireType.Varint).uint32(message.typeArgument); - /* optional sui.rpc.v2beta2.TypeArgumentError.TypeArgumentErrorKind kind = 2; */ - if (message.kind !== undefined) writer.tag(2, WireType.Varint).int32(message.kind); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TypeArgumentError diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/gas_cost_summary.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/gas_cost_summary.ts index 640d8cbc6..4def0d502 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/gas_cost_summary.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/gas_cost_summary.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * Summary of gas charges. @@ -79,74 +71,6 @@ class GasCostSummary$Type extends MessageType { }, ]); } - create(value?: PartialMessage): GasCostSummary { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GasCostSummary, - ): GasCostSummary { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 computation_cost */ 1: - message.computationCost = reader.uint64().toBigInt(); - break; - case /* optional uint64 storage_cost */ 2: - message.storageCost = reader.uint64().toBigInt(); - break; - case /* optional uint64 storage_rebate */ 3: - message.storageRebate = reader.uint64().toBigInt(); - break; - case /* optional uint64 non_refundable_storage_fee */ 4: - message.nonRefundableStorageFee = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GasCostSummary, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 computation_cost = 1; */ - if (message.computationCost !== undefined) - writer.tag(1, WireType.Varint).uint64(message.computationCost); - /* optional uint64 storage_cost = 2; */ - if (message.storageCost !== undefined) - writer.tag(2, WireType.Varint).uint64(message.storageCost); - /* optional uint64 storage_rebate = 3; */ - if (message.storageRebate !== undefined) - writer.tag(3, WireType.Varint).uint64(message.storageRebate); - /* optional uint64 non_refundable_storage_fee = 4; */ - if (message.nonRefundableStorageFee !== undefined) - writer.tag(4, WireType.Varint).uint64(message.nonRefundableStorageFee); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GasCostSummary diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/input.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/input.ts index 7b05509dc..237ce4e38 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/input.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/input.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Value } from '../../../google/protobuf/struct.js'; /** @@ -124,97 +116,6 @@ class Input$Type extends MessageType { { no: 1000, name: 'literal', kind: 'message', T: () => Value }, ]); } - create(value?: PartialMessage): Input { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Input, - ): Input { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Input.InputKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional bytes pure */ 2: - message.pure = reader.bytes(); - break; - case /* optional string object_id */ 3: - message.objectId = reader.string(); - break; - case /* optional uint64 version */ 4: - message.version = reader.uint64().toBigInt(); - break; - case /* optional string digest */ 5: - message.digest = reader.string(); - break; - case /* optional bool mutable */ 6: - message.mutable = reader.bool(); - break; - case /* optional google.protobuf.Value literal */ 1000: - message.literal = Value.internalBinaryRead( - reader, - reader.uint32(), - options, - message.literal, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Input, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Input.InputKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional bytes pure = 2; */ - if (message.pure !== undefined) writer.tag(2, WireType.LengthDelimited).bytes(message.pure); - /* optional string object_id = 3; */ - if (message.objectId !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.objectId); - /* optional uint64 version = 4; */ - if (message.version !== undefined) writer.tag(4, WireType.Varint).uint64(message.version); - /* optional string digest = 5; */ - if (message.digest !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.digest); - /* optional bool mutable = 6; */ - if (message.mutable !== undefined) writer.tag(6, WireType.Varint).bool(message.mutable); - /* optional google.protobuf.Value literal = 1000; */ - if (message.literal) - Value.internalBinaryWrite( - message.literal, - writer.tag(1000, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Input diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts index 30e66e538..87d61539a 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/ledger_service.ts @@ -1,14 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { ServiceType } from '@protobuf-ts/runtime-rpc'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Epoch } from './epoch.js'; import { Checkpoint } from './checkpoint.js'; @@ -326,50 +318,6 @@ class GetServiceInfoRequest$Type extends MessageType { constructor() { super('sui.rpc.v2beta2.GetServiceInfoRequest', []); } - create(value?: PartialMessage): GetServiceInfoRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetServiceInfoRequest, - ): GetServiceInfoRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetServiceInfoRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetServiceInfoRequest @@ -417,105 +365,6 @@ class GetServiceInfoResponse$Type extends MessageType { { no: 8, name: 'server', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): GetServiceInfoResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetServiceInfoResponse, - ): GetServiceInfoResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string chain_id */ 1: - message.chainId = reader.string(); - break; - case /* optional string chain */ 2: - message.chain = reader.string(); - break; - case /* optional uint64 epoch */ 3: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 checkpoint_height */ 4: - message.checkpointHeight = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.Timestamp timestamp */ 5: - message.timestamp = Timestamp.internalBinaryRead( - reader, - reader.uint32(), - options, - message.timestamp, - ); - break; - case /* optional uint64 lowest_available_checkpoint */ 6: - message.lowestAvailableCheckpoint = reader.uint64().toBigInt(); - break; - case /* optional uint64 lowest_available_checkpoint_objects */ 7: - message.lowestAvailableCheckpointObjects = reader.uint64().toBigInt(); - break; - case /* optional string server */ 8: - message.server = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetServiceInfoResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string chain_id = 1; */ - if (message.chainId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.chainId); - /* optional string chain = 2; */ - if (message.chain !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.chain); - /* optional uint64 epoch = 3; */ - if (message.epoch !== undefined) writer.tag(3, WireType.Varint).uint64(message.epoch); - /* optional uint64 checkpoint_height = 4; */ - if (message.checkpointHeight !== undefined) - writer.tag(4, WireType.Varint).uint64(message.checkpointHeight); - /* optional google.protobuf.Timestamp timestamp = 5; */ - if (message.timestamp) - Timestamp.internalBinaryWrite( - message.timestamp, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 lowest_available_checkpoint = 6; */ - if (message.lowestAvailableCheckpoint !== undefined) - writer.tag(6, WireType.Varint).uint64(message.lowestAvailableCheckpoint); - /* optional uint64 lowest_available_checkpoint_objects = 7; */ - if (message.lowestAvailableCheckpointObjects !== undefined) - writer.tag(7, WireType.Varint).uint64(message.lowestAvailableCheckpointObjects); - /* optional string server = 8; */ - if (message.server !== undefined) - writer.tag(8, WireType.LengthDelimited).string(message.server); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetServiceInfoResponse @@ -537,76 +386,6 @@ class GetObjectRequest$Type extends MessageType { { no: 3, name: 'read_mask', kind: 'message', T: () => FieldMask }, ]); } - create(value?: PartialMessage): GetObjectRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetObjectRequest, - ): GetObjectRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string object_id */ 1: - message.objectId = reader.string(); - break; - case /* optional uint64 version */ 2: - message.version = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.FieldMask read_mask */ 3: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetObjectRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string object_id = 1; */ - if (message.objectId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.objectId); - /* optional uint64 version = 2; */ - if (message.version !== undefined) writer.tag(2, WireType.Varint).uint64(message.version); - /* optional google.protobuf.FieldMask read_mask = 3; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetObjectRequest @@ -619,65 +398,6 @@ class GetObjectResponse$Type extends MessageType { { no: 1, name: 'object', kind: 'message', T: () => Object }, ]); } - create(value?: PartialMessage): GetObjectResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetObjectResponse, - ): GetObjectResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Object object */ 1: - message.object = Object.internalBinaryRead( - reader, - reader.uint32(), - options, - message.object, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetObjectResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Object object = 1; */ - if (message.object) - Object.internalBinaryWrite( - message.object, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetObjectResponse @@ -697,78 +417,6 @@ class BatchGetObjectsRequest$Type extends MessageType { { no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask }, ]); } - create(value?: PartialMessage): BatchGetObjectsRequest { - const message = globalThis.Object.create(this.messagePrototype!); - message.requests = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: BatchGetObjectsRequest, - ): BatchGetObjectsRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.GetObjectRequest requests */ 1: - message.requests.push( - GetObjectRequest.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional google.protobuf.FieldMask read_mask */ 2: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: BatchGetObjectsRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.GetObjectRequest requests = 1; */ - for (let i = 0; i < message.requests.length; i++) - GetObjectRequest.internalBinaryWrite( - message.requests[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional google.protobuf.FieldMask read_mask = 2; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.BatchGetObjectsRequest @@ -787,63 +435,6 @@ class BatchGetObjectsResponse$Type extends MessageType }, ]); } - create(value?: PartialMessage): BatchGetObjectsResponse { - const message = globalThis.Object.create(this.messagePrototype!); - message.objects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: BatchGetObjectsResponse, - ): BatchGetObjectsResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.GetObjectResult objects */ 1: - message.objects.push( - GetObjectResult.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: BatchGetObjectsResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.GetObjectResult objects = 1; */ - for (let i = 0; i < message.objects.length; i++) - GetObjectResult.internalBinaryWrite( - message.objects[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.BatchGetObjectsResponse @@ -857,87 +448,6 @@ class GetObjectResult$Type extends MessageType { { no: 2, name: 'error', kind: 'message', oneof: 'result', T: () => Status }, ]); } - create(value?: PartialMessage): GetObjectResult { - const message = globalThis.Object.create(this.messagePrototype!); - message.result = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetObjectResult, - ): GetObjectResult { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* sui.rpc.v2beta2.Object object */ 1: - message.result = { - oneofKind: 'object', - object: Object.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.result as any).object, - ), - }; - break; - case /* google.rpc.Status error */ 2: - message.result = { - oneofKind: 'error', - error: Status.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.result as any).error, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetObjectResult, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* sui.rpc.v2beta2.Object object = 1; */ - if (message.result.oneofKind === 'object') - Object.internalBinaryWrite( - message.result.object, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* google.rpc.Status error = 2; */ - if (message.result.oneofKind === 'error') - Status.internalBinaryWrite( - message.result.error, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetObjectResult @@ -951,71 +461,6 @@ class GetTransactionRequest$Type extends MessageType { { no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask }, ]); } - create(value?: PartialMessage): GetTransactionRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetTransactionRequest, - ): GetTransactionRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string digest */ 1: - message.digest = reader.string(); - break; - case /* optional google.protobuf.FieldMask read_mask */ 2: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetTransactionRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string digest = 1; */ - if (message.digest !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.digest); - /* optional google.protobuf.FieldMask read_mask = 2; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetTransactionRequest @@ -1028,65 +473,6 @@ class GetTransactionResponse$Type extends MessageType { { no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction }, ]); } - create(value?: PartialMessage): GetTransactionResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetTransactionResponse, - ): GetTransactionResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.ExecutedTransaction transaction */ 1: - message.transaction = ExecutedTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - message.transaction, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetTransactionResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.ExecutedTransaction transaction = 1; */ - if (message.transaction) - ExecutedTransaction.internalBinaryWrite( - message.transaction, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetTransactionResponse @@ -1106,73 +492,6 @@ class BatchGetTransactionsRequest$Type extends MessageType FieldMask }, ]); } - create(value?: PartialMessage): BatchGetTransactionsRequest { - const message = globalThis.Object.create(this.messagePrototype!); - message.digests = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: BatchGetTransactionsRequest, - ): BatchGetTransactionsRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated string digests */ 1: - message.digests.push(reader.string()); - break; - case /* optional google.protobuf.FieldMask read_mask */ 2: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: BatchGetTransactionsRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated string digests = 1; */ - for (let i = 0; i < message.digests.length; i++) - writer.tag(1, WireType.LengthDelimited).string(message.digests[i]); - /* optional google.protobuf.FieldMask read_mask = 2; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.BatchGetTransactionsRequest @@ -1191,64 +510,6 @@ class BatchGetTransactionsResponse$Type extends MessageType): BatchGetTransactionsResponse { - const message = globalThis.Object.create(this.messagePrototype!); - message.transactions = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: BatchGetTransactionsResponse, - ): BatchGetTransactionsResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.GetTransactionResult transactions */ 1: - message.transactions.push( - GetTransactionResult.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: BatchGetTransactionsResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.GetTransactionResult transactions = 1; */ - for (let i = 0; i < message.transactions.length; i++) - GetTransactionResult.internalBinaryWrite( - message.transactions[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.BatchGetTransactionsResponse @@ -1268,87 +529,6 @@ class GetTransactionResult$Type extends MessageType { { no: 2, name: 'error', kind: 'message', oneof: 'result', T: () => Status }, ]); } - create(value?: PartialMessage): GetTransactionResult { - const message = globalThis.Object.create(this.messagePrototype!); - message.result = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetTransactionResult, - ): GetTransactionResult { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* sui.rpc.v2beta2.ExecutedTransaction transaction */ 1: - message.result = { - oneofKind: 'transaction', - transaction: ExecutedTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.result as any).transaction, - ), - }; - break; - case /* google.rpc.Status error */ 2: - message.result = { - oneofKind: 'error', - error: Status.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.result as any).error, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetTransactionResult, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* sui.rpc.v2beta2.ExecutedTransaction transaction = 1; */ - if (message.result.oneofKind === 'transaction') - ExecutedTransaction.internalBinaryWrite( - message.result.transaction, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* google.rpc.Status error = 2; */ - if (message.result.oneofKind === 'error') - Status.internalBinaryWrite( - message.result.error, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetTransactionResult @@ -1370,84 +550,6 @@ class GetCheckpointRequest$Type extends MessageType { { no: 3, name: 'read_mask', kind: 'message', T: () => FieldMask }, ]); } - create(value?: PartialMessage): GetCheckpointRequest { - const message = globalThis.Object.create(this.messagePrototype!); - message.checkpointId = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetCheckpointRequest, - ): GetCheckpointRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 sequence_number */ 1: - message.checkpointId = { - oneofKind: 'sequenceNumber', - sequenceNumber: reader.uint64().toBigInt(), - }; - break; - case /* string digest */ 2: - message.checkpointId = { - oneofKind: 'digest', - digest: reader.string(), - }; - break; - case /* optional google.protobuf.FieldMask read_mask */ 3: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetCheckpointRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* uint64 sequence_number = 1; */ - if (message.checkpointId.oneofKind === 'sequenceNumber') - writer.tag(1, WireType.Varint).uint64(message.checkpointId.sequenceNumber); - /* string digest = 2; */ - if (message.checkpointId.oneofKind === 'digest') - writer.tag(2, WireType.LengthDelimited).string(message.checkpointId.digest); - /* optional google.protobuf.FieldMask read_mask = 3; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetCheckpointRequest @@ -1460,65 +562,6 @@ class GetCheckpointResponse$Type extends MessageType { { no: 1, name: 'checkpoint', kind: 'message', T: () => Checkpoint }, ]); } - create(value?: PartialMessage): GetCheckpointResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetCheckpointResponse, - ): GetCheckpointResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Checkpoint checkpoint */ 1: - message.checkpoint = Checkpoint.internalBinaryRead( - reader, - reader.uint32(), - options, - message.checkpoint, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetCheckpointResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Checkpoint checkpoint = 1; */ - if (message.checkpoint) - Checkpoint.internalBinaryWrite( - message.checkpoint, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetCheckpointResponse @@ -1539,70 +582,6 @@ class GetEpochRequest$Type extends MessageType { { no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask }, ]); } - create(value?: PartialMessage): GetEpochRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetEpochRequest, - ): GetEpochRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.FieldMask read_mask */ 2: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetEpochRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* optional google.protobuf.FieldMask read_mask = 2; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetEpochRequest @@ -1615,60 +594,6 @@ class GetEpochResponse$Type extends MessageType { { no: 1, name: 'epoch', kind: 'message', T: () => Epoch }, ]); } - create(value?: PartialMessage): GetEpochResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetEpochResponse, - ): GetEpochResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Epoch epoch */ 1: - message.epoch = Epoch.internalBinaryRead(reader, reader.uint32(), options, message.epoch); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetEpochResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Epoch epoch = 1; */ - if (message.epoch) - Epoch.internalBinaryWrite( - message.epoch, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetEpochResponse diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts index 2b4cc7286..c420b09d7 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/live_data_service.ts @@ -1,14 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { ServiceType } from '@protobuf-ts/runtime-rpc'; -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Value } from '../../../google/protobuf/struct.js'; import { Bcs } from './bcs.js'; @@ -685,56 +677,6 @@ class GetCoinInfoRequest$Type extends MessageType { { no: 1, name: 'coin_type', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): GetCoinInfoRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetCoinInfoRequest, - ): GetCoinInfoRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string coin_type */ 1: - message.coinType = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetCoinInfoRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string coin_type = 1; */ - if (message.coinType !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.coinType); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetCoinInfoRequest @@ -750,101 +692,6 @@ class GetCoinInfoResponse$Type extends MessageType { { no: 4, name: 'regulated_metadata', kind: 'message', T: () => RegulatedCoinMetadata }, ]); } - create(value?: PartialMessage): GetCoinInfoResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetCoinInfoResponse, - ): GetCoinInfoResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string coin_type */ 1: - message.coinType = reader.string(); - break; - case /* optional sui.rpc.v2beta2.CoinMetadata metadata */ 2: - message.metadata = CoinMetadata.internalBinaryRead( - reader, - reader.uint32(), - options, - message.metadata, - ); - break; - case /* optional sui.rpc.v2beta2.CoinTreasury treasury */ 3: - message.treasury = CoinTreasury.internalBinaryRead( - reader, - reader.uint32(), - options, - message.treasury, - ); - break; - case /* optional sui.rpc.v2beta2.RegulatedCoinMetadata regulated_metadata */ 4: - message.regulatedMetadata = RegulatedCoinMetadata.internalBinaryRead( - reader, - reader.uint32(), - options, - message.regulatedMetadata, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetCoinInfoResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string coin_type = 1; */ - if (message.coinType !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.coinType); - /* optional sui.rpc.v2beta2.CoinMetadata metadata = 2; */ - if (message.metadata) - CoinMetadata.internalBinaryWrite( - message.metadata, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.CoinTreasury treasury = 3; */ - if (message.treasury) - CoinTreasury.internalBinaryWrite( - message.treasury, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.RegulatedCoinMetadata regulated_metadata = 4; */ - if (message.regulatedMetadata) - RegulatedCoinMetadata.internalBinaryWrite( - message.regulatedMetadata, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetCoinInfoResponse @@ -870,95 +717,6 @@ class CoinMetadata$Type extends MessageType { }, ]); } - create(value?: PartialMessage): CoinMetadata { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CoinMetadata, - ): CoinMetadata { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string id */ 1: - message.id = reader.string(); - break; - case /* optional uint32 decimals */ 2: - message.decimals = reader.uint32(); - break; - case /* optional string name */ 3: - message.name = reader.string(); - break; - case /* optional string symbol */ 4: - message.symbol = reader.string(); - break; - case /* optional string description */ 5: - message.description = reader.string(); - break; - case /* optional string icon_url */ 6: - message.iconUrl = reader.string(); - break; - case /* optional string metadata_cap_id */ 7: - message.metadataCapId = reader.string(); - break; - case /* optional sui.rpc.v2beta2.CoinMetadata.MetadataCapState metadata_cap_state */ 8: - message.metadataCapState = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CoinMetadata, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string id = 1; */ - if (message.id !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.id); - /* optional uint32 decimals = 2; */ - if (message.decimals !== undefined) writer.tag(2, WireType.Varint).uint32(message.decimals); - /* optional string name = 3; */ - if (message.name !== undefined) writer.tag(3, WireType.LengthDelimited).string(message.name); - /* optional string symbol = 4; */ - if (message.symbol !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.symbol); - /* optional string description = 5; */ - if (message.description !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.description); - /* optional string icon_url = 6; */ - if (message.iconUrl !== undefined) - writer.tag(6, WireType.LengthDelimited).string(message.iconUrl); - /* optional string metadata_cap_id = 7; */ - if (message.metadataCapId !== undefined) - writer.tag(7, WireType.LengthDelimited).string(message.metadataCapId); - /* optional sui.rpc.v2beta2.CoinMetadata.MetadataCapState metadata_cap_state = 8; */ - if (message.metadataCapState !== undefined) - writer.tag(8, WireType.Varint).int32(message.metadataCapState); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CoinMetadata @@ -986,67 +744,6 @@ class CoinTreasury$Type extends MessageType { }, ]); } - create(value?: PartialMessage): CoinTreasury { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CoinTreasury, - ): CoinTreasury { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string id */ 1: - message.id = reader.string(); - break; - case /* optional uint64 total_supply */ 2: - message.totalSupply = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.CoinTreasury.SupplyState supply_state */ 3: - message.supplyState = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CoinTreasury, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string id = 1; */ - if (message.id !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.id); - /* optional uint64 total_supply = 2; */ - if (message.totalSupply !== undefined) - writer.tag(2, WireType.Varint).uint64(message.totalSupply); - /* optional sui.rpc.v2beta2.CoinTreasury.SupplyState supply_state = 3; */ - if (message.supplyState !== undefined) - writer.tag(3, WireType.Varint).int32(message.supplyState); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CoinTreasury @@ -1079,84 +776,6 @@ class RegulatedCoinMetadata$Type extends MessageType { }, ]); } - create(value?: PartialMessage): RegulatedCoinMetadata { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: RegulatedCoinMetadata, - ): RegulatedCoinMetadata { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string id */ 1: - message.id = reader.string(); - break; - case /* optional string coin_metadata_object */ 2: - message.coinMetadataObject = reader.string(); - break; - case /* optional string deny_cap_object */ 3: - message.denyCapObject = reader.string(); - break; - case /* optional bool allow_global_pause */ 4: - message.allowGlobalPause = reader.bool(); - break; - case /* optional uint32 variant */ 5: - message.variant = reader.uint32(); - break; - case /* optional sui.rpc.v2beta2.RegulatedCoinMetadata.CoinRegulatedState coin_regulated_state */ 6: - message.coinRegulatedState = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: RegulatedCoinMetadata, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string id = 1; */ - if (message.id !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.id); - /* optional string coin_metadata_object = 2; */ - if (message.coinMetadataObject !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.coinMetadataObject); - /* optional string deny_cap_object = 3; */ - if (message.denyCapObject !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.denyCapObject); - /* optional bool allow_global_pause = 4; */ - if (message.allowGlobalPause !== undefined) - writer.tag(4, WireType.Varint).bool(message.allowGlobalPause); - /* optional uint32 variant = 5; */ - if (message.variant !== undefined) writer.tag(5, WireType.Varint).uint32(message.variant); - /* optional sui.rpc.v2beta2.RegulatedCoinMetadata.CoinRegulatedState coin_regulated_state = 6; */ - if (message.coinRegulatedState !== undefined) - writer.tag(6, WireType.Varint).int32(message.coinRegulatedState); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.RegulatedCoinMetadata @@ -1170,61 +789,6 @@ class GetBalanceRequest$Type extends MessageType { { no: 2, name: 'coin_type', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): GetBalanceRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetBalanceRequest, - ): GetBalanceRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string owner */ 1: - message.owner = reader.string(); - break; - case /* optional string coin_type */ 2: - message.coinType = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetBalanceRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string owner = 1; */ - if (message.owner !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.owner); - /* optional string coin_type = 2; */ - if (message.coinType !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.coinType); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetBalanceRequest @@ -1237,65 +801,6 @@ class GetBalanceResponse$Type extends MessageType { { no: 1, name: 'balance', kind: 'message', T: () => Balance }, ]); } - create(value?: PartialMessage): GetBalanceResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetBalanceResponse, - ): GetBalanceResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Balance balance */ 1: - message.balance = Balance.internalBinaryRead( - reader, - reader.uint32(), - options, - message.balance, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetBalanceResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Balance balance = 1; */ - if (message.balance) - Balance.internalBinaryWrite( - message.balance, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetBalanceResponse @@ -1310,66 +815,6 @@ class ListBalancesRequest$Type extends MessageType { { no: 3, name: 'page_token', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ }, ]); } - create(value?: PartialMessage): ListBalancesRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListBalancesRequest, - ): ListBalancesRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string owner */ 1: - message.owner = reader.string(); - break; - case /* optional uint32 page_size */ 2: - message.pageSize = reader.uint32(); - break; - case /* optional bytes page_token */ 3: - message.pageToken = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListBalancesRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string owner = 1; */ - if (message.owner !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.owner); - /* optional uint32 page_size = 2; */ - if (message.pageSize !== undefined) writer.tag(2, WireType.Varint).uint32(message.pageSize); - /* optional bytes page_token = 3; */ - if (message.pageToken !== undefined) - writer.tag(3, WireType.LengthDelimited).bytes(message.pageToken); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListBalancesRequest @@ -1389,67 +834,6 @@ class ListBalancesResponse$Type extends MessageType { { no: 2, name: 'next_page_token', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ }, ]); } - create(value?: PartialMessage): ListBalancesResponse { - const message = globalThis.Object.create(this.messagePrototype!); - message.balances = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListBalancesResponse, - ): ListBalancesResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.Balance balances */ 1: - message.balances.push(Balance.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* optional bytes next_page_token */ 2: - message.nextPageToken = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListBalancesResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.Balance balances = 1; */ - for (let i = 0; i < message.balances.length; i++) - Balance.internalBinaryWrite( - message.balances[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional bytes next_page_token = 2; */ - if (message.nextPageToken !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.nextPageToken); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListBalancesResponse @@ -1470,61 +854,6 @@ class Balance$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Balance { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Balance, - ): Balance { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string coin_type */ 1: - message.coinType = reader.string(); - break; - case /* optional uint64 balance */ 3: - message.balance = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Balance, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string coin_type = 1; */ - if (message.coinType !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.coinType); - /* optional uint64 balance = 3; */ - if (message.balance !== undefined) writer.tag(3, WireType.Varint).uint64(message.balance); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Balance @@ -1540,82 +869,6 @@ class ListDynamicFieldsRequest$Type extends MessageType FieldMask }, ]); } - create(value?: PartialMessage): ListDynamicFieldsRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListDynamicFieldsRequest, - ): ListDynamicFieldsRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string parent */ 1: - message.parent = reader.string(); - break; - case /* optional uint32 page_size */ 2: - message.pageSize = reader.uint32(); - break; - case /* optional bytes page_token */ 3: - message.pageToken = reader.bytes(); - break; - case /* optional google.protobuf.FieldMask read_mask */ 4: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListDynamicFieldsRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string parent = 1; */ - if (message.parent !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.parent); - /* optional uint32 page_size = 2; */ - if (message.pageSize !== undefined) writer.tag(2, WireType.Varint).uint32(message.pageSize); - /* optional bytes page_token = 3; */ - if (message.pageToken !== undefined) - writer.tag(3, WireType.LengthDelimited).bytes(message.pageToken); - /* optional google.protobuf.FieldMask read_mask = 4; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListDynamicFieldsRequest @@ -1635,70 +888,6 @@ class ListDynamicFieldsResponse$Type extends MessageType): ListDynamicFieldsResponse { - const message = globalThis.Object.create(this.messagePrototype!); - message.dynamicFields = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListDynamicFieldsResponse, - ): ListDynamicFieldsResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.DynamicField dynamic_fields */ 1: - message.dynamicFields.push( - DynamicField.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional bytes next_page_token */ 2: - message.nextPageToken = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListDynamicFieldsResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.DynamicField dynamic_fields = 1; */ - for (let i = 0; i < message.dynamicFields.length; i++) - DynamicField.internalBinaryWrite( - message.dynamicFields[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional bytes next_page_token = 2; */ - if (message.nextPageToken !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.nextPageToken); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListDynamicFieldsResponse @@ -1724,106 +913,6 @@ class DynamicField$Type extends MessageType { { no: 8, name: 'object', kind: 'message', T: () => Object }, ]); } - create(value?: PartialMessage): DynamicField { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: DynamicField, - ): DynamicField { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.DynamicField.DynamicFieldKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional string parent */ 2: - message.parent = reader.string(); - break; - case /* optional string field_id */ 3: - message.fieldId = reader.string(); - break; - case /* optional string name_type */ 4: - message.nameType = reader.string(); - break; - case /* optional bytes name_value */ 5: - message.nameValue = reader.bytes(); - break; - case /* optional string value_type */ 6: - message.valueType = reader.string(); - break; - case /* optional string dynamic_object_id */ 7: - message.dynamicObjectId = reader.string(); - break; - case /* optional sui.rpc.v2beta2.Object object */ 8: - message.object = Object.internalBinaryRead( - reader, - reader.uint32(), - options, - message.object, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: DynamicField, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.DynamicField.DynamicFieldKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional string parent = 2; */ - if (message.parent !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.parent); - /* optional string field_id = 3; */ - if (message.fieldId !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.fieldId); - /* optional string name_type = 4; */ - if (message.nameType !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.nameType); - /* optional bytes name_value = 5; */ - if (message.nameValue !== undefined) - writer.tag(5, WireType.LengthDelimited).bytes(message.nameValue); - /* optional string value_type = 6; */ - if (message.valueType !== undefined) - writer.tag(6, WireType.LengthDelimited).string(message.valueType); - /* optional string dynamic_object_id = 7; */ - if (message.dynamicObjectId !== undefined) - writer.tag(7, WireType.LengthDelimited).string(message.dynamicObjectId); - /* optional sui.rpc.v2beta2.Object object = 8; */ - if (message.object) - Object.internalBinaryWrite( - message.object, - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.DynamicField @@ -1848,92 +937,6 @@ class SimulateTransactionRequest$Type extends MessageType): SimulateTransactionRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SimulateTransactionRequest, - ): SimulateTransactionRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Transaction transaction */ 1: - message.transaction = Transaction.internalBinaryRead( - reader, - reader.uint32(), - options, - message.transaction, - ); - break; - case /* optional google.protobuf.FieldMask read_mask */ 2: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - case /* optional sui.rpc.v2beta2.SimulateTransactionRequest.TransactionChecks checks */ 3: - message.checks = reader.int32(); - break; - case /* optional bool do_gas_selection */ 4: - message.doGasSelection = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SimulateTransactionRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Transaction transaction = 1; */ - if (message.transaction) - Transaction.internalBinaryWrite( - message.transaction, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional google.protobuf.FieldMask read_mask = 2; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.SimulateTransactionRequest.TransactionChecks checks = 3; */ - if (message.checks !== undefined) writer.tag(3, WireType.Varint).int32(message.checks); - /* optional bool do_gas_selection = 4; */ - if (message.doGasSelection !== undefined) - writer.tag(4, WireType.Varint).bool(message.doGasSelection); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SimulateTransactionRequest @@ -1953,77 +956,6 @@ class SimulateTransactionResponse$Type extends MessageType): SimulateTransactionResponse { - const message = globalThis.Object.create(this.messagePrototype!); - message.outputs = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SimulateTransactionResponse, - ): SimulateTransactionResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.ExecutedTransaction transaction */ 1: - message.transaction = ExecutedTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - message.transaction, - ); - break; - case /* repeated sui.rpc.v2beta2.CommandResult outputs */ 2: - message.outputs.push(CommandResult.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SimulateTransactionResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.ExecutedTransaction transaction = 1; */ - if (message.transaction) - ExecutedTransaction.internalBinaryWrite( - message.transaction, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.CommandResult outputs = 2; */ - for (let i = 0; i < message.outputs.length; i++) - CommandResult.internalBinaryWrite( - message.outputs[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SimulateTransactionResponse @@ -2049,76 +981,6 @@ class CommandResult$Type extends MessageType { }, ]); } - create(value?: PartialMessage): CommandResult { - const message = globalThis.Object.create(this.messagePrototype!); - message.returnValues = []; - message.mutatedByRef = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CommandResult, - ): CommandResult { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.CommandOutput return_values */ 1: - message.returnValues.push( - CommandOutput.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* repeated sui.rpc.v2beta2.CommandOutput mutated_by_ref */ 2: - message.mutatedByRef.push( - CommandOutput.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CommandResult, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.CommandOutput return_values = 1; */ - for (let i = 0; i < message.returnValues.length; i++) - CommandOutput.internalBinaryWrite( - message.returnValues[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.CommandOutput mutated_by_ref = 2; */ - for (let i = 0; i < message.mutatedByRef.length; i++) - CommandOutput.internalBinaryWrite( - message.mutatedByRef[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CommandResult @@ -2133,85 +995,6 @@ class CommandOutput$Type extends MessageType { { no: 3, name: 'json', kind: 'message', T: () => Value }, ]); } - create(value?: PartialMessage): CommandOutput { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CommandOutput, - ): CommandOutput { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Argument argument */ 1: - message.argument = Argument.internalBinaryRead( - reader, - reader.uint32(), - options, - message.argument, - ); - break; - case /* optional sui.rpc.v2beta2.Bcs value */ 2: - message.value = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.value); - break; - case /* optional google.protobuf.Value json */ 3: - message.json = Value.internalBinaryRead(reader, reader.uint32(), options, message.json); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CommandOutput, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Argument argument = 1; */ - if (message.argument) - Argument.internalBinaryWrite( - message.argument, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.Bcs value = 2; */ - if (message.value) - Bcs.internalBinaryWrite( - message.value, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional google.protobuf.Value json = 3; */ - if (message.json) - Value.internalBinaryWrite( - message.json, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CommandOutput @@ -2228,87 +1011,6 @@ class ListOwnedObjectsRequest$Type extends MessageType { no: 5, name: 'object_type', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): ListOwnedObjectsRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListOwnedObjectsRequest, - ): ListOwnedObjectsRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string owner */ 1: - message.owner = reader.string(); - break; - case /* optional uint32 page_size */ 2: - message.pageSize = reader.uint32(); - break; - case /* optional bytes page_token */ 3: - message.pageToken = reader.bytes(); - break; - case /* optional google.protobuf.FieldMask read_mask */ 4: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - case /* optional string object_type */ 5: - message.objectType = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListOwnedObjectsRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string owner = 1; */ - if (message.owner !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.owner); - /* optional uint32 page_size = 2; */ - if (message.pageSize !== undefined) writer.tag(2, WireType.Varint).uint32(message.pageSize); - /* optional bytes page_token = 3; */ - if (message.pageToken !== undefined) - writer.tag(3, WireType.LengthDelimited).bytes(message.pageToken); - /* optional google.protobuf.FieldMask read_mask = 4; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string object_type = 5; */ - if (message.objectType !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.objectType); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListOwnedObjectsRequest @@ -2328,67 +1030,6 @@ class ListOwnedObjectsResponse$Type extends MessageType): ListOwnedObjectsResponse { - const message = globalThis.Object.create(this.messagePrototype!); - message.objects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListOwnedObjectsResponse, - ): ListOwnedObjectsResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.Object objects */ 1: - message.objects.push(Object.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* optional bytes next_page_token */ 2: - message.nextPageToken = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListOwnedObjectsResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.Object objects = 1; */ - for (let i = 0; i < message.objects.length; i++) - Object.internalBinaryWrite( - message.objects[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional bytes next_page_token = 2; */ - if (message.nextPageToken !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.nextPageToken); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListOwnedObjectsResponse diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package.ts index e05cc9e49..249203e53 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * A Move Package @@ -546,100 +538,6 @@ class Package$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Package { - const message = globalThis.Object.create(this.messagePrototype!); - message.modules = []; - message.typeOrigins = []; - message.linkage = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Package, - ): Package { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string storage_id */ 1: - message.storageId = reader.string(); - break; - case /* optional string original_id */ 2: - message.originalId = reader.string(); - break; - case /* optional uint64 version */ 3: - message.version = reader.uint64().toBigInt(); - break; - case /* repeated sui.rpc.v2beta2.Module modules */ 4: - message.modules.push(Module.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated sui.rpc.v2beta2.TypeOrigin type_origins */ 5: - message.typeOrigins.push(TypeOrigin.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated sui.rpc.v2beta2.Linkage linkage */ 6: - message.linkage.push(Linkage.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Package, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string storage_id = 1; */ - if (message.storageId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.storageId); - /* optional string original_id = 2; */ - if (message.originalId !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.originalId); - /* optional uint64 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).uint64(message.version); - /* repeated sui.rpc.v2beta2.Module modules = 4; */ - for (let i = 0; i < message.modules.length; i++) - Module.internalBinaryWrite( - message.modules[i], - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.TypeOrigin type_origins = 5; */ - for (let i = 0; i < message.typeOrigins.length; i++) - TypeOrigin.internalBinaryWrite( - message.typeOrigins[i], - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.Linkage linkage = 6; */ - for (let i = 0; i < message.linkage.length; i++) - Linkage.internalBinaryWrite( - message.linkage[i], - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Package @@ -667,87 +565,6 @@ class Module$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Module { - const message = globalThis.Object.create(this.messagePrototype!); - message.datatypes = []; - message.functions = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Module, - ): Module { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string name */ 1: - message.name = reader.string(); - break; - case /* optional bytes contents */ 2: - message.contents = reader.bytes(); - break; - case /* repeated sui.rpc.v2beta2.DatatypeDescriptor datatypes */ 3: - message.datatypes.push( - DatatypeDescriptor.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* repeated sui.rpc.v2beta2.FunctionDescriptor functions */ 4: - message.functions.push( - FunctionDescriptor.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Module, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string name = 1; */ - if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); - /* optional bytes contents = 2; */ - if (message.contents !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.contents); - /* repeated sui.rpc.v2beta2.DatatypeDescriptor datatypes = 3; */ - for (let i = 0; i < message.datatypes.length; i++) - DatatypeDescriptor.internalBinaryWrite( - message.datatypes[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.FunctionDescriptor functions = 4; */ - for (let i = 0; i < message.functions.length; i++) - FunctionDescriptor.internalBinaryWrite( - message.functions[i], - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Module @@ -801,128 +618,6 @@ class DatatypeDescriptor$Type extends MessageType { }, ]); } - create(value?: PartialMessage): DatatypeDescriptor { - const message = globalThis.Object.create(this.messagePrototype!); - message.abilities = []; - message.typeParameters = []; - message.fields = []; - message.variants = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: DatatypeDescriptor, - ): DatatypeDescriptor { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string type_name */ 1: - message.typeName = reader.string(); - break; - case /* optional string defining_id */ 2: - message.definingId = reader.string(); - break; - case /* optional string module */ 3: - message.module = reader.string(); - break; - case /* optional string name */ 4: - message.name = reader.string(); - break; - case /* repeated sui.rpc.v2beta2.Ability abilities */ 5: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e; ) - message.abilities.push(reader.int32()); - else message.abilities.push(reader.int32()); - break; - case /* repeated sui.rpc.v2beta2.TypeParameter type_parameters */ 6: - message.typeParameters.push( - TypeParameter.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional sui.rpc.v2beta2.DatatypeDescriptor.DatatypeKind kind */ 7: - message.kind = reader.int32(); - break; - case /* repeated sui.rpc.v2beta2.FieldDescriptor fields */ 8: - message.fields.push(FieldDescriptor.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated sui.rpc.v2beta2.VariantDescriptor variants */ 9: - message.variants.push( - VariantDescriptor.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: DatatypeDescriptor, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string type_name = 1; */ - if (message.typeName !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.typeName); - /* optional string defining_id = 2; */ - if (message.definingId !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.definingId); - /* optional string module = 3; */ - if (message.module !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.module); - /* optional string name = 4; */ - if (message.name !== undefined) writer.tag(4, WireType.LengthDelimited).string(message.name); - /* repeated sui.rpc.v2beta2.Ability abilities = 5; */ - if (message.abilities.length) { - writer.tag(5, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.abilities.length; i++) writer.int32(message.abilities[i]); - writer.join(); - } - /* repeated sui.rpc.v2beta2.TypeParameter type_parameters = 6; */ - for (let i = 0; i < message.typeParameters.length; i++) - TypeParameter.internalBinaryWrite( - message.typeParameters[i], - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.DatatypeDescriptor.DatatypeKind kind = 7; */ - if (message.kind !== undefined) writer.tag(7, WireType.Varint).int32(message.kind); - /* repeated sui.rpc.v2beta2.FieldDescriptor fields = 8; */ - for (let i = 0; i < message.fields.length; i++) - FieldDescriptor.internalBinaryWrite( - message.fields[i], - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.VariantDescriptor variants = 9; */ - for (let i = 0; i < message.variants.length; i++) - VariantDescriptor.internalBinaryWrite( - message.variants[i], - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.DatatypeDescriptor @@ -942,68 +637,6 @@ class TypeParameter$Type extends MessageType { { no: 2, name: 'is_phantom', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ }, ]); } - create(value?: PartialMessage): TypeParameter { - const message = globalThis.Object.create(this.messagePrototype!); - message.constraints = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TypeParameter, - ): TypeParameter { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.Ability constraints */ 1: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e; ) - message.constraints.push(reader.int32()); - else message.constraints.push(reader.int32()); - break; - case /* optional bool is_phantom */ 2: - message.isPhantom = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TypeParameter, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.Ability constraints = 1; */ - if (message.constraints.length) { - writer.tag(1, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.constraints.length; i++) writer.int32(message.constraints[i]); - writer.join(); - } - /* optional bool is_phantom = 2; */ - if (message.isPhantom !== undefined) writer.tag(2, WireType.Varint).bool(message.isPhantom); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TypeParameter @@ -1018,75 +651,6 @@ class FieldDescriptor$Type extends MessageType { { no: 3, name: 'type', kind: 'message', T: () => OpenSignatureBody }, ]); } - create(value?: PartialMessage): FieldDescriptor { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: FieldDescriptor, - ): FieldDescriptor { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string name */ 1: - message.name = reader.string(); - break; - case /* optional uint32 position */ 2: - message.position = reader.uint32(); - break; - case /* optional sui.rpc.v2beta2.OpenSignatureBody type */ 3: - message.type = OpenSignatureBody.internalBinaryRead( - reader, - reader.uint32(), - options, - message.type, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: FieldDescriptor, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string name = 1; */ - if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); - /* optional uint32 position = 2; */ - if (message.position !== undefined) writer.tag(2, WireType.Varint).uint32(message.position); - /* optional sui.rpc.v2beta2.OpenSignatureBody type = 3; */ - if (message.type) - OpenSignatureBody.internalBinaryWrite( - message.type, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.FieldDescriptor @@ -1107,71 +671,6 @@ class VariantDescriptor$Type extends MessageType { }, ]); } - create(value?: PartialMessage): VariantDescriptor { - const message = globalThis.Object.create(this.messagePrototype!); - message.fields = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: VariantDescriptor, - ): VariantDescriptor { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string name */ 1: - message.name = reader.string(); - break; - case /* optional uint32 position */ 2: - message.position = reader.uint32(); - break; - case /* repeated sui.rpc.v2beta2.FieldDescriptor fields */ 3: - message.fields.push(FieldDescriptor.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: VariantDescriptor, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string name = 1; */ - if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); - /* optional uint32 position = 2; */ - if (message.position !== undefined) writer.tag(2, WireType.Varint).uint32(message.position); - /* repeated sui.rpc.v2beta2.FieldDescriptor fields = 3; */ - for (let i = 0; i < message.fields.length; i++) - FieldDescriptor.internalBinaryWrite( - message.fields[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.VariantDescriptor @@ -1199,80 +698,6 @@ class OpenSignatureBody$Type extends MessageType { { no: 4, name: 'type_parameter', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ }, ]); } - create(value?: PartialMessage): OpenSignatureBody { - const message = globalThis.Object.create(this.messagePrototype!); - message.typeParameterInstantiation = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: OpenSignatureBody, - ): OpenSignatureBody { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.OpenSignatureBody.Type type */ 1: - message.type = reader.int32(); - break; - case /* optional string type_name */ 2: - message.typeName = reader.string(); - break; - case /* repeated sui.rpc.v2beta2.OpenSignatureBody type_parameter_instantiation */ 3: - message.typeParameterInstantiation.push( - OpenSignatureBody.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional uint32 type_parameter */ 4: - message.typeParameter = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: OpenSignatureBody, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.OpenSignatureBody.Type type = 1; */ - if (message.type !== undefined) writer.tag(1, WireType.Varint).int32(message.type); - /* optional string type_name = 2; */ - if (message.typeName !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.typeName); - /* repeated sui.rpc.v2beta2.OpenSignatureBody type_parameter_instantiation = 3; */ - for (let i = 0; i < message.typeParameterInstantiation.length; i++) - OpenSignatureBody.internalBinaryWrite( - message.typeParameterInstantiation[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint32 type_parameter = 4; */ - if (message.typeParameter !== undefined) - writer.tag(4, WireType.Varint).uint32(message.typeParameter); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.OpenSignatureBody @@ -1314,102 +739,6 @@ class FunctionDescriptor$Type extends MessageType { }, ]); } - create(value?: PartialMessage): FunctionDescriptor { - const message = globalThis.Object.create(this.messagePrototype!); - message.typeParameters = []; - message.parameters = []; - message.returns = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: FunctionDescriptor, - ): FunctionDescriptor { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string name */ 1: - message.name = reader.string(); - break; - case /* optional sui.rpc.v2beta2.FunctionDescriptor.Visibility visibility */ 5: - message.visibility = reader.int32(); - break; - case /* optional bool is_entry */ 6: - message.isEntry = reader.bool(); - break; - case /* repeated sui.rpc.v2beta2.TypeParameter type_parameters */ 7: - message.typeParameters.push( - TypeParameter.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* repeated sui.rpc.v2beta2.OpenSignature parameters */ 8: - message.parameters.push( - OpenSignature.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* repeated sui.rpc.v2beta2.OpenSignature returns */ 9: - message.returns.push(OpenSignature.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: FunctionDescriptor, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string name = 1; */ - if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); - /* optional sui.rpc.v2beta2.FunctionDescriptor.Visibility visibility = 5; */ - if (message.visibility !== undefined) writer.tag(5, WireType.Varint).int32(message.visibility); - /* optional bool is_entry = 6; */ - if (message.isEntry !== undefined) writer.tag(6, WireType.Varint).bool(message.isEntry); - /* repeated sui.rpc.v2beta2.TypeParameter type_parameters = 7; */ - for (let i = 0; i < message.typeParameters.length; i++) - TypeParameter.internalBinaryWrite( - message.typeParameters[i], - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.OpenSignature parameters = 8; */ - for (let i = 0; i < message.parameters.length; i++) - OpenSignature.internalBinaryWrite( - message.parameters[i], - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.OpenSignature returns = 9; */ - for (let i = 0; i < message.returns.length; i++) - OpenSignature.internalBinaryWrite( - message.returns[i], - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.FunctionDescriptor @@ -1429,70 +758,6 @@ class OpenSignature$Type extends MessageType { { no: 2, name: 'body', kind: 'message', T: () => OpenSignatureBody }, ]); } - create(value?: PartialMessage): OpenSignature { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: OpenSignature, - ): OpenSignature { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.OpenSignature.Reference reference */ 1: - message.reference = reader.int32(); - break; - case /* optional sui.rpc.v2beta2.OpenSignatureBody body */ 2: - message.body = OpenSignatureBody.internalBinaryRead( - reader, - reader.uint32(), - options, - message.body, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: OpenSignature, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.OpenSignature.Reference reference = 1; */ - if (message.reference !== undefined) writer.tag(1, WireType.Varint).int32(message.reference); - /* optional sui.rpc.v2beta2.OpenSignatureBody body = 2; */ - if (message.body) - OpenSignatureBody.internalBinaryWrite( - message.body, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.OpenSignature @@ -1507,68 +772,6 @@ class TypeOrigin$Type extends MessageType { { no: 3, name: 'package_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): TypeOrigin { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TypeOrigin, - ): TypeOrigin { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string module_name */ 1: - message.moduleName = reader.string(); - break; - case /* optional string datatype_name */ 2: - message.datatypeName = reader.string(); - break; - case /* optional string package_id */ 3: - message.packageId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TypeOrigin, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string module_name = 1; */ - if (message.moduleName !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.moduleName); - /* optional string datatype_name = 2; */ - if (message.datatypeName !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.datatypeName); - /* optional string package_id = 3; */ - if (message.packageId !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.packageId); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TypeOrigin @@ -1590,68 +793,6 @@ class Linkage$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Linkage { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Linkage, - ): Linkage { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string original_id */ 1: - message.originalId = reader.string(); - break; - case /* optional string upgraded_id */ 2: - message.upgradedId = reader.string(); - break; - case /* optional uint64 upgraded_version */ 3: - message.upgradedVersion = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Linkage, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string original_id = 1; */ - if (message.originalId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.originalId); - /* optional string upgraded_id = 2; */ - if (message.upgradedId !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.upgradedId); - /* optional uint64 upgraded_version = 3; */ - if (message.upgradedVersion !== undefined) - writer.tag(3, WireType.Varint).uint64(message.upgradedVersion); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Linkage diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package_service.ts index 6524e76ef..9f42532e3 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/move_package_service.ts @@ -1,14 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { ServiceType } from '@protobuf-ts/runtime-rpc'; -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { FunctionDescriptor } from './move_package.js'; import { DatatypeDescriptor } from './move_package.js'; @@ -176,56 +168,6 @@ class GetPackageRequest$Type extends MessageType { { no: 1, name: 'package_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): GetPackageRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetPackageRequest, - ): GetPackageRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package_id */ 1: - message.packageId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetPackageRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package_id = 1; */ - if (message.packageId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.packageId); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetPackageRequest @@ -238,65 +180,6 @@ class GetPackageResponse$Type extends MessageType { { no: 1, name: 'package', kind: 'message', T: () => Package }, ]); } - create(value?: PartialMessage): GetPackageResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetPackageResponse, - ): GetPackageResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Package package */ 1: - message.package = Package.internalBinaryRead( - reader, - reader.uint32(), - options, - message.package, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetPackageResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Package package = 1; */ - if (message.package) - Package.internalBinaryWrite( - message.package, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetPackageResponse @@ -311,67 +194,6 @@ class GetDatatypeRequest$Type extends MessageType { { no: 3, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): GetDatatypeRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetDatatypeRequest, - ): GetDatatypeRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package_id */ 1: - message.packageId = reader.string(); - break; - case /* optional string module_name */ 2: - message.moduleName = reader.string(); - break; - case /* optional string name */ 3: - message.name = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetDatatypeRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package_id = 1; */ - if (message.packageId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.packageId); - /* optional string module_name = 2; */ - if (message.moduleName !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.moduleName); - /* optional string name = 3; */ - if (message.name !== undefined) writer.tag(3, WireType.LengthDelimited).string(message.name); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetDatatypeRequest @@ -384,65 +206,6 @@ class GetDatatypeResponse$Type extends MessageType { { no: 1, name: 'datatype', kind: 'message', T: () => DatatypeDescriptor }, ]); } - create(value?: PartialMessage): GetDatatypeResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetDatatypeResponse, - ): GetDatatypeResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.DatatypeDescriptor datatype */ 1: - message.datatype = DatatypeDescriptor.internalBinaryRead( - reader, - reader.uint32(), - options, - message.datatype, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetDatatypeResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.DatatypeDescriptor datatype = 1; */ - if (message.datatype) - DatatypeDescriptor.internalBinaryWrite( - message.datatype, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetDatatypeResponse @@ -457,67 +220,6 @@ class GetFunctionRequest$Type extends MessageType { { no: 3, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): GetFunctionRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetFunctionRequest, - ): GetFunctionRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package_id */ 1: - message.packageId = reader.string(); - break; - case /* optional string module_name */ 2: - message.moduleName = reader.string(); - break; - case /* optional string name */ 3: - message.name = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetFunctionRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package_id = 1; */ - if (message.packageId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.packageId); - /* optional string module_name = 2; */ - if (message.moduleName !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.moduleName); - /* optional string name = 3; */ - if (message.name !== undefined) writer.tag(3, WireType.LengthDelimited).string(message.name); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetFunctionRequest @@ -530,65 +232,6 @@ class GetFunctionResponse$Type extends MessageType { { no: 1, name: 'function', kind: 'message', T: () => FunctionDescriptor }, ]); } - create(value?: PartialMessage): GetFunctionResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GetFunctionResponse, - ): GetFunctionResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.FunctionDescriptor function */ 1: - message.function = FunctionDescriptor.internalBinaryRead( - reader, - reader.uint32(), - options, - message.function, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GetFunctionResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.FunctionDescriptor function = 1; */ - if (message.function) - FunctionDescriptor.internalBinaryWrite( - message.function, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GetFunctionResponse @@ -603,68 +246,6 @@ class ListPackageVersionsRequest$Type extends MessageType): ListPackageVersionsRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListPackageVersionsRequest, - ): ListPackageVersionsRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package_id */ 1: - message.packageId = reader.string(); - break; - case /* optional uint32 page_size */ 2: - message.pageSize = reader.uint32(); - break; - case /* optional bytes page_token */ 3: - message.pageToken = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListPackageVersionsRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package_id = 1; */ - if (message.packageId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.packageId); - /* optional uint32 page_size = 2; */ - if (message.pageSize !== undefined) writer.tag(2, WireType.Varint).uint32(message.pageSize); - /* optional bytes page_token = 3; */ - if (message.pageToken !== undefined) - writer.tag(3, WireType.LengthDelimited).bytes(message.pageToken); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListPackageVersionsRequest @@ -684,70 +265,6 @@ class ListPackageVersionsResponse$Type extends MessageType): ListPackageVersionsResponse { - const message = globalThis.Object.create(this.messagePrototype!); - message.versions = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ListPackageVersionsResponse, - ): ListPackageVersionsResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.PackageVersion versions */ 1: - message.versions.push( - PackageVersion.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional bytes next_page_token */ 2: - message.nextPageToken = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ListPackageVersionsResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.PackageVersion versions = 1; */ - for (let i = 0; i < message.versions.length; i++) - PackageVersion.internalBinaryWrite( - message.versions[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional bytes next_page_token = 2; */ - if (message.nextPageToken !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.nextPageToken); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ListPackageVersionsResponse @@ -768,61 +285,6 @@ class PackageVersion$Type extends MessageType { }, ]); } - create(value?: PartialMessage): PackageVersion { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: PackageVersion, - ): PackageVersion { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package_id */ 1: - message.packageId = reader.string(); - break; - case /* optional uint64 version */ 2: - message.version = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: PackageVersion, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package_id = 1; */ - if (message.packageId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.packageId); - /* optional uint64 version = 2; */ - if (message.version !== undefined) writer.tag(2, WireType.Varint).uint64(message.version); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.PackageVersion diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts index deb09cce8..e44795d92 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/name_service.ts @@ -1,14 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { ServiceType } from '@protobuf-ts/runtime-rpc'; -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; /** @@ -119,55 +111,6 @@ class LookupNameRequest$Type extends MessageType { { no: 1, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): LookupNameRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: LookupNameRequest, - ): LookupNameRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string name */ 1: - message.name = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: LookupNameRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string name = 1; */ - if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.LookupNameRequest @@ -180,65 +123,6 @@ class LookupNameResponse$Type extends MessageType { { no: 1, name: 'record', kind: 'message', T: () => NameRecord }, ]); } - create(value?: PartialMessage): LookupNameResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: LookupNameResponse, - ): LookupNameResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.NameRecord record */ 1: - message.record = NameRecord.internalBinaryRead( - reader, - reader.uint32(), - options, - message.record, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: LookupNameResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.NameRecord record = 1; */ - if (message.record) - NameRecord.internalBinaryWrite( - message.record, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.LookupNameResponse @@ -251,56 +135,6 @@ class ReverseLookupNameRequest$Type extends MessageType): ReverseLookupNameRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ReverseLookupNameRequest, - ): ReverseLookupNameRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string address */ 1: - message.address = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ReverseLookupNameRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string address = 1; */ - if (message.address !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.address); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ReverseLookupNameRequest @@ -313,66 +147,6 @@ class ReverseLookupNameResponse$Type extends MessageType NameRecord }, ]); } - create(value?: PartialMessage): ReverseLookupNameResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ReverseLookupNameResponse, - ): ReverseLookupNameResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.NameRecord record */ 1: - message.record = NameRecord.internalBinaryRead( - reader, - reader.uint32(), - options, - message.record, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ReverseLookupNameResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.NameRecord record = 1; */ - if (message.record) - NameRecord.internalBinaryWrite( - message.record, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ReverseLookupNameResponse @@ -396,125 +170,6 @@ class NameRecord$Type extends MessageType { }, ]); } - create(value?: PartialMessage): NameRecord { - const message = globalThis.Object.create(this.messagePrototype!); - message.data = {}; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: NameRecord, - ): NameRecord { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string id */ 1: - message.id = reader.string(); - break; - case /* optional string name */ 2: - message.name = reader.string(); - break; - case /* optional string registration_nft_id */ 3: - message.registrationNftId = reader.string(); - break; - case /* optional google.protobuf.Timestamp expiration_timestamp */ 4: - message.expirationTimestamp = Timestamp.internalBinaryRead( - reader, - reader.uint32(), - options, - message.expirationTimestamp, - ); - break; - case /* optional string target_address */ 5: - message.targetAddress = reader.string(); - break; - case /* map data */ 6: - this.binaryReadMap6(message.data, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - private binaryReadMap6( - map: NameRecord['data'], - reader: IBinaryReader, - options: BinaryReadOptions, - ): void { - let len = reader.uint32(), - end = reader.pos + len, - key: keyof NameRecord['data'] | undefined, - val: NameRecord['data'][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.string(); - break; - default: - throw new globalThis.Error('unknown map entry field for sui.rpc.v2beta2.NameRecord.data'); - } - } - map[key ?? ''] = val ?? ''; - } - internalBinaryWrite( - message: NameRecord, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string id = 1; */ - if (message.id !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.id); - /* optional string name = 2; */ - if (message.name !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.name); - /* optional string registration_nft_id = 3; */ - if (message.registrationNftId !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.registrationNftId); - /* optional google.protobuf.Timestamp expiration_timestamp = 4; */ - if (message.expirationTimestamp) - Timestamp.internalBinaryWrite( - message.expirationTimestamp, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string target_address = 5; */ - if (message.targetAddress !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.targetAddress); - /* map data = 6; */ - for (let k of globalThis.Object.keys(message.data)) - writer - .tag(6, WireType.LengthDelimited) - .fork() - .tag(1, WireType.LengthDelimited) - .string(k) - .tag(2, WireType.LengthDelimited) - .string(message.data[k]) - .join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.NameRecord diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object.ts index 2bbbedb31..3b1bb8ffe 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Value } from '../../../google/protobuf/struct.js'; import { Package } from './move_package.js'; @@ -153,156 +145,6 @@ class Object$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Object { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Object, - ): Object { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs bcs */ 1: - message.bcs = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.bcs); - break; - case /* optional string object_id */ 2: - message.objectId = reader.string(); - break; - case /* optional uint64 version */ 3: - message.version = reader.uint64().toBigInt(); - break; - case /* optional string digest */ 4: - message.digest = reader.string(); - break; - case /* optional sui.rpc.v2beta2.Owner owner */ 5: - message.owner = Owner.internalBinaryRead(reader, reader.uint32(), options, message.owner); - break; - case /* optional string object_type */ 6: - message.objectType = reader.string(); - break; - case /* optional bool has_public_transfer */ 7: - message.hasPublicTransfer = reader.bool(); - break; - case /* optional sui.rpc.v2beta2.Bcs contents */ 8: - message.contents = Bcs.internalBinaryRead( - reader, - reader.uint32(), - options, - message.contents, - ); - break; - case /* optional sui.rpc.v2beta2.Package package */ 9: - message.package = Package.internalBinaryRead( - reader, - reader.uint32(), - options, - message.package, - ); - break; - case /* optional string previous_transaction */ 10: - message.previousTransaction = reader.string(); - break; - case /* optional uint64 storage_rebate */ 11: - message.storageRebate = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.Value json */ 100: - message.json = Value.internalBinaryRead(reader, reader.uint32(), options, message.json); - break; - case /* optional uint64 balance */ 101: - message.balance = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Object, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs bcs = 1; */ - if (message.bcs) - Bcs.internalBinaryWrite( - message.bcs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string object_id = 2; */ - if (message.objectId !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.objectId); - /* optional uint64 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).uint64(message.version); - /* optional string digest = 4; */ - if (message.digest !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.digest); - /* optional sui.rpc.v2beta2.Owner owner = 5; */ - if (message.owner) - Owner.internalBinaryWrite( - message.owner, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string object_type = 6; */ - if (message.objectType !== undefined) - writer.tag(6, WireType.LengthDelimited).string(message.objectType); - /* optional bool has_public_transfer = 7; */ - if (message.hasPublicTransfer !== undefined) - writer.tag(7, WireType.Varint).bool(message.hasPublicTransfer); - /* optional sui.rpc.v2beta2.Bcs contents = 8; */ - if (message.contents) - Bcs.internalBinaryWrite( - message.contents, - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.Package package = 9; */ - if (message.package) - Package.internalBinaryWrite( - message.package, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string previous_transaction = 10; */ - if (message.previousTransaction !== undefined) - writer.tag(10, WireType.LengthDelimited).string(message.previousTransaction); - /* optional uint64 storage_rebate = 11; */ - if (message.storageRebate !== undefined) - writer.tag(11, WireType.Varint).uint64(message.storageRebate); - /* optional google.protobuf.Value json = 100; */ - if (message.json) - Value.internalBinaryWrite( - message.json, - writer.tag(100, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 balance = 101; */ - if (message.balance !== undefined) writer.tag(101, WireType.Varint).uint64(message.balance); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Object diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object_reference.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object_reference.ts index 3ab6a5679..4e191c873 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object_reference.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/object_reference.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * Reference to an object. @@ -50,67 +42,6 @@ class ObjectReference$Type extends MessageType { { no: 3, name: 'digest', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): ObjectReference { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ObjectReference, - ): ObjectReference { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string object_id */ 1: - message.objectId = reader.string(); - break; - case /* optional uint64 version */ 2: - message.version = reader.uint64().toBigInt(); - break; - case /* optional string digest */ 3: - message.digest = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ObjectReference, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string object_id = 1; */ - if (message.objectId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.objectId); - /* optional uint64 version = 2; */ - if (message.version !== undefined) writer.tag(2, WireType.Varint).uint64(message.version); - /* optional string digest = 3; */ - if (message.digest !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.digest); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ObjectReference diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/owner.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/owner.ts index 3d8759de0..a0442aaa9 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/owner.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/owner.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * Enum of different types of ownership for an object. @@ -83,66 +75,6 @@ class Owner$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Owner { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Owner, - ): Owner { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Owner.OwnerKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional string address */ 2: - message.address = reader.string(); - break; - case /* optional uint64 version */ 3: - message.version = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Owner, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Owner.OwnerKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional string address = 2; */ - if (message.address !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.address); - /* optional uint64 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).uint64(message.version); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Owner diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/protocol_config.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/protocol_config.ts index efdfcfa05..0ce73ef82 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/protocol_config.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/protocol_config.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * @generated from protobuf message sui.rpc.v2beta2.ProtocolConfig @@ -58,136 +50,6 @@ class ProtocolConfig$Type extends MessageType { }, ]); } - create(value?: PartialMessage): ProtocolConfig { - const message = globalThis.Object.create(this.messagePrototype!); - message.featureFlags = {}; - message.attributes = {}; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ProtocolConfig, - ): ProtocolConfig { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 protocol_version */ 1: - message.protocolVersion = reader.uint64().toBigInt(); - break; - case /* map feature_flags */ 2: - this.binaryReadMap2(message.featureFlags, reader, options); - break; - case /* map attributes */ 3: - this.binaryReadMap3(message.attributes, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - private binaryReadMap2( - map: ProtocolConfig['featureFlags'], - reader: IBinaryReader, - options: BinaryReadOptions, - ): void { - let len = reader.uint32(), - end = reader.pos + len, - key: keyof ProtocolConfig['featureFlags'] | undefined, - val: ProtocolConfig['featureFlags'][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.bool(); - break; - default: - throw new globalThis.Error( - 'unknown map entry field for sui.rpc.v2beta2.ProtocolConfig.feature_flags', - ); - } - } - map[key ?? ''] = val ?? false; - } - private binaryReadMap3( - map: ProtocolConfig['attributes'], - reader: IBinaryReader, - options: BinaryReadOptions, - ): void { - let len = reader.uint32(), - end = reader.pos + len, - key: keyof ProtocolConfig['attributes'] | undefined, - val: ProtocolConfig['attributes'][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.string(); - break; - default: - throw new globalThis.Error( - 'unknown map entry field for sui.rpc.v2beta2.ProtocolConfig.attributes', - ); - } - } - map[key ?? ''] = val ?? ''; - } - internalBinaryWrite( - message: ProtocolConfig, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 protocol_version = 1; */ - if (message.protocolVersion !== undefined) - writer.tag(1, WireType.Varint).uint64(message.protocolVersion); - /* map feature_flags = 2; */ - for (let k of globalThis.Object.keys(message.featureFlags)) - writer - .tag(2, WireType.LengthDelimited) - .fork() - .tag(1, WireType.LengthDelimited) - .string(k) - .tag(2, WireType.Varint) - .bool(message.featureFlags[k]) - .join(); - /* map attributes = 3; */ - for (let k of globalThis.Object.keys(message.attributes)) - writer - .tag(3, WireType.LengthDelimited) - .fork() - .tag(1, WireType.LengthDelimited) - .string(k) - .tag(2, WireType.LengthDelimited) - .string(message.attributes[k]) - .join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ProtocolConfig diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature.ts index 13e8d4d8f..de201faf1 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { SignatureScheme } from './signature_scheme.js'; import { Bcs } from './bcs.js'; @@ -539,138 +531,6 @@ class UserSignature$Type extends MessageType { }, ]); } - create(value?: PartialMessage): UserSignature { - const message = globalThis.Object.create(this.messagePrototype!); - message.signature = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: UserSignature, - ): UserSignature { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs bcs */ 1: - message.bcs = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.bcs); - break; - case /* optional sui.rpc.v2beta2.SignatureScheme scheme */ 2: - message.scheme = reader.int32(); - break; - case /* sui.rpc.v2beta2.SimpleSignature simple */ 3: - message.signature = { - oneofKind: 'simple', - simple: SimpleSignature.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.signature as any).simple, - ), - }; - break; - case /* sui.rpc.v2beta2.MultisigAggregatedSignature multisig */ 4: - message.signature = { - oneofKind: 'multisig', - multisig: MultisigAggregatedSignature.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.signature as any).multisig, - ), - }; - break; - case /* sui.rpc.v2beta2.ZkLoginAuthenticator zklogin */ 5: - message.signature = { - oneofKind: 'zklogin', - zklogin: ZkLoginAuthenticator.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.signature as any).zklogin, - ), - }; - break; - case /* sui.rpc.v2beta2.PasskeyAuthenticator passkey */ 6: - message.signature = { - oneofKind: 'passkey', - passkey: PasskeyAuthenticator.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.signature as any).passkey, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: UserSignature, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs bcs = 1; */ - if (message.bcs) - Bcs.internalBinaryWrite( - message.bcs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.SignatureScheme scheme = 2; */ - if (message.scheme !== undefined) writer.tag(2, WireType.Varint).int32(message.scheme); - /* sui.rpc.v2beta2.SimpleSignature simple = 3; */ - if (message.signature.oneofKind === 'simple') - SimpleSignature.internalBinaryWrite( - message.signature.simple, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.MultisigAggregatedSignature multisig = 4; */ - if (message.signature.oneofKind === 'multisig') - MultisigAggregatedSignature.internalBinaryWrite( - message.signature.multisig, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ZkLoginAuthenticator zklogin = 5; */ - if (message.signature.oneofKind === 'zklogin') - ZkLoginAuthenticator.internalBinaryWrite( - message.signature.zklogin, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.PasskeyAuthenticator passkey = 6; */ - if (message.signature.oneofKind === 'passkey') - PasskeyAuthenticator.internalBinaryWrite( - message.signature.passkey, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.UserSignature @@ -691,67 +551,6 @@ class SimpleSignature$Type extends MessageType { { no: 3, name: 'public_key', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ }, ]); } - create(value?: PartialMessage): SimpleSignature { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SimpleSignature, - ): SimpleSignature { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.SignatureScheme scheme */ 1: - message.scheme = reader.int32(); - break; - case /* optional bytes signature */ 2: - message.signature = reader.bytes(); - break; - case /* optional bytes public_key */ 3: - message.publicKey = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SimpleSignature, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.SignatureScheme scheme = 1; */ - if (message.scheme !== undefined) writer.tag(1, WireType.Varint).int32(message.scheme); - /* optional bytes signature = 2; */ - if (message.signature !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.signature); - /* optional bytes public_key = 3; */ - if (message.publicKey !== undefined) - writer.tag(3, WireType.LengthDelimited).bytes(message.publicKey); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SimpleSignature @@ -765,61 +564,6 @@ class ZkLoginPublicIdentifier$Type extends MessageType { no: 2, name: 'address_seed', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): ZkLoginPublicIdentifier { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ZkLoginPublicIdentifier, - ): ZkLoginPublicIdentifier { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string iss */ 1: - message.iss = reader.string(); - break; - case /* optional string address_seed */ 2: - message.addressSeed = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ZkLoginPublicIdentifier, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string iss = 1; */ - if (message.iss !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.iss); - /* optional string address_seed = 2; */ - if (message.addressSeed !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.addressSeed); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ZkLoginPublicIdentifier @@ -840,76 +584,6 @@ class MultisigMemberPublicKey$Type extends MessageType { no: 3, name: 'zklogin', kind: 'message', T: () => ZkLoginPublicIdentifier }, ]); } - create(value?: PartialMessage): MultisigMemberPublicKey { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MultisigMemberPublicKey, - ): MultisigMemberPublicKey { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.SignatureScheme scheme */ 1: - message.scheme = reader.int32(); - break; - case /* optional bytes public_key */ 2: - message.publicKey = reader.bytes(); - break; - case /* optional sui.rpc.v2beta2.ZkLoginPublicIdentifier zklogin */ 3: - message.zklogin = ZkLoginPublicIdentifier.internalBinaryRead( - reader, - reader.uint32(), - options, - message.zklogin, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MultisigMemberPublicKey, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.SignatureScheme scheme = 1; */ - if (message.scheme !== undefined) writer.tag(1, WireType.Varint).int32(message.scheme); - /* optional bytes public_key = 2; */ - if (message.publicKey !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.publicKey); - /* optional sui.rpc.v2beta2.ZkLoginPublicIdentifier zklogin = 3; */ - if (message.zklogin) - ZkLoginPublicIdentifier.internalBinaryWrite( - message.zklogin, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MultisigMemberPublicKey @@ -923,70 +597,6 @@ class MultisigMember$Type extends MessageType { { no: 2, name: 'weight', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ }, ]); } - create(value?: PartialMessage): MultisigMember { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MultisigMember, - ): MultisigMember { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.MultisigMemberPublicKey public_key */ 1: - message.publicKey = MultisigMemberPublicKey.internalBinaryRead( - reader, - reader.uint32(), - options, - message.publicKey, - ); - break; - case /* optional uint32 weight */ 2: - message.weight = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MultisigMember, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.MultisigMemberPublicKey public_key = 1; */ - if (message.publicKey) - MultisigMemberPublicKey.internalBinaryWrite( - message.publicKey, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint32 weight = 2; */ - if (message.weight !== undefined) writer.tag(2, WireType.Varint).uint32(message.weight); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MultisigMember @@ -1006,66 +616,6 @@ class MultisigCommittee$Type extends MessageType { { no: 2, name: 'threshold', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ }, ]); } - create(value?: PartialMessage): MultisigCommittee { - const message = globalThis.Object.create(this.messagePrototype!); - message.members = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MultisigCommittee, - ): MultisigCommittee { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.MultisigMember members */ 1: - message.members.push(MultisigMember.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* optional uint32 threshold */ 2: - message.threshold = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MultisigCommittee, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.MultisigMember members = 1; */ - for (let i = 0; i < message.members.length; i++) - MultisigMember.internalBinaryWrite( - message.members[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint32 threshold = 2; */ - if (message.threshold !== undefined) writer.tag(2, WireType.Varint).uint32(message.threshold); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MultisigCommittee @@ -1093,97 +643,6 @@ class MultisigAggregatedSignature$Type extends MessageType MultisigCommittee }, ]); } - create(value?: PartialMessage): MultisigAggregatedSignature { - const message = globalThis.Object.create(this.messagePrototype!); - message.signatures = []; - message.legacyBitmap = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MultisigAggregatedSignature, - ): MultisigAggregatedSignature { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.MultisigMemberSignature signatures */ 1: - message.signatures.push( - MultisigMemberSignature.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional uint32 bitmap */ 2: - message.bitmap = reader.uint32(); - break; - case /* repeated uint32 legacy_bitmap */ 3: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e; ) - message.legacyBitmap.push(reader.uint32()); - else message.legacyBitmap.push(reader.uint32()); - break; - case /* optional sui.rpc.v2beta2.MultisigCommittee committee */ 4: - message.committee = MultisigCommittee.internalBinaryRead( - reader, - reader.uint32(), - options, - message.committee, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MultisigAggregatedSignature, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.MultisigMemberSignature signatures = 1; */ - for (let i = 0; i < message.signatures.length; i++) - MultisigMemberSignature.internalBinaryWrite( - message.signatures[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint32 bitmap = 2; */ - if (message.bitmap !== undefined) writer.tag(2, WireType.Varint).uint32(message.bitmap); - /* repeated uint32 legacy_bitmap = 3; */ - if (message.legacyBitmap.length) { - writer.tag(3, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.legacyBitmap.length; i++) writer.uint32(message.legacyBitmap[i]); - writer.join(); - } - /* optional sui.rpc.v2beta2.MultisigCommittee committee = 4; */ - if (message.committee) - MultisigCommittee.internalBinaryWrite( - message.committee, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MultisigAggregatedSignature @@ -1205,91 +664,6 @@ class MultisigMemberSignature$Type extends MessageType { no: 4, name: 'passkey', kind: 'message', T: () => PasskeyAuthenticator }, ]); } - create(value?: PartialMessage): MultisigMemberSignature { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MultisigMemberSignature, - ): MultisigMemberSignature { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.SignatureScheme scheme */ 1: - message.scheme = reader.int32(); - break; - case /* optional bytes signature */ 2: - message.signature = reader.bytes(); - break; - case /* optional sui.rpc.v2beta2.ZkLoginAuthenticator zklogin */ 3: - message.zklogin = ZkLoginAuthenticator.internalBinaryRead( - reader, - reader.uint32(), - options, - message.zklogin, - ); - break; - case /* optional sui.rpc.v2beta2.PasskeyAuthenticator passkey */ 4: - message.passkey = PasskeyAuthenticator.internalBinaryRead( - reader, - reader.uint32(), - options, - message.passkey, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MultisigMemberSignature, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.SignatureScheme scheme = 1; */ - if (message.scheme !== undefined) writer.tag(1, WireType.Varint).int32(message.scheme); - /* optional bytes signature = 2; */ - if (message.signature !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.signature); - /* optional sui.rpc.v2beta2.ZkLoginAuthenticator zklogin = 3; */ - if (message.zklogin) - ZkLoginAuthenticator.internalBinaryWrite( - message.zklogin, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.PasskeyAuthenticator passkey = 4; */ - if (message.passkey) - PasskeyAuthenticator.internalBinaryWrite( - message.passkey, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MultisigMemberSignature @@ -1311,85 +685,6 @@ class ZkLoginAuthenticator$Type extends MessageType { { no: 3, name: 'signature', kind: 'message', T: () => SimpleSignature }, ]); } - create(value?: PartialMessage): ZkLoginAuthenticator { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ZkLoginAuthenticator, - ): ZkLoginAuthenticator { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.ZkLoginInputs inputs */ 1: - message.inputs = ZkLoginInputs.internalBinaryRead( - reader, - reader.uint32(), - options, - message.inputs, - ); - break; - case /* optional uint64 max_epoch */ 2: - message.maxEpoch = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.SimpleSignature signature */ 3: - message.signature = SimpleSignature.internalBinaryRead( - reader, - reader.uint32(), - options, - message.signature, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ZkLoginAuthenticator, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.ZkLoginInputs inputs = 1; */ - if (message.inputs) - ZkLoginInputs.internalBinaryWrite( - message.inputs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 max_epoch = 2; */ - if (message.maxEpoch !== undefined) writer.tag(2, WireType.Varint).uint64(message.maxEpoch); - /* optional sui.rpc.v2beta2.SimpleSignature signature = 3; */ - if (message.signature) - SimpleSignature.internalBinaryWrite( - message.signature, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ZkLoginAuthenticator @@ -1405,92 +700,6 @@ class ZkLoginInputs$Type extends MessageType { { no: 4, name: 'address_seed', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): ZkLoginInputs { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ZkLoginInputs, - ): ZkLoginInputs { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.ZkLoginProof proof_points */ 1: - message.proofPoints = ZkLoginProof.internalBinaryRead( - reader, - reader.uint32(), - options, - message.proofPoints, - ); - break; - case /* optional sui.rpc.v2beta2.ZkLoginClaim iss_base64_details */ 2: - message.issBase64Details = ZkLoginClaim.internalBinaryRead( - reader, - reader.uint32(), - options, - message.issBase64Details, - ); - break; - case /* optional string header_base64 */ 3: - message.headerBase64 = reader.string(); - break; - case /* optional string address_seed */ 4: - message.addressSeed = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ZkLoginInputs, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.ZkLoginProof proof_points = 1; */ - if (message.proofPoints) - ZkLoginProof.internalBinaryWrite( - message.proofPoints, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.ZkLoginClaim iss_base64_details = 2; */ - if (message.issBase64Details) - ZkLoginClaim.internalBinaryWrite( - message.issBase64Details, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string header_base64 = 3; */ - if (message.headerBase64 !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.headerBase64); - /* optional string address_seed = 4; */ - if (message.addressSeed !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.addressSeed); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ZkLoginInputs @@ -1505,80 +714,6 @@ class ZkLoginProof$Type extends MessageType { { no: 3, name: 'c', kind: 'message', T: () => CircomG1 }, ]); } - create(value?: PartialMessage): ZkLoginProof { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ZkLoginProof, - ): ZkLoginProof { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.CircomG1 a */ 1: - message.a = CircomG1.internalBinaryRead(reader, reader.uint32(), options, message.a); - break; - case /* optional sui.rpc.v2beta2.CircomG2 b */ 2: - message.b = CircomG2.internalBinaryRead(reader, reader.uint32(), options, message.b); - break; - case /* optional sui.rpc.v2beta2.CircomG1 c */ 3: - message.c = CircomG1.internalBinaryRead(reader, reader.uint32(), options, message.c); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ZkLoginProof, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.CircomG1 a = 1; */ - if (message.a) - CircomG1.internalBinaryWrite( - message.a, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.CircomG2 b = 2; */ - if (message.b) - CircomG2.internalBinaryWrite( - message.b, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.CircomG1 c = 3; */ - if (message.c) - CircomG1.internalBinaryWrite( - message.c, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ZkLoginProof @@ -1592,60 +727,6 @@ class ZkLoginClaim$Type extends MessageType { { no: 2, name: 'index_mod_4', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ }, ]); } - create(value?: PartialMessage): ZkLoginClaim { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ZkLoginClaim, - ): ZkLoginClaim { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string value */ 1: - message.value = reader.string(); - break; - case /* optional uint32 index_mod_4 */ 2: - message.indexMod4 = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ZkLoginClaim, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string value = 1; */ - if (message.value !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.value); - /* optional uint32 index_mod_4 = 2; */ - if (message.indexMod4 !== undefined) writer.tag(2, WireType.Varint).uint32(message.indexMod4); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ZkLoginClaim @@ -1660,65 +741,6 @@ class CircomG1$Type extends MessageType { { no: 3, name: 'e2', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): CircomG1 { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CircomG1, - ): CircomG1 { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string e0 */ 1: - message.e0 = reader.string(); - break; - case /* optional string e1 */ 2: - message.e1 = reader.string(); - break; - case /* optional string e2 */ 3: - message.e2 = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CircomG1, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string e0 = 1; */ - if (message.e0 !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.e0); - /* optional string e1 = 2; */ - if (message.e1 !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.e1); - /* optional string e2 = 3; */ - if (message.e2 !== undefined) writer.tag(3, WireType.LengthDelimited).string(message.e2); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CircomG1 @@ -1736,80 +758,6 @@ class CircomG2$Type extends MessageType { { no: 6, name: 'e21', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): CircomG2 { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CircomG2, - ): CircomG2 { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string e00 */ 1: - message.e00 = reader.string(); - break; - case /* optional string e01 */ 2: - message.e01 = reader.string(); - break; - case /* optional string e10 */ 3: - message.e10 = reader.string(); - break; - case /* optional string e11 */ 4: - message.e11 = reader.string(); - break; - case /* optional string e20 */ 5: - message.e20 = reader.string(); - break; - case /* optional string e21 */ 6: - message.e21 = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CircomG2, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string e00 = 1; */ - if (message.e00 !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.e00); - /* optional string e01 = 2; */ - if (message.e01 !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.e01); - /* optional string e10 = 3; */ - if (message.e10 !== undefined) writer.tag(3, WireType.LengthDelimited).string(message.e10); - /* optional string e11 = 4; */ - if (message.e11 !== undefined) writer.tag(4, WireType.LengthDelimited).string(message.e11); - /* optional string e20 = 5; */ - if (message.e20 !== undefined) writer.tag(5, WireType.LengthDelimited).string(message.e20); - /* optional string e21 = 6; */ - if (message.e21 !== undefined) writer.tag(6, WireType.LengthDelimited).string(message.e21); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CircomG2 @@ -1824,77 +772,6 @@ class PasskeyAuthenticator$Type extends MessageType { { no: 3, name: 'signature', kind: 'message', T: () => SimpleSignature }, ]); } - create(value?: PartialMessage): PasskeyAuthenticator { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: PasskeyAuthenticator, - ): PasskeyAuthenticator { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional bytes authenticator_data */ 1: - message.authenticatorData = reader.bytes(); - break; - case /* optional string client_data_json */ 2: - message.clientDataJson = reader.string(); - break; - case /* optional sui.rpc.v2beta2.SimpleSignature signature */ 3: - message.signature = SimpleSignature.internalBinaryRead( - reader, - reader.uint32(), - options, - message.signature, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: PasskeyAuthenticator, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional bytes authenticator_data = 1; */ - if (message.authenticatorData !== undefined) - writer.tag(1, WireType.LengthDelimited).bytes(message.authenticatorData); - /* optional string client_data_json = 2; */ - if (message.clientDataJson !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.clientDataJson); - /* optional sui.rpc.v2beta2.SimpleSignature signature = 3; */ - if (message.signature) - SimpleSignature.internalBinaryWrite( - message.signature, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.PasskeyAuthenticator @@ -1921,68 +798,6 @@ class ValidatorCommittee$Type extends MessageType { }, ]); } - create(value?: PartialMessage): ValidatorCommittee { - const message = globalThis.Object.create(this.messagePrototype!); - message.members = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ValidatorCommittee, - ): ValidatorCommittee { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* repeated sui.rpc.v2beta2.ValidatorCommitteeMember members */ 2: - message.members.push( - ValidatorCommitteeMember.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ValidatorCommittee, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* repeated sui.rpc.v2beta2.ValidatorCommitteeMember members = 2; */ - for (let i = 0; i < message.members.length; i++) - ValidatorCommitteeMember.internalBinaryWrite( - message.members[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ValidatorCommittee @@ -2003,61 +818,6 @@ class ValidatorCommitteeMember$Type extends MessageType): ValidatorCommitteeMember { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ValidatorCommitteeMember, - ): ValidatorCommitteeMember { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional bytes public_key */ 1: - message.publicKey = reader.bytes(); - break; - case /* optional uint64 weight */ 2: - message.weight = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ValidatorCommitteeMember, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional bytes public_key = 1; */ - if (message.publicKey !== undefined) - writer.tag(1, WireType.LengthDelimited).bytes(message.publicKey); - /* optional uint64 weight = 2; */ - if (message.weight !== undefined) writer.tag(2, WireType.Varint).uint64(message.weight); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ValidatorCommitteeMember @@ -2085,75 +845,6 @@ class ValidatorAggregatedSignature$Type extends MessageType): ValidatorAggregatedSignature { - const message = globalThis.Object.create(this.messagePrototype!); - message.bitmap = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ValidatorAggregatedSignature, - ): ValidatorAggregatedSignature { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional bytes signature */ 2: - message.signature = reader.bytes(); - break; - case /* repeated uint32 bitmap */ 3: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e; ) - message.bitmap.push(reader.uint32()); - else message.bitmap.push(reader.uint32()); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ValidatorAggregatedSignature, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* optional bytes signature = 2; */ - if (message.signature !== undefined) - writer.tag(2, WireType.LengthDelimited).bytes(message.signature); - /* repeated uint32 bitmap = 3; */ - if (message.bitmap.length) { - writer.tag(3, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.bitmap.length; i++) writer.uint32(message.bitmap[i]); - writer.join(); - } - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ValidatorAggregatedSignature diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature_verification_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature_verification_service.ts index 843ede71d..427e9fb8e 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature_verification_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/signature_verification_service.ts @@ -1,14 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { ServiceType } from '@protobuf-ts/runtime-rpc'; -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { ActiveJwk } from './transaction.js'; import { UserSignature } from './signature.js'; @@ -84,97 +76,6 @@ class VerifySignatureRequest$Type extends MessageType { }, ]); } - create(value?: PartialMessage): VerifySignatureRequest { - const message = globalThis.Object.create(this.messagePrototype!); - message.jwks = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: VerifySignatureRequest, - ): VerifySignatureRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs message */ 1: - message.message = Bcs.internalBinaryRead( - reader, - reader.uint32(), - options, - message.message, - ); - break; - case /* optional sui.rpc.v2beta2.UserSignature signature */ 2: - message.signature = UserSignature.internalBinaryRead( - reader, - reader.uint32(), - options, - message.signature, - ); - break; - case /* optional string address */ 3: - message.address = reader.string(); - break; - case /* repeated sui.rpc.v2beta2.ActiveJwk jwks */ 4: - message.jwks.push(ActiveJwk.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: VerifySignatureRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs message = 1; */ - if (message.message) - Bcs.internalBinaryWrite( - message.message, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.UserSignature signature = 2; */ - if (message.signature) - UserSignature.internalBinaryWrite( - message.signature, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string address = 3; */ - if (message.address !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.address); - /* repeated sui.rpc.v2beta2.ActiveJwk jwks = 4; */ - for (let i = 0; i < message.jwks.length; i++) - ActiveJwk.internalBinaryWrite( - message.jwks[i], - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.VerifySignatureRequest @@ -188,61 +89,6 @@ class VerifySignatureResponse$Type extends MessageType { no: 2, name: 'reason', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): VerifySignatureResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: VerifySignatureResponse, - ): VerifySignatureResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional bool is_valid */ 1: - message.isValid = reader.bool(); - break; - case /* optional string reason */ 2: - message.reason = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: VerifySignatureResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional bool is_valid = 1; */ - if (message.isValid !== undefined) writer.tag(1, WireType.Varint).bool(message.isValid); - /* optional string reason = 2; */ - if (message.reason !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.reason); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.VerifySignatureResponse diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/subscription_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/subscription_service.ts index 468a4d09e..2783a2b1b 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/subscription_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/subscription_service.ts @@ -1,14 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { ServiceType } from '@protobuf-ts/runtime-rpc'; -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Checkpoint } from './checkpoint.js'; import { FieldMask } from '../../../google/protobuf/field_mask.js'; @@ -53,66 +45,6 @@ class SubscribeCheckpointsRequest$Type extends MessageType FieldMask }, ]); } - create(value?: PartialMessage): SubscribeCheckpointsRequest { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SubscribeCheckpointsRequest, - ): SubscribeCheckpointsRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional google.protobuf.FieldMask read_mask */ 1: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SubscribeCheckpointsRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional google.protobuf.FieldMask read_mask = 1; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SubscribeCheckpointsRequest @@ -133,71 +65,6 @@ class SubscribeCheckpointsResponse$Type extends MessageType Checkpoint }, ]); } - create(value?: PartialMessage): SubscribeCheckpointsResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SubscribeCheckpointsResponse, - ): SubscribeCheckpointsResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 cursor */ 1: - message.cursor = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.Checkpoint checkpoint */ 2: - message.checkpoint = Checkpoint.internalBinaryRead( - reader, - reader.uint32(), - options, - message.checkpoint, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SubscribeCheckpointsResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 cursor = 1; */ - if (message.cursor !== undefined) writer.tag(1, WireType.Varint).uint64(message.cursor); - /* optional sui.rpc.v2beta2.Checkpoint checkpoint = 2; */ - if (message.checkpoint) - Checkpoint.internalBinaryWrite( - message.checkpoint, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SubscribeCheckpointsResponse diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/system_state.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/system_state.ts index 69e104b0e..3e406e1eb 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/system_state.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/system_state.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; /** * @generated from protobuf message sui.rpc.v2beta2.SystemState @@ -719,195 +711,6 @@ class SystemState$Type extends MessageType { { no: 16, name: 'extra_fields', kind: 'message', T: () => MoveTable }, ]); } - create(value?: PartialMessage): SystemState { - const message = globalThis.Object.create(this.messagePrototype!); - message.validatorReportRecords = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SystemState, - ): SystemState { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 version */ 1: - message.version = reader.uint64().toBigInt(); - break; - case /* optional uint64 epoch */ 2: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 protocol_version */ 3: - message.protocolVersion = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.ValidatorSet validators */ 4: - message.validators = ValidatorSet.internalBinaryRead( - reader, - reader.uint32(), - options, - message.validators, - ); - break; - case /* optional sui.rpc.v2beta2.StorageFund storage_fund */ 5: - message.storageFund = StorageFund.internalBinaryRead( - reader, - reader.uint32(), - options, - message.storageFund, - ); - break; - case /* optional sui.rpc.v2beta2.SystemParameters parameters */ 6: - message.parameters = SystemParameters.internalBinaryRead( - reader, - reader.uint32(), - options, - message.parameters, - ); - break; - case /* optional uint64 reference_gas_price */ 7: - message.referenceGasPrice = reader.uint64().toBigInt(); - break; - case /* repeated sui.rpc.v2beta2.ValidatorReportRecord validator_report_records */ 8: - message.validatorReportRecords.push( - ValidatorReportRecord.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional sui.rpc.v2beta2.StakeSubsidy stake_subsidy */ 9: - message.stakeSubsidy = StakeSubsidy.internalBinaryRead( - reader, - reader.uint32(), - options, - message.stakeSubsidy, - ); - break; - case /* optional bool safe_mode */ 10: - message.safeMode = reader.bool(); - break; - case /* optional uint64 safe_mode_storage_rewards */ 11: - message.safeModeStorageRewards = reader.uint64().toBigInt(); - break; - case /* optional uint64 safe_mode_computation_rewards */ 12: - message.safeModeComputationRewards = reader.uint64().toBigInt(); - break; - case /* optional uint64 safe_mode_storage_rebates */ 13: - message.safeModeStorageRebates = reader.uint64().toBigInt(); - break; - case /* optional uint64 safe_mode_non_refundable_storage_fee */ 14: - message.safeModeNonRefundableStorageFee = reader.uint64().toBigInt(); - break; - case /* optional uint64 epoch_start_timestamp_ms */ 15: - message.epochStartTimestampMs = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.MoveTable extra_fields */ 16: - message.extraFields = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.extraFields, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SystemState, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 version = 1; */ - if (message.version !== undefined) writer.tag(1, WireType.Varint).uint64(message.version); - /* optional uint64 epoch = 2; */ - if (message.epoch !== undefined) writer.tag(2, WireType.Varint).uint64(message.epoch); - /* optional uint64 protocol_version = 3; */ - if (message.protocolVersion !== undefined) - writer.tag(3, WireType.Varint).uint64(message.protocolVersion); - /* optional sui.rpc.v2beta2.ValidatorSet validators = 4; */ - if (message.validators) - ValidatorSet.internalBinaryWrite( - message.validators, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.StorageFund storage_fund = 5; */ - if (message.storageFund) - StorageFund.internalBinaryWrite( - message.storageFund, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.SystemParameters parameters = 6; */ - if (message.parameters) - SystemParameters.internalBinaryWrite( - message.parameters, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 reference_gas_price = 7; */ - if (message.referenceGasPrice !== undefined) - writer.tag(7, WireType.Varint).uint64(message.referenceGasPrice); - /* repeated sui.rpc.v2beta2.ValidatorReportRecord validator_report_records = 8; */ - for (let i = 0; i < message.validatorReportRecords.length; i++) - ValidatorReportRecord.internalBinaryWrite( - message.validatorReportRecords[i], - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.StakeSubsidy stake_subsidy = 9; */ - if (message.stakeSubsidy) - StakeSubsidy.internalBinaryWrite( - message.stakeSubsidy, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional bool safe_mode = 10; */ - if (message.safeMode !== undefined) writer.tag(10, WireType.Varint).bool(message.safeMode); - /* optional uint64 safe_mode_storage_rewards = 11; */ - if (message.safeModeStorageRewards !== undefined) - writer.tag(11, WireType.Varint).uint64(message.safeModeStorageRewards); - /* optional uint64 safe_mode_computation_rewards = 12; */ - if (message.safeModeComputationRewards !== undefined) - writer.tag(12, WireType.Varint).uint64(message.safeModeComputationRewards); - /* optional uint64 safe_mode_storage_rebates = 13; */ - if (message.safeModeStorageRebates !== undefined) - writer.tag(13, WireType.Varint).uint64(message.safeModeStorageRebates); - /* optional uint64 safe_mode_non_refundable_storage_fee = 14; */ - if (message.safeModeNonRefundableStorageFee !== undefined) - writer.tag(14, WireType.Varint).uint64(message.safeModeNonRefundableStorageFee); - /* optional uint64 epoch_start_timestamp_ms = 15; */ - if (message.epochStartTimestampMs !== undefined) - writer.tag(15, WireType.Varint).uint64(message.epochStartTimestampMs); - /* optional sui.rpc.v2beta2.MoveTable extra_fields = 16; */ - if (message.extraFields) - MoveTable.internalBinaryWrite( - message.extraFields, - writer.tag(16, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SystemState @@ -927,63 +730,6 @@ class ValidatorReportRecord$Type extends MessageType { }, ]); } - create(value?: PartialMessage): ValidatorReportRecord { - const message = globalThis.Object.create(this.messagePrototype!); - message.reporters = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ValidatorReportRecord, - ): ValidatorReportRecord { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string reported */ 1: - message.reported = reader.string(); - break; - case /* repeated string reporters */ 2: - message.reporters.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ValidatorReportRecord, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string reported = 1; */ - if (message.reported !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.reported); - /* repeated string reporters = 2; */ - for (let i = 0; i < message.reporters.length; i++) - writer.tag(2, WireType.LengthDelimited).string(message.reporters[i]); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ValidatorReportRecord @@ -1060,113 +806,6 @@ class SystemParameters$Type extends MessageType { { no: 9, name: 'extra_fields', kind: 'message', T: () => MoveTable }, ]); } - create(value?: PartialMessage): SystemParameters { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SystemParameters, - ): SystemParameters { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch_duration_ms */ 1: - message.epochDurationMs = reader.uint64().toBigInt(); - break; - case /* optional uint64 stake_subsidy_start_epoch */ 2: - message.stakeSubsidyStartEpoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 min_validator_count */ 3: - message.minValidatorCount = reader.uint64().toBigInt(); - break; - case /* optional uint64 max_validator_count */ 4: - message.maxValidatorCount = reader.uint64().toBigInt(); - break; - case /* optional uint64 min_validator_joining_stake */ 5: - message.minValidatorJoiningStake = reader.uint64().toBigInt(); - break; - case /* optional uint64 validator_low_stake_threshold */ 6: - message.validatorLowStakeThreshold = reader.uint64().toBigInt(); - break; - case /* optional uint64 validator_very_low_stake_threshold */ 7: - message.validatorVeryLowStakeThreshold = reader.uint64().toBigInt(); - break; - case /* optional uint64 validator_low_stake_grace_period */ 8: - message.validatorLowStakeGracePeriod = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.MoveTable extra_fields */ 9: - message.extraFields = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.extraFields, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SystemParameters, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch_duration_ms = 1; */ - if (message.epochDurationMs !== undefined) - writer.tag(1, WireType.Varint).uint64(message.epochDurationMs); - /* optional uint64 stake_subsidy_start_epoch = 2; */ - if (message.stakeSubsidyStartEpoch !== undefined) - writer.tag(2, WireType.Varint).uint64(message.stakeSubsidyStartEpoch); - /* optional uint64 min_validator_count = 3; */ - if (message.minValidatorCount !== undefined) - writer.tag(3, WireType.Varint).uint64(message.minValidatorCount); - /* optional uint64 max_validator_count = 4; */ - if (message.maxValidatorCount !== undefined) - writer.tag(4, WireType.Varint).uint64(message.maxValidatorCount); - /* optional uint64 min_validator_joining_stake = 5; */ - if (message.minValidatorJoiningStake !== undefined) - writer.tag(5, WireType.Varint).uint64(message.minValidatorJoiningStake); - /* optional uint64 validator_low_stake_threshold = 6; */ - if (message.validatorLowStakeThreshold !== undefined) - writer.tag(6, WireType.Varint).uint64(message.validatorLowStakeThreshold); - /* optional uint64 validator_very_low_stake_threshold = 7; */ - if (message.validatorVeryLowStakeThreshold !== undefined) - writer.tag(7, WireType.Varint).uint64(message.validatorVeryLowStakeThreshold); - /* optional uint64 validator_low_stake_grace_period = 8; */ - if (message.validatorLowStakeGracePeriod !== undefined) - writer.tag(8, WireType.Varint).uint64(message.validatorLowStakeGracePeriod); - /* optional sui.rpc.v2beta2.MoveTable extra_fields = 9; */ - if (message.extraFields) - MoveTable.internalBinaryWrite( - message.extraFields, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SystemParameters @@ -1187,60 +826,6 @@ class MoveTable$Type extends MessageType { }, ]); } - create(value?: PartialMessage): MoveTable { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MoveTable, - ): MoveTable { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string id */ 1: - message.id = reader.string(); - break; - case /* optional uint64 size */ 2: - message.size = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MoveTable, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string id = 1; */ - if (message.id !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.id); - /* optional uint64 size = 2; */ - if (message.size !== undefined) writer.tag(2, WireType.Varint).uint64(message.size); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MoveTable @@ -1292,94 +877,6 @@ class StakeSubsidy$Type extends MessageType { { no: 6, name: 'extra_fields', kind: 'message', T: () => MoveTable }, ]); } - create(value?: PartialMessage): StakeSubsidy { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: StakeSubsidy, - ): StakeSubsidy { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 balance */ 1: - message.balance = reader.uint64().toBigInt(); - break; - case /* optional uint64 distribution_counter */ 2: - message.distributionCounter = reader.uint64().toBigInt(); - break; - case /* optional uint64 current_distribution_amount */ 3: - message.currentDistributionAmount = reader.uint64().toBigInt(); - break; - case /* optional uint64 stake_subsidy_period_length */ 4: - message.stakeSubsidyPeriodLength = reader.uint64().toBigInt(); - break; - case /* optional uint32 stake_subsidy_decrease_rate */ 5: - message.stakeSubsidyDecreaseRate = reader.uint32(); - break; - case /* optional sui.rpc.v2beta2.MoveTable extra_fields */ 6: - message.extraFields = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.extraFields, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: StakeSubsidy, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 balance = 1; */ - if (message.balance !== undefined) writer.tag(1, WireType.Varint).uint64(message.balance); - /* optional uint64 distribution_counter = 2; */ - if (message.distributionCounter !== undefined) - writer.tag(2, WireType.Varint).uint64(message.distributionCounter); - /* optional uint64 current_distribution_amount = 3; */ - if (message.currentDistributionAmount !== undefined) - writer.tag(3, WireType.Varint).uint64(message.currentDistributionAmount); - /* optional uint64 stake_subsidy_period_length = 4; */ - if (message.stakeSubsidyPeriodLength !== undefined) - writer.tag(4, WireType.Varint).uint64(message.stakeSubsidyPeriodLength); - /* optional uint32 stake_subsidy_decrease_rate = 5; */ - if (message.stakeSubsidyDecreaseRate !== undefined) - writer.tag(5, WireType.Varint).uint32(message.stakeSubsidyDecreaseRate); - /* optional sui.rpc.v2beta2.MoveTable extra_fields = 6; */ - if (message.extraFields) - MoveTable.internalBinaryWrite( - message.extraFields, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.StakeSubsidy @@ -1407,62 +904,6 @@ class StorageFund$Type extends MessageType { }, ]); } - create(value?: PartialMessage): StorageFund { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: StorageFund, - ): StorageFund { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 total_object_storage_rebates */ 1: - message.totalObjectStorageRebates = reader.uint64().toBigInt(); - break; - case /* optional uint64 non_refundable_balance */ 2: - message.nonRefundableBalance = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: StorageFund, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 total_object_storage_rebates = 1; */ - if (message.totalObjectStorageRebates !== undefined) - writer.tag(1, WireType.Varint).uint64(message.totalObjectStorageRebates); - /* optional uint64 non_refundable_balance = 2; */ - if (message.nonRefundableBalance !== undefined) - writer.tag(2, WireType.Varint).uint64(message.nonRefundableBalance); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.StorageFund @@ -1509,197 +950,6 @@ class ValidatorSet$Type extends MessageType { { no: 9, name: 'extra_fields', kind: 'message', T: () => MoveTable }, ]); } - create(value?: PartialMessage): ValidatorSet { - const message = globalThis.Object.create(this.messagePrototype!); - message.activeValidators = []; - message.pendingRemovals = []; - message.atRiskValidators = {}; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ValidatorSet, - ): ValidatorSet { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 total_stake */ 1: - message.totalStake = reader.uint64().toBigInt(); - break; - case /* repeated sui.rpc.v2beta2.Validator active_validators */ 2: - message.activeValidators.push( - Validator.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional sui.rpc.v2beta2.MoveTable pending_active_validators */ 3: - message.pendingActiveValidators = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.pendingActiveValidators, - ); - break; - case /* repeated uint64 pending_removals */ 4: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e; ) - message.pendingRemovals.push(reader.uint64().toBigInt()); - else message.pendingRemovals.push(reader.uint64().toBigInt()); - break; - case /* optional sui.rpc.v2beta2.MoveTable staking_pool_mappings */ 5: - message.stakingPoolMappings = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.stakingPoolMappings, - ); - break; - case /* optional sui.rpc.v2beta2.MoveTable inactive_validators */ 6: - message.inactiveValidators = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.inactiveValidators, - ); - break; - case /* optional sui.rpc.v2beta2.MoveTable validator_candidates */ 7: - message.validatorCandidates = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.validatorCandidates, - ); - break; - case /* map at_risk_validators */ 8: - this.binaryReadMap8(message.atRiskValidators, reader, options); - break; - case /* optional sui.rpc.v2beta2.MoveTable extra_fields */ 9: - message.extraFields = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.extraFields, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - private binaryReadMap8( - map: ValidatorSet['atRiskValidators'], - reader: IBinaryReader, - options: BinaryReadOptions, - ): void { - let len = reader.uint32(), - end = reader.pos + len, - key: keyof ValidatorSet['atRiskValidators'] | undefined, - val: ValidatorSet['atRiskValidators'][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.uint64().toBigInt(); - break; - default: - throw new globalThis.Error( - 'unknown map entry field for sui.rpc.v2beta2.ValidatorSet.at_risk_validators', - ); - } - } - map[key ?? ''] = val ?? 0n; - } - internalBinaryWrite( - message: ValidatorSet, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 total_stake = 1; */ - if (message.totalStake !== undefined) writer.tag(1, WireType.Varint).uint64(message.totalStake); - /* repeated sui.rpc.v2beta2.Validator active_validators = 2; */ - for (let i = 0; i < message.activeValidators.length; i++) - Validator.internalBinaryWrite( - message.activeValidators[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.MoveTable pending_active_validators = 3; */ - if (message.pendingActiveValidators) - MoveTable.internalBinaryWrite( - message.pendingActiveValidators, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated uint64 pending_removals = 4; */ - if (message.pendingRemovals.length) { - writer.tag(4, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.pendingRemovals.length; i++) - writer.uint64(message.pendingRemovals[i]); - writer.join(); - } - /* optional sui.rpc.v2beta2.MoveTable staking_pool_mappings = 5; */ - if (message.stakingPoolMappings) - MoveTable.internalBinaryWrite( - message.stakingPoolMappings, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.MoveTable inactive_validators = 6; */ - if (message.inactiveValidators) - MoveTable.internalBinaryWrite( - message.inactiveValidators, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.MoveTable validator_candidates = 7; */ - if (message.validatorCandidates) - MoveTable.internalBinaryWrite( - message.validatorCandidates, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - /* map at_risk_validators = 8; */ - for (let k of globalThis.Object.keys(message.atRiskValidators)) - writer - .tag(8, WireType.LengthDelimited) - .fork() - .tag(1, WireType.LengthDelimited) - .string(k) - .tag(2, WireType.Varint) - .uint64(message.atRiskValidators[k]) - .join(); - /* optional sui.rpc.v2beta2.MoveTable extra_fields = 9; */ - if (message.extraFields) - MoveTable.internalBinaryWrite( - message.extraFields, - writer.tag(9, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ValidatorSet @@ -1840,261 +1090,6 @@ class Validator$Type extends MessageType { { no: 37, name: 'extra_fields', kind: 'message', T: () => MoveTable }, ]); } - create(value?: PartialMessage): Validator { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Validator, - ): Validator { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string name */ 1: - message.name = reader.string(); - break; - case /* optional string address */ 2: - message.address = reader.string(); - break; - case /* optional string description */ 3: - message.description = reader.string(); - break; - case /* optional string image_url */ 4: - message.imageUrl = reader.string(); - break; - case /* optional string project_url */ 5: - message.projectUrl = reader.string(); - break; - case /* optional bytes protocol_public_key */ 7: - message.protocolPublicKey = reader.bytes(); - break; - case /* optional bytes proof_of_possession */ 8: - message.proofOfPossession = reader.bytes(); - break; - case /* optional bytes network_public_key */ 10: - message.networkPublicKey = reader.bytes(); - break; - case /* optional bytes worker_public_key */ 12: - message.workerPublicKey = reader.bytes(); - break; - case /* optional string network_address */ 13: - message.networkAddress = reader.string(); - break; - case /* optional string p2p_address */ 14: - message.p2PAddress = reader.string(); - break; - case /* optional string primary_address */ 15: - message.primaryAddress = reader.string(); - break; - case /* optional string worker_address */ 16: - message.workerAddress = reader.string(); - break; - case /* optional bytes next_epoch_protocol_public_key */ 18: - message.nextEpochProtocolPublicKey = reader.bytes(); - break; - case /* optional bytes next_epoch_proof_of_possession */ 19: - message.nextEpochProofOfPossession = reader.bytes(); - break; - case /* optional bytes next_epoch_network_public_key */ 21: - message.nextEpochNetworkPublicKey = reader.bytes(); - break; - case /* optional bytes next_epoch_worker_public_key */ 23: - message.nextEpochWorkerPublicKey = reader.bytes(); - break; - case /* optional string next_epoch_network_address */ 24: - message.nextEpochNetworkAddress = reader.string(); - break; - case /* optional string next_epoch_p2p_address */ 25: - message.nextEpochP2PAddress = reader.string(); - break; - case /* optional string next_epoch_primary_address */ 26: - message.nextEpochPrimaryAddress = reader.string(); - break; - case /* optional string next_epoch_worker_address */ 27: - message.nextEpochWorkerAddress = reader.string(); - break; - case /* optional sui.rpc.v2beta2.MoveTable metadata_extra_fields */ 28: - message.metadataExtraFields = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.metadataExtraFields, - ); - break; - case /* optional uint64 voting_power */ 29: - message.votingPower = reader.uint64().toBigInt(); - break; - case /* optional string operation_cap_id */ 30: - message.operationCapId = reader.string(); - break; - case /* optional uint64 gas_price */ 31: - message.gasPrice = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.StakingPool staking_pool */ 32: - message.stakingPool = StakingPool.internalBinaryRead( - reader, - reader.uint32(), - options, - message.stakingPool, - ); - break; - case /* optional uint64 commission_rate */ 33: - message.commissionRate = reader.uint64().toBigInt(); - break; - case /* optional uint64 next_epoch_stake */ 34: - message.nextEpochStake = reader.uint64().toBigInt(); - break; - case /* optional uint64 next_epoch_gas_price */ 35: - message.nextEpochGasPrice = reader.uint64().toBigInt(); - break; - case /* optional uint64 next_epoch_commission_rate */ 36: - message.nextEpochCommissionRate = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.MoveTable extra_fields */ 37: - message.extraFields = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.extraFields, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Validator, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string name = 1; */ - if (message.name !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.name); - /* optional string address = 2; */ - if (message.address !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.address); - /* optional string description = 3; */ - if (message.description !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.description); - /* optional string image_url = 4; */ - if (message.imageUrl !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.imageUrl); - /* optional string project_url = 5; */ - if (message.projectUrl !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.projectUrl); - /* optional bytes protocol_public_key = 7; */ - if (message.protocolPublicKey !== undefined) - writer.tag(7, WireType.LengthDelimited).bytes(message.protocolPublicKey); - /* optional bytes proof_of_possession = 8; */ - if (message.proofOfPossession !== undefined) - writer.tag(8, WireType.LengthDelimited).bytes(message.proofOfPossession); - /* optional bytes network_public_key = 10; */ - if (message.networkPublicKey !== undefined) - writer.tag(10, WireType.LengthDelimited).bytes(message.networkPublicKey); - /* optional bytes worker_public_key = 12; */ - if (message.workerPublicKey !== undefined) - writer.tag(12, WireType.LengthDelimited).bytes(message.workerPublicKey); - /* optional string network_address = 13; */ - if (message.networkAddress !== undefined) - writer.tag(13, WireType.LengthDelimited).string(message.networkAddress); - /* optional string p2p_address = 14; */ - if (message.p2PAddress !== undefined) - writer.tag(14, WireType.LengthDelimited).string(message.p2PAddress); - /* optional string primary_address = 15; */ - if (message.primaryAddress !== undefined) - writer.tag(15, WireType.LengthDelimited).string(message.primaryAddress); - /* optional string worker_address = 16; */ - if (message.workerAddress !== undefined) - writer.tag(16, WireType.LengthDelimited).string(message.workerAddress); - /* optional bytes next_epoch_protocol_public_key = 18; */ - if (message.nextEpochProtocolPublicKey !== undefined) - writer.tag(18, WireType.LengthDelimited).bytes(message.nextEpochProtocolPublicKey); - /* optional bytes next_epoch_proof_of_possession = 19; */ - if (message.nextEpochProofOfPossession !== undefined) - writer.tag(19, WireType.LengthDelimited).bytes(message.nextEpochProofOfPossession); - /* optional bytes next_epoch_network_public_key = 21; */ - if (message.nextEpochNetworkPublicKey !== undefined) - writer.tag(21, WireType.LengthDelimited).bytes(message.nextEpochNetworkPublicKey); - /* optional bytes next_epoch_worker_public_key = 23; */ - if (message.nextEpochWorkerPublicKey !== undefined) - writer.tag(23, WireType.LengthDelimited).bytes(message.nextEpochWorkerPublicKey); - /* optional string next_epoch_network_address = 24; */ - if (message.nextEpochNetworkAddress !== undefined) - writer.tag(24, WireType.LengthDelimited).string(message.nextEpochNetworkAddress); - /* optional string next_epoch_p2p_address = 25; */ - if (message.nextEpochP2PAddress !== undefined) - writer.tag(25, WireType.LengthDelimited).string(message.nextEpochP2PAddress); - /* optional string next_epoch_primary_address = 26; */ - if (message.nextEpochPrimaryAddress !== undefined) - writer.tag(26, WireType.LengthDelimited).string(message.nextEpochPrimaryAddress); - /* optional string next_epoch_worker_address = 27; */ - if (message.nextEpochWorkerAddress !== undefined) - writer.tag(27, WireType.LengthDelimited).string(message.nextEpochWorkerAddress); - /* optional sui.rpc.v2beta2.MoveTable metadata_extra_fields = 28; */ - if (message.metadataExtraFields) - MoveTable.internalBinaryWrite( - message.metadataExtraFields, - writer.tag(28, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 voting_power = 29; */ - if (message.votingPower !== undefined) - writer.tag(29, WireType.Varint).uint64(message.votingPower); - /* optional string operation_cap_id = 30; */ - if (message.operationCapId !== undefined) - writer.tag(30, WireType.LengthDelimited).string(message.operationCapId); - /* optional uint64 gas_price = 31; */ - if (message.gasPrice !== undefined) writer.tag(31, WireType.Varint).uint64(message.gasPrice); - /* optional sui.rpc.v2beta2.StakingPool staking_pool = 32; */ - if (message.stakingPool) - StakingPool.internalBinaryWrite( - message.stakingPool, - writer.tag(32, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 commission_rate = 33; */ - if (message.commissionRate !== undefined) - writer.tag(33, WireType.Varint).uint64(message.commissionRate); - /* optional uint64 next_epoch_stake = 34; */ - if (message.nextEpochStake !== undefined) - writer.tag(34, WireType.Varint).uint64(message.nextEpochStake); - /* optional uint64 next_epoch_gas_price = 35; */ - if (message.nextEpochGasPrice !== undefined) - writer.tag(35, WireType.Varint).uint64(message.nextEpochGasPrice); - /* optional uint64 next_epoch_commission_rate = 36; */ - if (message.nextEpochCommissionRate !== undefined) - writer.tag(36, WireType.Varint).uint64(message.nextEpochCommissionRate); - /* optional sui.rpc.v2beta2.MoveTable extra_fields = 37; */ - if (message.extraFields) - MoveTable.internalBinaryWrite( - message.extraFields, - writer.tag(37, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Validator @@ -2173,132 +1168,6 @@ class StakingPool$Type extends MessageType { { no: 11, name: 'extra_fields', kind: 'message', T: () => MoveTable }, ]); } - create(value?: PartialMessage): StakingPool { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: StakingPool, - ): StakingPool { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string id */ 1: - message.id = reader.string(); - break; - case /* optional uint64 activation_epoch */ 2: - message.activationEpoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 deactivation_epoch */ 3: - message.deactivationEpoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 sui_balance */ 4: - message.suiBalance = reader.uint64().toBigInt(); - break; - case /* optional uint64 rewards_pool */ 5: - message.rewardsPool = reader.uint64().toBigInt(); - break; - case /* optional uint64 pool_token_balance */ 6: - message.poolTokenBalance = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.MoveTable exchange_rates */ 7: - message.exchangeRates = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.exchangeRates, - ); - break; - case /* optional uint64 pending_stake */ 8: - message.pendingStake = reader.uint64().toBigInt(); - break; - case /* optional uint64 pending_total_sui_withdraw */ 9: - message.pendingTotalSuiWithdraw = reader.uint64().toBigInt(); - break; - case /* optional uint64 pending_pool_token_withdraw */ 10: - message.pendingPoolTokenWithdraw = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.MoveTable extra_fields */ 11: - message.extraFields = MoveTable.internalBinaryRead( - reader, - reader.uint32(), - options, - message.extraFields, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: StakingPool, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string id = 1; */ - if (message.id !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.id); - /* optional uint64 activation_epoch = 2; */ - if (message.activationEpoch !== undefined) - writer.tag(2, WireType.Varint).uint64(message.activationEpoch); - /* optional uint64 deactivation_epoch = 3; */ - if (message.deactivationEpoch !== undefined) - writer.tag(3, WireType.Varint).uint64(message.deactivationEpoch); - /* optional uint64 sui_balance = 4; */ - if (message.suiBalance !== undefined) writer.tag(4, WireType.Varint).uint64(message.suiBalance); - /* optional uint64 rewards_pool = 5; */ - if (message.rewardsPool !== undefined) - writer.tag(5, WireType.Varint).uint64(message.rewardsPool); - /* optional uint64 pool_token_balance = 6; */ - if (message.poolTokenBalance !== undefined) - writer.tag(6, WireType.Varint).uint64(message.poolTokenBalance); - /* optional sui.rpc.v2beta2.MoveTable exchange_rates = 7; */ - if (message.exchangeRates) - MoveTable.internalBinaryWrite( - message.exchangeRates, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 pending_stake = 8; */ - if (message.pendingStake !== undefined) - writer.tag(8, WireType.Varint).uint64(message.pendingStake); - /* optional uint64 pending_total_sui_withdraw = 9; */ - if (message.pendingTotalSuiWithdraw !== undefined) - writer.tag(9, WireType.Varint).uint64(message.pendingTotalSuiWithdraw); - /* optional uint64 pending_pool_token_withdraw = 10; */ - if (message.pendingPoolTokenWithdraw !== undefined) - writer.tag(10, WireType.Varint).uint64(message.pendingPoolTokenWithdraw); - /* optional sui.rpc.v2beta2.MoveTable extra_fields = 11; */ - if (message.extraFields) - MoveTable.internalBinaryWrite( - message.extraFields, - writer.tag(11, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.StakingPool diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts index 9cb5ffe71..2ceb703c0 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction.ts @@ -1,13 +1,5 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Duration } from '../../../google/protobuf/duration.js'; import { Empty } from '../../../google/protobuf/empty.js'; @@ -1139,122 +1131,6 @@ class Transaction$Type extends MessageType { { no: 7, name: 'expiration', kind: 'message', T: () => TransactionExpiration }, ]); } - create(value?: PartialMessage): Transaction { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Transaction, - ): Transaction { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Bcs bcs */ 1: - message.bcs = Bcs.internalBinaryRead(reader, reader.uint32(), options, message.bcs); - break; - case /* optional string digest */ 2: - message.digest = reader.string(); - break; - case /* optional int32 version */ 3: - message.version = reader.int32(); - break; - case /* optional sui.rpc.v2beta2.TransactionKind kind */ 4: - message.kind = TransactionKind.internalBinaryRead( - reader, - reader.uint32(), - options, - message.kind, - ); - break; - case /* optional string sender */ 5: - message.sender = reader.string(); - break; - case /* optional sui.rpc.v2beta2.GasPayment gas_payment */ 6: - message.gasPayment = GasPayment.internalBinaryRead( - reader, - reader.uint32(), - options, - message.gasPayment, - ); - break; - case /* optional sui.rpc.v2beta2.TransactionExpiration expiration */ 7: - message.expiration = TransactionExpiration.internalBinaryRead( - reader, - reader.uint32(), - options, - message.expiration, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Transaction, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Bcs bcs = 1; */ - if (message.bcs) - Bcs.internalBinaryWrite( - message.bcs, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string digest = 2; */ - if (message.digest !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.digest); - /* optional int32 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).int32(message.version); - /* optional sui.rpc.v2beta2.TransactionKind kind = 4; */ - if (message.kind) - TransactionKind.internalBinaryWrite( - message.kind, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string sender = 5; */ - if (message.sender !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.sender); - /* optional sui.rpc.v2beta2.GasPayment gas_payment = 6; */ - if (message.gasPayment) - GasPayment.internalBinaryWrite( - message.gasPayment, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.TransactionExpiration expiration = 7; */ - if (message.expiration) - TransactionExpiration.internalBinaryWrite( - message.expiration, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Transaction @@ -1290,78 +1166,6 @@ class GasPayment$Type extends MessageType { }, ]); } - create(value?: PartialMessage): GasPayment { - const message = globalThis.Object.create(this.messagePrototype!); - message.objects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GasPayment, - ): GasPayment { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.ObjectReference objects */ 1: - message.objects.push( - ObjectReference.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional string owner */ 2: - message.owner = reader.string(); - break; - case /* optional uint64 price */ 3: - message.price = reader.uint64().toBigInt(); - break; - case /* optional uint64 budget */ 4: - message.budget = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GasPayment, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.ObjectReference objects = 1; */ - for (let i = 0; i < message.objects.length; i++) - ObjectReference.internalBinaryWrite( - message.objects[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string owner = 2; */ - if (message.owner !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.owner); - /* optional uint64 price = 3; */ - if (message.price !== undefined) writer.tag(3, WireType.Varint).uint64(message.price); - /* optional uint64 budget = 4; */ - if (message.budget !== undefined) writer.tag(4, WireType.Varint).uint64(message.budget); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GasPayment @@ -1391,60 +1195,6 @@ class TransactionExpiration$Type extends MessageType { }, ]); } - create(value?: PartialMessage): TransactionExpiration { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TransactionExpiration, - ): TransactionExpiration { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.TransactionExpiration.TransactionExpirationKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional uint64 epoch */ 2: - message.epoch = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TransactionExpiration, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.TransactionExpiration.TransactionExpirationKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional uint64 epoch = 2; */ - if (message.epoch !== undefined) writer.tag(2, WireType.Varint).uint64(message.epoch); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TransactionExpiration @@ -1521,249 +1271,6 @@ class TransactionKind$Type extends MessageType { }, ]); } - create(value?: PartialMessage): TransactionKind { - const message = globalThis.Object.create(this.messagePrototype!); - message.kind = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TransactionKind, - ): TransactionKind { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* sui.rpc.v2beta2.ProgrammableTransaction programmable_transaction */ 2: - message.kind = { - oneofKind: 'programmableTransaction', - programmableTransaction: ProgrammableTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).programmableTransaction, - ), - }; - break; - case /* sui.rpc.v2beta2.ProgrammableTransaction programmable_system_transaction */ 3: - message.kind = { - oneofKind: 'programmableSystemTransaction', - programmableSystemTransaction: ProgrammableTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).programmableSystemTransaction, - ), - }; - break; - case /* sui.rpc.v2beta2.ChangeEpoch change_epoch */ 100: - message.kind = { - oneofKind: 'changeEpoch', - changeEpoch: ChangeEpoch.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).changeEpoch, - ), - }; - break; - case /* sui.rpc.v2beta2.GenesisTransaction genesis */ 101: - message.kind = { - oneofKind: 'genesis', - genesis: GenesisTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).genesis, - ), - }; - break; - case /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v1 */ 102: - message.kind = { - oneofKind: 'consensusCommitPrologueV1', - consensusCommitPrologueV1: ConsensusCommitPrologue.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).consensusCommitPrologueV1, - ), - }; - break; - case /* sui.rpc.v2beta2.AuthenticatorStateUpdate authenticator_state_update */ 103: - message.kind = { - oneofKind: 'authenticatorStateUpdate', - authenticatorStateUpdate: AuthenticatorStateUpdate.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).authenticatorStateUpdate, - ), - }; - break; - case /* sui.rpc.v2beta2.EndOfEpochTransaction end_of_epoch */ 104: - message.kind = { - oneofKind: 'endOfEpoch', - endOfEpoch: EndOfEpochTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).endOfEpoch, - ), - }; - break; - case /* sui.rpc.v2beta2.RandomnessStateUpdate randomness_state_update */ 105: - message.kind = { - oneofKind: 'randomnessStateUpdate', - randomnessStateUpdate: RandomnessStateUpdate.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).randomnessStateUpdate, - ), - }; - break; - case /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v2 */ 106: - message.kind = { - oneofKind: 'consensusCommitPrologueV2', - consensusCommitPrologueV2: ConsensusCommitPrologue.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).consensusCommitPrologueV2, - ), - }; - break; - case /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v3 */ 107: - message.kind = { - oneofKind: 'consensusCommitPrologueV3', - consensusCommitPrologueV3: ConsensusCommitPrologue.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).consensusCommitPrologueV3, - ), - }; - break; - case /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v4 */ 108: - message.kind = { - oneofKind: 'consensusCommitPrologueV4', - consensusCommitPrologueV4: ConsensusCommitPrologue.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).consensusCommitPrologueV4, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TransactionKind, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* sui.rpc.v2beta2.ProgrammableTransaction programmable_transaction = 2; */ - if (message.kind.oneofKind === 'programmableTransaction') - ProgrammableTransaction.internalBinaryWrite( - message.kind.programmableTransaction, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ProgrammableTransaction programmable_system_transaction = 3; */ - if (message.kind.oneofKind === 'programmableSystemTransaction') - ProgrammableTransaction.internalBinaryWrite( - message.kind.programmableSystemTransaction, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ChangeEpoch change_epoch = 100; */ - if (message.kind.oneofKind === 'changeEpoch') - ChangeEpoch.internalBinaryWrite( - message.kind.changeEpoch, - writer.tag(100, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.GenesisTransaction genesis = 101; */ - if (message.kind.oneofKind === 'genesis') - GenesisTransaction.internalBinaryWrite( - message.kind.genesis, - writer.tag(101, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v1 = 102; */ - if (message.kind.oneofKind === 'consensusCommitPrologueV1') - ConsensusCommitPrologue.internalBinaryWrite( - message.kind.consensusCommitPrologueV1, - writer.tag(102, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.AuthenticatorStateUpdate authenticator_state_update = 103; */ - if (message.kind.oneofKind === 'authenticatorStateUpdate') - AuthenticatorStateUpdate.internalBinaryWrite( - message.kind.authenticatorStateUpdate, - writer.tag(103, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.EndOfEpochTransaction end_of_epoch = 104; */ - if (message.kind.oneofKind === 'endOfEpoch') - EndOfEpochTransaction.internalBinaryWrite( - message.kind.endOfEpoch, - writer.tag(104, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.RandomnessStateUpdate randomness_state_update = 105; */ - if (message.kind.oneofKind === 'randomnessStateUpdate') - RandomnessStateUpdate.internalBinaryWrite( - message.kind.randomnessStateUpdate, - writer.tag(105, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v2 = 106; */ - if (message.kind.oneofKind === 'consensusCommitPrologueV2') - ConsensusCommitPrologue.internalBinaryWrite( - message.kind.consensusCommitPrologueV2, - writer.tag(106, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v3 = 107; */ - if (message.kind.oneofKind === 'consensusCommitPrologueV3') - ConsensusCommitPrologue.internalBinaryWrite( - message.kind.consensusCommitPrologueV3, - writer.tag(107, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ConsensusCommitPrologue consensus_commit_prologue_v4 = 108; */ - if (message.kind.oneofKind === 'consensusCommitPrologueV4') - ConsensusCommitPrologue.internalBinaryWrite( - message.kind.consensusCommitPrologueV4, - writer.tag(108, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TransactionKind @@ -1783,72 +1290,6 @@ class ProgrammableTransaction$Type extends MessageType }, ]); } - create(value?: PartialMessage): ProgrammableTransaction { - const message = globalThis.Object.create(this.messagePrototype!); - message.inputs = []; - message.commands = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ProgrammableTransaction, - ): ProgrammableTransaction { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.Input inputs */ 1: - message.inputs.push(Input.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated sui.rpc.v2beta2.Command commands */ 2: - message.commands.push(Command.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ProgrammableTransaction, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.Input inputs = 1; */ - for (let i = 0; i < message.inputs.length; i++) - Input.internalBinaryWrite( - message.inputs[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.Command commands = 2; */ - for (let i = 0; i < message.commands.length; i++) - Command.internalBinaryWrite( - message.commands[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ProgrammableTransaction @@ -1879,177 +1320,6 @@ class Command$Type extends MessageType { { no: 7, name: 'upgrade', kind: 'message', oneof: 'command', T: () => Upgrade }, ]); } - create(value?: PartialMessage): Command { - const message = globalThis.Object.create(this.messagePrototype!); - message.command = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Command, - ): Command { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* sui.rpc.v2beta2.MoveCall move_call */ 1: - message.command = { - oneofKind: 'moveCall', - moveCall: MoveCall.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.command as any).moveCall, - ), - }; - break; - case /* sui.rpc.v2beta2.TransferObjects transfer_objects */ 2: - message.command = { - oneofKind: 'transferObjects', - transferObjects: TransferObjects.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.command as any).transferObjects, - ), - }; - break; - case /* sui.rpc.v2beta2.SplitCoins split_coins */ 3: - message.command = { - oneofKind: 'splitCoins', - splitCoins: SplitCoins.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.command as any).splitCoins, - ), - }; - break; - case /* sui.rpc.v2beta2.MergeCoins merge_coins */ 4: - message.command = { - oneofKind: 'mergeCoins', - mergeCoins: MergeCoins.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.command as any).mergeCoins, - ), - }; - break; - case /* sui.rpc.v2beta2.Publish publish */ 5: - message.command = { - oneofKind: 'publish', - publish: Publish.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.command as any).publish, - ), - }; - break; - case /* sui.rpc.v2beta2.MakeMoveVector make_move_vector */ 6: - message.command = { - oneofKind: 'makeMoveVector', - makeMoveVector: MakeMoveVector.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.command as any).makeMoveVector, - ), - }; - break; - case /* sui.rpc.v2beta2.Upgrade upgrade */ 7: - message.command = { - oneofKind: 'upgrade', - upgrade: Upgrade.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.command as any).upgrade, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Command, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* sui.rpc.v2beta2.MoveCall move_call = 1; */ - if (message.command.oneofKind === 'moveCall') - MoveCall.internalBinaryWrite( - message.command.moveCall, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.TransferObjects transfer_objects = 2; */ - if (message.command.oneofKind === 'transferObjects') - TransferObjects.internalBinaryWrite( - message.command.transferObjects, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.SplitCoins split_coins = 3; */ - if (message.command.oneofKind === 'splitCoins') - SplitCoins.internalBinaryWrite( - message.command.splitCoins, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.MergeCoins merge_coins = 4; */ - if (message.command.oneofKind === 'mergeCoins') - MergeCoins.internalBinaryWrite( - message.command.mergeCoins, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.Publish publish = 5; */ - if (message.command.oneofKind === 'publish') - Publish.internalBinaryWrite( - message.command.publish, - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.MakeMoveVector make_move_vector = 6; */ - if (message.command.oneofKind === 'makeMoveVector') - MakeMoveVector.internalBinaryWrite( - message.command.makeMoveVector, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.Upgrade upgrade = 7; */ - if (message.command.oneofKind === 'upgrade') - Upgrade.internalBinaryWrite( - message.command.upgrade, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Command @@ -2078,86 +1348,6 @@ class MoveCall$Type extends MessageType { }, ]); } - create(value?: PartialMessage): MoveCall { - const message = globalThis.Object.create(this.messagePrototype!); - message.typeArguments = []; - message.arguments = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MoveCall, - ): MoveCall { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string package */ 1: - message.package = reader.string(); - break; - case /* optional string module */ 2: - message.module = reader.string(); - break; - case /* optional string function */ 3: - message.function = reader.string(); - break; - case /* repeated string type_arguments */ 4: - message.typeArguments.push(reader.string()); - break; - case /* repeated sui.rpc.v2beta2.Argument arguments */ 5: - message.arguments.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MoveCall, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string package = 1; */ - if (message.package !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.package); - /* optional string module = 2; */ - if (message.module !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.module); - /* optional string function = 3; */ - if (message.function !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.function); - /* repeated string type_arguments = 4; */ - for (let i = 0; i < message.typeArguments.length; i++) - writer.tag(4, WireType.LengthDelimited).string(message.typeArguments[i]); - /* repeated sui.rpc.v2beta2.Argument arguments = 5; */ - for (let i = 0; i < message.arguments.length; i++) - Argument.internalBinaryWrite( - message.arguments[i], - writer.tag(5, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MoveCall @@ -2177,76 +1367,6 @@ class TransferObjects$Type extends MessageType { { no: 2, name: 'address', kind: 'message', T: () => Argument }, ]); } - create(value?: PartialMessage): TransferObjects { - const message = globalThis.Object.create(this.messagePrototype!); - message.objects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TransferObjects, - ): TransferObjects { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.Argument objects */ 1: - message.objects.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* optional sui.rpc.v2beta2.Argument address */ 2: - message.address = Argument.internalBinaryRead( - reader, - reader.uint32(), - options, - message.address, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TransferObjects, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.Argument objects = 1; */ - for (let i = 0; i < message.objects.length; i++) - Argument.internalBinaryWrite( - message.objects[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.Argument address = 2; */ - if (message.address) - Argument.internalBinaryWrite( - message.address, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TransferObjects @@ -2266,76 +1386,6 @@ class SplitCoins$Type extends MessageType { }, ]); } - create(value?: PartialMessage): SplitCoins { - const message = globalThis.Object.create(this.messagePrototype!); - message.amounts = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SplitCoins, - ): SplitCoins { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Argument coin */ 1: - message.coin = Argument.internalBinaryRead( - reader, - reader.uint32(), - options, - message.coin, - ); - break; - case /* repeated sui.rpc.v2beta2.Argument amounts */ 2: - message.amounts.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SplitCoins, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Argument coin = 1; */ - if (message.coin) - Argument.internalBinaryWrite( - message.coin, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.Argument amounts = 2; */ - for (let i = 0; i < message.amounts.length; i++) - Argument.internalBinaryWrite( - message.amounts[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SplitCoins @@ -2355,76 +1405,6 @@ class MergeCoins$Type extends MessageType { }, ]); } - create(value?: PartialMessage): MergeCoins { - const message = globalThis.Object.create(this.messagePrototype!); - message.coinsToMerge = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MergeCoins, - ): MergeCoins { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Argument coin */ 1: - message.coin = Argument.internalBinaryRead( - reader, - reader.uint32(), - options, - message.coin, - ); - break; - case /* repeated sui.rpc.v2beta2.Argument coins_to_merge */ 2: - message.coinsToMerge.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MergeCoins, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Argument coin = 1; */ - if (message.coin) - Argument.internalBinaryWrite( - message.coin, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.Argument coins_to_merge = 2; */ - for (let i = 0; i < message.coinsToMerge.length; i++) - Argument.internalBinaryWrite( - message.coinsToMerge[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MergeCoins @@ -2450,64 +1430,6 @@ class Publish$Type extends MessageType { }, ]); } - create(value?: PartialMessage): Publish { - const message = globalThis.Object.create(this.messagePrototype!); - message.modules = []; - message.dependencies = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Publish, - ): Publish { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated bytes modules */ 1: - message.modules.push(reader.bytes()); - break; - case /* repeated string dependencies */ 2: - message.dependencies.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Publish, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated bytes modules = 1; */ - for (let i = 0; i < message.modules.length; i++) - writer.tag(1, WireType.LengthDelimited).bytes(message.modules[i]); - /* repeated string dependencies = 2; */ - for (let i = 0; i < message.dependencies.length; i++) - writer.tag(2, WireType.LengthDelimited).string(message.dependencies[i]); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Publish @@ -2527,67 +1449,6 @@ class MakeMoveVector$Type extends MessageType { }, ]); } - create(value?: PartialMessage): MakeMoveVector { - const message = globalThis.Object.create(this.messagePrototype!); - message.elements = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: MakeMoveVector, - ): MakeMoveVector { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string element_type */ 1: - message.elementType = reader.string(); - break; - case /* repeated sui.rpc.v2beta2.Argument elements */ 2: - message.elements.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: MakeMoveVector, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string element_type = 1; */ - if (message.elementType !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.elementType); - /* repeated sui.rpc.v2beta2.Argument elements = 2; */ - for (let i = 0; i < message.elements.length; i++) - Argument.internalBinaryWrite( - message.elements[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.MakeMoveVector @@ -2615,85 +1476,6 @@ class Upgrade$Type extends MessageType { { no: 4, name: 'ticket', kind: 'message', T: () => Argument }, ]); } - create(value?: PartialMessage): Upgrade { - const message = globalThis.Object.create(this.messagePrototype!); - message.modules = []; - message.dependencies = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Upgrade, - ): Upgrade { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated bytes modules */ 1: - message.modules.push(reader.bytes()); - break; - case /* repeated string dependencies */ 2: - message.dependencies.push(reader.string()); - break; - case /* optional string package */ 3: - message.package = reader.string(); - break; - case /* optional sui.rpc.v2beta2.Argument ticket */ 4: - message.ticket = Argument.internalBinaryRead( - reader, - reader.uint32(), - options, - message.ticket, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Upgrade, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated bytes modules = 1; */ - for (let i = 0; i < message.modules.length; i++) - writer.tag(1, WireType.LengthDelimited).bytes(message.modules[i]); - /* repeated string dependencies = 2; */ - for (let i = 0; i < message.dependencies.length; i++) - writer.tag(2, WireType.LengthDelimited).string(message.dependencies[i]); - /* optional string package = 3; */ - if (message.package !== undefined) - writer.tag(3, WireType.LengthDelimited).string(message.package); - /* optional sui.rpc.v2beta2.Argument ticket = 4; */ - if (message.ticket) - Argument.internalBinaryWrite( - message.ticket, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Upgrade @@ -2730,73 +1512,6 @@ class RandomnessStateUpdate$Type extends MessageType { }, ]); } - create(value?: PartialMessage): RandomnessStateUpdate { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: RandomnessStateUpdate, - ): RandomnessStateUpdate { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 randomness_round */ 2: - message.randomnessRound = reader.uint64().toBigInt(); - break; - case /* optional bytes random_bytes */ 3: - message.randomBytes = reader.bytes(); - break; - case /* optional uint64 randomness_object_initial_shared_version */ 4: - message.randomnessObjectInitialSharedVersion = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: RandomnessStateUpdate, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* optional uint64 randomness_round = 2; */ - if (message.randomnessRound !== undefined) - writer.tag(2, WireType.Varint).uint64(message.randomnessRound); - /* optional bytes random_bytes = 3; */ - if (message.randomBytes !== undefined) - writer.tag(3, WireType.LengthDelimited).bytes(message.randomBytes); - /* optional uint64 randomness_object_initial_shared_version = 4; */ - if (message.randomnessObjectInitialSharedVersion !== undefined) - writer.tag(4, WireType.Varint).uint64(message.randomnessObjectInitialSharedVersion); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.RandomnessStateUpdate @@ -2864,113 +1579,6 @@ class ChangeEpoch$Type extends MessageType { }, ]); } - create(value?: PartialMessage): ChangeEpoch { - const message = globalThis.Object.create(this.messagePrototype!); - message.systemPackages = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ChangeEpoch, - ): ChangeEpoch { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 protocol_version */ 2: - message.protocolVersion = reader.uint64().toBigInt(); - break; - case /* optional uint64 storage_charge */ 3: - message.storageCharge = reader.uint64().toBigInt(); - break; - case /* optional uint64 computation_charge */ 4: - message.computationCharge = reader.uint64().toBigInt(); - break; - case /* optional uint64 storage_rebate */ 5: - message.storageRebate = reader.uint64().toBigInt(); - break; - case /* optional uint64 non_refundable_storage_fee */ 6: - message.nonRefundableStorageFee = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.Timestamp epoch_start_timestamp */ 7: - message.epochStartTimestamp = Timestamp.internalBinaryRead( - reader, - reader.uint32(), - options, - message.epochStartTimestamp, - ); - break; - case /* repeated sui.rpc.v2beta2.SystemPackage system_packages */ 8: - message.systemPackages.push( - SystemPackage.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ChangeEpoch, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* optional uint64 protocol_version = 2; */ - if (message.protocolVersion !== undefined) - writer.tag(2, WireType.Varint).uint64(message.protocolVersion); - /* optional uint64 storage_charge = 3; */ - if (message.storageCharge !== undefined) - writer.tag(3, WireType.Varint).uint64(message.storageCharge); - /* optional uint64 computation_charge = 4; */ - if (message.computationCharge !== undefined) - writer.tag(4, WireType.Varint).uint64(message.computationCharge); - /* optional uint64 storage_rebate = 5; */ - if (message.storageRebate !== undefined) - writer.tag(5, WireType.Varint).uint64(message.storageRebate); - /* optional uint64 non_refundable_storage_fee = 6; */ - if (message.nonRefundableStorageFee !== undefined) - writer.tag(6, WireType.Varint).uint64(message.nonRefundableStorageFee); - /* optional google.protobuf.Timestamp epoch_start_timestamp = 7; */ - if (message.epochStartTimestamp) - Timestamp.internalBinaryWrite( - message.epochStartTimestamp, - writer.tag(7, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.SystemPackage system_packages = 8; */ - for (let i = 0; i < message.systemPackages.length; i++) - SystemPackage.internalBinaryWrite( - message.systemPackages[i], - writer.tag(8, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ChangeEpoch @@ -3004,69 +1612,6 @@ class SystemPackage$Type extends MessageType { }, ]); } - create(value?: PartialMessage): SystemPackage { - const message = globalThis.Object.create(this.messagePrototype!); - message.modules = []; - message.dependencies = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: SystemPackage, - ): SystemPackage { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 version */ 1: - message.version = reader.uint64().toBigInt(); - break; - case /* repeated bytes modules */ 2: - message.modules.push(reader.bytes()); - break; - case /* repeated string dependencies */ 3: - message.dependencies.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: SystemPackage, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 version = 1; */ - if (message.version !== undefined) writer.tag(1, WireType.Varint).uint64(message.version); - /* repeated bytes modules = 2; */ - for (let i = 0; i < message.modules.length; i++) - writer.tag(2, WireType.LengthDelimited).bytes(message.modules[i]); - /* repeated string dependencies = 3; */ - for (let i = 0; i < message.dependencies.length; i++) - writer.tag(3, WireType.LengthDelimited).string(message.dependencies[i]); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.SystemPackage @@ -3085,61 +1630,6 @@ class GenesisTransaction$Type extends MessageType { }, ]); } - create(value?: PartialMessage): GenesisTransaction { - const message = globalThis.Object.create(this.messagePrototype!); - message.objects = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: GenesisTransaction, - ): GenesisTransaction { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.Object objects */ 1: - message.objects.push(Object.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: GenesisTransaction, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.Object objects = 1; */ - for (let i = 0; i < message.objects.length; i++) - Object.internalBinaryWrite( - message.objects[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.GenesisTransaction @@ -3196,109 +1686,6 @@ class ConsensusCommitPrologue$Type extends MessageType }, ]); } - create(value?: PartialMessage): ConsensusCommitPrologue { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ConsensusCommitPrologue, - ): ConsensusCommitPrologue { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 round */ 2: - message.round = reader.uint64().toBigInt(); - break; - case /* optional google.protobuf.Timestamp commit_timestamp */ 3: - message.commitTimestamp = Timestamp.internalBinaryRead( - reader, - reader.uint32(), - options, - message.commitTimestamp, - ); - break; - case /* optional string consensus_commit_digest */ 4: - message.consensusCommitDigest = reader.string(); - break; - case /* optional uint64 sub_dag_index */ 5: - message.subDagIndex = reader.uint64().toBigInt(); - break; - case /* optional sui.rpc.v2beta2.ConsensusDeterminedVersionAssignments consensus_determined_version_assignments */ 6: - message.consensusDeterminedVersionAssignments = - ConsensusDeterminedVersionAssignments.internalBinaryRead( - reader, - reader.uint32(), - options, - message.consensusDeterminedVersionAssignments, - ); - break; - case /* optional string additional_state_digest */ 7: - message.additionalStateDigest = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ConsensusCommitPrologue, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* optional uint64 round = 2; */ - if (message.round !== undefined) writer.tag(2, WireType.Varint).uint64(message.round); - /* optional google.protobuf.Timestamp commit_timestamp = 3; */ - if (message.commitTimestamp) - Timestamp.internalBinaryWrite( - message.commitTimestamp, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string consensus_commit_digest = 4; */ - if (message.consensusCommitDigest !== undefined) - writer.tag(4, WireType.LengthDelimited).string(message.consensusCommitDigest); - /* optional uint64 sub_dag_index = 5; */ - if (message.subDagIndex !== undefined) - writer.tag(5, WireType.Varint).uint64(message.subDagIndex); - /* optional sui.rpc.v2beta2.ConsensusDeterminedVersionAssignments consensus_determined_version_assignments = 6; */ - if (message.consensusDeterminedVersionAssignments) - ConsensusDeterminedVersionAssignments.internalBinaryWrite( - message.consensusDeterminedVersionAssignments, - writer.tag(6, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional string additional_state_digest = 7; */ - if (message.additionalStateDigest !== undefined) - writer.tag(7, WireType.LengthDelimited).string(message.additionalStateDigest); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ConsensusCommitPrologue @@ -3327,67 +1714,6 @@ class VersionAssignment$Type extends MessageType { }, ]); } - create(value?: PartialMessage): VersionAssignment { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: VersionAssignment, - ): VersionAssignment { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string object_id */ 1: - message.objectId = reader.string(); - break; - case /* optional uint64 start_version */ 2: - message.startVersion = reader.uint64().toBigInt(); - break; - case /* optional uint64 version */ 3: - message.version = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: VersionAssignment, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string object_id = 1; */ - if (message.objectId !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.objectId); - /* optional uint64 start_version = 2; */ - if (message.startVersion !== undefined) - writer.tag(2, WireType.Varint).uint64(message.startVersion); - /* optional uint64 version = 3; */ - if (message.version !== undefined) writer.tag(3, WireType.Varint).uint64(message.version); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.VersionAssignment @@ -3407,69 +1733,6 @@ class CanceledTransaction$Type extends MessageType { }, ]); } - create(value?: PartialMessage): CanceledTransaction { - const message = globalThis.Object.create(this.messagePrototype!); - message.versionAssignments = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: CanceledTransaction, - ): CanceledTransaction { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string digest */ 1: - message.digest = reader.string(); - break; - case /* repeated sui.rpc.v2beta2.VersionAssignment version_assignments */ 2: - message.versionAssignments.push( - VersionAssignment.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: CanceledTransaction, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string digest = 1; */ - if (message.digest !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.digest); - /* repeated sui.rpc.v2beta2.VersionAssignment version_assignments = 2; */ - for (let i = 0; i < message.versionAssignments.length; i++) - VersionAssignment.internalBinaryWrite( - message.versionAssignments[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.CanceledTransaction @@ -3489,71 +1752,6 @@ class ConsensusDeterminedVersionAssignments$Type extends MessageType, - ): ConsensusDeterminedVersionAssignments { - const message = globalThis.Object.create(this.messagePrototype!); - message.canceledTransactions = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ConsensusDeterminedVersionAssignments, - ): ConsensusDeterminedVersionAssignments { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional int32 version */ 1: - message.version = reader.int32(); - break; - case /* repeated sui.rpc.v2beta2.CanceledTransaction canceled_transactions */ 3: - message.canceledTransactions.push( - CanceledTransaction.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ConsensusDeterminedVersionAssignments, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional int32 version = 1; */ - if (message.version !== undefined) writer.tag(1, WireType.Varint).int32(message.version); - /* repeated sui.rpc.v2beta2.CanceledTransaction canceled_transactions = 3; */ - for (let i = 0; i < message.canceledTransactions.length; i++) - CanceledTransaction.internalBinaryWrite( - message.canceledTransactions[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ConsensusDeterminedVersionAssignments @@ -3597,79 +1795,6 @@ class AuthenticatorStateUpdate$Type extends MessageType): AuthenticatorStateUpdate { - const message = globalThis.Object.create(this.messagePrototype!); - message.newActiveJwks = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: AuthenticatorStateUpdate, - ): AuthenticatorStateUpdate { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 epoch */ 1: - message.epoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 round */ 2: - message.round = reader.uint64().toBigInt(); - break; - case /* repeated sui.rpc.v2beta2.ActiveJwk new_active_jwks */ 3: - message.newActiveJwks.push( - ActiveJwk.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional uint64 authenticator_object_initial_shared_version */ 4: - message.authenticatorObjectInitialSharedVersion = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: AuthenticatorStateUpdate, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 epoch = 1; */ - if (message.epoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.epoch); - /* optional uint64 round = 2; */ - if (message.round !== undefined) writer.tag(2, WireType.Varint).uint64(message.round); - /* repeated sui.rpc.v2beta2.ActiveJwk new_active_jwks = 3; */ - for (let i = 0; i < message.newActiveJwks.length; i++) - ActiveJwk.internalBinaryWrite( - message.newActiveJwks[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 authenticator_object_initial_shared_version = 4; */ - if (message.authenticatorObjectInitialSharedVersion !== undefined) - writer.tag(4, WireType.Varint).uint64(message.authenticatorObjectInitialSharedVersion); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.AuthenticatorStateUpdate @@ -3691,75 +1816,6 @@ class ActiveJwk$Type extends MessageType { }, ]); } - create(value?: PartialMessage): ActiveJwk { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ActiveJwk, - ): ActiveJwk { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.JwkId id */ 1: - message.id = JwkId.internalBinaryRead(reader, reader.uint32(), options, message.id); - break; - case /* optional sui.rpc.v2beta2.Jwk jwk */ 2: - message.jwk = Jwk.internalBinaryRead(reader, reader.uint32(), options, message.jwk); - break; - case /* optional uint64 epoch */ 3: - message.epoch = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ActiveJwk, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.JwkId id = 1; */ - if (message.id) - JwkId.internalBinaryWrite( - message.id, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.Jwk jwk = 2; */ - if (message.jwk) - Jwk.internalBinaryWrite( - message.jwk, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional uint64 epoch = 3; */ - if (message.epoch !== undefined) writer.tag(3, WireType.Varint).uint64(message.epoch); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ActiveJwk @@ -3773,60 +1829,6 @@ class JwkId$Type extends MessageType { { no: 2, name: 'kid', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): JwkId { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: JwkId, - ): JwkId { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string iss */ 1: - message.iss = reader.string(); - break; - case /* optional string kid */ 2: - message.kid = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: JwkId, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string iss = 1; */ - if (message.iss !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.iss); - /* optional string kid = 2; */ - if (message.kid !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.kid); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.JwkId @@ -3842,70 +1844,6 @@ class Jwk$Type extends MessageType { { no: 4, name: 'alg', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, ]); } - create(value?: PartialMessage): Jwk { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: Jwk, - ): Jwk { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string kty */ 1: - message.kty = reader.string(); - break; - case /* optional string e */ 2: - message.e = reader.string(); - break; - case /* optional string n */ 3: - message.n = reader.string(); - break; - case /* optional string alg */ 4: - message.alg = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: Jwk, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional string kty = 1; */ - if (message.kty !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.kty); - /* optional string e = 2; */ - if (message.e !== undefined) writer.tag(2, WireType.LengthDelimited).string(message.e); - /* optional string n = 3; */ - if (message.n !== undefined) writer.tag(3, WireType.LengthDelimited).string(message.n); - /* optional string alg = 4; */ - if (message.alg !== undefined) writer.tag(4, WireType.LengthDelimited).string(message.alg); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.Jwk @@ -3924,63 +1862,6 @@ class EndOfEpochTransaction$Type extends MessageType { }, ]); } - create(value?: PartialMessage): EndOfEpochTransaction { - const message = globalThis.Object.create(this.messagePrototype!); - message.transactions = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: EndOfEpochTransaction, - ): EndOfEpochTransaction { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated sui.rpc.v2beta2.EndOfEpochTransactionKind transactions */ 1: - message.transactions.push( - EndOfEpochTransactionKind.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: EndOfEpochTransaction, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* repeated sui.rpc.v2beta2.EndOfEpochTransactionKind transactions = 1; */ - for (let i = 0; i < message.transactions.length; i++) - EndOfEpochTransactionKind.internalBinaryWrite( - message.transactions[i], - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.EndOfEpochTransaction @@ -4033,214 +1914,6 @@ class EndOfEpochTransactionKind$Type extends MessageType Empty }, ]); } - create(value?: PartialMessage): EndOfEpochTransactionKind { - const message = globalThis.Object.create(this.messagePrototype!); - message.kind = { oneofKind: undefined }; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: EndOfEpochTransactionKind, - ): EndOfEpochTransactionKind { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* sui.rpc.v2beta2.ChangeEpoch change_epoch */ 2: - message.kind = { - oneofKind: 'changeEpoch', - changeEpoch: ChangeEpoch.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).changeEpoch, - ), - }; - break; - case /* sui.rpc.v2beta2.AuthenticatorStateExpire authenticator_state_expire */ 3: - message.kind = { - oneofKind: 'authenticatorStateExpire', - authenticatorStateExpire: AuthenticatorStateExpire.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).authenticatorStateExpire, - ), - }; - break; - case /* sui.rpc.v2beta2.ExecutionTimeObservations execution_time_observations */ 4: - message.kind = { - oneofKind: 'executionTimeObservations', - executionTimeObservations: ExecutionTimeObservations.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).executionTimeObservations, - ), - }; - break; - case /* google.protobuf.Empty authenticator_state_create */ 200: - message.kind = { - oneofKind: 'authenticatorStateCreate', - authenticatorStateCreate: Empty.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).authenticatorStateCreate, - ), - }; - break; - case /* google.protobuf.Empty randomness_state_create */ 201: - message.kind = { - oneofKind: 'randomnessStateCreate', - randomnessStateCreate: Empty.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).randomnessStateCreate, - ), - }; - break; - case /* google.protobuf.Empty deny_list_state_create */ 202: - message.kind = { - oneofKind: 'denyListStateCreate', - denyListStateCreate: Empty.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).denyListStateCreate, - ), - }; - break; - case /* string bridge_state_create */ 203: - message.kind = { - oneofKind: 'bridgeStateCreate', - bridgeStateCreate: reader.string(), - }; - break; - case /* uint64 bridge_committee_init */ 204: - message.kind = { - oneofKind: 'bridgeCommitteeInit', - bridgeCommitteeInit: reader.uint64().toBigInt(), - }; - break; - case /* google.protobuf.Empty accumulator_root_create */ 205: - message.kind = { - oneofKind: 'accumulatorRootCreate', - accumulatorRootCreate: Empty.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).accumulatorRootCreate, - ), - }; - break; - case /* google.protobuf.Empty coin_registry_create */ 206: - message.kind = { - oneofKind: 'coinRegistryCreate', - coinRegistryCreate: Empty.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.kind as any).coinRegistryCreate, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: EndOfEpochTransactionKind, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* sui.rpc.v2beta2.ChangeEpoch change_epoch = 2; */ - if (message.kind.oneofKind === 'changeEpoch') - ChangeEpoch.internalBinaryWrite( - message.kind.changeEpoch, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.AuthenticatorStateExpire authenticator_state_expire = 3; */ - if (message.kind.oneofKind === 'authenticatorStateExpire') - AuthenticatorStateExpire.internalBinaryWrite( - message.kind.authenticatorStateExpire, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - /* sui.rpc.v2beta2.ExecutionTimeObservations execution_time_observations = 4; */ - if (message.kind.oneofKind === 'executionTimeObservations') - ExecutionTimeObservations.internalBinaryWrite( - message.kind.executionTimeObservations, - writer.tag(4, WireType.LengthDelimited).fork(), - options, - ).join(); - /* google.protobuf.Empty authenticator_state_create = 200; */ - if (message.kind.oneofKind === 'authenticatorStateCreate') - Empty.internalBinaryWrite( - message.kind.authenticatorStateCreate, - writer.tag(200, WireType.LengthDelimited).fork(), - options, - ).join(); - /* google.protobuf.Empty randomness_state_create = 201; */ - if (message.kind.oneofKind === 'randomnessStateCreate') - Empty.internalBinaryWrite( - message.kind.randomnessStateCreate, - writer.tag(201, WireType.LengthDelimited).fork(), - options, - ).join(); - /* google.protobuf.Empty deny_list_state_create = 202; */ - if (message.kind.oneofKind === 'denyListStateCreate') - Empty.internalBinaryWrite( - message.kind.denyListStateCreate, - writer.tag(202, WireType.LengthDelimited).fork(), - options, - ).join(); - /* string bridge_state_create = 203; */ - if (message.kind.oneofKind === 'bridgeStateCreate') - writer.tag(203, WireType.LengthDelimited).string(message.kind.bridgeStateCreate); - /* uint64 bridge_committee_init = 204; */ - if (message.kind.oneofKind === 'bridgeCommitteeInit') - writer.tag(204, WireType.Varint).uint64(message.kind.bridgeCommitteeInit); - /* google.protobuf.Empty accumulator_root_create = 205; */ - if (message.kind.oneofKind === 'accumulatorRootCreate') - Empty.internalBinaryWrite( - message.kind.accumulatorRootCreate, - writer.tag(205, WireType.LengthDelimited).fork(), - options, - ).join(); - /* google.protobuf.Empty coin_registry_create = 206; */ - if (message.kind.oneofKind === 'coinRegistryCreate') - Empty.internalBinaryWrite( - message.kind.coinRegistryCreate, - writer.tag(206, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.EndOfEpochTransactionKind @@ -4268,61 +1941,6 @@ class AuthenticatorStateExpire$Type extends MessageType): AuthenticatorStateExpire { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: AuthenticatorStateExpire, - ): AuthenticatorStateExpire { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional uint64 min_epoch */ 1: - message.minEpoch = reader.uint64().toBigInt(); - break; - case /* optional uint64 authenticator_object_initial_shared_version */ 2: - message.authenticatorObjectInitialSharedVersion = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: AuthenticatorStateExpire, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional uint64 min_epoch = 1; */ - if (message.minEpoch !== undefined) writer.tag(1, WireType.Varint).uint64(message.minEpoch); - /* optional uint64 authenticator_object_initial_shared_version = 2; */ - if (message.authenticatorObjectInitialSharedVersion !== undefined) - writer.tag(2, WireType.Varint).uint64(message.authenticatorObjectInitialSharedVersion); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.AuthenticatorStateExpire @@ -4342,69 +1960,6 @@ class ExecutionTimeObservations$Type extends MessageType): ExecutionTimeObservations { - const message = globalThis.Object.create(this.messagePrototype!); - message.observations = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ExecutionTimeObservations, - ): ExecutionTimeObservations { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional int32 version */ 1: - message.version = reader.int32(); - break; - case /* repeated sui.rpc.v2beta2.ExecutionTimeObservation observations */ 2: - message.observations.push( - ExecutionTimeObservation.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ExecutionTimeObservations, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional int32 version = 1; */ - if (message.version !== undefined) writer.tag(1, WireType.Varint).int32(message.version); - /* repeated sui.rpc.v2beta2.ExecutionTimeObservation observations = 2; */ - for (let i = 0; i < message.observations.length; i++) - ExecutionTimeObservation.internalBinaryWrite( - message.observations[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ExecutionTimeObservations @@ -4434,83 +1989,6 @@ class ExecutionTimeObservation$Type extends MessageType): ExecutionTimeObservation { - const message = globalThis.Object.create(this.messagePrototype!); - message.validatorObservations = []; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ExecutionTimeObservation, - ): ExecutionTimeObservation { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.ExecutionTimeObservation.ExecutionTimeObservationKind kind */ 1: - message.kind = reader.int32(); - break; - case /* optional sui.rpc.v2beta2.MoveCall move_entry_point */ 2: - message.moveEntryPoint = MoveCall.internalBinaryRead( - reader, - reader.uint32(), - options, - message.moveEntryPoint, - ); - break; - case /* repeated sui.rpc.v2beta2.ValidatorExecutionTimeObservation validator_observations */ 3: - message.validatorObservations.push( - ValidatorExecutionTimeObservation.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ExecutionTimeObservation, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.ExecutionTimeObservation.ExecutionTimeObservationKind kind = 1; */ - if (message.kind !== undefined) writer.tag(1, WireType.Varint).int32(message.kind); - /* optional sui.rpc.v2beta2.MoveCall move_entry_point = 2; */ - if (message.moveEntryPoint) - MoveCall.internalBinaryWrite( - message.moveEntryPoint, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.ValidatorExecutionTimeObservation validator_observations = 3; */ - for (let i = 0; i < message.validatorObservations.length; i++) - ValidatorExecutionTimeObservation.internalBinaryWrite( - message.validatorObservations[i], - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ExecutionTimeObservation @@ -4524,74 +2002,6 @@ class ValidatorExecutionTimeObservation$Type extends MessageType Duration }, ]); } - create( - value?: PartialMessage, - ): ValidatorExecutionTimeObservation { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ValidatorExecutionTimeObservation, - ): ValidatorExecutionTimeObservation { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional bytes validator */ 1: - message.validator = reader.bytes(); - break; - case /* optional google.protobuf.Duration duration */ 2: - message.duration = Duration.internalBinaryRead( - reader, - reader.uint32(), - options, - message.duration, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ValidatorExecutionTimeObservation, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional bytes validator = 1; */ - if (message.validator !== undefined) - writer.tag(1, WireType.LengthDelimited).bytes(message.validator); - /* optional google.protobuf.Duration duration = 2; */ - if (message.duration) - Duration.internalBinaryWrite( - message.duration, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ValidatorExecutionTimeObservation diff --git a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.ts b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.ts index a52195ca6..a823cb3c8 100644 --- a/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.ts +++ b/packages/sui-grpc/src/proto/sui/rpc/v2beta2/transaction_execution_service.ts @@ -1,14 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 import { ServiceType } from '@protobuf-ts/runtime-rpc'; -import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; -import type { IBinaryWriter } from '@protobuf-ts/runtime'; -import { WireType } from '@protobuf-ts/runtime'; -import type { BinaryReadOptions } from '@protobuf-ts/runtime'; -import type { IBinaryReader } from '@protobuf-ts/runtime'; -import { UnknownFieldHandler } from '@protobuf-ts/runtime'; -import type { PartialMessage } from '@protobuf-ts/runtime'; -import { reflectionMergePartial } from '@protobuf-ts/runtime'; import { MessageType } from '@protobuf-ts/runtime'; import { Empty } from '../../../google/protobuf/empty.js'; import { ValidatorAggregatedSignature } from './signature.js'; @@ -116,94 +108,6 @@ class ExecuteTransactionRequest$Type extends MessageType FieldMask }, ]); } - create(value?: PartialMessage): ExecuteTransactionRequest { - const message = globalThis.Object.create(this.messagePrototype!); - message.signatures = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ExecuteTransactionRequest, - ): ExecuteTransactionRequest { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.Transaction transaction */ 1: - message.transaction = Transaction.internalBinaryRead( - reader, - reader.uint32(), - options, - message.transaction, - ); - break; - case /* repeated sui.rpc.v2beta2.UserSignature signatures */ 2: - message.signatures.push( - UserSignature.internalBinaryRead(reader, reader.uint32(), options), - ); - break; - case /* optional google.protobuf.FieldMask read_mask */ 3: - message.readMask = FieldMask.internalBinaryRead( - reader, - reader.uint32(), - options, - message.readMask, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ExecuteTransactionRequest, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.Transaction transaction = 1; */ - if (message.transaction) - Transaction.internalBinaryWrite( - message.transaction, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* repeated sui.rpc.v2beta2.UserSignature signatures = 2; */ - for (let i = 0; i < message.signatures.length; i++) - UserSignature.internalBinaryWrite( - message.signatures[i], - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional google.protobuf.FieldMask read_mask = 3; */ - if (message.readMask) - FieldMask.internalBinaryWrite( - message.readMask, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ExecuteTransactionRequest @@ -217,81 +121,6 @@ class ExecuteTransactionResponse$Type extends MessageType ExecutedTransaction }, ]); } - create(value?: PartialMessage): ExecuteTransactionResponse { - const message = globalThis.Object.create(this.messagePrototype!); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: ExecuteTransactionResponse, - ): ExecuteTransactionResponse { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional sui.rpc.v2beta2.TransactionFinality finality */ 1: - message.finality = TransactionFinality.internalBinaryRead( - reader, - reader.uint32(), - options, - message.finality, - ); - break; - case /* optional sui.rpc.v2beta2.ExecutedTransaction transaction */ 2: - message.transaction = ExecutedTransaction.internalBinaryRead( - reader, - reader.uint32(), - options, - message.transaction, - ); - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: ExecuteTransactionResponse, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* optional sui.rpc.v2beta2.TransactionFinality finality = 1; */ - if (message.finality) - TransactionFinality.internalBinaryWrite( - message.finality, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* optional sui.rpc.v2beta2.ExecutedTransaction transaction = 2; */ - if (message.transaction) - ExecutedTransaction.internalBinaryWrite( - message.transaction, - writer.tag(2, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.ExecuteTransactionResponse @@ -319,96 +148,6 @@ class TransactionFinality$Type extends MessageType { { no: 3, name: 'quorum_executed', kind: 'message', oneof: 'finality', T: () => Empty }, ]); } - create(value?: PartialMessage): TransactionFinality { - const message = globalThis.Object.create(this.messagePrototype!); - message.finality = { oneofKind: undefined }; - if (value !== undefined) reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead( - reader: IBinaryReader, - length: number, - options: BinaryReadOptions, - target?: TransactionFinality, - ): TransactionFinality { - let message = target ?? this.create(), - end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* sui.rpc.v2beta2.ValidatorAggregatedSignature certified */ 1: - message.finality = { - oneofKind: 'certified', - certified: ValidatorAggregatedSignature.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.finality as any).certified, - ), - }; - break; - case /* uint64 checkpointed */ 2: - message.finality = { - oneofKind: 'checkpointed', - checkpointed: reader.uint64().toBigInt(), - }; - break; - case /* google.protobuf.Empty quorum_executed */ 3: - message.finality = { - oneofKind: 'quorumExecuted', - quorumExecuted: Empty.internalBinaryRead( - reader, - reader.uint32(), - options, - (message.finality as any).quorumExecuted, - ), - }; - break; - default: - let u = options.readUnknownField; - if (u === 'throw') - throw new globalThis.Error( - `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, - ); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)( - this.typeName, - message, - fieldNo, - wireType, - d, - ); - } - } - return message; - } - internalBinaryWrite( - message: TransactionFinality, - writer: IBinaryWriter, - options: BinaryWriteOptions, - ): IBinaryWriter { - /* sui.rpc.v2beta2.ValidatorAggregatedSignature certified = 1; */ - if (message.finality.oneofKind === 'certified') - ValidatorAggregatedSignature.internalBinaryWrite( - message.finality.certified, - writer.tag(1, WireType.LengthDelimited).fork(), - options, - ).join(); - /* uint64 checkpointed = 2; */ - if (message.finality.oneofKind === 'checkpointed') - writer.tag(2, WireType.Varint).uint64(message.finality.checkpointed); - /* google.protobuf.Empty quorum_executed = 3; */ - if (message.finality.oneofKind === 'quorumExecuted') - Empty.internalBinaryWrite( - message.finality.quorumExecuted, - writer.tag(3, WireType.LengthDelimited).fork(), - options, - ).join(); - let u = options.writeUnknownFields; - if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } } /** * @generated MessageType for protobuf message sui.rpc.v2beta2.TransactionFinality From 80cde5940943586cf2426b22ffceb06d1658b203 Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Mon, 6 Oct 2025 09:54:15 -0700 Subject: [PATCH 32/36] support executed transactions (#582) Co-authored-by: Michael Hayes --- .../src/transaction-analyzer/analyzer.ts | 8 +++---- .../src/transaction-analyzer/rules/core.ts | 23 +++++++++++-------- .../transaction-analyzer/coin-flows.test.ts | 22 +++++++++--------- .../transaction-analyzer/coin-value.test.ts | 14 +++++------ .../test/transaction-analyzer/coins.test.ts | 2 +- .../transaction-analyzer/commands.test.ts | 2 +- .../transaction-analyzer/functions.test.ts | 2 +- .../test/transaction-analyzer/inputs.test.ts | 2 +- .../test/transaction-analyzer/objects.test.ts | 2 +- 9 files changed, 40 insertions(+), 37 deletions(-) diff --git a/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts b/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts index d6994a9f2..0ea10b417 100644 --- a/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts +++ b/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts @@ -46,15 +46,15 @@ type OptionsFromAnalyzers>> { [K in keyof T]: T[K] extends Analyzer ? O : never; }[keyof T] & { - transactionJson: string; + transaction: string | Uint8Array; } >; export async function analyze>>( analyzers: T, - { transactionJson, ...options }: OptionsFromAnalyzers, + { transaction, ...options }: OptionsFromAnalyzers, ) { - const transaction = Transaction.from(transactionJson); + const tx = Transaction.from(transaction); const analyzerMap = new Map< unknown, (analysis: object) => AnalyzerResult | Promise @@ -65,7 +65,7 @@ export async function analyze> = analyzer.dependencies || {}; - analyzerMap.set(cacheKey, analyzer.analyze(options, transaction)); + analyzerMap.set(cacheKey, analyzer.analyze(options, tx)); Object.values(deps).forEach((dep) => initializeAnalyzer(dep)); } diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/core.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/core.ts index 4e37f3e2a..ea9a8baab 100644 --- a/packages/wallet-sdk/src/transaction-analyzer/rules/core.ts +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/core.ts @@ -38,17 +38,20 @@ export const digest = createAnalyzer({ }, }); -export const dryRun = createAnalyzer({ - cacheKey: 'dryRun@1.0.0', +export const transactionResponse = createAnalyzer({ + cacheKey: 'transactionResponse@1.0.0', dependencies: { bytes }, analyze: - (options: { client: ClientWithCoreApi }) => - async ({ - bytes, - }): Promise> => { + (options: { + client: ClientWithCoreApi; + transactionResponse?: Experimental_SuiClientTypes.TransactionResponse; + }) => + async ({ bytes }): Promise> => { try { return { - result: await options.client.core.dryRunTransaction({ transaction: bytes }), + result: + options.transactionResponse ?? + (await options.client.core.dryRunTransaction({ transaction: bytes })).transaction, }; } catch { return { issues: [{ message: 'Failed to dry run transaction' }] }; @@ -57,10 +60,10 @@ export const dryRun = createAnalyzer({ }); export const balanceChanges = createAnalyzer({ - dependencies: { dryRun }, + dependencies: { transactionResponse }, analyze: () => - ({ dryRun }) => { - return { result: dryRun.transaction.balanceChanges || [] }; + ({ transactionResponse }) => { + return { result: transactionResponse.balanceChanges || [] }; }, }); diff --git a/packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts b/packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts index 497152ed6..00ec9510f 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/coin-flows.test.ts @@ -26,7 +26,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -52,7 +52,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -77,7 +77,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -119,7 +119,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -147,7 +147,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -174,7 +174,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -198,7 +198,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -227,7 +227,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -259,7 +259,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -316,7 +316,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); @@ -393,7 +393,7 @@ describe('TransactionAnalyzer - Coin Flows Rule', () => { { coinFlows }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); diff --git a/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts b/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts index 265af65f5..f06d9c0a9 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts @@ -65,7 +65,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { { coinValue }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), getCoinPrices: mockGetCoinPrices, }, ); @@ -112,7 +112,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { { coinValue }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), getCoinPrices: mockGetCoinPrices, }, ); @@ -158,7 +158,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { { coinValue }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), getCoinPrices: mockGetCoinPrices, }, ); @@ -186,7 +186,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { { coinValue }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), getCoinPrices: mockGetCoinPrices, }, ); @@ -236,7 +236,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { { coinValue }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), getCoinPrices: mockGetCoinPrices, }, ); @@ -266,7 +266,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { { coinValue }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), getCoinPrices: errorGetCoinPrices, }, ); @@ -297,7 +297,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { { coinValue }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), getCoinPrices: mockGetCoinPrices, }, ); diff --git a/packages/wallet-sdk/test/transaction-analyzer/coins.test.ts b/packages/wallet-sdk/test/transaction-analyzer/coins.test.ts index 23bd652c5..ff9e95964 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/coins.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/coins.test.ts @@ -80,7 +80,7 @@ describe('TransactionAnalyzer - Coins Rule', () => { { coins, gasCoins }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); diff --git a/packages/wallet-sdk/test/transaction-analyzer/commands.test.ts b/packages/wallet-sdk/test/transaction-analyzer/commands.test.ts index 321f909ab..6011161b5 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/commands.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/commands.test.ts @@ -38,7 +38,7 @@ describe('TransactionAnalyzer - Commands Rule', () => { { commands }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); diff --git a/packages/wallet-sdk/test/transaction-analyzer/functions.test.ts b/packages/wallet-sdk/test/transaction-analyzer/functions.test.ts index b6a8a164a..460722b0c 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/functions.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/functions.test.ts @@ -106,7 +106,7 @@ describe('TransactionAnalyzer - Functions Rule', () => { { moveFunctions }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); diff --git a/packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts b/packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts index 9d642e926..adb1bafd0 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/inputs.test.ts @@ -67,7 +67,7 @@ describe('TransactionAnalyzer - Inputs Rule', () => { { inputs }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); diff --git a/packages/wallet-sdk/test/transaction-analyzer/objects.test.ts b/packages/wallet-sdk/test/transaction-analyzer/objects.test.ts index 38f64bb74..96706aec9 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/objects.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/objects.test.ts @@ -64,7 +64,7 @@ describe('TransactionAnalyzer - Objects Rule', () => { { objectIds, objects, ownedObjects, objectsById }, { client, - transactionJson: await tx.toJSON(), + transaction: await tx.toJSON(), }, ); From 21820ad7dbf70e507bceeb95ac809fb21b9c7ec7 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Thu, 2 Oct 2025 10:49:00 -0700 Subject: [PATCH 33/36] Add AutoApprovalManager --- .../wallet-sdk/src/auto-approvals/index.ts | 14 + .../wallet-sdk/src/auto-approvals/intent.ts | 74 ++++ .../wallet-sdk/src/auto-approvals/manager.ts | 400 ++++++++++++++++++ .../src/auto-approvals/schemas/index.ts | 12 + .../src/auto-approvals/schemas/policy.ts | 63 +++ .../src/auto-approvals/schemas/state.ts | 21 + packages/wallet-sdk/src/index.ts | 5 + .../test/auto-approvals/manager.test.ts | 106 +++++ 8 files changed, 695 insertions(+) create mode 100644 packages/wallet-sdk/src/auto-approvals/index.ts create mode 100644 packages/wallet-sdk/src/auto-approvals/intent.ts create mode 100644 packages/wallet-sdk/src/auto-approvals/manager.ts create mode 100644 packages/wallet-sdk/src/auto-approvals/schemas/index.ts create mode 100644 packages/wallet-sdk/src/auto-approvals/schemas/policy.ts create mode 100644 packages/wallet-sdk/src/auto-approvals/schemas/state.ts create mode 100644 packages/wallet-sdk/src/index.ts create mode 100644 packages/wallet-sdk/test/auto-approvals/manager.test.ts diff --git a/packages/wallet-sdk/src/auto-approvals/index.ts b/packages/wallet-sdk/src/auto-approvals/index.ts new file mode 100644 index 000000000..70e144f17 --- /dev/null +++ b/packages/wallet-sdk/src/auto-approvals/index.ts @@ -0,0 +1,14 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +export { + operationType, + extractOperationType, + OPERATION_TYPE_INTENT, + operationTypeAnalyzer, +} from './intent.js'; + +export { AutoApprovalManager } from './manager.js'; +export type { AutoApprovalAnalysis, AutoApprovalIssue, AutoApprovalCheck } from './manager.js'; + +export * from './schemas/index.js'; diff --git a/packages/wallet-sdk/src/auto-approvals/intent.ts b/packages/wallet-sdk/src/auto-approvals/intent.ts new file mode 100644 index 000000000..612139e15 --- /dev/null +++ b/packages/wallet-sdk/src/auto-approvals/intent.ts @@ -0,0 +1,74 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Transaction, TransactionResult } from '@mysten/sui/transactions'; +import type { TransactionDataBuilder } from '@mysten/sui/transactions'; +import { Commands } from '@mysten/sui/transactions'; +import type { Analyzer } from '../transaction-analyzer/index.js'; + +export const OPERATION_TYPE_INTENT = 'OperationType'; + +export function operationType(operationType: string) { + return (tx: Transaction): TransactionResult => { + tx.addIntentResolver(OPERATION_TYPE_INTENT, (transactionData, _options, next) => { + replaceOperationTypeIntent(transactionData); + return next(); + }); + + const result = tx.add( + Commands.Intent({ + name: OPERATION_TYPE_INTENT, + inputs: {}, + data: { operationType }, + }), + ); + + return result; + }; +} + +export function extractOperationType(cb: (operationType: string) => void) { + return ( + transactionData: TransactionDataBuilder, + _options: unknown, + next: () => Promise, + ) => { + replaceOperationTypeIntent(transactionData, cb); + return next(); + }; +} + +function replaceOperationTypeIntent( + transactionData: TransactionDataBuilder, + cb?: (operationType: string) => void, +) { + let intentFound = false; + for (let index = 0; index < transactionData.commands.length; index++) { + const command = transactionData.commands[index]; + if (command.$kind === '$Intent' && command.$Intent.name === OPERATION_TYPE_INTENT) { + if (intentFound) { + throw new Error('Multiple operation type intents found in transaction'); + } + intentFound = true; + const operationType = command.$Intent.data.operationType as string; + transactionData.replaceCommand(index, []); + cb?.(operationType); + } + } +} + +export const operationTypeAnalyzer: Analyzer = (tx) => { + let operationType: string | null = null; + tx.addIntentResolver( + OPERATION_TYPE_INTENT, + extractOperationType((type) => { + operationType = type; + }), + ); + + return async ({ get }) => { + // wait for intent to be resolved + await get('data'); + return operationType; + }; +}; diff --git a/packages/wallet-sdk/src/auto-approvals/manager.ts b/packages/wallet-sdk/src/auto-approvals/manager.ts new file mode 100644 index 000000000..5c5fdeb65 --- /dev/null +++ b/packages/wallet-sdk/src/auto-approvals/manager.ts @@ -0,0 +1,400 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Experimental_SuiClientTypes } from '@mysten/sui/experimental'; +import { parse, safeParse } from 'valibot'; +import type { BaseAnalysis } from '../transaction-analyzer/base.js'; +import type { CoinValueAnalysis, TransactionAnalysisIssue } from '../transaction-analyzer/index.js'; +import type { AutoApprovalState } from './schemas/state.js'; +import { AutoApprovalStateSchema } from './schemas/state.js'; +import type { AutoApprovalSettings } from './schemas/policy.js'; +import { AutoApprovalPolicySchema, AutoApprovalSettingsSchema } from './schemas/policy.js'; +import { parseStructTag } from '@mysten/sui/utils'; + +export interface AutoApprovalManagerOptions { + policy: string; + state: string | null; +} + +export interface AutoApprovalAnalysis { + results: BaseAnalysis & { + coinValues: CoinValueAnalysis; + operationType: string | null; + }; + issues: TransactionAnalysisIssue[]; +} + +export interface AutoApprovalIssue { + message: string; +} + +export interface AutoApprovalCheck { + matchesPolicy: boolean; + canAutoApprove: boolean; + policyIssues: AutoApprovalIssue[]; + settingsIssues: AutoApprovalIssue[]; + analysisIssues: AutoApprovalIssue[]; +} + +export class AutoApprovalManager { + #state: AutoApprovalState; + + constructor(options: AutoApprovalManagerOptions) { + let state: AutoApprovalState | null = null; + + if (options.state) { + const parseResult = safeParse(AutoApprovalStateSchema, JSON.parse(options.state)); + if (parseResult.success) { + const providedPolicy = parse(AutoApprovalPolicySchema, JSON.parse(options.policy)); + const currentPolicy = parseResult.output.policy; + + if (JSON.stringify(currentPolicy) === JSON.stringify(providedPolicy)) { + state = parseResult.output; + } + } + } + + this.#state = + state ?? + parse(AutoApprovalStateSchema, { + schemaVersion: '1.0.0', + policy: parse(AutoApprovalPolicySchema, JSON.parse(options.policy)), + settings: null, + pendingDigests: [], + } satisfies AutoApprovalState); + } + + checkTransaction(analysis: AutoApprovalAnalysis): AutoApprovalCheck { + const results: AutoApprovalCheck = { + matchesPolicy: false, + canAutoApprove: false, + analysisIssues: [...analysis.issues], + policyIssues: [], + settingsIssues: [], + }; + + if (results.analysisIssues.length > 0) { + return results; + } + + const policyIssues = this.#matchesPolicy(analysis); + + if (policyIssues.length > 0) { + results.policyIssues = policyIssues; + return results; + } else { + results.matchesPolicy = true; + } + + const settingsIssues = this.#canAutoApprove(analysis); + + if (settingsIssues.length > 0) { + results.settingsIssues = settingsIssues; + return results; + } else { + results.canAutoApprove = true; + } + + return results; + } + + #matchesPolicy(analysis: AutoApprovalAnalysis): AutoApprovalIssue[] { + const issues: AutoApprovalIssue[] = []; + + if (analysis.issues.length > 0) { + issues.push({ message: 'Transaction analysis failed' }); + } + + if (!analysis.results.operationType) { + issues.push({ message: 'Operation type not found in Transaction' }); + + return issues; + } + + const operation = this.#state.policy.operations.find( + (op) => op.id === analysis.results.operationType, + ); + + if (!operation) { + issues.push({ message: 'Operation not found in policy' }); + return issues; + } + + if (!operation.permissions.anyBalance) { + for (const flow of analysis.results.coinFlows) { + if (!operation.permissions.balances?.find((b) => b.coinType === flow.coinType)) { + issues.push({ + message: `Operation does not have permission to use coin type ${flow.coinType}`, + }); + } + } + } + + for (const obj of analysis.results.ownedObjects) { + if (isCoinType(obj.type)) { + continue; + } + + const accessLevel = analysis.results.accessLevel[obj.id]; + + if (!accessLevel) { + issues.push({ message: `Access level could not be determined for object ${obj.id}` }); + } + + const ownedObjectsPermission = operation.permissions.ownedObjects?.find( + (p) => p.objectType === obj.type, + ); + + if (!ownedObjectsPermission) { + issues.push({ message: `No permission found for object ${obj.id}` }); + } else if (!compareAccessLevel(ownedObjectsPermission.accessLevel, accessLevel)) { + issues.push({ + message: `Insufficient access level for object ${obj.id}: required ${ownedObjectsPermission.accessLevel}, got ${accessLevel}`, + }); + } + } + + return issues; + + function compareAccessLevel( + required: 'read' | 'mutate' | 'transfer', + actual: 'read' | 'mutate' | 'transfer', + ): boolean { + if (required === 'read') { + return true; + } + if (required === 'mutate') { + return actual === 'mutate' || actual === 'transfer'; + } + return actual === 'transfer'; + } + } + + #canAutoApprove(analysis: AutoApprovalAnalysis): AutoApprovalIssue[] { + const issues: AutoApprovalIssue[] = []; + + if (!this.#state.settings) { + issues.push({ message: 'No auto-approval settings configured' }); + return issues; + } + + if (analysis.issues.length > 0) { + issues.push({ message: 'Transaction analysis failed' }); + return issues; + } + + if (new Date() > new Date(this.#state.settings.expiration)) { + issues.push({ message: 'Auto-approval settings have expired' }); + } + + if ( + this.#state.settings.remainingTransactions !== null && + this.#state.settings.remainingTransactions <= 0 + ) { + issues.push({ message: 'No remaining auto-approved transactions' }); + } + + if ( + !analysis.results.operationType || + !this.#state.settings.approvedOperations.includes(analysis.results.operationType) + ) { + issues.push({ message: 'Operation type not approved for auto-approval' }); + } + + for (const outflow of analysis.results.coinFlows) { + if (outflow.amount <= 0n) { + continue; + } + + if (this.#state.settings.coinBudgets[outflow.coinType] !== undefined) { + const coinBudget = this.#state.settings.coinBudgets[outflow.coinType]; + + if (coinBudget) { + if (BigInt(coinBudget) < outflow.amount) { + issues.push({ + message: `Insufficient budget for coin type ${outflow.coinType}`, + }); + } + } + } else { + const coinAmount = analysis.results.coinValues.coinTypes.find( + (ct) => ct.coinType === outflow.coinType, + ); + + if (!coinAmount) { + issues.push({ + message: `No budget configured for coin type ${outflow.coinType}`, + }); + } else if ((this.#state.settings.sharedBudget ?? 0) < coinAmount.convertedAmount) { + issues.push({ + message: `Insufficient budget for coin type ${outflow.coinType}`, + }); + } + } + } + + return issues; + } + + commitTransaction(analysis: AutoApprovalAnalysis): void { + if (!this.#state.settings) { + throw new Error('No auto-approval settings configured'); + } + + if (this.#state.settings.remainingTransactions !== null && this.#state.settings) { + this.#state.settings.remainingTransactions = Math.max( + 0, + this.#state.settings.remainingTransactions - 1, + ); + } + + for (const outflow of analysis.results.coinFlows) { + if (this.#state.settings.coinBudgets[outflow.coinType] !== undefined) { + const currentBudget = BigInt(this.#state.settings?.coinBudgets[outflow.coinType] ?? '0'); + const newBalance = currentBudget - outflow.amount; + this.#state.settings.coinBudgets[outflow.coinType] = newBalance.toString(); + } else { + if (this.#state.settings.sharedBudget === null) { + throw new Error('No budget available for coin type ' + outflow.coinType); + } + + const coinValue = analysis.results.coinValues.coinTypes.find( + (ct) => ct.coinType === outflow.coinType, + ); + + if (!coinValue) { + throw new Error('No value available for coin type ' + outflow.coinType); + } + + this.#state.settings.sharedBudget -= coinValue.convertedAmount; + } + } + + this.#state.pendingDigests.push(analysis.results.digest); + } + + revertTransaction(analysis: AutoApprovalAnalysis): void { + this.#removePendingDigest(analysis.results.digest); + + if (this.#state.settings?.remainingTransactions !== null && this.#state.settings) { + this.#state.settings.remainingTransactions += 1; + } + + this.#revertCoinFlows(analysis); + } + + #revertCoinFlows(analysis: AutoApprovalAnalysis): void { + if (!this.#state.settings) { + throw new Error('No auto-approval settings configured'); + } + + for (const outflow of analysis.results.coinFlows) { + if (this.#state.settings?.coinBudgets[outflow.coinType] !== undefined) { + const currentBudget = BigInt(this.#state.settings?.coinBudgets[outflow.coinType] ?? '0'); + const newBalance = currentBudget + outflow.amount; + this.#state.settings.coinBudgets[outflow.coinType] = newBalance.toString(); + } else { + if (this.#state.settings.sharedBudget === null) { + throw new Error('No budget available for coin type ' + outflow.coinType); + } + + const coinValue = analysis.results.coinValues.coinTypes.find( + (ct) => ct.coinType === outflow.coinType, + ); + + if (!coinValue) { + throw new Error('No value available for coin type ' + outflow.coinType); + } + + this.#state.settings.sharedBudget += coinValue.convertedAmount; + } + } + } + + #removePendingDigest(digest: string): void { + const pendingIndex = this.#state.pendingDigests.indexOf(digest); + if (pendingIndex >= 0) { + this.#state.pendingDigests.splice(pendingIndex, 1); + } else { + throw new Error(`Transaction with digest ${digest} not found in pending digests`); + } + } + + applyTransactionEffects( + analysis: AutoApprovalAnalysis, + result: Experimental_SuiClientTypes.TransactionResponse, + ): void { + this.#removePendingDigest(result.digest); + + if (!this.#state.settings) { + throw new Error('No auto-approval settings configured'); + } + + // Revert coin flows and use real balance changes instead + this.#revertCoinFlows(analysis); + + for (const change of result.balanceChanges) { + if (this.#state.settings.coinBudgets[change.coinType] !== undefined) { + const currentBudget = BigInt(this.#state.settings?.coinBudgets[change.coinType] ?? '0'); + const newBalance = currentBudget + BigInt(change.amount); + if (this.#state.settings) { + this.#state.settings.coinBudgets[change.coinType] = newBalance.toString(); + } + } else { + if (this.#state.settings.sharedBudget === null) { + throw new Error('No budget available for coin type ' + change.coinType); + } + + const coinValue = analysis.results.coinValues.coinTypes.find( + (ct) => ct.coinType === change.coinType, + ); + + if (!coinValue) { + throw new Error('No value available for coin type ' + change.coinType); + } + + const convertedChange = Number(change.amount) * 10 ** coinValue.decimals * coinValue.price; + + this.#state.settings.sharedBudget += convertedChange; + } + } + } + + reset() { + this.#state = { + schemaVersion: '1.0.0', + policy: this.#state.policy, + settings: null, + pendingDigests: [], + }; + } + + export(): string { + return JSON.stringify(parse(AutoApprovalStateSchema, this.#state)); + } + + getState(): AutoApprovalState { + return parse(AutoApprovalStateSchema, this.#state); + } + + getSettings(): AutoApprovalSettings | null { + return this.#state.settings; + } + + updateSettings(settings: AutoApprovalSettings): void { + const validatedSettings = parse(AutoApprovalSettingsSchema, settings); + this.#state.settings = validatedSettings; + } +} + +const parsedCoinType = parseStructTag('0x2::coin::Coin'); + +function isCoinType(type: string): boolean { + const parsedType = parseStructTag(type); + return ( + parsedType.address === parsedCoinType.address && + parsedType.module === parsedCoinType.module && + parsedType.name === parsedCoinType.name && + parsedType.typeParams.length === 1 + ); +} diff --git a/packages/wallet-sdk/src/auto-approvals/schemas/index.ts b/packages/wallet-sdk/src/auto-approvals/schemas/index.ts new file mode 100644 index 000000000..bb4485e58 --- /dev/null +++ b/packages/wallet-sdk/src/auto-approvals/schemas/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +export { AutoApprovalPolicySchema, AutoApprovalSettingsSchema } from './policy.js'; +export type { + AutoApprovalPolicy, + AutoApprovalSettings, + AutoApprovalOperation, + PolicyPermission, +} from './policy.js'; + +export { AutoApprovalStateSchema } from './state.js'; +export type { AutoApprovalState } from './state.js'; diff --git a/packages/wallet-sdk/src/auto-approvals/schemas/policy.ts b/packages/wallet-sdk/src/auto-approvals/schemas/policy.ts new file mode 100644 index 000000000..e22b5c2e3 --- /dev/null +++ b/packages/wallet-sdk/src/auto-approvals/schemas/policy.ts @@ -0,0 +1,63 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import * as v from 'valibot'; + +const AccessLevelSchema = v.union([v.literal('read'), v.literal('mutate'), v.literal('transfer')]); + +const BasePermissionSchema = v.object({ + description: v.string(), +}); + +const ObjectTypePermissionSchema = v.object({ + ...BasePermissionSchema.entries, + $kind: v.literal('ObjectType'), + objectType: v.string(), + accessLevel: AccessLevelSchema, +}); + +const CoinBalancePermissionSchema = v.object({ + ...BasePermissionSchema.entries, + $kind: v.literal('CoinBalance'), + coinType: v.string(), +}); + +const AnyBalancesPermissionSchema = v.object({ + ...BasePermissionSchema.entries, + $kind: v.literal('AnyBalance'), +}); + +export type PolicyPermission = v.InferOutput< + | typeof CoinBalancePermissionSchema + | typeof AnyBalancesPermissionSchema + | typeof ObjectTypePermissionSchema +>; + +const AutoApprovalOperationSchema = v.object({ + id: v.string(), + description: v.string(), + permissions: v.object({ + ownedObjects: v.optional(v.array(ObjectTypePermissionSchema)), + balances: v.optional(v.array(CoinBalancePermissionSchema)), + anyBalance: v.optional(AnyBalancesPermissionSchema), + }), +}); + +export const AutoApprovalSettingsSchema = v.looseObject({ + approvedOperations: v.array(v.string()), + expiration: v.number(), + remainingTransactions: v.nullable(v.number()), + sharedBudget: v.nullable(v.number()), + // TODO: normalize coin types + coinBudgets: v.record(v.string(), v.string()), +}); + +export const AutoApprovalPolicySchema = v.object({ + schemaVersion: v.literal('1.0.0'), + operations: v.array(AutoApprovalOperationSchema), + suggestedSettings: v.optional(v.partial(AutoApprovalSettingsSchema)), +}); + +export type AutoApprovalSettings = v.InferOutput; +export type AutoApprovalPolicy = v.InferOutput; +export type AutoApprovalOperation = v.InferOutput; diff --git a/packages/wallet-sdk/src/auto-approvals/schemas/state.ts b/packages/wallet-sdk/src/auto-approvals/schemas/state.ts new file mode 100644 index 000000000..121c0d06d --- /dev/null +++ b/packages/wallet-sdk/src/auto-approvals/schemas/state.ts @@ -0,0 +1,21 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import * as v from 'valibot'; +import { AutoApprovalPolicySchema, AutoApprovalSettingsSchema } from './policy.js'; + +export const CreatedObjectSchema = v.object({ + objectId: v.string(), + version: v.string(), + digest: v.string(), + objectType: v.string(), +}); + +export const AutoApprovalStateSchema = v.object({ + schemaVersion: v.literal('1.0.0'), + policy: AutoApprovalPolicySchema, + settings: v.nullable(AutoApprovalSettingsSchema), + pendingDigests: v.array(v.string()), +}); + +export type AutoApprovalState = v.InferOutput; diff --git a/packages/wallet-sdk/src/index.ts b/packages/wallet-sdk/src/index.ts new file mode 100644 index 000000000..a102c347d --- /dev/null +++ b/packages/wallet-sdk/src/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +export * from './transaction-analyzer/index.js'; +export * from './auto-approvals/index.js'; diff --git a/packages/wallet-sdk/test/auto-approvals/manager.test.ts b/packages/wallet-sdk/test/auto-approvals/manager.test.ts new file mode 100644 index 000000000..d2a86d21f --- /dev/null +++ b/packages/wallet-sdk/test/auto-approvals/manager.test.ts @@ -0,0 +1,106 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { Transaction } from '@mysten/sui/transactions'; +import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'; +import { + AutoApprovalManager, + AutoApprovalPolicy, + CoinValueAnalysis, + createCoinValueAnalyzer, + operationType, + operationTypeAnalyzer, + TransactionAnalyzer, +} from '../../src'; +import { getFullnodeUrl, SuiClient } from '@mysten/sui/client'; +import { MIST_PER_SUI } from '@mysten/sui/utils'; + +const policy: AutoApprovalPolicy = { + schemaVersion: '1.0.0', + operations: [ + { + id: 'test-operation', + description: 'Test operation', + permissions: {}, + }, + ], + suggestedSettings: {}, +}; + +describe('AutoApprovalManager', () => { + describe('placeholder example', async () => { + const keypair = new Ed25519Keypair(); + const client = new SuiClient({ url: getFullnodeUrl('testnet') }); + + const tx = new Transaction(); + tx.add(operationType('test-operation')); + const txJson = await tx.toJSON({ client }); + + const analysis = await TransactionAnalyzer.create<{ + operationType: string | null; + usdValue: CoinValueAnalysis; + }>(client, txJson, { + operationType: operationTypeAnalyzer, + usdValue: createCoinValueAnalyzer({ + getCoinPrices: async (types) => + types.map((coinType) => ({ coinType, decimals: 9, price: 2.5 })), + }), + }).analyze(); + + const manager = new AutoApprovalManager({ + policy: JSON.stringify(policy), + state: null, + }); + + // the transaction matches the policy + expect(manager.checkTransaction(analysis).matchesPolicy).toEqual(true); + + // policy has not been approved + expect(manager.checkTransaction(analysis).canAutoApprove).toEqual(false); + + manager.updateSettings({ + approvedOperations: ['test-operation'], + expiration: Date.now() + 1000 * 60 * 60, + remainingTransactions: 10, + usdBudget: 10, + coinBudgets: { + 'sui:0x2::sui::SUI': String(10n * MIST_PER_SUI), + }, + }); + + expect(manager.checkTransaction(analysis).canAutoApprove).toEqual(true); + + // deduct balances + manager.commitTransaction(analysis); + + const { signature } = await keypair.signTransaction(analysis.results.bytes); + + try { + var { transaction } = await client.core.executeTransaction({ + transaction: analysis.results.bytes, + signatures: [signature], + }); + } catch (e) { + // revert deductions on failure + manager.revertTransaction(analysis); + throw e; + } + + // update state with real effects + manager.applyTransactionEffects(analysis, transaction); + + // get state, store in local storage, etc. + const state = manager.export(); + + // instantiate a new manager with the saved state + const manager2 = new AutoApprovalManager({ + policy: JSON.stringify(policy), + state, + }); + + const settings = manager2.getSettings(); + + // new manager should have deducted from remaining transactions + expect(settings?.remainingTransactions).toEqual(9); + }); +}); From 23f8d6c359759f140500d55b808a03dc8aae0360 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Thu, 2 Oct 2025 20:38:39 -0700 Subject: [PATCH 34/36] update manager to work with latest analyzer format --- .../wallet-sdk/src/auto-approvals/analyzer.ts | 59 ++++++++++++++ .../wallet-sdk/src/auto-approvals/index.ts | 11 +-- .../wallet-sdk/src/auto-approvals/intent.ts | 17 ---- .../wallet-sdk/src/auto-approvals/manager.ts | 78 ++++++++++--------- .../src/transaction-analyzer/analyzer.ts | 9 +-- .../src/transaction-analyzer/index.ts | 12 ++- .../transaction-analyzer/rules/coin-value.ts | 2 +- .../src/transaction-analyzer/rules/index.ts | 32 ++++++++ packages/wallet-sdk/src/util.ts | 11 +++ .../test/auto-approvals/manager.test.ts | 39 ++++++---- .../transaction-analyzer/coin-value.test.ts | 36 ++++----- 11 files changed, 202 insertions(+), 104 deletions(-) create mode 100644 packages/wallet-sdk/src/auto-approvals/analyzer.ts create mode 100644 packages/wallet-sdk/src/transaction-analyzer/rules/index.ts create mode 100644 packages/wallet-sdk/src/util.ts diff --git a/packages/wallet-sdk/src/auto-approvals/analyzer.ts b/packages/wallet-sdk/src/auto-approvals/analyzer.ts new file mode 100644 index 000000000..775cef424 --- /dev/null +++ b/packages/wallet-sdk/src/auto-approvals/analyzer.ts @@ -0,0 +1,59 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { Analyzer, AnalyzerResult } from '../transaction-analyzer/analyzer.js'; +import { createAnalyzer } from '../transaction-analyzer/index.js'; +import { analyzers } from '../transaction-analyzer/index.js'; +import { extractOperationType, OPERATION_TYPE_INTENT } from './intent.js'; + +const operationType = createAnalyzer({ + dependencies: { + bytes: analyzers.bytes, + }, + analyze: (_options, tx) => { + let operationType: string | null = null; + tx.addIntentResolver( + OPERATION_TYPE_INTENT, + extractOperationType((type) => { + operationType = type; + }), + ); + + return async () => { + return { + result: operationType, + }; + }; + }, +}); + +export const autoApprovalAnalyzer = createAnalyzer({ + dependencies: { + operationType, + bytes: analyzers.bytes, + coinFlows: analyzers.coinFlows, + coinValues: analyzers.coinValues, + accessLevel: analyzers.accessLevel, + ownedObjects: analyzers.ownedObjects, + digest: analyzers.digest, + }, + analyze: + () => + async ({ bytes, coinFlows, accessLevel, ownedObjects, digest, operationType, coinValues }) => { + return { + result: { + operationType, + bytes, + coinFlows, + accessLevel, + ownedObjects, + digest, + coinValues, + }, + }; + }, +}); + +export type AutoApprovalAnalysis = + typeof autoApprovalAnalyzer extends Analyzer ? R : never; +export type AutoApprovalResult = AnalyzerResult; diff --git a/packages/wallet-sdk/src/auto-approvals/index.ts b/packages/wallet-sdk/src/auto-approvals/index.ts index 70e144f17..d6ee624f3 100644 --- a/packages/wallet-sdk/src/auto-approvals/index.ts +++ b/packages/wallet-sdk/src/auto-approvals/index.ts @@ -1,14 +1,11 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export { - operationType, - extractOperationType, - OPERATION_TYPE_INTENT, - operationTypeAnalyzer, -} from './intent.js'; +export { operationType, extractOperationType, OPERATION_TYPE_INTENT } from './intent.js'; +export { autoApprovalAnalyzer } from './analyzer.js'; +export type { AutoApprovalResult, AutoApprovalAnalysis } from './analyzer.js'; export { AutoApprovalManager } from './manager.js'; -export type { AutoApprovalAnalysis, AutoApprovalIssue, AutoApprovalCheck } from './manager.js'; +export type { AutoApprovalIssue, AutoApprovalCheck } from './manager.js'; export * from './schemas/index.js'; diff --git a/packages/wallet-sdk/src/auto-approvals/intent.ts b/packages/wallet-sdk/src/auto-approvals/intent.ts index 612139e15..e006fb888 100644 --- a/packages/wallet-sdk/src/auto-approvals/intent.ts +++ b/packages/wallet-sdk/src/auto-approvals/intent.ts @@ -4,7 +4,6 @@ import type { Transaction, TransactionResult } from '@mysten/sui/transactions'; import type { TransactionDataBuilder } from '@mysten/sui/transactions'; import { Commands } from '@mysten/sui/transactions'; -import type { Analyzer } from '../transaction-analyzer/index.js'; export const OPERATION_TYPE_INTENT = 'OperationType'; @@ -56,19 +55,3 @@ function replaceOperationTypeIntent( } } } - -export const operationTypeAnalyzer: Analyzer = (tx) => { - let operationType: string | null = null; - tx.addIntentResolver( - OPERATION_TYPE_INTENT, - extractOperationType((type) => { - operationType = type; - }), - ); - - return async ({ get }) => { - // wait for intent to be resolved - await get('data'); - return operationType; - }; -}; diff --git a/packages/wallet-sdk/src/auto-approvals/manager.ts b/packages/wallet-sdk/src/auto-approvals/manager.ts index 5c5fdeb65..5de8ff86e 100644 --- a/packages/wallet-sdk/src/auto-approvals/manager.ts +++ b/packages/wallet-sdk/src/auto-approvals/manager.ts @@ -3,27 +3,18 @@ import type { Experimental_SuiClientTypes } from '@mysten/sui/experimental'; import { parse, safeParse } from 'valibot'; -import type { BaseAnalysis } from '../transaction-analyzer/base.js'; -import type { CoinValueAnalysis, TransactionAnalysisIssue } from '../transaction-analyzer/index.js'; import type { AutoApprovalState } from './schemas/state.js'; import { AutoApprovalStateSchema } from './schemas/state.js'; import type { AutoApprovalSettings } from './schemas/policy.js'; import { AutoApprovalPolicySchema, AutoApprovalSettingsSchema } from './schemas/policy.js'; import { parseStructTag } from '@mysten/sui/utils'; +import type { AutoApprovalResult } from './analyzer.js'; export interface AutoApprovalManagerOptions { policy: string; state: string | null; } -export interface AutoApprovalAnalysis { - results: BaseAnalysis & { - coinValues: CoinValueAnalysis; - operationType: string | null; - }; - issues: TransactionAnalysisIssue[]; -} - export interface AutoApprovalIssue { message: string; } @@ -64,11 +55,11 @@ export class AutoApprovalManager { } satisfies AutoApprovalState); } - checkTransaction(analysis: AutoApprovalAnalysis): AutoApprovalCheck { + checkTransaction(analysis: AutoApprovalResult): AutoApprovalCheck { const results: AutoApprovalCheck = { matchesPolicy: false, canAutoApprove: false, - analysisIssues: [...analysis.issues], + analysisIssues: [...(analysis.issues ?? [])], policyIssues: [], settingsIssues: [], }; @@ -98,21 +89,22 @@ export class AutoApprovalManager { return results; } - #matchesPolicy(analysis: AutoApprovalAnalysis): AutoApprovalIssue[] { + #matchesPolicy(analysis: AutoApprovalResult): AutoApprovalIssue[] { const issues: AutoApprovalIssue[] = []; - if (analysis.issues.length > 0) { + if (analysis.issues) { issues.push({ message: 'Transaction analysis failed' }); + return issues; } - if (!analysis.results.operationType) { + if (!analysis.result.operationType) { issues.push({ message: 'Operation type not found in Transaction' }); return issues; } const operation = this.#state.policy.operations.find( - (op) => op.id === analysis.results.operationType, + (op) => op.id === analysis.result.operationType, ); if (!operation) { @@ -121,7 +113,7 @@ export class AutoApprovalManager { } if (!operation.permissions.anyBalance) { - for (const flow of analysis.results.coinFlows) { + for (const flow of analysis.result.coinFlows.outflows) { if (!operation.permissions.balances?.find((b) => b.coinType === flow.coinType)) { issues.push({ message: `Operation does not have permission to use coin type ${flow.coinType}`, @@ -130,12 +122,12 @@ export class AutoApprovalManager { } } - for (const obj of analysis.results.ownedObjects) { + for (const obj of analysis.result.ownedObjects) { if (isCoinType(obj.type)) { continue; } - const accessLevel = analysis.results.accessLevel[obj.id]; + const accessLevel = analysis.result.accessLevel[obj.id]; if (!accessLevel) { issues.push({ message: `Access level could not be determined for object ${obj.id}` }); @@ -170,7 +162,7 @@ export class AutoApprovalManager { } } - #canAutoApprove(analysis: AutoApprovalAnalysis): AutoApprovalIssue[] { + #canAutoApprove(analysis: AutoApprovalResult): AutoApprovalIssue[] { const issues: AutoApprovalIssue[] = []; if (!this.#state.settings) { @@ -178,7 +170,7 @@ export class AutoApprovalManager { return issues; } - if (analysis.issues.length > 0) { + if (analysis.issues) { issues.push({ message: 'Transaction analysis failed' }); return issues; } @@ -195,13 +187,13 @@ export class AutoApprovalManager { } if ( - !analysis.results.operationType || - !this.#state.settings.approvedOperations.includes(analysis.results.operationType) + !analysis.result.operationType || + !this.#state.settings.approvedOperations.includes(analysis.result.operationType) ) { issues.push({ message: 'Operation type not approved for auto-approval' }); } - for (const outflow of analysis.results.coinFlows) { + for (const outflow of analysis.result.coinFlows.outflows) { if (outflow.amount <= 0n) { continue; } @@ -217,7 +209,7 @@ export class AutoApprovalManager { } } } else { - const coinAmount = analysis.results.coinValues.coinTypes.find( + const coinAmount = analysis.result.coinValues.coinTypes.find( (ct) => ct.coinType === outflow.coinType, ); @@ -236,11 +228,15 @@ export class AutoApprovalManager { return issues; } - commitTransaction(analysis: AutoApprovalAnalysis): void { + commitTransaction(analysis: AutoApprovalResult): void { if (!this.#state.settings) { throw new Error('No auto-approval settings configured'); } + if (!analysis.result) { + throw new Error('Transaction analysis failed'); + } + if (this.#state.settings.remainingTransactions !== null && this.#state.settings) { this.#state.settings.remainingTransactions = Math.max( 0, @@ -248,7 +244,7 @@ export class AutoApprovalManager { ); } - for (const outflow of analysis.results.coinFlows) { + for (const outflow of analysis.result.coinFlows.outflows) { if (this.#state.settings.coinBudgets[outflow.coinType] !== undefined) { const currentBudget = BigInt(this.#state.settings?.coinBudgets[outflow.coinType] ?? '0'); const newBalance = currentBudget - outflow.amount; @@ -258,7 +254,7 @@ export class AutoApprovalManager { throw new Error('No budget available for coin type ' + outflow.coinType); } - const coinValue = analysis.results.coinValues.coinTypes.find( + const coinValue = analysis.result.coinValues.coinTypes.find( (ct) => ct.coinType === outflow.coinType, ); @@ -270,11 +266,13 @@ export class AutoApprovalManager { } } - this.#state.pendingDigests.push(analysis.results.digest); + this.#state.pendingDigests.push(analysis.result.digest); } - revertTransaction(analysis: AutoApprovalAnalysis): void { - this.#removePendingDigest(analysis.results.digest); + revertTransaction(analysis: AutoApprovalResult): void { + if (analysis.result?.digest) { + this.#removePendingDigest(analysis.result?.digest); + } if (this.#state.settings?.remainingTransactions !== null && this.#state.settings) { this.#state.settings.remainingTransactions += 1; @@ -283,12 +281,16 @@ export class AutoApprovalManager { this.#revertCoinFlows(analysis); } - #revertCoinFlows(analysis: AutoApprovalAnalysis): void { + #revertCoinFlows(analysis: AutoApprovalResult): void { if (!this.#state.settings) { throw new Error('No auto-approval settings configured'); } - for (const outflow of analysis.results.coinFlows) { + if (!analysis.result) { + throw new Error('Transaction analysis failed'); + } + + for (const outflow of analysis.result.coinFlows.outflows) { if (this.#state.settings?.coinBudgets[outflow.coinType] !== undefined) { const currentBudget = BigInt(this.#state.settings?.coinBudgets[outflow.coinType] ?? '0'); const newBalance = currentBudget + outflow.amount; @@ -298,7 +300,7 @@ export class AutoApprovalManager { throw new Error('No budget available for coin type ' + outflow.coinType); } - const coinValue = analysis.results.coinValues.coinTypes.find( + const coinValue = analysis.result.coinValues.coinTypes.find( (ct) => ct.coinType === outflow.coinType, ); @@ -321,7 +323,7 @@ export class AutoApprovalManager { } applyTransactionEffects( - analysis: AutoApprovalAnalysis, + analysis: AutoApprovalResult, result: Experimental_SuiClientTypes.TransactionResponse, ): void { this.#removePendingDigest(result.digest); @@ -330,6 +332,10 @@ export class AutoApprovalManager { throw new Error('No auto-approval settings configured'); } + if (!analysis.result) { + throw new Error('Transaction analysis failed'); + } + // Revert coin flows and use real balance changes instead this.#revertCoinFlows(analysis); @@ -345,7 +351,7 @@ export class AutoApprovalManager { throw new Error('No budget available for coin type ' + change.coinType); } - const coinValue = analysis.results.coinValues.coinTypes.find( + const coinValue = analysis.result.coinValues.coinTypes.find( (ct) => ct.coinType === change.coinType, ); diff --git a/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts b/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts index 0ea10b417..46424d3b3 100644 --- a/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts +++ b/packages/wallet-sdk/src/transaction-analyzer/analyzer.ts @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/ban-types */ import { Transaction } from '@mysten/sui/transactions'; +import type { Defined, Simplify, UnionToIntersection } from '../util.js'; export function createAnalyzer< T extends Defined, @@ -132,13 +133,7 @@ export async function analyze = { [K in keyof T]: T[K] } & {}; -type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void - ? I - : never; - -type Analyzer< +export type Analyzer< T extends Defined, Options = object, Analysis extends Record = {}, diff --git a/packages/wallet-sdk/src/transaction-analyzer/index.ts b/packages/wallet-sdk/src/transaction-analyzer/index.ts index 070e35eed..e4b026ccd 100644 --- a/packages/wallet-sdk/src/transaction-analyzer/index.ts +++ b/packages/wallet-sdk/src/transaction-analyzer/index.ts @@ -1,4 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -// TODO: figure out exports +export { analyze, createAnalyzer } from './analyzer.js'; +export type { AnalyzerResult, TransactionAnalysisIssue } from './analyzer.js'; + +export type { AnalyzedCoin } from './rules/coins.js'; +export type { AnalyzedCommandArgument, AnalyzedCommand } from './rules/commands.js'; +export type { AnalyzedObject } from './rules/objects.js'; +export type { CoinFlow } from './rules/coin-flows.js'; +export type { CoinValueAnalyzerOptions, CoinValueAnalysis } from './rules/coin-value.js'; +export type { AnalyzedCommandInput } from './rules/inputs.js'; + +export { analyzers } from './rules/index.js'; diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts index 6eae922d1..c2ae968c3 100644 --- a/packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/coin-value.ts @@ -26,7 +26,7 @@ export interface CoinValueAnalysis { }[]; } -export const coinValue = createAnalyzer({ +export const coinValues = createAnalyzer({ dependencies: { coinFlows }, analyze: ({ getCoinPrices }: CoinValueAnalyzerOptions) => diff --git a/packages/wallet-sdk/src/transaction-analyzer/rules/index.ts b/packages/wallet-sdk/src/transaction-analyzer/rules/index.ts new file mode 100644 index 000000000..d1e74bcdb --- /dev/null +++ b/packages/wallet-sdk/src/transaction-analyzer/rules/index.ts @@ -0,0 +1,32 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { accessLevel } from './accessLevel.js'; +import { coinFlows } from './coin-flows.js'; +import { coinValues } from './coin-value.js'; +import { coins, gasCoins } from './coins.js'; +import { commands } from './commands.js'; +import { balanceChanges, bytes, data, digest, transactionResponse } from './core.js'; +import { moveFunctions } from './functions.js'; +import { inputs } from './inputs.js'; +import { objectIds, objects, objectsById, ownedObjects } from './objects.js'; + +export const analyzers = { + accessLevel, + balanceChanges, + bytes, + coinFlows, + coins, + coinValues, + commands, + data, + digest, + transactionResponse, + gasCoins, + inputs, + moveFunctions, + objectIds, + objects, + objectsById, + ownedObjects, +}; diff --git a/packages/wallet-sdk/src/util.ts b/packages/wallet-sdk/src/util.ts new file mode 100644 index 000000000..e89b05fff --- /dev/null +++ b/packages/wallet-sdk/src/util.ts @@ -0,0 +1,11 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +/* eslint-disable @typescript-eslint/ban-types */ + +export type Defined = {} | null; +export type Simplify = { [K in keyof T]: T[K] } & {}; +export type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ( + k: infer I, +) => void + ? I + : never; diff --git a/packages/wallet-sdk/test/auto-approvals/manager.test.ts b/packages/wallet-sdk/test/auto-approvals/manager.test.ts index d2a86d21f..2442f799b 100644 --- a/packages/wallet-sdk/test/auto-approvals/manager.test.ts +++ b/packages/wallet-sdk/test/auto-approvals/manager.test.ts @@ -1,16 +1,15 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +import { describe, test, expect } from 'vitest'; import { Transaction } from '@mysten/sui/transactions'; import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'; import { + analyze, + autoApprovalAnalyzer, AutoApprovalManager, AutoApprovalPolicy, - CoinValueAnalysis, - createCoinValueAnalyzer, operationType, - operationTypeAnalyzer, - TransactionAnalyzer, } from '../../src'; import { getFullnodeUrl, SuiClient } from '@mysten/sui/client'; import { MIST_PER_SUI } from '@mysten/sui/utils'; @@ -28,24 +27,25 @@ const policy: AutoApprovalPolicy = { }; describe('AutoApprovalManager', () => { - describe('placeholder example', async () => { + test.skip('placeholder example', async () => { const keypair = new Ed25519Keypair(); const client = new SuiClient({ url: getFullnodeUrl('testnet') }); const tx = new Transaction(); tx.add(operationType('test-operation')); - const txJson = await tx.toJSON({ client }); - - const analysis = await TransactionAnalyzer.create<{ - operationType: string | null; - usdValue: CoinValueAnalysis; - }>(client, txJson, { - operationType: operationTypeAnalyzer, - usdValue: createCoinValueAnalyzer({ + const transactionJson = await tx.toJSON({ client }); + + const { analysis } = await analyze( + { + analysis: autoApprovalAnalyzer, + }, + { + transactionJson, + client, getCoinPrices: async (types) => types.map((coinType) => ({ coinType, decimals: 9, price: 2.5 })), - }), - }).analyze(); + }, + ); const manager = new AutoApprovalManager({ policy: JSON.stringify(policy), @@ -66,6 +66,7 @@ describe('AutoApprovalManager', () => { coinBudgets: { 'sui:0x2::sui::SUI': String(10n * MIST_PER_SUI), }, + sharedBudget: null, }); expect(manager.checkTransaction(analysis).canAutoApprove).toEqual(true); @@ -73,11 +74,15 @@ describe('AutoApprovalManager', () => { // deduct balances manager.commitTransaction(analysis); - const { signature } = await keypair.signTransaction(analysis.results.bytes); + if (!analysis.result) { + throw new Error('Transaction analysis failed'); + } + + const { signature } = await keypair.signTransaction(analysis.result.bytes); try { var { transaction } = await client.core.executeTransaction({ - transaction: analysis.results.bytes, + transaction: analysis.result?.bytes, signatures: [signature], }); } catch (e) { diff --git a/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts b/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts index f06d9c0a9..e87d494d1 100644 --- a/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts +++ b/packages/wallet-sdk/test/transaction-analyzer/coin-value.test.ts @@ -4,7 +4,7 @@ import { describe, it, expect } from 'vitest'; import { Transaction } from '@mysten/sui/transactions'; import { analyze } from '../../src/transaction-analyzer/analyzer'; -import { coinValue } from '../../src/transaction-analyzer/rules/coin-value'; +import { coinValues } from '../../src/transaction-analyzer/rules/coin-value.js'; import { MockSuiClient } from '../mocks/MockSuiClient'; import { DEFAULT_SENDER, @@ -62,7 +62,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { tx.transferObjects([suiSplit, usdcSplit, wethSplit], tx.pure.address('0x456')); const results = await analyze( - { coinValue }, + { coinValues }, { client, transaction: await tx.toJSON(), @@ -71,7 +71,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { ); // Verify coin value analysis - expect(results.coinValue.result).toMatchInlineSnapshot(` + expect(results.coinValues.result).toMatchInlineSnapshot(` { "coinTypes": [ { @@ -109,7 +109,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { // Empty transaction - no coin flows except gas budget const results = await analyze( - { coinValue }, + { coinValues }, { client, transaction: await tx.toJSON(), @@ -118,7 +118,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { ); // Should have no value calculations for empty transaction - expect(results.coinValue.result).toEqual({ + expect(results.coinValues.result).toEqual({ coinTypes: [ { coinType: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI', @@ -155,7 +155,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { tx.transferObjects([suiSplit, unknownCoin], tx.pure.address('0x456')); const results = await analyze( - { coinValue }, + { coinValues }, { client, transaction: await tx.toJSON(), @@ -164,7 +164,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { ); // Should track coins without prices separately - expect(results.coinValue.result?.coinTypesWithoutPrice).toContain( + expect(results.coinValues.result?.coinTypesWithoutPrice).toContain( '0x0000000000000000000000000000000000000000000000000000000000000999::unknown::TOKEN', ); }); @@ -183,7 +183,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { tx.transferObjects([suiSplit], tx.pure.address('0x456')); const results = await analyze( - { coinValue }, + { coinValues }, { client, transaction: await tx.toJSON(), @@ -191,7 +191,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { }, ); - expect(results.coinValue.result).toMatchInlineSnapshot(` + expect(results.coinValues.result).toMatchInlineSnapshot(` { "coinTypes": [ { @@ -233,7 +233,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { tx.transferObjects([suiSplit, usdcSplit, unknownCoin], tx.pure.address('0x456')); const results = await analyze( - { coinValue }, + { coinValues }, { client, transaction: await tx.toJSON(), @@ -242,7 +242,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { ); // Should have mixed results - some with prices, some without - expect(results.coinValue.result?.coinTypesWithoutPrice).toContain( + expect(results.coinValues.result?.coinTypesWithoutPrice).toContain( '0x0000000000000000000000000000000000000000000000000000000000000999::unknown::TOKEN', ); }); @@ -263,7 +263,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { // Should handle the error gracefully by returning issues const results = await analyze( - { coinValue }, + { coinValues }, { client, transaction: await tx.toJSON(), @@ -271,9 +271,9 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { }, ); - expect(results.coinValue.issues).toBeDefined(); - expect(results.coinValue.result).toBeUndefined(); - expect(results.coinValue.issues).toMatchInlineSnapshot(` + expect(results.coinValues.issues).toBeDefined(); + expect(results.coinValues.result).toBeUndefined(); + expect(results.coinValues.issues).toMatchInlineSnapshot(` [ { "message": "Unexpected error while analyzing transaction: Price provider unavailable", @@ -294,7 +294,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { tx.transferObjects([suiSplit], tx.pure.address(DEFAULT_SENDER)); const results = await analyze( - { coinValue }, + { coinValues }, { client, transaction: await tx.toJSON(), @@ -303,7 +303,7 @@ describe('TransactionAnalyzer - Coin Value Rule', () => { ); // Should have no value calculation since coins weren't actually spent - expect(results.coinValue.result?.total).toBe(0.025); - expect(results.coinValue.result?.coinTypes).toHaveLength(1); + expect(results.coinValues.result?.total).toBe(0.025); + expect(results.coinValues.result?.coinTypes).toHaveLength(1); }); }); From c32ba9c67de7256deab21a316b0464ecececf4dd Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Mon, 6 Oct 2025 13:11:59 -0700 Subject: [PATCH 35/36] Add demo --- AGENTS.md | 24 + packages/wallet-sdk/AUTO_APPROVALS.md | 123 ++++ packages/wallet-sdk/AUTO_APPROVALS_GUIDE.md | 503 ++++++++++++++ .../wallet-sdk/examples/demo-app/.gitignore | 28 + .../examples/demo-app/.prettierignore | 4 + .../wallet-sdk/examples/demo-app/README.md | 56 ++ .../wallet-sdk/examples/demo-app/index.html | 13 + .../examples/demo-app/move/counter/Move.lock | 34 + .../examples/demo-app/move/counter/Move.toml | 10 + .../move/counter/sources/counter.move | 36 + .../examples/demo-app/move/nft/Move.lock | 34 + .../examples/demo-app/move/nft/Move.toml | 10 + .../demo-app/move/nft/sources/demo_nft.move | 106 +++ .../wallet-sdk/examples/demo-app/package.json | 41 ++ .../testnet/automatic-approval-policy.json | 105 +++ .../demo-app/scripts/analyze-unused-code.ts | 596 ++++++++++++++++ .../wallet-sdk/examples/demo-app/src/App.tsx | 28 + .../examples/demo-app/src/DemoApp.tsx | 140 ++++ .../app/components/layout/NetworkSwitcher.tsx | 84 +++ .../demo-app/src/app/components/ui/Alert.tsx | 51 ++ .../demo-app/src/app/components/ui/Button.tsx | 42 ++ .../demo-app/src/app/components/ui/Card.tsx | 41 ++ .../app/components/ui/ConnectWalletPrompt.tsx | 26 + .../src/app/components/ui/DemoLayout.tsx | 18 + .../demo-app/src/app/components/ui/Input.tsx | 64 ++ .../src/app/components/ui/LabelWithValue.tsx | 18 + .../demo-app/src/app/components/ui/Modal.tsx | 58 ++ .../demo-app/src/app/constants/networks.ts | 33 + .../src/app/contracts/counter/counter.ts | 82 +++ .../app/contracts/counter/deps/sui/object.ts | 14 + .../src/app/contracts/demo_nft/demo_nft.ts | 190 +++++ .../app/contracts/demo_nft/deps/sui/object.ts | 14 + .../demo-app/src/app/contracts/utils/index.ts | 168 +++++ .../src/app/demos/counter/CounterDemo.tsx | 206 ++++++ .../src/app/demos/counter/transactions.ts | 90 +++ .../src/app/demos/nft/NFTMintDemo.tsx | 352 ++++++++++ .../src/app/demos/nft/transactions.ts | 37 + .../src/app/demos/transfer/TransferDemo.tsx | 394 +++++++++++ .../src/app/demos/transfer/transactions.ts | 201 ++++++ .../src/app/demos/wallet/WalletDemo.tsx | 222 ++++++ .../src/app/demos/walrus/WalrusDemo.tsx | 432 ++++++++++++ .../src/app/demos/walrus/transactions.ts | 55 ++ .../demo-app/src/app/hooks/useCoinBalances.ts | 89 +++ .../demo-app/src/app/hooks/useLocalStorage.ts | 72 ++ .../src/app/hooks/useNetworkConfig.ts | 30 + .../demo-app/src/app/hooks/useOwnedObjects.ts | 78 +++ .../src/app/hooks/useTransactionExecution.ts | 53 ++ .../demo-app/src/app/hooks/useTransferForm.ts | 58 ++ .../src/app/hooks/useWalletAccounts.ts | 55 ++ .../src/app/hooks/useWalrusBalances.ts | 61 ++ .../examples/demo-app/src/app/types/coins.ts | 15 + .../demo-app/src/app/types/network.ts | 9 + .../examples/demo-app/src/app/types/wallet.ts | 7 + .../examples/demo-app/src/app/utils/format.ts | 28 + .../demo-app/src/components/CopyableText.tsx | 65 ++ .../examples/demo-app/src/dApp-kit.ts | 63 ++ .../examples/demo-app/src/hooks/useCopy.ts | 23 + .../examples/demo-app/src/index.css | 19 + .../wallet-sdk/examples/demo-app/src/main.tsx | 12 + .../examples/demo-app/src/vite-env.d.ts | 1 + .../wallet/components/core/AccountInfo.tsx | 274 ++++++++ .../src/wallet/components/core/DemoWallet.tsx | 13 + .../wallet/components/core/DemoWalletUI.tsx | 115 +++ .../policy/PolicyApprovalScreen.tsx | 171 +++++ .../components/policy/PolicyOperation.tsx | 188 +++++ .../policy/PolicyPermissionDisplay.tsx | 117 ++++ .../policy/PolicyRuleErrorBoundary.tsx | 52 ++ .../policy/PolicyRuleSetSelector.tsx | 178 +++++ .../components/policy/PolicySettings.tsx | 340 +++++++++ .../components/signing/AccountDisplay.tsx | 45 ++ .../signing/AutoApprovalCountdown.tsx | 96 +++ .../signing/PolicyStatusMessage.tsx | 113 +++ .../components/signing/SigningActions.tsx | 57 ++ .../components/signing/SigningHeader.tsx | 99 +++ .../components/signing/SigningModal.tsx | 159 +++++ .../signing/TransactionApprovalModal.tsx | 151 ++++ .../components/signing/TransactionContent.tsx | 31 + .../signing/transaction/AutoApprovalTab.tsx | 252 +++++++ .../signing/transaction/CommandsTab.tsx | 236 +++++++ .../signing/transaction/DebugTab.tsx | 284 ++++++++ .../signing/transaction/InputsTab.tsx | 190 +++++ .../signing/transaction/OverviewTab.tsx | 209 ++++++ .../transaction/TransactionDetails.tsx | 82 +++ .../src/wallet/components/ui/BalancesList.tsx | 226 ++++++ .../wallet/components/ui/ConfirmDialog.tsx | 49 ++ .../wallet/components/ui/NetworkSelector.tsx | 51 ++ .../demo-app/src/wallet/constants/icons.ts | 21 + .../demo-app/src/wallet/core/DemoWallet.ts | 365 ++++++++++ .../demo-app/src/wallet/hooks/useAnalysis.ts | 78 +++ .../src/wallet/hooks/useAutoApproval.ts | 173 +++++ .../src/wallet/hooks/useWalletAccount.ts | 166 +++++ .../src/wallet/policies/operations.ts | 57 ++ .../src/wallet/providers/WalletProvider.tsx | 116 ++++ .../demo-app/src/wallet/utils/format.ts | 28 + .../demo-app/src/wallet/utils/storage.ts | 16 + .../demo-app/src/wallet/utils/suiClients.ts | 21 + .../examples/demo-app/sui-codegen.config.ts | 20 + .../examples/demo-app/tsconfig.json | 25 + .../examples/demo-app/tsconfig.node.json | 11 + .../demo-app/unused-code-analysis.json | 188 +++++ .../examples/demo-app/vite.config.ts | 10 + packages/wallet-sdk/test/manager.test.ts | 653 ++++++++++++++++++ 102 files changed, 11247 insertions(+) create mode 100644 AGENTS.md create mode 100644 packages/wallet-sdk/AUTO_APPROVALS.md create mode 100644 packages/wallet-sdk/AUTO_APPROVALS_GUIDE.md create mode 100644 packages/wallet-sdk/examples/demo-app/.gitignore create mode 100644 packages/wallet-sdk/examples/demo-app/.prettierignore create mode 100644 packages/wallet-sdk/examples/demo-app/README.md create mode 100644 packages/wallet-sdk/examples/demo-app/index.html create mode 100644 packages/wallet-sdk/examples/demo-app/move/counter/Move.lock create mode 100644 packages/wallet-sdk/examples/demo-app/move/counter/Move.toml create mode 100644 packages/wallet-sdk/examples/demo-app/move/counter/sources/counter.move create mode 100644 packages/wallet-sdk/examples/demo-app/move/nft/Move.lock create mode 100644 packages/wallet-sdk/examples/demo-app/move/nft/Move.toml create mode 100644 packages/wallet-sdk/examples/demo-app/move/nft/sources/demo_nft.move create mode 100644 packages/wallet-sdk/examples/demo-app/package.json create mode 100644 packages/wallet-sdk/examples/demo-app/public/.well-known/sui/testnet/automatic-approval-policy.json create mode 100644 packages/wallet-sdk/examples/demo-app/scripts/analyze-unused-code.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/App.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/DemoApp.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/layout/NetworkSwitcher.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/Alert.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/Button.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/Card.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/ConnectWalletPrompt.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/DemoLayout.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/Input.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/LabelWithValue.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/components/ui/Modal.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/constants/networks.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/counter.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/deps/sui/object.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/demo_nft.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/deps/sui/object.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/contracts/utils/index.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/counter/CounterDemo.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/counter/transactions.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/nft/NFTMintDemo.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/nft/transactions.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/transfer/TransferDemo.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/transfer/transactions.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/wallet/WalletDemo.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/walrus/WalrusDemo.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/demos/walrus/transactions.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useCoinBalances.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useLocalStorage.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useNetworkConfig.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useOwnedObjects.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useTransactionExecution.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useTransferForm.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useWalletAccounts.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/hooks/useWalrusBalances.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/types/coins.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/types/network.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/types/wallet.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/app/utils/format.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/components/CopyableText.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/dApp-kit.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/hooks/useCopy.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/index.css create mode 100644 packages/wallet-sdk/examples/demo-app/src/main.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/vite-env.d.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/core/AccountInfo.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/core/DemoWallet.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/core/DemoWalletUI.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/policy/PolicyApprovalScreen.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/policy/PolicyOperation.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/policy/PolicyPermissionDisplay.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/policy/PolicyRuleErrorBoundary.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/policy/PolicyRuleSetSelector.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/policy/PolicySettings.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/AccountDisplay.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/AutoApprovalCountdown.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/PolicyStatusMessage.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/SigningActions.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/SigningHeader.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/SigningModal.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/TransactionApprovalModal.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/TransactionContent.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/transaction/AutoApprovalTab.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/transaction/CommandsTab.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/transaction/DebugTab.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/transaction/InputsTab.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/transaction/OverviewTab.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/signing/transaction/TransactionDetails.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/ui/BalancesList.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/ui/ConfirmDialog.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/components/ui/NetworkSelector.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/constants/icons.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/core/DemoWallet.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/hooks/useAnalysis.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/hooks/useAutoApproval.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/hooks/useWalletAccount.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/policies/operations.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/providers/WalletProvider.tsx create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/utils/format.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/utils/storage.ts create mode 100644 packages/wallet-sdk/examples/demo-app/src/wallet/utils/suiClients.ts create mode 100644 packages/wallet-sdk/examples/demo-app/sui-codegen.config.ts create mode 100644 packages/wallet-sdk/examples/demo-app/tsconfig.json create mode 100644 packages/wallet-sdk/examples/demo-app/tsconfig.node.json create mode 100644 packages/wallet-sdk/examples/demo-app/unused-code-analysis.json create mode 100644 packages/wallet-sdk/examples/demo-app/vite.config.ts create mode 100644 packages/wallet-sdk/test/manager.test.ts diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..d063bc573 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,24 @@ +# AGENTS.md + +## Build/Test/Lint Commands +- `pnpm build` - Build all packages with Turbo +- `pnpm test` - Run unit tests for all packages +- `pnpm --filter @mysten/sui vitest run path/to/test.spec.ts` - Run single test file +- `pnpm lint` - Check ESLint + Prettier +- `pnpm lint:fix` - Auto-fix linting issues +- `pnpm changeset` - Add changeset for version updates + +## Architecture +- **Monorepo**: TypeScript SDKs for Sui blockchain, uses pnpm workspaces + Turbo +- **Core packages**: typescript/ (main SDK), dapp-kit/ (React hooks), wallet-standard/, signers/ (AWS/GCP KMS, Ledger) +- **Services**: deepbook/ (DEX), suins/ (name service), zksend/, walrus/ +- **Build**: ESM/CJS outputs to `dist/`, dependency-aware builds via Turbo +- **Tests**: Vitest for unit tests, separate e2e configs, Docker for integration tests + +## Code Style +- **Headers**: Apache-2.0 license headers required (`header/header` rule) +- **Imports**: Consistent type imports (`@typescript-eslint/consistent-type-imports`), require extensions +- **TypeScript**: Strict typing, no `any` in production, prefer `type` imports +- **Naming**: Underscore prefix for unused vars (`argsIgnorePattern: '^_'`) +- **Modules**: Subpath exports pattern (`@mysten/sui/client`, `@mysten/sui/bcs`) +- **No Buffer**: Banned in packages for web compatibility diff --git a/packages/wallet-sdk/AUTO_APPROVALS.md b/packages/wallet-sdk/AUTO_APPROVALS.md new file mode 100644 index 000000000..52315124f --- /dev/null +++ b/packages/wallet-sdk/AUTO_APPROVALS.md @@ -0,0 +1,123 @@ +# Wallet Auto-Approval System + +The Wallet Auto-Approval System enables users to authorize automatic signing of specific transaction +types, reducing friction for trusted applications while maintaining security and user control + +## Overview + +This system provides a standard implementation for wallets to automatically approve transactions +based on predefined policies. It consists of three main components: + +- **AutoApprovalPolicy**: Application-hosted policies defining approved transaction types +- **AutoApprovalManager**: SDK class for policy management and transaction evaluation +- **AutoApprovalIntent**: Optional hints from applications about which policy rule sets to apply + +## Architecture + +### Policy Discovery + +Applications host their `AutoApprovalPolicy` at: + +``` +/.well-known/sui/automatic-approval-policy.json +``` + +This well-known location enables wallets to discover policies without requiring explicit +advertising, making policies easier to mange for wallets, easier to audit and harder to change +frequently or generate dynamically to target specific users. + +### Policy Structure + +An `AutoApprovalPolicy` contains: + +- **ruleSets**: Collections of rules describing allowed asset interactions +- **suggestedSettings**: Recommended user configurations (budgets, limits, etc.) +- **defaultRuleSet**: Must be null - auto-approvals require explicit rule set selection + +### Rule Types + +Each ruleset specifies rules for different asset access patterns: + +- **ownedObjects**: Access to specific object types the user owns +- **sessionCreatedObjects**: Access to objects created during the current session +- **balances**: Access to specific coin type balances +- **allBalances**: Access to all coin balances + +### Policy Settings + +User-controlled limits applied to approved policies. These are controlled by the wallet and can be +configured by the user. + +- **remainingTransactions**: Maximum transactions per session +- **expiration**: Session expiration timestamp +- **approvedRuleSets**: Currently active rulesets +- **usdBudget**: USD spending limit across all coins +- **coinBudgets**: Per-coin-type spending limits + +## Usage Flow + +1. **Transaction Construction**: Applications build transactions normally, adding + `tx.add(autoApproval(ruleSetId))` to request auto-approval with a specific rule set + +2. **Policy Evaluation**: Wallet loads the AutoApprovalManager and analyzes the transaction against + current policy state + +3. **Auto-Approval Decision**: If approved, wallet signs automatically; otherwise, falls back to + standard user confirmation + +4. **State Updates**: On signing, the manager deducts balances and policy settings. After execution, + transaction effects can be applied to track new objects and increase balances in the policy + settings. + +## Implementation + +### AutoApprovalManager Class + +The core SDK class manages policy state and transaction analysis: + +```typescript +class AutoApprovalManager { + constructor(options: AutoApprovalManagerOptions); + analyzeTransaction(tx: Transaction): Promise; + commitTransaction(analysis: TransactionAnalysis): void; + applyTransactionEffects(analysis: TransactionAnalysis, effects: TransactionEffects): void; + update(policy: AutoApprovalPolicy, settings: AutoApprovalPolicySettings): void; + approve(): void; + reset(): void; + export(): string; +} +``` + +### State Management + +The manager maintains an `AutoApprovalState` tracking: + +- Current policy and settings +- Balance changes and transaction history +- Created objects from approved transactions +- Approved and pending transaction digests + +## Design Decisions + +### Limited API Surface + +Applications have no visibility into auto-approval state, ensuring: + +- Simple adoption (just publish a policy) +- Compatibility with non-supporting wallets +- Graceful degradation when users opt out + +### User Control + +All limits and permissions remain under user control: + +- Policies only describe what _may_ be auto-approved +- Users set actual budgets and transaction limits +- Access can be revoked at any time without breaking functionality + +### Security + +Well-known policy locations and structured rules provide: + +- Auditability of application intentions +- Protection against dynamic policy manipulation diff --git a/packages/wallet-sdk/AUTO_APPROVALS_GUIDE.md b/packages/wallet-sdk/AUTO_APPROVALS_GUIDE.md new file mode 100644 index 000000000..799f12318 --- /dev/null +++ b/packages/wallet-sdk/AUTO_APPROVALS_GUIDE.md @@ -0,0 +1,503 @@ +# Wallet Automatic Approvals + +Wallet automatic approvals (auto-approvals) will enable users and applications to securely opt into +auto-approval of specific types of transactions with user-defined limits and budgets. + +## Demo + +https://github.com/user-attachments/assets/4f7b0973-770a-4eec-89d4-e7776237b696 + +## Goals + +- A standard, not just a bespoke wallet-specific feature + - This is important for broader ecosystem adoption! + - Solve problems across all wallets, but also give wallets headroom to choose what they’ll + automatically approve. +- Layered on top of the existing transaction approval flow, so that it’s as simple as possible for + dapps to integrate. + - Our goal is for most dapps to be compatible with this! + - Auto-approvals is not a separate feature, but works as part of the existing signing flows + - Should require minimal app code changes to enable auto-approvals +- For any given transaction, even if it is valid for the automatic approval, a wallet may still + choose to display the user with an approval prompt. +- Completely opt-in on the user side, with no effect on the app when the user opts in or out + +## How It Works + +**Applications Define Their Operations**: Understanding the intent behind a Transaction is a hard +problem. Rather than wallets guessing what a transaction does, applications will publish a policy +that describes the different types of operations it might perform, and what types of assets those +operations use. A game might declare that it performs "character moves" that require gas fees and +modify player objects. A DEX might declare that it performs "token swaps" using any coin type. These +policies are public, auditable, and serve as contracts with users about what the application will +do. + +**Wallets Detect Policies**: Wallets will detect when an application has configured an auto-approval +policy, and may prompt the user to enable auto-approvals. It is up to each wallet to decide how and +when to implement this flow, but could be done when the user is first prompted for a transaction +covered by the auto-approval policy. + +**Users Configure Settings They Control**: When the wallet prompts a user to opt into +auto-approvals, they will be presented with descriptions of the different operations an application +supports, and what assets they need to access. They can select what operations are auto approved, as +well as what limits to enforce on those operations. They might allow 100 game moves using up to 1 +SUI for gas, expiring after 2 hours. Or 50 token swaps up to $500 total value, expiring after their +trading session. These limits are enforced by the wallet, not the application, ensuring no +application can exceed what users have approved. + +**Wallets Determine What Gets Auto-Approved**: Applications simply request signatures on +transactions through the existing wallet-standard methods, and won't know if the user is using +auto-approvals. The wallet can evaluate if the transaction matches the application's policy and if +the user's settings would allow the transaction to be automatically approved. If the policy and +settings allow for auto-approval, the wallet may automatically sign the transaction. + +## How Applications Support Auto-Approvals + +Applications support auto-approvals through two simple steps: publishing a policy document and +tagging their transactions with an operation type. + +The system is intentionally designed so that applications have no knowledge of whether +auto-approvals are enabled, and instead applications always provide wallets enough information to +enable auto-approvals if the user opts in. Applications don't need to check for support, handle +different code paths, or worry about compatibility. They simply publish their policy, tag their +transactions, and let wallets handle everything else. This clean separation of concerns means +applications can adopt auto-approvals with confidence that they won't break anything for existing +users. + +### Creating Policy Documents + +The policy document is a JSON file that describes the different types of operations an application +performs. Each operation represents a category of transactions that share similar characteristics - +for example, "game actions", "marketplace trades", or "governance votes". The policy tells wallets +what objects transactions need to access, what coins they might spend, and how they interact with +the blockchain. + +When designing operations, applications consider how users interact with them. They group related +actions together when they require similar permissions, but separate them when users might want +different approval settings. For instance, they might separate "gameplay" operations from +"marketplace" operations, since users might be comfortable auto-approving routine game moves but +want to manually approve each marketplace transaction. + +The permissions applications declare should be as specific as possible while still covering their +needs. If a game only needs to modify the player's character object, it should only declare that +specific object type. If it only spends SUI for gas, it should only declare SUI rather than using +`anyBalance`. This specificity helps users trust the application and makes them more likely to +enable auto-approvals. + +
+Example: Complete Policy Structure + +```json +{ + "schemaVersion": "1.0.0", + "operations": [ + { + "id": "gameplay", + "name": "Gameplay Actions", + "description": "Regular gameplay actions like moving, attacking, and using items", + "autoApprovalEnabled": true, + "permissions": { + // Coins needed for transactions + "balances": [ + { + "$kind": "CoinBalance", + "coinType": "0x2::sui::SUI", + "description": "Gas fees for gameplay transactions" + } + ], + + // Objects the user owns that we need to access + "ownedObjects": [ + { + "$kind": "ObjectType", + "objectType": "0xgame::character::Character", + "accessLevel": "mutate", + "description": "Update character stats and position" + }, + { + "$kind": "ObjectType", + "objectType": "0xgame::inventory::Item", + "accessLevel": "transfer", + "description": "Use and trade items from inventory" + } + ] + } + }, + { + "id": "marketplace", + "name": "Marketplace Trading", + "description": "Buy and sell items on the marketplace", + "autoApprovalEnabled": false, + "permissions": { + // Can use any coin type for marketplace transactions + "anyBalance": { + "$kind": "AnyBalance", + "description": "Use any token for marketplace purchases" + }, + + "ownedObjects": [ + { + "$kind": "ObjectType", + "objectType": "0xgame::marketplace::Listing", + "accessLevel": "transfer", + "description": "Create and manage marketplace listings" + } + ] + } + } + ] +} +``` + +
+ +
+Operation Fields Explained + +Each operation in your policy includes several required and optional fields: + +- **`id`**: A unique identifier for the operation type (e.g., "gameplay", "marketplace") +- **`name`**: A short, human-readable name displayed in wallet UI (e.g., "Gameplay Actions") +- **`description`**: A detailed explanation of what this operation does +- **`autoApprovalEnabled`**: Whether this operation supports automatic approvals + - Set to `true` for operations users might want to auto-approve (routine gameplay, simple transfers) + - Set to `false` for operations that should always require manual approval (high-value trades, admin functions) + - This allows you to document all your application's operations while only enabling auto-approvals for appropriate ones +- **`permissions`**: The blockchain permissions this operation requires (detailed below) + +Applications should set `autoApprovalEnabled: false` for sensitive operations like: +- High-value financial transactions +- Administrative or governance actions +- Operations that modify critical user settings +- One-time setup operations + +
+ +
+Permission Types Explained + +```json +{ + "permissions": { + // balances: Specific coin types your transactions use + "balances": [ + { + "$kind": "CoinBalance", + "coinType": "0x2::sui::SUI", // Full type name + "description": "Human-readable explanation" + } + ], + + // anyBalance: For apps that work with any coin type (DEXes, marketplaces) + "anyBalance": { + "$kind": "AnyBalance", + "description": "Why you need any coin type" + }, + + // ownedObjects: Objects the user owns that you need to access + "ownedObjects": [ + { + "$kind": "ObjectType", + "objectType": "0xpackage::module::Type", + "accessLevel": "read", // Pass by reference (&T) to Move functions + "accessLevel": "mutate", // Pass by mutable reference (&mut T) to Move functions + "accessLevel": "transfer", // Pass by value (T) to Move functions + "description": "What you do with this object" + } + ] + } +} +``` + +
+ +### Hosting Policies + +Once applications have created their policy document, they need to host it at a well-known location +where wallets can find it. The URL pattern is standardized so wallets know exactly where to look +without any configuration or registration process. The policy should be served as a static file - it +shouldn't be dynamically generated or personalized per user. Wallets may cache policies, or fetch +policies through their own backends to prevent serving policies tailored to specific users. + +The URL follows this pattern: +`https://yourdomain.com/.well-known/sui/{network}/automatic-approval-policy.json` + +Applications must serve their policy with appropriate CORS headers to allow wallets to fetch it. +Some wallets may be web-based and need to fetch policies from their own origin. + +### Tagging Transactions + +The final step in supporting auto-approvals is tagging transactions with the appropriate operation +ID and an optional description. This is done using the `operationType` function, which adds a +special intent to the transaction that tells wallets which operation from the policy this +transaction represents. + +The description parameter allows applications to provide specific context about what the +individual transaction is doing within the broader operation type. This is particularly useful +for operations that handle multiple types of actions. For example, a "walrus-operations" +operation type might handle both "Register blob" and "Certify blob" transactions - the +description helps users understand exactly what's happening in each step. + +
+Example: Adding Operation Type to Transaction + +```typescript +import { Transaction, operationType } from '@mysten/sui/transactions'; + +// Basic usage - just operation ID +const tx = new Transaction(); +tx.add(operationType('gameplay')); +tx.add(contract.doAction(params)); + +// With description for specific context +const registerTx = new Transaction(); +registerTx.add(operationType('walrus-operations', 'Register blob')); +registerTx.add(walrus.register(params)); + +const certifyTx = new Transaction(); +certifyTx.add(operationType('walrus-operations', 'Certify blob')); +certifyTx.add(walrus.certify(params)); +``` + +
+ +The tagging process is completely transparent to wallets that don't support auto-approvals. The tags +are automatically stripped out before being sent to any wallet that does not advertise supporting +the intent, so the transaction executes normally without any compatibility issues. + +--- + +## How Auto-Approvals Work for Users + +The specific flows used to enable and configure automatic approvals are up to each wallet, but they +should be an entirely optional enhancement to the normal transaction signing flows users are already +familiar with. When users encounter an application that supports auto-approvals, they see the same +signing dialogs they're used to, with the option to enable auto-approvals if they choose. Users can +completely ignore the feature and continue using their wallet exactly as before, or they can opt in +when they want the convenience of automatic signing for trusted applications. + +Core functionality any auto-approval implementation should support: + +- Detecting when an application has an auto-approval policy +- An Auto approval opt in flow for configuring the auto-approval settings + - Users should see clear descriptions of the assets each operation needs to access + - This may be part of connect, transaction signing, or some other settings view in the wallet + - Settings should allow configuring: + - what operations can be auto-approved + - budgets for specific coin types + - budgets in some normalized currency (eg, USD) + - expiration for the policy +- A UI for when transactions are being auto-approved + - This may include a countdown and cancel button +- A very easy way to disable and opt out of auto-approvals + - This may also include a way to edit the existing auto-approval settings + +## How Wallets Implement Auto-Approvals + +Because the application side of auto-approvals is very simple, wallets do not need to use any +specific libraries or standards to support auto approvals, but we are releasing a new +`@mysten/wallet-sdk` package which will include tools that significantly simplify the +implementation. + +The wallet SDK includes two main components to help with auto approvals: the TransactionAnalyzer for +understanding transactions, and the AutoApprovalManager for managing state and policy enforcement. +These components work together to provide an easy-to-use foundation to build auto-approvals on. + +### Transaction Analysis + +The TransactionAnalyzer examines transactions to understand what they do, what objects they access, +how they use coins, and what operation type they represent. The output of this analysis is an object +with normalized and easy to use data representing all the different aspects of a Transaction. It is +intended to be used as the foundation for all Transaction approval flows that show users what a +transaction does. + +The analyzer is designed to be extended with custom data. While it comes with comprehensive built-in +analyzers for understanding transaction structure, coin flows, and object access patterns, you can +add your own analyzers for wallet-specific needs. For auto-approvals, the base analyzer is extended +with the `operationTypeAnalyzer` to extract the operation type that applications embed in +transactions, and the `coinValueAnalyzer` to calculate coin values in a normalized currency for +budget tracking. + +
+Example: Basic Transaction Analysis + +```typescript +import { + TransactionAnalyzer, + operationTypeAnalyzer, + createCoinValueAnalyzer, +} from '@mysten/wallet-sdk'; + +async function analyzeTransaction( + client: SuiClient, + transactionJson: string, // From wallet-standard's transaction.toJSON() +) { + // Create the analyzer with the specific analyzers you need + const analyzer = TransactionAnalyzer.create(client, transactionJson, { + // Extract operation type for auto-approvals + operationType: operationTypeAnalyzer, + + // Calculate USD values for budget tracking + coinValues: createCoinValueAnalyzer({ + getCoinPrices: async (coinTypes) => { + // Integrate with your price feed service + // This example returns mock prices + return coinTypes.map((type) => ({ + coinType: type, + decimals: 9, + price: type.includes('SUI') ? 2.5 : 1.0, + })); + }, + }), + }); + + // Run the analysis + const { results, issues } = await analyzer.analyze(); + + // Check for any issues during analysis + if (issues.length > 0) { + console.warn('Transaction analysis issues:', issues); + // Handle or display issues to user + } + + return { results, issues }; +} +``` + +
+ +The TransactionAnalyzer should handle all data-loading and async work required to analyze and +display a transaction, including building the transaction to bytes. This pattern guarantees that the +analysis that determines if a Transaction can be auto approved is run against a fully resolved +Transaction with fixed object versions, and will be the exact transaction that is eventually +executed. Co-locating all the data loading should also enable batching and caching of certain +lookups. + +### The AutoApprovalManager + +The AutoApprovalManager is the brain of the auto-approval system. It's a fully synchronous state +machine that manages everything related to auto-approvals for a specific application. When you +create a manager instance, you provide it with the application's policy and any previously saved +state for the application. + +The manager handles policy evaluation, budget tracking, and user settings. The manager has a few +core methods: + +- `getSettings()`: Gets the user's settings +- `updateSettings()`: Updates the user's settings +- `reset()`: Clears the user's settings and state +- `export()`: Exports the manager state as a string +- `checkTransaction(analysis)`: Checks the transaction against the application's policy and the + user's settings, returning detailed information about any issues +- `commitTransaction(analysis)`: Updates the user's budgets and settings with the predicted effects + of the transaction +- `revertTransaction(analysis)`: Reverts the changes from a commitTransaction +- `applyTransactionEffects(analysis, result)`: Reverts the predicted effects, and applies the real + effects of a transaction + +##### User Settings + +The AutoApprovalManager maintains user settings, which are the user-configured preferences that +control when transactions can be auto-approved. The current settings include: + +- **Approved Operations**: Which operation types from the policy can be auto-approved +- **Expiration**: When the auto-approval session expires (as a timestamp) +- **Remaining Transactions**: How many more transactions can be auto-approved (null for unlimited) +- **Coin Budgets**: Maximum amounts per coin type that can be spent (stored as string to handle + large numbers) +- **Shared Budget**: Shared budget in a standardized currency (eg USD), this budget is only used + when there is no specific budgets for a coinType. + +
+Example: Settings Structure + +```typescript +interface AutoApprovalSettings { + approvedOperations: string[]; // ["gameplay", "marketplace"] + expiration: number; // Unix timestamp + remainingTransactions: number | null; // 100 or null for unlimited + coinBudgets: Record; // { "0x2::sui::SUI": "1000000000" } + sharedBudget: number | null; // 12.34 or null to only support specific coin budgets +} +``` + +
+ +Settings are updated in three ways: + +1. When users initially configure auto-approvals through the wallet UI +2. When users modify existing settings (changing limits, extending expiration) +3. Automatically modified when transactions are executed to adjust things like remaining + transactions and budget + +##### Persistence and Recovery + +The manager's state should be persisted after making changes to settings, invoking methods like +`commitTransaction` or `applyTransactionEffects` that mutate th managers state. The `export()` and +constructor methods handle serialization and deserialization: + +
+Example: State Persistence + +```typescript +// Save state after any changes +function saveManagerState(manager: AutoApprovalManager, origin: string, network: string) { + localStorage.setItem(`auto-approval-${origin}-${network}`, manager.export()); +} + +// Create manager with persisted state +const manager = new AutoApprovalManager({ + policy: policyJson, + state: localStorage.getItem(`auto-approval-${origin}-${network}`), +}); +``` + +
+ +
+Example: Complete Auto-Approval Flow + +```typescript +async function handleTransactionRequest( + request: WalletStandardSignRequest, + manager: AutoApprovalManager, + client: SuiClient, +) { + // Step 1: Analyze the transaction + const transactionJson = await request.transaction.toJSON(); + const analysis = await analyzeTransaction(client, transactionJson); + + // Step 2: Check auto-approval eligibility + const check = manager.checkTransaction(analysis); + + // Step 3: Handle auto-approval if eligible + if (check.canAutoApprove) { + return await executeAutoApproval(manager, analysis, request.account); + } + + // Step 4: Offer to configure/update settings if transaction matches policy + if (check.matchesPolicy && !check.canAutoApprove) { + const settings = await showSettingsDialog( + manager.getState().policy, + analysis.results.operationType, + manager.getSettings(), // Pass existing settings, if set + ); + + if (settings) { + manager.updateSettings(settings); + saveManagerState(manager, origin, network); + + // Re-check with new settings + const newCheck = manager.checkTransaction(analysis); + if (newCheck.canAutoApprove) { + return await executeAutoApproval(manager, analysis, request.account); + } + } + } + + // Step 5: Fall back to manual approval + return await showManualApprovalDialog(analysis, check); +} +``` + +
diff --git a/packages/wallet-sdk/examples/demo-app/.gitignore b/packages/wallet-sdk/examples/demo-app/.gitignore new file mode 100644 index 000000000..963e8645c --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/.gitignore @@ -0,0 +1,28 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# Move build artifacts +**/build/ +package_summaries/ \ No newline at end of file diff --git a/packages/wallet-sdk/examples/demo-app/.prettierignore b/packages/wallet-sdk/examples/demo-app/.prettierignore new file mode 100644 index 000000000..9d6f6417c --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/.prettierignore @@ -0,0 +1,4 @@ +dist/ +node_modules/ +*.min.js +*.map \ No newline at end of file diff --git a/packages/wallet-sdk/examples/demo-app/README.md b/packages/wallet-sdk/examples/demo-app/README.md new file mode 100644 index 000000000..42d80cd56 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/README.md @@ -0,0 +1,56 @@ +# Wallet SDK Demo App + +This demo app showcases two key components side by side: + +1. **Demo Wallet**: A simple wallet implementation based on the wallet-standard that shows what + transactions are being signed and allows approve/reject actions +2. **Demo dApp**: A counter example app that uses dapp-kit-react to interact with the wallet + +## Features + +### Demo Wallet + +- Creates an in-browser wallet using Ed25519 keypair +- Registers with the wallet-standard +- Shows signing requests with details +- Allows users to approve or reject transactions +- Displays the wallet address + +### Demo dApp + +- Simple counter application +- Uses dapp-kit-react hooks +- Creates, increments, and resets a counter +- Demonstrates wallet connectivity + +## Development + +```bash +# Install dependencies +pnpm install + +# Start development server +pnpm dev + +# Build for production +pnpm build +``` + +## Configuration + +To use the counter functionality, update the `COUNTER_PACKAGE_ID` constant in `src/DemoApp.tsx` with +your deployed counter package ID. + +## Architecture + +The demo uses: + +- Vite for bundling +- React for UI +- @mysten/dapp-kit for dApp functionality +- @mysten/wallet-standard for wallet implementation +- @radix-ui/themes for styling +- @tanstack/react-query for data fetching + +The wallet implementation shows a placeholder for future wallet-sdk integration, with a UI that +displays what users are signing before approving transactions. diff --git a/packages/wallet-sdk/examples/demo-app/index.html b/packages/wallet-sdk/examples/demo-app/index.html new file mode 100644 index 000000000..46a3aa532 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/index.html @@ -0,0 +1,13 @@ + + + + + + + Wallet SDK Demo App + + +
+ + + diff --git a/packages/wallet-sdk/examples/demo-app/move/counter/Move.lock b/packages/wallet-sdk/examples/demo-app/move/counter/Move.lock new file mode 100644 index 000000000..3465605b2 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/move/counter/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "08D7316957B1A037CF595F048A68951A7170111D758800E544B4CE2943ED9D97" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.51.1" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x58a6d7dccd124b7e0bb9756dc309f5d5b9e2bc38a05261177970e96d0d3911f1" +latest-published-id = "0x58a6d7dccd124b7e0bb9756dc309f5d5b9e2bc38a05261177970e96d0d3911f1" +published-version = "1" diff --git a/packages/wallet-sdk/examples/demo-app/move/counter/Move.toml b/packages/wallet-sdk/examples/demo-app/move/counter/Move.toml new file mode 100644 index 000000000..03eace71d --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/move/counter/Move.toml @@ -0,0 +1,10 @@ +[package] +name = "counter" +version = "0.0.1" +edition = "2024.beta" + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } + +[addresses] +counter = "0x0" \ No newline at end of file diff --git a/packages/wallet-sdk/examples/demo-app/move/counter/sources/counter.move b/packages/wallet-sdk/examples/demo-app/move/counter/sources/counter.move new file mode 100644 index 000000000..65308b721 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/move/counter/sources/counter.move @@ -0,0 +1,36 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// This example demonstrates a basic use of a shared object. +/// Rules: +/// - anyone can create and share a counter +/// - everyone can increment a counter by 1 +/// - the owner of the counter can reset it to any value +module counter::counter { + /// A shared counter. + public struct Counter has key { + id: UID, + owner: address, + value: u64 + } + + /// Create and share a Counter object. + public fun create(ctx: &mut TxContext) { + transfer::share_object(Counter { + id: object::new(ctx), + owner: ctx.sender(), + value: 0 + }) + } + + /// Increment a counter by 1. + public fun increment(counter: &mut Counter) { + counter.value = counter.value + 1; + } + + /// Set value (only runnable by the Counter owner) + public fun set_value(counter: &mut Counter, value: u64, ctx: &TxContext) { + assert!(counter.owner == ctx.sender(), 0); + counter.value = value; + } +} \ No newline at end of file diff --git a/packages/wallet-sdk/examples/demo-app/move/nft/Move.lock b/packages/wallet-sdk/examples/demo-app/move/nft/Move.lock new file mode 100644 index 000000000..216156c4c --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/move/nft/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "F0CC03EB9EC0446C5FE44F05CA7F4FEECD91B48F2DD80421C14961E93A1F2372" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[[move.package]] +id = "MoveStdlib" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/move-stdlib" } + +[[move.package]] +id = "Sui" +source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" } + +dependencies = [ + { id = "MoveStdlib", name = "MoveStdlib" }, +] + +[move.toolchain-version] +compiler-version = "1.51.1" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x1ae7832d6ad190aa4c8d6a36dd014d8383246428fb27590262b8648fcec62ca0" +latest-published-id = "0x1ae7832d6ad190aa4c8d6a36dd014d8383246428fb27590262b8648fcec62ca0" +published-version = "1" diff --git a/packages/wallet-sdk/examples/demo-app/move/nft/Move.toml b/packages/wallet-sdk/examples/demo-app/move/nft/Move.toml new file mode 100644 index 000000000..7b8f71a76 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/move/nft/Move.toml @@ -0,0 +1,10 @@ +[package] +name = "demo_nft" +version = "0.0.1" +edition = "2024.beta" + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } + +[addresses] +demo_nft = "0x0" \ No newline at end of file diff --git a/packages/wallet-sdk/examples/demo-app/move/nft/sources/demo_nft.move b/packages/wallet-sdk/examples/demo-app/move/nft/sources/demo_nft.move new file mode 100644 index 000000000..37fe02f54 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/move/nft/sources/demo_nft.move @@ -0,0 +1,106 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/// A demo NFT contract with Display configuration for the Sui demo app +module demo_nft::demo_nft; + +use std::string::{Self, String}; +use sui::display; +use sui::package; + +/// An example NFT that can be minted by anyone +public struct DemoNFT has key, store { + id: UID, + name: String, + description: String, + image_url: String, + creator: address, +} + +/// One-Time-Witness for the module +public struct DEMO_NFT has drop {} + +/// Module initializer called once on publish +fun init(otw: DEMO_NFT, ctx: &mut TxContext) { + let keys = vector[ + string::utf8(b"name"), + string::utf8(b"description"), + string::utf8(b"image_url"), + string::utf8(b"creator"), + string::utf8(b"project_url"), + ]; + + let values = vector[ + string::utf8(b"{name}"), + string::utf8(b"{description}"), + string::utf8(b"{image_url}"), + string::utf8(b"Created by {creator}"), + string::utf8(b"https://sui-demo-app.vercel.app"), + ]; + + let publisher = package::claim(otw, ctx); + let mut display = display::new_with_fields( + &publisher, + keys, + values, + ctx, + ); + + // Update the display with additional standard fields + display.update_version(); + + transfer::public_transfer(publisher, ctx.sender()); + transfer::public_transfer(display, ctx.sender()); +} + +/// Mint a new DemoNFT +public fun mint_nft( + name: String, + description: String, + image_url: String, + recipient: address, + ctx: &mut TxContext, +) { + let nft = DemoNFT { + id: object::new(ctx), + name, + description, + image_url, + creator: ctx.sender(), + }; + + transfer::public_transfer(nft, recipient); +} + +/// Public function to mint NFT with strings (for easier frontend integration) +public fun mint( + name: String, + description: String, + image_url: String, + ctx: &mut TxContext, +) { + mint_nft(name, description, image_url, ctx.sender(), ctx) +} + +// Getter functions for the NFT fields +public fun name(nft: &DemoNFT): &String { + &nft.name +} + +public fun description(nft: &DemoNFT): &String { + &nft.description +} + +public fun image_url(nft: &DemoNFT): &String { + &nft.image_url +} + +public fun creator(nft: &DemoNFT): address { + nft.creator +} + +/// Burn an NFT +public fun burn(nft: DemoNFT, _: &mut TxContext) { + let DemoNFT { id, name: _, description: _, image_url: _, creator: _ } = nft; + object::delete(id) +} diff --git a/packages/wallet-sdk/examples/demo-app/package.json b/packages/wallet-sdk/examples/demo-app/package.json new file mode 100644 index 000000000..6dd115f97 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/package.json @@ -0,0 +1,41 @@ +{ + "name": "@mysten/wallet-sdk-demo-app", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "codegen": "sui-ts-codegen generate && pnpm lint:fix", + "analyze-unused": "bun run scripts/analyze-unused-code.ts", + "cleanup-unused": "bun run scripts/analyze-unused-code.ts --cleanup", + "cleanup-unused-files": "bun run scripts/analyze-unused-code.ts --files-only", + "prettier:check": "prettier -c --ignore-unknown .", + "prettier:fix": "prettier -w --ignore-unknown .", + "eslint:check": "eslint --max-warnings=0 .", + "eslint:fix": "pnpm run eslint:check --fix", + "lint": "pnpm run eslint:check && pnpm run prettier:check", + "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix" + }, + "dependencies": { + "@mysten/dapp-kit-react": "workspace:*", + "@mysten/sui": "workspace:*", + "@mysten/wallet-sdk": "workspace:*", + "@mysten/wallet-standard": "workspace:*", + "@mysten/walrus": "workspace:*", + "@radix-ui/themes": "^3.1.6", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@mysten/codegen": "workspace:*", + "@tailwindcss/vite": "^4.1.13", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react-swc": "^3.11.0", + "tailwindcss": "^4.1.11", + "typescript": "^5.9.2", + "vite": "^7.1.5" + } +} diff --git a/packages/wallet-sdk/examples/demo-app/public/.well-known/sui/testnet/automatic-approval-policy.json b/packages/wallet-sdk/examples/demo-app/public/.well-known/sui/testnet/automatic-approval-policy.json new file mode 100644 index 000000000..62817926d --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/public/.well-known/sui/testnet/automatic-approval-policy.json @@ -0,0 +1,105 @@ +{ + "schemaVersion": "1.0.0", + "operations": [ + { + "id": "basic-transfers", + "name": "Basic Transfers", + "description": "Allow basic SUI and coin transfers to any address", + "autoApprovalEnabled": true, + "permissions": { + "balances": [ + { + "$kind": "CoinBalance", + "description": "Allow SUI transfers to any address", + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI" + } + ] + } + }, + { + "id": "counter-operations", + "name": "Counter Operations", + "description": "Allow interactions with demo counter smart contracts", + "autoApprovalEnabled": true, + "permissions": { + "balances": [ + { + "$kind": "CoinBalance", + "description": "Allow SUI for gas fees", + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI" + } + ], + "ownedObjects": [ + { + "$kind": "ObjectType", + "description": "Allow counter object interactions", + "objectType": "0x58a6d7dccd124b7e0bb9756dc309f5d5b9e2bc38a05261177970e96d0d3911f1::counter::Counter", + "accessLevel": "mutate" + } + ] + } + }, + { + "id": "nft-operations", + "name": "NFT Operations", + "description": "Allow NFT minting, transfers, and marketplace interactions", + "autoApprovalEnabled": true, + "permissions": { + "balances": [ + { + "$kind": "CoinBalance", + "description": "Allow SUI for gas fees", + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI" + }, + { + "$kind": "CoinBalance", + "description": "Allow WAL token transfers for storage operations", + "coinType": "0x8270feb7375eee355e64fdb69c50abb6b5f9393a722883c1cf45f8e26048810a::wal::WAL" + } + ], + "ownedObjects": [ + { + "$kind": "ObjectType", + "description": "Allow demo NFT interactions", + "objectType": "0x1ae7832d6ad190aa4c8d6a36dd014d8383246428fb27590262b8648fcec62ca0::nft::DemoNFT", + "accessLevel": "transfer" + }, + { + "$kind": "ObjectType", + "description": "Allow interactions with Walrus Blob objects", + "objectType": "0xd84704c17fc870b8764832c535aa6b11f21a95cd6f5bb38a9b07d2cf42220c66::blob::Blob", + "accessLevel": "mutate" + } + ] + } + }, + { + "id": "walrus-operations", + "name": "Walrus Storage", + "description": "Allow interactions with Walrus decentralized storage", + "autoApprovalEnabled": true, + "permissions": { + "balances": [ + { + "$kind": "CoinBalance", + "description": "Allow SUI payments for gas fees", + "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI" + }, + { + "$kind": "CoinBalance", + "description": "Allow WAL token transfers for storage operations", + "coinType": "0x8270feb7375eee355e64fdb69c50abb6b5f9393a722883c1cf45f8e26048810a::wal::WAL" + } + ], + "ownedObjects": [ + { + "$kind": "ObjectType", + "description": "Allow interactions with Walrus Blob objects", + "objectType": "0xd84704c17fc870b8764832c535aa6b11f21a95cd6f5bb38a9b07d2cf42220c66::blob::Blob", + "accessLevel": "mutate" + } + ] + } + } + ] +} diff --git a/packages/wallet-sdk/examples/demo-app/scripts/analyze-unused-code.ts b/packages/wallet-sdk/examples/demo-app/scripts/analyze-unused-code.ts new file mode 100644 index 000000000..853339817 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/scripts/analyze-unused-code.ts @@ -0,0 +1,596 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** + * Comprehensive unused code analyzer for the demo app + * + * This script: + * 1. Parses all TypeScript/JavaScript files to extract imports and exports + * 2. Builds a dependency graph to identify unused files and exports + * 3. Provides detailed analysis and recommendations for manual cleanup + * + * Usage: + * npx tsx scripts/analyze-unused-code.ts # Analysis only + * bun run scripts/analyze-unused-code.ts # Analysis only (Bun) + */ + +import fs from 'fs'; +import path from 'path'; + +// Configuration +const ROOT_DIR = process.cwd(); +const SRC_DIR = path.join(ROOT_DIR, 'src'); +const ANALYSIS_OUTPUT_FILE = path.join(ROOT_DIR, 'unused-code-analysis.json'); + +// File patterns to analyze +const FILE_PATTERNS = /\.(ts|tsx|js|jsx)$/; +const IGNORE_PATTERNS = [ + /node_modules/, + /\.d\.ts$/, + /dist/, + /build/, + /coverage/, + /\.test\./, + /\.spec\./, + /vite-env\.d\.ts$/, + /contracts\/.*\.(ts|tsx)$/, // Generated contract code +]; + +// Entry points that should never be considered unused +const ENTRY_POINTS = [ + 'src/main.tsx', + 'src/App.tsx', + 'src/DemoApp.tsx', + 'src/index.css', + 'vite.config.ts', + 'tsconfig.json', +]; + +interface FileInfo { + path: string; + size: number; + exports: Set; + imports: Map>; +} + +class CodeAnalyzer { + private files = new Map(); + private dependencyGraph = new Map>(); + private usedFiles = new Set(); + private usedExports = new Map>(); + private unusedFiles = new Set(); + private unusedExports = new Map>(); + + /** + * Main analysis function + */ + async analyze(): Promise { + console.log('🔍 Starting comprehensive code analysis...\n'); + + this.discoverFiles(); + this.parseFiles(); + this.buildDependencyGraph(); + this.identifyUnused(); + this.generateReport(); + this.saveResults(); + } + + /** + * Discover all analyzable files + */ + private discoverFiles(): void { + console.log('📁 Discovering files...'); + const allFiles = this.walkDirectory(SRC_DIR); + console.log(` Found ${allFiles.length} files to analyze\n`); + } + + /** + * Walk directory recursively to find files + */ + private walkDirectory(dir: string): string[] { + const files: string[] = []; + + try { + const entries = fs.readdirSync(dir, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + const relativePath = path.relative(ROOT_DIR, fullPath); + + if (this.shouldIgnore(relativePath)) continue; + + if (entry.isDirectory()) { + files.push(...this.walkDirectory(fullPath)); + } else if (entry.isFile() && FILE_PATTERNS.test(entry.name)) { + files.push(relativePath); + } + } + } catch (error) { + console.warn(` ⚠️ Could not read directory ${dir}:`, (error as Error).message); + } + + return files; + } + + /** + * Check if file should be ignored + */ + private shouldIgnore(filePath: string): boolean { + return IGNORE_PATTERNS.some((pattern) => pattern.test(filePath)); + } + + /** + * Parse all discovered files + */ + private parseFiles(): void { + console.log('📖 Parsing imports and exports...'); + + const allFiles = this.walkDirectory(SRC_DIR); + + for (const file of allFiles) { + this.parseFile(file); + } + + console.log(` Parsed ${this.files.size} files\n`); + } + + /** + * Parse individual file for imports and exports + */ + private parseFile(filePath: string): void { + try { + const content = fs.readFileSync(path.join(ROOT_DIR, filePath), 'utf8'); + const size = new TextEncoder().encode(content).length; + const exports = this.extractExports(content); + const imports = this.extractImports(content, filePath); + + this.files.set(filePath, { + path: filePath, + size, + exports, + imports, + }); + } catch (error) { + console.warn(` ⚠️ Could not parse ${filePath}:`, (error as Error).message); + } + } + + /** + * Extract exports from file content + */ + private extractExports(content: string): Set { + const exports = new Set(); + + // Remove comments and strings to avoid false matches + const cleanContent = this.removeCommentsAndStrings(content); + + // Export patterns + const patterns = [ + // Named exports: export { foo, bar } + /export\s*{([^}]+)}/g, + // Direct exports: export const foo = ..., export function foo(), etc. + /export\s+(?:const|let|var|function|class|interface|type|enum)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g, + // Default export with name: export default function foo() + /export\s+default\s+(?:function|class)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g, + ]; + + for (const pattern of patterns) { + let match; + while ((match = pattern.exec(cleanContent)) !== null) { + if (match[1]) { + // Handle comma-separated exports in braces + if (pattern.source.includes('{')) { + const exportNames = match[1] + .split(',') + .map((name) => name.trim().replace(/\s+as\s+.+/, '')); + exportNames.forEach((name) => { + if (name && !name.includes('*')) { + exports.add(name.trim()); + } + }); + } else { + exports.add(match[1].trim()); + } + } + } + } + + // Check for default exports + if (/export\s+default/g.test(cleanContent)) { + exports.add('default'); + } + + return exports; + } + + /** + * Extract imports from file content + */ + private extractImports(content: string, currentFile: string): Map> { + const imports = new Map>(); + const cleanContent = this.removeCommentsAndStrings(content); + + // Import patterns (with multiline support) + const patterns = [ + // import type { foo, bar } from 'module' + /import\s+type\s*{([^}]+)}\s*from\s*['"`]([^'"`]+)['"`]/gm, + // import { foo, bar } from 'module' + /import\s*{([^}]+)}\s*from\s*['"`]([^'"`]+)['"`]/gm, + // import foo from 'module' + /import\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*from\s*['"`]([^'"`]+)['"`]/gm, + // import * as foo from 'module' + /import\s*\*\s*as\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*from\s*['"`]([^'"`]+)['"`]/gm, + // import 'module' (side effect) + /import\s*['"`]([^'"`]+)['"`]/gm, + ]; + + for (const pattern of patterns) { + let match; + while ((match = pattern.exec(cleanContent)) !== null) { + let modulePath: string; + let importedItems: string[] = []; + + if (pattern.source.includes('{')) { + // Named imports + importedItems = match[1] + .split(',') + .map((item) => item.trim().replace(/\s+as\s+.+/, '')) + .filter((item) => item && !item.includes('*')); + modulePath = match[2]; + } else if (pattern.source.includes('\\*\\s*as')) { + // Namespace import + importedItems = ['*']; + modulePath = match[2]; + } else if (match[2]) { + // Default import + importedItems = ['default']; + modulePath = match[2]; + } else { + // Side effect import + importedItems = ['*']; // Mark as using the whole module + modulePath = match[1]; + } + + const resolvedPath = this.resolveImportPath(modulePath, currentFile); + if (resolvedPath) { + if (!imports.has(resolvedPath)) { + imports.set(resolvedPath, new Set()); + } + importedItems.forEach((item) => imports.get(resolvedPath)!.add(item)); + } + } + } + + return imports; + } + + /** + * Remove comments and strings from content to avoid false matches + */ + private removeCommentsAndStrings(content: string): string { + // Remove single line comments + content = content.replace(/\/\/.*$/gm, ''); + // Remove multi-line comments + content = content.replace(/\/\*[\s\S]*?\*\//g, ''); + + // Remove strings but preserve import/export module paths + // First, protect import/export statements by marking them + const protectedStatements: string[] = []; + let protectedIndex = 0; + + // Protect import statements + content = content.replace(/(import[\s\S]*?from\s*['"`][^'"`]+['"`])/g, (match) => { + const placeholder = `__IMPORT_${protectedIndex}__`; + protectedStatements[protectedIndex] = match; + protectedIndex++; + return placeholder; + }); + + // Protect export statements + content = content.replace(/(export[\s\S]*?from\s*['"`][^'"`]+['"`])/g, (match) => { + const placeholder = `__EXPORT_${protectedIndex}__`; + protectedStatements[protectedIndex] = match; + protectedIndex++; + return placeholder; + }); + + // Now remove other strings + content = content.replace(/'([^'\\]|\\.)*'/g, '""'); + content = content.replace(/"([^"\\]|\\.)*"/g, '""'); + content = content.replace(/`([^`\\]|\\.)*`/g, '""'); + + // Restore protected statements + for (let i = 0; i < protectedStatements.length; i++) { + content = content.replace(`__IMPORT_${i}__`, protectedStatements[i]); + content = content.replace(`__EXPORT_${i}__`, protectedStatements[i]); + } + + return content; + } + + /** + * Resolve import path to actual file path + */ + private resolveImportPath(importPath: string, currentFile: string): string | null { + // Skip external modules + if (!importPath.startsWith('.')) { + return null; + } + + const currentDir = path.dirname(currentFile); + let resolvedPath = path.resolve(ROOT_DIR, currentDir, importPath); + + // Convert to relative path from root + resolvedPath = path.relative(ROOT_DIR, resolvedPath); + + // Strategy 1: Direct file match + if (fs.existsSync(path.join(ROOT_DIR, resolvedPath))) { + return resolvedPath; + } + + // Strategy 2: Replace .js/.jsx with .ts/.tsx (common in TS projects) + if (resolvedPath.endsWith('.js') || resolvedPath.endsWith('.jsx')) { + const basePath = resolvedPath.replace(/\.(js|jsx)$/, ''); + const tsExtensions = ['.ts', '.tsx']; + + for (const ext of tsExtensions) { + const tsPath = basePath + ext; + if (fs.existsSync(path.join(ROOT_DIR, tsPath))) { + return tsPath; + } + } + } + + // Strategy 3: Try common extensions + const extensions = ['.ts', '.tsx', '.js', '.jsx']; + for (const ext of extensions) { + const withExt = resolvedPath + ext; + if (fs.existsSync(path.join(ROOT_DIR, withExt))) { + return withExt; + } + } + + // Strategy 4: Check for index files + const indexFiles = ['index.ts', 'index.tsx', 'index.js', 'index.jsx']; + for (const indexFile of indexFiles) { + const indexPath = path.join(resolvedPath, indexFile); + if (fs.existsSync(path.join(ROOT_DIR, indexPath))) { + return indexPath; + } + } + + return null; + } + + /** + * Build dependency graph from imports + */ + private buildDependencyGraph(): void { + console.log('🔗 Building dependency graph...'); + + for (const [filePath, fileInfo] of this.files) { + const deps = new Set(); + + for (const [importedFile] of fileInfo.imports) { + if (this.files.has(importedFile)) { + deps.add(importedFile); + } + } + + this.dependencyGraph.set(filePath, deps); + } + + console.log(' Dependency graph built\n'); + } + + /** + * Identify unused files and exports + */ + private identifyUnused(): void { + console.log('🎯 Identifying unused code...'); + + // Mark entry points as used + // Mark entry points as used + for (const entryPoint of ENTRY_POINTS) { + if (this.files.has(entryPoint)) { + this.markFileAsUsed(entryPoint); + } + } + + // Find unused files + for (const filePath of this.files.keys()) { + if (!this.usedFiles.has(filePath)) { + this.unusedFiles.add(filePath); + } + } + + // Find unused exports + for (const [filePath, fileInfo] of this.files) { + const usedExportsInFile = this.usedExports.get(filePath) || new Set(); + const unusedExportsInFile = new Set(); + + for (const exportName of fileInfo.exports) { + if (!usedExportsInFile.has(exportName)) { + unusedExportsInFile.add(exportName); + } + } + + if (unusedExportsInFile.size > 0) { + this.unusedExports.set(filePath, unusedExportsInFile); + } + } + } + + /** + * Recursively mark file and its dependencies as used + */ + private markFileAsUsed(filePath: string): void { + if (this.usedFiles.has(filePath)) return; + + this.usedFiles.add(filePath); + + const fileInfo = this.files.get(filePath); + if (!fileInfo) return; + + // Mark imports as used + for (const [importedFile, importedItems] of fileInfo.imports) { + if (this.files.has(importedFile)) { + this.markFileAsUsed(importedFile); + + // Mark specific exports as used + if (!this.usedExports.has(importedFile)) { + this.usedExports.set(importedFile, new Set()); + } + + const usedExportsInFile = this.usedExports.get(importedFile)!; + for (const item of importedItems) { + if (item === '*') { + // Import * means all exports are used + const importedFileInfo = this.files.get(importedFile); + if (importedFileInfo) { + for (const exp of importedFileInfo.exports) { + usedExportsInFile.add(exp); + } + } + } else { + usedExportsInFile.add(item); + } + } + } + } + } + + /** + * Generate comprehensive report + */ + private generateReport(): void { + const totalFiles = this.files.size; + const unusedFilesCount = this.unusedFiles.size; + const filesWithUnusedExports = Array.from(this.unusedExports.keys()).length; + const totalUnusedExports = Array.from(this.unusedExports.values()).reduce( + (sum, exports) => sum + exports.size, + 0, + ); + + console.log('📊 ANALYSIS RESULTS'); + console.log('==================\n'); + + console.log('📈 SUMMARY:'); + console.log(` Total files analyzed: ${totalFiles}`); + console.log(` Unused files: ${unusedFilesCount}`); + console.log(` Files with unused exports: ${filesWithUnusedExports}`); + console.log(` Total unused exports: ${totalUnusedExports}\n`); + + // Show unused files + if (this.unusedFiles.size > 0) { + console.log('🗑️ UNUSED FILES:'); + const sortedUnusedFiles = Array.from(this.unusedFiles).sort(); + sortedUnusedFiles.forEach((file, index) => { + const fileInfo = this.files.get(file); + const sizeStr = fileInfo ? this.formatBytes(fileInfo.size) : 'unknown size'; + console.log(` ${index + 1}. ${file} (${sizeStr})`); + }); + console.log(''); + } + + // Show files with unused exports + if (this.unusedExports.size > 0) { + console.log('🔧 FILES WITH UNUSED EXPORTS:'); + const sortedFiles = Array.from(this.unusedExports.entries()).sort(([a], [b]) => + (a as string).localeCompare(b as string), + ); + + let exportIndex = 1; + for (const [file, exports] of sortedFiles) { + console.log(` 📄 ${file}:`); + const sortedExports = Array.from(exports).sort(); + for (const exportName of sortedExports) { + console.log(` ${exportIndex}. export { ${exportName} }`); + exportIndex++; + } + } + console.log(''); + } + + console.log('💡 RECOMMENDATIONS:'); + console.log('===================\n'); + console.log('⚠️ Review each unused file and export carefully before removal:'); + console.log(" 1. Check if it's part of a public API"); + console.log(" 2. Verify it's not used by external consumers"); + console.log(' 3. Consider if it provides future extensibility'); + console.log(" 4. Ensure tests don't depend on it\n"); + + console.log('🔄 MANUAL CLEANUP PROCESS:'); + console.log(' 1. Review the analysis results above'); + console.log(' 2. Remove files/exports that are truly unused'); + console.log(' 3. Run: bun run build'); + console.log(' 4. Run: bun run lint'); + console.log(' 5. Verify all tests pass'); + console.log(' 6. Re-run this analyzer to see improvements\n'); + } + + /** + * Format bytes to human readable format + */ + private formatBytes(bytes: number): string { + if (bytes === 0) return '0 bytes'; + const k = 1024; + const sizes = ['bytes', 'KB', 'MB']; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]; + } + + /** + * Save analysis results to JSON file + */ + private saveResults(): void { + const results = { + timestamp: new Date().toISOString(), + summary: { + totalFiles: this.files.size, + unusedFiles: this.unusedFiles.size, + filesWithUnusedExports: Array.from(this.unusedExports.keys()).length, + totalUnusedExports: Array.from(this.unusedExports.values()).reduce( + (sum, exports) => sum + exports.size, + 0, + ), + }, + unusedFiles: Array.from(this.unusedFiles).sort(), + unusedExports: Object.fromEntries( + Array.from(this.unusedExports.entries()) + .map(([file, exports]) => [file, Array.from(exports).sort()]) + .sort(([a], [b]) => (a as string).localeCompare(b as string)), + ), + dependencyGraph: Object.fromEntries( + Array.from(this.dependencyGraph.entries()) + .map(([file, deps]) => [file, Array.from(deps).sort()]) + .sort(([a], [b]) => (a as string).localeCompare(b as string)), + ), + }; + + fs.writeFileSync(ANALYSIS_OUTPUT_FILE, JSON.stringify(results, null, 2)); + console.log(`💾 Analysis results saved to: ${path.relative(ROOT_DIR, ANALYSIS_OUTPUT_FILE)}`); + } +} + +/** + * Main function - analysis only + */ +async function main(): Promise { + const analyzer = new CodeAnalyzer(); + + try { + await analyzer.analyze(); + } catch (error) { + console.error('💥 Analysis failed:', (error as Error).message); + console.error((error as Error).stack); + process.exit(1); + } +} + +// Run if called directly (works with both Node.js and Bun) +if ((import.meta as any).main || import.meta.url === `file://${process.argv[1]}`) { + main(); +} + +export { CodeAnalyzer }; diff --git a/packages/wallet-sdk/examples/demo-app/src/App.tsx b/packages/wallet-sdk/examples/demo-app/src/App.tsx new file mode 100644 index 000000000..a59d01f95 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/App.tsx @@ -0,0 +1,28 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { DAppKitProvider } from '@mysten/dapp-kit-react'; +import { Theme } from '@radix-ui/themes'; +import '@radix-ui/themes/styles.css'; +import { dAppKit } from './dApp-kit.js'; +import { DemoWallet } from './wallet/components/core/DemoWallet.js'; +import { DemoApp } from './DemoApp.js'; + +function App() { + return ( + + +
+ {/* Main App Content */} +
+ +
+ + {/* Demo Wallet */} + +
+
+
+ ); +} + +export default App; diff --git a/packages/wallet-sdk/examples/demo-app/src/DemoApp.tsx b/packages/wallet-sdk/examples/demo-app/src/DemoApp.tsx new file mode 100644 index 000000000..90ca826f3 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/DemoApp.tsx @@ -0,0 +1,140 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { ConnectButton } from '@mysten/dapp-kit-react'; +import { useState, useEffect } from 'react'; +import { CounterDemo } from './app/demos/counter/CounterDemo.js'; +import { TransferDemo } from './app/demos/transfer/TransferDemo.js'; +import { WalletDemo } from './app/demos/wallet/WalletDemo.js'; +import { NFTMintDemo } from './app/demos/nft/NFTMintDemo.js'; +import { WalrusDemo } from './app/demos/walrus/WalrusDemo.js'; +import { NetworkSwitcher } from './app/components/layout/NetworkSwitcher.js'; + +export type DemoTab = 'counter' | 'transfer' | 'wallet' | 'nft-mint' | 'walrus'; + +export interface DemoProps { + onNavigate?: (tab: DemoTab) => void; +} + +interface Demo { + id: DemoTab; + name: string; + description: string; + icon: string; + component: React.ComponentType; +} + +const DEMOS: Demo[] = [ + { + id: 'counter', + name: 'Counter', + description: 'On-chain counter with increment and reset', + icon: '🔢', + component: CounterDemo, + }, + { + id: 'transfer', + name: 'Transfer', + description: 'Send SUI tokens to other addresses', + icon: '💸', + component: TransferDemo, + }, + { + id: 'wallet', + name: 'Wallet', + description: 'View your balances and NFTs', + icon: '👛', + component: WalletDemo, + }, + { + id: 'nft-mint', + name: 'Mint NFT', + description: 'Create your own NFTs', + icon: '🎨', + component: NFTMintDemo, + }, + { + id: 'walrus', + name: 'Walrus', + description: 'Store files on Walrus and swap SUI for WAL tokens', + icon: '🐋', + component: WalrusDemo, + }, +]; + +export function DemoApp() { + const [activeTab, setActiveTab] = useState('counter'); + + // Read initial tab from URL hash + useEffect(() => { + const hash = window.location.hash.slice(1); // Remove the # character + const matchingDemo = DEMOS.find((demo) => demo.id === hash); + if (matchingDemo) { + setActiveTab(matchingDemo.id); + } + }, []); + + // Update URL hash when tab changes + const handleTabChange = (tabId: DemoTab) => { + setActiveTab(tabId); + window.history.replaceState(null, '', `#${tabId}`); + }; + + const activeDemo = DEMOS.find((demo) => demo.id === activeTab) || DEMOS[0]; + const ActiveComponent = activeDemo.component; + + return ( +
+ {/* Header */} +
+
+
+

Sui Demo Suite

+

+ Interactive demos showcasing Sui blockchain capabilities +

+
+
+ + +
+
+
+ + {/* Tab Navigation */} +
+ {DEMOS.map((demo) => ( + + ))} +
+ + {/* Demo Content */} +
+ {/* Demo Header */} +
+

+ {activeDemo.icon} {activeDemo.name} +

+

{activeDemo.description}

+
+ + {/* Demo Component */} +
+
+ +
+
+
+
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/layout/NetworkSwitcher.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/layout/NetworkSwitcher.tsx new file mode 100644 index 000000000..41201e95e --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/layout/NetworkSwitcher.tsx @@ -0,0 +1,84 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { useCurrentNetwork } from '@mysten/dapp-kit-react'; +import { dAppKit } from '../../../dApp-kit.js'; +import { useState, useRef, useEffect } from 'react'; +import type { NetworkName } from '../../constants/networks.js'; + +const NETWORKS: { value: NetworkName; label: string }[] = [ + { value: 'testnet', label: 'Testnet' }, + { value: 'mainnet', label: 'Mainnet' }, + { value: 'devnet', label: 'Devnet' }, +]; + +export function NetworkSwitcher() { + const currentNetwork = useCurrentNetwork(); + const [isOpen, setIsOpen] = useState(false); + const dropdownRef = useRef(null); + + useEffect(() => { + function handleClickOutside(event: MouseEvent) { + if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { + setIsOpen(false); + } + } + + document.addEventListener('mousedown', handleClickOutside); + return () => document.removeEventListener('mousedown', handleClickOutside); + }, []); + + const handleNetworkChange = (network: NetworkName) => { + try { + dAppKit.switchNetwork(network); + } catch (error) { + console.error('Error switching network:', error); + } + setIsOpen(false); + }; + + const currentNetworkLabel = + NETWORKS.find((n) => n.value === currentNetwork || `sui:${n.value}` === currentNetwork) + ?.label || 'Unknown'; + + return ( +
+ + + {isOpen && ( +
+ {NETWORKS.map((network) => { + const isSelected = + network.value === currentNetwork || `sui:${network.value}` === currentNetwork; + return ( + + ); + })} +
+ )} +
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Alert.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Alert.tsx new file mode 100644 index 000000000..4cd443642 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Alert.tsx @@ -0,0 +1,51 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +interface AlertProps { + type: 'error' | 'success' | 'warning' | 'info'; + message?: string; + children?: React.ReactNode; + onClose?: () => void; +} + +const alertVariants = { + error: { + container: 'bg-red-50 border-red-200 text-red-800', + icon: '⚠️', + }, + success: { + container: 'bg-green-50 border-green-200 text-green-800', + icon: '✅', + }, + warning: { + container: 'bg-orange-50 border-orange-200 text-orange-800', + icon: '⚠️', + }, + info: { + container: 'bg-blue-50 border-blue-200 text-blue-800', + icon: 'ℹ️', + }, +}; + +export function Alert({ type, message, children, onClose }: AlertProps) { + const variant = alertVariants[type]; + + return ( +
+ {variant.icon} +
+ {message &&
{message}
} + {children &&
{children}
} +
+ {onClose && ( + + )} +
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Button.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Button.tsx new file mode 100644 index 000000000..dff1a4088 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Button.tsx @@ -0,0 +1,42 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +interface ButtonProps extends React.ButtonHTMLAttributes { + variant?: 'primary' | 'secondary' | 'danger'; + size?: 'sm' | 'md' | 'lg'; + children: React.ReactNode; +} + +const variants = { + primary: 'bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white border-none', + secondary: 'bg-gray-100 hover:bg-gray-200 text-gray-700 border border-gray-300', + danger: 'bg-red-500 hover:bg-red-600 text-white border-none', +}; + +const sizes = { + sm: 'px-3 py-1.5 text-sm', + md: 'px-5 py-2.5', + lg: 'px-6 py-3 text-lg', +}; + +export function Button({ + variant = 'primary', + size = 'md', + className = '', + children, + disabled, + ...props +}: ButtonProps) { + const variantClasses = variants[variant]; + const sizeClasses = sizes[size]; + const disabledClasses = disabled ? 'disabled:cursor-not-allowed' : 'cursor-pointer'; + + const classes = + `${variantClasses} ${sizeClasses} ${disabledClasses} rounded font-medium transition-colors duration-200 ${className}`.trim(); + + return ( + + ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Card.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Card.tsx new file mode 100644 index 000000000..6326f5d93 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Card.tsx @@ -0,0 +1,41 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +interface CardProps { + children: React.ReactNode; + className?: string; + variant?: 'default' | 'elevated' | 'bordered' | 'highlighted'; +} + +const variants = { + default: 'bg-white border border-gray-200 rounded-lg', + elevated: 'bg-white rounded-lg shadow-lg', + bordered: 'bg-white border border-gray-300 rounded-lg', + highlighted: 'bg-green-50 border border-green-200 rounded-lg', +}; + +export function Card({ children, className = '', variant = 'default' }: CardProps) { + const cardClasses = `${variants[variant]} ${className}`.trim(); + + return
{children}
; +} + +export function CardHeader({ + children, + className = '', +}: { + children: React.ReactNode; + className?: string; +}) { + return
{children}
; +} + +export function CardContent({ + children, + className = '', +}: { + children: React.ReactNode; + className?: string; +}) { + return
{children}
; +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/ConnectWalletPrompt.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/ConnectWalletPrompt.tsx new file mode 100644 index 000000000..954caabf6 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/ConnectWalletPrompt.tsx @@ -0,0 +1,26 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { Card, CardContent } from './Card.js'; + +interface ConnectWalletPromptProps { + icon?: string; + title?: string; + description?: string; +} + +export function ConnectWalletPrompt({ + icon = '🔌', + title = 'Connect Your Wallet', + description = 'Please connect your wallet to use this demo', +}: ConnectWalletPromptProps) { + return ( + + +
{icon}
+

{title}

+

{description}

+
+
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/DemoLayout.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/DemoLayout.tsx new file mode 100644 index 000000000..67d8b4b05 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/DemoLayout.tsx @@ -0,0 +1,18 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +interface DemoLayoutProps { + children: React.ReactNode; + maxWidth?: 'sm' | 'md' | 'lg' | 'xl'; +} + +const maxWidthClasses = { + sm: 'max-w-2xl', + md: 'max-w-4xl', + lg: 'max-w-6xl', + xl: 'max-w-7xl', +}; + +export function DemoLayout({ children, maxWidth = 'md' }: DemoLayoutProps) { + return
{children}
; +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Input.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Input.tsx new file mode 100644 index 000000000..84bd49254 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Input.tsx @@ -0,0 +1,64 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +interface InputProps extends React.InputHTMLAttributes { + label?: string; + error?: string; + prefix?: string; + suffix?: string; + variant?: 'default' | 'compact'; +} + +const variants = { + default: + 'w-full p-2 border border-gray-300 rounded focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500', + compact: + 'w-full px-2.5 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500', +}; + +export function Input({ + label, + error, + prefix, + suffix, + variant = 'default', + className = '', + ...props +}: InputProps) { + const inputClasses = + `${variants[variant]} ${error ? 'border-red-500 focus:border-red-500 focus:ring-red-500' : ''} ${className}`.trim(); + + const inputElement = ( +
+ {prefix && ( + {prefix} + )} + + {suffix && ( + + {suffix} + + )} +
+ ); + + if (label) { + return ( +
+ + {inputElement} + {error && {error}} +
+ ); + } + + return ( +
+ {inputElement} + {error && {error}} +
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/LabelWithValue.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/LabelWithValue.tsx new file mode 100644 index 000000000..90e182164 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/LabelWithValue.tsx @@ -0,0 +1,18 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +interface LabelWithValueProps { + label: string; + value: React.ReactNode; +} + +export function LabelWithValue({ label, value }: LabelWithValueProps) { + return ( +
+ + {label.replace(/([A-Z])/g, ' $1').trim()}: + +
{value}
+
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Modal.tsx b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Modal.tsx new file mode 100644 index 000000000..5184c6087 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/components/ui/Modal.tsx @@ -0,0 +1,58 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +interface ModalProps { + isOpen: boolean; + onClose: () => void; + title?: string; + children: React.ReactNode; + size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl'; + showCloseButton?: boolean; +} + +const sizeClasses = { + sm: 'max-w-md', + md: 'max-w-lg', + lg: 'max-w-2xl', + xl: 'max-w-4xl', + '2xl': 'max-w-6xl', +}; + +export function Modal({ + isOpen, + onClose, + title, + children, + size = 'lg', + showCloseButton = true, +}: ModalProps) { + if (!isOpen) return null; + + return ( +
+
+ {title && ( +
+

{title}

+ {showCloseButton && ( + + )} +
+ )} +
{children}
+
+
+ ); +} + +export function ModalFooter({ children }: { children: React.ReactNode }) { + return ( +
{children}
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/constants/networks.ts b/packages/wallet-sdk/examples/demo-app/src/app/constants/networks.ts new file mode 100644 index 000000000..601208ebf --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/constants/networks.ts @@ -0,0 +1,33 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import type { NetworkName } from '../types/network.js'; + +// Re-export for other components +export type { NetworkName }; + +interface NetworkConfig { + counterPackageId?: string; + nftPackageId?: string; + // Add other network-specific constants here as needed +} + +const NETWORK_CONFIGS: Record = { + testnet: { + counterPackageId: '0x58a6d7dccd124b7e0bb9756dc309f5d5b9e2bc38a05261177970e96d0d3911f1', + nftPackageId: '0x1ae7832d6ad190aa4c8d6a36dd014d8383246428fb27590262b8648fcec62ca0', + }, + mainnet: { + // Add mainnet-specific configs when available + }, + devnet: { + // Add devnet-specific configs when available + }, + localnet: { + // Add localnet-specific configs when available + }, +}; + +export function getNetworkConfig(network: string): NetworkConfig { + return NETWORK_CONFIGS[network as NetworkName] ?? NETWORK_CONFIGS.testnet; +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/counter.ts b/packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/counter.ts new file mode 100644 index 000000000..a573af145 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/counter.ts @@ -0,0 +1,82 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** + * This example demonstrates a basic use of a shared object. Rules: + * + * - anyone can create and share a counter + * - everyone can increment a counter by 1 + * - the owner of the counter can reset it to any value + */ + +import { MoveStruct, normalizeMoveArguments } from '../utils/index.js'; +import type { RawTransactionArgument } from '../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +import type { Transaction } from '@mysten/sui/transactions'; +import * as object from './deps/sui/object.js'; +const $moduleName = 'demo.sui/counter::counter'; +export const Counter = new MoveStruct({ + name: `${$moduleName}::Counter`, + fields: { + id: object.UID, + owner: bcs.Address, + value: bcs.u64(), + }, +}); +export interface CreateOptions { + package?: string; + arguments?: []; +} +/** Create and share a Counter object. */ +export function create(options: CreateOptions = {}) { + const packageAddress = options.package ?? 'demo.sui/counter'; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'counter', + function: 'create', + }); +} +export interface IncrementArguments { + counter: RawTransactionArgument; +} +export interface IncrementOptions { + package?: string; + arguments: IncrementArguments | [counter: RawTransactionArgument]; +} +/** Increment a counter by 1. */ +export function increment(options: IncrementOptions) { + const packageAddress = options.package ?? 'demo.sui/counter'; + const argumentsTypes = [`${packageAddress}::counter::Counter`] satisfies string[]; + const parameterNames = ['counter']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'counter', + function: 'increment', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface SetValueArguments { + counter: RawTransactionArgument; + value: RawTransactionArgument; +} +export interface SetValueOptions { + package?: string; + arguments: + | SetValueArguments + | [counter: RawTransactionArgument, value: RawTransactionArgument]; +} +/** Set value (only runnable by the Counter owner) */ +export function setValue(options: SetValueOptions) { + const packageAddress = options.package ?? 'demo.sui/counter'; + const argumentsTypes = [`${packageAddress}::counter::Counter`, 'u64'] satisfies string[]; + const parameterNames = ['counter', 'value']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'counter', + function: 'set_value', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/deps/sui/object.ts b/packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/deps/sui/object.ts new file mode 100644 index 000000000..e3f20da16 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/contracts/counter/deps/sui/object.ts @@ -0,0 +1,14 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** Sui object identifiers */ + +import { MoveStruct } from '../../../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +const $moduleName = '0x2::object'; +export const UID = new MoveStruct({ + name: `${$moduleName}::UID`, + fields: { + id: bcs.Address, + }, +}); diff --git a/packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/demo_nft.ts b/packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/demo_nft.ts new file mode 100644 index 000000000..ed60bc100 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/demo_nft.ts @@ -0,0 +1,190 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** A demo NFT contract with Display configuration for the Sui demo app */ + +import { MoveStruct, normalizeMoveArguments } from '../utils/index.js'; +import type { RawTransactionArgument } from '../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +import type { Transaction } from '@mysten/sui/transactions'; +import * as object from './deps/sui/object.js'; +const $moduleName = 'demo.sui/nft::demo_nft'; +export const DemoNFT = new MoveStruct({ + name: `${$moduleName}::DemoNFT`, + fields: { + id: object.UID, + name: bcs.string(), + description: bcs.string(), + image_url: bcs.string(), + creator: bcs.Address, + }, +}); +export const DEMO_NFT = new MoveStruct({ + name: `${$moduleName}::DEMO_NFT`, + fields: { + dummy_field: bcs.bool(), + }, +}); +export interface MintNftArguments { + name: RawTransactionArgument; + description: RawTransactionArgument; + imageUrl: RawTransactionArgument; + recipient: RawTransactionArgument; +} +export interface MintNftOptions { + package?: string; + arguments: + | MintNftArguments + | [ + name: RawTransactionArgument, + description: RawTransactionArgument, + imageUrl: RawTransactionArgument, + recipient: RawTransactionArgument, + ]; +} +/** Mint a new DemoNFT */ +export function mintNft(options: MintNftOptions) { + const packageAddress = options.package ?? 'demo.sui/nft'; + const argumentsTypes = [ + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + 'address', + ] satisfies string[]; + const parameterNames = ['name', 'description', 'imageUrl', 'recipient']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'demo_nft', + function: 'mint_nft', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface MintArguments { + name: RawTransactionArgument; + description: RawTransactionArgument; + imageUrl: RawTransactionArgument; +} +export interface MintOptions { + package?: string; + arguments: + | MintArguments + | [ + name: RawTransactionArgument, + description: RawTransactionArgument, + imageUrl: RawTransactionArgument, + ]; +} +/** Public function to mint NFT with strings (for easier frontend integration) */ +export function mint(options: MintOptions) { + const packageAddress = options.package ?? 'demo.sui/nft'; + const argumentsTypes = [ + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + '0x0000000000000000000000000000000000000000000000000000000000000001::string::String', + ] satisfies string[]; + const parameterNames = ['name', 'description', 'imageUrl']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'demo_nft', + function: 'mint', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface NameArguments { + nft: RawTransactionArgument; +} +export interface NameOptions { + package?: string; + arguments: NameArguments | [nft: RawTransactionArgument]; +} +export function name(options: NameOptions) { + const packageAddress = options.package ?? 'demo.sui/nft'; + const argumentsTypes = [`${packageAddress}::demo_nft::DemoNFT`] satisfies string[]; + const parameterNames = ['nft']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'demo_nft', + function: 'name', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface DescriptionArguments { + nft: RawTransactionArgument; +} +export interface DescriptionOptions { + package?: string; + arguments: DescriptionArguments | [nft: RawTransactionArgument]; +} +export function description(options: DescriptionOptions) { + const packageAddress = options.package ?? 'demo.sui/nft'; + const argumentsTypes = [`${packageAddress}::demo_nft::DemoNFT`] satisfies string[]; + const parameterNames = ['nft']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'demo_nft', + function: 'description', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface ImageUrlArguments { + nft: RawTransactionArgument; +} +export interface ImageUrlOptions { + package?: string; + arguments: ImageUrlArguments | [nft: RawTransactionArgument]; +} +export function imageUrl(options: ImageUrlOptions) { + const packageAddress = options.package ?? 'demo.sui/nft'; + const argumentsTypes = [`${packageAddress}::demo_nft::DemoNFT`] satisfies string[]; + const parameterNames = ['nft']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'demo_nft', + function: 'image_url', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface CreatorArguments { + nft: RawTransactionArgument; +} +export interface CreatorOptions { + package?: string; + arguments: CreatorArguments | [nft: RawTransactionArgument]; +} +export function creator(options: CreatorOptions) { + const packageAddress = options.package ?? 'demo.sui/nft'; + const argumentsTypes = [`${packageAddress}::demo_nft::DemoNFT`] satisfies string[]; + const parameterNames = ['nft']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'demo_nft', + function: 'creator', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} +export interface BurnArguments { + nft: RawTransactionArgument; +} +export interface BurnOptions { + package?: string; + arguments: BurnArguments | [nft: RawTransactionArgument]; +} +/** Burn an NFT */ +export function burn(options: BurnOptions) { + const packageAddress = options.package ?? 'demo.sui/nft'; + const argumentsTypes = [`${packageAddress}::demo_nft::DemoNFT`] satisfies string[]; + const parameterNames = ['nft']; + return (tx: Transaction) => + tx.moveCall({ + package: packageAddress, + module: 'demo_nft', + function: 'burn', + arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames), + }); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/deps/sui/object.ts b/packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/deps/sui/object.ts new file mode 100644 index 000000000..e3f20da16 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/contracts/demo_nft/deps/sui/object.ts @@ -0,0 +1,14 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +/** Sui object identifiers */ + +import { MoveStruct } from '../../../utils/index.js'; +import { bcs } from '@mysten/sui/bcs'; +const $moduleName = '0x2::object'; +export const UID = new MoveStruct({ + name: `${$moduleName}::UID`, + fields: { + id: bcs.Address, + }, +}); diff --git a/packages/wallet-sdk/examples/demo-app/src/app/contracts/utils/index.ts b/packages/wallet-sdk/examples/demo-app/src/app/contracts/utils/index.ts new file mode 100644 index 000000000..db331c48b --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/contracts/utils/index.ts @@ -0,0 +1,168 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import type { BcsType, TypeTag } from '@mysten/sui/bcs'; +import { bcs, TypeTagSerializer, BcsStruct, BcsEnum, BcsTuple } from '@mysten/sui/bcs'; +import { normalizeSuiAddress } from '@mysten/sui/utils'; +import type { TransactionArgument } from '@mysten/sui/transactions'; +import { isArgument } from '@mysten/sui/transactions'; + +const MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1'); +const SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2'); +const SUI_SYSTEM_ADDRESS = normalizeSuiAddress('0x3'); + +export type RawTransactionArgument = T | TransactionArgument; + +export function getPureBcsSchema(typeTag: string | TypeTag): BcsType | null { + const parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag; + + if ('u8' in parsedTag) { + return bcs.U8; + } else if ('u16' in parsedTag) { + return bcs.U16; + } else if ('u32' in parsedTag) { + return bcs.U32; + } else if ('u64' in parsedTag) { + return bcs.U64; + } else if ('u128' in parsedTag) { + return bcs.U128; + } else if ('u256' in parsedTag) { + return bcs.U256; + } else if ('address' in parsedTag) { + return bcs.Address; + } else if ('bool' in parsedTag) { + return bcs.Bool; + } else if ('vector' in parsedTag) { + const type = getPureBcsSchema(parsedTag.vector); + return type ? bcs.vector(type) : null; + } else if ('struct' in parsedTag) { + const structTag = parsedTag.struct; + const pkg = normalizeSuiAddress(parsedTag.struct.address); + + if (pkg === MOVE_STDLIB_ADDRESS) { + if ( + (structTag.module === 'ascii' || structTag.module === 'string') && + structTag.name === 'String' + ) { + return bcs.String; + } + + if (structTag.module === 'option' && structTag.name === 'Option') { + const type = getPureBcsSchema(structTag.typeParams[0]!); + return type ? bcs.vector(type) : null; + } + } + + if (pkg === SUI_FRAMEWORK_ADDRESS && structTag.module === 'Object' && structTag.name === 'ID') { + return bcs.Address; + } + } + + return null; +} + +export function normalizeMoveArguments( + args: unknown[] | object, + argTypes: string[], + parameterNames?: string[], +) { + const argLen = Array.isArray(args) ? args.length : Object.keys(args).length; + if (parameterNames && argLen !== parameterNames.length) { + throw new Error( + `Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`, + ); + } + + const normalizedArgs: TransactionArgument[] = []; + + let index = 0; + for (const [i, argType] of argTypes.entries()) { + if (argType === `${SUI_FRAMEWORK_ADDRESS}::deny_list::DenyList`) { + normalizedArgs.push((tx) => tx.object.denyList()); + continue; + } + + if (argType === `${SUI_FRAMEWORK_ADDRESS}::random::Random`) { + normalizedArgs.push((tx) => tx.object.random()); + continue; + } + + if (argType === `${SUI_FRAMEWORK_ADDRESS}::clock::Clock`) { + normalizedArgs.push((tx) => tx.object.clock()); + continue; + } + + if (argType === `${SUI_SYSTEM_ADDRESS}::sui_system::SuiSystemState`) { + normalizedArgs.push((tx) => tx.object.system()); + continue; + } + + let arg; + if (Array.isArray(args)) { + if (index >= args.length) { + throw new Error( + `Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`, + ); + } + arg = args[index]; + } else { + if (!parameterNames) { + throw new Error(`Expected arguments to be passed as an array`); + } + const name = parameterNames[index]; + arg = args[name as keyof typeof args]; + + if (arg == null) { + throw new Error(`Parameter ${name} is required`); + } + } + + index += 1; + + if (typeof arg === 'function' || isArgument(arg)) { + normalizedArgs.push(arg as TransactionArgument); + continue; + } + + const type = argTypes[i]!; + const bcsType = getPureBcsSchema(type); + + if (bcsType) { + const bytes = bcsType.serialize(arg as never); + normalizedArgs.push((tx) => tx.pure(bytes)); + continue; + } else if (typeof arg === 'string') { + normalizedArgs.push((tx) => tx.object(arg)); + continue; + } + + throw new Error(`Invalid argument ${stringify(arg)} for type ${type}`); + } + + return normalizedArgs; +} + +export class MoveStruct< + T extends Record>, + const Name extends string = string, +> extends BcsStruct {} + +export class MoveEnum< + T extends Record | null>, + const Name extends string, +> extends BcsEnum {} + +export class MoveTuple< + T extends readonly BcsType[], + const Name extends string, +> extends BcsTuple {} + +function stringify(val: unknown) { + if (typeof val === 'object') { + return JSON.stringify(val, (val: unknown) => val); + } + if (typeof val === 'bigint') { + return val.toString(); + } + + return val; +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/demos/counter/CounterDemo.tsx b/packages/wallet-sdk/examples/demo-app/src/app/demos/counter/CounterDemo.tsx new file mode 100644 index 000000000..50a9eb780 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/demos/counter/CounterDemo.tsx @@ -0,0 +1,206 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { useCurrentAccount, useSuiClient, useCurrentNetwork } from '@mysten/dapp-kit-react'; +import { useState, useCallback, useEffect } from 'react'; +import type { SuiObjectData } from '@mysten/sui/client'; +import { useTransactionExecution } from '../../hooks/useTransactionExecution.js'; +import { Alert } from '../../components/ui/Alert.js'; +import { ConnectWalletPrompt } from '../../components/ui/ConnectWalletPrompt.js'; +import { DemoLayout } from '../../components/ui/DemoLayout.js'; +import { getNetworkConfig } from '../../constants/networks.js'; +import { + createCounterTransaction, + incrementCounterTransaction, + resetCounterTransaction, +} from './transactions.js'; + +export function CounterDemo() { + const currentAccount = useCurrentAccount(); + const suiClient = useSuiClient(); + const currentNetwork = useCurrentNetwork(); + const { executeTransaction, isExecuting, error, setError } = useTransactionExecution(); + + const networkConfig = getNetworkConfig(currentNetwork); + const [counterId, setCounterId] = useState(null); + const [counterData, setCounterData] = useState(null); + const [isLoading, setIsLoading] = useState(false); + const [isIncrementing, setIsIncrementing] = useState(false); + const [isResetting, setIsResetting] = useState(false); + + const fetchCounterData = useCallback(async () => { + if (!counterId) return; + setIsLoading(true); + try { + const result = await suiClient.getObject({ + id: counterId, + options: { + showContent: true, + showOwner: true, + }, + }); + setCounterData(result.data || null); + } catch (error) { + console.error('Failed to fetch counter:', error); + } finally { + setIsLoading(false); + } + }, [counterId, suiClient]); + + useEffect(() => { + fetchCounterData(); + }, [fetchCounterData]); + + const createCounter = async () => { + if (!currentAccount) { + setError('No wallet connected'); + return; + } + + try { + const tx = createCounterTransaction({ + senderAddress: currentAccount.address, + }); + + const result = await executeTransaction(tx); + const txResponse = await suiClient.waitForTransaction({ + digest: result.digest, + options: { showEffects: true }, + }); + + const createdId = txResponse.effects?.created?.[0]?.reference?.objectId; + if (createdId) { + setCounterId(createdId); + } + } catch (error) { + console.error('Failed to create counter:', error); + } + }; + + const incrementCounter = async () => { + if (!currentAccount || !counterId) return; + + setIsIncrementing(true); + try { + const tx = incrementCounterTransaction({ + senderAddress: currentAccount.address, + counterId, + }); + + await executeTransaction(tx); + await fetchCounterData(); + } catch (error) { + console.error('Failed to increment counter:', error); + } finally { + setIsIncrementing(false); + } + }; + + const resetCounter = async () => { + if (!currentAccount || !counterId) return; + + setIsResetting(true); + try { + const tx = resetCounterTransaction({ + senderAddress: currentAccount.address, + counterId, + newValue: 0, + }); + + await executeTransaction(tx); + await fetchCounterData(); + } catch (error) { + console.error('Failed to reset counter:', error); + } finally { + setIsResetting(false); + } + }; + + const getCounterValue = (data: SuiObjectData | null | undefined) => { + if (!data || data.content?.dataType !== 'moveObject') { + return 0; + } + return (data.content.fields as { value: number })?.value || 0; + }; + + if (!currentAccount) { + return ( + + ); + } + + if (!networkConfig.counterPackageId) { + return ( +
+
⚠️
+

Counter Not Available

+

+ The counter contract is not deployed on the {currentNetwork} network. +
+ Please switch to testnet to use this demo. +

+
+ ); + } + + return ( + + {error && setError(null)} />} + + {!counterId ? ( +
+
🔢
+

Create Your Counter

+

+ Start by creating a counter to increment values on-chain +

+ +
+ ) : ( +
+
+

Counter

+
+ Counter ID: + + {counterId} + +
+
+ +
+
+ {isLoading ? '...' : getCounterValue(counterData)} +
+
Current Value
+
+ +
+ + +
+
+ )} +
+ ); +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/demos/counter/transactions.ts b/packages/wallet-sdk/examples/demo-app/src/app/demos/counter/transactions.ts new file mode 100644 index 000000000..e6742ffd2 --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/demos/counter/transactions.ts @@ -0,0 +1,90 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { Transaction } from '@mysten/sui/transactions'; +import { operationType } from '@mysten/wallet-sdk'; +import * as counterContract from '../../contracts/counter/counter.js'; + +interface CounterTransactionParams { + senderAddress: string; +} + +interface IncrementCounterParams extends CounterTransactionParams { + counterId: string; +} + +interface ResetCounterParams extends CounterTransactionParams { + counterId: string; + newValue: number; +} + +/** + * Creates a transaction to create a new counter + */ +export function createCounterTransaction({ senderAddress }: CounterTransactionParams): Transaction { + const tx = new Transaction(); + + // Add auto-approval intent for rule set selection + tx.add(operationType('counter-operations', 'Create counter')); + + tx.setSenderIfNotSet(senderAddress); + + // Use the generated type-safe create function + tx.add(counterContract.create()); + + return tx; +} + +/** + * Creates a transaction to increment a counter by 1 + */ +export function incrementCounterTransaction({ + senderAddress, + counterId, +}: IncrementCounterParams): Transaction { + const tx = new Transaction(); + + // Add auto-approval intent for rule set selection + tx.add(operationType('counter-operations', 'Increment counter')); + + tx.setSenderIfNotSet(senderAddress); + + // Use the generated type-safe increment function + tx.add( + counterContract.increment({ + arguments: { + counter: counterId, + }, + }), + ); + + return tx; +} + +/** + * Creates a transaction to reset a counter to a specific value + */ +export function resetCounterTransaction({ + senderAddress, + counterId, + newValue, +}: ResetCounterParams): Transaction { + const tx = new Transaction(); + + // Add auto-approval intent for rule set selection + tx.add(operationType('counter-operations', 'Reset counter')); + + tx.setSenderIfNotSet(senderAddress); + + // Use the generated type-safe setValue function + tx.add( + counterContract.setValue({ + arguments: { + counter: counterId, + value: newValue, + }, + }), + ); + + return tx; +} diff --git a/packages/wallet-sdk/examples/demo-app/src/app/demos/nft/NFTMintDemo.tsx b/packages/wallet-sdk/examples/demo-app/src/app/demos/nft/NFTMintDemo.tsx new file mode 100644 index 000000000..9bfa9ab8e --- /dev/null +++ b/packages/wallet-sdk/examples/demo-app/src/app/demos/nft/NFTMintDemo.tsx @@ -0,0 +1,352 @@ +// Copyright (c) Mysten Labs, Inc. +// SPDX-License-Identifier: Apache-2.0 +import { useCurrentAccount, useSuiClient, useCurrentNetwork } from '@mysten/dapp-kit-react'; +import { useState } from 'react'; +import { useTransactionExecution } from '../../hooks/useTransactionExecution.js'; +import { Alert } from '../../components/ui/Alert.js'; +import { Input } from '../../components/ui/Input.js'; +import { ConnectWalletPrompt } from '../../components/ui/ConnectWalletPrompt.js'; +import { DemoLayout } from '../../components/ui/DemoLayout.js'; +import { WalrusFile } from '@mysten/walrus'; +import { createMintNFTTransaction } from './transactions.js'; +import { operationType } from '@mysten/wallet-sdk'; +import type { DemoProps } from '../../../DemoApp.js'; + +export function NFTMintDemo({ onNavigate }: DemoProps = {}) { + const currentAccount = useCurrentAccount(); + const suiClient = useSuiClient(); + const currentNetwork = useCurrentNetwork(); + const { executeTransaction, isExecuting, error, setError } = useTransactionExecution(); + const uploadExecution = useTransactionExecution(); + + const [nftName, setNftName] = useState(''); + const [nftDescription, setNftDescription] = useState(''); + const [nftImageUrl, setNftImageUrl] = useState(''); + const [successMessage, setSuccessMessage] = useState(null); + + // Image input method: 'file' or 'url' + const [imageInputMethod, setImageInputMethod] = useState<'file' | 'url'>('url'); + const [selectedFile, setSelectedFile] = useState(null); + const [uploadStep, setUploadStep] = useState(''); + + // Helper function to get network-specific URLs (copied from WalrusDemo) + const getNetworkUrls = (network: string) => { + const isMainnet = network === 'mainnet'; + return { + aggregator: isMainnet + ? 'https://aggregator.walrus.space' + : 'https://aggregator.walrus-testnet.walrus.space', + }; + }; + + const handleFileChange = (event: React.ChangeEvent) => { + const file = event.target.files?.[0]; + if (file) { + setSelectedFile(file); + // Clear any existing URL when file is selected + setNftImageUrl(''); + } + }; + + const uploadFileToWalrus = async (): Promise => { + if (!selectedFile || !currentAccount) return null; + + try { + setUploadStep('Uploading image to Walrus...'); + + // Create WalrusFile from selected file + const fileArrayBuffer = await selectedFile.arrayBuffer(); + const fileBytes = new Uint8Array(fileArrayBuffer); + + const walrusFile = WalrusFile.from({ + contents: fileBytes, + identifier: selectedFile.name, + tags: { + 'content-type': selectedFile.type || 'image/*', + 'original-name': selectedFile.name, + }, + }); + + const walrusClient = suiClient.walrus; + const flow = walrusClient.writeFilesFlow({ files: [walrusFile] }); + + // Upload process + setUploadStep('Encoding file...'); + await flow.encode(); + + setUploadStep('Registering on-chain...'); + const registerTx = flow.register({ + epochs: 5, + deletable: true, + owner: currentAccount.address, + }); + + // Add operation type for auto-approval + registerTx.add(operationType('nft-operations', 'Register NFT image')); + + const result = await uploadExecution.executeTransaction(registerTx); + if (!result) { + throw new Error('Failed to register file on-chain'); + } + + setUploadStep('Uploading to storage nodes...'); + await flow.upload({ digest: result.digest }); + + setUploadStep('Finalizing...'); + const certifyTx = flow.certify(); + + // Add operation type for auto-approval + certifyTx.add(operationType('nft-operations', 'Certify NFT image')); + + const certifyResult = await uploadExecution.executeTransaction(certifyTx); + if (!certifyResult) { + throw new Error('Failed to certify file on-chain'); + } + + // Get file info and generate aggregator URL + const filesInfo = await flow.listFiles(); + if (filesInfo.length === 0) { + throw new Error('No file info found after upload'); + } + + const fileInfo = filesInfo[0]; + const networkUrls = getNetworkUrls(currentNetwork); + const imageUrl = `${networkUrls.aggregator}/v1/blobs/by-quilt-patch-id/${fileInfo.id}`; + + setUploadStep(''); + return imageUrl; + } catch (error) { + console.error('Walrus upload failed:', error); + setUploadStep(''); + throw error; + } + }; + + const handleMintNFT = async () => { + if (!currentAccount) return; + + // Validation + if (!nftName || !nftDescription) { + setError('Please fill in name and description'); + return; + } + + if (imageInputMethod === 'url' && !nftImageUrl) { + setError('Please provide an image URL'); + return; + } + + if (imageInputMethod === 'file' && !selectedFile) { + setError('Please select an image file to upload'); + return; + } + + try { + let finalImageUrl = nftImageUrl; + + // If using file upload, upload to Walrus first + if (imageInputMethod === 'file' && selectedFile) { + const uploadedUrl = await uploadFileToWalrus(); + if (!uploadedUrl) { + setError('Failed to upload image to Walrus'); + return; + } + finalImageUrl = uploadedUrl; + } + + // Now mint the NFT with the final image URL using transaction builder + const tx = createMintNFTTransaction({ + name: nftName, + description: nftDescription, + imageUrl: finalImageUrl, + senderAddress: currentAccount.address, + }); + + const result = await executeTransaction(tx); + if (result) { + setSuccessMessage(`Successfully minted NFT: ${nftName}! Switching to wallet...`); + setNftName(''); + setNftDescription(''); + setNftImageUrl(''); + setSelectedFile(null); + + // Switch to wallet demo immediately + onNavigate?.('wallet'); + } + } catch (err) { + console.error('NFT minting failed:', err); + setError('Failed to mint NFT. Please try again.'); + } + }; + + if (!currentAccount) { + return ; + } + + return ( + + {error && setError(null)} />} + {uploadExecution.error && ( + uploadExecution.setError(null)} + /> + )} + {successMessage && ( + setSuccessMessage(null)} /> + )} + +
+
+ setNftName(e.target.value)} + placeholder="My Awesome NFT" + /> + +
+ +