quantum-coin-js-sdk 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/example/example-wallet.js +2 -2
- package/example/package-lock.json +1 -1
- package/index.d.ts +2 -2
- package/index.js +5 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const qcsdk = require('quantum-coin-js-sdk');
|
|
2
2
|
|
|
3
|
-
var clientConfigVal = new qcsdk.Config("https://sdk.readrelay.quantumcoinapi.com", "https://sdk.writerelay.quantumcoinapi.com", 123123, "", ""); //Mainnet
|
|
3
|
+
//var clientConfigVal = new qcsdk.Config("https://sdk.readrelay.quantumcoinapi.com", "https://sdk.writerelay.quantumcoinapi.com", 123123, "", ""); //Mainnet
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
//Initialize the client configuration
|
|
@@ -17,7 +17,7 @@ var clientConfigVal = new qcsdk.Config("https://sdk.readrelay.quantumcoinapi.com
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
//Initialize the SDK
|
|
20
|
-
qcsdk.initialize(
|
|
20
|
+
qcsdk.initialize(undefined).then((initResult) => {
|
|
21
21
|
if (initResult === false) {
|
|
22
22
|
console.error("Initialize failed");
|
|
23
23
|
return;
|
package/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @async
|
|
5
5
|
* @function initialize
|
|
6
|
-
* @param {Config} clientConfig - A configuration represented by the Config class. A default configuration is used, if not specified.
|
|
6
|
+
* @param {Config|undefined} clientConfig - A configuration represented by the Config class. A default configuration is used, if not specified.
|
|
7
7
|
* @return {Promise<boolean>} Returns a promise of type boolean; true if the initialization succeeded, else false.
|
|
8
8
|
*/
|
|
9
|
-
export function initialize(clientConfig: Config): Promise<boolean>;
|
|
9
|
+
export function initialize(clientConfig: Config | undefined): Promise<boolean>;
|
|
10
10
|
/**
|
|
11
11
|
* The serializeWallet function serializes a Wallet object to a JSON string. You should encrypt the string before saving it to disk or a database.
|
|
12
12
|
*
|
package/index.js
CHANGED
|
@@ -694,7 +694,7 @@ async function InitAccountsWebAssembly() {
|
|
|
694
694
|
*
|
|
695
695
|
* @async
|
|
696
696
|
* @function initialize
|
|
697
|
-
* @param {Config} clientConfig - A configuration represented by the Config class. A default configuration is used, if not specified.
|
|
697
|
+
* @param {Config|undefined} clientConfig - A configuration represented by the Config class. A default configuration is used, if not specified.
|
|
698
698
|
* @return {Promise<boolean>} Returns a promise of type boolean; true if the initialization succeeded, else false.
|
|
699
699
|
*/
|
|
700
700
|
async function initialize(clientConfig) {
|
|
@@ -702,11 +702,10 @@ async function initialize(clientConfig) {
|
|
|
702
702
|
return false;
|
|
703
703
|
}
|
|
704
704
|
if (clientConfig === null || clientConfig === undefined) {
|
|
705
|
-
clientConfig = Config("https://sdk.readrelay.quantumcoinapi.com", "https://sdk.writerelay.quantumcoinapi.com", 123123, "", ""); //default
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
}
|
|
705
|
+
clientConfig = new Config("https://sdk.readrelay.quantumcoinapi.com", "https://sdk.writerelay.quantumcoinapi.com", 123123, "", ""); //default
|
|
706
|
+
}
|
|
707
|
+
if (clientConfig.readUrl === null || clientConfig.writeUrl === null || clientConfig.chainId === null) {
|
|
708
|
+
return false;
|
|
710
709
|
}
|
|
711
710
|
await InitAccountsWebAssembly();
|
|
712
711
|
config = clientConfig;
|