Skip to content
This repository was archived by the owner on Dec 26, 2024. It is now read-only.
This repository was archived by the owner on Dec 26, 2024. It is now read-only.

meteor integration #1

@vjuge

Description

@vjuge

meteor integration gives an error at runtime (server side) :

W20161123-19:09:10.829(1)? (STDERR) /Users/xxxxxx/Documents/devel/xxxxx/node_modules/etherscan-api/lib/init.js:350 W20161123-19:09:10.830(1)? (STDERR) let params = { W20161123-19:09:10.830(1)? (STDERR) ^^^ W20161123-19:09:10.831(1)? (STDERR) W20161123-19:09:10.831(1)? (STDERR) SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode W20161123-19:09:10.831(1)? (STDERR) at exports.runInThisContext (vm.js:53:16) W20161123-19:09:10.832(1)? (STDERR) at Module._compile (module.js:373:25) W20161123-19:09:10.832(1)? (STDERR) at Object.Module._extensions..js (module.js:416:10) W20161123-19:09:10.833(1)? (STDERR) at Module.load (module.js:343:32) W20161123-19:09:10.833(1)? (STDERR) at Function.Module._load (module.js:300:12) W20161123-19:09:10.834(1)? (STDERR) at Module.require (module.js:353:17) W20161123-19:09:10.834(1)? (STDERR) at require (internal/module.js:12:17) W20161123-19:09:10.834(1)? (STDERR) at Object.<anonymous> (/Users/vincent/Documents/devel/meteor-songsforlife/node_modules/etherscan-api/index.js:2:14) W20161123-19:09:10.835(1)? (STDERR) at Module._compile (module.js:409:26) W20161123-19:09:10.835(1)? (STDERR) at Object.Module._extensions..js (module.js:416:10) => Exited with code: 1

and error :
W20161123-19:10:12.867(1)? (STDERR) /Users/xxxxxx/Documents/devel/xxxxxx/node_modules/etherscan-api/lib/init.js:510 W20161123-19:10:12.867(1)? (STDERR) let action = 'balance'; W20161123-19:10:12.867(1)? (STDERR) ^^^ W20161123-19:10:12.868(1)? (STDERR) W20161123-19:10:12.868(1)? (STDERR) SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode W20161123-19:10:12.868(1)? (STDERR) at exports.runInThisContext (vm.js:53:16) W20161123-19:10:12.869(1)? (STDERR) at Module._compile (module.js:373:25) W20161123-19:10:12.869(1)? (STDERR) at Object.Module._extensions..js (module.js:416:10) W20161123-19:10:12.869(1)? (STDERR) at Module.load (module.js:343:32) W20161123-19:10:12.870(1)? (STDERR) at Function.Module._load (module.js:300:12) W20161123-19:10:12.870(1)? (STDERR) at Module.require (module.js:353:17) W20161123-19:10:12.871(1)? (STDERR) at require (internal/module.js:12:17) W20161123-19:10:12.871(1)? (STDERR) at Object.<anonymous> (/Users/vincent/Documents/devel/meteor-songsforlife/node_modules/etherscan-api/index.js:2:14) W20161123-19:10:12.871(1)? (STDERR) at Module._compile (module.js:409:26) W20161123-19:10:12.872(1)? (STDERR) at Object.Module._extensions..js (module.js:416:10) => Exited with code: 1

this can be resolved in node_modules/etherscan-api/lib/init.js
by adding "use strict;" at the beginning of the functions

line 333 :

/** * @namespace */ stats: { /** * Returns the supply of Tokens * @param {string} tokenname - Name of the Token * @param {string} contractaddress - Address from token contract * @example * var supply = api.stats.tokensupply(null, '0x57d90b64a1a57749b0f932f1a3395792e12e7055'); * @returns {Promise.<object>} */ tokensupply(tokenname, contractaddress) { "use strict"; const module = 'stats'; const action = 'tokensupply';

line 501 :

/** * Returns the balance of a sepcific account * @param {string} address - Address * @example * var balance = api.account.balance('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae'); * @returns {Promise.<object>} */ balance(address) { "use strict"; const module = 'account'; let action = 'balance'; const tag = 'latest';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions