@zerochain/0chain
Advanced tools
Comparing version 1.3.35 to 1.3.36
25
index.js
@@ -28,3 +28,3 @@ /* | ||
var miners, proxyServerUrl, sharders, clusterName, version; | ||
var miners, proxyServerUrl, zeroBoxUrl, sharders, clusterName, version; | ||
var preferredBlobbers, tokenLock; | ||
@@ -96,3 +96,9 @@ var readPrice, writePrice; | ||
PROXY_SERVER_MOVE_ENDPOINT: "/move", | ||
PROXY_SERVER_ENCRYPT_PUBLIC_KEY_ENDPOINT: "/publicEncryptionKey" | ||
PROXY_SERVER_ENCRYPT_PUBLIC_KEY_ENDPOINT: "/publicEncryptionKey", | ||
// ZEROBOX URLs | ||
ZEROBOX_SERVER_GET_MNEMONIC_ENDPOINT: '/getmnemonic', | ||
ZEROBOX_SERVER_SHARE_INFO_ENDPOINT: '/shareinfo', | ||
ZEROBOX_SERVER_SAVE_MNEMONIC_ENDPOINT: '/savemnemonic', | ||
ZEROBOX_SERVER_DELETE_MNEMONIC_ENDPOINT: '/shareinfo' | ||
} | ||
@@ -127,2 +133,3 @@ | ||
&& configObject.hasOwnProperty('clusterName') | ||
&& configObject.hasOwnProperty('zeroBoxUrl') | ||
&& configObject.hasOwnProperty('proxyServerUrl')) { | ||
@@ -157,2 +164,3 @@ config = configObject; | ||
"proxyServerUrl": "http://localhost:9082", | ||
"zeroBoxUrl": "http://one.0box.io:9081", | ||
"transaction_timeout": 15, | ||
@@ -169,2 +177,3 @@ "clusterName": "local" | ||
proxyServerUrl = config.proxyServerUrl; | ||
zeroBoxUrl = config.zeroBoxUrl; | ||
preferredBlobbers = config.preferredBlobbers; | ||
@@ -887,3 +896,4 @@ readPriceRange = config.readPrice; | ||
recoverWalletFromCloud: async function (AppIDToken, AppPhoneNumber) { | ||
const response = await utils.recoverWalletFromCloud(AppIDToken, AppPhoneNumber); | ||
const url = zeroBoxUrl + Endpoints.ZEROBOX_SERVER_GET_MNEMONIC_ENDPOINT; | ||
const response = await utils.recoverWalletFromCloud(url, AppIDToken, AppPhoneNumber); | ||
return response | ||
@@ -893,3 +903,3 @@ }, | ||
saveWalletToCloud: async function (activeWallet, encryptMnemonicUsingPasscode, tokenId, phone) { | ||
const url = '/savemnemonic'; | ||
const url = zeroBoxUrl + Endpoints.ZEROBOX_SERVER_SAVE_MNEMONIC_ENDPOINT; | ||
const data = new FormData(); | ||
@@ -905,3 +915,3 @@ data.append('mnemonic', encryptMnemonicUsingPasscode); | ||
postShareInfo: async function (authTicket, activeWallet, message, fromInfo, receiver_id, ae) { | ||
const url = '/shareinfo'; | ||
const url = zeroBoxUrl + Endpoints.ZEROBOX_SERVER_SHARE_INFO_ENDPOINT; | ||
const client_signature = this.getSign(ae.id, ae.secretKey); | ||
@@ -919,3 +929,3 @@ const data = new FormData(); | ||
deleteSharedObject: async function (authTicket, activeWallet) { | ||
const url = '/shareinfo'; | ||
const url = zeroBoxUrl + Endpoints.ZEROBOX_SERVER_SHARE_INFO_ENDPOINT; | ||
const sig = this.getSign(activeWallet.id, activeWallet.secretKey); | ||
@@ -938,4 +948,5 @@ const data = new FormData(); | ||
getShareInfo: async function (activeWallet) { | ||
const url = zeroBoxUrl + Endpoints.ZEROBOX_SERVER_SHARE_INFO_ENDPOINT; | ||
const clientSignature = this.getSign(activeWallet.id, activeWallet.secretKey); | ||
const response = await utils.getShareInfo(clientSignature, activeWallet.id, activeWallet.client_key); | ||
const response = await utils.getShareInfo(url, clientSignature, activeWallet.id, activeWallet.client_key); | ||
return response | ||
@@ -942,0 +953,0 @@ }, |
{ | ||
"name": "@zerochain/0chain", | ||
"version": "1.3.35", | ||
"version": "1.3.36", | ||
"description": "js client library to interact with 0chain Blockchain", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -65,2 +65,3 @@ # 0chain Client SDK for Node | ||
"proxyServerUrl" : "http://localhost:9082", | ||
"zeroBoxUrl": "http://one.0box.io:9081", | ||
"transaction_timeout" : 20, | ||
@@ -67,0 +68,0 @@ "state " : true |
12
utils.js
@@ -195,6 +195,6 @@ /* | ||
recoverWalletFromCloud: function recoverWalletFromCloud(AppIDToken, AppPhoneNumber) { | ||
recoverWalletFromCloud: function recoverWalletFromCloud(url, AppIDToken, AppPhoneNumber) { | ||
return axios({ | ||
method: 'get', | ||
url: 'http://one.0box.io:9081/getmnemonic', | ||
url: url, | ||
headers: { | ||
@@ -207,6 +207,6 @@ 'X-App-Id-Token': AppIDToken, | ||
getShareInfo: function getShareInfo(client_signature, clientId, clientkey) { | ||
getShareInfo: function getShareInfo(url, client_signature, clientId, clientkey) { | ||
return axios({ | ||
method: 'get', | ||
url: 'http://one.0box.io:9081/shareinfo', | ||
url: url, | ||
headers: { | ||
@@ -225,3 +225,3 @@ 'X-App-Client-ID': clientId, | ||
method: 'post', | ||
url: `http://one.0box.io:9081` + url, //0boxEndpoint | ||
url: url, | ||
headers: { | ||
@@ -242,3 +242,3 @@ 'Content-Type': 'application/x-www-form-urlencoded', | ||
method: 'delete', | ||
url: `http://one.0box.io:9081` + url, //0boxEndpoint | ||
url: url, | ||
headers: { | ||
@@ -245,0 +245,0 @@ 'X-App-Client-ID': clientId, |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
174615
1708
302
1