@subwallet/extension-base 1.1.6-3 → 1.1.7-0
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/cjs/packageInfo.js
CHANGED
|
@@ -58,7 +58,7 @@ class SubstrateApi {
|
|
|
58
58
|
return new _api2.WsProvider(apiUrl, _constants.API_AUTO_CONNECT_MS, {}, _constants.API_CONNECT_TIMEOUT);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
createApi(provider) {
|
|
61
|
+
createApi(provider, externalApiPromise) {
|
|
62
62
|
const apiOption = {
|
|
63
63
|
provider,
|
|
64
64
|
typesBundle: _api3.typesBundle,
|
|
@@ -72,7 +72,9 @@ class SubstrateApi {
|
|
|
72
72
|
}
|
|
73
73
|
this.updateConnectionStatus(_types2._ChainConnectionStatus.CONNECTING);
|
|
74
74
|
let api;
|
|
75
|
-
if (
|
|
75
|
+
if (externalApiPromise) {
|
|
76
|
+
api = externalApiPromise;
|
|
77
|
+
} else if (_constants._API_OPTIONS_CHAIN_GROUP.acala.includes(this.chainSlug)) {
|
|
76
78
|
api = new _api2.ApiPromise((0, _api.options)({
|
|
77
79
|
provider
|
|
78
80
|
}));
|
|
@@ -83,7 +85,7 @@ class SubstrateApi {
|
|
|
83
85
|
types: _types.types
|
|
84
86
|
});
|
|
85
87
|
} else if (_constants._API_OPTIONS_CHAIN_GROUP.avail.includes(this.chainSlug)) {
|
|
86
|
-
|
|
88
|
+
api = new _api2.ApiPromise({
|
|
87
89
|
provider,
|
|
88
90
|
rpc: _availJsSdk.spec.rpc,
|
|
89
91
|
types: _availJsSdk.spec.types,
|
|
@@ -110,7 +112,7 @@ class SubstrateApi {
|
|
|
110
112
|
this.registry = new _create.TypeRegistry();
|
|
111
113
|
this.metadata = metadata;
|
|
112
114
|
this.provider = this.createProvider(apiUrl);
|
|
113
|
-
this.api =
|
|
115
|
+
this.api = this.createApi(this.provider, externalApiPromise);
|
|
114
116
|
this.handleApiReady = (0, _promise.createPromiseHandler)();
|
|
115
117
|
}
|
|
116
118
|
get isReady() {
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"./cjs/detectPackage.js"
|
|
18
18
|
],
|
|
19
19
|
"type": "module",
|
|
20
|
-
"version": "1.1.
|
|
20
|
+
"version": "1.1.7-0",
|
|
21
21
|
"main": "./cjs/index.js",
|
|
22
22
|
"module": "./index.js",
|
|
23
23
|
"types": "./index.d.ts",
|
|
@@ -1189,10 +1189,10 @@
|
|
|
1189
1189
|
"@sora-substrate/type-definitions": "^1.17.7",
|
|
1190
1190
|
"@substrate/connect": "^0.7.26",
|
|
1191
1191
|
"@subwallet/chain-list": "0.2.9",
|
|
1192
|
-
"@subwallet/extension-base": "^1.1.
|
|
1193
|
-
"@subwallet/extension-chains": "^1.1.
|
|
1194
|
-
"@subwallet/extension-dapp": "^1.1.
|
|
1195
|
-
"@subwallet/extension-inject": "^1.1.
|
|
1192
|
+
"@subwallet/extension-base": "^1.1.7-0",
|
|
1193
|
+
"@subwallet/extension-chains": "^1.1.7-0",
|
|
1194
|
+
"@subwallet/extension-dapp": "^1.1.7-0",
|
|
1195
|
+
"@subwallet/extension-inject": "^1.1.7-0",
|
|
1196
1196
|
"@subwallet/keyring": "^0.0.10",
|
|
1197
1197
|
"@subwallet/ui-keyring": "^0.0.10",
|
|
1198
1198
|
"@walletconnect/sign-client": "^2.8.4",
|
package/packageInfo.js
CHANGED
|
@@ -7,5 +7,5 @@ export const packageInfo = {
|
|
|
7
7
|
name: '@subwallet/extension-base',
|
|
8
8
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
9
9
|
type: 'esm',
|
|
10
|
-
version: '1.1.
|
|
10
|
+
version: '1.1.7-0'
|
|
11
11
|
};
|
|
@@ -52,7 +52,7 @@ export class SubstrateApi {
|
|
|
52
52
|
return new WsProvider(apiUrl, API_AUTO_CONNECT_MS, {}, API_CONNECT_TIMEOUT);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
createApi(provider) {
|
|
55
|
+
createApi(provider, externalApiPromise) {
|
|
56
56
|
const apiOption = {
|
|
57
57
|
provider,
|
|
58
58
|
typesBundle,
|
|
@@ -66,7 +66,9 @@ export class SubstrateApi {
|
|
|
66
66
|
}
|
|
67
67
|
this.updateConnectionStatus(_ChainConnectionStatus.CONNECTING);
|
|
68
68
|
let api;
|
|
69
|
-
if (
|
|
69
|
+
if (externalApiPromise) {
|
|
70
|
+
api = externalApiPromise;
|
|
71
|
+
} else if (_API_OPTIONS_CHAIN_GROUP.acala.includes(this.chainSlug)) {
|
|
70
72
|
api = new ApiPromise(acalaOptions({
|
|
71
73
|
provider
|
|
72
74
|
}));
|
|
@@ -77,7 +79,7 @@ export class SubstrateApi {
|
|
|
77
79
|
types: oakTypes
|
|
78
80
|
});
|
|
79
81
|
} else if (_API_OPTIONS_CHAIN_GROUP.avail.includes(this.chainSlug)) {
|
|
80
|
-
|
|
82
|
+
api = new ApiPromise({
|
|
81
83
|
provider,
|
|
82
84
|
rpc: availSpec.rpc,
|
|
83
85
|
types: availSpec.types,
|
|
@@ -103,7 +105,7 @@ export class SubstrateApi {
|
|
|
103
105
|
this.registry = new TypeRegistry();
|
|
104
106
|
this.metadata = metadata;
|
|
105
107
|
this.provider = this.createProvider(apiUrl);
|
|
106
|
-
this.api =
|
|
108
|
+
this.api = this.createApi(this.provider, externalApiPromise);
|
|
107
109
|
this.handleApiReady = createPromiseHandler();
|
|
108
110
|
}
|
|
109
111
|
get isReady() {
|