Uh oh!
There was an error while loading. Please reload this page.
feat(staking,vesting,accounts): provider-lane writes + native transfer - #200
Conversation
B1: executeWrite in staking + vesting now branches on account.type === "local".
The local-key path (getTransactionCount -> prepareTransactionRequest -> sign ->
sendRawTransaction) is unchanged and stays the regression gate. Address-only /
injected-provider accounts route through client.request eth_sendTransaction
(wallet manages nonce + signing), mirroring the proven IC provider lane in
src/contracts/actions.ts. Shared preflight simulate + gas estimate and the
post-mine receipt wait / revert diagnostics are unchanged around the branch.
B2: new accountActions.transfer({to, value}) for native GEN transfers, local-key
only, mirroring the executeWrite local lane. accountActions now takes publicClient.
Unblocks CLI browser-wallet writes routing through the SDK.Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Two SDK changes on the shared write core. The local-key path is unchanged and remains the regression gate.
B1 — provider-aware
executeWrite(staking + vesting)executeWriteinsrc/staking/actions.tsandsrc/vesting/actions.tsnow branches onaccount.type === "local":getTransactionCount->prepareTransactionRequest{type:"legacy"}->signTransactionguard -> sign ->sendRawTransaction), moved verbatim inside theif.eth_gasPricethenclient.request({method:"eth_sendTransaction", ...})withtype:"0x0", wallet manages the nonce. Mirrors the proven IC provider lane insrc/contracts/actions.ts(~:2169-2178 / :2412-2422).Shared preflight simulate + gas estimate stay before the branch; the
publicClient.waitForTransactionReceiptwait, revert diagnostics, and returned{transactionHash, blockNumber, gasUsed}shape are unchanged. Discriminator is strictlyaccount.type === "local"(innersignTransactionguard retained). Nosrc/types/*write-path changes.B2 — native
transferactionsrc/accounts/actions.ts: factory is nowaccountActions(client, publicClient)and exposestransfer({to, value}): Promise<TransactionReceipt>— local-key only (throws a clear "requires a local-key account" error for missing / non-local / Address-only accounts). Mirrors theexecuteWritelocal lane 1:1. Plumbed insrc/client/client.ts(passes the in-scopepublicClient) and typed insrc/types/clients.ts.Testing
npm run build(incl. DTS) green;npm run lintclean.npm test(vitest --typecheck): 115 passed / 8 files (was 98 / 7). Existing local-lane write tests unchanged.tests/staking-actions.test.ts(localvalidatorJoinanchor + providervalidatorDeposit/delegatorExit/validatorJoinevent-decode); provider-lanedescribeintests/vesting-actions.test.ts;transfercases intests/accounts-actions.test.ts;transfertype assertion intests/client.test-d.ts.Unblocks CLI browser-wallet writes routing through the SDK.
Do not merge — shared write core; human review before it lands on
v2-dev.