Syntax error with "wallet_create_canister"

dfx canister --network=ic  call data wallet_create_canister '(record { cycles = 5000000000000 : nat64; controller = "i76lx-xkhlv-bmgqh-iyixq-ganj6-efqfo-k"})'

my data canister is set as wallet canister to default, and i want to create new canisters using this wallet, I already upgraded wasm module for my wallet canister …
Now im getting some syntax error for passing arguments in “wallet_create_canister” function , need a help .
Error :

Error: The Replica returned an error: code 5, message: "Canister ndupa-qaaa-aanoq-cai trapped explicitly: Custom(Fail to decode argument 0 from table0 to record {
  cycles : nat64;
  settings : record {
    controller : opt principal;
    freezing_threshold : opt nat;
    controllers : opt vec principal;
    memory_allocation : opt nat;
    compute_allocation : opt nat;
  };
}

Caused by:
    0: input: 4449444c016c029cb1fa25718daacd9408780100_3f6937366c782d786b686c762d626d6771682d69796978712d67616e6a362d656671666f2d6b637575702d36337966672d7673616d772d62787a68342d736165005039278c040000
       table: type table0 = record { 79_599_772 : text; 2_190_693_645 : nat64 }
       wire_type: table0, expect_type: record {
         cycles : nat64;
         settings : record {
           controller : opt principal;
           freezing_threshold : opt nat;
           controllers : opt vec principal;
           memory_allocation : opt nat;
           compute_allocation : opt nat;
         };
       }
    1: table0 is not a subtype of record {
         cycles : nat64;
         settings : record {
           controller : opt principal;
           freezing_threshold : opt nat;
           controllers : opt vec principal;
           memory_allocation : opt nat;
           compute_allocation : opt nat;
         };
       }
    2: Record field settings: record {
         controller : opt principal;
         freezing_threshold : opt nat;
         controllers : opt vec principal;
         memory_allocation : opt nat;
         compute_allocation : opt nat;
       } is only in the expected type and is not of opt, reserved or null type)"

Also is there a reference to wallet_create_canister method, how can i write my own ?

UPDATE : I also tried it passing like this :

dfx canister --network=ic call data wallet_create_canister '(record{cycles = 30000000000000; settings = record{controller = "i76lx-xkhlv-bmgqh-iyixq-ganj6-efqfofg-vsamw-bxzh4-sae"}})'

New Error :

Error: The Replica returned an error: code 5, message: "Canister ndupa-qaaaak-aanoq-cai trapped explicitly: Custom(Fail to decode argument 0 from table0 to record {
  cycles : nat64;
  settings : record {
    controller : opt principal;
    freezing_threshold : opt nat;
    controllers : opt vec principal;
    memory_allocation : opt nat;
    compute_allocation : opt nat;
  };
}

Caused by:
    0: input: 4449444c026c028daacd94087ce3f9f5d908016c019cb1fa25710100_80c0dfda8ee9063f6937366c782d786b686c762d626d6771682d69796978712d67616e6a362d656671666f2d6b637575702d36337966672d7673616d772d62787a68342d736165
       table: type table0 = record { 2_190_693_645 : int; 2_336_062_691 : table1 }
       type table1 = record { 79_599_772 : text }
       wire_type: table0, expect_type: record {
         cycles : nat64;
         settings : record {
           controller : opt principal;
           freezing_threshold : opt nat;
           controllers : opt vec principal;
           memory_allocation : opt nat;
           compute_allocation : opt nat;
         };
       }
    1: table0 is not a subtype of record {
         cycles : nat64;
         settings : record {
           controller : opt principal;
           freezing_threshold : opt nat;
           controllers : opt vec principal;
           memory_allocation : opt nat;
           compute_allocation : opt nat;
         };
       }
    2: Record field cycles: int is not a subtype of nat64
    3: int is not a subtype of nat64)"

Someone Please Help !!!

Conflicting with type of cycles when passing as argument !! between Nat64/Int.

First, consider putting :nat after the 300000””x

Second, I’ve never seen this call. What are you trying to do? In motoko you can just import your actor, create it and change the controller all from code. No dfx needed.

This wallet create canister call creates new canister from a wallet canister, i got this from smart contract docs…… did you heard about wallet create canister method? If yes can you share me an example , i got one reference from git repo of dfinity but they had it in rust , got me no clue!!! Want it in motoko.

Update : I figured out answer, thank you very much for replying.

dfx canister --network=ic call data wallet_create_canister '(record{cycles = 5000000 : nat64; settings = record{controller = principal "Your Principal here"}})'
1 Like