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

Add default value to variablePdaSeedNode #107

Open
lorisleiva opened this issue Jul 12, 2024 · 0 comments
Open

Add default value to variablePdaSeedNode #107

lorisleiva opened this issue Jul 12, 2024 · 0 comments
Labels
proposal Suggesting a change / new feature

Comments

@lorisleiva
Copy link
Member

This could be useful when we know the value of a PDA seed most of the time but would like to allow users to override it when necessary.

For instance, in the following example, we could parameterize the tokenProgram seed whilst making the SPL token the default value.

const node = pdaNode({
    name: 'associatedToken',
    seeds: [
        variablePdaSeedNode('mint', publicKeyTypeNode()),
        constantPdaSeedNode(
            publicKeyTypeNode(),
            publicKeyValueNode('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'),
        ),
        variablePdaSeedNode('owner', publicKeyTypeNode()),
    ],
});
@lorisleiva lorisleiva added the proposal Suggesting a change / new feature label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Suggesting a change / new feature
Projects
None yet
Development

No branches or pull requests

1 participant