Skip to content

Commit

Permalink
New commands: DeriveAccountKeyCommand and ConvertVerificationKeyCommand
Browse files Browse the repository at this point in the history
* New commands: DeriveAccountKeyCommand and ConvertVerificationKeyCommand
  • Loading branch information
safestak-keith authored Jun 10, 2022
1 parent 7625b2e commit 13a1478
Show file tree
Hide file tree
Showing 17 changed files with 683 additions and 66 deletions.
101 changes: 70 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dotnet tool install --global --add-source ./nupkg cscli --version 0.1.0-local-br
### Overview and Help
```console
$ cscli --help
cscli v0.1.0
cscli v0.3.0
A lightweight cross-platform tool for building and serialising Cardano wallet entities (i.e. recovery-phrases, keys, addresses and transactions), querying the chain and submitting transactions to the testnet or mainnet networks. Please refer to https://github.com/CardanoSharp/cscli for further documentation.

USAGE: cscli (OPTION | COMMAND)
Expand All @@ -80,16 +80,18 @@ Options:
Wallet commands:
wallet recovery-phrase generate --size <size> [--language <language>]
wallet key root derive --recovery-phrase "<string>" [--language <language>] [--passphrase "<string>"]
wallet key account derive --recovery-phrase "<string>" [--language <language>] [--passphrase "<string>"] [--account-index <index>]
wallet key stake derive --recovery-phrase "<string>" [--account-index <index>] [--address-index <index>]
wallet key payment derive --recovery-phrase "<string>" [--account-index <index>] [--address-index <index>]
wallet key policy derive --recovery-phrase "<string>" [--policy-index <index>]
wallet key verification convert --signing-key "<bech32_skey>"
wallet address stake derive --recovery-phrase "<string>" --network <network> [--account-index <index>] [--address-index <index>]
wallet address payment derive --recovery-phrase "<string>" --network <network> --payment-address-type <payment-address-type> [--account-index <index>] [--address-index <index>] [--stake-account-index <index>] [--stake-address-index <index>]

Query commands:
query tip --network <network>
query protocol-parameters --network <network>
query info account --network <network> [--stake-address <stake_address>][--address <payment_base_address>]
query info account --network <network> [--stake-address <stake_address> | --address <payment_base_address>]
query asset account --network <network> --stake-address <stake_address>
query info address --network <network> --address <payment_address>
query info transaction --network <network> --tx-id <transaction_id>
Expand All @@ -113,7 +115,7 @@ Arguments:

### Generate Recovery Phrase
```console
$ cscli wallet recovery-phrase generate | tee phrase.prv
$ cscli wallet recovery-phrase generate | tee phrase.en.prv
more enjoy seminar food bench online render dry essence indoor crazy page eight fragile mango zoo burger exhibit crouch drop rocket property alter uphold
```

Expand All @@ -128,36 +130,51 @@ solución aborto víspera puma molino ático ética feroz hacer orador saler

### Derive Root Key
```console
$ cscli wallet key root derive --recovery-phrase "$(cat phrase.prv)" | tee root.xsk
$ cscli wallet key root derive --recovery-phrase "$(cat phrase.en.prv)" | tee root.en.xsk
root_xsk12qpr53a6r7dpjpu2mr6zh96vp4whx2td4zccmplq3am6ph6z4dga6td8nph4qpcnlkdcjkd96p83t23mplvh2w42n6yc3urav8qgph3d9az6lc0px7xq7sau4r4dsfp9h0syfkhge8e6muhd69vz9j6fggdhgd4e
```

### Derive Account Key
```console
$ cscli wallet key account derive --recovery-phrase "$(cat phrase.en.prv)" | tee acct_0.en.xsk
acct_xsk13pfkzdyzuagmsquy0xjvszdxdjt84x49yrmvt2f3z8ndp6zz4dgka03j3ctm4gne9s5gullvjd7kynxxkny4qwyuuup2mcjfztctswdu3zp4s3ps5dskaq929vrp6cw8z3u77x7mymgntjw46f4l9kh3mcvg78y9
```

<details>
<summary>Account Key with Specific Index</summary>

```console
$ cscli wallet key account derive --recovery-phrase "$(cat phrase.en.prv)" --account-index 96884067 | tee acct_96884067.en.xsk
acct_xsk1vzcpqwahy0asxuua4gswzjagmt5awjepy9clhmvtr8tgpejz4dglkfl7zhunx0dcrvljtmgcx59yzv728wlxllp646qudhgkuaj3xycu4pkysaaau0lm4z2s8t2yum7nyfn99e3xxrwgaz5yt367r8638uetazlu
```
</details>

### Derive Payment Key
```console
$ cscli wallet key payment derive --recovery-phrase "$(cat phrase.prv)" | tee pay_0_0.xsk
$ cscli wallet key payment derive --recovery-phrase "$(cat phrase.en.prv)" | tee pay_0_0.en.xsk
addr_xsk1fzw9r482t0ekua7rcqewg3k8ju5d9run4juuehm2p24jtuzz4dg4wpeulnqhualvtx9lyy7u0h9pdjvmyhxdhzsyy49szs6y8c9zwfp0eqyrqyl290e6dr0q3fvngmsjn4aask9jjr6q34juh25hczw3euust0dw
```
<details>
<summary>Payment Key with Custom Indexes</summary>

```console
$ cscli wallet key payment derive --recovery-phrase "$(cat phrase.prv)" --account-index 569 --address-index 6949 | tee pay_569_6949.xsk
$ cscli wallet key payment derive --recovery-phrase "$(cat phrase.en.prv)" --account-index 569 --address-index 6949 | tee pay_569_6949.en.xsk
addr_xsk1kzjky39hv28q30qecg46f3cag3nwsjnnvn5uf0jtkrsxau2z4dgssyrv8jfwdh6frfkd0hskhszcf98xskje0c6ttcnz7k2cwdmc62uv7k6w7nwdcngkwn0semehjsdaajlv2nr5c0rg077dnsyjwxm05vhkuqet
```
</details>
<details>
<summary>Payment Key with cardano-cli Output Key Files</summary>

```console
$ cscli wallet key payment derive --recovery-phrase "$(cat phrase.prv)" --signing-key-file pay_0_0.skey --verification-key-file pay_0_0.vkey | tee pay_0_0.xsk
$ cscli wallet key payment derive --recovery-phrase "$(cat phrase.en.prv)" --signing-key-file pay_0_0.en.skey --verification-key-file pay_0_0.en.vkey | tee pay_0_0.en.xsk
addr_xsk1kzjky39hv28q30qecg46f3cag3nwsjnnvn5uf0jtkrsxau2z4dgssyrv8jfwdh6frfkd0hskhszcf98xskje0c6ttcnz7k2cwdmc62uv7k6w7nwdcngkwn0semehjsdaajlv2nr5c0rg077dnsyjwxm05vhkuqet
$ cat pay_0_0.skey
$ cat pay_0_0.en.skey
{
"type": "PaymentExtendedSigningKeyShelley_ed25519_bip32",
"description": "Payment Signing Key",
"cborHex": "5880489c51d4ea5bf36e77c3c032e446c79728d28f93acb9ccdf6a0aab25f042ab5157073cfcc17e77ec598bf213dc7dca16c99b25ccdb8a04254b0143443e0a2724de9503426759fa18624657f5bcc932f38220ec9eceb262907caf2d198b6e0faa2fc8083013ea2bf3a68de08a59346e129d7bd858b290f408d65cbaa97c09d1cf"
}
$ cat pay_0_0.vkey
$ cat pay_0_0.en.vkey
{
"type": "PaymentExtendedVerificationKeyShelley_ed25519_bip32",
"description": "Payment Verification Key",
Expand Down Expand Up @@ -188,31 +205,31 @@ $ cat pay_0_0.es.vkey

### Derive Stake Key
```console
$ cscli wallet key stake derive --recovery-phrase "$(cat phrase.prv)" | tee stake_0_0.xsk
$ cscli wallet key stake derive --recovery-phrase "$(cat phrase.en.prv)" | tee stake_0_0.en.xsk
stake_xsk1xr5c8423vymrfvrqz58wqqtpekg8cl2s7zvuedeass77emzz4dgs32nfp944ljxw86h7wkxcrut8gr8qmql8gvc9slc8nj9x47a6jtaqqxf9ywd4wfhrzv4c54vcjp827fytdzrxs3gdh5f0a0s7hcf8a5e4ay8g
```

<details>
<summary>Stake Key with Custom Indexes</summary>

```console
$ cscli wallet key stake derive --recovery-phrase "$(cat phrase.prv)" --account-index 968 --address-index 83106 | tee stake_968_83106.xsk
$ cscli wallet key stake derive --recovery-phrase "$(cat phrase.en.prv)" --account-index 968 --address-index 83106 | tee stake_968_83106.en.xsk
stake_xsk14p0lhj3txvfcj8j08dk3ur954hmcfz6u6t00q0a3vnrsd7zz4dgcy9dwcxgf67v4rdp4mk9tkeqw70y4m7va73thnel7jwyx0achc5tyyx8r2au5x3pw37zhznj03v2cajc96paltxlh8hpefssucyecus24q26n
```
</details>
<details>
<summary>Stake Key with cardano-cli Output Key Files</summary>

```console
$ cscli wallet key stake derive --recovery-phrase "$(cat phrase.prv)" --signing-key-file stake_0_0.skey --verification-key-file stake_0_0.vkey | tee stake_0_0.xsk
$ cscli wallet key stake derive --recovery-phrase "$(cat phrase.en.prv)" --signing-key-file stake_0_0.en.skey --verification-key-file stake_0_0.en.vkey | tee stake_0_0.en.xsk
stake_xsk14p0lhj3txvfcj8j08dk3ur954hmcfz6u6t00q0a3vnrsd7zz4dgcy9dwcxgf67v4rdp4mk9tkeqw70y4m7va73thnel7jwyx0achc5tyyx8r2au5x3pw37zhznj03v2cajc96paltxlh8hpefssucyecus24q26n
$ cat stake_0_0.skey
$ cat stake_0_0.en.skey
{
"type": "StakeExtendedSigningKeyShelley_ed25519_bip32",
"description": "Stake Signing Key",
"cborHex": "588030e983d551613634b060150ee00161cd907c7d50f099ccb73d843decec42ab5108aa69096b5fc8ce3eafe758d81f16740ce0d83e74330587f079c8a6afbba92f1bd85ec71d2d8ce0180138310983aafffa4585486db1576bc385b0ae350562e6a001925239b5726e3132b8a5598904eaf248b688668450dbd12febe1ebe127ed"
}
$ cat stake_0_0.vkey
$ cat stake_0_0.en.vkey
{
"type": "StakeVerificationKeyShelley_ed25519",
"description": "Stake Verification Key",
Expand All @@ -223,15 +240,15 @@ $ cat stake_0_0.vkey

### Derive Stake/Reward Address
```console
$ cscli wallet address stake derive --recovery-phrase "$(cat phrase.prv)" --network mainnet | tee stake_0_0.addr
$ cscli wallet address stake derive --recovery-phrase "$(cat phrase.en.prv)" --network mainnet | tee stake_0_0.en.addr
stake1u9wqktpz964g6jaemt5wr5tspy9cqxpdkw98d022d85kxxc2n2yxj
```

<details>
<summary>Stake Address with Custom Indexes</summary>

```console
$ cscli wallet address stake derive --recovery-phrase "$(cat phrase.prv)" --network mainnet --account-index 1 --address-index 7 | tee stake_1_7.addr
$ cscli wallet address stake derive --recovery-phrase "$(cat phrase.en.prv)" --network mainnet --account-index 1 --address-index 7 | tee stake_1_7.en.addr
stake1u87phtdn9shvp39c44elyfdduuqg7wz072vs0vjvc20hvaqym7xan
```
</details>
Expand All @@ -246,29 +263,30 @@ stake_test1uztkvps54v3yrwvxhvfz9uph8g6e2zd8jcg2cyss45g7xqclj4scq

### Derive Payment Enterprise Address
```console
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.prv)" --payment-address-type enterprise --network mainnet | tee pay_0_0.addr
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.en.prv)" --payment-address-type enterprise --network mainnet | tee pay_0_0.en.addr
addr1vy5zuhh9685fup86syuzmu3e6eengzv8t46mfqxg086cvqqrukl6w
```

<details>
<summary>Payment Enterprise Address with Custom Indexes</summary>

```console
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.prv)" --payment-address-type enterprise --network mainnet --account-index 1387 --address-index 12 | tee pay_1387_12.addr
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.en.prv)" --payment-address-type enterprise --network mainnet --account-index 1387 --address-index 12 | tee pay_1387_12.en.addr
addr1vy3y89nnzdqs4fmqv49fmpqw24hjheen3ce7tch082hh6xcc8pzd9
```

</details>

### Derive Payment Base Address
```console
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.prv)" --payment-address-type base --network mainnet | tee pay_0_0_0_0.addr
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.en.prv)" --payment-address-type base --network mainnet | tee pay_0_0_0_0.en.addr
addr1qy5zuhh9685fup86syuzmu3e6eengzv8t46mfqxg086cvqzupvkzyt42349mnkhgu8ghqzgtsqvzmvu2w675560fvvdspma4ht
```

<details>
<summary>Payment Base Address with Custom Indexes</summary>
```console
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.prv)" --payment-address-type base --network mainnet --account-index 1387 --address-index 12 --stake-account-index 968 --stake-address-index 83106 | tee pay_1387_12_968_83106.addr
$ cscli wallet address payment derive --recovery-phrase "$(cat phrase.en.prv)" --payment-address-type base --network mainnet --account-index 1387 --address-index 12 --stake-account-index 968 --stake-address-index 83106 | tee pay_1387_12_968_83106.en.addr
addr1qy3y89nnzdqs4fmqv49fmpqw24hjheen3ce7tch082hh6x7nwwgg06dngunf9ea4rd7mu9084sd3km6z56rqd7e04ylslhzn9h
```
</details>
Expand All @@ -283,22 +301,22 @@ addr_test1qpvttg5263dnutj749k5dcr35yk5mr94fxx0q2zs2xeuxq5hvcrpf2ezgxucdwcjytcrww

### Derive Policy Key
```console
$ cscli wallet key policy derive --recovery-phrase "$(cat phrase.prv)" | tee policy_0.sk
$ cscli wallet key policy derive --recovery-phrase "$(cat phrase.en.prv)" | tee policy_0.en.sk
policy_sk1trt3shjrd4gy70q4m2ejgjgsdzwej4whc4r2trrcwedlpm6z4dglxl4nycrd8fptxrkye3tl3q29euxlqj7zndk9cfg4tskqlnp90uqwjqz02
```
<details>
<summary>Policy Key with Custom Indexes</summary>

```console
$ cscli wallet key policy derive --recovery-phrase "$(cat phrase.prv)" --policy-index 88 | tee policy_88.xsk
$ cscli wallet key policy derive --recovery-phrase "$(cat phrase.en.prv)" --policy-index 88 | tee policy_88.en.xsk
policy_sk1tz5k03lravcx7ecjveg6j0ndyydma2a89ny4zkmvzvpz4u6z4dgkxctdpcvhjvjl3j4peywe4l25zu4672eg5qsluz36z5mgm4n2ftg3nhmyd
```
</details>
<details>
<summary>Policy Key with cardano-cli Output Key Files</summary>

```console
$ cscli wallet key policy derive --recovery-phrase "$(cat phrase.prv)" --signing-key-file policy_0.skey --verification-key-file policy_0.vkey | tee policy_0.xsk
$ cscli wallet key policy derive --recovery-phrase "$(cat phrase.en.prv)" --signing-key-file policy_0.skey --verification-key-file policy_0.vkey | tee policy_0.xsk
policy_sk1trt3shjrd4gy70q4m2ejgjgsdzwej4whc4r2trrcwedlpm6z4dglxl4nycrd8fptxrkye3tl3q29euxlqj7zndk9cfg4tskqlnp90uqwjqz02
$ cat policy_0.skey
{
Expand All @@ -315,6 +333,27 @@ $ cat policy_0.vkey
```
</details>

### Convert Verification Key
```console
$ cscli wallet key verification convert --signing-key $(cat pay_0_0.en.xsk) | tee pay_0_0.en.xvk
addr_xvk1m62sxsn8t8apscjx2l6mejfj7wpzpmy7e6ex9yru4uk3nzmwp74zljqgxqf752ln56x7pzjex3hp98tmmpvt9y85prt9ew4f0syarncveq5jl
```

<details>
<summary>Verification Key with cardano-cli Output Key Files</summary>

```console
$ cscli wallet key verification convert --signing-key $(cat stake_0_0.en.xsk) --verification-key-file stake_0_0.en.vkey | tee stake_0_0.en.xvk
stake_xvk1r0v9a3ca9kxwqxqp8qcsnqa2llaytp2gdkc4w67rskc2udg9vtn2qqvj2gum2unwxyet3f2e3yzw4ujgk6yxdpzsm0gjl6lpa0sj0mg4tq9sj
$ cat stake_0_0.en.vkey
{
"type": "StakeVerificationKeyShelley_ed25519",
"description": "Stake Verification Key",
"cborHex": "58201bd85ec71d2d8ce0180138310983aafffa4585486db1576bc385b0ae350562e6"
}
```
</details>

### Submit Transaction
```console
$ cscli transaction submit --network testnet --cbor-hex 84a600818258207f1d24706e65b3eaef608d6ba5adf8b2bf69254bbd1e1532fa7c601a1d6aca3d000d8001828258390058b5a28ad45b3e2e5ea96d46e071a12d4d8cb5498cf0285051b3c30297660614ab2241b986bb1222f0373a359509a79610ac1210ad11e3031a05f5e10082581d60f3a76db98805ebfb391d8a7fa176e0a4da4d20955c47a5d35936353c1a35a23dbb021a0002ab45031a03831a6f0e80a1008182582047a69a1a41541c00a1e62ab8d78c1870e4f04c0507530b90c7dfde2a144d0cfa58406f50cd131250768a3b707e5eb5797e1dc519157e8c7ac27a72ac472fb546bc4604d3b51b2460e4517e28aea5fd0d19ddf8d95d9bf223e59f0306db0a7794d40af5f6
Expand All @@ -325,20 +364,20 @@ $ cscli transaction submit --network testnet --cbor-hex 84a600818258207f1d24706e
```console
$ cscli query tip --network mainnet
{
"hash": "ae5514780cb47a920cd219a4635a54c9ce517a89c65889325c1fd6d166cfdcaa",
"epoch_no": 339,
"abs_slot": 61499734,
"epoch_slot": 414934,
"block_no": 7271096,
"block_time": "2022-05-20T17:00:25"
"hash": "bc0e501e50c42ed6d2964e418b0a626d6026f86d7c205c27fe5b96cb34d36ad9",
"epoch_no": 343,
"abs_slot": 63207567,
"epoch_slot": 394767,
"block_no": 7353437,
"block_time": "2022-06-09T11:24:18"
}
```

### Query Protocol Parameters
```console
$ cscli query protocol-parameters --network mainnet
{
"epoch_no": 339,
"epoch_no": 343,
"min_fee_a": 44,
"min_fee_b": 155381,
...
Expand Down Expand Up @@ -437,7 +476,7 @@ $ cscli query info transaction --network testnet --txid 4fe73db7e345f6853ade214b

### Bech32 Decode
```console
$ cscli bech32 decode --value "$(cat pay_0_0.addr)"
$ cscli bech32 decode --value "$(cat pay_0_0.en.addr)"
61282e5ee5d1e89e04fa81382df239d6733409875d75b480c879f58600
```

Expand Down
23 changes: 11 additions & 12 deletions Src/ConsoleTool/BackendGateway.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using CardanoSharp.Wallet.Enums;
using Refit;

namespace Cscli.ConsoleTool.Koios
namespace Cscli.ConsoleTool.Koios;

public static class BackendGateway
{
public static class BackendGateway
{
public static T GetBackendClient<T>(NetworkType networkType) =>
RestService.For<T>(GetBaseUrlForNetwork(networkType));
public static T GetBackendClient<T>(NetworkType networkType) =>
RestService.For<T>(GetBaseUrlForNetwork(networkType));

private static string GetBaseUrlForNetwork(NetworkType networkType) => networkType switch
{
NetworkType.Mainnet => "https://api.koios.rest/api/v0",
NetworkType.Testnet => "https://testnet.koios.rest/api/v0",
_ => throw new ArgumentException($"{nameof(networkType)} {networkType} is invalid", nameof(networkType))
};
}
private static string GetBaseUrlForNetwork(NetworkType networkType) => networkType switch
{
NetworkType.Mainnet => "https://api.koios.rest/api/v0",
NetworkType.Testnet => "https://testnet.koios.rest/api/v0",
_ => throw new ArgumentException($"{nameof(networkType)} {networkType} is invalid", nameof(networkType))
};
}
2 changes: 2 additions & 0 deletions Src/ConsoleTool/CommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ private static ICommand ParseWalletCommands(string intent, string[] args) =>
{
"wallet recovery-phrase generate" => BuildCommand<GenerateMnemonicCommand>(args),
"wallet key root derive" => BuildCommand<DeriveRootKeyCommand>(args),
"wallet key account derive" => BuildCommand<DeriveAccountKeyCommand>(args),
"wallet key payment derive" => BuildCommand<DerivePaymentKeyCommand>(args),
"wallet key stake derive" => BuildCommand<DeriveStakeKeyCommand>(args),
"wallet key policy derive" => BuildCommand<DerivePolicyKeyCommand>(args),
"wallet address payment derive" => BuildCommand<DerivePaymentAddressCommand>(args),
"wallet address stake derive" => BuildCommand<DeriveStakeAddressCommand>(args),
"wallet key verification convert" or "wallet key public convert" => BuildCommand<ConvertVerificationKeyCommand>(args),
_ => new ShowInvalidArgumentCommand(intent)
};

Expand Down
12 changes: 9 additions & 3 deletions Src/ConsoleTool/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ public static class Constants
public const int DefaultMnemonicCount = 24;
public const int MaxDerivationPathIndex = Int32.MaxValue; // 2^31 - 1
// Bech32 Prefixes https://cips.cardano.org/cips/cip5/
public const string RootKeyExtendedBech32Prefix = "root_xsk";
public const string PaymentSigningKeyBech32Prefix = "addr_xsk";
public const string StakeSigningKeyBech32Prefix = "stake_xsk";
public const string RootExtendedSigningKeyBech32Prefix = "root_xsk";
public const string RootSigningKeyBech32Prefix = "root_sk";
public const string AccountExtendedSigningKeyBech32Prefix = "acct_xsk";
public const string AccountSigningKeyBech32Prefix = "acct_sk";
public const string PaymentExtendedSigningKeyBech32Prefix = "addr_xsk";
public const string PaymentSigningKeyBech32Prefix = "addr_sk";
public const string StakeExtendedSigningKeyBech32Prefix = "stake_xsk";
public const string StakeSigningKeyBech32Prefix = "stake_sk";
public const string PolicySigningKeyBech32Prefix = "policy_sk";
// JSON CBOR text envelopes from cardano-cli
public const string PaymentSKeyJsonTypeField = "PaymentSigningKeyShelley_ed25519";
Expand Down Expand Up @@ -50,6 +55,7 @@ public static class Constants
{ "--stake-address", "stakeAddress" },
{ "--cbor-hex", "cborHex" },
{ "--tx-id", "txId" },
{ "--signing-key", "signingKey" },
//{ "--output-format", "outputFormat" },
};
}
2 changes: 1 addition & 1 deletion Src/ConsoleTool/Crypto/DecodeBech32Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ValueTask<CommandResult> ExecuteAsync(CancellationToken ct)
try
{
var hex = Bech32
.Decode(Value, out var ver, out var prefix)
.Decode(Value, out _, out _)
.ToStringHex();
var result = CommandResult.Success(hex);
return ValueTask.FromResult(result);
Expand Down
4 changes: 2 additions & 2 deletions Src/ConsoleTool/Crypto/EncodeBech32Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public ValueTask<CommandResult> ExecuteAsync(CancellationToken ct)
try
{
var rawBytesValue = Convert.FromHexString(Value);
var hex = Bech32.Encode(rawBytesValue, Prefix);
var result = CommandResult.Success(hex);
var bech32Value = Bech32.Encode(rawBytesValue, Prefix);
var result = CommandResult.Success(bech32Value);
return ValueTask.FromResult(result);
}
catch (FormatException ex)
Expand Down
Loading

0 comments on commit 13a1478

Please sign in to comment.