@subwallet/extension-base 1.2.31-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 -15
- 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/SubstrateApi.js +1 -0
- 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 -17
- 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/SubstrateApi.js +1 -0
- 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/mkt-campaign-service/types.d.ts +4 -0
- 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,161 @@
|
|
|
1
|
+
import type { KeypairType, KeyringPair$Meta } from '@subwallet/keyring/types';
|
|
2
|
+
import { _AssetType } from '@subwallet/chain-list/types';
|
|
3
|
+
import { ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
4
|
+
export interface AbstractAddressJson extends KeyringPair$Meta {
|
|
5
|
+
address: string;
|
|
6
|
+
type?: KeypairType;
|
|
7
|
+
whenCreated?: number;
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @interface AccountExternalData
|
|
12
|
+
* @prop {boolean} [isMasterAccount] - Is master account - account has seed
|
|
13
|
+
* @prop {boolean} [isMasterPassword] - Account has migrated with wallet password
|
|
14
|
+
* @prop {boolean} [isExternal] - Is external account
|
|
15
|
+
* @prop {boolean} [isHardware] - Is hardware account
|
|
16
|
+
* @prop {boolean} [isReadOnly] - Is readonly account
|
|
17
|
+
* @prop {boolean} [isHidden] - Is hidden account
|
|
18
|
+
* */
|
|
19
|
+
export interface AccountExternalData {
|
|
20
|
+
/** Is master account - account has seed */
|
|
21
|
+
isMasterAccount?: boolean;
|
|
22
|
+
/** Account has migrated with wallet password */
|
|
23
|
+
isMasterPassword?: boolean;
|
|
24
|
+
/** Is external account */
|
|
25
|
+
isExternal?: boolean;
|
|
26
|
+
/** Is hardware account */
|
|
27
|
+
isHardware?: boolean;
|
|
28
|
+
/** Is readonly account */
|
|
29
|
+
isReadOnly?: boolean;
|
|
30
|
+
/** Is hidden account */
|
|
31
|
+
isHidden?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @interface AccountLedgerData
|
|
35
|
+
* @prop {boolean} [isGeneric] - Is generic account
|
|
36
|
+
* @prop {number} [accountIndex] - Ledger's account index
|
|
37
|
+
* @prop {number} [addressOffset] - Ledger's address offset
|
|
38
|
+
* @prop {string|null} [genesisHash] - Ledger's genesisHash
|
|
39
|
+
* @prop {string|null} [originGenesisHash] - Ledger's originGenesisHash
|
|
40
|
+
* @prop {string[]} [availableGenesisHashes] - Ledger's availableGenesisHashes
|
|
41
|
+
* */
|
|
42
|
+
export interface AccountLedgerData {
|
|
43
|
+
/** Is generic ledger account */
|
|
44
|
+
isGeneric?: boolean;
|
|
45
|
+
/** Ledger's account index */
|
|
46
|
+
accountIndex?: number;
|
|
47
|
+
/** Ledger's address offset */
|
|
48
|
+
addressOffset?: number;
|
|
49
|
+
/** Ledger's genesisHash */
|
|
50
|
+
genesisHash?: string | null;
|
|
51
|
+
/** Ledger's originGenesisHash */
|
|
52
|
+
originGenesisHash?: string | null;
|
|
53
|
+
/** Ledger's availableGenesisHashes */
|
|
54
|
+
availableGenesisHashes?: string[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @interface AccountInjectData
|
|
58
|
+
* @prop {boolean} [isInjected] - Is injected account
|
|
59
|
+
* @prop {string} [source] - Account's source
|
|
60
|
+
* */
|
|
61
|
+
export interface AccountInjectData {
|
|
62
|
+
/** Is injected account */
|
|
63
|
+
isInjected?: boolean;
|
|
64
|
+
/** Account's source */
|
|
65
|
+
source?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @interface AccountDeriveData
|
|
69
|
+
* @prop {string} [parentAddress] - Parent's address
|
|
70
|
+
* @prop {string} [suri] - Substrate: Derivation path | Other: Brief for the derivation path
|
|
71
|
+
* @prop {string} [derivationPath] - Derivation path
|
|
72
|
+
* */
|
|
73
|
+
export interface AccountDeriveData {
|
|
74
|
+
/** Parent's address */
|
|
75
|
+
parentAddress?: string;
|
|
76
|
+
/**
|
|
77
|
+
* - Substrate: Derivation path
|
|
78
|
+
* - Other: Brief for the derivation path
|
|
79
|
+
* */
|
|
80
|
+
suri?: string;
|
|
81
|
+
/** Derivation path */
|
|
82
|
+
derivationPath?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Represents the comprehensive metadata associated with an account, combining various aspects of account data.
|
|
86
|
+
* This interface extends from multiple specific metadata interfaces to provide a unified view of an account's metadata.
|
|
87
|
+
* It includes external, ledger, injected, and derived account data, offering a detailed perspective on the account's characteristics and origins.
|
|
88
|
+
*
|
|
89
|
+
* @interface AccountMetadataData
|
|
90
|
+
* Represents the comprehensive metadata associated with an account. This interface aggregates various aspects of account data to provide a unified view of an account's metadata. It extends from multiple specific metadata interfaces, each covering a different dimension of account information.
|
|
91
|
+
*
|
|
92
|
+
* @extends AccountExternalData - Includes data about the account's external status, hardware wallet status, read-only status, and hidden status.
|
|
93
|
+
* @extends AccountLedgerData - Contains information specific to Ledger hardware wallets, such as account index and genesis hash.
|
|
94
|
+
* @extends AccountInjectData - Covers data related to injected accounts, including the source of the injection.
|
|
95
|
+
* @extends AccountDeriveData - Holds information about derived accounts, including the parent address and derivation path (suri).
|
|
96
|
+
*/
|
|
97
|
+
export interface AccountMetadataData extends AccountExternalData, AccountLedgerData, AccountInjectData, AccountDeriveData {
|
|
98
|
+
}
|
|
99
|
+
export declare enum AccountSignMode {
|
|
100
|
+
PASSWORD = "password",
|
|
101
|
+
QR = "qr",
|
|
102
|
+
LEGACY_LEDGER = "legacy-ledger",
|
|
103
|
+
GENERIC_LEDGER = "generic-ledger",
|
|
104
|
+
READ_ONLY = "readonly",
|
|
105
|
+
ALL_ACCOUNT = "all",
|
|
106
|
+
INJECTED = "injected",
|
|
107
|
+
UNKNOWN = "unknown"
|
|
108
|
+
}
|
|
109
|
+
export declare enum AccountChainType {
|
|
110
|
+
SUBSTRATE = "substrate",
|
|
111
|
+
ETHEREUM = "ethereum",
|
|
112
|
+
BITCOIN = "bitcoin",
|
|
113
|
+
TON = "ton"
|
|
114
|
+
}
|
|
115
|
+
export declare enum AccountActions {
|
|
116
|
+
DERIVE = "DERIVE",
|
|
117
|
+
EXPORT_MNEMONIC = "EXPORT_MNEMONIC",
|
|
118
|
+
EXPORT_PRIVATE_KEY = "EXPORT_PRIVATE_KEY",
|
|
119
|
+
EXPORT_JSON = "EXPORT_JSON",
|
|
120
|
+
EXPORT_QR = "EXPORT_QR",
|
|
121
|
+
TON_CHANGE_WALLET_CONTRACT_VERSION = "TON_CHANGE_WALLET_CONTRACT_VERSION"
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Represents the actions associated with an account.
|
|
125
|
+
* @interface AccountActionData
|
|
126
|
+
* @prop {AccountChainType} chainType - The chain type will account used on
|
|
127
|
+
* @prop {AccountActions[]} accountActions - A list of account-specific actions. These could be actions like 'derive', 'export', etc., that are applicable to the account.
|
|
128
|
+
* @prop {ExtrinsicType[]} transactionActions - A list of transaction types that the account can initiate. This is dependent on the blockchain's supported extrinsic types, such as 'transfer', 'bond', etc.
|
|
129
|
+
* @prop {AccountSignMode} signMode - Account sign mode
|
|
130
|
+
* @prop {string} [specialChain] - Optional the special chain, which account can only be used on
|
|
131
|
+
* @prop {_AssetType[]} tokenTypes - Asset types, which account can be used
|
|
132
|
+
*/
|
|
133
|
+
export interface AccountActionData {
|
|
134
|
+
chainType: AccountChainType;
|
|
135
|
+
accountActions: AccountActions[];
|
|
136
|
+
transactionActions: ExtrinsicType[];
|
|
137
|
+
signMode: AccountSignMode;
|
|
138
|
+
specialChain?: string;
|
|
139
|
+
tokenTypes: _AssetType[];
|
|
140
|
+
proxyId?: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @interface AccountJson
|
|
144
|
+
* @extends AbstractAddressJson
|
|
145
|
+
* @extends AccountMetadataData
|
|
146
|
+
* @extends AccountActionData
|
|
147
|
+
* @prop {boolean} [isSubWallet] - Import from SubWallet
|
|
148
|
+
* @prop {boolean} [pendingMigrate] - Pending migrate password
|
|
149
|
+
* */
|
|
150
|
+
export interface AccountJson extends AbstractAddressJson, AccountMetadataData, AccountActionData {
|
|
151
|
+
/** Import from SubWallet */
|
|
152
|
+
isSubWallet?: boolean;
|
|
153
|
+
/** Pending migrate password */
|
|
154
|
+
pendingMigrate?: boolean;
|
|
155
|
+
type: KeypairType;
|
|
156
|
+
}
|
|
157
|
+
export interface AddressJson extends AbstractAddressJson {
|
|
158
|
+
chainType: AccountChainType;
|
|
159
|
+
isRecent?: boolean;
|
|
160
|
+
recentChainSlugs?: string[];
|
|
161
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @interface AccountExternalData
|
|
6
|
+
* @prop {boolean} [isMasterAccount] - Is master account - account has seed
|
|
7
|
+
* @prop {boolean} [isMasterPassword] - Account has migrated with wallet password
|
|
8
|
+
* @prop {boolean} [isExternal] - Is external account
|
|
9
|
+
* @prop {boolean} [isHardware] - Is hardware account
|
|
10
|
+
* @prop {boolean} [isReadOnly] - Is readonly account
|
|
11
|
+
* @prop {boolean} [isHidden] - Is hidden account
|
|
12
|
+
* */
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @interface AccountLedgerData
|
|
16
|
+
* @prop {boolean} [isGeneric] - Is generic account
|
|
17
|
+
* @prop {number} [accountIndex] - Ledger's account index
|
|
18
|
+
* @prop {number} [addressOffset] - Ledger's address offset
|
|
19
|
+
* @prop {string|null} [genesisHash] - Ledger's genesisHash
|
|
20
|
+
* @prop {string|null} [originGenesisHash] - Ledger's originGenesisHash
|
|
21
|
+
* @prop {string[]} [availableGenesisHashes] - Ledger's availableGenesisHashes
|
|
22
|
+
* */
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @interface AccountInjectData
|
|
26
|
+
* @prop {boolean} [isInjected] - Is injected account
|
|
27
|
+
* @prop {string} [source] - Account's source
|
|
28
|
+
* */
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @interface AccountDeriveData
|
|
32
|
+
* @prop {string} [parentAddress] - Parent's address
|
|
33
|
+
* @prop {string} [suri] - Substrate: Derivation path | Other: Brief for the derivation path
|
|
34
|
+
* @prop {string} [derivationPath] - Derivation path
|
|
35
|
+
* */
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Represents the comprehensive metadata associated with an account, combining various aspects of account data.
|
|
39
|
+
* This interface extends from multiple specific metadata interfaces to provide a unified view of an account's metadata.
|
|
40
|
+
* It includes external, ledger, injected, and derived account data, offering a detailed perspective on the account's characteristics and origins.
|
|
41
|
+
*
|
|
42
|
+
* @interface AccountMetadataData
|
|
43
|
+
* Represents the comprehensive metadata associated with an account. This interface aggregates various aspects of account data to provide a unified view of an account's metadata. It extends from multiple specific metadata interfaces, each covering a different dimension of account information.
|
|
44
|
+
*
|
|
45
|
+
* @extends AccountExternalData - Includes data about the account's external status, hardware wallet status, read-only status, and hidden status.
|
|
46
|
+
* @extends AccountLedgerData - Contains information specific to Ledger hardware wallets, such as account index and genesis hash.
|
|
47
|
+
* @extends AccountInjectData - Covers data related to injected accounts, including the source of the injection.
|
|
48
|
+
* @extends AccountDeriveData - Holds information about derived accounts, including the parent address and derivation path (suri).
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
export let AccountSignMode;
|
|
52
|
+
(function (AccountSignMode) {
|
|
53
|
+
AccountSignMode["PASSWORD"] = "password";
|
|
54
|
+
AccountSignMode["QR"] = "qr";
|
|
55
|
+
AccountSignMode["LEGACY_LEDGER"] = "legacy-ledger";
|
|
56
|
+
AccountSignMode["GENERIC_LEDGER"] = "generic-ledger";
|
|
57
|
+
AccountSignMode["READ_ONLY"] = "readonly";
|
|
58
|
+
AccountSignMode["ALL_ACCOUNT"] = "all";
|
|
59
|
+
AccountSignMode["INJECTED"] = "injected";
|
|
60
|
+
AccountSignMode["UNKNOWN"] = "unknown";
|
|
61
|
+
})(AccountSignMode || (AccountSignMode = {}));
|
|
62
|
+
export let AccountChainType;
|
|
63
|
+
(function (AccountChainType) {
|
|
64
|
+
AccountChainType["SUBSTRATE"] = "substrate";
|
|
65
|
+
AccountChainType["ETHEREUM"] = "ethereum";
|
|
66
|
+
AccountChainType["BITCOIN"] = "bitcoin";
|
|
67
|
+
AccountChainType["TON"] = "ton";
|
|
68
|
+
})(AccountChainType || (AccountChainType = {}));
|
|
69
|
+
export let AccountActions;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Represents the actions associated with an account.
|
|
73
|
+
* @interface AccountActionData
|
|
74
|
+
* @prop {AccountChainType} chainType - The chain type will account used on
|
|
75
|
+
* @prop {AccountActions[]} accountActions - A list of account-specific actions. These could be actions like 'derive', 'export', etc., that are applicable to the account.
|
|
76
|
+
* @prop {ExtrinsicType[]} transactionActions - A list of transaction types that the account can initiate. This is dependent on the blockchain's supported extrinsic types, such as 'transfer', 'bond', etc.
|
|
77
|
+
* @prop {AccountSignMode} signMode - Account sign mode
|
|
78
|
+
* @prop {string} [specialChain] - Optional the special chain, which account can only be used on
|
|
79
|
+
* @prop {_AssetType[]} tokenTypes - Asset types, which account can be used
|
|
80
|
+
*/
|
|
81
|
+
(function (AccountActions) {
|
|
82
|
+
AccountActions["DERIVE"] = "DERIVE";
|
|
83
|
+
AccountActions["EXPORT_MNEMONIC"] = "EXPORT_MNEMONIC";
|
|
84
|
+
AccountActions["EXPORT_PRIVATE_KEY"] = "EXPORT_PRIVATE_KEY";
|
|
85
|
+
AccountActions["EXPORT_JSON"] = "EXPORT_JSON";
|
|
86
|
+
AccountActions["EXPORT_QR"] = "EXPORT_QR";
|
|
87
|
+
AccountActions["TON_CHANGE_WALLET_CONTRACT_VERSION"] = "TON_CHANGE_WALLET_CONTRACT_VERSION";
|
|
88
|
+
})(AccountActions || (AccountActions = {}));
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { _AssetType } from '@subwallet/chain-list/types';
|
|
2
|
+
import { KeyringPairs$Json } from '@subwallet/ui-keyring/types';
|
|
3
|
+
import { AccountActions, AccountChainType, AccountJson } from './keyring';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the basic data structure for an account proxy.
|
|
6
|
+
*
|
|
7
|
+
* @interface AccountProxyData
|
|
8
|
+
* @prop {string} id - The unique identifier for the proxy account.
|
|
9
|
+
* @prop {string} name - The name of the proxy account.
|
|
10
|
+
* @prop {string} [parentId] - The identifier of the parent account proxy, from which it is derived.
|
|
11
|
+
* @prop {string} [suri] - Derivate path.
|
|
12
|
+
*/
|
|
13
|
+
export interface AccountProxyData {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
parentId?: string;
|
|
17
|
+
suri?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents a mapping of unique identifiers to account proxy data.
|
|
21
|
+
* This type is used to store and manage account proxy information efficiently,
|
|
22
|
+
* allowing for quick access and manipulation of proxy account details.
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Record<string, AccountProxyData>} AccountProxyStoreData
|
|
25
|
+
*/
|
|
26
|
+
export declare type AccountProxyStoreData = Record<string, AccountProxyData>;
|
|
27
|
+
export declare enum AccountProxyType {
|
|
28
|
+
ALL_ACCOUNT = "all",
|
|
29
|
+
SOLO = "solo",
|
|
30
|
+
UNIFIED = "unified",
|
|
31
|
+
QR = "qr",
|
|
32
|
+
LEDGER = "ledger",
|
|
33
|
+
READ_ONLY = "readonly",
|
|
34
|
+
INJECTED = "injected",
|
|
35
|
+
UNKNOWN = "unknown"
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @interface AccountProxy
|
|
39
|
+
* @extends AccountProxyData - Inherits properties from AccountProxyData.
|
|
40
|
+
* @description Represents an account proxy, which includes additional details and associated accounts.
|
|
41
|
+
*
|
|
42
|
+
* @prop {AccountJson[]} accounts - An array of `AccountJson` objects representing the accounts associated with this proxy.
|
|
43
|
+
* @prop {AccountProxyType} accountType - The type of the account proxy.
|
|
44
|
+
* @prop {AccountChainType[]} chainTypes - An array of network types associated with this proxy.
|
|
45
|
+
* @prop {string} [specialChain] - Optional the special networks, which account proxy can only be used on
|
|
46
|
+
* @prop {_AssetType[]} tokenTypes - Asset types, which account proxy can be used
|
|
47
|
+
* @prop {AccountActions[]} accountActions - A list of account-specific actions.
|
|
48
|
+
* These could be actions like 'derive', 'export', etc., that are applicable to the account.
|
|
49
|
+
*/
|
|
50
|
+
export interface AccountProxy extends AccountProxyData {
|
|
51
|
+
accounts: AccountJson[];
|
|
52
|
+
accountType: AccountProxyType;
|
|
53
|
+
chainTypes: AccountChainType[];
|
|
54
|
+
specialChain?: string;
|
|
55
|
+
children?: string[];
|
|
56
|
+
tokenTypes: _AssetType[];
|
|
57
|
+
accountActions: AccountActions[];
|
|
58
|
+
}
|
|
59
|
+
export declare type AccountProxyMap = Record<string, AccountProxy>;
|
|
60
|
+
export interface AccountProxyExtra extends AccountProxy {
|
|
61
|
+
isExistAccount: boolean;
|
|
62
|
+
isExistName: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface ModifyPairData {
|
|
65
|
+
key: string;
|
|
66
|
+
migrated: boolean;
|
|
67
|
+
accountProxyId?: string;
|
|
68
|
+
}
|
|
69
|
+
export declare type ModifyPairStoreData = Record<string, ModifyPairData>;
|
|
70
|
+
export interface KeyringPairs$JsonV2 extends KeyringPairs$Json {
|
|
71
|
+
modifyPairs?: ModifyPairStoreData;
|
|
72
|
+
accountProxies?: AccountProxyStoreData;
|
|
73
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents the basic data structure for an account proxy.
|
|
6
|
+
*
|
|
7
|
+
* @interface AccountProxyData
|
|
8
|
+
* @prop {string} id - The unique identifier for the proxy account.
|
|
9
|
+
* @prop {string} name - The name of the proxy account.
|
|
10
|
+
* @prop {string} [parentId] - The identifier of the parent account proxy, from which it is derived.
|
|
11
|
+
* @prop {string} [suri] - Derivate path.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents a mapping of unique identifiers to account proxy data.
|
|
16
|
+
* This type is used to store and manage account proxy information efficiently,
|
|
17
|
+
* allowing for quick access and manipulation of proxy account details.
|
|
18
|
+
*
|
|
19
|
+
* @typedef {Record<string, AccountProxyData>} AccountProxyStoreData
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export let AccountProxyType;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @interface AccountProxy
|
|
26
|
+
* @extends AccountProxyData - Inherits properties from AccountProxyData.
|
|
27
|
+
* @description Represents an account proxy, which includes additional details and associated accounts.
|
|
28
|
+
*
|
|
29
|
+
* @prop {AccountJson[]} accounts - An array of `AccountJson` objects representing the accounts associated with this proxy.
|
|
30
|
+
* @prop {AccountProxyType} accountType - The type of the account proxy.
|
|
31
|
+
* @prop {AccountChainType[]} chainTypes - An array of network types associated with this proxy.
|
|
32
|
+
* @prop {string} [specialChain] - Optional the special networks, which account proxy can only be used on
|
|
33
|
+
* @prop {_AssetType[]} tokenTypes - Asset types, which account proxy can be used
|
|
34
|
+
* @prop {AccountActions[]} accountActions - A list of account-specific actions.
|
|
35
|
+
* These could be actions like 'derive', 'export', etc., that are applicable to the account.
|
|
36
|
+
*/
|
|
37
|
+
(function (AccountProxyType) {
|
|
38
|
+
AccountProxyType["ALL_ACCOUNT"] = "all";
|
|
39
|
+
AccountProxyType["SOLO"] = "solo";
|
|
40
|
+
AccountProxyType["UNIFIED"] = "unified";
|
|
41
|
+
AccountProxyType["QR"] = "qr";
|
|
42
|
+
AccountProxyType["LEDGER"] = "ledger";
|
|
43
|
+
AccountProxyType["READ_ONLY"] = "readonly";
|
|
44
|
+
AccountProxyType["INJECTED"] = "injected";
|
|
45
|
+
AccountProxyType["UNKNOWN"] = "unknown";
|
|
46
|
+
})(AccountProxyType || (AccountProxyType = {}));
|
package/types/balance/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types';
|
|
2
2
|
import { _BalanceMetadata, APIItemState, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
3
|
-
import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types';
|
|
3
|
+
import { _EvmApi, _SubstrateApi, _TonApi } from '@subwallet/extension-base/services/chain-service/types';
|
|
4
4
|
import { BN } from '@polkadot/util';
|
|
5
5
|
export interface TokenBalanceRaw {
|
|
6
6
|
reserved: BN;
|
|
@@ -48,3 +48,6 @@ export interface SubscribeSubstratePalletBalance extends SubscribeBasePalletBala
|
|
|
48
48
|
export interface SubscribeEvmPalletBalance extends SubscribeBasePalletBalance {
|
|
49
49
|
evmApi: _EvmApi;
|
|
50
50
|
}
|
|
51
|
+
export interface SubscribeTonPalletBalance extends SubscribeBasePalletBalance {
|
|
52
|
+
tonApi: _TonApi;
|
|
53
|
+
}
|
package/types/buy.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { AccountChainType } from './account';
|
|
1
2
|
export interface BuyService {
|
|
2
3
|
network: string;
|
|
3
4
|
symbol: string;
|
|
4
5
|
}
|
|
5
6
|
export declare type SupportService = 'transak' | 'banxa' | 'coinbase' | 'moonpay' | 'onramper';
|
|
7
|
+
export declare type OnrampAccountSupportType = 'ETHEREUM' | 'SUBSTRATE';
|
|
6
8
|
export interface BuyTokenInfo {
|
|
7
9
|
network: string;
|
|
8
10
|
symbol: string;
|
|
9
11
|
slug: string;
|
|
10
|
-
support:
|
|
12
|
+
support: AccountChainType;
|
|
11
13
|
services: Array<SupportService>;
|
|
12
14
|
serviceInfo: Record<SupportService, BuyService>;
|
|
13
15
|
}
|
package/types/error.d.ts
ADDED
package/types/error.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -8,12 +8,16 @@ export interface Message extends MessageEvent {
|
|
|
8
8
|
sender?: string;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
+
export * from './account';
|
|
11
12
|
export * from './balance';
|
|
12
13
|
export * from './buy';
|
|
13
14
|
export * from './campaigns';
|
|
14
15
|
export * from './common';
|
|
16
|
+
export * from './error';
|
|
15
17
|
export * from './fee';
|
|
16
18
|
export * from './metadata';
|
|
17
19
|
export * from './ordinal';
|
|
20
|
+
export * from './service-base';
|
|
21
|
+
export * from './swap';
|
|
18
22
|
export * from './transaction';
|
|
19
23
|
export * from './yield';
|
package/types/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
export * from "./account/index.js";
|
|
4
5
|
export * from "./balance/index.js";
|
|
5
6
|
export * from "./buy.js";
|
|
6
7
|
export * from "./campaigns/index.js";
|
|
7
8
|
export * from "./common/index.js";
|
|
9
|
+
export * from "./error.js";
|
|
8
10
|
export * from "./fee/index.js";
|
|
9
11
|
export * from "./metadata.js";
|
|
10
12
|
export * from "./ordinal.js";
|
|
11
|
-
export * from "./
|
|
13
|
+
export * from "./service-base.js";
|
|
14
|
+
export * from "./swap/index.js";
|
|
15
|
+
export * from "./transaction/index.js";
|
|
12
16
|
export * from "./yield/index.js";
|
|
13
17
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TransactionConfig } from 'web3-core';
|
|
2
|
+
import { SubmittableExtrinsic } from '@polkadot/api/types';
|
|
3
|
+
export declare type TransactionData = SubmittableExtrinsic<'promise'> | TransactionConfig;
|
|
4
|
+
export interface Web3TransactionBase {
|
|
5
|
+
to?: string;
|
|
6
|
+
gasPrice: number;
|
|
7
|
+
maxFeePerGas: number;
|
|
8
|
+
maxPriorityFeePerGas: number;
|
|
9
|
+
gasLimit: number;
|
|
10
|
+
nonce: number;
|
|
11
|
+
chainId: number;
|
|
12
|
+
data?: string;
|
|
13
|
+
value: number;
|
|
14
|
+
}
|
|
15
|
+
export interface Web3Transaction extends Web3TransactionBase {
|
|
16
|
+
from: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SwapErrorType } from '../swap';
|
|
2
|
+
export declare enum YieldValidationStatus {
|
|
3
|
+
NOT_ENOUGH_FEE = "NOT_ENOUGH_FEE",
|
|
4
|
+
NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
|
|
5
|
+
NOT_ENOUGH_MIN_JOIN_POOL = "NOT_ENOUGH_MIN_JOIN_POOL",
|
|
6
|
+
OK = "OK"
|
|
7
|
+
}
|
|
8
|
+
export declare enum BasicTxErrorType {
|
|
9
|
+
NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
|
|
10
|
+
CHAIN_DISCONNECTED = "CHAIN_DISCONNECTED",
|
|
11
|
+
INVALID_PARAMS = "INVALID_PARAMS",
|
|
12
|
+
DUPLICATE_TRANSACTION = "DUPLICATE_TRANSACTION",
|
|
13
|
+
UNABLE_TO_SIGN = "UNABLE_TO_SIGN",
|
|
14
|
+
USER_REJECT_REQUEST = "USER_REJECT_REQUEST",
|
|
15
|
+
UNABLE_TO_SEND = "UNABLE_TO_SEND",
|
|
16
|
+
SEND_TRANSACTION_FAILED = "SEND_TRANSACTION_FAILED",
|
|
17
|
+
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
18
|
+
UNSUPPORTED = "UNSUPPORTED",
|
|
19
|
+
TIMEOUT = "TIMEOUT",
|
|
20
|
+
NOT_ENOUGH_EXISTENTIAL_DEPOSIT = "NOT_ENOUGH_EXISTENTIAL_DEPOSIT"
|
|
21
|
+
}
|
|
22
|
+
export declare enum StakingTxErrorType {
|
|
23
|
+
NOT_ENOUGH_MIN_STAKE = "NOT_ENOUGH_MIN_STAKE",
|
|
24
|
+
EXCEED_MAX_NOMINATIONS = "EXCEED_MAX_NOMINATIONS",
|
|
25
|
+
EXIST_UNSTAKING_REQUEST = "EXIST_UNSTAKING_REQUEST",
|
|
26
|
+
INVALID_ACTIVE_STAKE = "INVALID_ACTIVE_STAKE",
|
|
27
|
+
EXCEED_MAX_UNSTAKING = "EXCEED_MAX_UNSTAKING",
|
|
28
|
+
INACTIVE_NOMINATION_POOL = "INACTIVE_NOMINATION_POOL",
|
|
29
|
+
CAN_NOT_GET_METADATA = "CAN_NOT_GET_METADATA",
|
|
30
|
+
NOT_ENOUGH_MIN_UNSTAKE = "NOT_ENOUGH_MIN_UNSTAKE"
|
|
31
|
+
}
|
|
32
|
+
export declare enum TransferTxErrorType {
|
|
33
|
+
NOT_ENOUGH_VALUE = "NOT_ENOUGH_VALUE",
|
|
34
|
+
NOT_ENOUGH_FEE = "NOT_ENOUGH_FEE",
|
|
35
|
+
INVALID_TOKEN = "INVALID_TOKEN",
|
|
36
|
+
TRANSFER_ERROR = "TRANSFER_ERROR",
|
|
37
|
+
RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT = "RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT"
|
|
38
|
+
}
|
|
39
|
+
export declare type TransactionErrorType = BasicTxErrorType | TransferTxErrorType | StakingTxErrorType | YieldValidationStatus | SwapErrorType;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright 2019-2022 @subwallet/extension-base
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export let YieldValidationStatus;
|
|
5
|
+
(function (YieldValidationStatus) {
|
|
6
|
+
YieldValidationStatus["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
|
|
7
|
+
YieldValidationStatus["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
|
|
8
|
+
YieldValidationStatus["NOT_ENOUGH_MIN_JOIN_POOL"] = "NOT_ENOUGH_MIN_JOIN_POOL";
|
|
9
|
+
YieldValidationStatus["OK"] = "OK";
|
|
10
|
+
})(YieldValidationStatus || (YieldValidationStatus = {}));
|
|
11
|
+
export let BasicTxErrorType;
|
|
12
|
+
(function (BasicTxErrorType) {
|
|
13
|
+
BasicTxErrorType["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
|
|
14
|
+
BasicTxErrorType["CHAIN_DISCONNECTED"] = "CHAIN_DISCONNECTED";
|
|
15
|
+
BasicTxErrorType["INVALID_PARAMS"] = "INVALID_PARAMS";
|
|
16
|
+
BasicTxErrorType["DUPLICATE_TRANSACTION"] = "DUPLICATE_TRANSACTION";
|
|
17
|
+
BasicTxErrorType["UNABLE_TO_SIGN"] = "UNABLE_TO_SIGN";
|
|
18
|
+
BasicTxErrorType["USER_REJECT_REQUEST"] = "USER_REJECT_REQUEST";
|
|
19
|
+
BasicTxErrorType["UNABLE_TO_SEND"] = "UNABLE_TO_SEND";
|
|
20
|
+
BasicTxErrorType["SEND_TRANSACTION_FAILED"] = "SEND_TRANSACTION_FAILED";
|
|
21
|
+
BasicTxErrorType["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
|
22
|
+
BasicTxErrorType["UNSUPPORTED"] = "UNSUPPORTED";
|
|
23
|
+
BasicTxErrorType["TIMEOUT"] = "TIMEOUT";
|
|
24
|
+
BasicTxErrorType["NOT_ENOUGH_EXISTENTIAL_DEPOSIT"] = "NOT_ENOUGH_EXISTENTIAL_DEPOSIT";
|
|
25
|
+
})(BasicTxErrorType || (BasicTxErrorType = {}));
|
|
26
|
+
export let StakingTxErrorType;
|
|
27
|
+
(function (StakingTxErrorType) {
|
|
28
|
+
StakingTxErrorType["NOT_ENOUGH_MIN_STAKE"] = "NOT_ENOUGH_MIN_STAKE";
|
|
29
|
+
StakingTxErrorType["EXCEED_MAX_NOMINATIONS"] = "EXCEED_MAX_NOMINATIONS";
|
|
30
|
+
StakingTxErrorType["EXIST_UNSTAKING_REQUEST"] = "EXIST_UNSTAKING_REQUEST";
|
|
31
|
+
StakingTxErrorType["INVALID_ACTIVE_STAKE"] = "INVALID_ACTIVE_STAKE";
|
|
32
|
+
StakingTxErrorType["EXCEED_MAX_UNSTAKING"] = "EXCEED_MAX_UNSTAKING";
|
|
33
|
+
StakingTxErrorType["INACTIVE_NOMINATION_POOL"] = "INACTIVE_NOMINATION_POOL";
|
|
34
|
+
StakingTxErrorType["CAN_NOT_GET_METADATA"] = "CAN_NOT_GET_METADATA";
|
|
35
|
+
StakingTxErrorType["NOT_ENOUGH_MIN_UNSTAKE"] = "NOT_ENOUGH_MIN_UNSTAKE";
|
|
36
|
+
})(StakingTxErrorType || (StakingTxErrorType = {}));
|
|
37
|
+
export let TransferTxErrorType;
|
|
38
|
+
(function (TransferTxErrorType) {
|
|
39
|
+
TransferTxErrorType["NOT_ENOUGH_VALUE"] = "NOT_ENOUGH_VALUE";
|
|
40
|
+
TransferTxErrorType["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
|
|
41
|
+
TransferTxErrorType["INVALID_TOKEN"] = "INVALID_TOKEN";
|
|
42
|
+
TransferTxErrorType["TRANSFER_ERROR"] = "TRANSFER_ERROR";
|
|
43
|
+
TransferTxErrorType["RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT"] = "RECEIVER_NOT_ENOUGH_EXISTENTIAL_DEPOSIT";
|
|
44
|
+
})(TransferTxErrorType || (TransferTxErrorType = {}));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TransactionWarningType } from '@subwallet/extension-base/types';
|
|
2
|
+
export declare type BaseRequestSign = {
|
|
3
|
+
ignoreWarnings?: TransactionWarningType[];
|
|
4
|
+
};
|
|
5
|
+
export declare type InternalRequestSign<T> = T & BaseRequestSign;
|
|
6
|
+
export interface RequestBaseTransfer {
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
tokenSlug: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
transferAll?: boolean;
|
|
12
|
+
transferBounceable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface RequestCheckTransfer extends RequestBaseTransfer {
|
|
15
|
+
networkKey: string;
|
|
16
|
+
}
|
|
17
|
+
export declare type RequestTransfer = InternalRequestSign<RequestCheckTransfer>;
|
|
18
|
+
export interface RequestCheckCrossChainTransfer extends RequestBaseTransfer {
|
|
19
|
+
value: string;
|
|
20
|
+
originNetworkKey: string;
|
|
21
|
+
destinationNetworkKey: string;
|
|
22
|
+
showExtraWarning?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare type RequestCrossChainTransfer = InternalRequestSign<RequestCheckCrossChainTransfer>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright 2019-2022 @subwallet/extension-koni-ui authors & contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export let BasicTxWarningCode;
|
|
5
|
+
(function (BasicTxWarningCode) {
|
|
6
|
+
BasicTxWarningCode["NOT_ENOUGH_EXISTENTIAL_DEPOSIT"] = "notEnoughExistentialDeposit";
|
|
7
|
+
BasicTxWarningCode["IS_BOUNCEABLE_ADDRESS"] = "isBounceableAddress";
|
|
8
|
+
})(BasicTxWarningCode || (BasicTxWarningCode = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _Address,
|
|
2
|
-
import { TransactionData } from '../../../transaction';
|
|
1
|
+
import { _Address, ChainType, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
2
|
+
import { BaseRequestSign, InternalRequestSign, TransactionData } from '../../../transaction';
|
|
3
3
|
import { NominationPoolInfo, ValidatorInfo, YieldPositionInfo } from '../../info';
|
|
4
4
|
import { OptimalYieldPath } from './step';
|
|
5
5
|
export interface HandleYieldStepData {
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import { YieldValidationStatus } from '../../../transaction';
|
|
1
2
|
import { OptimalYieldPath, YieldStepDetail } from './step';
|
|
2
3
|
import { SubmitYieldJoinData } from './submit';
|
|
3
|
-
export declare enum YieldValidationStatus {
|
|
4
|
-
NOT_ENOUGH_FEE = "NOT_ENOUGH_FEE",
|
|
5
|
-
NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
|
|
6
|
-
NOT_ENOUGH_MIN_JOIN_POOL = "NOT_ENOUGH_MIN_JOIN_POOL",
|
|
7
|
-
OK = "OK"
|
|
8
|
-
}
|
|
9
4
|
export interface YieldProcessValidation {
|
|
10
5
|
ok: boolean;
|
|
11
6
|
status: YieldValidationStatus;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
export let YieldValidationStatus;
|
|
5
|
-
(function (YieldValidationStatus) {
|
|
6
|
-
YieldValidationStatus["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
|
|
7
|
-
YieldValidationStatus["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
|
|
8
|
-
YieldValidationStatus["NOT_ENOUGH_MIN_JOIN_POOL"] = "NOT_ENOUGH_MIN_JOIN_POOL";
|
|
9
|
-
YieldValidationStatus["OK"] = "OK";
|
|
10
|
-
})(YieldValidationStatus || (YieldValidationStatus = {}));
|
|
1
|
+
export {};
|