-
Notifications
You must be signed in to change notification settings - Fork 69
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
Token 2022 Support #85
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
==========================================
+ Coverage 54.93% 59.60% +4.66%
==========================================
Files 143 159 +16
Lines 10530 11871 +1341
==========================================
+ Hits 5785 7076 +1291
- Misses 4745 4795 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -27,19 +40,21 @@ public extension SolanaAPIClient { | |||
try await request(method: method, params: []) | |||
} | |||
|
|||
func getMultipleMintDatas( | |||
func getMultipleMintDatas<M: TokenMintState>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change M to MintLayoutState or something similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
@@ -13,24 +13,9 @@ public extension SolanaBlockchainClient { | |||
from owner: PublicKey, | |||
amount: Lamports, | |||
payer: PublicKey, | |||
minRentExemption mre: Lamports? | |||
minRentExemption: Lamports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix docs mre: The min rent exemption (leave it nil if there is no pre-defined)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mre can be non optional now since this info can be retrieved directly from getTokenAccountByOwners, no need to calculate it again
) | ||
|
||
let isAssociatedTokenAddressRegistered: Bool | ||
do { | ||
let info: BufferInfo<SPLTokenAccountState>? = try await apiClient | ||
.getAccountInfo(account: associatedAddress.base58EncodedString) | ||
if info?.owner == TokenProgram.id.base58EncodedString, | ||
if PublicKey.isSPLTokenOrToken2022ProgramId(info?.owner), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reduce into PublicKey.isSPLTokenProgram
.
SPL - Solana Program Library.
Token Program and Token-2022 is a part of this library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
3d71257
to
e072989
Compare
Feature/token 2022 renaming
No description provided.