diff --git a/docs/content/profile-keys-setup.md b/docs/content/profile-keys-setup.md index 195cf84aa..3bd8c80c2 100644 --- a/docs/content/profile-keys-setup.md +++ b/docs/content/profile-keys-setup.md @@ -20,7 +20,7 @@ address 5EpqhyY9AfHgmrqwFs7tFh3V89ktNamgTP3TWM5zgeQM8y7a To add funds to a newly created DXNS account using faucet: ``` -dx dxns balance increase --faucet https://dxns2.kube.dxos.network/kube/faucet --account 5EpqhyY9AfHgmrqwFs7tFh3V89ktNamgTP3TWM5zgeQM8y7a +dx dxns balance increase --faucet https://dxns2.kube.dxos.network/kube/faucet --address 5EpqhyY9AfHgmrqwFs7tFh3V89ktNamgTP3TWM5zgeQM8y7a ``` To check balance: diff --git a/packages/cli-dxns/src/handlers/balance.ts b/packages/cli-dxns/src/handlers/balance.ts index 10ce54089..116b7b7f1 100644 --- a/packages/cli-dxns/src/handlers/balance.ts +++ b/packages/cli-dxns/src/handlers/balance.ts @@ -14,11 +14,11 @@ export const getBalance = (params: Params) => async (argv: any) => { const { getDXNSClient } = params; const client = await getDXNSClient(); - const { account = client.keypair?.address, json } = argv; + const { address = client.keypair?.address, json } = argv; - assert(account, 'Account should be provided.'); + assert(address, 'Address should be provided.'); - const currentFree = (await client.apiRaw.query.system.account(account)).data.free; + const currentFree = (await client.apiRaw.query.system.account(address)).data.free; const balance = currentFree.toString(); @@ -30,16 +30,16 @@ export const increaseBalance = (params: Params) => async (argv: any) => { const client = await getDXNSClient(); const { apiRaw, keypair, keyring, transactionHandler } = client; - const { account = keypair?.address, amount, mnemonic, json, faucet } = argv; + const { address = keypair?.address, amount, mnemonic, json, faucet } = argv; - assert(account, 'Account should be provided.'); + assert(address, 'Address should be provided.'); if (mnemonic) { const sudoer = keyring.addFromUri(mnemonic.join(' ')); - const { free: previousFree, reserved: previousReserved } = (await apiRaw.query.system.account(account)).data; + const { free: previousFree, reserved: previousReserved } = (await apiRaw.query.system.account(address)).data; const requestedFree = previousFree.add(new BN(amount)); - const setBalanceTx = apiRaw.tx.balances.setBalance(account, requestedFree, previousReserved); + const setBalanceTx = apiRaw.tx.balances.setBalance(address, requestedFree, previousReserved); const { events } = await transactionHandler.sendSudoTransaction(setBalanceTx, sudoer); const event = events.map((e: any) => e.event).find(apiRaw.events.balances.BalanceSet.is); @@ -63,7 +63,7 @@ export const increaseBalance = (params: Params) => async (argv: any) => { const response = await fetch(faucet, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ account }) + body: JSON.stringify({ account: address }) }); const result = await response.json(); diff --git a/packages/cli-dxns/src/modules/commands/balance.ts b/packages/cli-dxns/src/modules/commands/balance.ts index e3d61fd58..45fde7fe1 100644 --- a/packages/cli-dxns/src/modules/commands/balance.ts +++ b/packages/cli-dxns/src/modules/commands/balance.ts @@ -15,19 +15,19 @@ export const balanceCommand = (params: Params): CommandModule => ({ handler: () => {}, builder: yargs => yargs .command({ - command: ['get [account]'], - describe: 'Get account balance.', + command: ['get [address]'], + describe: 'Get address balance.', builder: yargs => yargs - .option('account', { type: 'string' }), + .option('address', { type: 'string' }), handler: asyncHandler(getBalance(params)) }) .command({ - command: ['increase [account]'], - describe: 'Increase account balance.', + command: ['increase [address]'], + describe: 'Increase address balance.', builder: yargs => yargs - .option('account', { type: 'string' }) + .option('address', { type: 'string' }) .option('amount', { type: 'string' }) .option('faucet', { type: 'string' }),