@subwallet/extension-base 1.2.32-0 → 1.2.33-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 +78 -227
- package/background/KoniTypes.js +3 -40
- package/background/errors/SWError.d.ts +4 -7
- package/background/errors/SWError.js +4 -0
- package/background/errors/TransactionError.d.ts +2 -2
- package/background/errors/TransactionError.js +2 -4
- package/background/handlers/State.d.ts +0 -12
- package/background/types.d.ts +9 -134
- package/background/warnings/TransactionWarning.d.ts +1 -1
- package/background/warnings/TransactionWarning.js +5 -1
- package/cjs/background/KoniTypes.js +4 -44
- package/cjs/background/errors/SWError.js +4 -0
- package/cjs/background/errors/TransactionError.js +13 -15
- package/cjs/background/warnings/TransactionWarning.js +6 -2
- package/cjs/constants/environment.js +13 -0
- package/cjs/constants/index.js +40 -13
- package/cjs/constants/signing.js +23 -0
- package/cjs/constants/storage.js +4 -2
- package/cjs/core/consts.js +20 -0
- package/cjs/core/logic-validation/recipientAddress.js +106 -0
- package/cjs/core/logic-validation/request.js +11 -19
- package/cjs/core/logic-validation/swap.js +5 -5
- package/cjs/core/logic-validation/transfer.js +83 -42
- package/cjs/core/types.js +26 -0
- package/cjs/core/utils.js +113 -0
- package/cjs/koni/api/dotsama/crowdloan.js +1 -1
- package/cjs/koni/api/nft/index.js +14 -5
- package/cjs/koni/api/staking/bonding/paraChain.js +8 -8
- package/cjs/koni/api/staking/bonding/relayChain.js +9 -9
- package/cjs/koni/api/staking/index.js +4 -1
- package/cjs/koni/background/cron.js +7 -7
- package/cjs/koni/background/handlers/Extension.js +510 -1446
- package/cjs/koni/background/handlers/State.js +61 -238
- package/cjs/koni/background/handlers/Tabs.js +143 -107
- package/cjs/koni/background/subscription.js +5 -5
- package/cjs/packageInfo.js +1 -1
- package/cjs/page/Accounts.js +2 -5
- package/cjs/page/SubWalleEvmProvider.js +1 -1
- package/cjs/page/index.js +2 -1
- package/cjs/services/balance-service/BalanceMapImpl.js +48 -20
- package/cjs/services/balance-service/helpers/subscribe/index.js +27 -12
- package/cjs/services/balance-service/helpers/subscribe/ton/consts.js +40 -0
- package/cjs/services/balance-service/helpers/subscribe/ton/ton.js +120 -0
- package/cjs/services/balance-service/helpers/subscribe/ton/utils.js +181 -0
- package/cjs/services/balance-service/index.js +25 -13
- package/cjs/services/balance-service/transfer/token.js +41 -24
- package/cjs/services/balance-service/transfer/ton-transfer.js +136 -0
- package/cjs/services/buy-service/index.js +5 -1
- package/cjs/services/chain-service/constants.js +1 -1
- package/cjs/services/chain-service/handler/TonApi.js +213 -0
- package/cjs/services/chain-service/handler/TonChainHandler.js +81 -0
- package/cjs/services/chain-service/index.js +32 -8
- package/cjs/services/chain-service/utils/index.js +78 -22
- package/cjs/services/earning-service/constants/chains.js +3 -1
- package/cjs/services/earning-service/handlers/base.js +2 -1
- package/cjs/services/earning-service/handlers/lending/base.js +8 -9
- package/cjs/services/earning-service/handlers/lending/interlay.js +1 -1
- package/cjs/services/earning-service/handlers/liquid-staking/base.js +9 -10
- package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +1 -1
- package/cjs/services/earning-service/handlers/native-staking/amplitude.js +1 -1
- package/cjs/services/earning-service/handlers/native-staking/astar.js +2 -2
- package/cjs/services/earning-service/handlers/native-staking/base-para.js +13 -13
- package/cjs/services/earning-service/handlers/native-staking/base.js +2 -2
- package/cjs/services/earning-service/handlers/native-staking/para-chain.js +2 -2
- package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +15 -15
- package/cjs/services/earning-service/handlers/nomination-pool/index.js +14 -14
- package/cjs/services/earning-service/handlers/special.js +10 -10
- package/cjs/services/earning-service/service.js +26 -17
- package/cjs/services/history-service/helpers/subscan-extrinsic-parser-helper.js +1 -1
- package/cjs/services/history-service/index.js +29 -11
- package/cjs/services/history-service/subscan-history.js +9 -21
- package/cjs/services/keyring-service/context/account-context.js +259 -0
- package/cjs/services/keyring-service/context/handlers/Base.js +20 -0
- package/cjs/services/keyring-service/context/handlers/Derive.js +377 -0
- package/cjs/services/keyring-service/context/handlers/Inject.js +75 -0
- package/cjs/services/keyring-service/context/handlers/Json.js +348 -0
- package/cjs/services/keyring-service/context/handlers/Ledger.js +165 -0
- package/cjs/services/keyring-service/context/handlers/Mnemonic.js +218 -0
- package/cjs/services/keyring-service/context/handlers/Modify.js +258 -0
- package/cjs/services/keyring-service/context/handlers/Secret.js +310 -0
- package/cjs/services/keyring-service/context/handlers/index.js +82 -0
- package/cjs/services/keyring-service/context/state.js +649 -0
- package/cjs/services/keyring-service/context/stores/AccountProxy.js +32 -0
- package/cjs/services/keyring-service/context/stores/Base.js +37 -0
- package/cjs/services/keyring-service/context/stores/CurrentAccount.js +28 -0
- package/cjs/services/keyring-service/context/stores/ModifyPair.js +19 -0
- package/cjs/services/keyring-service/context/stores/index.js +38 -0
- package/cjs/services/keyring-service/index.js +20 -164
- package/cjs/services/migration-service/scripts/index.js +6 -4
- package/cjs/services/migration-service/scripts/{MigrateLedgerAccountV2.js → keyring/MigrateLedgerAccountV2.js} +1 -1
- package/cjs/services/migration-service/scripts/keyring/MigratePairData.js +28 -0
- package/cjs/services/migration-service/scripts/{MigrateRemoveGenesisHash.js → keyring/MigrateRemoveGenesisHash.js} +1 -1
- package/cjs/services/request-service/constants.js +5 -3
- package/cjs/services/request-service/handler/AuthRequestHandler.js +104 -57
- package/cjs/services/request-service/handler/EvmRequestHandler.js +3 -4
- package/cjs/services/request-service/handler/SubstrateRequestHandler.js +5 -11
- package/cjs/services/request-service/handler/TonRequestHandler.js +175 -0
- package/cjs/services/request-service/index.js +24 -5
- package/cjs/services/swap-service/handler/asset-hub/handler.js +6 -5
- package/cjs/services/swap-service/handler/base-handler.js +8 -8
- package/cjs/services/swap-service/handler/chainflip-handler.js +5 -4
- package/cjs/services/swap-service/handler/hydradx-handler.js +4 -3
- package/cjs/services/swap-service/index.js +4 -4
- package/cjs/services/transaction-service/helpers/index.js +6 -1
- package/cjs/services/transaction-service/index.js +184 -84
- package/cjs/services/wallet-connect-service/handler/PolkadotRequestHandler.js +2 -10
- package/cjs/stores/AccountProxyStore.js +18 -0
- package/cjs/stores/ModifyPairStore.js +18 -0
- package/cjs/stores/index.js +23 -2
- package/cjs/types/account/action/add/index.js +38 -0
- package/cjs/types/account/action/add/json.js +1 -0
- package/cjs/types/account/action/add/mnemonic.js +1 -0
- package/cjs/types/account/action/add/secret.js +1 -0
- package/cjs/types/account/action/derive.js +1 -0
- package/cjs/types/account/action/edit.js +1 -0
- package/cjs/types/account/action/export.js +1 -0
- package/cjs/types/account/action/index.js +71 -0
- package/cjs/types/account/action/subscribe.js +16 -0
- package/cjs/types/account/action/validate.js +1 -0
- package/cjs/types/account/error/common.js +40 -0
- package/cjs/types/account/error/derive.js +55 -0
- package/cjs/types/account/error/index.js +27 -0
- package/cjs/types/account/index.js +38 -0
- package/cjs/types/account/info/current.js +1 -0
- package/cjs/types/account/info/index.js +38 -0
- package/cjs/types/account/info/keyring.js +90 -0
- package/cjs/types/account/info/proxy.js +49 -0
- package/cjs/types/error.js +1 -0
- package/cjs/types/index.js +44 -0
- package/cjs/types/transaction/data.js +1 -0
- package/cjs/types/transaction/error.js +53 -0
- package/cjs/types/transaction/index.js +49 -0
- package/cjs/types/transaction/request.js +1 -0
- package/cjs/types/transaction/warning.js +14 -0
- package/cjs/types/yield/actions/join/validate.js +1 -16
- package/cjs/utils/account/analyze.js +166 -0
- package/cjs/utils/account/common.js +121 -0
- package/cjs/utils/account/derive/index.js +27 -0
- package/cjs/utils/account/derive/info/index.js +27 -0
- package/cjs/utils/account/derive/info/solo.js +246 -0
- package/cjs/utils/account/derive/info/unified.js +112 -0
- package/cjs/utils/account/derive/validate.js +177 -0
- package/cjs/utils/account/index.js +49 -0
- package/cjs/utils/account/transform.js +566 -0
- package/cjs/utils/auth.js +46 -0
- package/cjs/utils/getId.js +8 -1
- package/cjs/utils/index.js +48 -62
- package/constants/environment.d.ts +1 -0
- package/constants/environment.js +6 -0
- package/constants/index.d.ts +5 -1
- package/constants/index.js +5 -2
- package/constants/signing.d.ts +4 -0
- package/constants/signing.js +15 -0
- package/constants/storage.d.ts +1 -0
- package/constants/storage.js +2 -1
- package/core/consts.d.ts +1 -0
- package/core/consts.js +13 -0
- package/core/logic-validation/recipientAddress.d.ts +2 -0
- package/core/logic-validation/recipientAddress.js +100 -0
- package/core/logic-validation/request.js +10 -18
- package/core/logic-validation/swap.js +1 -1
- package/core/logic-validation/transfer.d.ts +3 -2
- package/core/logic-validation/transfer.js +50 -10
- package/core/types.d.ts +26 -0
- package/core/types.js +19 -0
- package/core/utils.d.ts +10 -0
- package/core/utils.js +105 -0
- package/koni/api/dotsama/crowdloan.js +1 -1
- package/koni/api/nft/index.js +14 -5
- package/koni/api/staking/bonding/paraChain.js +2 -2
- package/koni/api/staking/bonding/relayChain.js +2 -2
- package/koni/api/staking/index.js +4 -1
- package/koni/background/cron.js +7 -7
- package/koni/background/handlers/Extension.d.ts +26 -35
- package/koni/background/handlers/Extension.js +337 -1242
- package/koni/background/handlers/State.d.ts +12 -19
- package/koni/background/handlers/State.js +57 -231
- package/koni/background/handlers/Tabs.d.ts +2 -3
- package/koni/background/handlers/Tabs.js +105 -61
- package/koni/background/subscription.js +5 -5
- package/package.json +352 -53
- package/packageInfo.js +1 -1
- package/page/Accounts.js +2 -5
- package/page/SubWalleEvmProvider.js +1 -1
- package/page/index.js +2 -1
- package/services/balance-service/BalanceMapImpl.d.ts +6 -4
- package/services/balance-service/BalanceMapImpl.js +44 -18
- package/services/balance-service/helpers/subscribe/index.d.ts +3 -4
- package/services/balance-service/helpers/subscribe/index.js +29 -14
- package/services/balance-service/helpers/subscribe/ton/consts.d.ts +18 -0
- package/services/balance-service/helpers/subscribe/ton/consts.js +28 -0
- package/services/balance-service/helpers/subscribe/ton/ton.d.ts +3 -0
- package/services/balance-service/helpers/subscribe/ton/ton.js +111 -0
- package/services/balance-service/helpers/subscribe/ton/types.d.ts +26 -0
- package/services/balance-service/helpers/subscribe/ton/utils.d.ts +32 -0
- package/services/balance-service/helpers/subscribe/ton/utils.js +159 -0
- package/services/balance-service/index.js +25 -13
- package/services/balance-service/transfer/token.d.ts +2 -2
- package/services/balance-service/transfer/token.js +18 -1
- package/services/balance-service/transfer/ton-transfer.d.ts +25 -0
- package/services/balance-service/transfer/ton-transfer.js +127 -0
- package/services/buy-service/index.js +5 -1
- package/services/buy-service/types.d.ts +2 -2
- package/services/chain-service/constants.js +1 -1
- package/services/chain-service/handler/TonApi.d.ts +52 -0
- package/services/chain-service/handler/TonApi.js +204 -0
- package/services/chain-service/handler/TonChainHandler.d.ts +17 -0
- package/services/chain-service/handler/TonChainHandler.js +73 -0
- package/services/chain-service/index.d.ts +5 -1
- package/services/chain-service/index.js +32 -8
- package/services/chain-service/types.d.ts +24 -0
- package/services/chain-service/utils/index.d.ts +10 -2
- package/services/chain-service/utils/index.js +59 -18
- package/services/earning-service/constants/chains.d.ts +1 -0
- package/services/earning-service/constants/chains.js +1 -0
- package/services/earning-service/handlers/base.js +3 -2
- package/services/earning-service/handlers/lending/base.js +1 -2
- package/services/earning-service/handlers/lending/interlay.js +2 -2
- package/services/earning-service/handlers/liquid-staking/base.js +1 -2
- package/services/earning-service/handlers/liquid-staking/stella-swap.js +2 -2
- package/services/earning-service/handlers/native-staking/amplitude.js +2 -2
- package/services/earning-service/handlers/native-staking/astar.js +2 -2
- package/services/earning-service/handlers/native-staking/base-para.js +2 -2
- package/services/earning-service/handlers/native-staking/base.js +2 -2
- package/services/earning-service/handlers/native-staking/para-chain.js +2 -2
- package/services/earning-service/handlers/native-staking/relay-chain.js +2 -2
- package/services/earning-service/handlers/nomination-pool/index.js +2 -2
- package/services/earning-service/handlers/special.js +2 -2
- package/services/earning-service/service.js +18 -9
- package/services/event-service/types.d.ts +3 -1
- package/services/history-service/helpers/subscan-extrinsic-parser-helper.js +1 -1
- package/services/history-service/index.d.ts +4 -1
- package/services/history-service/index.js +29 -11
- package/services/history-service/subscan-history.js +8 -20
- package/services/keyring-service/context/account-context.d.ts +87 -0
- package/services/keyring-service/context/account-context.js +250 -0
- package/services/keyring-service/context/handlers/Base.d.ts +11 -0
- package/services/keyring-service/context/handlers/Base.js +13 -0
- package/services/keyring-service/context/handlers/Derive.d.ts +29 -0
- package/services/keyring-service/context/handlers/Derive.js +365 -0
- package/services/keyring-service/context/handlers/Inject.d.ts +11 -0
- package/services/keyring-service/context/handlers/Inject.js +69 -0
- package/services/keyring-service/context/handlers/Json.d.ts +18 -0
- package/services/keyring-service/context/handlers/Json.js +328 -0
- package/services/keyring-service/context/handlers/Ledger.d.ts +11 -0
- package/services/keyring-service/context/handlers/Ledger.js +158 -0
- package/services/keyring-service/context/handlers/Mnemonic.d.ts +15 -0
- package/services/keyring-service/context/handlers/Mnemonic.js +206 -0
- package/services/keyring-service/context/handlers/Modify.d.ts +16 -0
- package/services/keyring-service/context/handlers/Modify.js +250 -0
- package/services/keyring-service/context/handlers/Secret.d.ts +16 -0
- package/services/keyring-service/context/handlers/Secret.js +299 -0
- package/services/keyring-service/context/handlers/index.d.ts +7 -0
- package/services/keyring-service/context/handlers/index.js +10 -0
- package/services/keyring-service/context/state.d.ts +92 -0
- package/services/keyring-service/context/state.js +629 -0
- package/services/keyring-service/context/stores/AccountProxy.d.ts +13 -0
- package/services/keyring-service/context/stores/AccountProxy.js +25 -0
- package/services/keyring-service/context/stores/Base.d.ts +22 -0
- package/services/keyring-service/context/stores/Base.js +30 -0
- package/services/keyring-service/context/stores/CurrentAccount.d.ts +15 -0
- package/services/keyring-service/context/stores/CurrentAccount.js +21 -0
- package/services/keyring-service/context/stores/ModifyPair.d.ts +10 -0
- package/services/keyring-service/context/stores/ModifyPair.js +12 -0
- package/services/keyring-service/context/stores/index.d.ts +3 -0
- package/services/keyring-service/context/stores/index.js +6 -0
- package/services/keyring-service/index.d.ts +10 -22
- package/services/keyring-service/index.js +20 -161
- package/services/migration-service/scripts/index.js +6 -4
- package/services/migration-service/scripts/{MigrateLedgerAccountV2.d.ts → keyring/MigrateLedgerAccountV2.d.ts} +1 -1
- package/services/migration-service/scripts/{MigrateLedgerAccountV2.js → keyring/MigrateLedgerAccountV2.js} +1 -1
- package/services/migration-service/scripts/keyring/MigratePairData.d.ts +4 -0
- package/services/migration-service/scripts/keyring/MigratePairData.js +20 -0
- package/services/migration-service/scripts/{MigrateRemoveGenesisHash.js → keyring/MigrateRemoveGenesisHash.js} +1 -1
- package/services/request-service/constants.d.ts +1 -1
- package/services/request-service/constants.js +2 -1
- package/services/request-service/handler/AuthRequestHandler.d.ts +1 -0
- package/services/request-service/handler/AuthRequestHandler.js +93 -45
- package/services/request-service/handler/EvmRequestHandler.js +3 -4
- package/services/request-service/handler/SubstrateRequestHandler.d.ts +2 -2
- package/services/request-service/handler/SubstrateRequestHandler.js +5 -11
- package/services/request-service/handler/TonRequestHandler.d.ts +17 -0
- package/services/request-service/handler/TonRequestHandler.js +168 -0
- package/services/request-service/index.d.ts +8 -3
- package/services/request-service/index.js +23 -5
- package/services/request-service/types.d.ts +6 -3
- package/services/swap-service/handler/asset-hub/handler.d.ts +1 -1
- package/services/swap-service/handler/asset-hub/handler.js +2 -1
- package/services/swap-service/handler/base-handler.js +1 -1
- package/services/swap-service/handler/chainflip-handler.d.ts +1 -1
- package/services/swap-service/handler/chainflip-handler.js +4 -3
- package/services/swap-service/handler/hydradx-handler.d.ts +1 -1
- package/services/swap-service/handler/hydradx-handler.js +2 -1
- package/services/swap-service/index.js +1 -1
- package/services/transaction-service/helpers/index.d.ts +2 -0
- package/services/transaction-service/helpers/index.js +4 -0
- package/services/transaction-service/index.d.ts +1 -0
- package/services/transaction-service/index.js +114 -17
- package/services/transaction-service/types.d.ts +4 -2
- package/services/wallet-connect-service/handler/PolkadotRequestHandler.js +2 -10
- package/stores/AccountProxyStore.d.ts +5 -0
- package/stores/AccountProxyStore.js +10 -0
- package/stores/Authorize.d.ts +1 -1
- package/stores/CurrentAccountStore.d.ts +1 -1
- package/stores/ModifyPairStore.d.ts +5 -0
- package/stores/ModifyPairStore.js +10 -0
- package/stores/index.d.ts +4 -1
- package/stores/index.js +5 -2
- package/types/account/action/add/index.d.ts +3 -0
- package/types/account/action/add/index.js +6 -0
- package/types/account/action/add/json.d.ts +29 -0
- package/types/account/action/add/json.js +1 -0
- package/types/account/action/add/mnemonic.d.ts +77 -0
- package/types/account/action/add/mnemonic.js +1 -0
- package/types/account/action/add/secret.d.ts +55 -0
- package/types/account/action/add/secret.js +1 -0
- package/types/account/action/derive.d.ts +77 -0
- package/types/account/action/derive.js +1 -0
- package/types/account/action/edit.d.ts +31 -0
- package/types/account/action/edit.js +1 -0
- package/types/account/action/export.d.ts +15 -0
- package/types/account/action/export.js +1 -0
- package/types/account/action/index.d.ts +6 -0
- package/types/account/action/index.js +9 -0
- package/types/account/action/subscribe.d.ts +22 -0
- package/types/account/action/subscribe.js +10 -0
- package/types/account/action/validate.d.ts +17 -0
- package/types/account/action/validate.js +1 -0
- package/types/account/error/common.d.ts +10 -0
- package/types/account/error/common.js +33 -0
- package/types/account/error/derive.d.ts +13 -0
- package/types/account/error/derive.js +48 -0
- package/types/account/error/index.d.ts +2 -0
- package/types/account/error/index.js +5 -0
- package/types/account/index.d.ts +3 -0
- package/types/account/index.js +6 -0
- package/types/account/info/current.d.ts +10 -0
- package/types/account/info/current.js +1 -0
- package/types/account/info/index.d.ts +3 -0
- package/types/account/info/index.js +6 -0
- package/types/account/info/keyring.d.ts +161 -0
- package/types/account/info/keyring.js +88 -0
- package/types/account/info/proxy.d.ts +73 -0
- package/types/account/info/proxy.js +46 -0
- package/types/balance/index.d.ts +4 -1
- package/types/buy.d.ts +3 -1
- package/types/error.d.ts +8 -0
- package/types/error.js +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.js +5 -1
- package/types/transaction/data.d.ts +17 -0
- package/types/transaction/data.js +1 -0
- package/types/transaction/error.d.ts +39 -0
- package/types/transaction/error.js +44 -0
- package/types/transaction/index.d.ts +4 -0
- package/types/transaction/index.js +7 -0
- package/types/transaction/request.d.ts +24 -0
- package/types/transaction/request.js +1 -0
- package/types/transaction/warning.d.ts +5 -0
- package/types/transaction/warning.js +8 -0
- package/types/yield/actions/join/submit.d.ts +2 -2
- package/types/yield/actions/join/validate.d.ts +1 -6
- package/types/yield/actions/join/validate.js +1 -10
- package/types/yield/actions/others.d.ts +1 -1
- package/utils/account/analyze.d.ts +4 -0
- package/utils/account/analyze.js +159 -0
- package/utils/account/common.d.ts +16 -0
- package/utils/account/common.js +104 -0
- package/utils/account/derive/index.d.ts +2 -0
- package/utils/account/derive/index.js +5 -0
- package/utils/account/derive/info/index.d.ts +2 -0
- package/utils/account/derive/info/index.js +5 -0
- package/utils/account/derive/info/solo.d.ts +11 -0
- package/utils/account/derive/info/solo.js +230 -0
- package/utils/account/derive/info/unified.d.ts +7 -0
- package/utils/account/derive/info/unified.js +102 -0
- package/utils/account/derive/validate.d.ts +8 -0
- package/utils/account/derive/validate.js +165 -0
- package/utils/account/index.d.ts +4 -0
- package/utils/account/index.js +7 -0
- package/utils/account/transform.d.ts +41 -0
- package/utils/account/transform.js +533 -0
- package/utils/auth.d.ts +2 -0
- package/utils/auth.js +39 -0
- package/utils/canDerive.d.ts +1 -1
- package/utils/eth/mergeTransactionAndSignature.d.ts +1 -1
- package/utils/getId.d.ts +1 -0
- package/utils/getId.js +3 -1
- package/utils/index.d.ts +12 -5
- package/utils/index.js +28 -47
- package/cjs/signers/substrates/KeyringSigner.js +0 -35
- package/cjs/signers/substrates/LedgerSigner.js +0 -44
- package/cjs/signers/substrates/QrSigner.js +0 -63
- package/cjs/signers/types.js +0 -15
- package/cjs/signers/web3/QrSigner.js +0 -67
- package/cjs/utils/account.js +0 -34
- package/signers/substrates/KeyringSigner.d.ts +0 -13
- package/signers/substrates/KeyringSigner.js +0 -27
- package/signers/substrates/LedgerSigner.d.ts +0 -13
- package/signers/substrates/LedgerSigner.js +0 -37
- package/signers/substrates/QrSigner.d.ts +0 -20
- package/signers/substrates/QrSigner.js +0 -55
- package/signers/types.d.ts +0 -34
- package/signers/types.js +0 -9
- package/signers/web3/QrSigner.d.ts +0 -18
- package/signers/web3/QrSigner.js +0 -59
- package/types/transaction.d.ts +0 -3
- package/utils/account.d.ts +0 -5
- package/utils/account.js +0 -24
- /package/cjs/{types/transaction.js → services/balance-service/helpers/subscribe/ton/types.js} +0 -0
- /package/cjs/services/migration-service/scripts/{MigrateLedgerAccount.js → keyring/MigrateLedgerAccount.js} +0 -0
- /package/{types/transaction.js → services/balance-service/helpers/subscribe/ton/types.js} +0 -0
- /package/services/migration-service/scripts/{MigrateLedgerAccount.d.ts → keyring/MigrateLedgerAccount.d.ts} +0 -0
- /package/services/migration-service/scripts/{MigrateLedgerAccount.js → keyring/MigrateLedgerAccount.js} +0 -0
- /package/services/migration-service/scripts/{MigrateRemoveGenesisHash.d.ts → keyring/MigrateRemoveGenesisHash.d.ts} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { AbstractChainHandler } from '@subwallet/extension-base/services/chain-service/handler/AbstractChainHandler';
|
|
5
|
+
import { TonApi } from '@subwallet/extension-base/services/chain-service/handler/TonApi';
|
|
6
|
+
export class TonChainHandler extends AbstractChainHandler {
|
|
7
|
+
tonApiMap = {};
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line no-useless-constructor
|
|
10
|
+
constructor(parent) {
|
|
11
|
+
super(parent);
|
|
12
|
+
}
|
|
13
|
+
getTonApiMap() {
|
|
14
|
+
return this.tonApiMap;
|
|
15
|
+
}
|
|
16
|
+
getTonApiByChain(chain) {
|
|
17
|
+
return this.tonApiMap[chain];
|
|
18
|
+
}
|
|
19
|
+
getApiByChain(chain) {
|
|
20
|
+
return this.getTonApiByChain(chain);
|
|
21
|
+
}
|
|
22
|
+
setTonApi(chain, tonApi) {
|
|
23
|
+
this.tonApiMap[chain] = tonApi;
|
|
24
|
+
}
|
|
25
|
+
async initApi(chainSlug, apiUrl, {
|
|
26
|
+
onUpdateStatus,
|
|
27
|
+
providerName
|
|
28
|
+
} = {}) {
|
|
29
|
+
const existed = this.getTonApiByChain(chainSlug);
|
|
30
|
+
if (existed) {
|
|
31
|
+
existed.connect();
|
|
32
|
+
if (apiUrl !== existed.apiUrl) {
|
|
33
|
+
existed.updateApiUrl(apiUrl).catch(console.error);
|
|
34
|
+
}
|
|
35
|
+
return existed;
|
|
36
|
+
}
|
|
37
|
+
const apiObject = new TonApi(chainSlug, apiUrl, {
|
|
38
|
+
providerName
|
|
39
|
+
});
|
|
40
|
+
apiObject.connectionStatusSubject.subscribe(this.handleConnection.bind(this, chainSlug));
|
|
41
|
+
apiObject.connectionStatusSubject.subscribe(onUpdateStatus);
|
|
42
|
+
return Promise.resolve(apiObject);
|
|
43
|
+
}
|
|
44
|
+
async recoverApi(chain) {
|
|
45
|
+
const existed = this.getTonApiByChain(chain);
|
|
46
|
+
if (existed && !existed.isApiReadyOnce) {
|
|
47
|
+
console.log(`Reconnect ${existed.providerName || existed.chainSlug} at ${existed.apiUrl}`);
|
|
48
|
+
return existed.recoverConnect();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
destroyTonApi(chain) {
|
|
52
|
+
const tonApi = this.getTonApiByChain(chain);
|
|
53
|
+
tonApi === null || tonApi === void 0 ? void 0 : tonApi.destroy().catch(console.error);
|
|
54
|
+
}
|
|
55
|
+
async sleep() {
|
|
56
|
+
this.isSleeping = true;
|
|
57
|
+
this.cancelAllRecover();
|
|
58
|
+
await Promise.all(Object.values(this.getTonApiMap()).map(tonApi => {
|
|
59
|
+
return tonApi.disconnect().catch(console.error);
|
|
60
|
+
}));
|
|
61
|
+
return Promise.resolve();
|
|
62
|
+
}
|
|
63
|
+
wakeUp() {
|
|
64
|
+
var _this$parent;
|
|
65
|
+
this.isSleeping = false;
|
|
66
|
+
const activeChains = ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.getActiveChains()) || [];
|
|
67
|
+
for (const chain of activeChains) {
|
|
68
|
+
const tonApi = this.getTonApiByChain(chain);
|
|
69
|
+
tonApi === null || tonApi === void 0 ? void 0 : tonApi.connect();
|
|
70
|
+
}
|
|
71
|
+
return Promise.resolve();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -15,6 +15,7 @@ export declare class ChainService {
|
|
|
15
15
|
private lockChainInfoMap;
|
|
16
16
|
private substrateChainHandler;
|
|
17
17
|
private evmChainHandler;
|
|
18
|
+
private tonChainHandler;
|
|
18
19
|
private mantaChainHandler;
|
|
19
20
|
refreshLatestChainDataTimeOut: NodeJS.Timer | undefined;
|
|
20
21
|
get mantaPay(): MantaPrivateHandler | undefined;
|
|
@@ -45,8 +46,10 @@ export declare class ChainService {
|
|
|
45
46
|
get swapRefMap(): Record<string, _AssetRef>;
|
|
46
47
|
getEvmApi(slug: string): import("./handler/EvmApi").EvmApi;
|
|
47
48
|
getEvmApiMap(): Record<string, import("./handler/EvmApi").EvmApi>;
|
|
48
|
-
getSubstrateApiMap(): Record<string, _SubstrateApi>;
|
|
49
49
|
getSubstrateApi(slug: string): _SubstrateApi;
|
|
50
|
+
getSubstrateApiMap(): Record<string, _SubstrateApi>;
|
|
51
|
+
getTonApi(slug: string): import("./handler/TonApi").TonApi;
|
|
52
|
+
getTonApiMap(): Record<string, import("./handler/TonApi").TonApi>;
|
|
50
53
|
getChainCurrentProviderByKey(slug: string): {
|
|
51
54
|
endpoint: string;
|
|
52
55
|
providerName: string;
|
|
@@ -133,6 +136,7 @@ export declare class ChainService {
|
|
|
133
136
|
private generateSlugForNativeToken;
|
|
134
137
|
refreshSubstrateApi(slug: string): void;
|
|
135
138
|
refreshEvmApi(slug: string): void;
|
|
139
|
+
refreshTonApi(slug: string): void;
|
|
136
140
|
stopAllChainApis(): Promise<void>;
|
|
137
141
|
resumeAllChainApis(): Promise<void>;
|
|
138
142
|
initAssetSettings(): Promise<void>;
|
|
@@ -7,6 +7,7 @@ import { _DEFAULT_ACTIVE_CHAINS, _ZK_ASSET_PREFIX, LATEST_CHAIN_DATA_FETCHING_IN
|
|
|
7
7
|
import { EvmChainHandler } from '@subwallet/extension-base/services/chain-service/handler/EvmChainHandler';
|
|
8
8
|
import { MantaPrivateHandler } from '@subwallet/extension-base/services/chain-service/handler/manta/MantaPrivateHandler';
|
|
9
9
|
import { SubstrateChainHandler } from '@subwallet/extension-base/services/chain-service/handler/SubstrateChainHandler';
|
|
10
|
+
import { TonChainHandler } from '@subwallet/extension-base/services/chain-service/handler/TonChainHandler';
|
|
10
11
|
import { _CHAIN_VALIDATION_ERROR } from '@subwallet/extension-base/services/chain-service/handler/types';
|
|
11
12
|
import { _ChainConnectionStatus, _CUSTOM_PREFIX, _NFT_CONTRACT_STANDARDS, _SMART_CONTRACT_STANDARDS } from '@subwallet/extension-base/services/chain-service/types';
|
|
12
13
|
import { _isAssetAutoEnable, _isAssetCanPayTxFee, _isAssetFungibleToken, _isChainEnabled, _isCustomAsset, _isCustomChain, _isCustomProvider, _isEqualContractAddress, _isEqualSmartContractAsset, _isMantaZkAsset, _isPureEvmChain, _isPureSubstrateChain, _parseAssetRefKey, fetchPatchData, randomizeProvider, updateLatestChainInfo } from '@subwallet/extension-base/services/chain-service/utils';
|
|
@@ -18,7 +19,7 @@ import { logger as createLogger } from '@polkadot/util/logger';
|
|
|
18
19
|
const filterChainInfoMap = (data, ignoredChains) => {
|
|
19
20
|
return Object.fromEntries(Object.entries(data).filter(([slug, info]) => !info.bitcoinInfo && !ignoredChains.includes(slug)));
|
|
20
21
|
};
|
|
21
|
-
const ignoredList = ['bevm', 'bevmTest', 'bevm_testnet', 'layerEdge_testnet', 'merlinEvm', 'botanixEvmTest', 'syscoin_evm', 'syscoin_evm_testnet', 'rollux_evm', 'rollux_testnet', 'boolAlpha', 'boolBeta_testnet', 'core', 'satoshivm', 'satoshivm_testnet', '
|
|
22
|
+
const ignoredList = ['bevm', 'bevmTest', 'bevm_testnet', 'layerEdge_testnet', 'merlinEvm', 'botanixEvmTest', 'syscoin_evm', 'syscoin_evm_testnet', 'rollux_evm', 'rollux_testnet', 'boolAlpha', 'boolBeta_testnet', 'core', 'satoshivm', 'satoshivm_testnet', 'storyPartner_testnet'];
|
|
22
23
|
const filterAssetInfoMap = (chainInfo, assets) => {
|
|
23
24
|
return Object.fromEntries(Object.entries(assets).filter(([, info]) => chainInfo[info.originChain]));
|
|
24
25
|
};
|
|
@@ -83,6 +84,7 @@ export class ChainService {
|
|
|
83
84
|
}
|
|
84
85
|
this.substrateChainHandler = new SubstrateChainHandler(this);
|
|
85
86
|
this.evmChainHandler = new EvmChainHandler(this);
|
|
87
|
+
this.tonChainHandler = new TonChainHandler(this);
|
|
86
88
|
this.logger = createLogger('chain-service');
|
|
87
89
|
}
|
|
88
90
|
get value() {
|
|
@@ -130,11 +132,17 @@ export class ChainService {
|
|
|
130
132
|
getEvmApiMap() {
|
|
131
133
|
return this.evmChainHandler.getEvmApiMap();
|
|
132
134
|
}
|
|
135
|
+
getSubstrateApi(slug) {
|
|
136
|
+
return this.substrateChainHandler.getSubstrateApiByChain(slug);
|
|
137
|
+
}
|
|
133
138
|
getSubstrateApiMap() {
|
|
134
139
|
return this.substrateChainHandler.getSubstrateApiMap();
|
|
135
140
|
}
|
|
136
|
-
|
|
137
|
-
return this.
|
|
141
|
+
getTonApi(slug) {
|
|
142
|
+
return this.tonChainHandler.getTonApiByChain(slug);
|
|
143
|
+
}
|
|
144
|
+
getTonApiMap() {
|
|
145
|
+
return this.tonChainHandler.getTonApiMap();
|
|
138
146
|
}
|
|
139
147
|
getChainCurrentProviderByKey(slug) {
|
|
140
148
|
const providerName = this.getChainStateByKey(slug).currentProvider;
|
|
@@ -737,6 +745,13 @@ export class ChainService {
|
|
|
737
745
|
});
|
|
738
746
|
this.evmChainHandler.setEvmApi(chainInfo.slug, chainApi);
|
|
739
747
|
}
|
|
748
|
+
if (chainInfo.tonInfo !== null && chainInfo.tonInfo !== undefined) {
|
|
749
|
+
const chainApi = await this.tonChainHandler.initApi(chainInfo.slug, endpoint, {
|
|
750
|
+
providerName,
|
|
751
|
+
onUpdateStatus
|
|
752
|
+
});
|
|
753
|
+
this.tonChainHandler.setTonApi(chainInfo.slug, chainApi);
|
|
754
|
+
}
|
|
740
755
|
}
|
|
741
756
|
destroyApiForChain(chainInfo) {
|
|
742
757
|
if (chainInfo.substrateInfo !== null) {
|
|
@@ -745,6 +760,9 @@ export class ChainService {
|
|
|
745
760
|
if (chainInfo.evmInfo !== null) {
|
|
746
761
|
this.evmChainHandler.destroyEvmApi(chainInfo.slug);
|
|
747
762
|
}
|
|
763
|
+
if (chainInfo.tonInfo !== null) {
|
|
764
|
+
this.tonChainHandler.destroyTonApi(chainInfo.slug);
|
|
765
|
+
}
|
|
748
766
|
}
|
|
749
767
|
async enableChain(chainSlug) {
|
|
750
768
|
const chainInfo = this.getChainInfoByKey(chainSlug);
|
|
@@ -1010,7 +1028,7 @@ export class ChainService {
|
|
|
1010
1028
|
deprecatedChainMap[storedSlug] = duplicatedDefaultSlug;
|
|
1011
1029
|
deprecatedChains.push(storedSlug);
|
|
1012
1030
|
} else {
|
|
1013
|
-
var _storedChainInfo$bitc
|
|
1031
|
+
var _storedChainInfo$bitc;
|
|
1014
1032
|
mergedChainInfoMap[storedSlug] = {
|
|
1015
1033
|
slug: storedSlug,
|
|
1016
1034
|
name: storedChainInfo.name,
|
|
@@ -1019,7 +1037,7 @@ export class ChainService {
|
|
|
1019
1037
|
evmInfo: storedChainInfo.evmInfo,
|
|
1020
1038
|
substrateInfo: storedChainInfo.substrateInfo,
|
|
1021
1039
|
bitcoinInfo: (_storedChainInfo$bitc = storedChainInfo.bitcoinInfo) !== null && _storedChainInfo$bitc !== void 0 ? _storedChainInfo$bitc : null,
|
|
1022
|
-
tonInfo:
|
|
1040
|
+
tonInfo: storedChainInfo.tonInfo,
|
|
1023
1041
|
isTestnet: storedChainInfo.isTestnet,
|
|
1024
1042
|
chainStatus: storedChainInfo.chainStatus,
|
|
1025
1043
|
icon: storedChainInfo.icon,
|
|
@@ -1196,6 +1214,7 @@ export class ChainService {
|
|
|
1196
1214
|
const newChainSlug = this.generateSlugForCustomChain(params.chainEditInfo.chainType, params.chainEditInfo.name, params.chainSpec.paraId, params.chainSpec.evmChainId);
|
|
1197
1215
|
let substrateInfo = null;
|
|
1198
1216
|
let evmInfo = null;
|
|
1217
|
+
const tonInfo = null;
|
|
1199
1218
|
if (params.chainSpec.genesisHash !== '') {
|
|
1200
1219
|
substrateInfo = {
|
|
1201
1220
|
crowdloanFunds: params.chainSpec.crowdloanFunds || null,
|
|
@@ -1233,7 +1252,7 @@ export class ChainService {
|
|
|
1233
1252
|
substrateInfo,
|
|
1234
1253
|
evmInfo,
|
|
1235
1254
|
bitcoinInfo: null,
|
|
1236
|
-
tonInfo
|
|
1255
|
+
tonInfo,
|
|
1237
1256
|
isTestnet: false,
|
|
1238
1257
|
chainStatus: _ChainStatus.ACTIVE,
|
|
1239
1258
|
icon: '',
|
|
@@ -1344,6 +1363,8 @@ export class ChainService {
|
|
|
1344
1363
|
|
|
1345
1364
|
// TODO: EVM chain might have WS provider
|
|
1346
1365
|
if (provider.startsWith('http')) {
|
|
1366
|
+
// todo: handle validate ton provider
|
|
1367
|
+
|
|
1347
1368
|
// HTTP provider is EVM by default
|
|
1348
1369
|
api = await this.evmChainHandler.initApi('custom', provider);
|
|
1349
1370
|
} else {
|
|
@@ -1537,12 +1558,15 @@ export class ChainService {
|
|
|
1537
1558
|
refreshEvmApi(slug) {
|
|
1538
1559
|
this.evmChainHandler.recoverApi(slug).catch(console.error);
|
|
1539
1560
|
}
|
|
1561
|
+
refreshTonApi(slug) {
|
|
1562
|
+
this.tonChainHandler.recoverApi(slug).catch(console.error);
|
|
1563
|
+
}
|
|
1540
1564
|
async stopAllChainApis() {
|
|
1541
|
-
await Promise.all([this.substrateChainHandler.sleep(), this.evmChainHandler.sleep()]);
|
|
1565
|
+
await Promise.all([this.substrateChainHandler.sleep(), this.evmChainHandler.sleep(), this.tonChainHandler.sleep()]);
|
|
1542
1566
|
this.stopCheckLatestChainData();
|
|
1543
1567
|
}
|
|
1544
1568
|
async resumeAllChainApis() {
|
|
1545
|
-
await Promise.all([this.substrateChainHandler.wakeUp(), this.evmChainHandler.wakeUp()]);
|
|
1569
|
+
await Promise.all([this.substrateChainHandler.wakeUp(), this.evmChainHandler.wakeUp(), this.tonChainHandler.wakeUp()]);
|
|
1546
1570
|
this.checkLatestData();
|
|
1547
1571
|
}
|
|
1548
1572
|
async initAssetSettings() {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
|
2
2
|
import { _AssetRef, _AssetType, _ChainAsset, _ChainInfo, _CrowdloanFund } from '@subwallet/chain-list/types';
|
|
3
|
+
import { AccountState, TxByMsgResponse } from '@subwallet/extension-base/services/balance-service/helpers/subscribe/ton/types';
|
|
3
4
|
import { _CHAIN_VALIDATION_ERROR } from '@subwallet/extension-base/services/chain-service/handler/types';
|
|
5
|
+
import { TonWalletContract } from '@subwallet/keyring/types';
|
|
6
|
+
import { Cell } from '@ton/core';
|
|
7
|
+
import { Address, Contract, OpenedContract } from '@ton/ton';
|
|
4
8
|
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
5
9
|
import Web3 from 'web3';
|
|
6
10
|
import { ApiPromise } from '@polkadot/api';
|
|
@@ -100,6 +104,26 @@ export interface _EvmApi extends _ChainBaseApi {
|
|
|
100
104
|
api: Web3;
|
|
101
105
|
isReady: Promise<_EvmApi>;
|
|
102
106
|
}
|
|
107
|
+
export interface _TonApi extends _ChainBaseApi, _TonUtilsApi {
|
|
108
|
+
isReady: Promise<_TonApi>;
|
|
109
|
+
}
|
|
110
|
+
export interface _TonUtilsApi {
|
|
111
|
+
getBalance(address: Address): Promise<bigint>;
|
|
112
|
+
open<T extends Contract>(src: T): OpenedContract<T>;
|
|
113
|
+
estimateExternalMessageFee(walletContract: TonWalletContract, body: Cell, isInit: boolean, ignoreSignature?: boolean): Promise<EstimateExternalMessageFee>;
|
|
114
|
+
sendTonTransaction(boc: string): Promise<string>;
|
|
115
|
+
getTxByInMsg(extMsgHash: string): Promise<TxByMsgResponse>;
|
|
116
|
+
getStatusByExtMsgHash(extMsgHash: string): Promise<[boolean, string]>;
|
|
117
|
+
getAccountState(address: string): Promise<AccountState>;
|
|
118
|
+
}
|
|
119
|
+
export interface EstimateExternalMessageFee {
|
|
120
|
+
source_fees: {
|
|
121
|
+
in_fwd_fee: number;
|
|
122
|
+
storage_fee: number;
|
|
123
|
+
gas_fee: number;
|
|
124
|
+
fwd_fee: number;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
103
127
|
export declare type _NetworkUpsertParams = {
|
|
104
128
|
mode: 'update' | 'insert';
|
|
105
129
|
chainEditInfo: {
|
|
@@ -2,6 +2,7 @@ import { _AssetRef, _AssetType, _ChainAsset, _ChainInfo, _MultiChainAsset } from
|
|
|
2
2
|
import { BasicTokenInfo } from '@subwallet/extension-base/background/KoniTypes';
|
|
3
3
|
import { _ChainState, _DataMap } from '@subwallet/extension-base/services/chain-service/types';
|
|
4
4
|
import { IChain } from '@subwallet/extension-base/services/storage-service/databases';
|
|
5
|
+
import { AccountChainType } from '@subwallet/extension-base/types';
|
|
5
6
|
export declare function _isCustomChain(slug: string): boolean;
|
|
6
7
|
export declare function _isCustomAsset(slug: string): boolean;
|
|
7
8
|
export declare function _getCustomAssets(assetRegistry: Record<string, _ChainAsset>): Record<string, _ChainAsset>;
|
|
@@ -9,6 +10,7 @@ export declare function _isEqualContractAddress(address1: string, address2: stri
|
|
|
9
10
|
export declare function _isEqualSmartContractAsset(asset1: _ChainAsset, asset2: _ChainAsset): boolean;
|
|
10
11
|
export declare function _isPureEvmChain(chainInfo: _ChainInfo): boolean;
|
|
11
12
|
export declare function _isPureSubstrateChain(chainInfo: _ChainInfo): boolean;
|
|
13
|
+
export declare function _isPureTonChain(chainInfo: _ChainInfo): boolean;
|
|
12
14
|
export declare function _getOriginChainOfAsset(assetSlug: string): string;
|
|
13
15
|
export declare function _getContractAddressOfToken(tokenInfo: _ChainAsset): string;
|
|
14
16
|
/**
|
|
@@ -26,15 +28,19 @@ export declare function _isNativeTokenTransferredByEvm(tokenInfo: _ChainAsset):
|
|
|
26
28
|
* */
|
|
27
29
|
export declare function _isTokenTransferredByEvm(tokenInfo: _ChainAsset): boolean;
|
|
28
30
|
export declare function _checkSmartContractSupportByChain(chainInfo: _ChainInfo, contractType: _AssetType): boolean;
|
|
31
|
+
export declare function _isJettonToken(tokenInfo: _ChainAsset): boolean;
|
|
32
|
+
export declare function _isTokenTransferredByTon(tokenInfo: _ChainAsset): boolean;
|
|
29
33
|
export declare function _getTokenOnChainAssetId(tokenInfo: _ChainAsset): string;
|
|
30
34
|
export declare function _getTokenOnChainInfo(tokenInfo: _ChainAsset): Record<string, any>;
|
|
31
35
|
export declare function _isBridgedToken(tokenInfo: _ChainAsset): boolean;
|
|
32
36
|
export declare function _getTokenMinAmount(tokenInfo: _ChainAsset): string;
|
|
33
37
|
export declare function _isChainEvmCompatible(chainInfo: _ChainInfo): boolean;
|
|
38
|
+
export declare function _isChainBitcoinCompatible(chainInfo: _ChainInfo): boolean;
|
|
39
|
+
export declare function _isChainTonCompatible(chainInfo: _ChainInfo): boolean;
|
|
34
40
|
export declare function _isNativeToken(tokenInfo: _ChainAsset): boolean;
|
|
35
41
|
export declare function _isNativeTokenBySlug(tokenSlug: string): boolean;
|
|
36
42
|
export declare function _isSmartContractToken(tokenInfo: _ChainAsset): boolean;
|
|
37
|
-
export declare function
|
|
43
|
+
export declare function _isChainSubstrateCompatible(chainInfo: _ChainInfo): boolean;
|
|
38
44
|
export declare function _getEvmChainId(chainInfo: _ChainInfo): number | undefined;
|
|
39
45
|
export declare function _getSubstrateParaId(chainInfo: _ChainInfo): number;
|
|
40
46
|
export declare function _getSubstrateRelayParent(chainInfo: _ChainInfo): string | null | undefined;
|
|
@@ -56,6 +62,7 @@ export declare function _getChainNativeTokenBasicInfo(chainInfo: _ChainInfo): Ba
|
|
|
56
62
|
export declare function _getChainNativeTokenSlug(chainInfo: _ChainInfo): string;
|
|
57
63
|
export declare function _isLocalToken(tokenInfo: _ChainAsset): boolean;
|
|
58
64
|
export declare function _isTokenEvmSmartContract(tokenInfo: _ChainAsset): boolean;
|
|
65
|
+
export declare function _isTokenTonSmartContract(tokenInfo: _ChainAsset): boolean;
|
|
59
66
|
export declare function _isTokenWasmSmartContract(tokenInfo: _ChainAsset): boolean;
|
|
60
67
|
export declare function _isAssetSmartContractNft(assetInfo: _ChainAsset): boolean;
|
|
61
68
|
export declare function _isTokenGearSmartContract(tokenInfo: _ChainAsset): boolean;
|
|
@@ -77,7 +84,7 @@ export declare function _getMultiChainAssetPriceId(multiChainAsset: _MultiChainA
|
|
|
77
84
|
export declare function _getAssetSymbol(assetInfo?: _ChainAsset): string;
|
|
78
85
|
export declare function _getMultiChainAssetSymbol(multiChainAsset: _MultiChainAsset): string;
|
|
79
86
|
export declare function _getAssetOriginChain(assetInfo?: _ChainAsset): string;
|
|
80
|
-
export declare function _getChainName(chainInfo
|
|
87
|
+
export declare function _getChainName(chainInfo?: _ChainInfo): string;
|
|
81
88
|
export declare function _getAssetDecimals(assetInfo?: _ChainAsset): number;
|
|
82
89
|
export declare function _getBlockExplorerFromChain(chainInfo: _ChainInfo): string | undefined;
|
|
83
90
|
export declare function _parseMetadataForSmartContractAsset(contractAddress: string): Record<string, string>;
|
|
@@ -101,4 +108,5 @@ export declare function updateLatestChainInfo(currentDataMap: _DataMap, latestCh
|
|
|
101
108
|
storedChainInfoList: IChain[];
|
|
102
109
|
needUpdateChainApiList: _ChainInfo[];
|
|
103
110
|
};
|
|
111
|
+
export declare const _chainInfoToChainType: (chainInfo: _ChainInfo) => AccountChainType;
|
|
104
112
|
export * from './patch';
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { _AssetRefPath, _AssetType, _ChainStatus, _SubstrateChainType } from '@subwallet/chain-list/types';
|
|
5
5
|
import { _MANTA_ZK_CHAIN_GROUP, _ZK_ASSET_PREFIX } from '@subwallet/extension-base/services/chain-service/constants';
|
|
6
6
|
import { _CUSTOM_PREFIX, _SMART_CONTRACT_STANDARDS } from '@subwallet/extension-base/services/chain-service/types';
|
|
7
|
+
import { AccountChainType } from '@subwallet/extension-base/types';
|
|
7
8
|
import { isEthereumAddress } from '@polkadot/util-crypto';
|
|
8
9
|
export function _isCustomChain(slug) {
|
|
9
10
|
if (slug.length === 0) {
|
|
@@ -47,10 +48,13 @@ export function _isEqualSmartContractAsset(asset1, asset2) {
|
|
|
47
48
|
return false;
|
|
48
49
|
}
|
|
49
50
|
export function _isPureEvmChain(chainInfo) {
|
|
50
|
-
return !!chainInfo.evmInfo && !chainInfo.substrateInfo;
|
|
51
|
+
return !!chainInfo.evmInfo && !chainInfo.substrateInfo && !chainInfo.tonInfo;
|
|
51
52
|
}
|
|
52
53
|
export function _isPureSubstrateChain(chainInfo) {
|
|
53
|
-
return !chainInfo.evmInfo && !!chainInfo.substrateInfo;
|
|
54
|
+
return !chainInfo.evmInfo && !!chainInfo.substrateInfo && !chainInfo.tonInfo;
|
|
55
|
+
}
|
|
56
|
+
export function _isPureTonChain(chainInfo) {
|
|
57
|
+
return !chainInfo.evmInfo && !chainInfo.substrateInfo && !!chainInfo.tonInfo;
|
|
54
58
|
}
|
|
55
59
|
export function _getOriginChainOfAsset(assetSlug) {
|
|
56
60
|
if (assetSlug.startsWith(_CUSTOM_PREFIX)) {
|
|
@@ -96,19 +100,26 @@ export function _checkSmartContractSupportByChain(chainInfo, contractType) {
|
|
|
96
100
|
}
|
|
97
101
|
return chainInfo.substrateInfo.supportSmartContract !== null && chainInfo.substrateInfo.supportSmartContract.includes(contractType);
|
|
98
102
|
}
|
|
103
|
+
export function _isJettonToken(tokenInfo) {
|
|
104
|
+
var _tokenInfo$metadata4;
|
|
105
|
+
return tokenInfo.assetType === _AssetType.TEP74 && !!((_tokenInfo$metadata4 = tokenInfo.metadata) !== null && _tokenInfo$metadata4 !== void 0 && _tokenInfo$metadata4.contractAddress);
|
|
106
|
+
}
|
|
107
|
+
export function _isTokenTransferredByTon(tokenInfo) {
|
|
108
|
+
return _isJettonToken(tokenInfo) || _isNativeToken(tokenInfo);
|
|
109
|
+
}
|
|
99
110
|
|
|
100
111
|
// Utils for balance functions
|
|
101
112
|
export function _getTokenOnChainAssetId(tokenInfo) {
|
|
102
|
-
var _tokenInfo$
|
|
103
|
-
return ((_tokenInfo$
|
|
113
|
+
var _tokenInfo$metadata5;
|
|
114
|
+
return ((_tokenInfo$metadata5 = tokenInfo.metadata) === null || _tokenInfo$metadata5 === void 0 ? void 0 : _tokenInfo$metadata5.assetId) || '-1';
|
|
104
115
|
}
|
|
105
116
|
export function _getTokenOnChainInfo(tokenInfo) {
|
|
106
|
-
var _tokenInfo$
|
|
107
|
-
return (_tokenInfo$
|
|
117
|
+
var _tokenInfo$metadata6;
|
|
118
|
+
return (_tokenInfo$metadata6 = tokenInfo.metadata) === null || _tokenInfo$metadata6 === void 0 ? void 0 : _tokenInfo$metadata6.onChainInfo;
|
|
108
119
|
}
|
|
109
120
|
export function _isBridgedToken(tokenInfo) {
|
|
110
|
-
var _tokenInfo$
|
|
111
|
-
return (_tokenInfo$
|
|
121
|
+
var _tokenInfo$metadata7;
|
|
122
|
+
return (_tokenInfo$metadata7 = tokenInfo.metadata) === null || _tokenInfo$metadata7 === void 0 ? void 0 : _tokenInfo$metadata7.isBridged;
|
|
112
123
|
}
|
|
113
124
|
export function _getTokenMinAmount(tokenInfo) {
|
|
114
125
|
return tokenInfo.minAmount || '0';
|
|
@@ -116,6 +127,12 @@ export function _getTokenMinAmount(tokenInfo) {
|
|
|
116
127
|
export function _isChainEvmCompatible(chainInfo) {
|
|
117
128
|
return !!chainInfo.evmInfo;
|
|
118
129
|
}
|
|
130
|
+
export function _isChainBitcoinCompatible(chainInfo) {
|
|
131
|
+
return !!chainInfo.bitcoinInfo;
|
|
132
|
+
}
|
|
133
|
+
export function _isChainTonCompatible(chainInfo) {
|
|
134
|
+
return !!chainInfo.tonInfo;
|
|
135
|
+
}
|
|
119
136
|
export function _isNativeToken(tokenInfo) {
|
|
120
137
|
return tokenInfo.assetType === _AssetType.NATIVE;
|
|
121
138
|
}
|
|
@@ -125,7 +142,7 @@ export function _isNativeTokenBySlug(tokenSlug) {
|
|
|
125
142
|
export function _isSmartContractToken(tokenInfo) {
|
|
126
143
|
return _SMART_CONTRACT_STANDARDS.includes(tokenInfo.assetType);
|
|
127
144
|
}
|
|
128
|
-
export function
|
|
145
|
+
export function _isChainSubstrateCompatible(chainInfo) {
|
|
129
146
|
return !!chainInfo.substrateInfo; // fallback to Ethereum
|
|
130
147
|
}
|
|
131
148
|
|
|
@@ -232,17 +249,22 @@ export function _getChainNativeTokenBasicInfo(chainInfo) {
|
|
|
232
249
|
decimals: -1
|
|
233
250
|
};
|
|
234
251
|
}
|
|
235
|
-
if (chainInfo.substrateInfo
|
|
252
|
+
if (chainInfo.substrateInfo) {
|
|
236
253
|
// substrate by default
|
|
237
254
|
return {
|
|
238
255
|
symbol: chainInfo.substrateInfo.symbol,
|
|
239
256
|
decimals: chainInfo.substrateInfo.decimals
|
|
240
257
|
};
|
|
241
|
-
} else if (chainInfo.evmInfo
|
|
258
|
+
} else if (chainInfo.evmInfo) {
|
|
242
259
|
return {
|
|
243
260
|
symbol: chainInfo.evmInfo.symbol,
|
|
244
261
|
decimals: chainInfo.evmInfo.decimals
|
|
245
262
|
};
|
|
263
|
+
} else if (chainInfo.tonInfo) {
|
|
264
|
+
return {
|
|
265
|
+
symbol: chainInfo.tonInfo.symbol,
|
|
266
|
+
decimals: chainInfo.tonInfo.decimals
|
|
267
|
+
};
|
|
246
268
|
}
|
|
247
269
|
return {
|
|
248
270
|
symbol: '',
|
|
@@ -261,6 +283,10 @@ export function _isLocalToken(tokenInfo) {
|
|
|
261
283
|
export function _isTokenEvmSmartContract(tokenInfo) {
|
|
262
284
|
return [_AssetType.ERC721, _AssetType.ERC20].includes(tokenInfo.assetType);
|
|
263
285
|
}
|
|
286
|
+
export function _isTokenTonSmartContract(tokenInfo) {
|
|
287
|
+
return [_AssetType.TEP74].includes(tokenInfo.assetType); // add TEP-62 when supporting
|
|
288
|
+
}
|
|
289
|
+
|
|
264
290
|
export function _isTokenWasmSmartContract(tokenInfo) {
|
|
265
291
|
return [_AssetType.PSP22, _AssetType.PSP34].includes(tokenInfo.assetType);
|
|
266
292
|
}
|
|
@@ -281,16 +307,16 @@ export function _isXcmPathSupported(originTokenSlug, destinationTokenSlug, asset
|
|
|
281
307
|
return assetRef.path === _AssetRefPath.XCM;
|
|
282
308
|
}
|
|
283
309
|
export function _getXcmAssetType(tokenInfo) {
|
|
284
|
-
var _tokenInfo$
|
|
285
|
-
return ((_tokenInfo$
|
|
310
|
+
var _tokenInfo$metadata8;
|
|
311
|
+
return ((_tokenInfo$metadata8 = tokenInfo.metadata) === null || _tokenInfo$metadata8 === void 0 ? void 0 : _tokenInfo$metadata8.assetType) || '';
|
|
286
312
|
}
|
|
287
313
|
export function _getXcmAssetId(tokenInfo) {
|
|
288
|
-
var _tokenInfo$
|
|
289
|
-
return ((_tokenInfo$
|
|
314
|
+
var _tokenInfo$metadata9;
|
|
315
|
+
return ((_tokenInfo$metadata9 = tokenInfo.metadata) === null || _tokenInfo$metadata9 === void 0 ? void 0 : _tokenInfo$metadata9.assetId) || '-1';
|
|
290
316
|
}
|
|
291
317
|
export function _getXcmAssetMultilocation(tokenInfo) {
|
|
292
|
-
var _tokenInfo$
|
|
293
|
-
return (_tokenInfo$
|
|
318
|
+
var _tokenInfo$metadata10;
|
|
319
|
+
return (_tokenInfo$metadata10 = tokenInfo.metadata) === null || _tokenInfo$metadata10 === void 0 ? void 0 : _tokenInfo$metadata10.multilocation;
|
|
294
320
|
}
|
|
295
321
|
export function _getXcmTransferType(originChainInfo, destinationChainInfo) {
|
|
296
322
|
var _originChainInfo$subs, _destinationChainInfo;
|
|
@@ -336,7 +362,7 @@ export function _getAssetOriginChain(assetInfo) {
|
|
|
336
362
|
return (assetInfo === null || assetInfo === void 0 ? void 0 : assetInfo.originChain) || '';
|
|
337
363
|
}
|
|
338
364
|
export function _getChainName(chainInfo) {
|
|
339
|
-
return chainInfo.name;
|
|
365
|
+
return (chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.name) || '';
|
|
340
366
|
}
|
|
341
367
|
export function _getAssetDecimals(assetInfo) {
|
|
342
368
|
return (assetInfo === null || assetInfo === void 0 ? void 0 : assetInfo.decimals) || 0;
|
|
@@ -503,4 +529,19 @@ export function updateLatestChainInfo(currentDataMap, latestChainInfoList) {
|
|
|
503
529
|
needUpdateChainApiList
|
|
504
530
|
};
|
|
505
531
|
}
|
|
532
|
+
export const _chainInfoToChainType = chainInfo => {
|
|
533
|
+
if (_isPureSubstrateChain(chainInfo)) {
|
|
534
|
+
return AccountChainType.SUBSTRATE;
|
|
535
|
+
}
|
|
536
|
+
if (_isChainEvmCompatible(chainInfo)) {
|
|
537
|
+
return AccountChainType.ETHEREUM;
|
|
538
|
+
}
|
|
539
|
+
if (_isChainTonCompatible(chainInfo)) {
|
|
540
|
+
return AccountChainType.TON;
|
|
541
|
+
}
|
|
542
|
+
if (_isChainBitcoinCompatible(chainInfo)) {
|
|
543
|
+
return AccountChainType.BITCOIN;
|
|
544
|
+
}
|
|
545
|
+
return AccountChainType.SUBSTRATE;
|
|
546
|
+
};
|
|
506
547
|
export * from "./patch.js";
|
|
@@ -13,6 +13,7 @@ export declare const _STAKING_CHAIN_GROUP: {
|
|
|
13
13
|
krest_network: string[];
|
|
14
14
|
manta: string[];
|
|
15
15
|
};
|
|
16
|
+
export declare const TON_CHAINS: string[];
|
|
16
17
|
export declare const MaxEraRewardPointsEras = 14;
|
|
17
18
|
export declare const ST_LIQUID_TOKEN_ABI: Record<string, any>;
|
|
18
19
|
export declare const MANTA_VALIDATOR_POINTS_PER_BLOCK = 20;
|
|
@@ -18,6 +18,7 @@ export const _STAKING_CHAIN_GROUP = {
|
|
|
18
18
|
krest_network: ['krest_network'],
|
|
19
19
|
manta: ['manta_network']
|
|
20
20
|
};
|
|
21
|
+
export const TON_CHAINS = ['ton', 'ton_testnet'];
|
|
21
22
|
export const MaxEraRewardPointsEras = 14;
|
|
22
23
|
|
|
23
24
|
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { ChainType } from '@subwallet/extension-base/background/KoniTypes';
|
|
5
5
|
import { ALL_ACCOUNT_KEY } from '@subwallet/extension-base/constants';
|
|
6
6
|
import { DEFAULT_YIELD_FIRST_STEP } from '@subwallet/extension-base/services/earning-service/constants';
|
|
7
|
-
import { formatNumber } from '@subwallet/extension-base/utils';
|
|
7
|
+
import { formatNumber, reformatAddress } from '@subwallet/extension-base/utils';
|
|
8
8
|
import { BN, BN_TEN } from '@polkadot/util';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -101,7 +101,8 @@ export default class BasePoolHandler {
|
|
|
101
101
|
return await this.state.earningService.getYieldPool(this.slug);
|
|
102
102
|
}
|
|
103
103
|
async getPoolPosition(address) {
|
|
104
|
-
|
|
104
|
+
const originAddress = reformatAddress(address);
|
|
105
|
+
return await this.state.earningService.getYieldPosition(originAddress, this.slug);
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
/* Subscribe data */
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import { BasicTxErrorType, StakingTxErrorType } from '@subwallet/extension-base/
|
|
6
|
-
import { YieldPoolType } from '@subwallet/extension-base/types';
|
|
5
|
+
import { BasicTxErrorType, StakingTxErrorType, YieldPoolType } from '@subwallet/extension-base/types';
|
|
7
6
|
import { BN_ZERO, formatNumber } from '@subwallet/extension-base/utils';
|
|
8
7
|
import BigN from 'bignumber.js';
|
|
9
8
|
import { t } from 'i18next';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import {
|
|
5
|
+
import { ChainType, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
6
|
import { _getTokenOnChainInfo } from '@subwallet/extension-base/services/chain-service/utils';
|
|
7
|
-
import { EarningStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
7
|
+
import { BasicTxErrorType, EarningStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
8
8
|
import { BN, BN_TEN, BN_ZERO } from '@polkadot/util';
|
|
9
9
|
import { fakeAddress } from "../../constants/index.js";
|
|
10
10
|
import BaseLendingPoolHandler from "./base.js";
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import { BasicTxErrorType, StakingTxErrorType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
5
|
import { convertDerivativeToOriginToken } from '@subwallet/extension-base/koni/api/yield/helper/utils';
|
|
7
|
-
import { YieldPoolType } from '@subwallet/extension-base/types';
|
|
6
|
+
import { BasicTxErrorType, StakingTxErrorType, YieldPoolType } from '@subwallet/extension-base/types';
|
|
8
7
|
import { formatNumber } from '@subwallet/extension-base/utils';
|
|
9
8
|
import BigN from 'bignumber.js';
|
|
10
9
|
import { t } from 'i18next';
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import {
|
|
5
|
+
import { ChainType, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
6
|
import { getERC20Contract, getERC20SpendingApprovalTx } from '@subwallet/extension-base/koni/api/contract-handler/evm/web3';
|
|
7
7
|
import { _getAssetDecimals, _getContractAddressOfToken } from '@subwallet/extension-base/services/chain-service/utils';
|
|
8
8
|
import { calculateGasFeeParams } from '@subwallet/extension-base/services/fee-service/utils';
|
|
9
|
-
import { EarningStatus, UnstakingStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
9
|
+
import { BasicTxErrorType, EarningStatus, UnstakingStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
10
10
|
import { BN, BN_TEN, BN_ZERO } from '@polkadot/util';
|
|
11
11
|
import { ST_LIQUID_TOKEN_ABI } from "../../constants/index.js";
|
|
12
12
|
import BaseLiquidStakingPoolHandler from "./base.js";
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import { APIItemState,
|
|
5
|
+
import { APIItemState, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
6
|
import { getBondedValidators, getEarningStatusByNominations, isUnstakeAll } from '@subwallet/extension-base/koni/api/staking/bonding/utils';
|
|
7
7
|
import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants';
|
|
8
8
|
import { _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/earning-service/constants';
|
|
9
9
|
import { parseIdentity } from '@subwallet/extension-base/services/earning-service/utils';
|
|
10
|
-
import { EarningStatus, UnstakingStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
10
|
+
import { BasicTxErrorType, EarningStatus, UnstakingStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
11
11
|
import { balanceFormatter, formatNumber, parseRawNumber, reformatAddress } from '@subwallet/extension-base/utils';
|
|
12
12
|
import { BN, BN_ZERO } from '@polkadot/util';
|
|
13
13
|
import BaseParaNativeStakingPoolHandler from "./base-para.js";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import {
|
|
5
|
+
import { ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
6
|
import { getEarningStatusByNominations } from '@subwallet/extension-base/koni/api/staking/bonding/utils';
|
|
7
7
|
import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants';
|
|
8
|
-
import { EarningStatus, UnstakingStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
8
|
+
import { BasicTxErrorType, EarningStatus, UnstakingStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
9
9
|
import { balanceFormatter, formatNumber, isUrl, parseRawNumber, reformatAddress } from '@subwallet/extension-base/utils';
|
|
10
10
|
import { BN, BN_ZERO } from '@polkadot/util';
|
|
11
11
|
import { isEthereumAddress } from '@polkadot/util-crypto';
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import {
|
|
5
|
+
import { StakingType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
6
|
import { getBondedValidators, getExistUnstakeErrorMessage, getMaxValidatorErrorMessage, getMinStakeErrorMessage } from '@subwallet/extension-base/koni/api/staking/bonding/utils';
|
|
7
7
|
import BaseNativeStakingPoolHandler from '@subwallet/extension-base/services/earning-service/handlers/native-staking/base';
|
|
8
|
-
import { EarningStatus, YieldStepType } from '@subwallet/extension-base/types';
|
|
8
|
+
import { BasicTxErrorType, EarningStatus, StakingTxErrorType, YieldStepType } from '@subwallet/extension-base/types';
|
|
9
9
|
import { isSameAddress, reformatAddress } from '@subwallet/extension-base/utils';
|
|
10
10
|
import { t } from 'i18next';
|
|
11
11
|
import { BN, BN_ZERO } from '@polkadot/util';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError';
|
|
5
|
-
import {
|
|
6
|
-
import { YieldPoolType, YieldStepType } from '@subwallet/extension-base/types';
|
|
5
|
+
import { ChainType, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
6
|
+
import { BasicTxErrorType, YieldPoolType, YieldStepType } from '@subwallet/extension-base/types';
|
|
7
7
|
import { noop } from '@polkadot/util';
|
|
8
8
|
import BasePoolHandler from "../base.js";
|
|
9
9
|
export default class BaseNativeStakingPoolHandler extends BasePoolHandler {
|