Repository navigation
feat(staking,vesting,accounts): provider-lane writes + native transfer - #200
Merged
Merged
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.