Cannot topup canister in the IC network

I cannot top up my canister created on the IC network I’m getting following error

An error happened during the call: 3: IC0302: Canister qf2gs-giaaa-aaaai-qgbza-cai has no update method 'wallet_receive'

Is there any workaround for this?

1 Like

The wallet_receive() method must be explicitly defined within the canister that your attempting to send the cycles to. It’s not inherently there. Did you define it?

Actually @Jesse , I didn’t implement that method for now. Do we need to implement that?

Yep. I’ll post an example of this method too. I’ll do so tomorrow when i post the other example i told you I’d post from your other thread.

1 Like

Thanks for the help @Jesse

AFAIK, a canister can send cycles to another canister directly (without requiring a wallet_receive) using:

However, you can’t call deposit_cycles as an ingress message (eg. using dfx).

1 Like

I have accidentally found on this forum an answer from another person about solving this issue and being able to deposit cycles to ANY canister, no matter if it has wallet_receive or not since I needed it for my assets canister that is just a static website and has no SC in it or wallet_receive.

dfx canister --network ic deposit-cycles <cycles> [canister]

And you’re done ! Tested out and working. It can be run in dfx without issues. I don’t know why this information does not at all exist in the official docs, since I believe this is a crucial thing to have over there and must be added in.

3 Likes

Hey @AnonymousCoder, thanks for your help. I tried your exact code with my Canister ID, but I’m getting an error,

Error: The deposit cycles call needs to proxied via the wallet canister. Invoke this command without the –no-wallet flag.

Even though I’m not adding the --no-wallet flag. I then tried testing by adding just --wallet to the call, but then I got: Found argument '3000000' which wasn't expected, or isn't valid in this context (referring to the <cycles amount>).

Any idea how I can top up this canister with cycles? I have cycles in my wallet as shown when running dfx wallet --network ic balance (more than 5.2 Trillion). I want to top up this canister so that I can create new canisters with it.

I received the original error show by OP, which brought me here: An error happened during the call: 3: IC0302: Canister btdpo-wiaaa-aaaaj-adajq-cai has no update method 'wallet_receive'

Thanks in advance
-Shaby

The next release of the wallet binary will call the management canister’s deposit_cycles function instead of the recipient’s wallet_receive function. When dfx 0.10 proper is released, you can call dfx wallet upgrade to resolve this issue, or you can take a short-cut by building the wallet locally and running that command with the DFX_WALLET_WASM variable set to the path to the wallet wasm.

It’s a weird error to get for sure considering that you did not use the --no-wallet flag… I had no such issue when I ran the above to deposit cycles. Are you sure that you ran the command with proper arguments?
Here is the example call which uses real parameters, you can swap out cycles amount with the desired amount as well as the canister principal ID with your own:

dfx canister --network ic deposit-cycles 595176013 epaas-dsdsd-asda-qasad-cai

1 Like

I got the same error on the local dev dfx command, and i look the dfx canister deposit-cycles doc or help, I don’t find the --no-wallet flag

Is this response helpful to you? Depositing Cycles from Terminal - #14 by Severin

the command dfx caniste --wallet <my_wallet_canister_id> deposit-cycles 20000000000000 <canister_id> can works.
thanks.