feat: Align grant registration with new gateway struct#150
Conversation
Replace the legacy `grant: string` JSON blob + `fileIds: uint256[]` with first-class EIP-712 fields `scopes: string[]`, `grantVersion: uint256`, and `expiresAt: uint256`, and add `grantVersion` to GrantRevocation so the monotonic nonce defends both events against replay. Update the gateway client wire format and GET response shape (now carries `expiresAt`/`expired`/`paymentStatus`/`paidAt`/`paidBy`/`grantVersion`/ `fee`) to match data-gateway. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
Findings
Verification
|
Add the GenericPayment EIP-712 typed-data and gateway-client wrappers for /v1/escrow/balance, /v1/escrow/deposit, and /v1/escrow/pay so a builder can settle a grant's registration + data-access fees before calling the Personal Server. Adds `dataPortabilityEscrow` to the contracts config (so existing fixtures gain the field) and a NATIVE_VANA_ASSET sentinel for the native-asset case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add primitives for funding the escrow balance from a wallet —
buildDepositNativeRequest / buildDepositTokenRequest return the
raw {to, data, value?} request object for any tx-submission stack
(viem, ethers, wallet-rpc, MPC, Safe). The credited `account` is
encoded in calldata, so a third party can fund someone else's escrow.
Add an e2e test that wires the deposit + payment helpers through a
real viem WalletClient against an in-memory L1 (custom RPC transport)
and a fetch-mocked gateway that decodes the same calldata via
ESCROW_DEPOSIT_ABI and recovers the GenericPayment signer with
recoverTypedDataAddress — the same cryptographic checks the real
gateway runs. Covers happy path, 402 insufficient-balance, and 409
nonce-replay.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the legacy
grant: stringJSON blob +fileIds: uint256[]with first-class EIP-712 fieldsscopes: string[],grantVersion: uint256, andexpiresAt: uint256, and addgrantVersionto GrantRevocation so the monotonic nonce defends both events against replay. Update the gateway client wire format and GET response shape (now carriesexpiresAt/expired/paymentStatus/paidAt/paidBy/grantVersion/fee) to match data-gateway.