Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BRO-48] 8.0.0-alpha.1 Enable ZK proof generations with new company identities #522

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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",
2 changes: 1 addition & 1 deletion examples/add-example-Web3Id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/eSealing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/nft-minting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packageManager": "[email protected]",
"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",
Expand Down
2 changes: 1 addition & 1 deletion examples/piggybank/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packageManager": "[email protected]",
"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"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/two-step-transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/voting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packageManager": "[email protected]",
"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",
Expand Down
2 changes: 1 addition & 1 deletion examples/wCCD/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion packages/browser-wallet-api-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down Expand Up @@ -166,12 +168,18 @@ function DisplayPoolStatus({ status }: DisplayPoolStatusProps) {
<SidedRow
className="m-t-5"
left="Current pool:"
right={displayAsCcd(status.delegatedCapital.microCcdAmount).toString()}
right={
status.delegatedCapital ? displayAsCcd(status.delegatedCapital.microCcdAmount).toString() : 'N/A'
}
/>
<SidedRow
className="m-t-5"
left="Pool limit:"
right={displayAsCcd(status.delegatedCapitalCap.microCcdAmount).toString()}
right={
status.delegatedCapitalCap
? displayAsCcd(status.delegatedCapitalCap.microCcdAmount).toString()
: 'N/A'
}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) });
}
Expand Down
34 changes: 17 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading