-
Notifications
You must be signed in to change notification settings - Fork 698
feat: implement wallet_getSubAccounts rpc #1676
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
feat: implement wallet_getSubAccounts rpc #1676
Conversation
✅ Heimdall Review Status
|
b73f805 to
f223d00
Compare
stephancill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the response not be just SubAccount[] vs {subAccounts: SubAccount[]}?
Newportgogogadit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙃
d9efdda to
4c662b7
Compare
4c662b7 to
4709c7d
Compare
| if (!this.chain.rpcUrl) { | ||
| throw standardErrors.rpc.internal('No RPC URL set for chain'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably missed the design reviews for getSubAccounts but should the RPC take a chainID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current BE implementation dedupes them on network so only one sub account is returned per address so chain ID is not required. The current approach is that sub accounts will feel cross-chain as the SDK/keys will perform JIT sub account deployments for crosschain transactions, and also perform JIT signer updates if the local signer is not on a given chain. We can revisit if we need to provide explicit chain id querying here in the future as well
cb-jake
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, curious about chain id being a param
Summary
Integrate with wallet_getSubAccounts RPC
How did you test your changes?
Created section on playground to test RPC against dev endpoint implementation