@@ -169,7 +169,7 @@ For more details about websocket, see [Websocket](#websocket).
169
169
- [ Expand] ( #expand )
170
170
- [ Key Service] ( #key-service )
171
171
- [ Generate seed] ( #generate-seed )
172
- - [ Get secret key] ( #get-secret -key )
172
+ - [ Get private key] ( #get-private -key )
173
173
- [ Get public key] ( #get-public-key )
174
174
- [ Get address] ( #get-address )
175
175
- [ Node] ( #node )
@@ -736,6 +736,7 @@ You have currently 3 nano in your account.
736
736
const wallet = nona.wallet(privateKey);
737
737
const info = await wallet.info();
738
738
const recipient = 'nano_1send...';
739
+ const recipientPublicKey = KeyService.getPublicKey(recipient);
739
740
740
741
const sendBlock = await this.blocks.create({
741
742
// Current account
@@ -749,7 +750,7 @@ const sendBlock = await this.blocks.create({
749
750
// If the block is sending funds, set link to the public key of the destination account.
750
751
// If it is receiving funds, set link to the hash of the block to receive.
751
752
// If the block has no balance change but is updating representative only, set link to 0.
752
- link: recipient ,
753
+ link: recipientPublicKey ,
753
754
// Private key of the account
754
755
key: privateKey,
755
756
});
@@ -838,25 +839,25 @@ Generates a random seed.
838
839
const seed = await KeyService.generateSeed();
839
840
` ` `
840
841
841
- ### Get secret key
842
+ ### Get private key
842
843
843
844
` ` ` typescript
844
- KeyService.getSecretKey (seed: string, index: number): string
845
+ KeyService.getPrivateKey (seed: string, index: number): string
845
846
` ` `
846
847
847
- Derive a secret key from a seed , given an index .
848
+ Derive a private key from a seed , given an index .
848
849
849
850
` ` ` typescript
850
- const privateKey = KeyService.getSecretKey (seed, 0);
851
+ const privateKey = KeyService.getPrivateKey (seed, 0);
851
852
` ` `
852
853
853
854
### Get public key
854
855
855
856
` ` ` typescript
856
- KeyService.getPublicKey(privateKey : string): string
857
+ KeyService.getPublicKey(privateKeyOrAddress : string): string
857
858
` ` `
858
859
859
- Derive a public key from a secret key .
860
+ Derive a public key from a private key or an address .
860
861
861
862
` ` ` typescript
862
863
const publicKey = KeyService.getPublicKey(privateKey);
0 commit comments