iotex-client-js
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -6,17 +6,41 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "IotexClient", { | ||
Object.defineProperty(exports, "Iotx", { | ||
enumerable: true, | ||
get: function () { | ||
return _iotexClient.IotexClient; | ||
return _iotx.Iotx; | ||
} | ||
}); | ||
Object.defineProperty(exports, "JsonRpcProvider", { | ||
Object.defineProperty(exports, "Contract", { | ||
enumerable: true, | ||
get: function () { | ||
return _provider.JsonRpcProvider; | ||
return _contract.Contract; | ||
} | ||
}); | ||
Object.defineProperty(exports, "HttpProvider", { | ||
enumerable: true, | ||
get: function () { | ||
return _provider.HttpProvider; | ||
} | ||
}); | ||
Object.defineProperty(exports, "RpcMethods", { | ||
enumerable: true, | ||
get: function () { | ||
return _rpcMethods.RpcMethods; | ||
} | ||
}); | ||
Object.defineProperty(exports, "Accounts", { | ||
enumerable: true, | ||
get: function () { | ||
return _remoteAccounts.Accounts; | ||
} | ||
}); | ||
var _iotexClient = require("./iotex-client"); | ||
var _iotx = require("./iotx"); | ||
var _provider = require("./provider"); | ||
var _contract = require("./contract/contract"); | ||
var _provider = require("./provider"); | ||
var _rpcMethods = require("./rpc-methods"); | ||
var _remoteAccounts = require("./account/remote-accounts"); |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.JsonRpcProvider = void 0; | ||
exports.HttpProvider = void 0; | ||
@@ -13,7 +13,17 @@ var _axios = _interopRequireDefault(require("axios")); | ||
class JsonRpcProvider { | ||
constructor({ | ||
url, | ||
timeout | ||
}) { | ||
let requestId = 0; | ||
/** | ||
* Provider is the network provider interface of iotex backend. | ||
*/ | ||
/** | ||
* Provider is the network provider of iotex backend that is implemented in HTTP. | ||
*/ | ||
class HttpProvider { | ||
/** | ||
* constructor creates an instance of HttpProvider. | ||
* @param url | ||
* @param timeout | ||
*/ | ||
constructor(url, timeout) { | ||
this.axios = _axios.default.create({ | ||
@@ -24,3 +34,9 @@ baseURL: url, | ||
} | ||
/** | ||
* send makes an xhr call to the url. | ||
* @param request | ||
* @returns | ||
*/ | ||
async send(request) { | ||
@@ -32,3 +48,3 @@ let resp; | ||
jsonrpc: '2.0', | ||
id: 0, | ||
id: String(requestId++), | ||
method: request.method, | ||
@@ -39,5 +55,6 @@ params: request.params || [] | ||
return { | ||
result: null, | ||
error: { | ||
code: -32601, | ||
message: 'Network Error: cannot send request' | ||
message: `Network Error: cannot send request: ${e.stack}` | ||
} | ||
@@ -52,2 +69,2 @@ }; | ||
exports.JsonRpcProvider = JsonRpcProvider; | ||
exports.HttpProvider = HttpProvider; |
{ | ||
"name": "iotex-client-js", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "IoTeX Client", | ||
@@ -22,3 +22,9 @@ "main": "index.js", | ||
"build:watch": "babel --watch src/**/*.js -d dist", | ||
"prepublish": "npm run build" | ||
"prepublish": "npm run build", | ||
"docs": "documentation build src/** -f html -o docs && npm run docs-md", | ||
"docs-md": "documentation build src/** -f md > docs/docs.md && documentation build src/rpc-methods.js -f md > docs/sdk-rpc-methods.md && documentation build src/account/remote-accounts.js -f md > docs/sdk-account.md && documentation build src/iotx.js -f md > docs/sdk-transfer.md", | ||
"serve-docs": "documentation serve --watch src/**", | ||
"changelog-major": "build-changelog --major", | ||
"changelog-minor": "build-changelog --minor", | ||
"changelog-patch": "build-changelog --patch" | ||
}, | ||
@@ -57,3 +63,2 @@ "nyc": { | ||
"devDependencies": { | ||
"solc": "^0.4.25", | ||
"@babel/cli": "7.0.0", | ||
@@ -74,2 +79,4 @@ "@babel/core": "7.0.1", | ||
"babel-plugin-transform-class-properties": "6.24.1", | ||
"build-changelog": "^2.1.2", | ||
"documentation": "^8.1.2", | ||
"eslint": "5.5.0", | ||
@@ -85,3 +92,4 @@ "eslint-plugin-babel": "5.1.0", | ||
"jsdom-global": "3.0.2", | ||
"nyc": "13.0.1" | ||
"nyc": "13.0.1", | ||
"solc": "^0.4.25" | ||
}, | ||
@@ -95,3 +103,2 @@ "engines": { | ||
"bech32": "^1.1.3", | ||
"dotty": "^0.1.0", | ||
"ethereumjs-abi": "^0.6.5", | ||
@@ -98,0 +105,0 @@ "js-sha3": "^0.8.0" |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
31106
4
12
867
29
1
- Removeddotty@^0.1.0
- Removeddotty@0.1.2(transitive)