Hello there
I wanted to integrate this rust library made by @amschel99 in my project and when I went through the source code, I see that in the function: transfer_icp, you’ve used this function: transfer
calling the icp ledger, ofcourse. What my question is, if I’d like to take ICP from the user, and then use that to convert to cycles for a new canister creation or top up. We usually use, approve and transfer_from functions of icrc2 in icp ledger, So, my question is in order to use your library in my project, will I have to alter the transfer function or just proceed with this one? Please let me know, thanks.
The transfer to the CMC needs to be made with the ledger’s transfer
function. This is because the icrc methods write the memo a bit differently in the resulting block, which the CMC does not recognize. We’re aware that this sucks and have an item in the backlog to make the CMC accept icrc transfers
1 Like
Thanks for your reply. @Severin
I just need a confirmation now that, can I perform the transfer (ledger’s transfer func) from user to my backend canister, such that I can send the tokens to cmc and further use them for cycle creation or top up.
Yes, you can do that transfer with one of the icrc methods, or transfer
. Either work fine
1 Like