Repository navigation
Conversation
|
| Filename | Overview |
|---|---|
| src/withdrawal.ts | Adds destination resolution, amount-policy enforcement, commitment calculation, and canonical calldata encoding and validation. |
| src/wasm.ts | Changes upstream module specifiers but also removes the established public guard namespace, breaking existing root-package consumers. |
| scripts/encode-withdrawal-e2e.ts | Adds a strict JSON E2E driver that resolves destinations, encodes withdrawals, and returns deterministic success or error responses. |
| scripts/prepare-withdrawal-e2e-package.ts | Adds clean-checkout validation, deterministic npm packaging, package-content checks, and integrity metadata generation. |
| package.json | Publishes the withdrawal subpath, includes fixtures, adds the E2E build and test lifecycle, and bumps the package version. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Client withdrawal request] --> B[Resolve destination]
B --> C[Validate amount policy]
C --> D[Calculate commitment]
D --> E[Encode 116-byte calldata]
E --> F[Decode and self-validate]
F --> G[Simulation and submission]
Prompt To Fix All With AI
### Issue 1
src/wasm.ts:5-6
**WASM guard namespace removed**
When an existing consumer accesses `wasm.guard` through the root SDK export, the wrapper no longer provides the previously exported guard namespace, causing compile-time failures or an `undefined` runtime value in validation paths.
```suggestion
export * from '@nockbox/iris-wasm/iris_wasm.js';
export { default } from '@nockbox/iris-wasm/iris_wasm.js';
export * as guard from '@nockbox/iris-wasm/iris_wasm.guard';
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "chore: drop unused e2e driver plumbing" | Re-trigger Greptile
| export * from '@nockbox/iris-wasm/iris_wasm.js'; | ||
| export { default } from '@nockbox/iris-wasm/iris_wasm.js'; |
There was a problem hiding this comment.
When an existing consumer accesses wasm.guard through the root SDK export, the wrapper no longer provides the previously exported guard namespace, causing compile-time failures or an undefined runtime value in validation paths.
| export * from '@nockbox/iris-wasm/iris_wasm.js'; | |
| export { default } from '@nockbox/iris-wasm/iris_wasm.js'; | |
| export * from '@nockbox/iris-wasm/iris_wasm.js'; | |
| export { default } from '@nockbox/iris-wasm/iris_wasm.js'; | |
| export * as guard from '@nockbox/iris-wasm/iris_wasm.guard'; |
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/wasm.ts
Line: 5-6
Comment:
**WASM guard namespace removed**
When an existing consumer accesses `wasm.guard` through the root SDK export, the wrapper no longer provides the previously exported guard namespace, causing compile-time failures or an `undefined` runtime value in validation paths.
```suggestion
export * from '@nockbox/iris-wasm/iris_wasm.js';
export { default } from '@nockbox/iris-wasm/iris_wasm.js';
export * as guard from '@nockbox/iris-wasm/iris_wasm.guard';
```
**Knowledge Base Used:**
- [WASM cryptographic integration](https://app.greptile.com/nockbox/-/custom-context/knowledge-base/nockbox/iris-sdk/-/docs/wasm-cryptographic-integration.md)
- [WASM wrapper and declarations](https://app.greptile.com/nockbox/-/custom-context/knowledge-base/nockbox/iris-sdk/-/docs/wasm-wrapper-and-declarations.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
This PR adds the canonical Iris codec for withdrawals from Base to Nockchain.
The codec resolves a Nockchain destination. It also checks
withdrawal-policy-v1and creates the exact contract calldata.Changes
WithdrawalWireV1data.v1_pkhand lock-root destinations.WithdrawalWireErrorcode for each malformed input or policy error.withdrawalentry point.0.3.3.Safety
burn(uint256,bytes32)call omits part of the destination.Tests
npm testpassed 20 tests.npm run typecheckpassed.npm run format:checkpassed.npm run test:pack-readinesspassed 15 tests.34f00b991e5050d877d9691c185883c409c5755f.Related changes
fc7d912cb5ee22e57137dc0eb7f1a93007132626.Nockchain PR stack
Review and merge the Nockchain PRs in this order: