We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As I understand, parameters are different than a record. Currently, the code looks like this:
public shared ({ caller }) func icrc1_transfer({ from_subaccount : ?Subaccount; to : Account; amount : Tokens; fee : ?Tokens; memo : ?Memo; created_at_time : ?Timestamp; }) : async Result<TxIndex, TransferError> dfx canister call <canister_id> icrc1_transfer '("<from_subaccount>", "<to>", <amount>, <fee>, "<memo>", <created_at_time>)'
It should be
/// Arguments for a transfer operation public type TransferArgs = { from_subaccount : ?Subaccount; to : Account; amount : Tokens; fee : ?Tokens; memo : ?Blob; /// The time at which the transaction was created. /// If this is set, the canister will check for duplicate transactions and reject them. created_at_time : ?Nat64; }; public shared ({ caller }) func icrc1_transfer(args: TransferArgs) : async Result<TxIndex, TransferError> { applyTransfer({ spender = caller; source = #Icrc1Transfer; from = { owner = caller; subaccount = args.from_subaccount; }; to = args.to; amount = args.amount; fee = args.fee; memo = args.memo; created_at_time = args.created_at_time; }); }; dfx canister call icrc1 icrc1_transfer '( record { from_subaccount = null; to = record {account = "account-id", subaccount = null}; amount = record {e8s = 100_000_000}; fee = null; memo = null; created_at_time = null; } )'
The text was updated successfully, but these errors were encountered:
Sorry, I can't spot the difference between the TransferArgs in the "should be" section and the type in the Motoko implementation. Could you clarify?
TransferArgs
amount = record {e8s = 100_000_000};
Note that "amount" is of nat type in the ICRC-1 standard, not of a record type.
nat
Sorry, something went wrong.
No branches or pull requests
As I understand, parameters are different than a record.
Currently, the code looks like this:
It should be
The text was updated successfully, but these errors were encountered: