11import { BZZ } from '@ethersphere/bee-js'
22import { LeafCommand , Option } from 'furious-commander'
3- import { createSpinner } from '../utils/spinner'
4- import { createKeyValue } from '../utils/text'
5- import { RootCommand } from './root-command'
6- import { VerbosityLevel } from './root-command/command-log'
3+ import { createSpinner } from '../../utils/spinner'
4+ import { RootCommand } from '../root-command'
5+ import { VerbosityLevel } from '../root-command/command-log'
76
87const MIN_DEPOSIT = BZZ . fromDecimalString ( '10' )
98
10- export class Stake extends RootCommand implements LeafCommand {
11- public readonly name = 'stake '
9+ export class Deposit extends RootCommand implements LeafCommand {
10+ public readonly name = 'deposit '
1211
13- public readonly description = `Manages nodes stake`
12+ public readonly description = 'Stake xBZZ for the storage incentives'
1413
1514 @Option ( {
16- key : 'deposit ' ,
15+ key : 'plur ' ,
1716 description : "Amount of PLUR to add to the node's stake" ,
1817 type : 'bigint' ,
1918 minimum : BigInt ( 1 ) ,
19+ conflicts : 'bzz' ,
2020 } )
2121 public amountPlur ! : bigint | undefined
2222
2323 @Option ( {
24- key : 'deposit- bzz' ,
24+ key : 'bzz' ,
2525 description : "Amount of BZZ to add to the node's stake" ,
2626 type : 'string' ,
27+ conflicts : 'plur' ,
2728 } )
2829 public amountBzz ! : string | undefined
2930
@@ -36,10 +37,10 @@ export class Stake extends RootCommand implements LeafCommand {
3637 await this . deposit ( BZZ . fromDecimalString ( this . amountBzz ) )
3738 }
3839
39- const stake = await this . bee . getStake ( )
40-
41- this . console . log ( createKeyValue ( 'Staked xBZZ' , stake . toDecimalString ( ) ) )
42- this . console . quiet ( stake . toDecimalString ( ) )
40+ this . console . log ( 'Stake deposited successfully!' )
41+ this . console . log ( 'Run `swarm-cli stake status` to check your stake status.' )
42+ this . console . log ( '' )
43+ this . console . log ( 'Do note it may take a few minutes for the stake to be reflected in the node status.' )
4344 }
4445
4546 private async deposit ( amount : BZZ ) : Promise < void > {
@@ -86,10 +87,6 @@ export class Stake extends RootCommand implements LeafCommand {
8687 try {
8788 await this . bee . depositStake ( amount )
8889 spinner . stop ( )
89-
90- this . console . log (
91- 'Successfully staked! It may take a few minutes for the stake to be reflected in the node status.' ,
92- )
9390 } catch ( e ) {
9491 spinner . stop ( )
9592 throw e
0 commit comments