[RFC] Add NamedRemainingAccounts as a BTreeMap<String, AccountInfo> #1900
kevinrodriguez-io
started this conversation in
Ideas
Replies: 1 comment
-
The other use case of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now
RemainingAccounts
is a vector that you have to reference via positioning yourself on it, which makes further modifications and scaling harder to do. I've seen different usage patterns like commenting what they are by index, using a numeric index, but that complicates things a bit on both the client side and program side.The request would be to make another data structure named
NamedRemainingAccounts
and deprecateRemainingAccounts
. So in TS is aRecord<String, anchor.web3.Pubkey>
and it's properly mapped as aBTreeMap<String, AccountInfo>
in Rust land to make it easier to grab accounts since the main usage for RemainingAccounts has been optional accounts, like receiving a mint for a treasury that can be either an ATA or Native Sol. This would work very similar to how bumps are passed, and would also keep the current data structure.Beta Was this translation helpful? Give feedback.
All reactions