Skip to content

Compute mint rent exemption dynamically in JS client#134

Merged
lorisleiva merged 1 commit intomainfrom
loris/use-sync-rent-fn-from-kit
Mar 3, 2026
Merged

Compute mint rent exemption dynamically in JS client#134
lorisleiva merged 1 commit intomainfrom
loris/use-sync-rent-fn-from-kit

Conversation

@lorisleiva
Copy link
Member

This PR uses the new synchronous getMinimumBalanceForRentExemption function from @solana/kit to compute the rent of the new mint account without having to make an RPC call.

This is equivalent to the previous hardcoded solution except that, when these computations will change, we'll only need to change that in one place.

Copy link
Member

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Definitely agree with using the Kit function wherever we need a rent value synchronously.

@lorisleiva lorisleiva merged commit 4b06df8 into main Mar 3, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants