Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### feat: streamlined output during asset synchronization

### chore: hide `dfx wallet redeem-faucet-coupon`

## Dependencies

### Motoko
Expand Down
59 changes: 51 additions & 8 deletions docs/cli-reference/dfx-cycles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ dfx cycles [subcommand] [options]

The following subcommands are available:

| Command | Description |
|---------------------------------------|--------------------------------------------------------------------------------------|
| [`approve`](#dfx-cycles-approve) | Approves a principal to spend cycles on your behalf. |
| [`balance`](#dfx-cycles-balance) | Prints the account balance of the user. |
| [`convert`](#dfx-cycles-convert) | Convert some of the user's ICP balance into cycles. |
| [`top-up`](#dfx-cycles-top-up) | Deposit cycles into a canister. |
| [`transfer`](#dfx-cycles-transfer) | Send cycles to another account. |
| `help` | Displays usage information message for a specified subcommand. |
| Command | Description |
|-------------------------------------------------|--------------------------------------------------------------------------------------|
| [`approve`](#dfx-cycles-approve) | Approves a principal to spend cycles on your behalf. |
| [`balance`](#dfx-cycles-balance) | Prints the account balance of the user. |
| [`convert`](#dfx-cycles-convert) | Convert some of the user's ICP balance into cycles. |
| [`redeem-faucet-coupon`](#redeem-faucet-coupon) | Redeem a code at the cycles faucet. |
| [`top-up`](#dfx-cycles-top-up) | Deposit cycles into a canister. |
| [`transfer`](#dfx-cycles-transfer) | Send cycles to another account. |
| `help` | Displays usage information message for a specified subcommand. |

To view usage information for a specific subcommand, specify the subcommand and the `--help` flag. For example, to see usage information for `dfx cycles balance`, you can run the following command:

Expand Down Expand Up @@ -200,6 +201,48 @@ Transfer from a subaccount:
dfx cycles transfer raxcz-bidhr-evrzj-qyivt-nht5a-eltcc-24qfc-o6cvi-hfw7j-dcecz-kae 1000000000 --from-subaccount 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f --network ic
```

## dfx cycles redeem-faucet-coupon

Use the `dfx cycles redeem-faucet-coupon` command to redeem a cycles faucet coupon.
This will redeem a coupon and deposit the cycles to your cycles ledger account.

### Basic usage
```
dfx cycles redeem-faucet-coupon <your faucet coupon>
```

### Arguments

Use the following necessary argument with the `dfx cycles redeem-faucet-coupon` command.


|Argument |Description
----------|--------------
|`<your faucet coupon>` | The coupon code to redeem at the faucet.|


### Flags

You can use the following optional flags with the `dfx cycles redeem-faucet-coupon` command.


|Flag |Description|
|-----|-----------|
|`--faucet`|Alternative faucet address. If not set, this uses the DFINITY faucet.|
|`--yes`|Skips yes/no checks by answering 'yes'. Not recommended outside of CI.|

### Example

If you have a coupon code `ABCDE-ABCDE-ABCDE`, you can redeem it like this:
``` bash
dfx cycles redeem-faucet-coupon 'ABCDE-ABCDE-ABCDE'
```

This will print something similar to this:
```
Redeemed coupon ABCDE-ABCDE-ABCDE to the cycles ledger for 10 TC (trillion cycles). New balance: 10 TC.
```

## dfx cycles top-up

Use the `dfx cycles top-up` command to send cycles from your account to a canister.
Expand Down
55 changes: 0 additions & 55 deletions docs/cli-reference/dfx-wallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ For reference information and examples that illustrate using `dfx wallet` comman
|[`deauthorize`](#dfx-wallet-deauthorize) | Deauthorize a cycles wallet custodian using the custodian's principal.
|`help`|Displays a usage message and the help of the given subcommand(s).
|[`name`](#dfx-wallet-name) |Returns the name of the cycles wallet if you've used the `dfx wallet set-name` command.
|[`redeem-faucet-coupon`](#redeem-faucet-coupon) | Redeem a code at the cycles faucet. |
|[`remove-controller`](#dfx-wallet-remove-controller) |Removes a specified controller from the selected identity's cycles wallet.
|[`send`](#dfx-wallet-send) |Sends a specified amount of cycles from the selected identity's cycles wallet to another canister.
|[`set-name`](#dfx-wallet-set-name) |Specify a name for your cycles wallet.
Expand Down Expand Up @@ -320,60 +319,6 @@ If you have named your cycles wallet "Terrances_wallet", then the command would
Terrances_wallet
```

## dfx wallet redeem-faucet-coupon

Use the `dfx wallet redeem-faucet-coupon` command to redeem a cycles faucet coupon.
If you have no wallet set, this will create a wallet for you.
If you have a wallet set already, this will add the coupon's cycles to your existing wallet.

### Basic usage
```
dfx wallet redeem-faucet-coupon <your faucet coupon>
```

### Arguments

Use the following necessary argument with the `dfx wallet redeem-faucet-coupon` command.


|Argument |Description
----------|--------------
|`<your faucet coupon>` | The coupon code to redeem at the faucet.|


### Flags

You can use the following optional flags with the `dfx wallet redeem-faucet-coupon` command.


|Flag |Description|
|-----|-----------|
|`--faucet`|Alternative faucet address. If not set, this uses the DFINITY faucet.|
|`--yes`|Skips yes/no checks by answering 'yes'. Not recommended outside of CI.|

### Example

If you have no wallet yet and a coupon code `ABCDE-ABCDE-ABCDE`, you can redeem it like this:
``` bash
dfx wallet redeem-faucet-coupon 'ABCDE-ABCDE-ABCDE'
```

This will print something similar to this:
```
Redeemed coupon ABCDE-ABCDE-ABCDE for a new wallet: rdmx6-jaaaa-aaaaa-aaadq-cai
New wallet set.
```

If you have a wallet already and a coupon code `ABCDE-ABCDE-ABCDE`, you can redeem it like this:
``` bash
dfx wallet redeem-faucet-coupon 'ABCDE-ABCDE-ABCDE'
```

This will print something similar to this:
```
Redeemed coupon code ABCDE-ABCDE-ABCDE for 20.000 TC (trillion cycles).
```

## dfx wallet remove-controller

Use the `dfx wallet remove-controller` command to remove a controller of your selected identity's cycles wallet.
Expand Down
1 change: 1 addition & 0 deletions src/dfx/src/commands/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum SubCommand {
Custodians(custodians::CustodiansOpts),
Deauthorize(deauthorize::DeauthorizeOpts),
Name(name::NameOpts),
#[command(hide = true)]
RedeemFaucetCoupon(redeem_faucet_coupon::RedeemFaucetCouponOpts),
RemoveController(remove_controller::RemoveControllerOpts),
Send(send::SendOpts),
Expand Down
Loading