@subwallet/extension-base 1.3.7-0 → 1.3.8-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 +7 -5
- package/background/KoniTypes.js +1 -1
- package/cjs/background/KoniTypes.js +1 -1
- package/cjs/core/substrate/xcm-parser.js +16 -2
- package/cjs/koni/api/contract-handler/utils/index.js +15 -1
- package/cjs/koni/background/handlers/Extension.js +42 -3
- package/cjs/koni/background/handlers/State.js +11 -2
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/balance-service/transfer/xcm/index.js +31 -1
- package/cjs/services/balance-service/transfer/xcm/polygonBridge.js +108 -0
- package/cjs/services/chain-online-service/constants.js +32 -0
- package/cjs/services/chain-online-service/index.js +190 -0
- package/cjs/services/chain-service/index.js +87 -127
- package/cjs/services/chain-service/utils/index.js +0 -2
- package/cjs/services/chain-service/utils/patch.js +7 -3
- package/cjs/services/fee-service/utils/index.js +14 -0
- package/cjs/services/inapp-notification-service/consts.js +6 -4
- package/cjs/services/inapp-notification-service/index.js +110 -6
- package/cjs/services/inapp-notification-service/interfaces.js +9 -1
- package/cjs/services/inapp-notification-service/utils/avail.js +88 -0
- package/cjs/services/inapp-notification-service/{utils.js → utils/common.js} +1 -84
- package/cjs/services/inapp-notification-service/utils/index.js +38 -0
- package/cjs/services/inapp-notification-service/utils/polygon.js +66 -0
- package/cjs/services/migration-service/scripts/MigrateTransactionHistoryBridge.js +37 -0
- package/cjs/services/migration-service/scripts/index.js +3 -1
- package/cjs/services/setting-service/SettingService.js +8 -0
- package/cjs/services/setting-service/constants.js +2 -1
- package/cjs/services/storage-service/DatabaseService.js +3 -0
- package/cjs/services/transaction-service/index.js +1 -1
- package/cjs/stores/ChainlistStore.js +18 -0
- package/cjs/types/index.js +11 -0
- package/cjs/utils/account/transform.js +1 -1
- package/core/substrate/xcm-parser.d.ts +1 -0
- package/core/substrate/xcm-parser.js +15 -2
- package/koni/api/contract-handler/utils/index.d.ts +2 -0
- package/koni/api/contract-handler/utils/index.js +12 -0
- package/koni/api/contract-handler/utils/polygon_bridge_abi.json +1004 -0
- package/koni/background/handlers/Extension.d.ts +2 -0
- package/koni/background/handlers/Extension.js +43 -4
- package/koni/background/handlers/State.d.ts +2 -0
- package/koni/background/handlers/State.js +11 -2
- package/package.json +56 -14
- package/packageInfo.js +1 -1
- package/services/balance-service/transfer/xcm/index.d.ts +1 -0
- package/services/balance-service/transfer/xcm/index.js +29 -1
- package/services/balance-service/transfer/xcm/polygonBridge.d.ts +22 -0
- package/services/balance-service/transfer/xcm/polygonBridge.js +95 -0
- package/services/chain-online-service/constants.d.ts +4 -0
- package/services/chain-online-service/constants.js +23 -0
- package/services/chain-online-service/index.d.ts +22 -0
- package/services/chain-online-service/index.js +182 -0
- package/services/chain-service/index.d.ts +6 -7
- package/services/chain-service/index.js +78 -116
- package/services/chain-service/utils/index.js +0 -2
- package/services/chain-service/utils/patch.d.ts +16 -1
- package/services/chain-service/utils/patch.js +7 -3
- package/services/fee-service/utils/index.js +14 -0
- package/services/inapp-notification-service/consts.d.ts +3 -1
- package/services/inapp-notification-service/consts.js +6 -4
- package/services/inapp-notification-service/index.d.ts +10 -2
- package/services/inapp-notification-service/index.js +111 -7
- package/services/inapp-notification-service/interfaces.d.ts +27 -3
- package/services/inapp-notification-service/interfaces.js +7 -0
- package/services/inapp-notification-service/utils/avail.d.ts +40 -0
- package/services/inapp-notification-service/utils/avail.js +73 -0
- package/services/inapp-notification-service/utils/common.d.ts +11 -0
- package/services/inapp-notification-service/{utils.js → utils/common.js} +1 -72
- package/services/inapp-notification-service/utils/index.d.ts +3 -0
- package/services/inapp-notification-service/utils/index.js +6 -0
- package/services/inapp-notification-service/utils/polygon.d.ts +71 -0
- package/services/inapp-notification-service/utils/polygon.js +54 -0
- package/services/migration-service/scripts/MigrateTransactionHistoryBridge.d.ts +4 -0
- package/services/migration-service/scripts/MigrateTransactionHistoryBridge.js +29 -0
- package/services/migration-service/scripts/index.js +3 -1
- package/services/setting-service/SettingService.d.ts +4 -0
- package/services/setting-service/SettingService.js +8 -0
- package/services/setting-service/constants.js +2 -1
- package/services/storage-service/DatabaseService.d.ts +1 -0
- package/services/storage-service/DatabaseService.js +3 -0
- package/services/transaction-service/index.js +1 -1
- package/stores/ChainlistStore.d.ts +7 -0
- package/stores/ChainlistStore.js +10 -0
- package/types/{avail-bridge → bridge}/index.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/types/notification/index.d.ts +5 -0
- package/utils/account/transform.js +1 -1
- package/services/inapp-notification-service/utils.d.ts +0 -55
- /package/cjs/types/{avail-bridge → bridge}/index.js +0 -0
- /package/types/{avail-bridge → bridge}/index.js +0 -0
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.InappNotificationService = void 0;
|
|
7
|
+
var _chainList = require("@subwallet/chain-list");
|
|
7
8
|
var _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
|
|
8
9
|
var _constants = require("@subwallet/extension-base/constants");
|
|
9
10
|
var _remindNotificationTime = require("@subwallet/extension-base/constants/remind-notification-time");
|
|
@@ -110,6 +111,28 @@ class InappNotificationService {
|
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
if ([_interfaces.NotificationActionType.CLAIM_POLYGON_BRIDGE].includes(candidateNotification.actionType)) {
|
|
115
|
+
const {
|
|
116
|
+
address,
|
|
117
|
+
metadata,
|
|
118
|
+
time
|
|
119
|
+
} = candidateNotification;
|
|
120
|
+
const candidateMetadata = metadata;
|
|
121
|
+
const remindTime = (0, _utils.hrsToMillisecond)(remindTimeConfigInHrs[candidateNotification.actionType]);
|
|
122
|
+
for (const notification of comparedNotifications) {
|
|
123
|
+
if (notification.address !== address) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (time - notification.time >= remindTime) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const comparedMetadata = notification.metadata;
|
|
130
|
+
const sameNotification = candidateMetadata._id === comparedMetadata._id && candidateMetadata.transactionHash === comparedMetadata.transactionHash && candidateMetadata.counter === comparedMetadata.counter;
|
|
131
|
+
if (sameNotification) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
113
136
|
return true;
|
|
114
137
|
}
|
|
115
138
|
async validateAndWriteNotificationsToDB(notifications, address) {
|
|
@@ -131,17 +154,23 @@ class InappNotificationService {
|
|
|
131
154
|
}
|
|
132
155
|
await this.dbService.upsertNotifications(passNotifications);
|
|
133
156
|
}
|
|
134
|
-
|
|
157
|
+
cronCreateBridgeClaimNotification() {
|
|
135
158
|
clearTimeout(this.refeshAvailBridgeClaimTimeOut);
|
|
136
159
|
this.createAvailBridgeClaimNotification();
|
|
137
|
-
this.
|
|
160
|
+
this.createPolygonClaimableTransactions().catch(err => {
|
|
161
|
+
console.error('Error:', err);
|
|
162
|
+
});
|
|
163
|
+
this.refeshAvailBridgeClaimTimeOut = setTimeout(this.cronCreateBridgeClaimNotification.bind(this), _constants.CRON_LISTEN_AVAIL_BRIDGE_CLAIM);
|
|
138
164
|
}
|
|
139
|
-
|
|
165
|
+
getCategorizedAddresses() {
|
|
140
166
|
const addresses = this.keyringService.context.getAllAddresses();
|
|
167
|
+
return (0, _utils2.categoryAddresses)(addresses);
|
|
168
|
+
}
|
|
169
|
+
createAvailBridgeClaimNotification() {
|
|
141
170
|
const {
|
|
142
171
|
evm: evmAddresses,
|
|
143
172
|
substrate: substrateAddresses
|
|
144
|
-
} =
|
|
173
|
+
} = this.getCategorizedAddresses();
|
|
145
174
|
const chainAssets = this.chainService.getAssetRegistry();
|
|
146
175
|
let ASSET_TYPE;
|
|
147
176
|
(function (ASSET_TYPE) {
|
|
@@ -215,7 +244,7 @@ class InappNotificationService {
|
|
|
215
244
|
title: _consts.NotificationTitleMap[actionType].replace('{{tokenSymbol}}', symbol),
|
|
216
245
|
description: _consts.NotificationDescriptionMap[actionType]((0, _utils2.formatNumber)(amount, decimals), symbol),
|
|
217
246
|
time: timestamp,
|
|
218
|
-
extrinsicType: _KoniTypes.ExtrinsicType.
|
|
247
|
+
extrinsicType: _KoniTypes.ExtrinsicType.CLAIM_BRIDGE,
|
|
219
248
|
isRead: false,
|
|
220
249
|
actionType,
|
|
221
250
|
metadata
|
|
@@ -223,6 +252,81 @@ class InappNotificationService {
|
|
|
223
252
|
});
|
|
224
253
|
await this.validateAndWriteNotificationsToDB(notifications, address);
|
|
225
254
|
}
|
|
255
|
+
|
|
256
|
+
// Polygon Claimable Handle
|
|
257
|
+
async createPolygonClaimableTransactions() {
|
|
258
|
+
const {
|
|
259
|
+
evm: evmAddresses
|
|
260
|
+
} = this.getCategorizedAddresses();
|
|
261
|
+
const etherChains = [_chainList.COMMON_ASSETS.ETH, _chainList.COMMON_ASSETS.ETH_SEPOLIA];
|
|
262
|
+
const polygonAssets = Object.values(this.chainService.getAssetRegistry()).filter(asset => etherChains.includes(asset.slug));
|
|
263
|
+
for (const polygonAsset of polygonAssets) {
|
|
264
|
+
const isTestnet = (polygonAsset === null || polygonAsset === void 0 ? void 0 : polygonAsset.originChain) === _chainList.COMMON_CHAIN_SLUGS.ETHEREUM_SEPOLIA;
|
|
265
|
+
if (evmAddresses.length === 0) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
for (const address of evmAddresses) {
|
|
269
|
+
const response = await (0, _utils.fetchPolygonBridgeTransactions)(address, isTestnet);
|
|
270
|
+
if (response && response.success) {
|
|
271
|
+
await this.processPolygonClaimNotification(address, response.result, polygonAsset);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async processPolygonClaimNotification(address, transactions, token) {
|
|
277
|
+
var _token$decimals2;
|
|
278
|
+
const actionType = _interfaces.NotificationActionType.CLAIM_POLYGON_BRIDGE;
|
|
279
|
+
const timestamp = Date.now();
|
|
280
|
+
const symbol = token.symbol;
|
|
281
|
+
const decimals = (_token$decimals2 = token.decimals) !== null && _token$decimals2 !== void 0 ? _token$decimals2 : 0;
|
|
282
|
+
const notifications = transactions.map(transaction => {
|
|
283
|
+
const {
|
|
284
|
+
_id,
|
|
285
|
+
amounts,
|
|
286
|
+
counter,
|
|
287
|
+
destinationNetwork,
|
|
288
|
+
originTokenAddress,
|
|
289
|
+
originTokenNetwork,
|
|
290
|
+
receiver,
|
|
291
|
+
sourceNetwork,
|
|
292
|
+
status,
|
|
293
|
+
transactionHash,
|
|
294
|
+
transactionInitiator,
|
|
295
|
+
userAddress
|
|
296
|
+
} = transaction;
|
|
297
|
+
const metadata = {
|
|
298
|
+
chainSlug: token.originChain,
|
|
299
|
+
tokenSlug: token.slug,
|
|
300
|
+
_id,
|
|
301
|
+
amounts,
|
|
302
|
+
counter,
|
|
303
|
+
destinationNetwork,
|
|
304
|
+
originTokenAddress,
|
|
305
|
+
originTokenNetwork,
|
|
306
|
+
receiver,
|
|
307
|
+
sourceNetwork,
|
|
308
|
+
status,
|
|
309
|
+
transactionHash,
|
|
310
|
+
transactionInitiator,
|
|
311
|
+
userAddress
|
|
312
|
+
};
|
|
313
|
+
return {
|
|
314
|
+
id: `${actionType}___${_id}___${timestamp}`,
|
|
315
|
+
address: address,
|
|
316
|
+
title: _consts.NotificationTitleMap[actionType].replace('{{tokenSymbol}}', symbol),
|
|
317
|
+
description: _consts.NotificationDescriptionMap[actionType]((0, _utils2.formatNumber)(amounts[0], decimals), symbol),
|
|
318
|
+
time: timestamp,
|
|
319
|
+
extrinsicType: _KoniTypes.ExtrinsicType.CLAIM_BRIDGE,
|
|
320
|
+
isRead: false,
|
|
321
|
+
actionType,
|
|
322
|
+
metadata
|
|
323
|
+
};
|
|
324
|
+
});
|
|
325
|
+
await this.validateAndWriteNotificationsToDB(notifications, address);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Polygon Claimable Handle
|
|
329
|
+
|
|
226
330
|
async start() {
|
|
227
331
|
if (this.status === _types.ServiceStatus.STARTED) {
|
|
228
332
|
return;
|
|
@@ -235,7 +339,7 @@ class InappNotificationService {
|
|
|
235
339
|
}
|
|
236
340
|
async startCron() {
|
|
237
341
|
this.cleanUpOldNotifications().catch(console.error);
|
|
238
|
-
this.
|
|
342
|
+
this.cronCreateBridgeClaimNotification();
|
|
239
343
|
return Promise.resolve();
|
|
240
344
|
}
|
|
241
345
|
async stop() {
|
|
@@ -3,9 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.NotificationTimePeriod = exports.NotificationTab = exports.NotificationActionType = void 0;
|
|
6
|
+
exports.NotificationTimePeriod = exports.NotificationTab = exports.NotificationActionType = exports.BridgeTransactionStatus = void 0;
|
|
7
7
|
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
let BridgeTransactionStatus;
|
|
10
|
+
exports.BridgeTransactionStatus = BridgeTransactionStatus;
|
|
11
|
+
(function (BridgeTransactionStatus) {
|
|
12
|
+
BridgeTransactionStatus["READY_TO_CLAIM"] = "READY_TO_CLAIM";
|
|
13
|
+
BridgeTransactionStatus["CLAIMED"] = "CLAIMED";
|
|
14
|
+
BridgeTransactionStatus["BRIDGED"] = "BRIDGED";
|
|
15
|
+
})(BridgeTransactionStatus || (exports.BridgeTransactionStatus = BridgeTransactionStatus = {}));
|
|
9
16
|
let NotificationTimePeriod;
|
|
10
17
|
exports.NotificationTimePeriod = NotificationTimePeriod;
|
|
11
18
|
(function (NotificationTimePeriod) {
|
|
@@ -22,6 +29,7 @@ exports.NotificationActionType = NotificationActionType;
|
|
|
22
29
|
NotificationActionType["CLAIM"] = "CLAIM";
|
|
23
30
|
NotificationActionType["CLAIM_AVAIL_BRIDGE_ON_AVAIL"] = "CLAIM_AVAIL_BRIDGE_ON_AVAIL";
|
|
24
31
|
NotificationActionType["CLAIM_AVAIL_BRIDGE_ON_ETHEREUM"] = "CLAIM_AVAIL_BRIDGE_ON_ETHEREUM";
|
|
32
|
+
NotificationActionType["CLAIM_POLYGON_BRIDGE"] = "CLAIM_POLYGON_BRIDGE";
|
|
25
33
|
})(NotificationActionType || (exports.NotificationActionType = NotificationActionType = {}));
|
|
26
34
|
let NotificationTab;
|
|
27
35
|
exports.NotificationTab = NotificationTab;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AvailBridgeSourceChain = exports.AVAIL_BRIDGE_INDEXER = exports.AVAIL_BRIDGE_API = void 0;
|
|
7
|
+
exports.fetchAllAvailBridgeClaimable = fetchAllAvailBridgeClaimable;
|
|
8
|
+
exports.fetchAvailBridgeTransactions = fetchAvailBridgeTransactions;
|
|
9
|
+
exports.filterClaimableOfAddress = filterClaimableOfAddress;
|
|
10
|
+
exports.getAvailBridgeClaimDescription = getAvailBridgeClaimDescription;
|
|
11
|
+
var _interfaces = require("../interfaces");
|
|
12
|
+
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
13
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
14
|
+
|
|
15
|
+
/* Description */
|
|
16
|
+
function getAvailBridgeClaimDescription(amount, symbol) {
|
|
17
|
+
return `${amount} ${symbol} ready to claim from ${symbol} cross-chain transfer. Click to claim now!`;
|
|
18
|
+
}
|
|
19
|
+
/* Description */
|
|
20
|
+
|
|
21
|
+
// todo: can refactor utils and const of avail bridge to a new file. Also check in /transfer/xcm/availBridge.ts file
|
|
22
|
+
|
|
23
|
+
const AVAIL_BRIDGE_INDEXER = {
|
|
24
|
+
AVAIL_MAINNET: 'https://bridge-indexer.avail.so',
|
|
25
|
+
AVAIL_TESTNET: 'https://turing-bridge-indexer.fra.avail.so'
|
|
26
|
+
};
|
|
27
|
+
exports.AVAIL_BRIDGE_INDEXER = AVAIL_BRIDGE_INDEXER;
|
|
28
|
+
const AVAIL_BRIDGE_API = {
|
|
29
|
+
AVAIL_MAINNET: 'https://bridge-api.avail.so',
|
|
30
|
+
AVAIL_TESTNET: 'https://turing-bridge-api.fra.avail.so'
|
|
31
|
+
};
|
|
32
|
+
exports.AVAIL_BRIDGE_API = AVAIL_BRIDGE_API;
|
|
33
|
+
let AvailBridgeSourceChain;
|
|
34
|
+
exports.AvailBridgeSourceChain = AvailBridgeSourceChain;
|
|
35
|
+
(function (AvailBridgeSourceChain) {
|
|
36
|
+
AvailBridgeSourceChain["AVAIL"] = "AVAIL";
|
|
37
|
+
AvailBridgeSourceChain["ETHEREUM"] = "ETHEREUM";
|
|
38
|
+
})(AvailBridgeSourceChain || (exports.AvailBridgeSourceChain = AvailBridgeSourceChain = {}));
|
|
39
|
+
async function fetchAllAvailBridgeClaimable(address, sourceChain, isTestnet) {
|
|
40
|
+
const transactions = [];
|
|
41
|
+
let isContinue = true;
|
|
42
|
+
let page = 0;
|
|
43
|
+
const pageSize = 100;
|
|
44
|
+
while (isContinue) {
|
|
45
|
+
const response = await fetchAvailBridgeTransactions(address, sourceChain, _interfaces.BridgeTransactionStatus.READY_TO_CLAIM, pageSize, page, isTestnet);
|
|
46
|
+
if (!response) {
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
transactions.push(...filterClaimableOfAddress(address, response.data.result));
|
|
50
|
+
isContinue = response.data.paginationData.hasNextPage;
|
|
51
|
+
page = page + 1;
|
|
52
|
+
}
|
|
53
|
+
return transactions;
|
|
54
|
+
}
|
|
55
|
+
async function fetchAvailBridgeTransactions(userAddress, sourceChain, status) {
|
|
56
|
+
let pageSize = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100;
|
|
57
|
+
let page = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
58
|
+
let isTestnet = arguments.length > 5 ? arguments[5] : undefined;
|
|
59
|
+
const params = new URLSearchParams({
|
|
60
|
+
userAddress,
|
|
61
|
+
sourceChain,
|
|
62
|
+
status,
|
|
63
|
+
pageSize: pageSize.toString(),
|
|
64
|
+
page: page.toString()
|
|
65
|
+
});
|
|
66
|
+
try {
|
|
67
|
+
const api = isTestnet ? AVAIL_BRIDGE_INDEXER.AVAIL_TESTNET : AVAIL_BRIDGE_INDEXER.AVAIL_MAINNET;
|
|
68
|
+
const rawResponse = await fetch(`${api}/transactions?${params.toString()}`, {
|
|
69
|
+
method: 'GET',
|
|
70
|
+
headers: {
|
|
71
|
+
'Content-Type': 'application/json',
|
|
72
|
+
'Access-Control-Allow-Origin': '*'
|
|
73
|
+
},
|
|
74
|
+
credentials: 'omit'
|
|
75
|
+
});
|
|
76
|
+
if (!rawResponse.ok) {
|
|
77
|
+
console.error('Error fetching claimable bridge transactions');
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
return await rawResponse.json();
|
|
81
|
+
} catch (e) {
|
|
82
|
+
console.error(e);
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function filterClaimableOfAddress(address, transactions) {
|
|
87
|
+
return transactions.filter(transaction => transaction.receiverAddress.toLowerCase() === address.toLowerCase());
|
|
88
|
+
}
|
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.AvailBridgeTransactionStatus = exports.AvailBridgeSourceChain = exports.AVAIL_BRIDGE_INDEXER = exports.AVAIL_BRIDGE_API = void 0;
|
|
7
6
|
exports.createClaimNotification = createClaimNotification;
|
|
8
7
|
exports.createWithdrawNotifications = createWithdrawNotifications;
|
|
9
|
-
exports.fetchAllAvailBridgeClaimable = fetchAllAvailBridgeClaimable;
|
|
10
|
-
exports.fetchAvailBridgeTransactions = fetchAvailBridgeTransactions;
|
|
11
|
-
exports.filterClaimableOfAddress = filterClaimableOfAddress;
|
|
12
|
-
exports.getAvailBridgeClaimDescription = getAvailBridgeClaimDescription;
|
|
13
8
|
exports.getClaimDescription = getClaimDescription;
|
|
14
9
|
exports.getIsTabRead = getIsTabRead;
|
|
15
10
|
exports.getReceiveDescription = getReceiveDescription;
|
|
@@ -41,9 +36,7 @@ function getSendDescription(amount, symbol) {
|
|
|
41
36
|
function getReceiveDescription(amount, symbol) {
|
|
42
37
|
return `You have just received ${amount} ${symbol}`;
|
|
43
38
|
}
|
|
44
|
-
|
|
45
|
-
return `${amount} ${symbol} ready to claim from ${symbol} cross-chain transfer. Click to claim now!`;
|
|
46
|
-
}
|
|
39
|
+
|
|
47
40
|
/* Description */
|
|
48
41
|
|
|
49
42
|
function getIsTabRead(notificationTab) {
|
|
@@ -116,82 +109,6 @@ function createClaimNotification(claimItemInfo, tokenInfo) {
|
|
|
116
109
|
}
|
|
117
110
|
};
|
|
118
111
|
}
|
|
119
|
-
|
|
120
|
-
// todo: can refactor utils and const of avail bridge to a new file. Also check in /transfer/xcm/availBridge.ts file
|
|
121
|
-
|
|
122
|
-
const AVAIL_BRIDGE_INDEXER = {
|
|
123
|
-
AVAIL_MAINNET: 'https://bridge-indexer.avail.so',
|
|
124
|
-
AVAIL_TESTNET: 'https://turing-bridge-indexer.fra.avail.so'
|
|
125
|
-
};
|
|
126
|
-
exports.AVAIL_BRIDGE_INDEXER = AVAIL_BRIDGE_INDEXER;
|
|
127
|
-
const AVAIL_BRIDGE_API = {
|
|
128
|
-
AVAIL_MAINNET: 'https://bridge-api.avail.so',
|
|
129
|
-
AVAIL_TESTNET: 'https://turing-bridge-api.fra.avail.so'
|
|
130
|
-
};
|
|
131
|
-
exports.AVAIL_BRIDGE_API = AVAIL_BRIDGE_API;
|
|
132
|
-
let AvailBridgeTransactionStatus;
|
|
133
|
-
exports.AvailBridgeTransactionStatus = AvailBridgeTransactionStatus;
|
|
134
|
-
(function (AvailBridgeTransactionStatus) {
|
|
135
|
-
AvailBridgeTransactionStatus["READY_TO_CLAIM"] = "READY_TO_CLAIM";
|
|
136
|
-
AvailBridgeTransactionStatus["CLAIMED"] = "CLAIMED";
|
|
137
|
-
AvailBridgeTransactionStatus["BRIDGED"] = "BRIDGED";
|
|
138
|
-
})(AvailBridgeTransactionStatus || (exports.AvailBridgeTransactionStatus = AvailBridgeTransactionStatus = {}));
|
|
139
|
-
let AvailBridgeSourceChain;
|
|
140
|
-
exports.AvailBridgeSourceChain = AvailBridgeSourceChain;
|
|
141
|
-
(function (AvailBridgeSourceChain) {
|
|
142
|
-
AvailBridgeSourceChain["AVAIL"] = "AVAIL";
|
|
143
|
-
AvailBridgeSourceChain["ETHEREUM"] = "ETHEREUM";
|
|
144
|
-
})(AvailBridgeSourceChain || (exports.AvailBridgeSourceChain = AvailBridgeSourceChain = {}));
|
|
145
|
-
async function fetchAllAvailBridgeClaimable(address, sourceChain, isTestnet) {
|
|
146
|
-
const transactions = [];
|
|
147
|
-
let isContinue = true;
|
|
148
|
-
let page = 0;
|
|
149
|
-
const pageSize = 100;
|
|
150
|
-
while (isContinue) {
|
|
151
|
-
const response = await fetchAvailBridgeTransactions(address, sourceChain, AvailBridgeTransactionStatus.READY_TO_CLAIM, pageSize, page, isTestnet);
|
|
152
|
-
if (!response) {
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
transactions.push(...filterClaimableOfAddress(address, response.data.result));
|
|
156
|
-
isContinue = response.data.paginationData.hasNextPage;
|
|
157
|
-
page = page + 1;
|
|
158
|
-
}
|
|
159
|
-
return transactions;
|
|
160
|
-
}
|
|
161
|
-
async function fetchAvailBridgeTransactions(userAddress, sourceChain, status) {
|
|
162
|
-
let pageSize = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100;
|
|
163
|
-
let page = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
164
|
-
let isTestnet = arguments.length > 5 ? arguments[5] : undefined;
|
|
165
|
-
const params = new URLSearchParams({
|
|
166
|
-
userAddress,
|
|
167
|
-
sourceChain,
|
|
168
|
-
status,
|
|
169
|
-
pageSize: pageSize.toString(),
|
|
170
|
-
page: page.toString()
|
|
171
|
-
});
|
|
172
|
-
try {
|
|
173
|
-
const api = isTestnet ? AVAIL_BRIDGE_INDEXER.AVAIL_TESTNET : AVAIL_BRIDGE_INDEXER.AVAIL_MAINNET;
|
|
174
|
-
const rawResponse = await fetch(`${api}/transactions?${params.toString()}`, {
|
|
175
|
-
method: 'GET',
|
|
176
|
-
headers: {
|
|
177
|
-
'Content-Type': 'application/json',
|
|
178
|
-
'Access-Control-Allow-Origin': '*'
|
|
179
|
-
},
|
|
180
|
-
credentials: 'omit'
|
|
181
|
-
});
|
|
182
|
-
if (!rawResponse.ok) {
|
|
183
|
-
console.error('Error fetching claimable bridge transactions');
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
return await rawResponse.json();
|
|
187
|
-
} catch (e) {
|
|
188
|
-
console.error(e);
|
|
189
|
-
return undefined;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function filterClaimableOfAddress(address, transactions) {
|
|
193
|
-
return transactions.filter(transaction => transaction.receiverAddress.toLowerCase() === address.toLowerCase());
|
|
194
|
-
}
|
|
195
112
|
function hrsToMillisecond(hours) {
|
|
196
113
|
return hours * 60 * 60 * 1000;
|
|
197
114
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _avail = require("./avail");
|
|
7
|
+
Object.keys(_avail).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _avail[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _avail[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _common = require("./common");
|
|
18
|
+
Object.keys(_common).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _common[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _common[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _polygon = require("./polygon");
|
|
29
|
+
Object.keys(_polygon).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _polygon[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _polygon[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.POLYGON_BRIDGE_INDEXER = void 0;
|
|
7
|
+
exports.fetchAndFilterPolygonTransactionById = fetchAndFilterPolygonTransactionById;
|
|
8
|
+
exports.fetchPolygonBridgeTransactions = fetchPolygonBridgeTransactions;
|
|
9
|
+
exports.getPolygonBridgeClaimDescription = getPolygonBridgeClaimDescription;
|
|
10
|
+
var _interfaces = require("../interfaces");
|
|
11
|
+
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
12
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
|
|
14
|
+
const POLYGON_BRIDGE_INDEXER = {
|
|
15
|
+
MAINNET: 'https://api-gateway.polygon.technology/api/v3/transactions/mainnet',
|
|
16
|
+
TESTNET: 'https://api-gateway.polygon.technology/api/v3/transactions/testnet'
|
|
17
|
+
};
|
|
18
|
+
exports.POLYGON_BRIDGE_INDEXER = POLYGON_BRIDGE_INDEXER;
|
|
19
|
+
/* Description */
|
|
20
|
+
function getPolygonBridgeClaimDescription(amount, symbol) {
|
|
21
|
+
return `${amount} ${symbol} ready to claim from ${symbol} cross-chain transfer. Click to claim now!`;
|
|
22
|
+
}
|
|
23
|
+
/* Description */
|
|
24
|
+
|
|
25
|
+
async function fetchPolygonBridgeTransactions(userAddress, isTestnet) {
|
|
26
|
+
let pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 500;
|
|
27
|
+
let page = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
28
|
+
const params = new URLSearchParams({
|
|
29
|
+
userAddress,
|
|
30
|
+
pageSize: pageSize.toString(),
|
|
31
|
+
page: page.toString()
|
|
32
|
+
});
|
|
33
|
+
const networkIds = [0, 1];
|
|
34
|
+
networkIds.forEach(networkId => {
|
|
35
|
+
params.append('destinationNetworkIds', networkId.toString());
|
|
36
|
+
params.append('sourceNetworkIds', networkId.toString());
|
|
37
|
+
params.append('status', _interfaces.BridgeTransactionStatus.READY_TO_CLAIM);
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
const domain = isTestnet ? POLYGON_BRIDGE_INDEXER.TESTNET : POLYGON_BRIDGE_INDEXER.MAINNET;
|
|
41
|
+
const rawResponse = await fetch(`${domain}?${params.toString()}`, {
|
|
42
|
+
method: 'GET',
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
'Access-Control-Allow-Origin': '*',
|
|
46
|
+
'x-api-key': 'polygonag_4RFN-g_wt2o12GmK9WWOWrGf-4Hamhtd'
|
|
47
|
+
},
|
|
48
|
+
credentials: 'omit'
|
|
49
|
+
});
|
|
50
|
+
if (!rawResponse.ok) {
|
|
51
|
+
console.error('Error fetching claimable bridge transactions');
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return await rawResponse.json();
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.error(e);
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function fetchAndFilterPolygonTransactionById(transactionId, userAddress, isTestnet) {
|
|
61
|
+
const response = await fetchPolygonBridgeTransactions(userAddress, isTestnet);
|
|
62
|
+
if (!response || !response.success) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
return response.result.find(tx => tx._id === transactionId);
|
|
66
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 _KoniTypes = require("@subwallet/extension-base/background/KoniTypes");
|
|
9
|
+
var _Base = _interopRequireDefault(require("@subwallet/extension-base/services/migration-service/Base"));
|
|
10
|
+
var _dexie = _interopRequireDefault(require("dexie"));
|
|
11
|
+
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
12
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
|
|
14
|
+
class MigrateTransactionHistoryBridge extends _Base.default {
|
|
15
|
+
async run() {
|
|
16
|
+
const state = this.state;
|
|
17
|
+
const newTransactionItems = [];
|
|
18
|
+
try {
|
|
19
|
+
const db = new _dexie.default('SubWalletDB_v2');
|
|
20
|
+
const dexieDB = await db.open();
|
|
21
|
+
const transactionTable = dexieDB.table('transactions');
|
|
22
|
+
const oldTransactionData = await transactionTable.toArray();
|
|
23
|
+
const claimAvailBridgeTransactions = oldTransactionData.filter(item => item.type === 'claim.claim_avail_bridge');
|
|
24
|
+
claimAvailBridgeTransactions.forEach(item => {
|
|
25
|
+
const newItem = {
|
|
26
|
+
...item,
|
|
27
|
+
type: _KoniTypes.ExtrinsicType.CLAIM_BRIDGE
|
|
28
|
+
};
|
|
29
|
+
newTransactionItems.push(newItem);
|
|
30
|
+
});
|
|
31
|
+
await state.dbService.upsertHistory(newTransactionItems);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
this.logger.error(e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = MigrateTransactionHistoryBridge;
|
|
@@ -31,6 +31,7 @@ var _MigrateNetworkSettings = _interopRequireDefault(require("./MigrateNetworkSe
|
|
|
31
31
|
var _MigrateSettings = _interopRequireDefault(require("./MigrateSettings"));
|
|
32
32
|
var _MigrateTokenDecimals = _interopRequireDefault(require("./MigrateTokenDecimals"));
|
|
33
33
|
var _MigrateTransactionHistory = _interopRequireDefault(require("./MigrateTransactionHistory"));
|
|
34
|
+
var _MigrateTransactionHistoryBridge = _interopRequireDefault(require("./MigrateTransactionHistoryBridge"));
|
|
34
35
|
var _MigrateTransactionHistoryBySymbol = _interopRequireDefault(require("./MigrateTransactionHistoryBySymbol"));
|
|
35
36
|
var _MigrateWalletReference = _interopRequireDefault(require("./MigrateWalletReference"));
|
|
36
37
|
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
@@ -67,7 +68,8 @@ var _default = {
|
|
|
67
68
|
'1.2.69-01': _MigrateRemoveGenesisHash.default,
|
|
68
69
|
'1.2.13-01': _ReloadMetadata.default,
|
|
69
70
|
'1.2.14-01': _ClearMetadataDatabase.default,
|
|
70
|
-
'1.2.32-01': _MigratePairData.default
|
|
71
|
+
'1.2.32-01': _MigratePairData.default,
|
|
72
|
+
'1.3.6-01': _MigrateTransactionHistoryBridge.default
|
|
71
73
|
// [`${EVERYTIME}-1.1.42-02`]: MigrateTransactionHistoryBySymbol
|
|
72
74
|
// [`${EVERYTIME}-1`]: AutoEnableChainsTokens
|
|
73
75
|
};
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _constants = require("@subwallet/extension-base/constants");
|
|
9
9
|
var _Environment = require("@subwallet/extension-base/services/environment-service/stores/Environment");
|
|
10
10
|
var _storage = require("@subwallet/extension-base/storage");
|
|
11
|
+
var _ChainlistStore = _interopRequireDefault(require("@subwallet/extension-base/stores/ChainlistStore"));
|
|
11
12
|
var _PassPhishingStore = _interopRequireDefault(require("@subwallet/extension-base/stores/PassPhishingStore"));
|
|
12
13
|
var _Settings = _interopRequireDefault(require("@subwallet/extension-base/stores/Settings"));
|
|
13
14
|
var _i18n = _interopRequireDefault(require("./i18n/i18n"));
|
|
@@ -18,6 +19,7 @@ var _constants2 = require("./constants");
|
|
|
18
19
|
class SettingService {
|
|
19
20
|
settingsStore = new _Settings.default();
|
|
20
21
|
passPhishingStore = new _PassPhishingStore.default();
|
|
22
|
+
chainlistStore = new _ChainlistStore.default();
|
|
21
23
|
environmentStore = new _Environment.EnvironmentStoreSubject();
|
|
22
24
|
constructor() {
|
|
23
25
|
this.initSetting().catch(console.error);
|
|
@@ -71,6 +73,12 @@ class SettingService {
|
|
|
71
73
|
setPassPhishing(data, callback) {
|
|
72
74
|
this.passPhishingStore.set('PassPhishing', data, callback);
|
|
73
75
|
}
|
|
76
|
+
getChainlistSetting() {
|
|
77
|
+
return this.chainlistStore.asyncGet('Chainlist');
|
|
78
|
+
}
|
|
79
|
+
setChainlist(data, callback) {
|
|
80
|
+
this.chainlistStore.set('Chainlist', data, callback);
|
|
81
|
+
}
|
|
74
82
|
getEnvironmentSetting() {
|
|
75
83
|
return this.environmentStore.subject.value;
|
|
76
84
|
}
|
|
@@ -38,7 +38,8 @@ const DEFAULT_NOTIFICATION_SETUP = {
|
|
|
38
38
|
// receive: true,
|
|
39
39
|
earningClaim: true,
|
|
40
40
|
earningWithdraw: true,
|
|
41
|
-
availBridgeClaim: true
|
|
41
|
+
availBridgeClaim: true,
|
|
42
|
+
polygonBridgeClaim: true
|
|
42
43
|
// isHideWithdraw: false, // todo: just for test, remove later
|
|
43
44
|
// isHideMarketing: false,
|
|
44
45
|
// isHideAnnouncement: false
|
|
@@ -343,6 +343,9 @@ class DatabaseService {
|
|
|
343
343
|
async updateAssetStore(item) {
|
|
344
344
|
return this.stores.asset.upsert(item);
|
|
345
345
|
}
|
|
346
|
+
async bulkUpdateAssetsStore(items) {
|
|
347
|
+
return this.stores.asset.bulkUpsert(items);
|
|
348
|
+
}
|
|
346
349
|
async getAllAssetStore() {
|
|
347
350
|
return this.stores.asset.getAll();
|
|
348
351
|
}
|
|
@@ -592,7 +592,7 @@ class TransactionService {
|
|
|
592
592
|
historyItem.additionalInfo = data;
|
|
593
593
|
break;
|
|
594
594
|
}
|
|
595
|
-
case _KoniTypes.ExtrinsicType.
|
|
595
|
+
case _KoniTypes.ExtrinsicType.CLAIM_BRIDGE:
|
|
596
596
|
{
|
|
597
597
|
const data = (0, _utils3.parseTransactionData)(transaction.data); // TODO: switch by provider
|
|
598
598
|
const metadata = data.notification.metadata;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 _SubscribableStore = _interopRequireDefault(require("@subwallet/extension-base/stores/SubscribableStore"));
|
|
10
|
+
// Copyright 2019-2022 @subwallet/extension-base
|
|
11
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
|
|
13
|
+
class ChainlistStore extends _SubscribableStore.default {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(_defaults.EXTENSION_PREFIX ? `${_defaults.EXTENSION_PREFIX}chainlist` : null);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = ChainlistStore;
|
package/cjs/types/index.js
CHANGED
|
@@ -25,6 +25,17 @@ Object.keys(_balance).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
var _bridge = require("./bridge");
|
|
29
|
+
Object.keys(_bridge).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _bridge[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _bridge[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
28
39
|
var _buy = require("./buy");
|
|
29
40
|
Object.keys(_buy).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -145,7 +145,7 @@ const EARN_QDOT_ACTIONS = [_KoniTypes.ExtrinsicType.MINT_QDOT, _KoniTypes.Extrin
|
|
|
145
145
|
const EARN_STDOT_ACTIONS = [_KoniTypes.ExtrinsicType.MINT_STDOT, _KoniTypes.ExtrinsicType.REDEEM_STDOT, _KoniTypes.ExtrinsicType.UNSTAKE_STDOT];
|
|
146
146
|
const EARN_VMANTA_ACTIONS = [_KoniTypes.ExtrinsicType.MINT_VMANTA, _KoniTypes.ExtrinsicType.REDEEM_VMANTA, _KoniTypes.ExtrinsicType.UNSTAKE_VMANTA];
|
|
147
147
|
const EVM_ACTIONS = [_KoniTypes.ExtrinsicType.TOKEN_SPENDING_APPROVAL, _KoniTypes.ExtrinsicType.EVM_EXECUTE];
|
|
148
|
-
const CLAIM_AVAIL_BRIDGE = [_KoniTypes.ExtrinsicType.
|
|
148
|
+
const CLAIM_AVAIL_BRIDGE = [_KoniTypes.ExtrinsicType.CLAIM_BRIDGE];
|
|
149
149
|
const OTHER_ACTIONS = [_KoniTypes.ExtrinsicType.TRANSFER_XCM, _KoniTypes.ExtrinsicType.SEND_NFT, _KoniTypes.ExtrinsicType.SWAP, _KoniTypes.ExtrinsicType.CROWDLOAN];
|
|
150
150
|
const getAccountTransactionActions = (signMode, networkType, type, _meta, _specialNetwork) => {
|
|
151
151
|
if ([_types2.AccountSignMode.PASSWORD, _types2.AccountSignMode.INJECTED].includes(signMode)) {
|
|
@@ -53,4 +53,5 @@ export declare function _isXcmWithinSameConsensus(originChainInfo: _ChainInfo, d
|
|
|
53
53
|
export declare function _isSnowBridgeXcm(originChainInfo: _ChainInfo, destChainInfo: _ChainInfo): boolean;
|
|
54
54
|
export declare function _isAvailBridgeXcm(originChainInfo: _ChainInfo, destChainInfo: _ChainInfo): boolean;
|
|
55
55
|
export declare function _isMythosFromHydrationToMythos(originChainInfo: _ChainInfo, destChainInfo: _ChainInfo, assetSlug: string): boolean;
|
|
56
|
+
export declare function _isPolygonBridgeXcm(originChainInfo: _ChainInfo, destChainInfo: _ChainInfo): boolean;
|
|
56
57
|
export declare function _adaptX1Interior(_assetIdentifier: Record<string, any>, version: number): Record<string, any>;
|