-
Notifications
You must be signed in to change notification settings - Fork 299
fix(sdk-coin-sol): fix ata creation for sol 2022 token #6201
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
Conversation
f70320d to
c019ad6
Compare
Ranjna-G
left a comment
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.
LGTM
8f84dd4 to
8c6791a
Compare
shashankms288
left a comment
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.
LGTM
modules/statics/src/account.ts
Outdated
| contractAddress: string, | ||
| asset: UnderlyingAsset, | ||
| features: CoinFeature[] = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.REQUIRES_RESERVE], | ||
| programId = '', |
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.
Why not default it to spl token program id, instead of having an empty string.
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.
Done
8c6791a to
5e4f561
Compare
e04b6fa to
c879d2c
Compare
modules/statics/src/base.ts
Outdated
| export enum ProgramID { | ||
| TokenProgramId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', | ||
| Token2022ProgramId = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', | ||
| } | ||
|
|
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.
Nit: This can reside in account.ts file, base.ts have enums and types that are required by baseCoin class. Can you please also add a description for this enum.
| const tokensArray = tokens.map((token) => token); | ||
| if (tokensArray.length >= 1) { | ||
| // there should never be two tokens with the same contract address, so we assert that here | ||
| assert(tokensArray.length === 1); |
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.
Please verify if we have any testnet and mainnet token with same contract address. This check will fail in that case.
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.
I have checked there is no token with same address in testnet and mainnet
c879d2c to
4acffc6
Compare
TICKET: WIN-5670