Skip to content

Commit d1016ec

Browse files
committed
moving to KeyPair api on solana
1 parent b187810 commit d1016ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/solana.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Account } from '@solana/web3.js'
1+
import { Keypair } from '@solana/web3.js'
22
import nacl from 'tweetnacl';
33
import * as bip39 from 'bip39'
44
import base58 from 'bs58'
@@ -41,7 +41,7 @@ export async function sign(account, message) {
4141
}
4242

4343
export async function new_account({path = "m/44'/60'/0'/0/0"} = {}) {
44-
let account = new Account()
44+
let account = new Keypair()
4545
console.log(account)
4646
return import_account({
4747
'private_key': base58.encode(account.secretKey)
@@ -74,7 +74,7 @@ export async function import_account({
7474

7575
let wallet = null
7676
if (private_key !== null) {
77-
wallet = new Account(base58.decode(private_key))
77+
wallet = Keypair.fromSecretKey(base58.decode(private_key))
7878
}
7979
return await _from_wallet(wallet, name)
8080
}

0 commit comments

Comments
 (0)