feat: Add local rent exemption calculator#1065
Conversation
🦋 Changeset detectedLatest commit: 8fa6ff0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
f6a6044 to
4bc9a37
Compare
BundleMonFiles updated (4)
Unchanged files (132)
Total files change +704B +0.18% Final result: ✅ View report in BundleMon website ➡️ |
mcintyre94
left a comment
There was a problem hiding this comment.
Thanks for this! The logic looks good, just a small nitpick on the function signature.
| * | ||
| * @param space The number of bytes of account data. | ||
| */ | ||
| export function getMinimumBalanceForRentExemption(space: bigint | number = 0): Lamports { |
There was a problem hiding this comment.
I'd prefer to just use bigint as input here, to match the rest of the library. We generally leave type conversion to callers to make the library simpler and avoid branching (in cases where that's relevant).
I'd also remove the default, because I think it'll make the calling code clearer.
|
Re the CI issue, if you run Re the changeset, as this is new functionality we'd want to release a new version with this. If you do |
887d405 to
657cb0f
Compare
|
@mcintyre94 Thank you for the review. I've updated the function signature, fixed prettier issues, and included the changeset. |
657cb0f to
153bc9c
Compare
153bc9c to
ca916a5
Compare
8aa358b to
9a831c7
Compare
Your organization requires reapproval when changes are made, so Graphite has dismissed approvals. See the output of git range-diff at https://github.com/anza-xyz/kit/actions/runs/20787741799
9a831c7 to
914ae56
Compare
914ae56 to
8fa6ff0
Compare
Your organization requires reapproval when changes are made, so Graphite has dismissed approvals. See the output of git range-diff at https://github.com/anza-xyz/kit/actions/runs/20789825575
mcintyre94
left a comment
There was a problem hiding this comment.
Thankyou for this! And thankyou for your patience getting it merged!
|
🔎💬 Inkeep AI search and chat service is syncing content for source 'Solana Kit Docs' |
|
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
Problem
Logic for the getMinimumBalanceForRentExemption function is stateless, so there's no need to make an rpc call.
Summary of Changes
packages/kit/src/get-minimum-balance-for-rent-exemption.tspackages/kit/src/index.ts.Tests added
packages/kit/src/__tests__/get-minimum-balance-for-rent-exemption-test.tsCloses #777