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

Suggestion: add Base58EncodedAddress constants to avoid unnecessary boilerplate #1689

Closed
mikemaccana opened this issue Oct 6, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@mikemaccana
Copy link
Contributor

mikemaccana commented Oct 6, 2023

Right now people have to run something like:

const SYSTEM_PROGRAM =
  "11111111111111111111111111111111" as Base58EncodedAddress;

const MEMO_PROGRAM =
  "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr" as Base58EncodedAddress;

As a user that wants to send you 4 sol with a note saying 'Thanks!', I'd expect to be able to import SYSTEM_PROGRAM, MEMO_PROGRAM, COMPUTE_BUDGET_PROGRAM and similar from web3.js with the typing done for me.

Motivation

Easier to do this once in web3.js rather than have every example contain the same boilerplate

Example use case

import { SYSTEM_PROGRAM, MEMO_PROGRAM } from "@solana/web3.js";
@mikemaccana mikemaccana added the enhancement New feature or request label Oct 6, 2023
@steveluscher
Copy link
Collaborator

@buffalojoec made this a lot better in #1619.

@steveluscher
Copy link
Collaborator

And also, @lorisleiva's codegen is going to produce generated constants that you can import with reckless abandon, for every program imaginable.

Copy link
Contributor

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants