-
Notifications
You must be signed in to change notification settings - Fork 915
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
[GraphQL]: Token-2022 Extension Instructions #2406
Comments
Hey! I'm interested in working on this issue. Can I get more context on getting started? |
Basically we need to add schema support for Token-2022 extensions. These will appear in a JSON-parsed instruction from an RPC-retrieved transaction or block. I've marked a little placeholder in the instructions schema module where they can live: solana-web3.js/packages/rpc-graphql/src/schema/instruction.ts Lines 515 to 529 in acd929d
I think the easiest way to roll each of these is to grab their layouts from the Solana Transaction Status crate: That file should have all the Token-2022 extensions that are parseable by the RPC's JSON-parsed, and we can just adapt them into GraphQL schema types! The tricky bit is going to be querying the RPC manually (likely via CLI or something) and finding transaction payloads that have some of these instructions and using them in tests. You can just copy-paste them into the |
Looking into it. |
Hey! I was going through Edit: |
So, with the way the GraphQL schema is configured, we can choose to use In other words, if mint: 'BrdbK35MgB3keCWx87eMpWf5v1QudW9vddxyH2Hb2m5r' You could do something like: query notARealQuery {
transaction(signature: '5UJYEYLqHrdmnMU546Gs3Tj6PTnWPpwjarYAcG7Fp165PTnWPpwjarYAcG7Fp165') {
instructions {
... on TransferFeeInitializeTransferFeeConfig {
mint {
lamports
# More fields from `Account`...
... on MintAccount {
supply
# More fields from `MintAccount`...
}
}
}
}
}
} Note this only works if you add the field to the schema's resolver!
|
I'm unable to tick the checkbox in the PR. |
I believe InitializeMint has been done for ConfidentialTransfer
|
Also just noticed this
I believe that should be a BigInt since it is a u64 |
Thanks I'll look into this. I think all |
@Hrushi20 @nasjuice Thank you both for an awesome effort and hammering out all of these extensions!! I'll be sure to shout you guys out in the release. If there's anything else you're interested in working on, feel free to tag me and ask any questions. As I continue to build the GraphQL demo application, I'll uncover more issues and things that need to be done in the GraphQL library. The repository is public, and if you have ideas on stuff you want to add/showcase in the demo app, go ahead and dive in! Maybe we can work in the issues here, and over there as well! |
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. |
Motivation
Token-2022 extensions are live and gaining popularity on all clusters. The GraphQL library must offer support for these extension instructions within the schema.
ConfidentialTransferFee
InitializeConfidentialTransferFeeConfig
WithdrawWithheldTokensFromMint
WithdrawWithheldTokensFromAccounts
HarvestWithheldTokensToMint
EnableHarvestToMint
DisableHarvestToMint
ConfidentialTransfer
InitializeMint
UpdateMint
ConfigureAccount
ApproveAccount
EmptyAccount
Deposit
Withdraw
Transfer
ApplyPendingBalance
EnableConfidentialCredits
DisableConfidentialCredits
EnableNonConfidentialCredits
DisableNonConfidentialCredits
TransferWithSplitProofs
CpiGuardInstruction
Enable
Disable
DefaultAccountStateInstruction
Initialize
Update
GroupMemberPointerInstruction
Initialize
Update
GroupPointerInstruction
Initialize
Update
InterestBearingMintInstruction
Initialize
Update
RequiredMemoTransfersInstruction
Enable
Disable
MetadataPointerInstruction
Initialize
Update
InitializeMintCloseAuthority
InitializePermanentDelegate
Reallocate
TokenGroupInstruction
InitializeGroup
UpdateGroupMaxSize
UpdateGroupAuthority
InitializeMember
TokenMetadataInstruction
Initialize
UpdateField
RemoveKey
UpdateAuthority
Emit
TransferFeeInstruction
InitializeTransferFeeConfig
TransferCheckedWithFee
WithdrawWithheldTokensFromMint
WithdrawWithheldTokensFromAccounts
HarvestWithheldTokensToMint
TransferHookInstruction
Initialize
Update
The text was updated successfully, but these errors were encountered: