diff --git a/.yarn/patches/@concordium-web-sdk-npm-8.0.0-alpha.1-aded1beb40.patch b/.yarn/patches/@concordium-web-sdk-npm-8.0.0-alpha.1-aded1beb40.patch new file mode 100644 index 00000000..dfe3b688 --- /dev/null +++ b/.yarn/patches/@concordium-web-sdk-npm-8.0.0-alpha.1-aded1beb40.patch @@ -0,0 +1,16 @@ +diff --git a/package.json b/package.json +index ab729e79bf5245960cae62599cd21aa0c0047baa..7185ff2492f6ae8bb266166925e1345345488b05 100644 +--- a/package.json ++++ b/package.json +@@ -38,6 +38,11 @@ + "react-native": null, + "default": "./lib/esm/pub/wasm.js" + }, ++ "./types/*": { ++ "types": "./lib/esm/types/*.d.ts", ++ "bun": "./src/types/*.ts", ++ "default": "./lib/esm/types/*.js" ++ }, + "./*": { + "types": "./lib/esm/pub/*.d.ts", + "bun": "./src/pub/*.ts", diff --git a/examples/add-example-Web3Id/package.json b/examples/add-example-Web3Id/package.json index aec69d9c..8b91bd74 100644 --- a/examples/add-example-Web3Id/package.json +++ b/examples/add-example-Web3Id/package.json @@ -8,6 +8,6 @@ "start": "live-server ./index.html --mount=/sdk.js:../../node_modules/@concordium/web-sdk/lib/concordium.min.js --mount=/helpers.js:../../packages/browser-wallet-api-helpers/lib/concordiumHelpers.min.js" }, "dependencies": { - "@concordium/web-sdk": "^7.5.0" + "@concordium/web-sdk": "^8.0.0-alpha.1" } } diff --git a/examples/eSealing/package.json b/examples/eSealing/package.json index 0ddff333..1a8d5fb5 100644 --- a/examples/eSealing/package.json +++ b/examples/eSealing/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "dependencies": { "@concordium/react-components": "^0.4.0", - "@concordium/web-sdk": "^7.5.0", + "@concordium/web-sdk": "^8.0.0-alpha.1", "@thi.ng/leb128": "^2.1.18", "@types/sha256": "^0.2.0", "@walletconnect/types": "^2.1.4", diff --git a/examples/nft-minting/package.json b/examples/nft-minting/package.json index d2f2efa6..1ce0439a 100644 --- a/examples/nft-minting/package.json +++ b/examples/nft-minting/package.json @@ -3,7 +3,7 @@ "packageManager": "yarn@3.2.0", "dependencies": { "@concordium/browser-wallet-api-helpers": "workspace:^", - "@concordium/web-sdk": "^7.5.0", + "@concordium/web-sdk": "^8.0.0-alpha.1", "cors": "^2.8.5", "express": "^4.18.1", "express-fileupload": "^1.4.0", diff --git a/examples/piggybank/package.json b/examples/piggybank/package.json index 008bc1e6..d5eed14a 100644 --- a/examples/piggybank/package.json +++ b/examples/piggybank/package.json @@ -3,7 +3,7 @@ "packageManager": "yarn@3.2.0", "dependencies": { "@concordium/browser-wallet-api-helpers": "workspace:^", - "@concordium/web-sdk": "^7.5.0", + "@concordium/web-sdk": "^8.0.0-alpha.1", "react": "^18.1.0", "react-dom": "^18.1.0" }, diff --git a/examples/two-step-transfer/package.json b/examples/two-step-transfer/package.json index 5a4be32e..dd18f466 100644 --- a/examples/two-step-transfer/package.json +++ b/examples/two-step-transfer/package.json @@ -8,6 +8,6 @@ "start": "live-server ../two-step-transfer/index.html --mount=/sdk.js:../../node_modules/@concordium/web-sdk/lib/min/concordium.web.min.js --mount=/helpers.js:../../packages/browser-wallet-api-helpers/lib/concordiumHelpers.min.js" }, "dependencies": { - "@concordium/web-sdk": "^7.5.0" + "@concordium/web-sdk": "^8.0.0-alpha.1" } } diff --git a/examples/voting/package.json b/examples/voting/package.json index 2cfb9af2..47c31367 100644 --- a/examples/voting/package.json +++ b/examples/voting/package.json @@ -5,7 +5,7 @@ "packageManager": "yarn@3.2.0", "dependencies": { "@concordium/browser-wallet-api-helpers": "^3.0.0", - "@concordium/web-sdk": "^7.5.0", + "@concordium/web-sdk": "^8.0.0-alpha.1", "bootstrap": "^5.2.1", "moment": "^2.29.4", "react": "^18.2.0", diff --git a/examples/wCCD/package.json b/examples/wCCD/package.json index 947f0266..497b2b5d 100644 --- a/examples/wCCD/package.json +++ b/examples/wCCD/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "dependencies": { "@concordium/react-components": "^0.4.0", - "@concordium/web-sdk": "^7.5.0", + "@concordium/web-sdk": "^8.0.0-alpha.1", "@thi.ng/leb128": "^2.1.18", "@walletconnect/types": "^2.1.4", "mathjs": "^11.4.0", diff --git a/package.json b/package.json index b6998bec..bc54880c 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ }, "resolutions": { "@concordium/web-sdk@^7.5.0": "patch:@concordium/web-sdk@npm:^7.5.0#.yarn/patches/@concordium-web-sdk-npm-7.5.0-ed44307ebf.patch", - "@concordium/web-sdk@^7.5.1": "patch:@concordium/web-sdk@npm:^7.5.1#.yarn/patches/@concordium-web-sdk-npm-7.5.0-ed44307ebf.patch" + "@concordium/web-sdk@^7.5.1": "patch:@concordium/web-sdk@npm:^7.5.1#.yarn/patches/@concordium-web-sdk-npm-7.5.0-ed44307ebf.patch", + "@concordium/web-sdk@^8.0.0-alpha.1": "patch:@concordium/web-sdk@npm:^8.0.0-alpha.1#.yarn/patches/@concordium-web-sdk-npm-8.0.0-alpha.1-aded1beb40.patch" } } diff --git a/packages/browser-wallet-api-helpers/package.json b/packages/browser-wallet-api-helpers/package.json index 81ebd5d7..bf128a5a 100644 --- a/packages/browser-wallet-api-helpers/package.json +++ b/packages/browser-wallet-api-helpers/package.json @@ -40,7 +40,7 @@ "webpack-cli": "^4.9.2" }, "peerDependencies": { - "@concordium/web-sdk": "^7.5", + "@concordium/web-sdk": "^8.0.0-alpha.1", "@protobuf-ts/runtime-rpc": "^2.9.1" }, "scripts": { diff --git a/packages/browser-wallet/package.json b/packages/browser-wallet/package.json index 9f5de51c..4a86fffb 100644 --- a/packages/browser-wallet/package.json +++ b/packages/browser-wallet/package.json @@ -21,7 +21,7 @@ "dependencies": { "@concordium/browser-wallet-api-helpers": "workspace:^", "@concordium/common-sdk": "^9.5.3", - "@concordium/web-sdk": "^7.5.1", + "@concordium/web-sdk": "^8.0.0-alpha.1", "@noble/ed25519": "^1.7.0", "@protobuf-ts/grpcweb-transport": "^2.9.1", "@protobuf-ts/runtime-rpc": "^2.8.2", diff --git a/packages/browser-wallet/src/popup/pages/Account/Earn/Delegate/ConfigureDelegationFlow.tsx b/packages/browser-wallet/src/popup/pages/Account/Earn/Delegate/ConfigureDelegationFlow.tsx index 45447b35..cb68f645 100644 --- a/packages/browser-wallet/src/popup/pages/Account/Earn/Delegate/ConfigureDelegationFlow.tsx +++ b/packages/browser-wallet/src/popup/pages/Account/Earn/Delegate/ConfigureDelegationFlow.tsx @@ -65,12 +65,14 @@ function PoolPage({ onNext, initial, accountInfo }: PoolPageProps) { const bakerId = BigInt(value); const poolStatus = await client.getPoolInfo(bakerId); - if (poolStatus.poolInfo.openStatus !== OpenStatusText.OpenForAll) { + if (poolStatus.poolInfo?.openStatus !== OpenStatusText.OpenForAll) { return t('pool.targetNotOpenForAll'); } if ( accountInfo.type === AccountInfoType.Delegator && + poolStatus.delegatedCapitalCap && + poolStatus.delegatedCapital && poolStatus.delegatedCapitalCap.microCcdAmount - poolStatus.delegatedCapital.microCcdAmount < accountInfo.accountDelegation.stakedAmount.microCcdAmount ) { @@ -166,12 +168,18 @@ function DisplayPoolStatus({ status }: DisplayPoolStatusProps) { ); diff --git a/packages/browser-wallet/src/popup/shared/utils/transaction-helpers.ts b/packages/browser-wallet/src/popup/shared/utils/transaction-helpers.ts index 7e5af2be..352379c0 100644 --- a/packages/browser-wallet/src/popup/shared/utils/transaction-helpers.ts +++ b/packages/browser-wallet/src/popup/shared/utils/transaction-helpers.ts @@ -137,9 +137,10 @@ export function validateDelegationAmount( return i18n.t('utils.ccdAmount.zero'); } - const max = targetStatus - ? targetStatus.delegatedCapitalCap.microCcdAmount - targetStatus.delegatedCapital.microCcdAmount - : undefined; + const max = + targetStatus && targetStatus.delegatedCapitalCap && targetStatus.delegatedCapital + ? targetStatus.delegatedCapitalCap.microCcdAmount - targetStatus.delegatedCapital.microCcdAmount + : undefined; if (max !== undefined && amount > max) { return i18n.t('utils.ccdAmount.exceedingDelegationCap', { max: displayAsCcd(max) }); } diff --git a/yarn.lock b/yarn.lock index 187b2842..de7e5f13 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2174,7 +2174,7 @@ __metadata: webpack: ^5.72.0 webpack-cli: ^4.9.2 peerDependencies: - "@concordium/web-sdk": ^7.5 + "@concordium/web-sdk": ^8.0.0-alpha.1 "@protobuf-ts/runtime-rpc": ^2.9.1 languageName: unknown linkType: soft @@ -2186,7 +2186,7 @@ __metadata: "@babel/core": ^7.18.2 "@concordium/browser-wallet-api-helpers": "workspace:^" "@concordium/common-sdk": ^9.5.3 - "@concordium/web-sdk": ^7.5.1 + "@concordium/web-sdk": ^8.0.0-alpha.1 "@craftamap/esbuild-plugin-html": ^0.4.0 "@mdx-js/react": ^1.6.22 "@noble/ed25519": ^1.7.0 @@ -2319,9 +2319,9 @@ __metadata: languageName: node linkType: hard -"@concordium/web-sdk@npm:^7.5.0, @concordium/web-sdk@npm:^7.5.1": - version: 7.5.1 - resolution: "@concordium/web-sdk@npm:7.5.1" +"@concordium/web-sdk@npm:^8.0.0-alpha.1": + version: 8.0.1 + resolution: "@concordium/web-sdk@npm:8.0.1" dependencies: "@concordium/rust-bindings": ^3.2.1 "@grpc/grpc-js": ^1.9.4 @@ -2341,13 +2341,13 @@ __metadata: uuid: ^8.3.2 peerDependencies: "@protobuf-ts/runtime-rpc": ^2.8.2 - checksum: 7a63cfe59e9efde55a6e638b206a5200f67e6fddbc10304db40a766cc5ea20434a353fe6b5425dc59cc8a35391c80fb5bd79c70ccc62080a3a0d37dc72e35187 + checksum: c6d98c7e883556983274492a289d8a403bcaa540f90402918988926cd1a14b2c47274bb58b081f818e09d270da46e6b2b49c95ce09d9ff705a64c2b95351a3d4 languageName: node linkType: hard -"@concordium/web-sdk@patch:@concordium/web-sdk@npm:^7.5.0#.yarn/patches/@concordium-web-sdk-npm-7.5.0-ed44307ebf.patch::locator=concordium-browser-wallet%40workspace%3A., @concordium/web-sdk@patch:@concordium/web-sdk@npm:^7.5.1#.yarn/patches/@concordium-web-sdk-npm-7.5.0-ed44307ebf.patch::locator=concordium-browser-wallet%40workspace%3A.": - version: 7.5.1 - resolution: "@concordium/web-sdk@patch:@concordium/web-sdk@npm%3A7.5.1#.yarn/patches/@concordium-web-sdk-npm-7.5.0-ed44307ebf.patch::version=7.5.1&hash=f177fc&locator=concordium-browser-wallet%40workspace%3A." +"@concordium/web-sdk@patch:@concordium/web-sdk@npm:^8.0.0-alpha.1#.yarn/patches/@concordium-web-sdk-npm-8.0.0-alpha.1-aded1beb40.patch::locator=concordium-browser-wallet%40workspace%3A.": + version: 8.0.1 + resolution: "@concordium/web-sdk@patch:@concordium/web-sdk@npm%3A8.0.1#.yarn/patches/@concordium-web-sdk-npm-8.0.0-alpha.1-aded1beb40.patch::version=8.0.1&hash=7556d0&locator=concordium-browser-wallet%40workspace%3A." dependencies: "@concordium/rust-bindings": ^3.2.1 "@grpc/grpc-js": ^1.9.4 @@ -2367,7 +2367,7 @@ __metadata: uuid: ^8.3.2 peerDependencies: "@protobuf-ts/runtime-rpc": ^2.8.2 - checksum: 76bb473bc352517a1adf605b18cb1ecd136fb54db4aa94f8bfab847f6d2b51f8778737c77f72dcf9195e2df36a44b2ab93b0627cdf34940f3b5f9ca0ca345744 + checksum: 5db8a1ab079d2eee1da5de651df7b08e45e238867ef5a76233a757d66daddf4c892e84c9042bca289af6c47327e987ccd38154edec1e23cd3eb937685838dcc8 languageName: node linkType: hard @@ -7675,7 +7675,7 @@ __metadata: resolution: "NFT-Minting@workspace:examples/nft-minting" dependencies: "@concordium/browser-wallet-api-helpers": "workspace:^" - "@concordium/web-sdk": ^7.5.0 + "@concordium/web-sdk": ^8.0.0-alpha.1 "@craftamap/esbuild-plugin-html": ^0.4.0 "@types/react": ^18.0.9 "@types/react-dom": ^18.0.5 @@ -7827,7 +7827,7 @@ __metadata: version: 0.0.0-use.local resolution: "add-example-web3-id@workspace:examples/add-example-Web3Id" dependencies: - "@concordium/web-sdk": ^7.5.0 + "@concordium/web-sdk": ^8.0.0-alpha.1 live-server: ^1.2.2 languageName: unknown linkType: soft @@ -11287,7 +11287,7 @@ __metadata: resolution: "e_sealing@workspace:examples/eSealing" dependencies: "@concordium/react-components": ^0.4.0 - "@concordium/web-sdk": ^7.5.0 + "@concordium/web-sdk": ^8.0.0-alpha.1 "@thi.ng/leb128": ^2.1.18 "@types/node": ^18.7.23 "@types/react": ^18.0.9 @@ -18794,7 +18794,7 @@ __metadata: resolution: "piggybank@workspace:examples/piggybank" dependencies: "@concordium/browser-wallet-api-helpers": "workspace:^" - "@concordium/web-sdk": ^7.5.0 + "@concordium/web-sdk": ^8.0.0-alpha.1 "@types/react": ^18.0.9 "@types/react-dom": ^18.0.5 "@vitejs/plugin-react-swc": ^3.4.0 @@ -22990,7 +22990,7 @@ __metadata: version: 0.0.0-use.local resolution: "two-step-transfer@workspace:examples/two-step-transfer" dependencies: - "@concordium/web-sdk": ^7.5.0 + "@concordium/web-sdk": ^8.0.0-alpha.1 live-server: ^1.2.2 languageName: unknown linkType: soft @@ -23813,7 +23813,7 @@ __metadata: resolution: "voting@workspace:examples/voting" dependencies: "@concordium/browser-wallet-api-helpers": ^3.0.0 - "@concordium/web-sdk": ^7.5.0 + "@concordium/web-sdk": ^8.0.0-alpha.1 "@types/node": ^18.7.23 "@types/react": ^18.0.9 "@types/react-dom": ^18.0.5 @@ -23923,7 +23923,7 @@ __metadata: resolution: "wccd@workspace:examples/wCCD" dependencies: "@concordium/react-components": ^0.4.0 - "@concordium/web-sdk": ^7.5.0 + "@concordium/web-sdk": ^8.0.0-alpha.1 "@thi.ng/leb128": ^2.1.18 "@types/node": ^18.7.23 "@types/react": ^18.0.9