Skip to content
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

rename rpc to something else #3377

Open
pynixwang opened this issue Nov 22, 2024 · 3 comments
Open

rename rpc to something else #3377

pynixwang opened this issue Nov 22, 2024 · 3 comments
Labels
enhancement New feature or request ts

Comments

@pynixwang
Copy link

pynixwang commented Nov 22, 2024

const tx = await program.methods.initialize().rpc();

rpc is not like an action.
maybe send, execute or call is better

@acheroncrypto acheroncrypto added enhancement New feature or request ts labels Nov 23, 2024
@acheroncrypto
Copy link
Collaborator

Yeah, I think send would be more intuitive for sure. We already have plans to do certain naming changes to make things more consistent and intuitive, so we can also include this change during that time.

@mikemaccana
Copy link
Contributor

mikemaccana commented Dec 3, 2024

There was a similar discussion for web3 js v2. send was chosen (and they didn't feel like changing when the discussion came up) but execute makes more sense as send creates ambiguity between sending transactions and sending lamports and sending SPL tokens.

@acheroncrypto
Copy link
Collaborator

execute would be technically incorrect imo, since the TS client is only responsible for sending the transaction, and the execution is done by the validators.

Also, Anchor's send method is namespaced by the program's instruction name, so I'm not sure how it would create the ambiguity you mentioned. It's different for web3js v2 because, from what I've seen, it follows a functional style with a bunch of function declarations, which is great for bundle size but worse for ambiguity/explorability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ts
Projects
None yet
Development

No branches or pull requests

3 participants