iotex-client-js
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -50,8 +50,9 @@ "use strict"; | ||
* @param chainId is the optional param to specify what the chain id those accounts are associated with. | ||
* @param walletProvider is the remote wallet provider. | ||
*/ | ||
constructor(rpcMethods, chainId) { | ||
constructor(rpcMethods, chainId, walletProvider) { | ||
this.wallets = {}; | ||
this.rpcMethods = rpcMethods; | ||
this.chainId = chainId || 1; | ||
this.walletProvider = new _provider.HttpProvider(DEFAULT_URL); | ||
this.walletProvider = walletProvider || new _provider.HttpProvider(DEFAULT_URL); | ||
this.walletRpcMethods = {}; | ||
@@ -58,0 +59,0 @@ ['generateWallet', 'unlockWallet', 'signTransfer', 'signVote', 'signSmartContract', 'signCreateDeposit', 'signSettleDeposit'].map(method => { |
@@ -11,4 +11,2 @@ "use strict"; | ||
var _global = require("global"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -119,3 +117,4 @@ | ||
const chainIdPack = data.slice(1, 5); | ||
return new _global.Buffer(chainIdPack).readUInt32LE(0); | ||
const hex = `0x${chainIdPack.reverse().map(num => toHex(num)).join('')}`; | ||
return parseInt(hex, 16); | ||
} |
@@ -128,3 +128,3 @@ "use strict"; | ||
this.rpcMethods = new _rpcMethods.RpcMethods(provider); | ||
this.accounts = new _remoteAccounts.Accounts(this.rpcMethods, this.opts.chainId); | ||
this.accounts = new _remoteAccounts.Accounts(this.rpcMethods, this.opts.chainId, opts && opts.walletProvider); | ||
this.Contract = (0, _contract.contractFactory)(this.provider, this.accounts, this.rpcMethods); | ||
@@ -131,0 +131,0 @@ } |
{ | ||
"name": "iotex-client-js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "IoTeX Client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34756
961