-
Notifications
You must be signed in to change notification settings - Fork 4
/
utils.js
24 lines (22 loc) · 845 Bytes
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const MaticPOSClient = require("@maticnetwork/maticjs").MaticPOSClient;
const config = require("./config");
const HDWalletProvider = require("@truffle/hdwallet-provider");
const getMaticPOSClient = () => {
return new MaticPOSClient({
network: "testnet", // For mainnet change this to mainnet
version: "mumbai", // For mainnet change this to v1
parentProvider: new HDWalletProvider(
config.user.privateKey,
config.root.RPC
),
maticProvider: new HDWalletProvider(
config.user.privateKey,
config.child.RPC
),
parentDefaultOptions: { from: config.user.address }, // optional, can also be sent as last param while sending tx
maticDefaultOptions: { from: config.user.address }, // optional, can also be sent as last param while sending tx
});
};
module.exports = {
getMaticPOSClient,
};