mirror of
https://github.com/emo2007/block-accounting.git
synced 2025-01-18 15:36:27 +00:00
seed phrase
This commit is contained in:
parent
d257227497
commit
fa6f595736
@ -9,4 +9,9 @@ export class EthereumController {
|
|||||||
async getAddressFromPrivateKey(@Param('privateKey') privateKey: string) {
|
async getAddressFromPrivateKey(@Param('privateKey') privateKey: string) {
|
||||||
return this.ethereumService.getAddressFromPrivateKey(privateKey);
|
return this.ethereumService.getAddressFromPrivateKey(privateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('/address-from-seed/:seedPhrase')
|
||||||
|
async getAddressFromSeedPhrase(@Param('seedPhrase') seedPhrase: string) {
|
||||||
|
return this.ethereumService.getAddressFromSeedPhrase(seedPhrase);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,4 +7,8 @@ export class EthereumService {
|
|||||||
const wallet = new ethers.Wallet(privateKey);
|
const wallet = new ethers.Wallet(privateKey);
|
||||||
return wallet.address;
|
return wallet.address;
|
||||||
}
|
}
|
||||||
|
async getAddressFromSeedPhrase(seedPhrase: string) {
|
||||||
|
const wallet = ethers.Wallet.fromPhrase(seedPhrase);
|
||||||
|
return wallet.address;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user