@subwallet/extension-base 1.1.2-1 → 1.1.3-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 +18 -0
- package/background/KoniTypes.js +2 -1
- package/cjs/background/KoniTypes.js +4 -2
- package/cjs/koni/api/dotsama/transfer.js +0 -2
- package/cjs/koni/background/handlers/Extension.js +179 -120
- package/cjs/koni/background/handlers/State.js +73 -48
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/constants.js +2 -1
- package/cjs/services/chain-service/handler/SubstrateApi.js +8 -0
- package/cjs/services/chain-service/handler/manta/MantaPrivateHandler.js +1 -1
- package/cjs/services/chain-service/handler/manta/manta-extension-sdk-empty.js +13 -0
- package/cjs/services/chain-service/index.js +11 -6
- package/cjs/services/request-service/handler/PopupHandler.js +2 -2
- package/cjs/services/request-service/helper/index.js +2 -26
- package/cjs/services/storage-service/db-stores/Metadata.js +1 -1
- package/cjs/services/wallet-connect-service/constants.js +8 -5
- package/cjs/services/wallet-connect-service/index.js +50 -36
- package/cjs/utils/environment.js +32 -2
- package/cjs/utils/index.js +21 -5
- package/cjs/utils/registry.js +25 -0
- package/koni/api/dotsama/transfer.js +0 -2
- package/koni/background/handlers/Extension.d.ts +2 -0
- package/koni/background/handlers/Extension.js +72 -15
- package/koni/background/handlers/State.d.ts +7 -2
- package/koni/background/handlers/State.js +73 -48
- package/package.json +17 -6
- package/packageInfo.js +1 -1
- package/services/chain-service/constants.d.ts +1 -0
- package/services/chain-service/constants.js +2 -1
- package/services/chain-service/handler/SubstrateApi.js +8 -0
- package/services/chain-service/handler/manta/MantaPrivateHandler.d.ts +1 -1
- package/services/chain-service/handler/manta/MantaPrivateHandler.js +1 -1
- package/services/chain-service/handler/manta/manta-extension-sdk-empty.d.ts +4 -0
- package/services/chain-service/handler/manta/manta-extension-sdk-empty.js +5 -0
- package/services/chain-service/index.d.ts +2 -1
- package/services/chain-service/index.js +11 -6
- package/services/request-service/handler/PopupHandler.js +1 -1
- package/services/request-service/helper/index.d.ts +0 -2
- package/services/request-service/helper/index.js +0 -23
- package/services/request-service/types.d.ts +0 -1
- package/services/storage-service/db-stores/Metadata.js +1 -1
- package/services/wallet-connect-service/constants.d.ts +2 -1
- package/services/wallet-connect-service/constants.js +5 -3
- package/services/wallet-connect-service/index.d.ts +0 -1
- package/services/wallet-connect-service/index.js +50 -36
- package/utils/environment.d.ts +4 -1
- package/utils/environment.js +28 -1
- package/utils/index.d.ts +2 -0
- package/utils/index.js +4 -1
- package/utils/registry.d.ts +4 -0
- package/utils/registry.js +18 -0
|
@@ -213,7 +213,8 @@ export default class KoniState {
|
|
|
213
213
|
await this.startSubscription();
|
|
214
214
|
}
|
|
215
215
|
async initMantaPay(password) {
|
|
216
|
-
|
|
216
|
+
var _this$chainService, _this$chainService$ma;
|
|
217
|
+
const mantaPayConfig = await ((_this$chainService = this.chainService) === null || _this$chainService === void 0 ? void 0 : (_this$chainService$ma = _this$chainService.mantaPay) === null || _this$chainService$ma === void 0 ? void 0 : _this$chainService$ma.getMantaPayFirstConfig(_DEFAULT_MANTA_ZK_CHAIN));
|
|
217
218
|
if (mantaPayConfig && mantaPayConfig.enabled && !this.isMantaPayEnabled) {
|
|
218
219
|
// only init the first login
|
|
219
220
|
console.debug('Initiating MantaPay for', mantaPayConfig.address);
|
|
@@ -614,6 +615,15 @@ export default class KoniState {
|
|
|
614
615
|
this.settingService.setSettings(newSettings);
|
|
615
616
|
});
|
|
616
617
|
}
|
|
618
|
+
setShowBalance(value) {
|
|
619
|
+
this.settingService.getSettings(settings => {
|
|
620
|
+
const newSettings = {
|
|
621
|
+
...settings,
|
|
622
|
+
isShowBalance: value
|
|
623
|
+
};
|
|
624
|
+
this.settingService.setSettings(newSettings);
|
|
625
|
+
});
|
|
626
|
+
}
|
|
617
627
|
subscribeSettingsSubject() {
|
|
618
628
|
return this.settingService.getSubject();
|
|
619
629
|
}
|
|
@@ -862,7 +872,8 @@ export default class KoniState {
|
|
|
862
872
|
async disableChain(chainSlug) {
|
|
863
873
|
await this.chainService.updateAssetSettingByChain(chainSlug, false);
|
|
864
874
|
if (_MANTA_ZK_CHAIN_GROUP.includes(chainSlug)) {
|
|
865
|
-
|
|
875
|
+
var _this$chainService2, _this$chainService2$m;
|
|
876
|
+
const mantaPayConfig = await ((_this$chainService2 = this.chainService) === null || _this$chainService2 === void 0 ? void 0 : (_this$chainService2$m = _this$chainService2.mantaPay) === null || _this$chainService2$m === void 0 ? void 0 : _this$chainService2$m.getMantaPayFirstConfig(_DEFAULT_MANTA_ZK_CHAIN));
|
|
866
877
|
if (mantaPayConfig && mantaPayConfig.enabled && this.isMantaPayEnabled) {
|
|
867
878
|
await this.disableMantaPay(mantaPayConfig.address);
|
|
868
879
|
}
|
|
@@ -1533,95 +1544,95 @@ export default class KoniState {
|
|
|
1533
1544
|
await this.chainService.init();
|
|
1534
1545
|
}
|
|
1535
1546
|
async enableMantaPay(updateStore, address, password, seedPhrase) {
|
|
1536
|
-
var _this$
|
|
1547
|
+
var _this$chainService3, _this$chainService3$m, _this$chainService4, _this$chainService4$m, _this$chainService4$m2, _this$chainService11, _this$chainService11$, _this$chainService11$2;
|
|
1537
1548
|
if (!address || isEthereumAddress(address)) {
|
|
1538
1549
|
return;
|
|
1539
1550
|
}
|
|
1540
|
-
this.chainService.mantaPay.setCurrentAddress(address);
|
|
1541
|
-
await ((_this$
|
|
1551
|
+
(_this$chainService3 = this.chainService) === null || _this$chainService3 === void 0 ? void 0 : (_this$chainService3$m = _this$chainService3.mantaPay) === null || _this$chainService3$m === void 0 ? void 0 : _this$chainService3$m.setCurrentAddress(address);
|
|
1552
|
+
await ((_this$chainService4 = this.chainService) === null || _this$chainService4 === void 0 ? void 0 : (_this$chainService4$m = _this$chainService4.mantaPay) === null || _this$chainService4$m === void 0 ? void 0 : (_this$chainService4$m2 = _this$chainService4$m.privateWallet) === null || _this$chainService4$m2 === void 0 ? void 0 : _this$chainService4$m2.initialSigner());
|
|
1542
1553
|
if (updateStore && seedPhrase) {
|
|
1543
|
-
var _this$
|
|
1554
|
+
var _this$chainService5, _this$chainService5$m, _this$chainService5$m2, _this$chainService6, _this$chainService6$m, _this$chainService6$m2, _this$chainService7, _this$chainService7$m, _this$chainService7$m2, _this$chainService8, _this$chainService8$m;
|
|
1544
1555
|
// first time initiation
|
|
1545
|
-
await ((_this$
|
|
1546
|
-
const authContext = await ((_this$
|
|
1547
|
-
await ((_this$
|
|
1556
|
+
await ((_this$chainService5 = this.chainService) === null || _this$chainService5 === void 0 ? void 0 : (_this$chainService5$m = _this$chainService5.mantaPay) === null || _this$chainService5$m === void 0 ? void 0 : (_this$chainService5$m2 = _this$chainService5$m.privateWallet) === null || _this$chainService5$m2 === void 0 ? void 0 : _this$chainService5$m2.loadUserSeedPhrase(seedPhrase));
|
|
1557
|
+
const authContext = await ((_this$chainService6 = this.chainService) === null || _this$chainService6 === void 0 ? void 0 : (_this$chainService6$m = _this$chainService6.mantaPay) === null || _this$chainService6$m === void 0 ? void 0 : (_this$chainService6$m2 = _this$chainService6$m.privateWallet) === null || _this$chainService6$m2 === void 0 ? void 0 : _this$chainService6$m2.getAuthorizationContext());
|
|
1558
|
+
await ((_this$chainService7 = this.chainService) === null || _this$chainService7 === void 0 ? void 0 : (_this$chainService7$m = _this$chainService7.mantaPay) === null || _this$chainService7$m === void 0 ? void 0 : (_this$chainService7$m2 = _this$chainService7$m.privateWallet) === null || _this$chainService7$m2 === void 0 ? void 0 : _this$chainService7$m2.loadAuthorizationContext(authContext));
|
|
1548
1559
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
|
|
1549
1560
|
const encryptedData = await passworder.encrypt(password, authContext);
|
|
1550
|
-
await this.chainService.mantaPay.saveMantaAuthContext({
|
|
1561
|
+
await ((_this$chainService8 = this.chainService) === null || _this$chainService8 === void 0 ? void 0 : (_this$chainService8$m = _this$chainService8.mantaPay) === null || _this$chainService8$m === void 0 ? void 0 : _this$chainService8$m.saveMantaAuthContext({
|
|
1551
1562
|
chain: _DEFAULT_MANTA_ZK_CHAIN,
|
|
1552
1563
|
address,
|
|
1553
1564
|
data: encryptedData
|
|
1554
|
-
});
|
|
1565
|
+
}));
|
|
1555
1566
|
} else {
|
|
1556
|
-
var _this$
|
|
1557
|
-
const authContext = await this.chainService.mantaPay.getMantaAuthContext(address, _DEFAULT_MANTA_ZK_CHAIN);
|
|
1567
|
+
var _this$chainService9, _this$chainService9$m, _this$chainService10, _this$chainService10$, _this$chainService10$2;
|
|
1568
|
+
const authContext = await ((_this$chainService9 = this.chainService) === null || _this$chainService9 === void 0 ? void 0 : (_this$chainService9$m = _this$chainService9.mantaPay) === null || _this$chainService9$m === void 0 ? void 0 : _this$chainService9$m.getMantaAuthContext(address, _DEFAULT_MANTA_ZK_CHAIN));
|
|
1558
1569
|
|
|
1559
1570
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
|
|
1560
1571
|
const decryptedData = await passworder.decrypt(password, authContext.data);
|
|
1561
1572
|
|
|
1562
1573
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access
|
|
1563
1574
|
const proofAuthKey = new Uint8Array(Object.values(decryptedData.proof_authorization_key));
|
|
1564
|
-
await ((_this$
|
|
1575
|
+
await ((_this$chainService10 = this.chainService) === null || _this$chainService10 === void 0 ? void 0 : (_this$chainService10$ = _this$chainService10.mantaPay) === null || _this$chainService10$ === void 0 ? void 0 : (_this$chainService10$2 = _this$chainService10$.privateWallet) === null || _this$chainService10$2 === void 0 ? void 0 : _this$chainService10$2.loadAuthorizationContext({
|
|
1565
1576
|
proof_authorization_key: proofAuthKey
|
|
1566
1577
|
}));
|
|
1567
1578
|
}
|
|
1568
|
-
const zkAddress = await ((_this$
|
|
1579
|
+
const zkAddress = await ((_this$chainService11 = this.chainService) === null || _this$chainService11 === void 0 ? void 0 : (_this$chainService11$ = _this$chainService11.mantaPay) === null || _this$chainService11$ === void 0 ? void 0 : (_this$chainService11$2 = _this$chainService11$.privateWallet) === null || _this$chainService11$2 === void 0 ? void 0 : _this$chainService11$2.getZkAddress());
|
|
1569
1580
|
if (updateStore) {
|
|
1570
|
-
var _this$
|
|
1571
|
-
await this.chainService.mantaPay
|
|
1581
|
+
var _this$chainService12, _this$chainService12$, _this$chainService13, _this$chainService13$, _this$chainService13$2, _this$chainService13$3;
|
|
1582
|
+
await ((_this$chainService12 = this.chainService) === null || _this$chainService12 === void 0 ? void 0 : (_this$chainService12$ = _this$chainService12.mantaPay) === null || _this$chainService12$ === void 0 ? void 0 : _this$chainService12$.saveMantaPayConfig({
|
|
1572
1583
|
address,
|
|
1573
1584
|
zkAddress: zkAddress,
|
|
1574
1585
|
enabled: true,
|
|
1575
|
-
chain: (_this$
|
|
1586
|
+
chain: (_this$chainService13 = this.chainService) === null || _this$chainService13 === void 0 ? void 0 : (_this$chainService13$ = _this$chainService13.mantaPay) === null || _this$chainService13$ === void 0 ? void 0 : (_this$chainService13$2 = _this$chainService13$.privateWallet) === null || _this$chainService13$2 === void 0 ? void 0 : (_this$chainService13$3 = _this$chainService13$2.network) === null || _this$chainService13$3 === void 0 ? void 0 : _this$chainService13$3.toLowerCase(),
|
|
1576
1587
|
isInitialSync: false
|
|
1577
|
-
});
|
|
1588
|
+
}));
|
|
1578
1589
|
}
|
|
1579
1590
|
this.isMantaPayEnabled = true;
|
|
1580
1591
|
return zkAddress;
|
|
1581
1592
|
}
|
|
1582
1593
|
async disableMantaPay(address) {
|
|
1583
|
-
var _this$
|
|
1584
|
-
const config = await this.chainService.mantaPay
|
|
1594
|
+
var _this$chainService14, _this$chainService14$, _this$chainService15, _this$chainService15$, _this$chainService15$2, _this$chainService16, _this$chainService16$, _this$chainService16$2, _this$chainService17, _this$chainService17$, _this$chainService18, _this$chainService18$;
|
|
1595
|
+
const config = await ((_this$chainService14 = this.chainService) === null || _this$chainService14 === void 0 ? void 0 : (_this$chainService14$ = _this$chainService14.mantaPay) === null || _this$chainService14$ === void 0 ? void 0 : _this$chainService14$.getMantaPayConfig(address, _DEFAULT_MANTA_ZK_CHAIN));
|
|
1585
1596
|
if (!config) {
|
|
1586
1597
|
return false;
|
|
1587
1598
|
}
|
|
1588
|
-
await ((_this$
|
|
1589
|
-
await ((_this$
|
|
1590
|
-
// await this.chainService
|
|
1591
|
-
await this.chainService.mantaPay
|
|
1592
|
-
await this.chainService.mantaPay
|
|
1599
|
+
await ((_this$chainService15 = this.chainService) === null || _this$chainService15 === void 0 ? void 0 : (_this$chainService15$ = _this$chainService15.mantaPay) === null || _this$chainService15$ === void 0 ? void 0 : (_this$chainService15$2 = _this$chainService15$.privateWallet) === null || _this$chainService15$2 === void 0 ? void 0 : _this$chainService15$2.dropAuthorizationContext());
|
|
1600
|
+
await ((_this$chainService16 = this.chainService) === null || _this$chainService16 === void 0 ? void 0 : (_this$chainService16$ = _this$chainService16.mantaPay) === null || _this$chainService16$ === void 0 ? void 0 : (_this$chainService16$2 = _this$chainService16$.privateWallet) === null || _this$chainService16$2 === void 0 ? void 0 : _this$chainService16$2.dropUserSeedPhrase());
|
|
1601
|
+
// await this.chainService?.mantaPay?.privateWallet?.resetState();
|
|
1602
|
+
await ((_this$chainService17 = this.chainService) === null || _this$chainService17 === void 0 ? void 0 : (_this$chainService17$ = _this$chainService17.mantaPay) === null || _this$chainService17$ === void 0 ? void 0 : _this$chainService17$.deleteMantaPayConfig(address, _DEFAULT_MANTA_ZK_CHAIN));
|
|
1603
|
+
await ((_this$chainService18 = this.chainService) === null || _this$chainService18 === void 0 ? void 0 : (_this$chainService18$ = _this$chainService18.mantaPay) === null || _this$chainService18$ === void 0 ? void 0 : _this$chainService18$.deleteMantaAuthContext(address, _DEFAULT_MANTA_ZK_CHAIN));
|
|
1593
1604
|
this.chainService.setMantaZkAssetSettings(false);
|
|
1594
1605
|
this.isMantaPayEnabled = false;
|
|
1595
1606
|
return true;
|
|
1596
1607
|
}
|
|
1597
1608
|
async initialSyncMantaPay(address) {
|
|
1598
|
-
var _this$
|
|
1609
|
+
var _this$chainService19, _this$chainService19$, _this$chainService20, _this$chainService20$, _this$chainService20$2, _this$chainService20$3, _this$chainService21, _this$chainService21$, _this$chainService21$2, _this$chainService22, _this$chainService22$;
|
|
1599
1610
|
if (!address || isEthereumAddress(address)) {
|
|
1600
1611
|
return;
|
|
1601
1612
|
}
|
|
1602
|
-
this.chainService.mantaPay
|
|
1603
|
-
await ((_this$
|
|
1604
|
-
const syncResult = await ((_this$
|
|
1605
|
-
await this.chainService.mantaPay
|
|
1613
|
+
(_this$chainService19 = this.chainService) === null || _this$chainService19 === void 0 ? void 0 : (_this$chainService19$ = _this$chainService19.mantaPay) === null || _this$chainService19$ === void 0 ? void 0 : _this$chainService19$.setCurrentAddress(address);
|
|
1614
|
+
await ((_this$chainService20 = this.chainService) === null || _this$chainService20 === void 0 ? void 0 : (_this$chainService20$ = _this$chainService20.mantaPay) === null || _this$chainService20$ === void 0 ? void 0 : (_this$chainService20$2 = _this$chainService20$.privateWallet) === null || _this$chainService20$2 === void 0 ? void 0 : (_this$chainService20$3 = _this$chainService20$2.baseWallet) === null || _this$chainService20$3 === void 0 ? void 0 : _this$chainService20$3.isApiReady());
|
|
1615
|
+
const syncResult = await ((_this$chainService21 = this.chainService) === null || _this$chainService21 === void 0 ? void 0 : (_this$chainService21$ = _this$chainService21.mantaPay) === null || _this$chainService21$ === void 0 ? void 0 : (_this$chainService21$2 = _this$chainService21$.privateWallet) === null || _this$chainService21$2 === void 0 ? void 0 : _this$chainService21$2.initialWalletSync());
|
|
1616
|
+
await ((_this$chainService22 = this.chainService) === null || _this$chainService22 === void 0 ? void 0 : (_this$chainService22$ = _this$chainService22.mantaPay) === null || _this$chainService22$ === void 0 ? void 0 : _this$chainService22$.updateMantaPayConfig(address, _DEFAULT_MANTA_ZK_CHAIN, {
|
|
1606
1617
|
isInitialSync: true
|
|
1607
|
-
});
|
|
1618
|
+
}));
|
|
1608
1619
|
this.eventService.emit('mantaPay.initSync', undefined);
|
|
1609
1620
|
return syncResult;
|
|
1610
1621
|
}
|
|
1611
1622
|
getMantaZkBalance() {
|
|
1612
|
-
var _this$
|
|
1613
|
-
if (!this.chainService || !this.chainService.mantaPay) {
|
|
1623
|
+
var _this$chainService23, _this$chainService24, _this$chainService24$, _this$chainService24$2, _this$chainService25, _this$chainService25$, _this$chainService26, _this$chainService26$, _this$chainService26$2;
|
|
1624
|
+
if (!this.chainService || !((_this$chainService23 = this.chainService) !== null && _this$chainService23 !== void 0 && _this$chainService23.mantaPay)) {
|
|
1614
1625
|
return;
|
|
1615
1626
|
}
|
|
1616
|
-
if (!((_this$
|
|
1627
|
+
if (!((_this$chainService24 = this.chainService) !== null && _this$chainService24 !== void 0 && (_this$chainService24$ = _this$chainService24.mantaPay) !== null && _this$chainService24$ !== void 0 && (_this$chainService24$2 = _this$chainService24$.privateWallet) !== null && _this$chainService24$2 !== void 0 && _this$chainService24$2.initialSyncIsFinished)) {
|
|
1617
1628
|
return;
|
|
1618
1629
|
}
|
|
1619
|
-
const chain = (_this$
|
|
1630
|
+
const chain = (_this$chainService25 = this.chainService) === null || _this$chainService25 === void 0 ? void 0 : (_this$chainService25$ = _this$chainService25.mantaPay.privateWallet) === null || _this$chainService25$ === void 0 ? void 0 : _this$chainService25$.network;
|
|
1620
1631
|
if (!chain) {
|
|
1621
1632
|
return;
|
|
1622
1633
|
}
|
|
1623
1634
|
const assetMap = this.chainService.getMantaZkAssets(chain === null || chain === void 0 ? void 0 : chain.toLowerCase());
|
|
1624
|
-
(_this$
|
|
1635
|
+
(_this$chainService26 = this.chainService) === null || _this$chainService26 === void 0 ? void 0 : (_this$chainService26$ = _this$chainService26.mantaPay) === null || _this$chainService26$ === void 0 ? void 0 : (_this$chainService26$2 = _this$chainService26$.privateWallet) === null || _this$chainService26$2 === void 0 ? void 0 : _this$chainService26$2.getMultiZkBalance(Object.values(assetMap).map(tokenInfo => new BN(_getTokenOnChainAssetId(tokenInfo)))).then(zkBalances => {
|
|
1625
1636
|
const assetList = Object.values(assetMap);
|
|
1626
1637
|
for (let i = 0; i < assetList.length; i++) {
|
|
1627
1638
|
var _zkBalances$i;
|
|
@@ -1638,8 +1649,9 @@ export default class KoniState {
|
|
|
1638
1649
|
}).catch(console.warn);
|
|
1639
1650
|
}
|
|
1640
1651
|
subscribeMantaPayBalance() {
|
|
1652
|
+
var _this$chainService27, _this$chainService27$;
|
|
1641
1653
|
let interval;
|
|
1642
|
-
this.chainService.mantaPay
|
|
1654
|
+
(_this$chainService27 = this.chainService) === null || _this$chainService27 === void 0 ? void 0 : (_this$chainService27$ = _this$chainService27.mantaPay) === null || _this$chainService27$ === void 0 ? void 0 : _this$chainService27$.getMantaPayConfig(this.keyringService.currentAccount.address, _DEFAULT_MANTA_ZK_CHAIN).then(config => {
|
|
1643
1655
|
if (config && config.enabled && config.isInitialSync) {
|
|
1644
1656
|
this.getMantaZkBalance();
|
|
1645
1657
|
interval = setInterval(this.getMantaZkBalance, MANTA_PAY_BALANCE_INTERVAL);
|
|
@@ -1650,23 +1662,23 @@ export default class KoniState {
|
|
|
1650
1662
|
};
|
|
1651
1663
|
}
|
|
1652
1664
|
async syncMantaPay() {
|
|
1653
|
-
var _this$
|
|
1654
|
-
const config = await this.chainService.mantaPay
|
|
1665
|
+
var _this$chainService28, _this$chainService28$, _this$chainService29, _this$chainService29$, _this$chainService29$2;
|
|
1666
|
+
const config = await ((_this$chainService28 = this.chainService) === null || _this$chainService28 === void 0 ? void 0 : (_this$chainService28$ = _this$chainService28.mantaPay) === null || _this$chainService28$ === void 0 ? void 0 : _this$chainService28$.getMantaPayFirstConfig(_DEFAULT_MANTA_ZK_CHAIN));
|
|
1655
1667
|
if (!config.isInitialSync) {
|
|
1656
1668
|
return;
|
|
1657
1669
|
}
|
|
1658
|
-
if ((_this$
|
|
1659
|
-
var _this$
|
|
1660
|
-
await ((_this$
|
|
1670
|
+
if ((_this$chainService29 = this.chainService) !== null && _this$chainService29 !== void 0 && (_this$chainService29$ = _this$chainService29.mantaPay) !== null && _this$chainService29$ !== void 0 && (_this$chainService29$2 = _this$chainService29$.privateWallet) !== null && _this$chainService29$2 !== void 0 && _this$chainService29$2.initialSyncIsFinished) {
|
|
1671
|
+
var _this$chainService30, _this$chainService30$, _this$chainService30$2;
|
|
1672
|
+
await ((_this$chainService30 = this.chainService) === null || _this$chainService30 === void 0 ? void 0 : (_this$chainService30$ = _this$chainService30.mantaPay) === null || _this$chainService30$ === void 0 ? void 0 : (_this$chainService30$2 = _this$chainService30$.privateWallet) === null || _this$chainService30$2 === void 0 ? void 0 : _this$chainService30$2.walletSync());
|
|
1661
1673
|
} else {
|
|
1662
|
-
var _this$
|
|
1663
|
-
await ((_this$
|
|
1674
|
+
var _this$chainService31, _this$chainService31$, _this$chainService31$2;
|
|
1675
|
+
await ((_this$chainService31 = this.chainService) === null || _this$chainService31 === void 0 ? void 0 : (_this$chainService31$ = _this$chainService31.mantaPay) === null || _this$chainService31$ === void 0 ? void 0 : (_this$chainService31$2 = _this$chainService31$.privateWallet) === null || _this$chainService31$2 === void 0 ? void 0 : _this$chainService31$2.initialWalletSync());
|
|
1664
1676
|
}
|
|
1665
1677
|
}
|
|
1666
1678
|
async getMantaPayZkBalance(address, tokenInfo) {
|
|
1667
|
-
var _this$
|
|
1679
|
+
var _this$chainService32, _this$chainService32$, _this$chainService32$2;
|
|
1668
1680
|
const bnAssetId = new BN(_getTokenOnChainAssetId(tokenInfo));
|
|
1669
|
-
const balance = await ((_this$
|
|
1681
|
+
const balance = await ((_this$chainService32 = this.chainService) === null || _this$chainService32 === void 0 ? void 0 : (_this$chainService32$ = _this$chainService32.mantaPay) === null || _this$chainService32$ === void 0 ? void 0 : (_this$chainService32$2 = _this$chainService32$.privateWallet) === null || _this$chainService32$2 === void 0 ? void 0 : _this$chainService32$2.getZkBalance(bnAssetId));
|
|
1670
1682
|
return {
|
|
1671
1683
|
decimals: tokenInfo.decimals || 0,
|
|
1672
1684
|
symbol: tokenInfo.symbol,
|
|
@@ -1674,6 +1686,19 @@ export default class KoniState {
|
|
|
1674
1686
|
};
|
|
1675
1687
|
}
|
|
1676
1688
|
subscribeMantaPaySyncState() {
|
|
1677
|
-
|
|
1689
|
+
var _this$chainService33, _this$chainService34, _this$chainService34$;
|
|
1690
|
+
if (!((_this$chainService33 = this.chainService) !== null && _this$chainService33 !== void 0 && _this$chainService33.mantaPay)) {
|
|
1691
|
+
return new Subject();
|
|
1692
|
+
}
|
|
1693
|
+
return (_this$chainService34 = this.chainService) === null || _this$chainService34 === void 0 ? void 0 : (_this$chainService34$ = _this$chainService34.mantaPay) === null || _this$chainService34$ === void 0 ? void 0 : _this$chainService34$.subscribeSyncState();
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
// Metadata
|
|
1697
|
+
async findMetadata(hash) {
|
|
1698
|
+
const metadata = await this.chainService.getMetadataByHash(hash);
|
|
1699
|
+
return {
|
|
1700
|
+
metadata: (metadata === null || metadata === void 0 ? void 0 : metadata.hexValue) || '',
|
|
1701
|
+
specVersion: parseInt((metadata === null || metadata === void 0 ? void 0 : metadata.specVersion) || '0')
|
|
1702
|
+
};
|
|
1678
1703
|
}
|
|
1679
1704
|
}
|
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.3-0",
|
|
21
21
|
"main": "./cjs/index.js",
|
|
22
22
|
"module": "./index.js",
|
|
23
23
|
"types": "./index.d.ts",
|
|
@@ -530,6 +530,11 @@
|
|
|
530
530
|
"require": "./cjs/services/chain-service/handler/light-client/index.js",
|
|
531
531
|
"default": "./services/chain-service/handler/light-client/index.js"
|
|
532
532
|
},
|
|
533
|
+
"./services/chain-service/handler/manta/manta-extension-sdk-empty": {
|
|
534
|
+
"types": "./services/chain-service/handler/manta/manta-extension-sdk-empty.d.ts",
|
|
535
|
+
"require": "./cjs/services/chain-service/handler/manta/manta-extension-sdk-empty.js",
|
|
536
|
+
"default": "./services/chain-service/handler/manta/manta-extension-sdk-empty.js"
|
|
537
|
+
},
|
|
533
538
|
"./services/chain-service/handler/manta/MantaPrivateHandler": {
|
|
534
539
|
"types": "./services/chain-service/handler/manta/MantaPrivateHandler.d.ts",
|
|
535
540
|
"require": "./cjs/services/chain-service/handler/manta/MantaPrivateHandler.js",
|
|
@@ -1125,6 +1130,11 @@
|
|
|
1125
1130
|
"require": "./cjs/utils/promise.js",
|
|
1126
1131
|
"default": "./utils/promise.js"
|
|
1127
1132
|
},
|
|
1133
|
+
"./utils/registry": {
|
|
1134
|
+
"types": "./utils/registry.d.ts",
|
|
1135
|
+
"require": "./cjs/utils/registry.js",
|
|
1136
|
+
"default": "./utils/registry.js"
|
|
1137
|
+
},
|
|
1128
1138
|
"./utils/request": {
|
|
1129
1139
|
"types": "./utils/request.d.ts",
|
|
1130
1140
|
"require": "./cjs/utils/request.js",
|
|
@@ -1163,16 +1173,17 @@
|
|
|
1163
1173
|
"@reduxjs/toolkit": "^1.9.1",
|
|
1164
1174
|
"@sora-substrate/type-definitions": "^1.17.7",
|
|
1165
1175
|
"@substrate/connect": "^0.7.26",
|
|
1166
|
-
"@subwallet/chain-list": "^0.2.
|
|
1167
|
-
"@subwallet/extension-base": "^1.1.
|
|
1168
|
-
"@subwallet/extension-chains": "^1.1.
|
|
1169
|
-
"@subwallet/extension-dapp": "^1.1.
|
|
1170
|
-
"@subwallet/extension-inject": "^1.1.
|
|
1176
|
+
"@subwallet/chain-list": "^0.2.7",
|
|
1177
|
+
"@subwallet/extension-base": "^1.1.3-0",
|
|
1178
|
+
"@subwallet/extension-chains": "^1.1.3-0",
|
|
1179
|
+
"@subwallet/extension-dapp": "^1.1.3-0",
|
|
1180
|
+
"@subwallet/extension-inject": "^1.1.3-0",
|
|
1171
1181
|
"@subwallet/keyring": "^0.0.10",
|
|
1172
1182
|
"@subwallet/ui-keyring": "^0.0.10",
|
|
1173
1183
|
"@walletconnect/sign-client": "^2.8.4",
|
|
1174
1184
|
"@walletconnect/types": "^2.8.4",
|
|
1175
1185
|
"@walletconnect/utils": "^2.8.4",
|
|
1186
|
+
"avail-js-sdk": "^0.0.10",
|
|
1176
1187
|
"axios": "^1.2.1",
|
|
1177
1188
|
"bignumber.js": "^9.1.1",
|
|
1178
1189
|
"bn.js": "^5.2.1",
|
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.3-0'
|
|
11
11
|
};
|
|
@@ -5,6 +5,7 @@ export declare const API_MAX_RETRY = 2;
|
|
|
5
5
|
export declare const _API_OPTIONS_CHAIN_GROUP: {
|
|
6
6
|
acala: string[];
|
|
7
7
|
turing: string[];
|
|
8
|
+
avail: string[];
|
|
8
9
|
};
|
|
9
10
|
export declare const _PREDEFINED_SINGLE_MODES: Record<string, SingleModeJson>;
|
|
10
11
|
export declare const _PURE_EVM_CHAINS: string[];
|
|
@@ -9,7 +9,8 @@ export const API_CONNECT_TIMEOUT = 30000;
|
|
|
9
9
|
export const API_MAX_RETRY = 2;
|
|
10
10
|
export const _API_OPTIONS_CHAIN_GROUP = {
|
|
11
11
|
acala: ['acala', 'karura', 'origintrail', 'kintsugi'],
|
|
12
|
-
turing: ['turingStaging', 'turing']
|
|
12
|
+
turing: ['turingStaging', 'turing'],
|
|
13
|
+
avail: ['kate']
|
|
13
14
|
};
|
|
14
15
|
export const _PREDEFINED_SINGLE_MODES = {
|
|
15
16
|
subspace: {
|
|
@@ -8,6 +8,7 @@ import { _API_OPTIONS_CHAIN_GROUP, API_AUTO_CONNECT_MS, API_CONNECT_TIMEOUT } fr
|
|
|
8
8
|
import { getSubstrateConnectProvider } from '@subwallet/extension-base/services/chain-service/handler/light-client';
|
|
9
9
|
import { DEFAULT_AUX } from '@subwallet/extension-base/services/chain-service/handler/SubstrateChainHandler';
|
|
10
10
|
import { createPromiseHandler } from '@subwallet/extension-base/utils/promise';
|
|
11
|
+
import { spec as availSpec } from 'avail-js-sdk';
|
|
11
12
|
import { BehaviorSubject } from 'rxjs';
|
|
12
13
|
import { ApiPromise, WsProvider } from '@polkadot/api';
|
|
13
14
|
import { typesBundle } from '@polkadot/apps-config/api';
|
|
@@ -63,6 +64,13 @@ export class SubstrateApi {
|
|
|
63
64
|
rpc: oakRpc,
|
|
64
65
|
types: oakTypes
|
|
65
66
|
});
|
|
67
|
+
} else if (_API_OPTIONS_CHAIN_GROUP.avail.includes(this.chainSlug)) {
|
|
68
|
+
return new ApiPromise({
|
|
69
|
+
provider,
|
|
70
|
+
rpc: availSpec.rpc,
|
|
71
|
+
types: availSpec.types,
|
|
72
|
+
signedExtensions: availSpec.signedExtensions
|
|
73
|
+
});
|
|
66
74
|
} else {
|
|
67
75
|
return new ApiPromise(apiOption);
|
|
68
76
|
}
|
|
@@ -23,7 +23,7 @@ export declare class MantaPrivateHandler {
|
|
|
23
23
|
deleteMantaAuthContext(address: string, chain: string): Promise<number>;
|
|
24
24
|
private saveLedgerState;
|
|
25
25
|
private getLedgerState;
|
|
26
|
-
initMantaPay(providerUrl: string, network: string): Promise<import("
|
|
26
|
+
initMantaPay(providerUrl: string, network: string): Promise<import("avail-js-sdk").ApiPromise>;
|
|
27
27
|
getCurrentLedgerState(): Promise<number>;
|
|
28
28
|
setSyncState(data: MantaPaySyncState): void;
|
|
29
29
|
subscribeSyncProgress(): Promise<() => void>;
|
|
@@ -88,7 +88,7 @@ export class MantaPrivateHandler {
|
|
|
88
88
|
|
|
89
89
|
const baseWallet = await BaseWallet.init({
|
|
90
90
|
apiEndpoint: providerUrl,
|
|
91
|
-
loggingEnabled:
|
|
91
|
+
loggingEnabled: true,
|
|
92
92
|
provingFilePath: './manta-pay/proving',
|
|
93
93
|
parametersFilePath: './manta-pay/parameters',
|
|
94
94
|
saveStorageStateToLocal: this.saveLedgerState.bind(this),
|
|
@@ -14,7 +14,7 @@ export declare class ChainService {
|
|
|
14
14
|
private substrateChainHandler;
|
|
15
15
|
private evmChainHandler;
|
|
16
16
|
private mantaChainHandler;
|
|
17
|
-
get mantaPay(): MantaPrivateHandler;
|
|
17
|
+
get mantaPay(): MantaPrivateHandler | undefined;
|
|
18
18
|
private chainInfoMapSubject;
|
|
19
19
|
private chainStateMapSubject;
|
|
20
20
|
private assetRegistrySubject;
|
|
@@ -110,4 +110,5 @@ export declare class ChainService {
|
|
|
110
110
|
resetWallet(resetAll: boolean): void;
|
|
111
111
|
getMetadata(chain: string): import("dexie").PromiseExtended<IMetadataItem | undefined>;
|
|
112
112
|
upsertMetadata(chain: string, metadata: IMetadataItem): import("dexie").PromiseExtended<unknown>;
|
|
113
|
+
getMetadataByHash(hash: string): import("dexie").PromiseExtended<IMetadataItem | undefined>;
|
|
113
114
|
}
|
|
@@ -11,6 +11,7 @@ import { _CHAIN_VALIDATION_ERROR } from '@subwallet/extension-base/services/chai
|
|
|
11
11
|
import { _ChainConnectionStatus, _CUSTOM_PREFIX, _NFT_CONTRACT_STANDARDS, _SMART_CONTRACT_STANDARDS } from '@subwallet/extension-base/services/chain-service/types';
|
|
12
12
|
import { _isAssetFungibleToken, _isChainEnabled, _isCustomAsset, _isCustomChain, _isEqualContractAddress, _isEqualSmartContractAsset, _isMantaZkAsset, _isPureEvmChain, _isPureSubstrateChain, _parseAssetRefKey } from '@subwallet/extension-base/services/chain-service/utils';
|
|
13
13
|
import AssetSettingStore from '@subwallet/extension-base/stores/AssetSetting';
|
|
14
|
+
import { MODULE_SUPPORT } from '@subwallet/extension-base/utils';
|
|
14
15
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
15
16
|
import Web3 from 'web3';
|
|
16
17
|
import { logger as createLogger } from '@polkadot/util/logger';
|
|
@@ -40,14 +41,14 @@ export class ChainService {
|
|
|
40
41
|
constructor(dbService, eventService) {
|
|
41
42
|
this.dbService = dbService;
|
|
42
43
|
this.eventService = eventService;
|
|
43
|
-
this.substrateChainHandler = new SubstrateChainHandler();
|
|
44
|
-
this.evmChainHandler = new EvmChainHandler();
|
|
45
|
-
this.mantaChainHandler = new MantaPrivateHandler(dbService);
|
|
46
44
|
this.chainInfoMapSubject.next(this.dataMap.chainInfoMap);
|
|
47
45
|
this.chainStateMapSubject.next(this.dataMap.chainStateMap);
|
|
48
|
-
this.chainInfoMapSubject.next(this.dataMap.chainInfoMap);
|
|
49
46
|
this.assetRegistrySubject.next(this.dataMap.assetRegistry);
|
|
50
47
|
this.xcmRefMapSubject.next(this.dataMap.assetRefMap);
|
|
48
|
+
if (MODULE_SUPPORT.MANTA_ZK) {
|
|
49
|
+
console.log('Init Manta ZK');
|
|
50
|
+
this.mantaChainHandler = new MantaPrivateHandler(dbService);
|
|
51
|
+
}
|
|
51
52
|
this.substrateChainHandler = new SubstrateChainHandler(this);
|
|
52
53
|
this.evmChainHandler = new EvmChainHandler(this);
|
|
53
54
|
this.logger = createLogger('chain-service');
|
|
@@ -417,8 +418,9 @@ export class ChainService {
|
|
|
417
418
|
}
|
|
418
419
|
};
|
|
419
420
|
if (chainInfo.substrateInfo !== null && chainInfo.substrateInfo !== undefined) {
|
|
420
|
-
if (_MANTA_ZK_CHAIN_GROUP.includes(chainInfo.slug)) {
|
|
421
|
-
|
|
421
|
+
if (_MANTA_ZK_CHAIN_GROUP.includes(chainInfo.slug) && MODULE_SUPPORT.MANTA_ZK && this.mantaChainHandler) {
|
|
422
|
+
var _this$mantaChainHandl;
|
|
423
|
+
const apiPromise = await ((_this$mantaChainHandl = this.mantaChainHandler) === null || _this$mantaChainHandl === void 0 ? void 0 : _this$mantaChainHandl.initMantaPay(endpoint, chainInfo.slug));
|
|
422
424
|
const chainApi = await this.substrateChainHandler.initApi(chainInfo.slug, endpoint, {
|
|
423
425
|
providerName,
|
|
424
426
|
externalApiPromise: apiPromise,
|
|
@@ -1304,4 +1306,7 @@ export class ChainService {
|
|
|
1304
1306
|
upsertMetadata(chain, metadata) {
|
|
1305
1307
|
return this.dbService.stores.metadata.upsertMetadata(chain, metadata);
|
|
1306
1308
|
}
|
|
1309
|
+
getMetadataByHash(hash) {
|
|
1310
|
+
return this.dbService.stores.metadata.getMetadataByGenesisHash(hash);
|
|
1311
|
+
}
|
|
1307
1312
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { withErrorLog } from '@subwallet/extension-base/background/handlers/helpers';
|
|
5
|
-
import { getOS } from '@subwallet/extension-base/services/request-service/helper';
|
|
6
5
|
import { DEFAULT_NOTIFICATION_TYPE } from '@subwallet/extension-base/services/setting-service/constants';
|
|
6
|
+
import { getOS } from '@subwallet/extension-base/utils';
|
|
7
7
|
const NOTIFICATION_URL = chrome.extension.getURL('notification.html');
|
|
8
8
|
const OS = getOS();
|
|
9
9
|
const extraHeight = OS === 'Linux' ? 0 : 28;
|
|
@@ -41,27 +41,4 @@ export const extractMetadata = store => {
|
|
|
41
41
|
def
|
|
42
42
|
}) => addMetadata(def));
|
|
43
43
|
});
|
|
44
|
-
};
|
|
45
|
-
export const getOS = () => {
|
|
46
|
-
var _window$navigator, _window$navigator$use;
|
|
47
|
-
const userAgent = window.navigator.userAgent;
|
|
48
|
-
// @ts-ignore
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
|
|
50
|
-
const platform = ((_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : (_window$navigator$use = _window$navigator.userAgentData) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform;
|
|
51
|
-
const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
|
|
52
|
-
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
|
|
53
|
-
const iosPlatforms = ['iPhone', 'iPad', 'iPod'];
|
|
54
|
-
let os = 'Unknown';
|
|
55
|
-
if (macosPlatforms.indexOf(platform) !== -1) {
|
|
56
|
-
os = 'Mac OS';
|
|
57
|
-
} else if (iosPlatforms.indexOf(platform) !== -1) {
|
|
58
|
-
os = 'iOS';
|
|
59
|
-
} else if (windowsPlatforms.indexOf(platform) !== -1) {
|
|
60
|
-
os = 'Windows';
|
|
61
|
-
} else if (/Android/.test(userAgent)) {
|
|
62
|
-
os = 'Android';
|
|
63
|
-
} else if (/Linux/.test(platform)) {
|
|
64
|
-
os = 'Linux';
|
|
65
|
-
}
|
|
66
|
-
return os;
|
|
67
44
|
};
|
|
@@ -10,7 +10,7 @@ export default class MetadataStore extends BaseStoreWithChain {
|
|
|
10
10
|
return this.table.put(metadata, chain);
|
|
11
11
|
}
|
|
12
12
|
getMetadataByGenesisHash(genesisHash) {
|
|
13
|
-
return this.table.
|
|
13
|
+
return this.table.get(genesisHash);
|
|
14
14
|
}
|
|
15
15
|
updateMetadataByGenesisHash(genesisHash, metadata) {
|
|
16
16
|
return this.table.put(metadata, genesisHash);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WalletConnectSigningMethod } from '@subwallet/extension-base/services/wallet-connect-service/types';
|
|
2
2
|
import { SignClientTypes } from '@walletconnect/types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const PROJECT_ID_EXTENSION = "6da34c0b48164d27681924dd9a46d6be";
|
|
4
|
+
export declare const PROJECT_ID_MOBILE = "6da34c0b48164d27681924dd9a46d6be";
|
|
4
5
|
export declare const RELAY_URL = "wss://relay.walletconnect.com";
|
|
5
6
|
export declare const DEFAULT_WALLET_CONNECT_OPTIONS: SignClientTypes.Options;
|
|
6
7
|
export declare const ALL_WALLET_CONNECT_EVENT: SignClientTypes.Event[];
|
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { EIP155_SIGNING_METHODS, POLKADOT_SIGNING_METHODS } from '@subwallet/extension-base/services/wallet-connect-service/types';
|
|
5
|
-
|
|
5
|
+
import { isMobile } from '@subwallet/extension-base/utils';
|
|
6
|
+
export const PROJECT_ID_EXTENSION = '6da34c0b48164d27681924dd9a46d6be';
|
|
7
|
+
export const PROJECT_ID_MOBILE = '6da34c0b48164d27681924dd9a46d6be';
|
|
6
8
|
export const RELAY_URL = 'wss://relay.walletconnect.com';
|
|
7
9
|
export const DEFAULT_WALLET_CONNECT_OPTIONS = {
|
|
8
10
|
logger: 'debug',
|
|
9
|
-
projectId:
|
|
11
|
+
projectId: !isMobile ? PROJECT_ID_EXTENSION : PROJECT_ID_MOBILE,
|
|
10
12
|
relayUrl: RELAY_URL,
|
|
11
13
|
metadata: {
|
|
12
14
|
name: 'SubWallet',
|
|
13
15
|
description: 'React Wallet for WalletConnect',
|
|
14
16
|
url: 'https://www.subwallet.app/',
|
|
15
|
-
icons: ['https://
|
|
17
|
+
icons: ['https://raw.githubusercontent.com/Koniverse/SubWallet-Extension/master/packages/extension-koni/public/images/icon-128.png']
|
|
16
18
|
}
|
|
17
19
|
};
|
|
18
20
|
export const ALL_WALLET_CONNECT_EVENT = ['session_proposal', 'session_update', 'session_extend', 'session_ping', 'session_delete', 'session_expire', 'session_request', 'session_request_sent', 'session_event', 'proposal_expire'];
|
|
@@ -10,7 +10,6 @@ export default class WalletConnectService {
|
|
|
10
10
|
get sessions(): SessionTypes.Struct[];
|
|
11
11
|
getSession(topic: string): SessionTypes.Struct;
|
|
12
12
|
changeOption(newOption: Omit<SignClientTypes.Options, 'projectId'>): Promise<void>;
|
|
13
|
-
getSessions(): void;
|
|
14
13
|
connect(uri: string): Promise<void>;
|
|
15
14
|
approveSession(result: ResultApproveWalletConnectSession): Promise<void>;
|
|
16
15
|
rejectSession(id: number): Promise<void>;
|