mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
example for adding hdwallet
This commit is contained in:
parent
ee45cf96c9
commit
9cd134052c
19
src/examples/GetHDWalletAccounts.ts
Normal file
19
src/examples/GetHDWalletAccounts.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import * as HDWalletProvider from "truffle-hdwallet-provider"
|
||||||
|
import {Logger, Ocean} from "../squid"
|
||||||
|
import * as config from "./config.json"
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const seedphrase = "genuine oyster tonight funny fat chimney initial answer potato myself doll enable"
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
config.web3Provider = new HDWalletProvider(
|
||||||
|
seedphrase,
|
||||||
|
config.nodeUri,
|
||||||
|
0, 100,
|
||||||
|
)
|
||||||
|
const ocean: Ocean = await Ocean.getInstance(config)
|
||||||
|
|
||||||
|
const accounts = await ocean.getAccounts()
|
||||||
|
|
||||||
|
Logger.log(JSON.stringify(accounts, null, 2))
|
||||||
|
})()
|
Loading…
Reference in New Issue
Block a user