Skip to content

Commit ac9d705

Browse files
committed
Edit Portis module to take networkId
1 parent 275fd35 commit ac9d705

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/modules/select/wallets/portis.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
import Portis from "@portis/web3"
22

3+
import { networkName } from "../../../utilities"
34
import portisIcon from "../wallet-icons/icon-portis.svg"
45

56
function portis(options) {
67
if (!options || typeof options !== "object") {
78
throw new Error("An options object is required to initialize portis module")
89
}
910

10-
const { apiKey, network } = options
11+
const { apiKey, networkId } = options
1112

1213
if (!apiKey || typeof apiKey !== "string") {
1314
throw new Error(
1415
"A apiKey of type string is required to initialize portis module"
1516
)
1617
}
1718

18-
if (!network || typeof network !== "string") {
19+
if (!networkId || typeof networkId !== "number") {
1920
throw new Error(
20-
"A network of type string is required to initialize portis module"
21+
"A network of type number is required to initialize portis module"
2122
)
2223
}
2324

2425
return {
2526
name: "Portis",
2627
iconSrc: portisIcon,
2728
wallet: ({ BigNumber }) => {
28-
const portis = new Portis(apiKey, network)
29+
const portis = new Portis(apiKey, networkName(networkId))
2930
const { provider } = portis
3031

3132
return {

0 commit comments

Comments
 (0)