Skip to content

Commit

Permalink
add seed2Mnemonic
Browse files Browse the repository at this point in the history
  • Loading branch information
gordon-sero committed Oct 30, 2019
1 parent 90d24f4 commit c9ce992
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/ethapi/api_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (s *PublicLocalAPI) GenSeed(ctx context.Context) (hexutil.Bytes, error) {
return hexutil.Bytes(entropy), nil
}

func (s *PublicLocalAPI) Seed2Mnemonic(ctx context.Context, seed hexutil.Bytes) (string, error) {
return bip39.NewMnemonic(seed[:])
}

func (s *PublicLocalAPI) CurrencyToId(ctx context.Context, currency string) (ret c_type.Uint256, e error) {
ret = flight.CurrencyToId(currency)
return
Expand Down
5 changes: 5 additions & 0 deletions internal/web3ext/web3ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,11 @@ web3._extend({
call: 'local_genSeed',
params: 0
}),
new web3._extend.Method({
name: 'seed2Mnemonic',
call: 'local_seed2Mnemonic',
params: 1
}),
new web3._extend.Method({
name: 'seed2Sk',
call: 'local_seed2Sk',
Expand Down

0 comments on commit c9ce992

Please sign in to comment.