Skip to content

Commit

Permalink
change wrap-near cookbook recipe to use testnet (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedotexe authored Feb 4, 2022
1 parent 0139380 commit e927253
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/cookbook/utils/wrap-near.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ const HELP = `To convert N $NEAR to wNEAR, run this script in the following for
node wrap-near.js YOU.near N
Note: runs on mainnet!`;
`;

const { connect, keyStores, transactions, utils } = require("near-api-js");
const path = require("path");
const homedir = require("os").homedir();

const WRAP_NEAR_CONTRACT_ID = "wrap.near";
// On mainnet it's wrap.near, by the way
const WRAP_NEAR_CONTRACT_ID = "wrap.testnet";

const credentialsPath = path.join(homedir, ".near-credentials");
const keyStore = new keyStores.UnencryptedFileSystemKeyStore(credentialsPath);

const config = {
keyStore,
networkId: "mainnet",
nodeUrl: "https://rpc.mainnet.near.org",
networkId: "testnet",
nodeUrl: "https://rpc.testnet.near.org",
};

if (process.argv.length !== 4) {
Expand Down

0 comments on commit e927253

Please sign in to comment.