Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Add require for url so that near login works on older node versions +… #65

Merged
merged 4 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blank_project/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
case 'development':
return {
networkId: 'default',
nodeUrl: 'http://34.94.33.164:3030',
nodeUrl: 'https://rpc.nearprotocol.com',
contractName: CONTRACT_NAME,
walletUrl: 'https://wallet.nearprotocol.com',
};
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const yargs = require('yargs');
const bs58 = require('bs58');
const ncp = require('ncp').ncp;
const rimraf = require('rimraf');
const readline = require('readline')
const readline = require('readline');
const URL = require('url').URL;

ncp.limit = 16;

Expand Down Expand Up @@ -116,6 +117,7 @@ exports.stake = async function(options) {
}

exports.login = async function(options) {
console.log(options);
behaviary marked this conversation as resolved.
Show resolved Hide resolved
if (!options.walletUrl) {
console.log("Log in is not needed on this environment. Please use appropriate master account for shell operations.")
} else {
Expand All @@ -124,7 +126,7 @@ exports.login = async function(options) {
newUrl.searchParams.set('title', title);
const keyPair = await KeyPair.fromRandom('ed25519');
newUrl.searchParams.set('public_key', keyPair.getPublicKey());
console.log(`Please navigate to this url and follow the insturctions to log in: ${newUrl.toString()}`);
console.log(`Please navigate to this url and follow the instructions to log in: ${newUrl.toString()}`);

const rl = readline.createInterface({
input: process.stdin,
Expand Down