Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
change to staking key and add spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
icerove committed Nov 4, 2019
1 parent 82d61d5 commit 8c80fec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For account:
near view <accountId> # view account state
near keys <accountId> # view account public keys
near send <sender> <receiver> <amount> # send tokens to given receiver
near stake <accountId> <publicKey> <amount> # create staking transaction (base58 encoded)
near stake <accountId> <stakingKey> <amount> # create staking transaction (stakingKey is base58 encoded)
near delete <accountId> <beneficiaryId> # delete an account and transfer funds to beneficiary account
```

Expand All @@ -40,7 +40,7 @@ For smart contract:
[args] # can modify state
near view <contractName> <methodName> # make smart contract call which can
[args] # view state
near clean # clean the build environment
near clean # clean the smart contract build locally(remove ./out )
```

For transactions:
Expand Down
12 changes: 6 additions & 6 deletions bin/near
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const exitOnError = async function(promise) {
}
}

//For smart contract:
// For smart contract:
const { spawn } = require('child_process');
const build = {
command: 'build',
Expand Down Expand Up @@ -67,7 +67,7 @@ const callViewFunction = {

const clean = {
command: 'clean',
desc: 'clean the build environment',
desc: 'clean the smart contract build locally',
builder: (yargs) => yargs
.option('outDir', {
desc: 'build directory',
Expand All @@ -77,7 +77,7 @@ const clean = {
handler: (argv) => exitOnError(main.clean(argv))
};

//For Account:
// For Account:
const createAccount = {
command: 'create_account <accountId>',
desc: 'create a developer account with --masterAccount, --publicKey and --initialBalance',
Expand Down Expand Up @@ -154,15 +154,15 @@ const keys = {
};

const stake = {
command: 'stake <accountId> <stakeKey> <amount>',
command: 'stake <accountId> <stakingKey> <amount>',
desc: 'create staking transaction',
builder: (yargs) => yargs
.option('accountId', {
desc: 'Account to stake on',
type: 'string',
required: true,
})
.option('stakeKey', {
.option('stakingKey', {
descr: 'Public key to stake with (base58 encoded)',
type: 'string',
required: true,
Expand All @@ -182,7 +182,7 @@ const sendMoney = {
handler: (argv) => exitOnError(main.sendMoney(argv))
};

//For transaction:
// For transaction:
const txStatus = {
command: 'tx-status <hash>',
desc: 'lookup transaction status by hash',
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function connect(options) {

// TODO: Fix promisified wrappers to handle error properly

//For smart contract:
// For smart contract:
exports.clean = async function() {
const rmDirFn = () => {
return new Promise(resolve => {
Expand Down Expand Up @@ -64,7 +64,7 @@ exports.callViewFunction = async function(options) {
console.log(inspectResponse(await account.viewFunction(options.contractName, options.methodName, JSON.parse(options.args || '{}'))));
};

//For account:
// For account:
exports.createAccount = async function(options) {
let near = await connect(options);
let keyPair;
Expand Down Expand Up @@ -153,14 +153,14 @@ exports.sendMoney = async function(options) {
};

exports.stake = async function(options) {
console.log(`Staking ${options.amount} on ${options.accountId} with public key = ${options.stakeKey}.`);
console.log(`Staking ${options.amount} on ${options.accountId} with public key = ${options.stakingKey}.`);
const near = await connect(options);
const account = await near.account(options.accountId);
const result = await account.stake(options.stakeKey, options.amount);
const result = await account.stake(options.stakingKey, options.amount);
console.log(inspectResponse(result));
};

//For transaction:
// For transaction:
exports.txStatus = async function(options) {
let near = await connect(options);
let status = await near.connection.provider.txStatus(bs58.decode(options.hash), options.accountId || options.masterAccount);
Expand Down

0 comments on commit 8c80fec

Please sign in to comment.