@subwallet/extension-base 1.1.68-2 → 1.2.2-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/background/KoniTypes.d.ts +3 -1
- package/background/handlers/State.d.ts +1 -78
- package/background/handlers/State.js +1 -428
- package/background/types.d.ts +1 -0
- package/cjs/background/handlers/State.js +1 -456
- package/cjs/constants/storage.js +3 -1
- package/cjs/koni/api/dotsama/crowdloan.js +1 -2
- package/cjs/koni/api/nft/acala_nft/index.js +1 -3
- package/cjs/koni/api/nft/assethub_nft/index.js +1 -3
- package/cjs/koni/api/nft/assethub_unique/index.js +1 -3
- package/cjs/koni/api/nft/bit.country/index.js +4 -6
- package/cjs/koni/api/nft/config.js +1 -8
- package/cjs/koni/api/nft/evm_nft/index.js +1 -3
- package/cjs/koni/api/nft/karura_nft/index.js +1 -3
- package/cjs/koni/api/nft/ordinal_nft/index.js +4 -3
- package/cjs/koni/api/nft/rmrk_nft/index.js +4 -6
- package/cjs/koni/api/nft/unique_network_nft/index.js +1 -3
- package/cjs/koni/api/nft/unique_nft/uniqueNftV2.js +1 -3
- package/cjs/koni/api/nft/vara_nft/index.js +1 -3
- package/cjs/koni/api/nft/wasm_nft/index.js +10 -17
- package/cjs/koni/api/staking/bonding/astar.js +2 -4
- package/cjs/koni/api/staking/subsquidStaking.js +9 -12
- package/cjs/koni/api/subquery/subquery.js +1 -3
- package/cjs/koni/background/handlers/Extension.js +39 -15
- package/cjs/koni/background/handlers/Mobile.js +7 -4
- package/cjs/koni/background/handlers/State.js +68 -12
- package/cjs/koni/background/handlers/Tabs.js +7 -3
- package/cjs/koni/background/handlers/index.js +71 -71
- package/cjs/koni/background/subscription.js +7 -6
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/campaign-service/helpers.js +3 -1
- package/cjs/services/chain-service/index.js +36 -27
- package/cjs/services/chain-service/utils/patch.js +1 -3
- package/cjs/services/earning-service/handlers/liquid-staking/acala.js +1 -2
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost-manta.js +2 -3
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +2 -3
- package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +1 -2
- package/cjs/services/earning-service/handlers/native-staking/astar.js +3 -4
- package/cjs/services/event-service/index.js +0 -1
- package/cjs/services/history-service/subsquid-multi-chain-history.js +1 -3
- package/cjs/services/keyring-service/index.js +22 -0
- package/cjs/services/migration-service/scripts/MigrateRemoveGenesisHash.js +28 -0
- package/cjs/services/migration-service/scripts/index.js +3 -1
- package/cjs/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +16 -21
- package/cjs/services/notification-service/NotificationService.js +3 -1
- package/cjs/services/price-service/coingecko.js +6 -7
- package/cjs/services/price-service/index.js +7 -3
- package/cjs/services/request-service/handler/PopupHandler.js +14 -15
- package/cjs/services/setting-service/SettingService.js +4 -1
- package/cjs/services/setting-service/constants.js +1 -1
- package/cjs/services/setting-service/i18n/i18n.js +2 -4
- package/cjs/services/storage-service/DatabaseService.js +1 -1
- package/cjs/services/storage-service/databases/index.js +14 -1
- package/cjs/services/storage-service/db-stores/KeyValue.js +13 -0
- package/cjs/services/subscan-service/index.js +11 -3
- package/cjs/services/transaction-service/index.js +3 -3
- package/cjs/services/wallet-connect-service/constants.js +2 -2
- package/cjs/services/wallet-connect-service/helpers.js +1 -4
- package/cjs/services/wallet-connect-service/index.js +50 -33
- package/cjs/storage/index.js +120 -23
- package/cjs/types/common/index.js +16 -0
- package/cjs/types/common/storage.js +1 -0
- package/cjs/types/index.js +11 -0
- package/cjs/utils/environment.js +1 -1
- package/cjs/utils/eth/parseTransaction/index.js +8 -10
- package/cjs/utils/fetch.js +55 -0
- package/cjs/utils/fetchStaticCache.js +2 -4
- package/cjs/utils/fetchStaticData.js +7 -4
- package/cjs/utils/index.js +24 -0
- package/cjs/utils/reportError.js +1 -3
- package/constants/storage.d.ts +1 -0
- package/constants/storage.js +1 -0
- package/koni/api/dotsama/crowdloan.js +2 -3
- package/koni/api/nft/acala_nft/index.js +0 -1
- package/koni/api/nft/assethub_nft/index.js +0 -1
- package/koni/api/nft/assethub_unique/index.js +0 -1
- package/koni/api/nft/bit.country/index.js +0 -1
- package/koni/api/nft/config.js +1 -7
- package/koni/api/nft/evm_nft/index.js +0 -1
- package/koni/api/nft/karura_nft/index.js +0 -1
- package/koni/api/nft/ordinal_nft/index.d.ts +2 -0
- package/koni/api/nft/ordinal_nft/index.js +4 -3
- package/koni/api/nft/rmrk_nft/index.js +0 -1
- package/koni/api/nft/unique_network_nft/index.js +0 -1
- package/koni/api/nft/unique_nft/uniqueNftV2.js +0 -1
- package/koni/api/nft/vara_nft/index.js +0 -1
- package/koni/api/nft/wasm_nft/index.js +4 -10
- package/koni/api/staking/bonding/astar.js +0 -1
- package/koni/api/staking/subsquidStaking.js +10 -12
- package/koni/api/subquery/subquery.js +0 -1
- package/koni/background/handlers/Extension.d.ts +4 -0
- package/koni/background/handlers/Extension.js +29 -8
- package/koni/background/handlers/Mobile.js +9 -6
- package/koni/background/handlers/State.d.ts +6 -1
- package/koni/background/handlers/State.js +68 -12
- package/koni/background/handlers/Tabs.js +7 -3
- package/koni/background/handlers/index.d.ts +13 -7
- package/koni/background/handlers/index.js +67 -62
- package/koni/background/subscription.js +2 -1
- package/package.json +35 -28
- package/packageInfo.js +1 -1
- package/services/campaign-service/helpers.js +3 -1
- package/services/chain-service/index.js +36 -28
- package/services/chain-service/utils/patch.js +0 -1
- package/services/earning-service/handlers/liquid-staking/acala.js +0 -1
- package/services/earning-service/handlers/liquid-staking/bifrost-manta.js +0 -1
- package/services/earning-service/handlers/liquid-staking/bifrost.js +0 -1
- package/services/earning-service/handlers/liquid-staking/stella-swap.js +0 -1
- package/services/earning-service/handlers/native-staking/astar.js +0 -1
- package/services/event-service/index.js +0 -1
- package/services/history-service/subsquid-multi-chain-history.js +0 -1
- package/services/keyring-service/index.d.ts +1 -0
- package/services/keyring-service/index.js +19 -0
- package/services/migration-service/scripts/MigrateRemoveGenesisHash.d.ts +4 -0
- package/services/migration-service/scripts/MigrateRemoveGenesisHash.js +20 -0
- package/services/migration-service/scripts/index.js +3 -1
- package/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +17 -21
- package/services/notification-service/NotificationService.js +3 -1
- package/services/price-service/coingecko.js +6 -6
- package/services/price-service/index.js +7 -3
- package/services/request-service/handler/PopupHandler.d.ts +1 -1
- package/services/request-service/handler/PopupHandler.js +14 -15
- package/services/setting-service/SettingService.d.ts +1 -0
- package/services/setting-service/SettingService.js +4 -1
- package/services/setting-service/constants.js +2 -2
- package/services/setting-service/i18n/i18n.js +2 -4
- package/services/storage-service/DatabaseService.js +1 -1
- package/services/storage-service/databases/index.d.ts +8 -0
- package/services/storage-service/databases/index.js +13 -1
- package/services/storage-service/db-stores/KeyValue.d.ts +4 -0
- package/services/storage-service/db-stores/KeyValue.js +5 -0
- package/services/subscan-service/index.d.ts +2 -0
- package/services/subscan-service/index.js +10 -1
- package/services/transaction-service/index.js +4 -4
- package/services/wallet-connect-service/constants.js +3 -3
- package/services/wallet-connect-service/helpers.js +1 -4
- package/services/wallet-connect-service/index.d.ts +2 -0
- package/services/wallet-connect-service/index.js +42 -31
- package/storage/index.d.ts +19 -9
- package/storage/index.js +115 -23
- package/types/common/index.d.ts +1 -0
- package/types/common/index.js +4 -0
- package/types/common/storage.d.ts +4 -0
- package/types/common/storage.js +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/utils/environment.js +1 -1
- package/utils/eth/parseTransaction/index.js +8 -10
- package/utils/fetch.d.ts +8 -0
- package/utils/fetch.js +44 -0
- package/utils/fetchStaticCache.js +2 -3
- package/utils/fetchStaticData.d.ts +1 -1
- package/utils/fetchStaticData.js +7 -4
- package/utils/index.d.ts +2 -0
- package/utils/index.js +2 -0
- package/utils/reportError.js +0 -1
- package/background/handlers/Extension.d.ts +0 -55
- package/background/handlers/Extension.js +0 -601
- package/background/handlers/Tabs.d.ts +0 -24
- package/background/handlers/Tabs.js +0 -194
- package/background/handlers/index.d.ts +0 -3
- package/background/handlers/index.js +0 -45
- package/cjs/background/handlers/Extension.js +0 -642
- package/cjs/background/handlers/Tabs.js +0 -222
- package/cjs/background/handlers/index.js +0 -54
- package/cjs/koni/background/events.js +0 -14
- package/koni/background/events.d.ts +0 -1
- package/koni/background/events.js +0 -7
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _defaults = require("@subwallet/extension-base/defaults");
|
|
9
|
-
var _utils = require("@subwallet/extension-base/utils");
|
|
10
|
-
var _uiKeyring = _interopRequireDefault(require("@subwallet/ui-keyring"));
|
|
11
|
-
var _accounts = require("@subwallet/ui-keyring/observable/accounts");
|
|
12
|
-
var _phishing = require("@polkadot/phishing");
|
|
13
|
-
var _util = require("@polkadot/util");
|
|
14
|
-
var _RequestBytesSign = _interopRequireDefault(require("../RequestBytesSign"));
|
|
15
|
-
var _RequestExtrinsicSign = _interopRequireDefault(require("../RequestExtrinsicSign"));
|
|
16
|
-
var _helpers = require("./helpers");
|
|
17
|
-
var _subscriptions = require("./subscriptions");
|
|
18
|
-
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
19
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
20
|
-
|
|
21
|
-
function transformAccounts(accounts) {
|
|
22
|
-
let anyType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
23
|
-
return Object.values(accounts).filter(_ref => {
|
|
24
|
-
let {
|
|
25
|
-
json: {
|
|
26
|
-
meta: {
|
|
27
|
-
isHidden
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
} = _ref;
|
|
31
|
-
return !isHidden;
|
|
32
|
-
}).filter(_ref2 => {
|
|
33
|
-
let {
|
|
34
|
-
type
|
|
35
|
-
} = _ref2;
|
|
36
|
-
return anyType ? true : (0, _utils.canDerive)(type);
|
|
37
|
-
}).filter(_ref3 => {
|
|
38
|
-
let {
|
|
39
|
-
type
|
|
40
|
-
} = _ref3;
|
|
41
|
-
return type !== 'ethereum';
|
|
42
|
-
}) // Quick fix DApp not allow EVM
|
|
43
|
-
.sort((a, b) => (a.json.meta.whenCreated || 0) - (b.json.meta.whenCreated || 0)).map(_ref4 => {
|
|
44
|
-
let {
|
|
45
|
-
json: {
|
|
46
|
-
address,
|
|
47
|
-
meta: {
|
|
48
|
-
genesisHash,
|
|
49
|
-
name
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
type
|
|
53
|
-
} = _ref4;
|
|
54
|
-
return {
|
|
55
|
-
address,
|
|
56
|
-
genesisHash,
|
|
57
|
-
name,
|
|
58
|
-
type
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
class Tabs {
|
|
63
|
-
#state;
|
|
64
|
-
constructor(state) {
|
|
65
|
-
this.#state = state;
|
|
66
|
-
}
|
|
67
|
-
authorize(url, request) {
|
|
68
|
-
return this.#state.authorizeUrl(url, request);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
72
|
-
accountsList(url, _ref5) {
|
|
73
|
-
let {
|
|
74
|
-
anyType
|
|
75
|
-
} = _ref5;
|
|
76
|
-
return transformAccounts(_accounts.accounts.subject.getValue(), anyType);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// FIXME This looks very much like what we have in Extension
|
|
80
|
-
accountsSubscribe(url, id, port) {
|
|
81
|
-
const cb = (0, _subscriptions.createSubscription)(id, port);
|
|
82
|
-
const subscription = _accounts.accounts.subject.subscribe(accounts => cb(transformAccounts(accounts)));
|
|
83
|
-
port.onDisconnect.addListener(() => {
|
|
84
|
-
(0, _subscriptions.unsubscribe)(id);
|
|
85
|
-
subscription.unsubscribe();
|
|
86
|
-
});
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
getSigningPair(address) {
|
|
90
|
-
const pair = _uiKeyring.default.getPair(address);
|
|
91
|
-
(0, _util.assert)(pair, 'Unable to find account');
|
|
92
|
-
return pair;
|
|
93
|
-
}
|
|
94
|
-
bytesSign(url, request) {
|
|
95
|
-
const address = request.address;
|
|
96
|
-
const pair = this.getSigningPair(address);
|
|
97
|
-
return this.#state.sign(url, new _RequestBytesSign.default(request), {
|
|
98
|
-
address,
|
|
99
|
-
...pair.meta
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
extrinsicSign(url, request) {
|
|
103
|
-
const address = request.address;
|
|
104
|
-
const pair = this.getSigningPair(address);
|
|
105
|
-
return this.#state.sign(url, new _RequestExtrinsicSign.default(request), {
|
|
106
|
-
address,
|
|
107
|
-
...pair.meta
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
metadataProvide(url, request) {
|
|
111
|
-
return this.#state.injectMetadata(url, request);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
115
|
-
metadataList(url) {
|
|
116
|
-
return this.#state.knownMetadata.map(_ref6 => {
|
|
117
|
-
let {
|
|
118
|
-
genesisHash,
|
|
119
|
-
specVersion
|
|
120
|
-
} = _ref6;
|
|
121
|
-
return {
|
|
122
|
-
genesisHash,
|
|
123
|
-
specVersion
|
|
124
|
-
};
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
rpcListProviders() {
|
|
128
|
-
return this.#state.rpcListProviders();
|
|
129
|
-
}
|
|
130
|
-
rpcSend(request, port) {
|
|
131
|
-
return this.#state.rpcSend(request, port);
|
|
132
|
-
}
|
|
133
|
-
rpcStartProvider(key, port) {
|
|
134
|
-
return this.#state.rpcStartProvider(key, port);
|
|
135
|
-
}
|
|
136
|
-
async rpcSubscribe(request, id, port) {
|
|
137
|
-
const innerCb = (0, _subscriptions.createSubscription)(id, port);
|
|
138
|
-
const cb = (_error, data) => innerCb(data);
|
|
139
|
-
const subscriptionId = await this.#state.rpcSubscribe(request, cb, port);
|
|
140
|
-
port.onDisconnect.addListener(() => {
|
|
141
|
-
(0, _subscriptions.unsubscribe)(id);
|
|
142
|
-
(0, _helpers.withErrorLog)(() => this.rpcUnsubscribe({
|
|
143
|
-
...request,
|
|
144
|
-
subscriptionId
|
|
145
|
-
}, port));
|
|
146
|
-
});
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
rpcSubscribeConnected(request, id, port) {
|
|
150
|
-
const innerCb = (0, _subscriptions.createSubscription)(id, port);
|
|
151
|
-
const cb = (_error, data) => innerCb(data);
|
|
152
|
-
this.#state.rpcSubscribeConnected(request, cb, port);
|
|
153
|
-
port.onDisconnect.addListener(() => {
|
|
154
|
-
(0, _subscriptions.unsubscribe)(id);
|
|
155
|
-
});
|
|
156
|
-
return Promise.resolve(true);
|
|
157
|
-
}
|
|
158
|
-
async rpcUnsubscribe(request, port) {
|
|
159
|
-
return this.#state.rpcUnsubscribe(request, port);
|
|
160
|
-
}
|
|
161
|
-
redirectPhishingLanding(phishingWebsite) {
|
|
162
|
-
const nonFragment = phishingWebsite.split('#')[0];
|
|
163
|
-
const encodedWebsite = encodeURIComponent(nonFragment);
|
|
164
|
-
const url = `${chrome.extension.getURL('index.html')}#${_defaults.PHISHING_PAGE_REDIRECT}/${encodedWebsite}`;
|
|
165
|
-
chrome.tabs.query({
|
|
166
|
-
url: nonFragment
|
|
167
|
-
}, tabs => {
|
|
168
|
-
tabs.map(_ref7 => {
|
|
169
|
-
let {
|
|
170
|
-
id
|
|
171
|
-
} = _ref7;
|
|
172
|
-
return id;
|
|
173
|
-
}).filter(id => (0, _util.isNumber)(id)).forEach(id => (0, _helpers.withErrorLog)(() => chrome.tabs.update(id, {
|
|
174
|
-
url
|
|
175
|
-
})));
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
async redirectIfPhishing(url) {
|
|
179
|
-
const isInDenyList = await (0, _phishing.checkIfDenied)(url);
|
|
180
|
-
if (isInDenyList) {
|
|
181
|
-
this.redirectPhishingLanding(url);
|
|
182
|
-
return true;
|
|
183
|
-
}
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
async handle(id, type, request, url, port) {
|
|
187
|
-
if (type === 'pub(phishing.redirectIfDenied)') {
|
|
188
|
-
return this.redirectIfPhishing(url);
|
|
189
|
-
}
|
|
190
|
-
switch (type) {
|
|
191
|
-
case 'pub(authorize.tab)':
|
|
192
|
-
return this.authorize(url, request);
|
|
193
|
-
case 'pub(accounts.list)':
|
|
194
|
-
return this.accountsList(url, request);
|
|
195
|
-
case 'pub(accounts.subscribe)':
|
|
196
|
-
return this.accountsSubscribe(url, id, port);
|
|
197
|
-
case 'pub(bytes.sign)':
|
|
198
|
-
return this.bytesSign(url, request);
|
|
199
|
-
case 'pub(extrinsic.sign)':
|
|
200
|
-
return this.extrinsicSign(url, request);
|
|
201
|
-
case 'pub(metadata.list)':
|
|
202
|
-
return this.metadataList(url);
|
|
203
|
-
case 'pub(metadata.provide)':
|
|
204
|
-
return this.metadataProvide(url, request);
|
|
205
|
-
case 'pub(rpc.listProviders)':
|
|
206
|
-
return this.rpcListProviders();
|
|
207
|
-
case 'pub(rpc.send)':
|
|
208
|
-
return this.rpcSend(request, port);
|
|
209
|
-
case 'pub(rpc.startProvider)':
|
|
210
|
-
return this.rpcStartProvider(request, port);
|
|
211
|
-
case 'pub(rpc.subscribe)':
|
|
212
|
-
return this.rpcSubscribe(request, id, port);
|
|
213
|
-
case 'pub(rpc.subscribeConnected)':
|
|
214
|
-
return this.rpcSubscribeConnected(request, id, port);
|
|
215
|
-
case 'pub(rpc.unsubscribe)':
|
|
216
|
-
return this.rpcUnsubscribe(request, port);
|
|
217
|
-
default:
|
|
218
|
-
throw new Error(`Unable to handle message of type ${type}`);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
exports.default = Tabs;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = handler;
|
|
8
|
-
var _util = require("@polkadot/util");
|
|
9
|
-
var _defaults = require("../../defaults");
|
|
10
|
-
var _Extension = _interopRequireDefault(require("./Extension"));
|
|
11
|
-
var _State = _interopRequireDefault(require("./State"));
|
|
12
|
-
var _Tabs = _interopRequireDefault(require("./Tabs"));
|
|
13
|
-
// Copyright 2019-2022 @polkadot/extension authors & contributors
|
|
14
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
15
|
-
|
|
16
|
-
const state = new _State.default();
|
|
17
|
-
const extension = new _Extension.default(state);
|
|
18
|
-
const tabs = new _Tabs.default(state);
|
|
19
|
-
function handler(_ref, port) {
|
|
20
|
-
let {
|
|
21
|
-
id,
|
|
22
|
-
message,
|
|
23
|
-
request
|
|
24
|
-
} = _ref;
|
|
25
|
-
let extensionPortName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _defaults.PORT_EXTENSION;
|
|
26
|
-
const isExtension = port.name === extensionPortName;
|
|
27
|
-
const sender = port.sender;
|
|
28
|
-
const from = isExtension ? 'extension' : sender.tab && sender.tab.url || sender.url || '<unknown>';
|
|
29
|
-
const source = `${from}: ${id}: ${message}`;
|
|
30
|
-
console.log(` [in] ${source}`); // :: ${JSON.stringify(request)}`);
|
|
31
|
-
|
|
32
|
-
const promise = isExtension ? extension.handle(id, message, request, port) : tabs.handle(id, message, request, from, port);
|
|
33
|
-
promise.then(response => {
|
|
34
|
-
console.log(`[out] ${source}`); // :: ${JSON.stringify(response)}`);
|
|
35
|
-
|
|
36
|
-
// between the start and the end of the promise, the user may have closed
|
|
37
|
-
// the tab, in which case port will be undefined
|
|
38
|
-
(0, _util.assert)(port, 'Port has been disconnected');
|
|
39
|
-
port.postMessage({
|
|
40
|
-
id,
|
|
41
|
-
response
|
|
42
|
-
});
|
|
43
|
-
}).catch(error => {
|
|
44
|
-
console.log(`[err] ${source}:: ${error.message}`);
|
|
45
|
-
|
|
46
|
-
// only send message back to port if it's still connected
|
|
47
|
-
if (port) {
|
|
48
|
-
port.postMessage({
|
|
49
|
-
error: error.message,
|
|
50
|
-
id
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.onExtensionInstall = void 0;
|
|
7
|
-
var _handlers = require("@subwallet/extension-base/koni/background/handlers");
|
|
8
|
-
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
9
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
10
|
-
|
|
11
|
-
const onExtensionInstall = () => {
|
|
12
|
-
_handlers.state.onInstall();
|
|
13
|
-
};
|
|
14
|
-
exports.onExtensionInstall = onExtensionInstall;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const onExtensionInstall: () => void;
|