Hi everyone, Im developing a canister that can deploy a ICRC1 Ledger by uploading wasm. This is my code:
let IC0 : Types.ActorManagement = actor ("aaaaa-aa");
let { canister_id } = await IC0.create_canister({
settings = ?{
controllers = ?[Principal.fromActor(this)];
compute_allocation = null;
memory_allocation = null;
freezing_threshold = null;
};
});
let initArgs : Types.InitArgs = {
token_symbol = "MYTOKEN";
token_name = "My Token";
transfer_fee = 0;
decimals = ?8;
feature_flags = ?{ icrc2 = true };
minting_account = { owner = Principal.fromActor(this); subaccount = null };
fee_collector_account = null;
initial_balances = [];
send_whitelist = ?[];
metadata = [];
archive_options = {
num_blocks_to_archive = 1000;
trigger_threshold = 2000;
controller_id = Principal.fromActor(this);
max_transactions_per_response = null;
max_message_size_bytes = null;
cycles_for_archive_creation = null;
node_max_memory_size_bytes = null;
more_controller_ids = null;
};
max_memo_length = null;
max_message_size_bytes = null;
transaction_window = null;
maximum_number_of_accounts = null;
accounts_overflow_trim_quantity = null;
};
await IC0.install_code({
mode = #install;
canister_id = canister_id;
wasm_module = ledgerWasm;
arg = Blob.toArray(to_candid (initArgs));
});
But it throws this error:
Error: Call was rejected:
Request ID: dbfc1afc4c0a083cc5ab27167ff500c030a5679b5f97b4863cf9844dc8d1506c
Reject code: 4
Reject text: Canister ewdd7-oeaaa-aaaaa-qaa7a-cai trapped explicitly: failed to decode call arguments: Custom(Fail to decode argument 0
Caused by:
Subtyping error: Type mismatch at external/crate_index__candid-0.10.5/src/de.rs:1028)
My wasm file is: https://download.dfinity.systems/ic/04775a0d6a27b65be2412f73172e529a138a6f44/canisters/ic-icrc1-ledger.wasm.gz
I have been struggling to this for several days already. Thank you very much