I am trying to use XTC from agent-js and I wanted to use the
And this is how you should call the
mint function from
$ dfx canister --network=ic --wallet=$(dfx identity --network=ic get-wallet) call --with-cycles AMOUNT aanaa-xaaaa-aaaah-aaeiq-cai mint "(principal \"$(dfx identity get-principal)\",0:nat)"
The interesting part here is the
As per documentation the
AMOUNT is the cycles amount that you need to mint and the second arg to
0:nat is just a fake argument that gets ignored by
This is also mentioned in this post
One can spot an interesting expression inside the
(to, Nat::from(0)). Unfortunately, this is how XTC’s API works - you have to pass zero as a second argument (which in classic
mint()is the amount of tokens to mint). This value does no affect the algorithm - you will get the same amount of XTC as the amount of cycles you send to this method. So, basically, this second argument is a fake.
mint: (arg_0: Principal, arg_1: bigint) => Promise<MintResult>;
and there’s no api for passing cycles equivalent to
The question is how one could pass cycles to this function or how one could use the mint function from agent-js.