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 all 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 @@ -124,7 +125,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: \n${newUrl.toString()}`);

const rl = readline.createInterface({
input: process.stdin,
Expand All @@ -135,6 +136,7 @@ exports.login = async function(options) {
const keyStore = new UnencryptedFileSystemKeyStore('./neardev');
keyStore.setKey(options.networkId, accountId, keyPair);
console.log(`Logged in with ${accountId}`);
rl.close();
});
}
}