-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbifcore-sdk-nodejs+1.0.6.patch
57 lines (57 loc) · 2.5 KB
/
bifcore-sdk-nodejs+1.0.6.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff --git a/node_modules/bifcore-sdk-nodejs/lib/contract/index.js b/node_modules/bifcore-sdk-nodejs/lib/contract/index.js
index 882e84e..a8769a1 100644
--- a/node_modules/bifcore-sdk-nodejs/lib/contract/index.js
+++ b/node_modules/bifcore-sdk-nodejs/lib/contract/index.js
@@ -162,7 +162,7 @@ class Contract {
return util._responseError(errors.REQUEST_NULL_ERROR)
}
let { sourceAddress, privateKey, payload, initBalance, remarks, type, feeLimit, gasPrice, ceilLedgerSeq, initInput, domainId } = request
- if (!util._verifyValue(initBalance)) {
+ if (!util._isAvailableValue(initBalance)) {
return util._responseError(errors.INVALID_INITBALANCE_ERROR)
}
if (ceilLedgerSeq != null && ceilLedgerSeq != '' && !util._isAvailableValue(ceilLedgerSeq)) {
diff --git a/node_modules/bifcore-sdk-nodejs/lib/query/index.js b/node_modules/bifcore-sdk-nodejs/lib/query/index.js
index 250187f..019f62f 100644
--- a/node_modules/bifcore-sdk-nodejs/lib/query/index.js
+++ b/node_modules/bifcore-sdk-nodejs/lib/query/index.js
@@ -15,7 +15,10 @@ class Query {
async _get (method, params) {
const options = {
method: 'GET',
- uri: `${this.host}/${method}?${params}`,
+ uri: `${location.origin}/api/${method}?${params}`,
+ headers: {
+ ProxyAddress: this.host,
+ },
// json: true,
timeout: 4000
}
@@ -26,7 +29,10 @@ class Query {
async _post (method, paramsJson) {
const options = {
method: 'POST',
- uri: `${this.host}/${method}`,
+ uri: `${location.origin}/api/${method}`,
+ headers: {
+ ProxyAddress: this.host,
+ },
body: paramsJson,
json: true,
timeout: 4000
diff --git a/node_modules/bifcore-sdk-nodejs/lib/transaction/index.js b/node_modules/bifcore-sdk-nodejs/lib/transaction/index.js
index 223daa4..0fc6bff 100644
--- a/node_modules/bifcore-sdk-nodejs/lib/transaction/index.js
+++ b/node_modules/bifcore-sdk-nodejs/lib/transaction/index.js
@@ -550,7 +550,10 @@ class Transaction {
}
const options = {
method: 'POST',
- uri: `${this.host}/submitTransaction`,
+ uri: `${location.origin}/api/submitTransaction`,
+ headers: {
+ ProxyAddress: this.host,
+ },
body: postData,
json: true
}