From 9cd134052c52269ae4d4cd01e0543ec2ac07b40b Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Wed, 28 Nov 2018 13:54:37 +0100 Subject: [PATCH] example for adding hdwallet --- src/examples/GetHDWalletAccounts.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/examples/GetHDWalletAccounts.ts diff --git a/src/examples/GetHDWalletAccounts.ts b/src/examples/GetHDWalletAccounts.ts new file mode 100644 index 0000000..ebb7b63 --- /dev/null +++ b/src/examples/GetHDWalletAccounts.ts @@ -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)) +})()