@subwallet/extension-base 1.0.2-1b → 1.0.2-2
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 +34 -16
- package/background/KoniTypes.js +7 -6
- package/background/errors/TransactionError.js +1 -21
- package/cjs/background/KoniTypes.js +7 -6
- package/cjs/background/errors/TransactionError.js +0 -20
- package/cjs/constants/index.js +26 -8
- package/cjs/koni/api/dotsama/balance.js +224 -49
- package/cjs/koni/api/dotsama/transfer.js +29 -30
- package/cjs/koni/api/nft/acala_nft/index.js +1 -4
- package/cjs/koni/api/nft/bit.country/index.js +1 -4
- package/cjs/koni/api/nft/evm_nft/index.js +3 -7
- package/cjs/koni/api/nft/index.js +6 -3
- package/cjs/koni/api/nft/karura_nft/index.js +1 -4
- package/cjs/koni/api/nft/rmrk_nft/index.js +1 -8
- package/cjs/koni/api/nft/statemine_nft/index.js +1 -4
- package/cjs/koni/api/nft/unique_nft/index.js +1 -6
- package/cjs/koni/api/nft/wasm_nft/index.js +111 -169
- package/cjs/koni/api/nft/wasm_nft/utils.js +7 -11
- package/cjs/koni/api/staking/bonding/amplitude.js +9 -13
- package/cjs/koni/api/staking/bonding/astar.js +13 -15
- package/cjs/koni/api/staking/bonding/index.js +10 -22
- package/cjs/koni/api/staking/bonding/paraChain.js +2 -85
- package/cjs/koni/api/staking/bonding/relayChain.js +16 -119
- package/cjs/koni/api/staking/bonding/utils.js +8 -27
- package/cjs/koni/api/tokens/wasm/index.js +4 -5
- package/cjs/koni/api/xcm/polkadotXcm.js +1 -1
- package/cjs/koni/api/xcm/utils.js +13 -18
- package/cjs/koni/api/xcm/xTokens.js +1 -1
- package/cjs/koni/api/xcm/xcmPallet.js +6 -9
- package/cjs/koni/background/cron.js +47 -150
- package/cjs/koni/background/handlers/Extension.js +64 -106
- package/cjs/koni/background/handlers/State.js +21 -19
- package/cjs/koni/background/handlers/Tabs.js +1 -8
- package/cjs/koni/background/subscription.js +29 -32
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/handler/SubstrateChainHandler.js +8 -13
- package/cjs/services/chain-service/handler/light-client/index.js +0 -2
- package/cjs/services/chain-service/index.js +7 -6
- package/cjs/services/event-service/index.js +1 -5
- package/cjs/services/event-service/types.js +1 -11
- package/cjs/services/history-service/index.js +10 -16
- package/cjs/services/history-service/subsquid-multi-chain-history.js +9 -12
- package/cjs/services/price-service/coingecko.js +1 -0
- package/cjs/services/price-service/index.js +3 -2
- package/cjs/services/request-service/handler/AuthRequestHandler.js +2 -6
- package/cjs/services/storage-service/DatabaseService.js +33 -52
- package/cjs/services/storage-service/db-stores/Nft.js +17 -4
- package/cjs/services/transaction-service/event-parser/index.js +48 -20
- package/cjs/services/transaction-service/index.js +14 -23
- package/cjs/utils/index.js +14 -7
- package/constants/index.d.ts +13 -7
- package/constants/index.js +13 -7
- package/koni/api/dotsama/balance.d.ts +1 -0
- package/koni/api/dotsama/balance.js +197 -22
- package/koni/api/dotsama/transfer.js +4 -5
- package/koni/api/nft/acala_nft/index.js +1 -3
- package/koni/api/nft/bit.country/index.js +1 -3
- package/koni/api/nft/evm_nft/index.js +3 -6
- package/koni/api/nft/index.d.ts +2 -1
- package/koni/api/nft/index.js +6 -3
- package/koni/api/nft/karura_nft/index.js +1 -3
- package/koni/api/nft/nft.d.ts +0 -1
- package/koni/api/nft/rmrk_nft/index.js +1 -8
- package/koni/api/nft/statemine_nft/index.js +1 -3
- package/koni/api/nft/unique_nft/index.js +1 -5
- package/koni/api/nft/wasm_nft/index.d.ts +2 -0
- package/koni/api/nft/wasm_nft/index.js +109 -167
- package/koni/api/nft/wasm_nft/utils.d.ts +5 -7
- package/koni/api/nft/wasm_nft/utils.js +5 -7
- package/koni/api/staking/bonding/amplitude.d.ts +1 -0
- package/koni/api/staking/bonding/amplitude.js +10 -15
- package/koni/api/staking/bonding/astar.js +6 -8
- package/koni/api/staking/bonding/index.d.ts +1 -4
- package/koni/api/staking/bonding/index.js +13 -23
- package/koni/api/staking/bonding/paraChain.d.ts +0 -3
- package/koni/api/staking/bonding/paraChain.js +5 -86
- package/koni/api/staking/bonding/relayChain.d.ts +1 -5
- package/koni/api/staking/bonding/relayChain.js +18 -118
- package/koni/api/staking/bonding/utils.d.ts +2 -3
- package/koni/api/staking/bonding/utils.js +9 -27
- package/koni/api/tokens/wasm/index.js +4 -5
- package/koni/api/xcm/polkadotXcm.js +2 -2
- package/koni/api/xcm/utils.d.ts +6 -5
- package/koni/api/xcm/utils.js +10 -15
- package/koni/api/xcm/xTokens.js +2 -2
- package/koni/api/xcm/xcmPallet.js +9 -10
- package/koni/background/cron.d.ts +1 -6
- package/koni/background/cron.js +48 -151
- package/koni/background/handlers/Extension.d.ts +2 -2
- package/koni/background/handlers/Extension.js +67 -108
- package/koni/background/handlers/State.d.ts +6 -5
- package/koni/background/handlers/State.js +21 -19
- package/koni/background/handlers/Tabs.js +1 -8
- package/koni/background/subscription.js +30 -31
- package/package.json +8 -13
- package/packageInfo.js +1 -1
- package/services/chain-service/handler/SubstrateChainHandler.js +9 -14
- package/services/chain-service/handler/light-client/index.d.ts +1 -17
- package/services/chain-service/handler/light-client/index.js +1 -1
- package/services/chain-service/helper/psp22_abi.json +881 -1041
- package/services/chain-service/helper/psp34_abi.json +1808 -2964
- package/services/chain-service/index.js +7 -6
- package/services/event-service/index.js +1 -5
- package/services/event-service/types.d.ts +9 -5
- package/services/event-service/types.js +1 -4
- package/services/history-service/index.d.ts +1 -1
- package/services/history-service/index.js +10 -16
- package/services/history-service/subsquid-multi-chain-history.js +11 -15
- package/services/price-service/coingecko.js +1 -0
- package/services/price-service/index.js +3 -2
- package/services/request-service/handler/AuthRequestHandler.js +2 -6
- package/services/storage-service/DatabaseService.d.ts +0 -1
- package/services/storage-service/DatabaseService.js +33 -52
- package/services/storage-service/db-stores/Nft.d.ts +2 -1
- package/services/storage-service/db-stores/Nft.js +16 -4
- package/services/transaction-service/event-parser/index.js +49 -21
- package/services/transaction-service/index.js +14 -23
- package/utils/index.d.ts +1 -1
- package/utils/index.js +12 -6
- package/cjs/koni/api/tokens/wasm/utils.js +0 -63
- package/koni/api/tokens/wasm/utils.d.ts +0 -6
- package/koni/api/tokens/wasm/utils.js +0 -54
|
@@ -430,38 +430,35 @@ class KoniExtension {
|
|
|
430
430
|
}
|
|
431
431
|
async accountsGetAllWithCurrentAddress(id, port) {
|
|
432
432
|
const cb = (0, _subscriptions.createSubscription)(id, port);
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
port.onDisconnect.addListener(() => {
|
|
462
|
-
this.cancelSubscription(id);
|
|
433
|
+
return await new Promise(resolve => {
|
|
434
|
+
const subscription = _accounts.accounts.subject.subscribe(storedAccounts => {
|
|
435
|
+
const transformedAccounts = transformAccounts(storedAccounts);
|
|
436
|
+
const accounts = transformedAccounts && transformedAccounts.length ? [{
|
|
437
|
+
...ACCOUNT_ALL_JSON
|
|
438
|
+
}, ...transformedAccounts] : [];
|
|
439
|
+
const accountsWithCurrentAddress = {
|
|
440
|
+
accounts
|
|
441
|
+
};
|
|
442
|
+
setTimeout(() => {
|
|
443
|
+
const accountInfo = this.#koniState.keyringService.currentAccount;
|
|
444
|
+
if (accountInfo) {
|
|
445
|
+
accountsWithCurrentAddress.currentAddress = accountInfo.address;
|
|
446
|
+
if (accountInfo.address === _constants.ALL_ACCOUNT_KEY) {
|
|
447
|
+
accountsWithCurrentAddress.currentGenesisHash = accountInfo.currentGenesisHash;
|
|
448
|
+
} else {
|
|
449
|
+
const acc = accounts.find(a => a.address === accountInfo.address);
|
|
450
|
+
accountsWithCurrentAddress.currentGenesisHash = (acc === null || acc === void 0 ? void 0 : acc.genesisHash) || _constants.ALL_GENESIS_HASH;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
resolve(accountsWithCurrentAddress);
|
|
454
|
+
cb(accountsWithCurrentAddress);
|
|
455
|
+
}, 300);
|
|
456
|
+
});
|
|
457
|
+
this.createUnsubscriptionHandle(id, subscription.unsubscribe);
|
|
458
|
+
port.onDisconnect.addListener(() => {
|
|
459
|
+
this.cancelSubscription(id);
|
|
460
|
+
});
|
|
463
461
|
});
|
|
464
|
-
return responseData;
|
|
465
462
|
}
|
|
466
463
|
accountsGetAll(id, port) {
|
|
467
464
|
const cb = (0, _subscriptions.createSubscription)(id, port);
|
|
@@ -483,15 +480,11 @@ class KoniExtension {
|
|
|
483
480
|
} = _ref21;
|
|
484
481
|
return _uiKeyring.keyring.saveRecent(accountId);
|
|
485
482
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
//
|
|
492
|
-
// return true;
|
|
493
|
-
// }
|
|
494
|
-
|
|
483
|
+
triggerAccountsSubscription() {
|
|
484
|
+
const accountsSubject = _accounts.accounts.subject;
|
|
485
|
+
accountsSubject.next(accountsSubject.getValue());
|
|
486
|
+
return true;
|
|
487
|
+
}
|
|
495
488
|
_getAuthListV2() {
|
|
496
489
|
return new Promise((resolve, reject) => {
|
|
497
490
|
this.#koniState.getAuthorize(rs => {
|
|
@@ -847,12 +840,8 @@ class KoniExtension {
|
|
|
847
840
|
} else {
|
|
848
841
|
accountInfo.address = address;
|
|
849
842
|
if (address !== _constants.ALL_ACCOUNT_KEY) {
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
accountInfo.currentGenesisHash = (currentKeyPair === null || currentKeyPair === void 0 ? void 0 : currentKeyPair.meta.genesisHash) || _constants.ALL_GENESIS_HASH;
|
|
853
|
-
} catch {
|
|
854
|
-
accountInfo.currentGenesisHash = _constants.ALL_GENESIS_HASH;
|
|
855
|
-
}
|
|
843
|
+
const currentKeyPair = _uiKeyring.keyring.getAccount(address);
|
|
844
|
+
accountInfo.currentGenesisHash = (currentKeyPair === null || currentKeyPair === void 0 ? void 0 : currentKeyPair.meta.genesisHash) || _constants.ALL_GENESIS_HASH;
|
|
856
845
|
} else {
|
|
857
846
|
accountInfo.currentGenesisHash = accountInfo.allGenesisHash || _constants.ALL_GENESIS_HASH;
|
|
858
847
|
}
|
|
@@ -862,15 +851,18 @@ class KoniExtension {
|
|
|
862
851
|
});
|
|
863
852
|
}
|
|
864
853
|
updateCurrentAccountAddress(address) {
|
|
865
|
-
this._saveCurrentAccountAddress(address)
|
|
854
|
+
this._saveCurrentAccountAddress(address, () => {
|
|
855
|
+
this.triggerAccountsSubscription();
|
|
856
|
+
});
|
|
866
857
|
return true;
|
|
867
858
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
859
|
+
saveCurrentAccountAddress(data, id, port) {
|
|
860
|
+
const cb = (0, _subscriptions.createSubscription)(id, port);
|
|
861
|
+
this._saveCurrentAccountAddress(data.address, cb);
|
|
862
|
+
port.onDisconnect.addListener(() => {
|
|
863
|
+
this.cancelSubscription(id);
|
|
873
864
|
});
|
|
865
|
+
return true;
|
|
874
866
|
}
|
|
875
867
|
async getAssetSetting() {
|
|
876
868
|
return this.#koniState.chainService.getAssetSettings();
|
|
@@ -887,7 +879,6 @@ class KoniExtension {
|
|
|
887
879
|
async updateAssetSetting(params) {
|
|
888
880
|
try {
|
|
889
881
|
await this.#koniState.chainService.updateAssetSetting(params.tokenSlug, params.assetSetting);
|
|
890
|
-
this.#koniState.eventService.emit('asset.updateState', params.tokenSlug);
|
|
891
882
|
return true;
|
|
892
883
|
} catch (e) {
|
|
893
884
|
console.error('Error updating asset setting', e);
|
|
@@ -1375,6 +1366,7 @@ class KoniExtension {
|
|
|
1375
1366
|
|
|
1376
1367
|
// Get native token amount
|
|
1377
1368
|
const freeBalance = await this.#koniState.balanceService.getTokenFreeBalance(from, networkKey, tokenSlug);
|
|
1369
|
+
let edAsWarning = false;
|
|
1378
1370
|
if ((0, _utilCrypto.isEthereumAddress)(from) && (0, _utilCrypto.isEthereumAddress)(to)) {
|
|
1379
1371
|
chainType = _KoniTypes.ChainType.EVM;
|
|
1380
1372
|
const txVal = transferAll ? freeBalance.value : value || '0';
|
|
@@ -1384,6 +1376,7 @@ class KoniExtension {
|
|
|
1384
1376
|
[transaction, transferAmount.value] = await (0, _transfer3.getERC20TransactionObject)((0, _utils._getContractAddressOfToken)(tokenInfo), chainInfo, from, to, txVal, !!transferAll, evmApiMap);
|
|
1385
1377
|
} else {
|
|
1386
1378
|
[transaction, transferAmount.value] = await (0, _transfer3.getEVMTransactionObject)(chainInfo, to, txVal, !!transferAll, evmApiMap);
|
|
1379
|
+
edAsWarning = true;
|
|
1387
1380
|
}
|
|
1388
1381
|
} else {
|
|
1389
1382
|
const substrateApi = this.#koniState.getSubstrateApi(networkKey);
|
|
@@ -1396,6 +1389,7 @@ class KoniExtension {
|
|
|
1396
1389
|
to: to,
|
|
1397
1390
|
substrateApi
|
|
1398
1391
|
});
|
|
1392
|
+
edAsWarning = true;
|
|
1399
1393
|
}
|
|
1400
1394
|
const transferNativeAmount = isTransferNativeToken ? transferAmount.value : '0';
|
|
1401
1395
|
return this.#koniState.transactionService.handleTransaction({
|
|
@@ -1410,7 +1404,7 @@ class KoniExtension {
|
|
|
1410
1404
|
extrinsicType: isTransferNativeToken ? _KoniTypes.ExtrinsicType.TRANSFER_BALANCE : _KoniTypes.ExtrinsicType.TRANSFER_TOKEN,
|
|
1411
1405
|
ignoreWarnings: transferAll,
|
|
1412
1406
|
isTransferAll: transferAll,
|
|
1413
|
-
edAsWarning:
|
|
1407
|
+
edAsWarning: edAsWarning
|
|
1414
1408
|
});
|
|
1415
1409
|
}
|
|
1416
1410
|
validateCrossChainTransfer(destinationNetworkKey, sendingTokenSlug, sender, sendingValue) {
|
|
@@ -2105,7 +2099,6 @@ class KoniExtension {
|
|
|
2105
2099
|
}
|
|
2106
2100
|
async getNominationPoolOptions(chain) {
|
|
2107
2101
|
const substrateApi = this.#koniState.getSubstrateApi(chain);
|
|
2108
|
-
console.log('chain', chain);
|
|
2109
2102
|
return await (0, _bonding.getNominationPoolsInfo)(chain, substrateApi);
|
|
2110
2103
|
}
|
|
2111
2104
|
async submitBonding(inputData) {
|
|
@@ -2116,15 +2109,12 @@ class KoniExtension {
|
|
|
2116
2109
|
nominatorMetadata,
|
|
2117
2110
|
selectedValidators
|
|
2118
2111
|
} = inputData;
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors([new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.
|
|
2123
|
-
}
|
|
2124
|
-
const bondingValidation = (0, _bonding.validateBondingCondition)(chainInfo, amount, selectedValidators, address, chainStakingMetadata, nominatorMetadata);
|
|
2125
|
-
if (!amount || !selectedValidators || bondingValidation.length > 0) {
|
|
2126
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors(bondingValidation);
|
|
2112
|
+
if (!amount || !selectedValidators) {
|
|
2113
|
+
// Todo: Check and return error here
|
|
2114
|
+
|
|
2115
|
+
return this.#koniState.transactionService.generateBeforeHandleResponseErrors([new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.INVALID_PARAMS)]);
|
|
2127
2116
|
}
|
|
2117
|
+
const chainInfo = this.#koniState.getChainInfo(chain);
|
|
2128
2118
|
const substrateApi = this.#koniState.getSubstrateApi(chain);
|
|
2129
2119
|
const extrinsic = await (0, _bonding.getBondingExtrinsic)(chainInfo, amount, selectedValidators, substrateApi, address, nominatorMetadata);
|
|
2130
2120
|
console.log('Bonding extrinsic: ', chain, extrinsic.toHex());
|
|
@@ -2135,8 +2125,7 @@ class KoniExtension {
|
|
|
2135
2125
|
data: inputData,
|
|
2136
2126
|
extrinsicType: _KoniTypes.ExtrinsicType.STAKING_BOND,
|
|
2137
2127
|
transaction: extrinsic,
|
|
2138
|
-
url: _constants2.EXTENSION_REQUEST_URL
|
|
2139
|
-
transferNativeAmount: amount
|
|
2128
|
+
url: _constants2.EXTENSION_REQUEST_URL
|
|
2140
2129
|
});
|
|
2141
2130
|
}
|
|
2142
2131
|
async submitUnbonding(inputData) {
|
|
@@ -2146,17 +2135,12 @@ class KoniExtension {
|
|
|
2146
2135
|
nominatorMetadata,
|
|
2147
2136
|
validatorAddress
|
|
2148
2137
|
} = inputData;
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors([new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.INTERNAL_ERROR)]);
|
|
2152
|
-
}
|
|
2153
|
-
const unbondingValidation = (0, _bonding.validateUnbondingCondition)(nominatorMetadata, amount, chain, chainStakingMetadata, validatorAddress);
|
|
2154
|
-
if (!amount || unbondingValidation.length > 0) {
|
|
2155
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors(unbondingValidation);
|
|
2138
|
+
if (!amount || !nominatorMetadata) {
|
|
2139
|
+
return this.#koniState.transactionService.generateBeforeHandleResponseErrors([new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.INVALID_PARAMS)]);
|
|
2156
2140
|
}
|
|
2157
2141
|
const substrateApi = this.#koniState.getSubstrateApi(chain);
|
|
2158
2142
|
const extrinsic = await (0, _bonding.getUnbondingExtrinsic)(nominatorMetadata, amount, chain, substrateApi, validatorAddress);
|
|
2159
|
-
console.log('
|
|
2143
|
+
console.log('unbonding extrinsic: ', extrinsic.toHex());
|
|
2160
2144
|
return await this.#koniState.transactionService.handleTransaction({
|
|
2161
2145
|
address: nominatorMetadata.address,
|
|
2162
2146
|
chain: chain,
|
|
@@ -2230,7 +2214,7 @@ class KoniExtension {
|
|
|
2230
2214
|
chainType: _KoniTypes.ChainType.SUBSTRATE
|
|
2231
2215
|
});
|
|
2232
2216
|
}
|
|
2233
|
-
async
|
|
2217
|
+
async submitPoolingBonding(inputData) {
|
|
2234
2218
|
const {
|
|
2235
2219
|
address,
|
|
2236
2220
|
amount,
|
|
@@ -2238,15 +2222,8 @@ class KoniExtension {
|
|
|
2238
2222
|
nominatorMetadata,
|
|
2239
2223
|
selectedPool
|
|
2240
2224
|
} = inputData;
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
if (!chainStakingMetadata) {
|
|
2244
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors([new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.INTERNAL_ERROR)]);
|
|
2245
|
-
}
|
|
2246
|
-
const bondingValidation = (0, _relayChain.validatePoolBondingCondition)(chainInfo, amount, selectedPool, address, chainStakingMetadata, nominatorMetadata);
|
|
2247
|
-
if (!amount || bondingValidation.length > 0) {
|
|
2248
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors(bondingValidation);
|
|
2249
|
-
}
|
|
2225
|
+
|
|
2226
|
+
// TODO: can't stake when unstake all
|
|
2250
2227
|
const substrateApi = this.#koniState.getSubstrateApi(chain);
|
|
2251
2228
|
const extrinsic = await (0, _relayChain.getPoolingBondingExtrinsic)(substrateApi, amount, selectedPool.id, nominatorMetadata);
|
|
2252
2229
|
console.log('Join nomination pool extrinsic', extrinsic.toHex());
|
|
@@ -2265,14 +2242,6 @@ class KoniExtension {
|
|
|
2265
2242
|
chain,
|
|
2266
2243
|
nominatorMetadata
|
|
2267
2244
|
} = inputData;
|
|
2268
|
-
const chainStakingMetadata = await this.#koniState.getStakingMetadataByChain(chain, _KoniTypes.StakingType.NOMINATED);
|
|
2269
|
-
if (!chainStakingMetadata || !nominatorMetadata) {
|
|
2270
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors([new _TransactionError.TransactionError(_KoniTypes.BasicTxErrorType.INTERNAL_ERROR)]);
|
|
2271
|
-
}
|
|
2272
|
-
const unbondingValidation = (0, _relayChain.validateRelayUnbondingCondition)(amount, chainStakingMetadata, nominatorMetadata);
|
|
2273
|
-
if (!amount || unbondingValidation.length > 0) {
|
|
2274
|
-
return this.#koniState.transactionService.generateBeforeHandleResponseErrors(unbondingValidation);
|
|
2275
|
-
}
|
|
2276
2245
|
const substrateApi = this.#koniState.getSubstrateApi(chain);
|
|
2277
2246
|
const extrinsic = await (0, _relayChain.getPoolingUnbondingExtrinsic)(substrateApi, amount, nominatorMetadata);
|
|
2278
2247
|
console.log('Nomination pool unbond extrinsic', extrinsic.toHex());
|
|
@@ -2775,17 +2744,6 @@ class KoniExtension {
|
|
|
2775
2744
|
});
|
|
2776
2745
|
return notificationSubject.value;
|
|
2777
2746
|
}
|
|
2778
|
-
async reloadCron(_ref65) {
|
|
2779
|
-
let {
|
|
2780
|
-
data
|
|
2781
|
-
} = _ref65;
|
|
2782
|
-
if (data === 'nft') {
|
|
2783
|
-
return await this.#koniState.reloadNft();
|
|
2784
|
-
} else if (data === 'staking') {
|
|
2785
|
-
return await this.#koniState.reloadStaking();
|
|
2786
|
-
}
|
|
2787
|
-
return Promise.resolve(false);
|
|
2788
|
-
}
|
|
2789
2747
|
|
|
2790
2748
|
// --------------------------------------------------------------
|
|
2791
2749
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
@@ -2902,8 +2860,10 @@ class KoniExtension {
|
|
|
2902
2860
|
return this.accountsGetAll(id, port);
|
|
2903
2861
|
case 'pri(accounts.saveRecent)':
|
|
2904
2862
|
return this.saveRecentAccountId(request);
|
|
2863
|
+
case 'pri(accounts.triggerSubscription)':
|
|
2864
|
+
return this.triggerAccountsSubscription();
|
|
2905
2865
|
case 'pri(currentAccount.saveAddress)':
|
|
2906
|
-
return
|
|
2866
|
+
return this.saveCurrentAccountAddress(request, id, port);
|
|
2907
2867
|
case 'pri(accounts.updateCurrentAddress)':
|
|
2908
2868
|
return this.updateCurrentAccountAddress(request);
|
|
2909
2869
|
case 'pri(settings.changeBalancesVisibility)':
|
|
@@ -3067,7 +3027,7 @@ class KoniExtension {
|
|
|
3067
3027
|
case 'pri(staking.submitTuringCancelCompound)':
|
|
3068
3028
|
return await this.submitTuringCancelStakeCompound(request);
|
|
3069
3029
|
case 'pri(bonding.nominationPool.submitBonding)':
|
|
3070
|
-
return await this.
|
|
3030
|
+
return await this.submitPoolingBonding(request);
|
|
3071
3031
|
case 'pri(bonding.nominationPool.submitUnbonding)':
|
|
3072
3032
|
return await this.submitPoolingUnbonding(request);
|
|
3073
3033
|
|
|
@@ -3116,8 +3076,6 @@ class KoniExtension {
|
|
|
3116
3076
|
// Notification
|
|
3117
3077
|
case 'pri(notifications.subscribe)':
|
|
3118
3078
|
return this.subscribeNotifications(id, port);
|
|
3119
|
-
case 'pri(cron.reload)':
|
|
3120
|
-
return await this.reloadCron(request);
|
|
3121
3079
|
|
|
3122
3080
|
// Default
|
|
3123
3081
|
default:
|
|
@@ -67,6 +67,7 @@ class KoniState {
|
|
|
67
67
|
unsubscriptionMap = {};
|
|
68
68
|
accountRefStore = new _AccountRef.default();
|
|
69
69
|
externalRequest = {};
|
|
70
|
+
serviceInfoSubject = new _rxjs.Subject();
|
|
70
71
|
balanceMap = {};
|
|
71
72
|
balanceSubject = new _rxjs.Subject();
|
|
72
73
|
crowdloanMap = generateDefaultCrowdloanMap();
|
|
@@ -308,7 +309,7 @@ class KoniState {
|
|
|
308
309
|
return addresses;
|
|
309
310
|
}
|
|
310
311
|
async getPooledStakingRecordsByAddress(addresses) {
|
|
311
|
-
return this.dbService.getPooledStakings(addresses, this.activeChainSlugs);
|
|
312
|
+
return await this.dbService.getPooledStakings(addresses, this.activeChainSlugs);
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
// TODO: delete later
|
|
@@ -366,12 +367,12 @@ class KoniState {
|
|
|
366
367
|
this.dbService.addNft(address, nftData).catch(e => this.logger.warn(e));
|
|
367
368
|
callback && callback(nftData);
|
|
368
369
|
}
|
|
370
|
+
removeNfts(chain, address, collectionId, nftIds) {
|
|
371
|
+
return this.dbService.removeNfts(chain, address, collectionId, nftIds);
|
|
372
|
+
}
|
|
369
373
|
deleteNftCollection(chain, collectionId) {
|
|
370
374
|
return this.dbService.deleteNftCollection(chain, collectionId);
|
|
371
375
|
}
|
|
372
|
-
cleanUpNfts(chain, owner, collectionId, nftIds) {
|
|
373
|
-
this.dbService.cleanUpNft(chain, owner, collectionId, nftIds).catch(e => this.logger.warn(e));
|
|
374
|
-
}
|
|
375
376
|
async getNft() {
|
|
376
377
|
const addresses = this.getDecodedAddresses();
|
|
377
378
|
if (!addresses.length) {
|
|
@@ -458,7 +459,7 @@ class KoniState {
|
|
|
458
459
|
if (address === _constants.ALL_ACCOUNT_KEY) {
|
|
459
460
|
const pairs = _uiKeyring.keyring.getAccounts();
|
|
460
461
|
const pair = pairs[0];
|
|
461
|
-
const pairGenesisHash =
|
|
462
|
+
const pairGenesisHash = pair.meta.genesisHash;
|
|
462
463
|
if (pairs.length > 1 || !pair) {
|
|
463
464
|
result.allGenesisHash = currentGenesisHash || undefined;
|
|
464
465
|
} else {
|
|
@@ -672,7 +673,7 @@ class KoniState {
|
|
|
672
673
|
const items = await this.dbService.stores.balance.getBalanceMapByAddress(address);
|
|
673
674
|
return items || {};
|
|
674
675
|
}
|
|
675
|
-
async
|
|
676
|
+
async switchAccount(newAddress) {
|
|
676
677
|
await Promise.all([this.resetBalanceMap(newAddress), this.resetCrowdloanMap(newAddress)]);
|
|
677
678
|
}
|
|
678
679
|
async resetBalanceMap(newAddress) {
|
|
@@ -753,6 +754,9 @@ class KoniState {
|
|
|
753
754
|
subscribeCrowdloan() {
|
|
754
755
|
return this.crowdloanSubject;
|
|
755
756
|
}
|
|
757
|
+
getAllPriceIds() {
|
|
758
|
+
return this.chainService.getAllPriceIds();
|
|
759
|
+
}
|
|
756
760
|
getSmartContractNfts() {
|
|
757
761
|
return this.chainService.getSmartContractNfts();
|
|
758
762
|
}
|
|
@@ -810,9 +814,7 @@ class KoniState {
|
|
|
810
814
|
await this.chainService.updateAssetSetting(tokenSlug, {
|
|
811
815
|
visible: true
|
|
812
816
|
});
|
|
813
|
-
this.eventService.emit('asset.
|
|
814
|
-
} else {
|
|
815
|
-
this.eventService.emit('asset.updateState', tokenSlug);
|
|
817
|
+
this.eventService.emit('asset.update', tokenSlug);
|
|
816
818
|
}
|
|
817
819
|
}
|
|
818
820
|
deleteCustomAssets(targetTokens) {
|
|
@@ -839,7 +841,6 @@ class KoniState {
|
|
|
839
841
|
await this.chainService.updateAssetSetting(newNativeTokenSlug, {
|
|
840
842
|
visible: true
|
|
841
843
|
});
|
|
842
|
-
this.eventService.emit('asset.updateState', newNativeTokenSlug);
|
|
843
844
|
}
|
|
844
845
|
return true;
|
|
845
846
|
}
|
|
@@ -883,6 +884,13 @@ class KoniState {
|
|
|
883
884
|
const defaultChains = this.getDefaultNetworkKeys();
|
|
884
885
|
return this.chainService.resetChainInfoMap(defaultChains);
|
|
885
886
|
}
|
|
887
|
+
updateNetworkStatus(networkKey, status) {
|
|
888
|
+
const chainState = this.chainService.getChainStateByKey(networkKey);
|
|
889
|
+
if (chainState.connectionStatus === status) {
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
this.chainService.setChainConnectionStatus(networkKey, status);
|
|
893
|
+
}
|
|
886
894
|
getSubstrateApiMap() {
|
|
887
895
|
return this.chainService.getSubstrateApiMap();
|
|
888
896
|
}
|
|
@@ -908,6 +916,9 @@ class KoniState {
|
|
|
908
916
|
refreshWeb3Api(key) {
|
|
909
917
|
this.chainService.refreshEvmApi(key);
|
|
910
918
|
}
|
|
919
|
+
subscribeServiceInfo() {
|
|
920
|
+
return this.serviceInfoSubject;
|
|
921
|
+
}
|
|
911
922
|
getServiceInfo() {
|
|
912
923
|
return {
|
|
913
924
|
chainInfoMap: this.chainService.getChainInfoMap(),
|
|
@@ -1357,9 +1368,6 @@ class KoniState {
|
|
|
1357
1368
|
createUnsubscriptionHandle(id, unsubscribe) {
|
|
1358
1369
|
this.unsubscriptionMap[id] = unsubscribe;
|
|
1359
1370
|
}
|
|
1360
|
-
updateChainConnectionStatus(chain, status) {
|
|
1361
|
-
this.chainService.setChainConnectionStatus(chain, status);
|
|
1362
|
-
}
|
|
1363
1371
|
async autoEnableChains(addresses) {
|
|
1364
1372
|
const assetMap = this.chainService.getAssetRegistry();
|
|
1365
1373
|
const promiseList = addresses.map(address => {
|
|
@@ -1431,11 +1439,5 @@ class KoniState {
|
|
|
1431
1439
|
stores.staking.removeAllByAddress(address).catch(console.error);
|
|
1432
1440
|
});
|
|
1433
1441
|
}
|
|
1434
|
-
async reloadNft() {
|
|
1435
|
-
return await this.cron.reloadNft();
|
|
1436
|
-
}
|
|
1437
|
-
async reloadStaking() {
|
|
1438
|
-
return await this.cron.reloadStaking();
|
|
1439
|
-
}
|
|
1440
1442
|
}
|
|
1441
1443
|
exports.default = KoniState;
|
|
@@ -295,20 +295,13 @@ class KoniTabs {
|
|
|
295
295
|
if (!web3.currentProvider.connected) {
|
|
296
296
|
console.log(`[Web3] ${slug} is disconnected, trying to connect...`);
|
|
297
297
|
this.#koniState.refreshWeb3Api(slug);
|
|
298
|
-
let checkingNum = 0;
|
|
299
298
|
const poll = resolve => {
|
|
300
|
-
checkingNum += 1;
|
|
301
299
|
if (web3.currentProvider.connected) {
|
|
302
300
|
console.log(`Network [${slug}] is connected.`);
|
|
303
301
|
resolve(true);
|
|
304
302
|
} else {
|
|
305
303
|
console.log(`Connecting to network [${slug}]`);
|
|
306
|
-
|
|
307
|
-
setTimeout(() => poll(resolve), 900);
|
|
308
|
-
} else {
|
|
309
|
-
console.log(`Max retry, stop checking [${slug}]`);
|
|
310
|
-
resolve(false);
|
|
311
|
-
}
|
|
304
|
+
setTimeout(() => poll(resolve), 400);
|
|
312
305
|
}
|
|
313
306
|
};
|
|
314
307
|
await new Promise(poll);
|
|
@@ -14,7 +14,6 @@ var _paraChain = require("@subwallet/extension-base/koni/api/staking/paraChain")
|
|
|
14
14
|
var _handlers = require("@subwallet/extension-base/koni/background/handlers");
|
|
15
15
|
var _constants2 = require("@subwallet/extension-base/services/chain-service/constants");
|
|
16
16
|
var _utils = require("@subwallet/extension-base/services/chain-service/utils");
|
|
17
|
-
var _types = require("@subwallet/extension-base/services/event-service/types");
|
|
18
17
|
var _util = require("@polkadot/util");
|
|
19
18
|
var _utilCrypto = require("@polkadot/util-crypto");
|
|
20
19
|
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
@@ -65,28 +64,30 @@ class KoniSubscription {
|
|
|
65
64
|
this.subscribeBalancesAndCrowdloans(currentAddress, this.state.getChainInfoMap(), this.state.getChainStateMap(), this.state.getSubstrateApiMap(), this.state.getEvmApiMap());
|
|
66
65
|
this.subscribeStakingOnChain(currentAddress, this.state.getSubstrateApiMap());
|
|
67
66
|
}
|
|
68
|
-
this.eventHandler
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
if (!this.eventHandler) {
|
|
68
|
+
const reloadEvents = ['account.add', 'account.remove', 'account.updateCurrent', 'chain.add', 'chain.update', 'chain.enable', 'asset.update', 'asset.enable', 'transaction.done', 'transaction.failed'];
|
|
69
|
+
this.eventHandler = (events, eventTypes) => {
|
|
70
|
+
var _serviceInfo$currentA;
|
|
71
|
+
const serviceInfo = this.state.getServiceInfo();
|
|
72
|
+
const needReload = eventTypes.some(eT => reloadEvents.includes(eT));
|
|
73
|
+
if (!needReload) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.logger.log('ServiceInfo updated, restarting...');
|
|
77
|
+
const address = (_serviceInfo$currentA = serviceInfo.currentAccountInfo) === null || _serviceInfo$currentA === void 0 ? void 0 : _serviceInfo$currentA.address;
|
|
78
|
+
if (!address) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.subscribeBalancesAndCrowdloans(address, serviceInfo.chainInfoMap, serviceInfo.chainStateMap, serviceInfo.chainApiMap.substrate, serviceInfo.chainApiMap.evm);
|
|
82
|
+
this.subscribeStakingOnChain(address, serviceInfo.chainApiMap.substrate);
|
|
83
|
+
};
|
|
84
|
+
this.state.eventService.onLazy(this.eventHandler);
|
|
85
|
+
}
|
|
84
86
|
}
|
|
85
87
|
stop() {
|
|
86
88
|
this.logger.log('Stopping subscription');
|
|
87
89
|
if (this.eventHandler) {
|
|
88
90
|
this.state.eventService.offLazy(this.eventHandler);
|
|
89
|
-
this.eventHandler = undefined;
|
|
90
91
|
}
|
|
91
92
|
this.stopAllSubscription();
|
|
92
93
|
}
|
|
@@ -112,7 +113,7 @@ class KoniSubscription {
|
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
115
|
subscribeBalancesAndCrowdloans(address, chainInfoMap, chainStateMap, substrateApiMap, web3ApiMap, onlyRunOnFirstTime) {
|
|
115
|
-
this.state.
|
|
116
|
+
this.state.switchAccount(address).then(() => {
|
|
116
117
|
const addresses = this.state.getDecodedAddresses(address);
|
|
117
118
|
if (!addresses.length) {
|
|
118
119
|
return;
|
|
@@ -188,8 +189,8 @@ class KoniSubscription {
|
|
|
188
189
|
return _this.state.updateNftData(...arguments);
|
|
189
190
|
}, function () {
|
|
190
191
|
return _this.state.setNftCollection(...arguments);
|
|
191
|
-
}
|
|
192
|
-
|
|
192
|
+
}).then(() => {
|
|
193
|
+
this.logger.log('nft state updated');
|
|
193
194
|
}).catch(this.logger.log);
|
|
194
195
|
}
|
|
195
196
|
async subscribeStakingReward(address) {
|
|
@@ -208,6 +209,7 @@ class KoniSubscription {
|
|
|
208
209
|
});
|
|
209
210
|
const result = await (0, _staking.getNominationStakingRewardData)(addresses, targetNetworkMap);
|
|
210
211
|
this.state.updateStakingReward(result, 'slowInterval');
|
|
212
|
+
this.logger.log('Set staking reward state done', result);
|
|
211
213
|
}
|
|
212
214
|
async subscribeStakingRewardFastInterval(address) {
|
|
213
215
|
const addresses = this.state.getDecodedAddresses(address);
|
|
@@ -237,21 +239,15 @@ class KoniSubscription {
|
|
|
237
239
|
const [poolingStakingRewards, amplitudeUnclaimedStakingRewards] = await Promise.all([(0, _staking.getPoolingStakingRewardData)(pooledAddresses, targetChainMap, this.state.getSubstrateApiMap()), (0, _paraChain.getAmplitudeUnclaimedStakingReward)(this.state.getSubstrateApiMap(), addresses, chainInfoMap, activeNetworks)]);
|
|
238
240
|
const result = [...poolingStakingRewards, ...amplitudeUnclaimedStakingRewards];
|
|
239
241
|
this.state.updateStakingReward(result, 'fastInterval');
|
|
242
|
+
this.logger.log('Set staking reward state with fast interval done', result);
|
|
240
243
|
}
|
|
241
244
|
async fetchChainStakingMetadata(chainInfoMap, chainStateMap, substrateApiMap) {
|
|
242
|
-
|
|
243
|
-
Object.values(chainInfoMap).forEach(chainInfo => {
|
|
245
|
+
await Promise.all(Object.values(chainInfoMap).map(async chainInfo => {
|
|
244
246
|
const chainState = chainStateMap[chainInfo.slug];
|
|
245
247
|
if (chainState !== null && chainState !== void 0 && chainState.active && (0, _utils._isChainSupportSubstrateStaking)(chainInfo)) {
|
|
246
|
-
|
|
248
|
+
const chainStakingMetadata = await (0, _bonding.getChainStakingMetadata)(chainInfo.slug, substrateApiMap[chainInfo.slug]);
|
|
249
|
+
this.state.updateChainStakingMetadata(chainStakingMetadata);
|
|
247
250
|
}
|
|
248
|
-
});
|
|
249
|
-
if (Object.values(filteredChainInfoMap).length === 0) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
await Promise.all(Object.values(filteredChainInfoMap).map(async chainInfo => {
|
|
253
|
-
const chainStakingMetadata = await (0, _bonding.getChainStakingMetadata)(chainInfo, substrateApiMap[chainInfo.slug]);
|
|
254
|
-
this.state.updateChainStakingMetadata(chainStakingMetadata);
|
|
255
251
|
}));
|
|
256
252
|
}
|
|
257
253
|
async fetchNominatorMetadata(currentAddress, chainInfoMap, chainStateMap, substrateApiMap) {
|
|
@@ -266,7 +262,8 @@ class KoniSubscription {
|
|
|
266
262
|
if (currentAddress === _constants.ALL_ACCOUNT_KEY) {
|
|
267
263
|
addresses = await this.state.getStakingOwnersByChains(Object.keys(filteredChainInfoMap));
|
|
268
264
|
}
|
|
269
|
-
|
|
265
|
+
const validAddresses = addresses.filter(address => !(0, _utilCrypto.isEthereumAddress)(address));
|
|
266
|
+
await Promise.all(validAddresses.map(async address => {
|
|
270
267
|
const isEvmAddress = (0, _utilCrypto.isEthereumAddress)(address);
|
|
271
268
|
await Promise.all(Object.values(filteredChainInfoMap).map(async chainInfo => {
|
|
272
269
|
if (isEvmAddress && !(0, _utils._isChainEvmCompatible)(chainInfo)) {
|
package/cjs/packageInfo.js
CHANGED
|
@@ -7,7 +7,6 @@ exports.SubstrateChainHandler = exports.DEFAULT_AUX = void 0;
|
|
|
7
7
|
var _api = require("@acala-network/api");
|
|
8
8
|
var _types = require("@oak-foundation/types");
|
|
9
9
|
var _types2 = require("@subwallet/chain-list/types");
|
|
10
|
-
var _utils = require("@subwallet/extension-base/koni/api/tokens/wasm/utils");
|
|
11
10
|
var _lightClient = require("@subwallet/extension-base/services/chain-service/handler/light-client");
|
|
12
11
|
var _api2 = require("@polkadot/api");
|
|
13
12
|
var _apiContract = require("@polkadot/api-contract");
|
|
@@ -95,13 +94,13 @@ class SubstrateChainHandler {
|
|
|
95
94
|
if (tokenType === _types2._AssetType.PSP22) {
|
|
96
95
|
tokenContract = new _apiContract.ContractPromise(substrateApi.api, _helper._PSP22_ABI, contractAddress);
|
|
97
96
|
const [nameResp, symbolResp, decimalsResp] = await Promise.all([tokenContract.query['psp22Metadata::tokenName'](contractCaller || contractAddress, {
|
|
98
|
-
gasLimit:
|
|
97
|
+
gasLimit: -1
|
|
99
98
|
}),
|
|
100
99
|
// read-only operation so no gas limit
|
|
101
100
|
tokenContract.query['psp22Metadata::tokenSymbol'](contractCaller || contractAddress, {
|
|
102
|
-
gasLimit:
|
|
101
|
+
gasLimit: -1
|
|
103
102
|
}), tokenContract.query['psp22Metadata::tokenDecimals'](contractCaller || contractAddress, {
|
|
104
|
-
gasLimit:
|
|
103
|
+
gasLimit: -1
|
|
105
104
|
})]);
|
|
106
105
|
if (!(nameResp.result.isOk && symbolResp.result.isOk && decimalsResp.result.isOk) || !nameResp.output || !decimalsResp.output || !symbolResp.output) {
|
|
107
106
|
this.logger.error('Error response while validating WASM contract');
|
|
@@ -112,22 +111,18 @@ class SubstrateChainHandler {
|
|
|
112
111
|
contractError: true
|
|
113
112
|
};
|
|
114
113
|
} else {
|
|
115
|
-
var _symbolResp$output, _decimalsResp$output,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
name = nameResp.output ? nameObj.Ok || nameObj.ok : '';
|
|
120
|
-
decimals = decimalsResp.output ? new _util.BN(decimalsObj.Ok || decimalsObj.ok).toNumber() : 0;
|
|
121
|
-
symbol = decimalsResp.output ? symbolObj.Ok || symbolObj.ok : '';
|
|
114
|
+
var _symbolResp$output, _decimalsResp$output, _symbolResp$output2;
|
|
115
|
+
name = (_symbolResp$output = symbolResp.output) === null || _symbolResp$output === void 0 ? void 0 : _symbolResp$output.toHuman();
|
|
116
|
+
decimals = parseInt((_decimalsResp$output = decimalsResp.output) === null || _decimalsResp$output === void 0 ? void 0 : _decimalsResp$output.toHuman());
|
|
117
|
+
symbol = (_symbolResp$output2 = symbolResp.output) === null || _symbolResp$output2 === void 0 ? void 0 : _symbolResp$output2.toHuman();
|
|
122
118
|
if (name === '' || symbol === '') {
|
|
123
119
|
contractError = true;
|
|
124
120
|
}
|
|
125
|
-
console.log('validate PSP22', name, symbol, decimals);
|
|
126
121
|
}
|
|
127
122
|
} else {
|
|
128
123
|
tokenContract = new _apiContract.ContractPromise(substrateApi.api, _helper._PSP34_ABI, contractAddress);
|
|
129
124
|
const collectionIdResp = await tokenContract.query['psp34::collectionId'](contractCaller || contractAddress, {
|
|
130
|
-
gasLimit:
|
|
125
|
+
gasLimit: -1
|
|
131
126
|
}); // read-only operation so no gas limit
|
|
132
127
|
|
|
133
128
|
if (!collectionIdResp.result.isOk || !collectionIdResp.output) {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ProviderPlaceholder = void 0;
|
|
7
6
|
exports.getSubstrateConnectProvider = getSubstrateConnectProvider;
|
|
8
7
|
exports.relayChainSpecs = exports.paraChainSpecs = void 0;
|
|
9
8
|
var _rpcProvider = require("@polkadot/rpc-provider");
|
|
@@ -104,7 +103,6 @@ class ProviderPlaceholder {
|
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
|
-
exports.ProviderPlaceholder = ProviderPlaceholder;
|
|
108
106
|
function getSubstrateConnectProvider(specLink) {
|
|
109
107
|
const [relayName, paraName] = specLink.split('/');
|
|
110
108
|
const relaySpec = relayChainSpecs[relayName];
|