-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: update tokenAmount
and splTokenTransferCheckedInfo
models
#276
base: master
Are you sure you want to change the base?
Conversation
packages/solana/lib/src/rpc/dto/parsed_message/spl_token_transfer_checked_info.dart
Outdated
Show resolved
Hide resolved
…` fields feat: add helper method `singleAuthority` to retrieve corresponding authority
final List<String>? signers; | ||
|
||
/// If [authority] is not provided, [multisigAuthority] must be provided. And vice versa. | ||
String get singleAuthority => authority ?? multisigAuthority!; |
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.
Added helper method to retrieve correct authority
.
final List<String>? signers; | ||
|
||
/// If [authority] is not provided, [multisigAuthority] must be provided. And vice versa. | ||
String get singleAuthority => authority ?? multisigAuthority!; |
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.
Added helper method to retrieve correct authority
.
Would be great if you could find some time (30min) for some 1-1 catchup - would love to properly spin test environment (as it does not seem to work for me now), because I'd like to also add tests for these new changes, as it's very important to not mess anything up. |
Sure, find me in Solana Dart developers Discord channel and let's schedule some call. |
await solanaClient.sendAndConfirmTransaction( | ||
message: Message.only( | ||
TokenInstruction.transferChecked( | ||
amount: 10, | ||
decimals: 2, | ||
source: | ||
Ed25519HDPublicKey.fromBase58(senderTokenAccounts[0].pubkey), | ||
mint: token.address, | ||
destination: wallet.publicKey, | ||
owner: source.publicKey, | ||
), | ||
), | ||
signers: [source], | ||
commitment: Commitment.finalized, | ||
); |
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.
It keeps failing with
jsonrpc-2.0 error (-32002): Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
{accounts: null, err: AccountNotFound, logs: [], unitsConsumed: 0}
I assume I don't pass correct params or I'm missing something.
|
||
group('SplTokenTransferCheckedInfo test', () { | ||
test('authority is not available', () { | ||
// TODO |
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.
Not sure how to make multisig
transaction. Because then authority
will be null
and multisig
with signatures
- won't. Would love to have helping hand here.
|
||
group('SplTokenTransferInfo test', () { | ||
test('authority is not available', () { | ||
// TODO |
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.
Not sure how to make multisig
transaction. Because then authority
will be null
and multisig
with signatures
- won't. Would love to have helping hand here.
Added test commit with comments. Would love to hear suggestions on how to fix mentioned problems. |
Changes
Current models have not included several fields, which seems to be existing in latest solana implementation.
Sample transaction.
After implementing changes, locally it works well.
To simulate this outcome, send USDC to your
devnet
wallet. It seems thatchecked transfer
has several more fields. However - I have not found any full official json for these models, therefore not sure, if they can be nullable or are fixed. Would be great if someone could guide me here.Furthermore, after running solana test suite and running
flutter test
- it simply timed out. I guess I'm not doing something correctly. Would love to get some guidance here.Checklist