@caspay/sdk 1.1.3 → 1.1.4
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 +2 -2
- package/dist/caspay.min.js +2 -2
- package/dist/index.esm.js +16 -1
- package/dist/index.js +16 -1
- package/dist/resources/wallet.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey, ExecutableDeployItem, TransferDeployItem, DeployHeader, Deploy } from 'casper-js-sdk';
|
|
2
2
|
|
|
3
|
-
const SDK_VERSION = '1.1.
|
|
3
|
+
const SDK_VERSION = '1.1.4';
|
|
4
4
|
|
|
5
5
|
class HttpClient {
|
|
6
6
|
constructor(config) {
|
|
@@ -529,6 +529,21 @@ class Wallet {
|
|
|
529
529
|
getNetwork() {
|
|
530
530
|
return this.config.network === 'mainnet' ? 'casper' : 'casper-test';
|
|
531
531
|
}
|
|
532
|
+
async getActiveNetwork() {
|
|
533
|
+
if (!this.provider) {
|
|
534
|
+
return this.getNetwork();
|
|
535
|
+
}
|
|
536
|
+
try {
|
|
537
|
+
const network = await this.provider.getActiveNetwork?.();
|
|
538
|
+
if (network) {
|
|
539
|
+
// 'casper' or 'casper-test'
|
|
540
|
+
return network;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
catch (error) {
|
|
544
|
+
}
|
|
545
|
+
return this.getNetwork();
|
|
546
|
+
}
|
|
532
547
|
async signDeploy(deploy) {
|
|
533
548
|
if (!this.provider) {
|
|
534
549
|
const error = {
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var casperJsSdk = require('casper-js-sdk');
|
|
6
6
|
|
|
7
|
-
const SDK_VERSION = '1.1.
|
|
7
|
+
const SDK_VERSION = '1.1.4';
|
|
8
8
|
|
|
9
9
|
class HttpClient {
|
|
10
10
|
constructor(config) {
|
|
@@ -533,6 +533,21 @@ class Wallet {
|
|
|
533
533
|
getNetwork() {
|
|
534
534
|
return this.config.network === 'mainnet' ? 'casper' : 'casper-test';
|
|
535
535
|
}
|
|
536
|
+
async getActiveNetwork() {
|
|
537
|
+
if (!this.provider) {
|
|
538
|
+
return this.getNetwork();
|
|
539
|
+
}
|
|
540
|
+
try {
|
|
541
|
+
const network = await this.provider.getActiveNetwork?.();
|
|
542
|
+
if (network) {
|
|
543
|
+
// 'casper' or 'casper-test'
|
|
544
|
+
return network;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
catch (error) {
|
|
548
|
+
}
|
|
549
|
+
return this.getNetwork();
|
|
550
|
+
}
|
|
536
551
|
async signDeploy(deploy) {
|
|
537
552
|
if (!this.provider) {
|
|
538
553
|
const error = {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.1.
|
|
1
|
+
export declare const SDK_VERSION = "1.1.4";
|