# Dfx 0.10.0 - dfx canister deposit-cycles returns error

**URL:** <https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251>\
**Category:** Command Line Tools\
**Created:** [May 24, 2022, 7:57am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251 "2022-05-24T07:57:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nakamotik](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nakamotik/32/3530_2.png) [@Nakamotik](https://forum.dfinity.org/u/Nakamotik)\
**Post date:** [May 24, 2022, 7:57am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/1 "2022-05-24T07:57:43Z")

</div>

When I call  
`dfx canister --network ic deposit-cycles 100000000000 main`  
it returns  
`Error: The deposit cycles call needs to proxied via the wallet canister. Invoke this command without the `--no-wallet` flag.`

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [May 24, 2022, 8:08am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/2 "2022-05-24T08:08:46Z")

</div>

Misleading error message. I just patched it, but it hasn’t made its way into a release yet. The new message will be: `The deposit cycles call needs to proxied via the wallet canister. Please run this command using 'dfx canister --wallet <your wallet id> deposit-cycles <other arguments>'.` Does this work?

---

<div class="post-metadata">

**Author:** ![Nakamotik](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nakamotik/32/3530_2.png) [@Nakamotik](https://forum.dfinity.org/u/Nakamotik)\
**Post date:** [May 24, 2022, 8:27am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/3 "2022-05-24T08:27:17Z")

</div>

Thanks, its works. Also `dfx wallet send ...` works too.

---

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [June 11, 2022, 9:33am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/4 "2022-06-11T09:33:35Z")

</div>

I was receiving this error when executing any of the following commands

```auto
% dfx canister --wallet=local deposit-cycles 8000000000000 6t4yy-zqaaa-aaaaa-aag3a-cai 
Error: Text cannot be converted to a Principal; too small.
% dfx canister --wallet=local deposit-cycles 8000000000000 index
Error: Text cannot be converted to a Principal; too small.

```

I figured out that I needed to pass the principal of my wallet, and couldn’t use the wallet name that I had set.

```auto
% dfx canister --wallet=zj7qq-3iaaa-aaaaa-aagjq-cai deposit-cycles 8000000000000 index

```

It would be nice if we could use the wallet name alias with these commands (just like we can use the canister name alias)

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [June 13, 2022, 8:44am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/5 "2022-06-13T08:44:18Z")

</div>

> [@icme](#):
>
> It would be nice if we could use the wallet name alias with these commands (just like we can use the canister name alias)

Added this to our backlog. I agree and I’m not sure why there are even wallet names in the first place if we don’t allow them to be used by name…

---

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [September 9, 2022, 7:47am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/6 "2022-09-09T07:47:12Z")

</div>

Wanted to check in on this, as I’m writing some quickstart documentation for a developer tool and would love for the copy paste steps I’m writing to be easier to digest for the end user (developer).

This is the best solution I have right now

`dfx canister --wallet=$(dfx identity get-wallet) deposit-cycles <cycle_amount> <canister>`

I think the default behavior if a wallet-id or name is not provided would be to use this default wallet for the developer’s identity.

The ideal would be for the command below to use this default wallet

`dfx canister deposit-cycles <cycles> <canister>`

If the sdk team still wants to make the wallet explicit for the IC, then it might be helpful to allow developers to reference a `default` alias via `--wallet=default` that would use the same wallet returned by `dfx identity get-wallet`.

Now this same command would look like

`dfx canister --wallet=default deposit-cycles <cycles> <canister>`.

I also know that the cycles wallet is being deprecated, so I’m not sure if that’s what’s holding this up 🙂

Additionally, I wanted to check in on the dfx ordering of flag arguments ticket mentioned in [Depositing Cycles from Terminal - #14 by Severin](https://forum.dfinity.org/t/depositing-cycles-from-terminal/9438/14) (allow dfx flags to be placed at various placed in the middle of or at the end of the command)

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [September 9, 2022, 8:46am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/7 "2022-09-09T08:46:48Z")

</div>

Using wallet names is still asleep in the backlog. Not deleted/wontfix, just not urgent enough.

> [@icme](#):
>
> The ideal would be for the command below to use this default wallet
> 
> `dfx canister deposit-cycles <cycles> <canister>`

Agreed. Made a quick PR for this: [chore: deposit-cycles uses default wallet if none is specified by sesi200 · Pull Request #2553 · dfinity/sdk · GitHub](https://github.com/dfinity/sdk/pull/2553)

> [@icme](#):
>
> Additionally, I wanted to check in on the dfx ordering of flag arguments ticket mentioned in [Depositing Cycles from Terminal - #14 by Severin](https://forum.dfinity.org/t/depositing-cycles-from-terminal/9438/14) (allow dfx flags to be placed at various placed in the middle of or at the end of the command)

Implemented and will be included in the next release. [Changelog entry here](https://github.com/dfinity/sdk/blob/master/CHANGELOG.md#feat-move-all-the-flags-to-the-end).

---

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [September 9, 2022, 9:03am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/8 "2022-09-09T09:03:48Z")

</div>

20 chars in 👏 👏 👏 👏 👏 👏

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [September 9, 2022, 9:53am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/9 "2022-09-09T09:53:19Z")

</div>

> [@icme](#):
>
> `dfx canister --wallet=$(dfx identity get-wallet) deposit-cycles <cycle_amount> <canister>`

Since you’re not mentioning `--network ic`: Are you aware of `dfx ledger fabricate-cycles`? That would be the easiest way to go about adding cycles on local(!) networks.

---

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [September 9, 2022, 4:13pm UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/10 "2022-09-09T16:13:51Z")

</div>

> [@Vivienne](#):
>
> Since you’re not mentioning `--network ic`: Are you aware of `dfx ledger fabricate-cycles`?

I was not aware of this!

How many cycles can I fabricate locally? More than 100T?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [September 13, 2022, 6:06am UTC](https://forum.dfinity.org/t/dfx-0-10-0-dfx-canister-deposit-cycles-returns-error/13251/11 "2022-09-13T06:06:51Z")

</div>

The only restriction I’m aware of is that the number will be parsed as a Rust `u128`, but otherwise you should be good to go with anything. If you can find an input that breaks your canister I’d be very interested to hear it 😄
