Skip to content

Commit 35f7ca6

Browse files
committed
chore: network selection
1 parent 9fdbeaf commit 35f7ca6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.env.example

+4-1
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,7 @@ NEAR_WALLET_SECRET_KEY=
191191
NEAR_WALLET_PUBLIC_KEY=
192192
NEAR_ADDRESS=
193193
SLIPPAGE=1
194-
RPC_URL=
194+
RPC_URL=
195+
196+
# Add this line to your existing .env.example
197+
NEAR_NETWORK=testnet # or mainnet

packages/plugin-near/src/providers/wallet.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import os from "os";
77
import { KeyPairString } from "near-api-js/lib/utils";
88

99
const PROVIDER_CONFIG = {
10-
networkId: "testnet",
11-
nodeUrl: process.env.RPC_URL || "https://rpc.testnet.near.org",
12-
walletUrl: "https://testnet.mynearwallet.com/",
13-
helperUrl: "https://helper.testnet.near.org",
14-
explorerUrl: "https://testnet.nearblocks.io",
10+
networkId: process.env.NEAR_NETWORK || "testnet",
11+
nodeUrl: process.env.RPC_URL || `https://rpc.${process.env.NEAR_NETWORK || "testnet"}.near.org`,
12+
walletUrl: `https://${process.env.NEAR_NETWORK || "testnet"}.mynearwallet.com/`,
13+
helperUrl: `https://helper.${process.env.NEAR_NETWORK || "testnet"}.near.org`,
14+
explorerUrl: `https://${process.env.NEAR_NETWORK || "testnet"}.nearblocks.io`,
1515
MAX_RETRIES: 3,
1616
RETRY_DELAY: 2000,
1717
SLIPPAGE: process.env.SLIPPAGE ? parseInt(process.env.SLIPPAGE) : 1,

0 commit comments

Comments
 (0)