From 7c7a25989e9ad45387040667d65e874a4954eb80 Mon Sep 17 00:00:00 2001 From: AnhMTV Date: Mon, 20 Mar 2023 16:52:24 +0700 Subject: [PATCH] Move extension-koni-base to extension/base/koni => Make other migration more easier --- packages/extension-base/package.json | 1 - .../src/koni}/api/coingecko.ts | 0 .../src/koni}/api/donate.ts | 0 .../src/koni}/api/dotsama/balance.ts | 12 +- .../src/koni}/api/dotsama/crowdloan.ts | 4 +- .../src/koni}/api/dotsama/ignore-api.spec.ts | 2 +- .../src/koni}/api/dotsama/parseTransaction.ts | 0 .../src/koni}/api/dotsama/transfer.ts | 4 +- .../src/koni}/api/dotsama/typeRegistry.ts | 0 .../src/koni}/api/nft/acala_nft/index.ts | 4 +- .../src/koni}/api/nft/bit.country/index.ts | 6 +- .../src/koni}/api/nft/config.ts | 0 .../src/koni}/api/nft/evm_nft/index.ts | 4 +- .../src/koni}/api/nft/index.ts | 18 +- .../src/koni}/api/nft/karura_nft/index.ts | 4 +- .../src/koni}/api/nft/nft.ts | 2 +- .../src/koni}/api/nft/quartz_nft/index.ts | 2 +- .../src/koni}/api/nft/quartz_nft/protobuf.ts | 0 .../src/koni}/api/nft/rmrk_nft/index.ts | 2 +- .../src/koni}/api/nft/statemine_nft/index.ts | 2 +- .../src/koni}/api/nft/transfer.ts | 2 +- .../api/nft/unique_nft/ignore-test.spec.ts | 2 +- .../src/koni}/api/nft/unique_nft/index.ts | 2 +- .../src/koni}/api/nft/unique_nft/protobuf.ts | 0 .../koni}/api/nft/unique_nft/runtime_types.ts | 0 .../koni}/api/nft/unique_nft/uniqueNftV2.ts | 4 +- .../src/koni}/api/nft/wasm_nft/index.ts | 6 +- .../src/koni}/api/nft/wasm_nft/utils.ts | 0 .../koni}/api/staking/bonding/amplitude.ts | 2 +- .../src/koni}/api/staking/bonding/astar.ts | 4 +- .../src/koni}/api/staking/bonding/index.ts | 8 +- .../koni}/api/staking/bonding/paraChain.ts | 2 +- .../koni}/api/staking/bonding/relayChain.ts | 2 +- .../src/koni}/api/staking/bonding/utils.ts | 0 .../src/koni}/api/staking/config.ts | 0 .../src/koni}/api/staking/index.ts | 6 +- .../src/koni}/api/staking/paraChain.ts | 0 .../src/koni}/api/staking/relayChain.ts | 0 .../src/koni}/api/staking/subsquidStaking.ts | 2 +- .../src/koni}/api/staking/utils.ts | 0 .../subquery/__generated__/DotSamaHistory.ts | 0 .../src/koni}/api/subquery/codegen.md | 0 .../src/koni}/api/subquery/subquery.ts | 0 .../src/koni}/api/tokens/evm/balance.ts | 2 +- .../src/koni}/api/tokens/evm/transfer.ts | 4 +- .../src/koni}/api/tokens/evm/web3.ts | 2 +- .../src/koni}/api/tokens/index.ts | 2 +- .../src/koni}/api/tokens/wasm/index.ts | 4 +- .../src/koni}/api/xcm/astar.ts | 2 +- .../src/koni}/api/xcm/index.ts | 10 +- .../src/koni}/api/xcm/moonbeamXcm.ts | 4 +- .../src/koni}/api/xcm/statemintXcm.ts | 4 +- .../src/koni}/api/xcm/substrateXcm.ts | 4 +- .../src/koni}/api/xcm/utils.ts | 2 +- .../src/koni}/background/cron.ts | 4 +- .../src/koni}/background/events.ts | 2 +- .../koni}/background/handlers/Extension.ts | 22 +- .../src/koni}/background/handlers/State.ts | 4 +- .../src/koni}/background/handlers/Tabs.ts | 2 +- .../src/koni}/background/handlers/index.ts | 10 +- .../background/helper/eth-simple-keyring.d.ts | 0 .../src/koni}/background/subscription.ts | 14 +- .../src/koni}/migration/Base.ts | 2 +- .../src/koni}/migration/index.ts | 2 +- .../migration/scripts/ChangeRouteToHome.ts | 2 +- .../migration/scripts/ClearOldStorage.ts | 2 +- .../migration/scripts/RemoveWrongCrowdloan.ts | 2 +- ...emoveWrongTransactionHistoriesFromStore.ts | 2 +- .../ResetTransactionHistoryEventIdx.ts | 2 +- .../src/koni}/migration/scripts/index.ts | 6 +- .../src/koni}/page/SubWalleEvmProvider.ts | 0 .../src/koni}/page/index.ts | 2 +- .../src/services/chain-service/constants.ts | 2 +- .../services/chain-service/helper/index.ts | 2 +- .../src/services/chain-service/types.ts | 2 +- .../src/services/chain-service/utils.ts | 2 +- .../src/services/history-service/index.ts | 2 +- packages/extension-base/src/utils/eth.ts | 2 +- .../src/utils/eth/parseTransaction/base.ts | 2 +- .../src/utils/ignore-utils.spec.ts | 2 +- packages/extension-base/src/utils/keyring.ts | 2 +- packages/extension-base/src/utils/request.ts | 2 +- packages/extension-koni-base/LICENSE | 201 ------------------ packages/extension-koni-base/README.md | 10 - packages/extension-koni-base/package.json | 95 --------- .../extension-koni-base/src/detectOther.ts | 6 - .../extension-koni-base/src/detectPackage.ts | 11 - packages/extension-koni-base/src/index.ts | 4 - .../extension-koni-base/src/packageInfo.ts | 6 - .../extension-koni-base/tsconfig.build.json | 14 -- packages/extension-koni-base/tsconfig.json | 12 -- packages/extension-koni-ui/package.json | 1 - .../Popup/Home/Staking/StakingDetailModal.tsx | 2 +- .../src/Popup/Transaction/Stake.tsx | 2 +- .../src/components/Field/PoolSelector.tsx | 13 +- .../Modal/Staking/PoolDetailModal.tsx | 10 +- .../StakingItem/StakingPoolItem.tsx | 4 +- .../extension-koni-ui/src/stores/types.ts | 22 +- .../extension-koni-ui/tsconfig.build.json | 2 - packages/extension-koni-ui/tsconfig.json | 1 - packages/extension-koni/package.json | 1 - .../public/locales/en/translation.json | 16 +- packages/extension-koni/src/background.ts | 4 +- packages/extension-koni/src/page.ts | 2 +- packages/extension-koni/tsconfig.build.json | 2 - packages/extension-koni/tsconfig.json | 1 - packages/extension-koni/webpack.shared.cjs | 1 - packages/web-runner/package.json | 1 - packages/web-runner/src/messageHandle.ts | 2 +- packages/web-runner/src/webRunner.ts | 2 +- packages/web-runner/tsconfig.build.json | 2 - packages/web-runner/tsconfig.json | 1 - packages/web-runner/webpack.config.cjs | 1 - rollup.config.mjs | 2 +- tsconfig.base.json | 2 - tsconfig.build.json | 3 +- tsconfig.json | 1 - yarn.lock | 83 -------- 118 files changed, 160 insertions(+), 632 deletions(-) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/coingecko.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/donate.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/dotsama/balance.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/dotsama/crowdloan.ts (97%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/dotsama/ignore-api.spec.ts (93%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/dotsama/parseTransaction.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/dotsama/transfer.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/dotsama/typeRegistry.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/acala_nft/index.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/bit.country/index.ts (96%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/config.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/evm_nft/index.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/index.ts (91%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/karura_nft/index.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/nft.ts (97%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/quartz_nft/index.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/quartz_nft/protobuf.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/rmrk_nft/index.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/statemine_nft/index.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/transfer.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/unique_nft/ignore-test.spec.ts (93%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/unique_nft/index.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/unique_nft/protobuf.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/unique_nft/runtime_types.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/unique_nft/uniqueNftV2.ts (94%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/wasm_nft/index.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/nft/wasm_nft/utils.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/bonding/amplitude.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/bonding/astar.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/bonding/index.ts (96%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/bonding/paraChain.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/bonding/relayChain.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/bonding/utils.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/config.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/index.ts (94%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/paraChain.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/relayChain.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/subsquidStaking.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/staking/utils.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/subquery/__generated__/DotSamaHistory.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/subquery/codegen.md (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/subquery/subquery.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/tokens/evm/balance.ts (84%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/tokens/evm/transfer.ts (97%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/tokens/evm/web3.ts (88%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/tokens/index.ts (83%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/tokens/wasm/index.ts (96%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/xcm/astar.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/xcm/index.ts (97%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/xcm/moonbeamXcm.ts (96%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/xcm/statemintXcm.ts (97%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/xcm/substrateXcm.ts (98%) rename packages/{extension-koni-base/src => extension-base/src/koni}/api/xcm/utils.ts (96%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/cron.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/events.ts (74%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/handlers/Extension.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/handlers/State.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/handlers/Tabs.ts (99%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/handlers/index.ts (88%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/helper/eth-simple-keyring.d.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/background/subscription.ts (97%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/Base.ts (89%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/index.ts (95%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/scripts/ChangeRouteToHome.ts (92%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/scripts/ClearOldStorage.ts (89%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/scripts/RemoveWrongCrowdloan.ts (86%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/scripts/RemoveWrongTransactionHistoriesFromStore.ts (95%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/scripts/ResetTransactionHistoryEventIdx.ts (89%) rename packages/{extension-koni-base/src => extension-base/src/koni}/migration/scripts/index.ts (78%) rename packages/{extension-koni-base/src => extension-base/src/koni}/page/SubWalleEvmProvider.ts (100%) rename packages/{extension-koni-base/src => extension-base/src/koni}/page/index.ts (81%) delete mode 100644 packages/extension-koni-base/LICENSE delete mode 100644 packages/extension-koni-base/README.md delete mode 100644 packages/extension-koni-base/package.json delete mode 100644 packages/extension-koni-base/src/detectOther.ts delete mode 100644 packages/extension-koni-base/src/detectPackage.ts delete mode 100644 packages/extension-koni-base/src/index.ts delete mode 100644 packages/extension-koni-base/src/packageInfo.ts delete mode 100644 packages/extension-koni-base/tsconfig.build.json delete mode 100644 packages/extension-koni-base/tsconfig.json diff --git a/packages/extension-base/package.json b/packages/extension-base/package.json index e14350ffc4..822cc777d3 100644 --- a/packages/extension-base/package.json +++ b/packages/extension-base/package.json @@ -79,7 +79,6 @@ "@subwallet/extension-chains": "^0.8.1", "@subwallet/extension-dapp": "^0.8.1", "@subwallet/extension-inject": "^0.8.1", - "@subwallet/extension-koni-base": "^0.8.1", "@subwallet/keyring": "^0.0.4", "@subwallet/ui-keyring": "^0.0.3", "@unique-nft/types": "^0.6.0-4", diff --git a/packages/extension-koni-base/src/api/coingecko.ts b/packages/extension-base/src/koni/api/coingecko.ts similarity index 100% rename from packages/extension-koni-base/src/api/coingecko.ts rename to packages/extension-base/src/koni/api/coingecko.ts diff --git a/packages/extension-koni-base/src/api/donate.ts b/packages/extension-base/src/koni/api/donate.ts similarity index 100% rename from packages/extension-koni-base/src/api/donate.ts rename to packages/extension-base/src/koni/api/donate.ts diff --git a/packages/extension-koni-base/src/api/dotsama/balance.ts b/packages/extension-base/src/koni/api/dotsama/balance.ts similarity index 98% rename from packages/extension-koni-base/src/api/dotsama/balance.ts rename to packages/extension-base/src/koni/api/dotsama/balance.ts index 89b58bd895..d2bd246b2f 100644 --- a/packages/extension-koni-base/src/api/dotsama/balance.ts +++ b/packages/extension-base/src/koni/api/dotsama/balance.ts @@ -1,19 +1,19 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { SignedBalance } from '@equilab/api/genshiro/interfaces'; import { _AssetType, _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; import { APIItemState, BalanceItem, TokenBalanceRaw } from '@subwallet/extension-base/background/KoniTypes'; import { ASTAR_REFRESH_BALANCE_INTERVAL, SUB_TOKEN_REFRESH_BALANCE_INTERVAL, SUBSCRIBE_BALANCE_FAST_INTERVAL } from '@subwallet/extension-base/constants'; +import { PalletNominationPoolsPoolMember } from '@subwallet/extension-base/koni/api/staking/bonding/utils'; +import { getEVMBalance } from '@subwallet/extension-base/koni/api/tokens/evm/balance'; +import { getERC20Contract } from '@subwallet/extension-base/koni/api/tokens/evm/web3'; +import { getPSP22ContractPromise } from '@subwallet/extension-base/koni/api/tokens/wasm'; +import { state } from '@subwallet/extension-base/koni/background/handlers'; import { _BALANCE_CHAIN_GROUP, _BALANCE_TOKEN_GROUP, _PURE_EVM_CHAINS } from '@subwallet/extension-base/services/chain-service/constants'; import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _checkSmartContractSupportByChain, _getChainNativeTokenSlug, _getContractAddressOfToken, _getTokenOnChainAssetId, _getTokenOnChainInfo, _isChainEvmCompatible, _isNativeToken, _isPureEvmChain, _isSmartContractToken } from '@subwallet/extension-base/services/chain-service/utils'; import { categoryAddresses, sumBN } from '@subwallet/extension-base/utils'; -import { PalletNominationPoolsPoolMember } from '@subwallet/extension-koni-base/api/staking/bonding/utils'; -import { getEVMBalance } from '@subwallet/extension-koni-base/api/tokens/evm/balance'; -import { getERC20Contract } from '@subwallet/extension-koni-base/api/tokens/evm/web3'; -import { getPSP22ContractPromise } from '@subwallet/extension-koni-base/api/tokens/wasm'; -import { state } from '@subwallet/extension-koni-base/background/handlers'; import { Contract } from 'web3-eth-contract'; import { ApiPromise } from '@polkadot/api'; diff --git a/packages/extension-koni-base/src/api/dotsama/crowdloan.ts b/packages/extension-base/src/koni/api/dotsama/crowdloan.ts similarity index 97% rename from packages/extension-koni-base/src/api/dotsama/crowdloan.ts rename to packages/extension-base/src/koni/api/dotsama/crowdloan.ts index 60ed20a09a..50ce377748 100644 --- a/packages/extension-koni-base/src/api/dotsama/crowdloan.ts +++ b/packages/extension-base/src/koni/api/dotsama/crowdloan.ts @@ -1,14 +1,14 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { COMMON_CHAIN_SLUGS } from '@subwallet/chain-list'; import { _ChainInfo } from '@subwallet/chain-list/types'; import { APIItemState, CrowdloanItem, CrowdloanParaState } from '@subwallet/extension-base/background/KoniTypes'; import { ACALA_REFRESH_CROWDLOAN_INTERVAL } from '@subwallet/extension-base/constants'; +import registry from '@subwallet/extension-base/koni/api/dotsama/typeRegistry'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getChainSubstrateAddressPrefix, _getSubstrateParaId, _getSubstrateRelayParent, _isChainEvmCompatible, _isSubstrateParachain } from '@subwallet/extension-base/services/chain-service/utils'; import { categoryAddresses, reformatAddress } from '@subwallet/extension-base/utils'; -import registry from '@subwallet/extension-koni-base/api/dotsama/typeRegistry'; import axios from 'axios'; import { ApiPromise } from '@polkadot/api'; diff --git a/packages/extension-koni-base/src/api/dotsama/ignore-api.spec.ts b/packages/extension-base/src/koni/api/dotsama/ignore-api.spec.ts similarity index 93% rename from packages/extension-koni-base/src/api/dotsama/ignore-api.spec.ts rename to packages/extension-base/src/koni/api/dotsama/ignore-api.spec.ts index 3865a9612a..f51c5fab71 100644 --- a/packages/extension-koni-base/src/api/dotsama/ignore-api.spec.ts +++ b/packages/extension-base/src/koni/api/dotsama/ignore-api.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 jest.setTimeout(50000); diff --git a/packages/extension-koni-base/src/api/dotsama/parseTransaction.ts b/packages/extension-base/src/koni/api/dotsama/parseTransaction.ts similarity index 100% rename from packages/extension-koni-base/src/api/dotsama/parseTransaction.ts rename to packages/extension-base/src/koni/api/dotsama/parseTransaction.ts diff --git a/packages/extension-koni-base/src/api/dotsama/transfer.ts b/packages/extension-base/src/koni/api/dotsama/transfer.ts similarity index 98% rename from packages/extension-koni-base/src/api/dotsama/transfer.ts rename to packages/extension-base/src/koni/api/dotsama/transfer.ts index c4533ccc74..dd12fc23d6 100644 --- a/packages/extension-koni-base/src/api/dotsama/transfer.ts +++ b/packages/extension-base/src/koni/api/dotsama/transfer.ts @@ -1,13 +1,13 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError'; import { BasicTxErrorType, SupportTransferResponse, TransactionResponse } from '@subwallet/extension-base/background/KoniTypes'; +import { getPSP22ContractPromise } from '@subwallet/extension-base/koni/api/tokens/wasm'; import { _BALANCE_TOKEN_GROUP, _TRANSFER_CHAIN_GROUP, _TRANSFER_NOT_SUPPORTED_CHAINS } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getContractAddressOfToken, _getTokenOnChainAssetId, _getTokenOnChainInfo, _isChainEvmCompatible, _isNativeToken, _isTokenWasmSmartContract } from '@subwallet/extension-base/services/chain-service/utils'; -import { getPSP22ContractPromise } from '@subwallet/extension-koni-base/api/tokens/wasm'; import { KeyringPair } from '@subwallet/keyring/types'; import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; diff --git a/packages/extension-koni-base/src/api/dotsama/typeRegistry.ts b/packages/extension-base/src/koni/api/dotsama/typeRegistry.ts similarity index 100% rename from packages/extension-koni-base/src/api/dotsama/typeRegistry.ts rename to packages/extension-base/src/koni/api/dotsama/typeRegistry.ts diff --git a/packages/extension-koni-base/src/api/nft/acala_nft/index.ts b/packages/extension-base/src/koni/api/nft/acala_nft/index.ts similarity index 98% rename from packages/extension-koni-base/src/api/nft/acala_nft/index.ts rename to packages/extension-base/src/koni/api/nft/acala_nft/index.ts index aa09d75ca6..43e5d20cf3 100644 --- a/packages/extension-koni-base/src/api/nft/acala_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/acala_nft/index.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { getRandomIpfsGateway } from '@subwallet/extension-base/koni/api/nft/config'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { isUrl } from '@subwallet/extension-base/utils'; -import { getRandomIpfsGateway } from '@subwallet/extension-koni-base/api/nft/config'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import fetch from 'cross-fetch'; interface AssetId { diff --git a/packages/extension-koni-base/src/api/nft/bit.country/index.ts b/packages/extension-base/src/koni/api/nft/bit.country/index.ts similarity index 96% rename from packages/extension-koni-base/src/api/nft/bit.country/index.ts rename to packages/extension-base/src/koni/api/nft/bit.country/index.ts index f36ead791d..261f953fd7 100644 --- a/packages/extension-koni-base/src/api/nft/bit.country/index.ts +++ b/packages/extension-base/src/koni/api/nft/bit.country/index.ts @@ -1,11 +1,11 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { BIT_COUNTRY_SERVER } from '@subwallet/extension-base/koni/api/nft/config'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { isUrl } from '@subwallet/extension-base/utils'; -import { BIT_COUNTRY_SERVER } from '@subwallet/extension-koni-base/api/nft/config'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import fetch from 'cross-fetch'; interface AssetId { diff --git a/packages/extension-koni-base/src/api/nft/config.ts b/packages/extension-base/src/koni/api/nft/config.ts similarity index 100% rename from packages/extension-koni-base/src/api/nft/config.ts rename to packages/extension-base/src/koni/api/nft/config.ts diff --git a/packages/extension-koni-base/src/api/nft/evm_nft/index.ts b/packages/extension-base/src/koni/api/nft/evm_nft/index.ts similarity index 98% rename from packages/extension-koni-base/src/api/nft/evm_nft/index.ts rename to packages/extension-base/src/koni/api/nft/evm_nft/index.ts index 021833e1d1..8a8f7cc744 100644 --- a/packages/extension-koni-base/src/api/nft/evm_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/evm_nft/index.ts @@ -3,12 +3,12 @@ import { _AssetType, _ChainAsset } from '@subwallet/chain-list/types'; import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { getRandomIpfsGateway } from '@subwallet/extension-base/koni/api/nft/config'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { _ERC721_ABI } from '@subwallet/extension-base/services/chain-service/helper'; import { _EvmApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getContractAddressOfToken } from '@subwallet/extension-base/services/chain-service/utils'; import { isUrl } from '@subwallet/extension-base/utils'; -import { getRandomIpfsGateway } from '@subwallet/extension-koni-base/api/nft/config'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import fetch from 'cross-fetch'; import { isEthereumAddress } from '@polkadot/util-crypto'; diff --git a/packages/extension-koni-base/src/api/nft/index.ts b/packages/extension-base/src/koni/api/nft/index.ts similarity index 91% rename from packages/extension-koni-base/src/api/nft/index.ts rename to packages/extension-base/src/koni/api/nft/index.ts index 1cc52ed0f0..1a8bef739d 100644 --- a/packages/extension-koni-base/src/api/nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/index.ts @@ -3,19 +3,19 @@ import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { AcalaNftApi } from '@subwallet/extension-base/koni/api/nft/acala_nft'; +import { BitCountryNftApi } from '@subwallet/extension-base/koni/api/nft/bit.country'; +import { EvmNftApi } from '@subwallet/extension-base/koni/api/nft/evm_nft'; +import { KaruraNftApi } from '@subwallet/extension-base/koni/api/nft/karura_nft'; +import { BaseNftApi } from '@subwallet/extension-base/koni/api/nft/nft'; +import { RmrkNftApi } from '@subwallet/extension-base/koni/api/nft/rmrk_nft'; +import StatemineNftApi from '@subwallet/extension-base/koni/api/nft/statemine_nft'; +import UniqueNftApi from '@subwallet/extension-base/koni/api/nft/unique_nft'; +import { WasmNftApi } from '@subwallet/extension-base/koni/api/nft/wasm_nft'; import { _NFT_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants'; import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _isChainSupportEvmNft, _isChainSupportNativeNft, _isChainSupportWasmNft } from '@subwallet/extension-base/services/chain-service/utils'; import { categoryAddresses } from '@subwallet/extension-base/utils'; -import { AcalaNftApi } from '@subwallet/extension-koni-base/api/nft/acala_nft'; -import { BitCountryNftApi } from '@subwallet/extension-koni-base/api/nft/bit.country'; -import { EvmNftApi } from '@subwallet/extension-koni-base/api/nft/evm_nft'; -import { KaruraNftApi } from '@subwallet/extension-koni-base/api/nft/karura_nft'; -import { BaseNftApi } from '@subwallet/extension-koni-base/api/nft/nft'; -import { RmrkNftApi } from '@subwallet/extension-koni-base/api/nft/rmrk_nft'; -import StatemineNftApi from '@subwallet/extension-koni-base/api/nft/statemine_nft'; -import UniqueNftApi from '@subwallet/extension-koni-base/api/nft/unique_nft'; -import { WasmNftApi } from '@subwallet/extension-koni-base/api/nft/wasm_nft'; function createSubstrateNftApi (chain: string, substrateApi: _SubstrateApi | null, addresses: string[]): BaseNftApi | null { const [substrateAddresses] = categoryAddresses(addresses); diff --git a/packages/extension-koni-base/src/api/nft/karura_nft/index.ts b/packages/extension-base/src/koni/api/nft/karura_nft/index.ts similarity index 98% rename from packages/extension-koni-base/src/api/nft/karura_nft/index.ts rename to packages/extension-base/src/koni/api/nft/karura_nft/index.ts index cd9bc0fbe7..de07f23764 100644 --- a/packages/extension-koni-base/src/api/nft/karura_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/karura_nft/index.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { getRandomIpfsGateway } from '@subwallet/extension-base/koni/api/nft/config'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { isUrl } from '@subwallet/extension-base/utils'; -import { getRandomIpfsGateway } from '@subwallet/extension-koni-base/api/nft/config'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import fetch from 'cross-fetch'; interface AssetId { diff --git a/packages/extension-koni-base/src/api/nft/nft.ts b/packages/extension-base/src/koni/api/nft/nft.ts similarity index 97% rename from packages/extension-koni-base/src/api/nft/nft.ts rename to packages/extension-base/src/koni/api/nft/nft.ts index fa67bfa0c9..4964e78e7c 100644 --- a/packages/extension-koni-base/src/api/nft/nft.ts +++ b/packages/extension-base/src/koni/api/nft/nft.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { getRandomIpfsGateway } from '@subwallet/extension-base/koni/api/nft/config'; import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { isUrl } from '@subwallet/extension-base/utils'; -import { getRandomIpfsGateway } from '@subwallet/extension-koni-base/api/nft/config'; export interface HandleNftParams { updateItem: (chain: string, data: NftItem, owner: string) => void, diff --git a/packages/extension-koni-base/src/api/nft/quartz_nft/index.ts b/packages/extension-base/src/koni/api/nft/quartz_nft/index.ts similarity index 99% rename from packages/extension-koni-base/src/api/nft/quartz_nft/index.ts rename to packages/extension-base/src/koni/api/nft/quartz_nft/index.ts index 6741e17615..f722b04b9a 100644 --- a/packages/extension-koni-base/src/api/nft/quartz_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/quartz_nft/index.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { hexToStr, hexToUTF16, parseIpfsLink, utf16ToString } from '@subwallet/extension-base/utils'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import { deserializeNft } from './protobuf'; diff --git a/packages/extension-koni-base/src/api/nft/quartz_nft/protobuf.ts b/packages/extension-base/src/koni/api/nft/quartz_nft/protobuf.ts similarity index 100% rename from packages/extension-koni-base/src/api/nft/quartz_nft/protobuf.ts rename to packages/extension-base/src/koni/api/nft/quartz_nft/protobuf.ts diff --git a/packages/extension-koni-base/src/api/nft/rmrk_nft/index.ts b/packages/extension-base/src/koni/api/nft/rmrk_nft/index.ts similarity index 99% rename from packages/extension-koni-base/src/api/nft/rmrk_nft/index.ts rename to packages/extension-base/src/koni/api/nft/rmrk_nft/index.ts index 8e9f2959aa..d1950a2933 100644 --- a/packages/extension-koni-base/src/api/nft/rmrk_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/rmrk_nft/index.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem, RMRK_VER } from '@subwallet/extension-base/background/KoniTypes'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { isUrl, reformatAddress } from '@subwallet/extension-base/utils'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import fetch from 'cross-fetch'; import { getRandomIpfsGateway, SINGULAR_V1_COLLECTION_ENDPOINT, SINGULAR_V1_ENDPOINT, SINGULAR_V2_COLLECTION_ENDPOINT, SINGULAR_V2_ENDPOINT } from '../config'; diff --git a/packages/extension-koni-base/src/api/nft/statemine_nft/index.ts b/packages/extension-base/src/koni/api/nft/statemine_nft/index.ts similarity index 99% rename from packages/extension-koni-base/src/api/nft/statemine_nft/index.ts rename to packages/extension-base/src/koni/api/nft/statemine_nft/index.ts index 0337cb3c2f..ab1154ff21 100644 --- a/packages/extension-koni-base/src/api/nft/statemine_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/statemine_nft/index.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { isUrl } from '@subwallet/extension-base/utils'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import fetch from 'cross-fetch'; interface AssetId { diff --git a/packages/extension-koni-base/src/api/nft/transfer.ts b/packages/extension-base/src/koni/api/nft/transfer.ts similarity index 99% rename from packages/extension-koni-base/src/api/nft/transfer.ts rename to packages/extension-base/src/koni/api/nft/transfer.ts index 746d3a3fe1..3b868ea586 100644 --- a/packages/extension-koni-base/src/api/nft/transfer.ts +++ b/packages/extension-base/src/koni/api/nft/transfer.ts @@ -3,9 +3,9 @@ import { TransactionError } from '@subwallet/extension-base/background/errors/TransactionError'; import { BasicTxErrorType } from '@subwallet/extension-base/background/KoniTypes'; +import { SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME } from '@subwallet/extension-base/koni/api/nft/config'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { reformatAddress } from '@subwallet/extension-base/utils'; -import { SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME } from '@subwallet/extension-koni-base/api/nft/config'; import { ApiPromise } from '@polkadot/api'; diff --git a/packages/extension-koni-base/src/api/nft/unique_nft/ignore-test.spec.ts b/packages/extension-base/src/koni/api/nft/unique_nft/ignore-test.spec.ts similarity index 93% rename from packages/extension-koni-base/src/api/nft/unique_nft/ignore-test.spec.ts rename to packages/extension-base/src/koni/api/nft/unique_nft/ignore-test.spec.ts index 9ec69eb3de..76fedf16b1 100644 --- a/packages/extension-koni-base/src/api/nft/unique_nft/ignore-test.spec.ts +++ b/packages/extension-base/src/koni/api/nft/unique_nft/ignore-test.spec.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; -import { UniqueNftApiV2 } from '@subwallet/extension-koni-base/api/nft/unique_nft/uniqueNftV2'; +import { UniqueNftApiV2 } from '@subwallet/extension-base/koni/api/nft/unique_nft/uniqueNftV2'; jest.setTimeout(50000); diff --git a/packages/extension-koni-base/src/api/nft/unique_nft/index.ts b/packages/extension-base/src/koni/api/nft/unique_nft/index.ts similarity index 99% rename from packages/extension-koni-base/src/api/nft/unique_nft/index.ts rename to packages/extension-base/src/koni/api/nft/unique_nft/index.ts index b517e7ea67..8973741307 100644 --- a/packages/extension-koni-base/src/api/nft/unique_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/unique_nft/index.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { hexToStr, hexToUTF16, utf16ToString } from '@subwallet/extension-base/utils'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; import { deserializeNft } from './protobuf'; diff --git a/packages/extension-koni-base/src/api/nft/unique_nft/protobuf.ts b/packages/extension-base/src/koni/api/nft/unique_nft/protobuf.ts similarity index 100% rename from packages/extension-koni-base/src/api/nft/unique_nft/protobuf.ts rename to packages/extension-base/src/koni/api/nft/unique_nft/protobuf.ts diff --git a/packages/extension-koni-base/src/api/nft/unique_nft/runtime_types.ts b/packages/extension-base/src/koni/api/nft/unique_nft/runtime_types.ts similarity index 100% rename from packages/extension-koni-base/src/api/nft/unique_nft/runtime_types.ts rename to packages/extension-base/src/koni/api/nft/unique_nft/runtime_types.ts diff --git a/packages/extension-koni-base/src/api/nft/unique_nft/uniqueNftV2.ts b/packages/extension-base/src/koni/api/nft/unique_nft/uniqueNftV2.ts similarity index 94% rename from packages/extension-koni-base/src/api/nft/unique_nft/uniqueNftV2.ts rename to packages/extension-base/src/koni/api/nft/unique_nft/uniqueNftV2.ts index 282e93e4bd..10fd93473c 100644 --- a/packages/extension-koni-base/src/api/nft/unique_nft/uniqueNftV2.ts +++ b/packages/extension-base/src/koni/api/nft/unique_nft/uniqueNftV2.ts @@ -1,8 +1,8 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { UNIQUE_SCAN_ENDPOINT } from '@subwallet/extension-koni-base/api/nft/config'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; +import { UNIQUE_SCAN_ENDPOINT } from '@subwallet/extension-base/koni/api/nft/config'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; import fetch from 'cross-fetch'; interface NftData { diff --git a/packages/extension-koni-base/src/api/nft/wasm_nft/index.ts b/packages/extension-base/src/koni/api/nft/wasm_nft/index.ts similarity index 98% rename from packages/extension-koni-base/src/api/nft/wasm_nft/index.ts rename to packages/extension-base/src/koni/api/nft/wasm_nft/index.ts index 2e6f933e15..f78cd838ba 100644 --- a/packages/extension-koni-base/src/api/nft/wasm_nft/index.ts +++ b/packages/extension-base/src/koni/api/nft/wasm_nft/index.ts @@ -3,11 +3,11 @@ import { _AssetType, _ChainAsset } from '@subwallet/chain-list/types'; import { NftCollection, NftItem } from '@subwallet/extension-base/background/KoniTypes'; +import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft'; +import { ART_ZERO_COLLECTION_API, ART_ZERO_CONTRACTS, ART_ZERO_EXTERNAL_URL, ART_ZERO_IMAGE_API, ART_ZERO_IPFS_API } from '@subwallet/extension-base/koni/api/nft/wasm_nft/utils'; +import { getPSP34ContractPromise } from '@subwallet/extension-base/koni/api/tokens/wasm'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getContractAddressOfToken } from '@subwallet/extension-base/services/chain-service/utils'; -import { BaseNftApi, HandleNftParams } from '@subwallet/extension-koni-base/api/nft/nft'; -import { ART_ZERO_COLLECTION_API, ART_ZERO_CONTRACTS, ART_ZERO_EXTERNAL_URL, ART_ZERO_IMAGE_API, ART_ZERO_IPFS_API } from '@subwallet/extension-koni-base/api/nft/wasm_nft/utils'; -import { getPSP34ContractPromise } from '@subwallet/extension-koni-base/api/tokens/wasm'; import fetch from 'cross-fetch'; import { ApiPromise } from '@polkadot/api'; diff --git a/packages/extension-koni-base/src/api/nft/wasm_nft/utils.ts b/packages/extension-base/src/koni/api/nft/wasm_nft/utils.ts similarity index 100% rename from packages/extension-koni-base/src/api/nft/wasm_nft/utils.ts rename to packages/extension-base/src/koni/api/nft/wasm_nft/utils.ts diff --git a/packages/extension-koni-base/src/api/staking/bonding/amplitude.ts b/packages/extension-base/src/koni/api/staking/bonding/amplitude.ts similarity index 99% rename from packages/extension-koni-base/src/api/staking/bonding/amplitude.ts rename to packages/extension-base/src/koni/api/staking/bonding/amplitude.ts index 5a2ede9351..6c41c86ce7 100644 --- a/packages/extension-koni-base/src/api/staking/bonding/amplitude.ts +++ b/packages/extension-base/src/koni/api/staking/bonding/amplitude.ts @@ -3,10 +3,10 @@ import { _ChainInfo } from '@subwallet/chain-list/types'; import { ChainStakingMetadata, NominationInfo, NominatorMetadata, StakingType, UnstakingInfo, UnstakingStatus, ValidatorInfo } from '@subwallet/extension-base/background/KoniTypes'; +import { BlockHeader, getBondedValidators, isUnstakeAll, PalletIdentityRegistration, ParachainStakingStakeOption, parseIdentity } from '@subwallet/extension-base/koni/api/staking/bonding/utils'; import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { parseRawNumber } from '@subwallet/extension-base/utils'; -import { BlockHeader, getBondedValidators, isUnstakeAll, PalletIdentityRegistration, ParachainStakingStakeOption, parseIdentity } from '@subwallet/extension-koni-base/api/staking/bonding/utils'; import { BN } from '@polkadot/util'; import { isEthereumAddress } from '@polkadot/util-crypto'; diff --git a/packages/extension-koni-base/src/api/staking/bonding/astar.ts b/packages/extension-base/src/koni/api/staking/bonding/astar.ts similarity index 99% rename from packages/extension-koni-base/src/api/staking/bonding/astar.ts rename to packages/extension-base/src/koni/api/staking/bonding/astar.ts index 8e81f8dcd1..dcbb589a58 100644 --- a/packages/extension-koni-base/src/api/staking/bonding/astar.ts +++ b/packages/extension-base/src/koni/api/staking/bonding/astar.ts @@ -3,12 +3,12 @@ import { _ChainInfo } from '@subwallet/chain-list/types'; import { BasicTxInfo, ChainStakingMetadata, NominationInfo, NominatorMetadata, StakingType, UnlockingStakeInfo, UnstakingInfo, UnstakingStatus, ValidatorInfo } from '@subwallet/extension-base/background/KoniTypes'; +import { getFreeBalance } from '@subwallet/extension-base/koni/api/dotsama/balance'; +import { PalletDappsStakingAccountLedger, PalletDappsStakingDappInfo } from '@subwallet/extension-base/koni/api/staking/bonding/utils'; import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants'; import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getChainNativeTokenBasicInfo } from '@subwallet/extension-base/services/chain-service/utils'; import { isUrl, parseNumberToDisplay, parseRawNumber } from '@subwallet/extension-base/utils'; -import { getFreeBalance } from '@subwallet/extension-koni-base/api/dotsama/balance'; -import { PalletDappsStakingAccountLedger, PalletDappsStakingDappInfo } from '@subwallet/extension-koni-base/api/staking/bonding/utils'; import fetch from 'cross-fetch'; import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; diff --git a/packages/extension-koni-base/src/api/staking/bonding/index.ts b/packages/extension-base/src/koni/api/staking/bonding/index.ts similarity index 96% rename from packages/extension-koni-base/src/api/staking/bonding/index.ts rename to packages/extension-base/src/koni/api/staking/bonding/index.ts index a845ef24c8..d5582f6d75 100644 --- a/packages/extension-koni-base/src/api/staking/bonding/index.ts +++ b/packages/extension-base/src/koni/api/staking/bonding/index.ts @@ -3,12 +3,12 @@ import { _ChainInfo } from '@subwallet/chain-list/types'; import { ChainStakingMetadata, NominatorMetadata, StakingType, UnstakingInfo, ValidatorInfo } from '@subwallet/extension-base/background/KoniTypes'; +import { getAmplitudeBondingExtrinsic, getAmplitudeCancelWithdrawalExtrinsic, getAmplitudeClaimRewardExtrinsic, getAmplitudeCollatorsInfo, getAmplitudeNominatorMetadata, getAmplitudeStakingMetadata, getAmplitudeUnbondingExtrinsic, getAmplitudeWithdrawalExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding/amplitude'; +import { getAstarBondingExtrinsic, getAstarClaimRewardExtrinsic, getAstarDappsInfo, getAstarNominatorMetadata, getAstarStakingMetadata, getAstarUnbondingExtrinsic, getAstarWithdrawalExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding/astar'; +import { getParaBondingExtrinsic, getParaCancelWithdrawalExtrinsic, getParachainCollatorsInfo, getParaChainNominatorMetadata, getParaChainStakingMetadata, getParaUnbondingExtrinsic, getParaWithdrawalExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding/paraChain'; +import { getPoolingClaimRewardExtrinsic, getRelayBondingExtrinsic, getRelayCancelWithdrawalExtrinsic, getRelayChainNominatorMetadata, getRelayChainStakingMetadata, getRelayPoolsInfo, getRelayUnbondingExtrinsic, getRelayValidatorsInfo, getRelayWithdrawalExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding/relayChain'; import { _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; -import { getAmplitudeBondingExtrinsic, getAmplitudeCancelWithdrawalExtrinsic, getAmplitudeClaimRewardExtrinsic, getAmplitudeCollatorsInfo, getAmplitudeNominatorMetadata, getAmplitudeStakingMetadata, getAmplitudeUnbondingExtrinsic, getAmplitudeWithdrawalExtrinsic } from '@subwallet/extension-koni-base/api/staking/bonding/amplitude'; -import { getAstarBondingExtrinsic, getAstarClaimRewardExtrinsic, getAstarDappsInfo, getAstarNominatorMetadata, getAstarStakingMetadata, getAstarUnbondingExtrinsic, getAstarWithdrawalExtrinsic } from '@subwallet/extension-koni-base/api/staking/bonding/astar'; -import { getParaBondingExtrinsic, getParaCancelWithdrawalExtrinsic, getParachainCollatorsInfo, getParaChainNominatorMetadata, getParaChainStakingMetadata, getParaUnbondingExtrinsic, getParaWithdrawalExtrinsic } from '@subwallet/extension-koni-base/api/staking/bonding/paraChain'; -import { getPoolingClaimRewardExtrinsic, getRelayBondingExtrinsic, getRelayCancelWithdrawalExtrinsic, getRelayChainNominatorMetadata, getRelayChainStakingMetadata, getRelayPoolsInfo, getRelayUnbondingExtrinsic, getRelayValidatorsInfo, getRelayWithdrawalExtrinsic } from '@subwallet/extension-koni-base/api/staking/bonding/relayChain'; // all addresses must be converted to its chain format diff --git a/packages/extension-koni-base/src/api/staking/bonding/paraChain.ts b/packages/extension-base/src/koni/api/staking/bonding/paraChain.ts similarity index 99% rename from packages/extension-koni-base/src/api/staking/bonding/paraChain.ts rename to packages/extension-base/src/koni/api/staking/bonding/paraChain.ts index 9f0970ea12..9cb9fb5423 100644 --- a/packages/extension-koni-base/src/api/staking/bonding/paraChain.ts +++ b/packages/extension-base/src/koni/api/staking/bonding/paraChain.ts @@ -3,11 +3,11 @@ import { _ChainInfo } from '@subwallet/chain-list/types'; import { ChainStakingMetadata, NominationInfo, NominatorMetadata, StakingType, UnstakingInfo, UnstakingStatus, ValidatorInfo } from '@subwallet/extension-base/background/KoniTypes'; +import { getBondedValidators, getParaCurrentInflation, InflationConfig, isUnstakeAll, PalletIdentityRegistration, PalletParachainStakingDelegationRequestsScheduledRequest, PalletParachainStakingDelegator, ParachainStakingCandidateMetadata, parseIdentity, TuringOptimalCompoundFormat } from '@subwallet/extension-base/koni/api/staking/bonding/utils'; import { _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _isChainEvmCompatible } from '@subwallet/extension-base/services/chain-service/utils'; import { parseRawNumber, reformatAddress } from '@subwallet/extension-base/utils'; -import { getBondedValidators, getParaCurrentInflation, InflationConfig, isUnstakeAll, PalletIdentityRegistration, PalletParachainStakingDelegationRequestsScheduledRequest, PalletParachainStakingDelegator, ParachainStakingCandidateMetadata, parseIdentity, TuringOptimalCompoundFormat } from '@subwallet/extension-koni-base/api/staking/bonding/utils'; import { BN, BN_ZERO } from '@polkadot/util'; import { isEthereumAddress } from '@polkadot/util-crypto'; diff --git a/packages/extension-koni-base/src/api/staking/bonding/relayChain.ts b/packages/extension-base/src/koni/api/staking/bonding/relayChain.ts similarity index 99% rename from packages/extension-koni-base/src/api/staking/bonding/relayChain.ts rename to packages/extension-base/src/koni/api/staking/bonding/relayChain.ts index 80247d9d68..997e319b42 100644 --- a/packages/extension-koni-base/src/api/staking/bonding/relayChain.ts +++ b/packages/extension-base/src/koni/api/staking/bonding/relayChain.ts @@ -3,9 +3,9 @@ import { _ChainInfo } from '@subwallet/chain-list/types'; import { ChainStakingMetadata, NominationInfo, NominationPoolInfo, NominatorMetadata, PalletNominationPoolsBondedPoolInner, StakingType, UnstakingInfo, UnstakingStatus, ValidatorInfo } from '@subwallet/extension-base/background/KoniTypes'; +import { calculateAlephZeroValidatorReturn, calculateChainStakedReturn, calculateInflation, calculateValidatorStakedReturn, getCommission, PalletIdentityRegistration, PalletNominationPoolsPoolMember, parseIdentity, transformPoolName, ValidatorExtraInfo } from '@subwallet/extension-base/koni/api/staking/bonding/utils'; import { _STAKING_CHAIN_GROUP, _STAKING_ERA_LENGTH_MAP } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; -import { calculateAlephZeroValidatorReturn, calculateChainStakedReturn, calculateInflation, calculateValidatorStakedReturn, getCommission, PalletIdentityRegistration, PalletNominationPoolsPoolMember, parseIdentity, transformPoolName, ValidatorExtraInfo } from '@subwallet/extension-koni-base/api/staking/bonding/utils'; import { Bytes } from '@polkadot/types'; import { BN, BN_ZERO } from '@polkadot/util'; diff --git a/packages/extension-koni-base/src/api/staking/bonding/utils.ts b/packages/extension-base/src/koni/api/staking/bonding/utils.ts similarity index 100% rename from packages/extension-koni-base/src/api/staking/bonding/utils.ts rename to packages/extension-base/src/koni/api/staking/bonding/utils.ts diff --git a/packages/extension-koni-base/src/api/staking/config.ts b/packages/extension-base/src/koni/api/staking/config.ts similarity index 100% rename from packages/extension-koni-base/src/api/staking/config.ts rename to packages/extension-base/src/koni/api/staking/config.ts diff --git a/packages/extension-koni-base/src/api/staking/index.ts b/packages/extension-base/src/koni/api/staking/index.ts similarity index 94% rename from packages/extension-koni-base/src/api/staking/index.ts rename to packages/extension-base/src/koni/api/staking/index.ts index 9e6fb67b48..a38bbee08b 100644 --- a/packages/extension-koni-base/src/api/staking/index.ts +++ b/packages/extension-base/src/koni/api/staking/index.ts @@ -3,13 +3,13 @@ import { _ChainInfo } from '@subwallet/chain-list/types'; import { StakingItem, StakingRewardItem } from '@subwallet/extension-base/background/KoniTypes'; +import { getAmplitudeStakingOnChain, getAstarStakingOnChain, getParaStakingOnChain } from '@subwallet/extension-base/koni/api/staking/paraChain'; +import { getNominationPoolReward, getRelayPoolingOnChain, getRelayStakingOnChain } from '@subwallet/extension-base/koni/api/staking/relayChain'; +import { getAllSubsquidStaking } from '@subwallet/extension-base/koni/api/staking/subsquidStaking'; import { _PURE_EVM_CHAINS, _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _isChainEvmCompatible, _isChainSupportSubstrateStaking } from '@subwallet/extension-base/services/chain-service/utils'; import { categoryAddresses } from '@subwallet/extension-base/utils'; -import { getAmplitudeStakingOnChain, getAstarStakingOnChain, getParaStakingOnChain } from '@subwallet/extension-koni-base/api/staking/paraChain'; -import { getNominationPoolReward, getRelayPoolingOnChain, getRelayStakingOnChain } from '@subwallet/extension-koni-base/api/staking/relayChain'; -import { getAllSubsquidStaking } from '@subwallet/extension-koni-base/api/staking/subsquidStaking'; interface PromiseMapping { api: _SubstrateApi, diff --git a/packages/extension-koni-base/src/api/staking/paraChain.ts b/packages/extension-base/src/koni/api/staking/paraChain.ts similarity index 100% rename from packages/extension-koni-base/src/api/staking/paraChain.ts rename to packages/extension-base/src/koni/api/staking/paraChain.ts diff --git a/packages/extension-koni-base/src/api/staking/relayChain.ts b/packages/extension-base/src/koni/api/staking/relayChain.ts similarity index 100% rename from packages/extension-koni-base/src/api/staking/relayChain.ts rename to packages/extension-base/src/koni/api/staking/relayChain.ts diff --git a/packages/extension-koni-base/src/api/staking/subsquidStaking.ts b/packages/extension-base/src/koni/api/staking/subsquidStaking.ts similarity index 98% rename from packages/extension-koni-base/src/api/staking/subsquidStaking.ts rename to packages/extension-base/src/koni/api/staking/subsquidStaking.ts index cf679eead4..c51429fbcc 100644 --- a/packages/extension-koni-base/src/api/staking/subsquidStaking.ts +++ b/packages/extension-base/src/koni/api/staking/subsquidStaking.ts @@ -3,9 +3,9 @@ import { _ChainInfo } from '@subwallet/chain-list/types'; import { APIItemState, StakingRewardItem, StakingType } from '@subwallet/extension-base/background/KoniTypes'; +import { INDEXER_SUPPORTED_STAKING_CHAINS, SUBSQUID_ENDPOINTS } from '@subwallet/extension-base/koni/api/staking/config'; import { _getChainSubstrateAddressPrefix, _isChainEvmCompatible } from '@subwallet/extension-base/services/chain-service/utils'; import { reformatAddress } from '@subwallet/extension-base/utils'; -import { INDEXER_SUPPORTED_STAKING_CHAINS, SUBSQUID_ENDPOINTS } from '@subwallet/extension-koni-base/api/staking/config'; import axios from 'axios'; import { isEthereumAddress } from '@polkadot/util-crypto'; diff --git a/packages/extension-koni-base/src/api/staking/utils.ts b/packages/extension-base/src/koni/api/staking/utils.ts similarity index 100% rename from packages/extension-koni-base/src/api/staking/utils.ts rename to packages/extension-base/src/koni/api/staking/utils.ts diff --git a/packages/extension-koni-base/src/api/subquery/__generated__/DotSamaHistory.ts b/packages/extension-base/src/koni/api/subquery/__generated__/DotSamaHistory.ts similarity index 100% rename from packages/extension-koni-base/src/api/subquery/__generated__/DotSamaHistory.ts rename to packages/extension-base/src/koni/api/subquery/__generated__/DotSamaHistory.ts diff --git a/packages/extension-koni-base/src/api/subquery/codegen.md b/packages/extension-base/src/koni/api/subquery/codegen.md similarity index 100% rename from packages/extension-koni-base/src/api/subquery/codegen.md rename to packages/extension-base/src/koni/api/subquery/codegen.md diff --git a/packages/extension-koni-base/src/api/subquery/subquery.ts b/packages/extension-base/src/koni/api/subquery/subquery.ts similarity index 100% rename from packages/extension-koni-base/src/api/subquery/subquery.ts rename to packages/extension-base/src/koni/api/subquery/subquery.ts diff --git a/packages/extension-koni-base/src/api/tokens/evm/balance.ts b/packages/extension-base/src/koni/api/tokens/evm/balance.ts similarity index 84% rename from packages/extension-koni-base/src/api/tokens/evm/balance.ts rename to packages/extension-base/src/koni/api/tokens/evm/balance.ts index f9ecc7282a..fc09c59f7c 100644 --- a/packages/extension-koni-base/src/api/tokens/evm/balance.ts +++ b/packages/extension-base/src/koni/api/tokens/evm/balance.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _EvmApi } from '@subwallet/extension-base/services/chain-service/types'; diff --git a/packages/extension-koni-base/src/api/tokens/evm/transfer.ts b/packages/extension-base/src/koni/api/tokens/evm/transfer.ts similarity index 97% rename from packages/extension-koni-base/src/api/tokens/evm/transfer.ts rename to packages/extension-base/src/koni/api/tokens/evm/transfer.ts index b349633512..4fb6165f5f 100644 --- a/packages/extension-koni-base/src/api/tokens/evm/transfer.ts +++ b/packages/extension-base/src/koni/api/tokens/evm/transfer.ts @@ -1,12 +1,12 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ChainInfo } from '@subwallet/chain-list/types'; import { ExternalRequestPromise, ExternalRequestPromiseStatus, HandleBasicTx, TransactionResponse } from '@subwallet/extension-base/background/KoniTypes'; +import { getERC20Contract } from '@subwallet/extension-base/koni/api/tokens/evm/web3'; import { _BALANCE_PARSING_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants'; import { _ERC721_ABI } from '@subwallet/extension-base/services/chain-service/helper'; import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; -import { getERC20Contract } from '@subwallet/extension-koni-base/api/tokens/evm/web3'; import { TransactionConfig, TransactionReceipt } from 'web3-core'; import { BN, hexToBn } from '@polkadot/util'; diff --git a/packages/extension-koni-base/src/api/tokens/evm/web3.ts b/packages/extension-base/src/koni/api/tokens/evm/web3.ts similarity index 88% rename from packages/extension-koni-base/src/api/tokens/evm/web3.ts rename to packages/extension-base/src/koni/api/tokens/evm/web3.ts index 16f5f43014..58cadab6cc 100644 --- a/packages/extension-koni-base/src/api/tokens/evm/web3.ts +++ b/packages/extension-base/src/koni/api/tokens/evm/web3.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ERC20_ABI } from '@subwallet/extension-base/services/chain-service/helper'; diff --git a/packages/extension-koni-base/src/api/tokens/index.ts b/packages/extension-base/src/koni/api/tokens/index.ts similarity index 83% rename from packages/extension-koni-base/src/api/tokens/index.ts rename to packages/extension-base/src/koni/api/tokens/index.ts index 0706db4755..0871d3c328 100644 --- a/packages/extension-koni-base/src/api/tokens/index.ts +++ b/packages/extension-base/src/koni/api/tokens/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { isEthereumAddress } from '@polkadot/util-crypto'; diff --git a/packages/extension-koni-base/src/api/tokens/wasm/index.ts b/packages/extension-base/src/koni/api/tokens/wasm/index.ts similarity index 96% rename from packages/extension-koni-base/src/api/tokens/wasm/index.ts rename to packages/extension-base/src/koni/api/tokens/wasm/index.ts index 362579268a..2bb1dccb77 100644 --- a/packages/extension-koni-base/src/api/tokens/wasm/index.ts +++ b/packages/extension-base/src/koni/api/tokens/wasm/index.ts @@ -1,13 +1,13 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ChainInfo } from '@subwallet/chain-list/types'; import { SubstrateNftTransaction } from '@subwallet/extension-base/background/KoniTypes'; +import { getFreeBalance } from '@subwallet/extension-base/koni/api/dotsama/balance'; import { _PSP22_ABI, _PSP34_ABI } from '@subwallet/extension-base/services/chain-service/helper'; import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getChainNativeTokenBasicInfo } from '@subwallet/extension-base/services/chain-service/utils'; import { parseNumberToDisplay } from '@subwallet/extension-base/utils'; -import { getFreeBalance } from '@subwallet/extension-koni-base/api/dotsama/balance'; import { ApiPromise } from '@polkadot/api'; import { ContractPromise } from '@polkadot/api-contract'; diff --git a/packages/extension-koni-base/src/api/xcm/astar.ts b/packages/extension-base/src/koni/api/xcm/astar.ts similarity index 98% rename from packages/extension-koni-base/src/api/xcm/astar.ts rename to packages/extension-base/src/koni/api/xcm/astar.ts index 65926abbd1..6ee700a010 100644 --- a/packages/extension-koni-base/src/api/xcm/astar.ts +++ b/packages/extension-base/src/koni/api/xcm/astar.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; diff --git a/packages/extension-koni-base/src/api/xcm/index.ts b/packages/extension-base/src/koni/api/xcm/index.ts similarity index 97% rename from packages/extension-koni-base/src/api/xcm/index.ts rename to packages/extension-base/src/koni/api/xcm/index.ts index 3997bdb064..b183226d66 100644 --- a/packages/extension-koni-base/src/api/xcm/index.ts +++ b/packages/extension-base/src/koni/api/xcm/index.ts @@ -1,15 +1,15 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _AssetRef, _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; import { TransactionResponse } from '@subwallet/extension-base/background/KoniTypes'; +import { astarEstimateCrossChainFee, astarGetXcmExtrinsic } from '@subwallet/extension-base/koni/api/xcm/astar'; +import { moonbeamEstimateCrossChainFee, moonbeamGetXcmExtrinsic } from '@subwallet/extension-base/koni/api/xcm/moonbeamXcm'; +import { statemintEstimateCrossChainFee, statemintGetXcmExtrinsic } from '@subwallet/extension-base/koni/api/xcm/statemintXcm'; +import { substrateEstimateCrossChainFee, substrateGetXcmExtrinsic } from '@subwallet/extension-base/koni/api/xcm/substrateXcm'; import { _XCM_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _isNativeToken, _isXcmPathSupported } from '@subwallet/extension-base/services/chain-service/utils'; -import { astarEstimateCrossChainFee, astarGetXcmExtrinsic } from '@subwallet/extension-koni-base/api/xcm/astar'; -import { moonbeamEstimateCrossChainFee, moonbeamGetXcmExtrinsic } from '@subwallet/extension-koni-base/api/xcm/moonbeamXcm'; -import { statemintEstimateCrossChainFee, statemintGetXcmExtrinsic } from '@subwallet/extension-koni-base/api/xcm/statemintXcm'; -import { substrateEstimateCrossChainFee, substrateGetXcmExtrinsic } from '@subwallet/extension-koni-base/api/xcm/substrateXcm'; import { KeyringPair } from '@subwallet/keyring/types'; import { SubmittableExtrinsic } from '@polkadot/api/types'; diff --git a/packages/extension-koni-base/src/api/xcm/moonbeamXcm.ts b/packages/extension-base/src/koni/api/xcm/moonbeamXcm.ts similarity index 96% rename from packages/extension-koni-base/src/api/xcm/moonbeamXcm.ts rename to packages/extension-base/src/koni/api/xcm/moonbeamXcm.ts index 353f8e07bc..6a9df09a08 100644 --- a/packages/extension-koni-base/src/api/xcm/moonbeamXcm.ts +++ b/packages/extension-base/src/koni/api/xcm/moonbeamXcm.ts @@ -1,11 +1,11 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { COMMON_CHAIN_SLUGS } from '@subwallet/chain-list'; import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; +import { FOUR_INSTRUCTIONS_WEIGHT, getMultiLocationFromParachain, POLKADOT_UNLIMITED_WEIGHT } from '@subwallet/extension-base/koni/api/xcm/utils'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getXcmAssetId, _getXcmAssetType } from '@subwallet/extension-base/services/chain-service/utils'; -import { FOUR_INSTRUCTIONS_WEIGHT, getMultiLocationFromParachain, POLKADOT_UNLIMITED_WEIGHT } from '@subwallet/extension-koni-base/api/xcm/utils'; import { KeyringPair } from '@subwallet/keyring/types'; import { ApiPromise } from '@polkadot/api'; diff --git a/packages/extension-koni-base/src/api/xcm/statemintXcm.ts b/packages/extension-base/src/koni/api/xcm/statemintXcm.ts similarity index 97% rename from packages/extension-koni-base/src/api/xcm/statemintXcm.ts rename to packages/extension-base/src/koni/api/xcm/statemintXcm.ts index 598869418b..05f4f28c6a 100644 --- a/packages/extension-koni-base/src/api/xcm/statemintXcm.ts +++ b/packages/extension-base/src/koni/api/xcm/statemintXcm.ts @@ -1,10 +1,10 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; +import { getReceiverLocation, POLKADOT_UNLIMITED_WEIGHT } from '@subwallet/extension-base/koni/api/xcm/utils'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getSubstrateParaId, _getXcmAssetMultilocation, _isSubstrateParaChain } from '@subwallet/extension-base/services/chain-service/utils'; -import { getReceiverLocation, POLKADOT_UNLIMITED_WEIGHT } from '@subwallet/extension-koni-base/api/xcm/utils'; import { KeyringPair } from '@subwallet/keyring/types'; import { ApiPromise } from '@polkadot/api'; diff --git a/packages/extension-koni-base/src/api/xcm/substrateXcm.ts b/packages/extension-base/src/koni/api/xcm/substrateXcm.ts similarity index 98% rename from packages/extension-koni-base/src/api/xcm/substrateXcm.ts rename to packages/extension-base/src/koni/api/xcm/substrateXcm.ts index 879f9f819e..e30980a862 100644 --- a/packages/extension-koni-base/src/api/xcm/substrateXcm.ts +++ b/packages/extension-base/src/koni/api/xcm/substrateXcm.ts @@ -1,11 +1,11 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; +import { FOUR_INSTRUCTIONS_WEIGHT, getMultiLocationFromParachain, getReceiverLocation, POLKADOT_UNLIMITED_WEIGHT } from '@subwallet/extension-base/koni/api/xcm/utils'; import { _XCM_CHAIN_GROUP, _XCM_CHAIN_USE_LIMITED_WEIGHT } from '@subwallet/extension-base/services/chain-service/constants'; import { _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _getSubstrateParaId, _getXcmAssetMultilocation, _isSubstrateParaChain } from '@subwallet/extension-base/services/chain-service/utils'; -import { FOUR_INSTRUCTIONS_WEIGHT, getMultiLocationFromParachain, getReceiverLocation, POLKADOT_UNLIMITED_WEIGHT } from '@subwallet/extension-koni-base/api/xcm/utils'; import { KeyringPair } from '@subwallet/keyring/types'; import { ApiPromise } from '@polkadot/api'; diff --git a/packages/extension-koni-base/src/api/xcm/utils.ts b/packages/extension-base/src/koni/api/xcm/utils.ts similarity index 96% rename from packages/extension-koni-base/src/api/xcm/utils.ts rename to packages/extension-base/src/koni/api/xcm/utils.ts index 9b565dc4bd..820a1da07d 100644 --- a/packages/extension-koni-base/src/api/xcm/utils.ts +++ b/packages/extension-base/src/koni/api/xcm/utils.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _ChainInfo } from '@subwallet/chain-list/types'; diff --git a/packages/extension-koni-base/src/background/cron.ts b/packages/extension-base/src/koni/background/cron.ts similarity index 99% rename from packages/extension-koni-base/src/background/cron.ts rename to packages/extension-base/src/koni/background/cron.ts index e91a70e793..9cbf449d7a 100644 --- a/packages/extension-koni-base/src/background/cron.ts +++ b/packages/extension-base/src/koni/background/cron.ts @@ -4,10 +4,10 @@ import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; import { ApiMap, NftTransferExtra, ServiceInfo } from '@subwallet/extension-base/background/KoniTypes'; import { CRON_AUTO_RECOVER_DOTSAMA_INTERVAL, CRON_GET_API_MAP_STATUS, CRON_REFRESH_CHAIN_NOMINATOR_METADATA, CRON_REFRESH_CHAIN_STAKING_METADATA, CRON_REFRESH_NFT_INTERVAL, CRON_REFRESH_PRICE_INTERVAL, CRON_REFRESH_STAKING_REWARD_FAST_INTERVAL, CRON_REFRESH_STAKING_REWARD_INTERVAL } from '@subwallet/extension-base/constants'; +import { getTokenPrice } from '@subwallet/extension-base/koni/api/coingecko'; +import { KoniSubscription } from '@subwallet/extension-base/koni/background/subscription'; import { _ChainConnectionStatus, _ChainState, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import DatabaseService from '@subwallet/extension-base/services/storage-service/DatabaseService'; -import { getTokenPrice } from '@subwallet/extension-koni-base/api/coingecko'; -import { KoniSubscription } from '@subwallet/extension-koni-base/background/subscription'; import { Subject, Subscription } from 'rxjs'; import { logger as createLogger } from '@polkadot/util'; diff --git a/packages/extension-koni-base/src/background/events.ts b/packages/extension-base/src/koni/background/events.ts similarity index 74% rename from packages/extension-koni-base/src/background/events.ts rename to packages/extension-base/src/koni/background/events.ts index 14bd65b682..d407ed765f 100644 --- a/packages/extension-koni-base/src/background/events.ts +++ b/packages/extension-base/src/koni/background/events.ts @@ -1,7 +1,7 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { state } from '@subwallet/extension-koni-base/background/handlers'; +import { state } from '@subwallet/extension-base/koni/background/handlers'; export const onExtensionInstall = () => { state.onInstall(); diff --git a/packages/extension-koni-base/src/background/handlers/Extension.ts b/packages/extension-base/src/koni/background/handlers/Extension.ts similarity index 99% rename from packages/extension-koni-base/src/background/handlers/Extension.ts rename to packages/extension-base/src/koni/background/handlers/Extension.ts index 3ca6882ad6..457506eddc 100644 --- a/packages/extension-koni-base/src/background/handlers/Extension.ts +++ b/packages/extension-base/src/koni/background/handlers/Extension.ts @@ -12,6 +12,17 @@ import { AccountAuthType, AccountJson, AllowedPath, AuthorizeRequest, MessageTyp import { TransactionWarning } from '@subwallet/extension-base/background/warnings/TransactionWarning'; import { ALL_ACCOUNT_KEY, ALL_GENESIS_HASH } from '@subwallet/extension-base/constants'; import { ALLOWED_PATH } from '@subwallet/extension-base/defaults'; +import { getFreeBalance, subscribeFreeBalance } from '@subwallet/extension-base/koni/api/dotsama/balance'; +import { parseSubstrateTransaction } from '@subwallet/extension-base/koni/api/dotsama/parseTransaction'; +import { checkReferenceCount, checkSupportTransfer, createTransferExtrinsic } from '@subwallet/extension-base/koni/api/dotsama/transfer'; +import { getNftTransferExtrinsic, isRecipientSelf } from '@subwallet/extension-base/koni/api/nft/transfer'; +import { getBondingExtrinsic, getCancelWithdrawalExtrinsic, getClaimRewardExtrinsic, getNominationPoolsInfo, getUnbondingExtrinsic, getValidatorsInfo, getWithdrawalExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding'; +import { getTuringCancelCompoundingExtrinsic, getTuringCompoundExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding/paraChain'; +import { getPoolingBondingExtrinsic, getPoolingUnbondingExtrinsic, getPoolingWithdrawalExtrinsic } from '@subwallet/extension-base/koni/api/staking/bonding/relayChain'; +import { getERC20TransactionObject, getERC721Transaction, getEVMTransactionObject } from '@subwallet/extension-base/koni/api/tokens/evm/transfer'; +import { getPSP34Transaction, getPSP34TransferExtrinsic } from '@subwallet/extension-base/koni/api/tokens/wasm'; +import { createXcmExtrinsic } from '@subwallet/extension-base/koni/api/xcm'; +import KoniState from '@subwallet/extension-base/koni/background/handlers/State'; import { _ChainState, _NetworkUpsertParams, _ValidateCustomAssetRequest, _ValidateCustomAssetResponse } from '@subwallet/extension-base/services/chain-service/types'; import { _getChainNativeTokenBasicInfo, _getContractAddressOfToken, _getEvmChainId, _getSubstrateGenesisHash, _getTokenMinAmount, _isAssetSmartContractNft, _isChainEvmCompatible, _isCustomAsset, _isNativeToken, _isTokenEvmSmartContract } from '@subwallet/extension-base/services/chain-service/utils'; import { EXTENSION_REQUEST_URL } from '@subwallet/extension-base/services/request-service/constants'; @@ -20,17 +31,6 @@ import { SWTransaction, SWTransactionResponse, SWTransactionResult, ValidateTran import { createTransactionFromRLP, signatureToHex, Transaction as QrTransaction } from '@subwallet/extension-base/utils/eth'; import { parseContractInput, parseEvmRlp } from '@subwallet/extension-base/utils/eth/parseTransaction'; import { MetadataDef } from '@subwallet/extension-inject/types'; -import { getFreeBalance, subscribeFreeBalance } from '@subwallet/extension-koni-base/api/dotsama/balance'; -import { parseSubstrateTransaction } from '@subwallet/extension-koni-base/api/dotsama/parseTransaction'; -import { checkReferenceCount, checkSupportTransfer, createTransferExtrinsic } from '@subwallet/extension-koni-base/api/dotsama/transfer'; -import { getNftTransferExtrinsic, isRecipientSelf } from '@subwallet/extension-koni-base/api/nft/transfer'; -import { getBondingExtrinsic, getCancelWithdrawalExtrinsic, getClaimRewardExtrinsic, getNominationPoolsInfo, getUnbondingExtrinsic, getValidatorsInfo, getWithdrawalExtrinsic } from '@subwallet/extension-koni-base/api/staking/bonding'; -import { getTuringCancelCompoundingExtrinsic, getTuringCompoundExtrinsic } from '@subwallet/extension-koni-base/api/staking/bonding/paraChain'; -import { getPoolingBondingExtrinsic, getPoolingUnbondingExtrinsic, getPoolingWithdrawalExtrinsic } from '@subwallet/extension-koni-base/api/staking/bonding/relayChain'; -import { getERC20TransactionObject, getERC721Transaction, getEVMTransactionObject } from '@subwallet/extension-koni-base/api/tokens/evm/transfer'; -import { getPSP34Transaction, getPSP34TransferExtrinsic } from '@subwallet/extension-koni-base/api/tokens/wasm'; -import { createXcmExtrinsic } from '@subwallet/extension-koni-base/api/xcm'; -import KoniState from '@subwallet/extension-koni-base/background/handlers/State'; import { createPair } from '@subwallet/keyring'; import { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '@subwallet/keyring/types'; import { keyring } from '@subwallet/ui-keyring'; diff --git a/packages/extension-koni-base/src/background/handlers/State.ts b/packages/extension-base/src/koni/background/handlers/State.ts similarity index 99% rename from packages/extension-koni-base/src/background/handlers/State.ts rename to packages/extension-base/src/koni/background/handlers/State.ts index a8b97dc5c5..d161193497 100644 --- a/packages/extension-koni-base/src/background/handlers/State.ts +++ b/packages/extension-base/src/koni/background/handlers/State.ts @@ -9,6 +9,8 @@ import { isSubscriptionRunning, unsubscribe } from '@subwallet/extension-base/ba import { AccountRefMap, AddTokenRequestExternal, APIItemState, ApiMap, AssetSetting, AuthRequestV2, BalanceItem, BalanceJson, BasicTxErrorType, BrowserConfirmationType, ChainStakingMetadata, ChainType, ConfirmationsQueue, CrowdloanItem, CrowdloanJson, CurrentAccountInfo, EvmProviderErrorType, EvmSendTransactionParams, EvmSendTransactionRequest, EvmSignatureRequest, ExternalRequestPromise, ExternalRequestPromiseStatus, ExtrinsicType, KeyringState, NftCollection, NftItem, NftJson, NftTransferExtra, NominatorMetadata, PriceJson, RequestAccountExportPrivateKey, RequestCheckPublicAndSecretKey, RequestConfirmationComplete, RequestSettingsType, ResponseAccountExportPrivateKey, ResponseCheckPublicAndSecretKey, ServiceInfo, SingleModeJson, StakingItem, StakingJson, StakingRewardItem, StakingRewardJson, StakingType, ThemeNames, UiSettings } from '@subwallet/extension-base/background/KoniTypes'; import { AccountJson, RequestAuthorizeTab, RequestRpcSend, RequestRpcSubscribe, RequestRpcUnsubscribe, RequestSign, ResponseRpcListProviders, ResponseSigning } from '@subwallet/extension-base/background/types'; import { ALL_ACCOUNT_KEY, ALL_GENESIS_HASH } from '@subwallet/extension-base/constants'; +import { getTokenPrice } from '@subwallet/extension-base/koni/api/coingecko'; +import { getFreeBalance } from '@subwallet/extension-base/koni/api/dotsama/balance'; import { BalanceService } from '@subwallet/extension-base/services/balance-service'; import { ChainService } from '@subwallet/extension-base/services/chain-service'; import { _PREDEFINED_SINGLE_MODES } from '@subwallet/extension-base/services/chain-service/constants'; @@ -26,8 +28,6 @@ import AccountRefStore from '@subwallet/extension-base/stores/AccountRef'; import AssetSettingStore from '@subwallet/extension-base/stores/AssetSetting'; import { isContractAddress, parseContractInput } from '@subwallet/extension-base/utils/eth/parseTransaction'; import { MetadataDef, ProviderMeta } from '@subwallet/extension-inject/types'; -import { getTokenPrice } from '@subwallet/extension-koni-base/api/coingecko'; -import { getFreeBalance } from '@subwallet/extension-koni-base/api/dotsama/balance'; import { decodePair } from '@subwallet/keyring/pair/decode'; import { keyring } from '@subwallet/ui-keyring'; import { accounts } from '@subwallet/ui-keyring/observable/accounts'; diff --git a/packages/extension-koni-base/src/background/handlers/Tabs.ts b/packages/extension-base/src/koni/background/handlers/Tabs.ts similarity index 99% rename from packages/extension-koni-base/src/background/handlers/Tabs.ts rename to packages/extension-base/src/koni/background/handlers/Tabs.ts index 648feb35b2..3fc52a49e9 100644 --- a/packages/extension-koni-base/src/background/handlers/Tabs.ts +++ b/packages/extension-base/src/koni/background/handlers/Tabs.ts @@ -14,10 +14,10 @@ import RequestExtrinsicSign from '@subwallet/extension-base/background/RequestEx import { AccountAuthType, MessageTypes, RequestAccountList, RequestAccountSubscribe, RequestAuthorizeTab, RequestRpcSend, RequestRpcSubscribe, RequestRpcUnsubscribe, RequestTypes, ResponseRpcListProviders, ResponseSigning, ResponseTypes, SubscriptionMessageTypes } from '@subwallet/extension-base/background/types'; import { ALL_ACCOUNT_KEY, CRON_GET_API_MAP_STATUS } from '@subwallet/extension-base/constants'; import { PHISHING_PAGE_REDIRECT } from '@subwallet/extension-base/defaults'; +import KoniState from '@subwallet/extension-base/koni/background/handlers/State'; import { _generateCustomProviderKey } from '@subwallet/extension-base/services/chain-service/utils'; import { canDerive } from '@subwallet/extension-base/utils'; import { InjectedMetadataKnown, MetadataDef, ProviderMeta } from '@subwallet/extension-inject/types'; -import KoniState from '@subwallet/extension-koni-base/background/handlers/State'; import { KeyringPair } from '@subwallet/keyring/types'; import keyring from '@subwallet/ui-keyring'; import { accounts as accountsObservable } from '@subwallet/ui-keyring/observable/accounts'; diff --git a/packages/extension-koni-base/src/background/handlers/index.ts b/packages/extension-base/src/koni/background/handlers/index.ts similarity index 88% rename from packages/extension-koni-base/src/background/handlers/index.ts rename to packages/extension-base/src/koni/background/handlers/index.ts index 0a61a06887..4b38989337 100644 --- a/packages/extension-koni-base/src/background/handlers/index.ts +++ b/packages/extension-base/src/koni/background/handlers/index.ts @@ -4,12 +4,12 @@ import { ProviderError } from '@subwallet/extension-base/background/errors/ProviderError'; import { MessageTypes, TransportRequestMessage } from '@subwallet/extension-base/background/types'; import { PORT_EXTENSION } from '@subwallet/extension-base/defaults'; -import { NftHandler } from '@subwallet/extension-koni-base/api/nft'; -import KoniExtension from '@subwallet/extension-koni-base/background/handlers/Extension'; -import KoniState from '@subwallet/extension-koni-base/background/handlers/State'; -import KoniTabs from '@subwallet/extension-koni-base/background/handlers/Tabs'; +import { NftHandler } from '@subwallet/extension-base/koni/api/nft'; +import KoniExtension from '@subwallet/extension-base/koni/background/handlers/Extension'; +import KoniState from '@subwallet/extension-base/koni/background/handlers/State'; +import KoniTabs from '@subwallet/extension-base/koni/background/handlers/Tabs'; -// import Migration from '@subwallet/extension-koni-base/migration'; +// import Migration from '@subwallet/extension-base/koni/migration'; import { assert } from '@polkadot/util'; export const state = new KoniState(); diff --git a/packages/extension-koni-base/src/background/helper/eth-simple-keyring.d.ts b/packages/extension-base/src/koni/background/helper/eth-simple-keyring.d.ts similarity index 100% rename from packages/extension-koni-base/src/background/helper/eth-simple-keyring.d.ts rename to packages/extension-base/src/koni/background/helper/eth-simple-keyring.d.ts diff --git a/packages/extension-koni-base/src/background/subscription.ts b/packages/extension-base/src/koni/background/subscription.ts similarity index 97% rename from packages/extension-koni-base/src/background/subscription.ts rename to packages/extension-base/src/koni/background/subscription.ts index 6a8ee238ef..d8acc3ffaf 100644 --- a/packages/extension-koni-base/src/background/subscription.ts +++ b/packages/extension-base/src/koni/background/subscription.ts @@ -5,17 +5,17 @@ import { _ChainAsset, _ChainInfo } from '@subwallet/chain-list/types'; import { AuthUrls } from '@subwallet/extension-base/background/handlers/State'; import { NftTransferExtra } from '@subwallet/extension-base/background/KoniTypes'; import { ALL_ACCOUNT_KEY } from '@subwallet/extension-base/constants'; +import { subscribeBalance } from '@subwallet/extension-base/koni/api/dotsama/balance'; +import { subscribeCrowdloan } from '@subwallet/extension-base/koni/api/dotsama/crowdloan'; +import { getNominationStakingRewardData, getPoolingStakingRewardData, stakingOnChainApi } from '@subwallet/extension-base/koni/api/staking'; +import { getChainStakingMetadata, getNominatorMetadata } from '@subwallet/extension-base/koni/api/staking/bonding'; +import { getRelayChainPoolMemberMetadata } from '@subwallet/extension-base/koni/api/staking/bonding/relayChain'; +import { getAmplitudeUnclaimedStakingReward } from '@subwallet/extension-base/koni/api/staking/paraChain'; +import { nftHandler } from '@subwallet/extension-base/koni/background/handlers'; import { _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants'; import { _ChainState, _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types'; import { _isChainEnabled, _isChainSupportSubstrateStaking, _isSubstrateRelayChain } from '@subwallet/extension-base/services/chain-service/utils'; import DatabaseService from '@subwallet/extension-base/services/storage-service/DatabaseService'; -import { subscribeBalance } from '@subwallet/extension-koni-base/api/dotsama/balance'; -import { subscribeCrowdloan } from '@subwallet/extension-koni-base/api/dotsama/crowdloan'; -import { getNominationStakingRewardData, getPoolingStakingRewardData, stakingOnChainApi } from '@subwallet/extension-koni-base/api/staking'; -import { getChainStakingMetadata, getNominatorMetadata } from '@subwallet/extension-koni-base/api/staking/bonding'; -import { getRelayChainPoolMemberMetadata } from '@subwallet/extension-koni-base/api/staking/bonding/relayChain'; -import { getAmplitudeUnclaimedStakingReward } from '@subwallet/extension-koni-base/api/staking/paraChain'; -import { nftHandler } from '@subwallet/extension-koni-base/background/handlers'; import { Subscription } from 'rxjs'; import { logger as createLogger } from '@polkadot/util'; diff --git a/packages/extension-koni-base/src/migration/Base.ts b/packages/extension-base/src/koni/migration/Base.ts similarity index 89% rename from packages/extension-koni-base/src/migration/Base.ts rename to packages/extension-base/src/koni/migration/Base.ts index ce3d114b48..15b7d995d8 100644 --- a/packages/extension-koni-base/src/migration/Base.ts +++ b/packages/extension-base/src/koni/migration/Base.ts @@ -1,7 +1,7 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 -import State from '@subwallet/extension-koni-base/background/handlers/State'; +import State from '@subwallet/extension-base/koni/background/handlers/State'; import { logger as createLogger } from '@polkadot/util'; import { Logger } from '@polkadot/util/types'; diff --git a/packages/extension-koni-base/src/migration/index.ts b/packages/extension-base/src/koni/migration/index.ts similarity index 95% rename from packages/extension-koni-base/src/migration/index.ts rename to packages/extension-base/src/koni/migration/index.ts index 8d0c3f86d1..2234e9c233 100644 --- a/packages/extension-koni-base/src/migration/index.ts +++ b/packages/extension-base/src/koni/migration/index.ts @@ -1,7 +1,7 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 -import State from '@subwallet/extension-koni-base/background/handlers/State'; +import State from '@subwallet/extension-base/koni/background/handlers/State'; import { logger as createLogger } from '@polkadot/util'; import { Logger } from '@polkadot/util/types'; diff --git a/packages/extension-koni-base/src/migration/scripts/ChangeRouteToHome.ts b/packages/extension-base/src/koni/migration/scripts/ChangeRouteToHome.ts similarity index 92% rename from packages/extension-koni-base/src/migration/scripts/ChangeRouteToHome.ts rename to packages/extension-base/src/koni/migration/scripts/ChangeRouteToHome.ts index f31b388cee..5cfd27d67f 100644 --- a/packages/extension-koni-base/src/migration/scripts/ChangeRouteToHome.ts +++ b/packages/extension-base/src/koni/migration/scripts/ChangeRouteToHome.ts @@ -1,7 +1,7 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BaseMigrationJob from '@subwallet/extension-koni-base/migration/Base'; +import BaseMigrationJob from '@subwallet/extension-base/koni/migration/Base'; export default class ChangeRouteToHome extends BaseMigrationJob { public override async run (): Promise { diff --git a/packages/extension-koni-base/src/migration/scripts/ClearOldStorage.ts b/packages/extension-base/src/koni/migration/scripts/ClearOldStorage.ts similarity index 89% rename from packages/extension-koni-base/src/migration/scripts/ClearOldStorage.ts rename to packages/extension-base/src/koni/migration/scripts/ClearOldStorage.ts index 79ddb20279..2d952ee477 100644 --- a/packages/extension-koni-base/src/migration/scripts/ClearOldStorage.ts +++ b/packages/extension-base/src/koni/migration/scripts/ClearOldStorage.ts @@ -1,7 +1,7 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BaseMigrationJob from '@subwallet/extension-koni-base/migration/Base'; +import BaseMigrationJob from '@subwallet/extension-base/koni/migration/Base'; export default class ClearOldStorage extends BaseMigrationJob { public override async run (): Promise { diff --git a/packages/extension-koni-base/src/migration/scripts/RemoveWrongCrowdloan.ts b/packages/extension-base/src/koni/migration/scripts/RemoveWrongCrowdloan.ts similarity index 86% rename from packages/extension-koni-base/src/migration/scripts/RemoveWrongCrowdloan.ts rename to packages/extension-base/src/koni/migration/scripts/RemoveWrongCrowdloan.ts index a3f0a5de40..3c80a36098 100644 --- a/packages/extension-koni-base/src/migration/scripts/RemoveWrongCrowdloan.ts +++ b/packages/extension-base/src/koni/migration/scripts/RemoveWrongCrowdloan.ts @@ -1,8 +1,8 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BaseMigrationJob from '@subwallet/extension-base/koni/migration/Base'; import KoniDatabase from '@subwallet/extension-base/services/storage-service/databases'; -import BaseMigrationJob from '@subwallet/extension-koni-base/migration/Base'; export default class RemoveWrongCrowdloan extends BaseMigrationJob { public override async run (): Promise { diff --git a/packages/extension-koni-base/src/migration/scripts/RemoveWrongTransactionHistoriesFromStore.ts b/packages/extension-base/src/koni/migration/scripts/RemoveWrongTransactionHistoriesFromStore.ts similarity index 95% rename from packages/extension-koni-base/src/migration/scripts/RemoveWrongTransactionHistoriesFromStore.ts rename to packages/extension-base/src/koni/migration/scripts/RemoveWrongTransactionHistoriesFromStore.ts index 22265d5fb7..e20ca8217d 100644 --- a/packages/extension-koni-base/src/migration/scripts/RemoveWrongTransactionHistoriesFromStore.ts +++ b/packages/extension-base/src/koni/migration/scripts/RemoveWrongTransactionHistoriesFromStore.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import { TransactionHistoryItemJson } from '@subwallet/extension-base/background/KoniTypes'; +import BaseMigrationJob from '@subwallet/extension-base/koni/migration/Base'; import TransactionHistoryStoreV3 from '@subwallet/extension-base/stores/TransactionHistoryV3'; -import BaseMigrationJob from '@subwallet/extension-koni-base/migration/Base'; import { accounts } from '@subwallet/ui-keyring/observable/accounts'; export default class RemoveWrongTransactionHistoriesFromStore extends BaseMigrationJob { diff --git a/packages/extension-koni-base/src/migration/scripts/ResetTransactionHistoryEventIdx.ts b/packages/extension-base/src/koni/migration/scripts/ResetTransactionHistoryEventIdx.ts similarity index 89% rename from packages/extension-koni-base/src/migration/scripts/ResetTransactionHistoryEventIdx.ts rename to packages/extension-base/src/koni/migration/scripts/ResetTransactionHistoryEventIdx.ts index 2f4a93450b..672b1a320a 100644 --- a/packages/extension-koni-base/src/migration/scripts/ResetTransactionHistoryEventIdx.ts +++ b/packages/extension-base/src/koni/migration/scripts/ResetTransactionHistoryEventIdx.ts @@ -1,8 +1,8 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BaseMigrationJob from '@subwallet/extension-base/koni/migration/Base'; import KoniDatabase from '@subwallet/extension-base/services/storage-service/databases'; -import BaseMigrationJob from '@subwallet/extension-koni-base/migration/Base'; export default class ResetTransactionHistoryEventIdx extends BaseMigrationJob { public override async run (): Promise { diff --git a/packages/extension-koni-base/src/migration/scripts/index.ts b/packages/extension-base/src/koni/migration/scripts/index.ts similarity index 78% rename from packages/extension-koni-base/src/migration/scripts/index.ts rename to packages/extension-base/src/koni/migration/scripts/index.ts index ab43dc8673..efcd3ef626 100644 --- a/packages/extension-koni-base/src/migration/scripts/index.ts +++ b/packages/extension-base/src/koni/migration/scripts/index.ts @@ -1,9 +1,9 @@ // Copyright 2019-2022 @subwallet/extension-koni authors & contributors // SPDX-License-Identifier: Apache-2.0 -import ChangeRouteToHome from '@subwallet/extension-koni-base/migration/scripts/ChangeRouteToHome'; -import RemoveWrongCrowdloan from '@subwallet/extension-koni-base/migration/scripts/RemoveWrongCrowdloan'; -import ResetTransactionHistoryEventIdx from '@subwallet/extension-koni-base/migration/scripts/ResetTransactionHistoryEventIdx'; +import ChangeRouteToHome from '@subwallet/extension-base/koni/migration/scripts/ChangeRouteToHome'; +import RemoveWrongCrowdloan from '@subwallet/extension-base/koni/migration/scripts/RemoveWrongCrowdloan'; +import ResetTransactionHistoryEventIdx from '@subwallet/extension-base/koni/migration/scripts/ResetTransactionHistoryEventIdx'; import BaseMigrationJob from '../Base'; import ClearOldStorage from './ClearOldStorage'; diff --git a/packages/extension-koni-base/src/page/SubWalleEvmProvider.ts b/packages/extension-base/src/koni/page/SubWalleEvmProvider.ts similarity index 100% rename from packages/extension-koni-base/src/page/SubWalleEvmProvider.ts rename to packages/extension-base/src/koni/page/SubWalleEvmProvider.ts diff --git a/packages/extension-koni-base/src/page/index.ts b/packages/extension-base/src/koni/page/index.ts similarity index 81% rename from packages/extension-koni-base/src/page/index.ts rename to packages/extension-base/src/koni/page/index.ts index f6a251097d..0cf4f5cf63 100644 --- a/packages/extension-koni-base/src/page/index.ts +++ b/packages/extension-base/src/koni/page/index.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // the enable function, called by the dapp to allow access +import { SubWalletEvmProvider } from '@subwallet/extension-base/koni/page/SubWalleEvmProvider'; import { sendMessage } from '@subwallet/extension-base/page'; import { EvmProvider } from '@subwallet/extension-inject/types'; -import { SubWalletEvmProvider } from '@subwallet/extension-koni-base/page/SubWalleEvmProvider'; export function initEvmProvider (version: string): EvmProvider { return new SubWalletEvmProvider(sendMessage, version); diff --git a/packages/extension-base/src/services/chain-service/constants.ts b/packages/extension-base/src/services/chain-service/constants.ts index 8a48b6b8d6..28ab4ecbcf 100644 --- a/packages/extension-base/src/services/chain-service/constants.ts +++ b/packages/extension-base/src/services/chain-service/constants.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _DEFAULT_CHAINS } from '@subwallet/chain-list'; diff --git a/packages/extension-base/src/services/chain-service/helper/index.ts b/packages/extension-base/src/services/chain-service/helper/index.ts index 26a9771843..4fb9628224 100644 --- a/packages/extension-base/src/services/chain-service/helper/index.ts +++ b/packages/extension-base/src/services/chain-service/helper/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment diff --git a/packages/extension-base/src/services/chain-service/types.ts b/packages/extension-base/src/services/chain-service/types.ts index a9e71e299c..72527f490d 100644 --- a/packages/extension-base/src/services/chain-service/types.ts +++ b/packages/extension-base/src/services/chain-service/types.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 /* eslint @typescript-eslint/no-empty-interface: "off" */ diff --git a/packages/extension-base/src/services/chain-service/utils.ts b/packages/extension-base/src/services/chain-service/utils.ts index 887eb6d2db..59ac371e7e 100644 --- a/packages/extension-base/src/services/chain-service/utils.ts +++ b/packages/extension-base/src/services/chain-service/utils.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { _AssetRef, _AssetRefPath, _AssetType, _ChainAsset, _ChainInfo, _MultiChainAsset, _SubstrateChainType } from '@subwallet/chain-list/types'; diff --git a/packages/extension-base/src/services/history-service/index.ts b/packages/extension-base/src/services/history-service/index.ts index eaf9b261eb..082fd2586e 100644 --- a/packages/extension-base/src/services/history-service/index.ts +++ b/packages/extension-base/src/services/history-service/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { TransactionHistoryItem } from '@subwallet/extension-base/background/KoniTypes'; diff --git a/packages/extension-base/src/utils/eth.ts b/packages/extension-base/src/utils/eth.ts index 8b7d7ae6d0..708ee3c4ae 100644 --- a/packages/extension-base/src/utils/eth.ts +++ b/packages/extension-base/src/utils/eth.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import BigN from 'bignumber.js'; diff --git a/packages/extension-base/src/utils/eth/parseTransaction/base.ts b/packages/extension-base/src/utils/eth/parseTransaction/base.ts index a4534b4a7f..1005d5f421 100644 --- a/packages/extension-base/src/utils/eth/parseTransaction/base.ts +++ b/packages/extension-base/src/utils/eth/parseTransaction/base.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { FunctionFragment, JsonFragment, Result } from '@ethersproject/abi'; diff --git a/packages/extension-base/src/utils/ignore-utils.spec.ts b/packages/extension-base/src/utils/ignore-utils.spec.ts index bc76fab466..d295452f1c 100644 --- a/packages/extension-base/src/utils/ignore-utils.spec.ts +++ b/packages/extension-base/src/utils/ignore-utils.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { convertToEvmAddress, filterAddressByNetworkKey } from '@subwallet/extension-base/utils/index'; diff --git a/packages/extension-base/src/utils/keyring.ts b/packages/extension-base/src/utils/keyring.ts index 18e31a3e28..968215f88b 100644 --- a/packages/extension-base/src/utils/keyring.ts +++ b/packages/extension-base/src/utils/keyring.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { Keyring } from '@subwallet/keyring'; diff --git a/packages/extension-base/src/utils/request.ts b/packages/extension-base/src/utils/request.ts index e50e8047eb..7ba461d794 100644 --- a/packages/extension-base/src/utils/request.ts +++ b/packages/extension-base/src/utils/request.ts @@ -1,4 +1,4 @@ -// Copyright 2019-2022 @subwallet/extension-koni-base authors & contributors +// Copyright 2019-2022 @subwallet/extension-base // SPDX-License-Identifier: Apache-2.0 import { EXTENSION_REQUEST_URL } from '@subwallet/extension-base/services/request-service/constants'; diff --git a/packages/extension-koni-base/LICENSE b/packages/extension-koni-base/LICENSE deleted file mode 100644 index 0d381b2e97..0000000000 --- a/packages/extension-koni-base/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/packages/extension-koni-base/README.md b/packages/extension-koni-base/README.md deleted file mode 100644 index 090f9eff39..0000000000 --- a/packages/extension-koni-base/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# @subwallet/extension-koni-base - -Functions, classes and other utilities used in `@subwallet/extension`. These include: -- background script handlers, -- message passing, -- scripts injected inside pages. - -They are primarily meant to be used in `@subwallet/extension`, and can be broken without any notice to cater for `@subwallet/extension`'s needs. - -They are exported here if you wish to use part of them in the development of your own extension. Don't forget to add `process.env.EXTENSION_PREFIX` to separate ports and stores from the current extension's ones. diff --git a/packages/extension-koni-base/package.json b/packages/extension-koni-base/package.json deleted file mode 100644 index 97be94e399..0000000000 --- a/packages/extension-koni-base/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "author": "Koni Studio", - "bugs": "https://github.com/Koniverse/Subwallet-V2/issues", - "contributors": [], - "description": "Functions, classes and other utilities used in @subwallet/extension", - "homepage": "https://github.com/Koniverse/Subwallet-V2/tree/master/packages/extension-koni-base#readme", - "license": "Apache-2.0", - "maintainers": [], - "name": "@subwallet/extension-koni-base", - "repository": { - "directory": "packages/extension-koni-base", - "type": "git", - "url": "https://github.com/Koniverse/Subwallet-V2.git" - }, - "sideEffects": false, - "type": "module", - "version": "0.8.1", - "main": "index.js", - "dependencies": { - "@acala-network/api": "^4.1.8-2.3", - "@acala-network/type-definitions": "^4.1.5", - "@apollo/client": "^3.7.3", - "@babel/runtime": "^7.20.6", - "@bifrost-finance/type-definitions": "^1.7.2", - "@crustio/type-definitions": "^1.3.0", - "@darwinia/types": "^2.8.10", - "@darwinia/types-known": "^2.8.10", - "@digitalnative/type-definitions": "^1.1.27", - "@docknetwork/node-types": "^0.15.0", - "@edgeware/node-types": "^3.6.2-wako", - "@equilab/api": "^1.14.12", - "@equilab/definitions": "^1.4.18", - "@ethereumjs/common": "^2.6.5", - "@ethersproject/abi": "^5.7.0", - "@interlay/interbtc-types": "^1.11.0", - "@laminar/type-definitions": "^0.3.1", - "@metamask/safe-event-emitter": "^2.0.0", - "@metaverse-network-sdk/type-definitions": "^0.0.1-13", - "@oak-foundation/api-augment": "^0.0.23", - "@oak-foundation/types": "^0.0.23", - "@parallel-finance/type-definitions": "^1.7.14", - "@phala/typedefs": "^0.2.32", - "@polkadot/api": "^9.10.3", - "@polkadot/api-contract": "^9.10.3", - "@polkadot/api-derive": "^9.10.3", - "@polkadot/networks": "^10.2.1", - "@polkadot/phishing": "^0.18.12", - "@polkadot/rpc-provider": "^9.10.3", - "@polkadot/types": "^9.10.3", - "@polkadot/ui-settings": "^2.9.14", - "@polkadot/util": "^10.2.1", - "@polkadot/util-crypto": "^10.2.1", - "@polymathnetwork/polymesh-types": "^0.0.2", - "@snowfork/snowbridge-types": "^0.2.7", - "@sora-substrate/type-definitions": "^1.12.4", - "@subsocial/types": "^0.6.8", - "@substrate/connect": "^0.7.18", - "@subwallet/chain-list": "^0.0.13", - "@subwallet/extension-base": "^0.8.1", - "@subwallet/extension-chains": "^0.8.1", - "@subwallet/extension-dapp": "^0.8.1", - "@subwallet/extension-inject": "^0.8.1", - "@subwallet/keyring": "^0.0.4", - "@subwallet/ui-keyring": "^0.0.3", - "@unique-nft/types": "^0.6.0-4", - "@zeitgeistpm/type-defs": "^0.10.0", - "@zeroio/type-definitions": "^0.0.14", - "axios": "^1.2.1", - "bignumber.js": "^9.1.1", - "bn.js": "^5.2.1", - "buffer": "^6.0.3", - "cross-fetch": "^3.1.5", - "dexie": "^3.2.2", - "eth-simple-keyring": "^4.2.0", - "ethereumjs-tx": "^2.1.2", - "ethers": "^5.7.2", - "eventemitter3": "^5.0.0", - "graphql": "^16.6.0", - "is-buffer": "^2.0.5", - "json-rpc-engine": "^6.1.0", - "moonbeam-types-bundle": "^2.0.9", - "pontem-types-bundle": "^1.0.15", - "protobufjs": "^7.1.2", - "rlp": "^3.0.0", - "rxjs": "^7.8.0", - "web3": "^1.8.1", - "web3-core": "^1.8.1", - "web3-core-helpers": "^1.8.1", - "web3-eth-contract": "^1.8.1", - "web3-utils": "^1.8.1" - }, - "devDependencies": { - "@subwallet/extension-mocks": "^0.8.1" - } -} diff --git a/packages/extension-koni-base/src/detectOther.ts b/packages/extension-koni-base/src/detectOther.ts deleted file mode 100644 index 93215326b9..0000000000 --- a/packages/extension-koni-base/src/detectOther.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2017-2022 @subwallet/extension-koni-base authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// Empty template, auto-generated by @polkadot/dev - -export default []; diff --git a/packages/extension-koni-base/src/detectPackage.ts b/packages/extension-koni-base/src/detectPackage.ts deleted file mode 100644 index 5f0b4cd5bf..0000000000 --- a/packages/extension-koni-base/src/detectPackage.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2017-2022 @subwallet/extension-koni-base authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// Do not edit, auto-generated by @polkadot/dev - -import { detectPackage } from '@polkadot/util'; - -import others from './detectOther'; -import { packageInfo } from './packageInfo'; - -detectPackage(packageInfo, null, others); diff --git a/packages/extension-koni-base/src/index.ts b/packages/extension-koni-base/src/index.ts deleted file mode 100644 index 2b2ebbcb1a..0000000000 --- a/packages/extension-koni-base/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2019-2022 @subwallet/extension-koni authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// no direct exports diff --git a/packages/extension-koni-base/src/packageInfo.ts b/packages/extension-koni-base/src/packageInfo.ts deleted file mode 100644 index 04f84a285c..0000000000 --- a/packages/extension-koni-base/src/packageInfo.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2017-2022 @subwallet/extension-koni-base authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// Do not edit, auto-generated by @polkadot/dev - -export const packageInfo = { name: '@subwallet/extension-koni-base', path: 'auto', type: 'auto', version: '0.8.1' }; diff --git a/packages/extension-koni-base/tsconfig.build.json b/packages/extension-koni-base/tsconfig.build.json deleted file mode 100644 index 96d70cb912..0000000000 --- a/packages/extension-koni-base/tsconfig.build.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "..", - "outDir": "./build", - "rootDir": "./src" - }, - "references": [ - { "path": "../extension-base/tsconfig.build.json" - }, - { "path": "../extension-inject/tsconfig.build.json" - } - ] -} diff --git a/packages/extension-koni-base/tsconfig.json b/packages/extension-koni-base/tsconfig.json deleted file mode 100644 index d58713c259..0000000000 --- a/packages/extension-koni-base/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "..", - "outDir": "./build", - "rootDir": "./src" - }, - "references": [ - { "path": "../extension-base" }, - { "path": "../extension-inject" } - ] -} diff --git a/packages/extension-koni-ui/package.json b/packages/extension-koni-ui/package.json index c854ca54fb..bc16626eba 100644 --- a/packages/extension-koni-ui/package.json +++ b/packages/extension-koni-ui/package.json @@ -42,7 +42,6 @@ "@subwallet/extension-chains": "^0.8.1", "@subwallet/extension-dapp": "^0.8.1", "@subwallet/extension-inject": "^0.8.1", - "@subwallet/extension-koni-base": "^0.8.1", "@subwallet/keyring": "^0.0.4", "@subwallet/react-ui": "5.1.2-b30", "@subwallet/ui-keyring": "^0.0.3", diff --git a/packages/extension-koni-ui/src/Popup/Home/Staking/StakingDetailModal.tsx b/packages/extension-koni-ui/src/Popup/Home/Staking/StakingDetailModal.tsx index d735c3fda6..ba6a80bfd0 100644 --- a/packages/extension-koni-ui/src/Popup/Home/Staking/StakingDetailModal.tsx +++ b/packages/extension-koni-ui/src/Popup/Home/Staking/StakingDetailModal.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import { ChainStakingMetadata, NominationInfo, NominatorMetadata, StakingType, UnstakingInfo, UnstakingStatus } from '@subwallet/extension-base/background/KoniTypes'; +import { isShowNominationByValidator } from '@subwallet/extension-base/koni/api/staking/bonding/utils'; import { _getChainSubstrateAddressPrefix } from '@subwallet/extension-base/services/chain-service/utils'; -import { isShowNominationByValidator } from '@subwallet/extension-koni-base/api/staking/bonding/utils'; import MetaInfo from '@subwallet/extension-koni-ui/components/MetaInfo'; import AccountItem from '@subwallet/extension-koni-ui/components/MetaInfo/parts/AccountItem'; import useGetAccountByAddress from '@subwallet/extension-koni-ui/hooks/account/useGetAccountByAddress'; diff --git a/packages/extension-koni-ui/src/Popup/Transaction/Stake.tsx b/packages/extension-koni-ui/src/Popup/Transaction/Stake.tsx index 0d2387e45e..0c0a1af052 100644 --- a/packages/extension-koni-ui/src/Popup/Transaction/Stake.tsx +++ b/packages/extension-koni-ui/src/Popup/Transaction/Stake.tsx @@ -45,7 +45,7 @@ const Component: React.FC = (props: Props) => { const location = useLocation(); const { chainStakingMetadata, hideTabList, nominatorMetadata } = location.state as StakingDataOption; - console.log(chainStakingMetadata, nominatorMetadata) + console.log(chainStakingMetadata, nominatorMetadata); const assetRegistry = useSelector((root: RootState) => root.assetRegistry.assetRegistry); const chainInfoMap = useSelector((state: RootState) => state.chainStore.chainInfoMap); diff --git a/packages/extension-koni-ui/src/components/Field/PoolSelector.tsx b/packages/extension-koni-ui/src/components/Field/PoolSelector.tsx index 24e1b689d8..78e101af46 100644 --- a/packages/extension-koni-ui/src/components/Field/PoolSelector.tsx +++ b/packages/extension-koni-ui/src/components/Field/PoolSelector.tsx @@ -106,8 +106,8 @@ const Component = (props: Props, ref: ForwardedRef) => { return ( item.address.toLowerCase().includes(searchTextLowerCase) || - (item.identity - ? item.identity.toLowerCase().includes(searchTextLowerCase) + (item.name + ? item.name.toLowerCase().includes(searchTextLowerCase) : false) ); }, []); @@ -115,19 +115,14 @@ const Component = (props: Props, ref: ForwardedRef) => { const renderItem = useCallback((item: NominationPoolDataType) => { return ( { e.stopPropagation(); setViewDetailItem(item); activeModal(PoolDetailModalId); }} - symbol={item.symbol} /> ); }, [activeModal]); @@ -140,7 +135,7 @@ const Component = (props: Props, ref: ForwardedRef) => { return (
- {item.identity} + {item.name}
diff --git a/packages/extension-koni-ui/src/components/Modal/Staking/PoolDetailModal.tsx b/packages/extension-koni-ui/src/components/Modal/Staking/PoolDetailModal.tsx index 3637df27e7..7a202d8688 100644 --- a/packages/extension-koni-ui/src/components/Modal/Staking/PoolDetailModal.tsx +++ b/packages/extension-koni-ui/src/components/Modal/Staking/PoolDetailModal.tsx @@ -21,7 +21,7 @@ export const PoolDetailModalId = 'poolDetailModalId'; function Component ({ className, decimals, onCancel, selectedNominationPool, status }: Props): React.ReactElement { const { t } = useTranslation(); - const { address, identity, memberCount, symbol } = selectedNominationPool; + const { address, memberCounter, name, symbol } = selectedNominationPool; return ( diff --git a/packages/extension-koni-ui/src/components/StakingItem/StakingPoolItem.tsx b/packages/extension-koni-ui/src/components/StakingItem/StakingPoolItem.tsx index da3117b9c4..eb261b634e 100644 --- a/packages/extension-koni-ui/src/components/StakingItem/StakingPoolItem.tsx +++ b/packages/extension-koni-ui/src/components/StakingItem/StakingPoolItem.tsx @@ -17,7 +17,7 @@ type Props = NominationPoolDataType & ThemeProps & { } const Component: React.FC = (props: Props) => { - const { address, bondedAmount, className, identity, onClickMoreBtn, symbol } = props; + const { address, bondedAmount, className, name, onClickMoreBtn, symbol } = props; const { t } = useTranslation(); @@ -34,7 +34,7 @@ const Component: React.FC = (props: Props) => { } middleItem={
-
{identity}
+
{name}
{t('Bonded: ')} { id: string, diff --git a/packages/web-runner/src/webRunner.ts b/packages/web-runner/src/webRunner.ts index 2479c45037..c5e2e64bd1 100644 --- a/packages/web-runner/src/webRunner.ts +++ b/packages/web-runner/src/webRunner.ts @@ -3,9 +3,9 @@ import '@subwallet/extension-inject/crossenv'; +import { state as koniState } from '@subwallet/extension-base/koni/background/handlers'; import { AccountsStore } from '@subwallet/extension-base/stores'; import KeyringStore from '@subwallet/extension-base/stores/Keyring'; -import { state as koniState } from '@subwallet/extension-koni-base/background/handlers'; import keyring from '@subwallet/ui-keyring'; import { cryptoWaitReady } from '@polkadot/util-crypto'; diff --git a/packages/web-runner/tsconfig.build.json b/packages/web-runner/tsconfig.build.json index 72744eba76..b0b4a8f9ab 100644 --- a/packages/web-runner/tsconfig.build.json +++ b/packages/web-runner/tsconfig.build.json @@ -10,8 +10,6 @@ }, { "path": "../extension-inject/tsconfig.build.json" }, - { "path": "../extension-koni-base/tsconfig.build.json" - }, { "path": "../extension-koni-ui/tsconfig.build.json" } ] diff --git a/packages/web-runner/tsconfig.json b/packages/web-runner/tsconfig.json index 4ae7e2fcf0..94724ec666 100644 --- a/packages/web-runner/tsconfig.json +++ b/packages/web-runner/tsconfig.json @@ -8,7 +8,6 @@ "references": [ { "path": "../extension-base" }, { "path": "../extension-inject" }, - { "path": "../extension-koni-base" }, { "path": "../extension-koni-ui" } ] } diff --git a/packages/web-runner/webpack.config.cjs b/packages/web-runner/webpack.config.cjs index 0a097626a8..14b81c802e 100644 --- a/packages/web-runner/webpack.config.cjs +++ b/packages/web-runner/webpack.config.cjs @@ -38,7 +38,6 @@ const packages = [ 'extension-dapp', 'extension-inject', 'extension-koni', - 'extension-koni-base', 'extension-koni-ui' ]; diff --git a/rollup.config.mjs b/rollup.config.mjs index 1d29e965a5..dc46099beb 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -79,7 +79,7 @@ const external = [ '@polkadot/util-crypto' ]; -const entries = ['extension-base', 'extension-chains', 'extension-inject', 'extension-koni-base'].reduce((all, p) => ({ +const entries = ['extension-base', 'extension-chains', 'extension-inject'].reduce((all, p) => ({ ...all, [`@subwallet/${p}`]: path.resolve(process.cwd(), `packages/${p}/build`) }), {}); diff --git a/tsconfig.base.json b/tsconfig.base.json index 0e574b3692..8f85ac8367 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,8 +15,6 @@ "@subwallet/extension-mocks/*": ["extension-mocks/src/*"], "@subwallet/extension-koni": ["extension-koni/src"], "@subwallet/extension-koni/*": ["extension-koni/src/*"], - "@subwallet/extension-koni-base": ["extension-koni-base/src"], - "@subwallet/extension-koni-base/*": ["extension-koni-base/src/*"], "@subwallet/extension-koni-ui": ["extension-koni-ui/src"], "@subwallet/extension-koni-ui/*": ["extension-koni-ui/src/*"], "@subwallet/web-runner": ["web-runner/src"], diff --git a/tsconfig.build.json b/tsconfig.build.json index c148573ac7..12103e9c1a 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -6,7 +6,6 @@ "references": [ { "path": "./packages/extension-koni/tsconfig.build.json" }, { "path": "./packages/extension-base/tsconfig.build.json" }, - { "path": "./packages/extension-koni-base/tsconfig.build.json" }, { "path": "./packages/extension-chains/tsconfig.build.json" }, { "path": "./packages/extension-compat-metamask/tsconfig.build.json" }, { "path": "./packages/extension-dapp/tsconfig.build.json" }, @@ -15,4 +14,4 @@ { "path": "./packages/extension-koni-ui/tsconfig.build.json" }, { "path": "./packages/web-runner/tsconfig.build.json" } ] -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index cd4c7e7312..d9249ff188 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,6 @@ { "path": "./packages/extension-inject" }, { "path": "./packages/extension-mocks" }, { "path": "./packages/extension-koni" }, - { "path": "./packages/extension-koni-base" }, { "path": "./packages/extension-koni-ui" }, { "path": "./packages/web-runner" } ] diff --git a/yarn.lock b/yarn.lock index d98ef83fe8..2292644454 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5944,7 +5944,6 @@ __metadata: "@subwallet/extension-chains": ^0.8.1 "@subwallet/extension-dapp": ^0.8.1 "@subwallet/extension-inject": ^0.8.1 - "@subwallet/extension-koni-base": ^0.8.1 "@subwallet/extension-mocks": ^0.8.1 "@subwallet/keyring": ^0.0.4 "@subwallet/ui-keyring": ^0.0.3 @@ -6071,85 +6070,6 @@ __metadata: languageName: unknown linkType: soft -"@subwallet/extension-koni-base@^0.8.1, @subwallet/extension-koni-base@workspace:packages/extension-koni-base": - version: 0.0.0-use.local - resolution: "@subwallet/extension-koni-base@workspace:packages/extension-koni-base" - dependencies: - "@acala-network/api": ^4.1.8-2.3 - "@acala-network/type-definitions": ^4.1.5 - "@apollo/client": ^3.7.3 - "@babel/runtime": ^7.20.6 - "@bifrost-finance/type-definitions": ^1.7.2 - "@crustio/type-definitions": ^1.3.0 - "@darwinia/types": ^2.8.10 - "@darwinia/types-known": ^2.8.10 - "@digitalnative/type-definitions": ^1.1.27 - "@docknetwork/node-types": ^0.15.0 - "@edgeware/node-types": ^3.6.2-wako - "@equilab/api": ^1.14.12 - "@equilab/definitions": ^1.4.18 - "@ethereumjs/common": ^2.6.5 - "@ethersproject/abi": ^5.7.0 - "@interlay/interbtc-types": ^1.11.0 - "@laminar/type-definitions": ^0.3.1 - "@metamask/safe-event-emitter": ^2.0.0 - "@metaverse-network-sdk/type-definitions": ^0.0.1-13 - "@oak-foundation/api-augment": ^0.0.23 - "@oak-foundation/types": ^0.0.23 - "@parallel-finance/type-definitions": ^1.7.14 - "@phala/typedefs": ^0.2.32 - "@polkadot/api": ^9.10.3 - "@polkadot/api-contract": ^9.10.3 - "@polkadot/api-derive": ^9.10.3 - "@polkadot/networks": ^10.2.1 - "@polkadot/phishing": ^0.18.12 - "@polkadot/rpc-provider": ^9.10.3 - "@polkadot/types": ^9.10.3 - "@polkadot/ui-settings": ^2.9.14 - "@polkadot/util": ^10.2.1 - "@polkadot/util-crypto": ^10.2.1 - "@polymathnetwork/polymesh-types": ^0.0.2 - "@snowfork/snowbridge-types": ^0.2.7 - "@sora-substrate/type-definitions": ^1.12.4 - "@subsocial/types": ^0.6.8 - "@substrate/connect": ^0.7.18 - "@subwallet/chain-list": ^0.0.13 - "@subwallet/extension-base": ^0.8.1 - "@subwallet/extension-chains": ^0.8.1 - "@subwallet/extension-dapp": ^0.8.1 - "@subwallet/extension-inject": ^0.8.1 - "@subwallet/extension-mocks": ^0.8.1 - "@subwallet/keyring": ^0.0.4 - "@subwallet/ui-keyring": ^0.0.3 - "@unique-nft/types": ^0.6.0-4 - "@zeitgeistpm/type-defs": ^0.10.0 - "@zeroio/type-definitions": ^0.0.14 - axios: ^1.2.1 - bignumber.js: ^9.1.1 - bn.js: ^5.2.1 - buffer: ^6.0.3 - cross-fetch: ^3.1.5 - dexie: ^3.2.2 - eth-simple-keyring: ^4.2.0 - ethereumjs-tx: ^2.1.2 - ethers: ^5.7.2 - eventemitter3: ^5.0.0 - graphql: ^16.6.0 - is-buffer: ^2.0.5 - json-rpc-engine: ^6.1.0 - moonbeam-types-bundle: ^2.0.9 - pontem-types-bundle: ^1.0.15 - protobufjs: ^7.1.2 - rlp: ^3.0.0 - rxjs: ^7.8.0 - web3: ^1.8.1 - web3-core: ^1.8.1 - web3-core-helpers: ^1.8.1 - web3-eth-contract: ^1.8.1 - web3-utils: ^1.8.1 - languageName: unknown - linkType: soft - "@subwallet/extension-koni-ui@^0.8.1, @subwallet/extension-koni-ui@workspace:packages/extension-koni-ui": version: 0.0.0-use.local resolution: "@subwallet/extension-koni-ui@workspace:packages/extension-koni-ui" @@ -6180,7 +6100,6 @@ __metadata: "@subwallet/extension-chains": ^0.8.1 "@subwallet/extension-dapp": ^0.8.1 "@subwallet/extension-inject": ^0.8.1 - "@subwallet/extension-koni-base": ^0.8.1 "@subwallet/extension-mocks": ^0.8.1 "@subwallet/keyring": ^0.0.4 "@subwallet/react-ui": 5.1.2-b30 @@ -6248,7 +6167,6 @@ __metadata: "@polkadot/dev": ^0.65.23 "@subwallet/extension-base": ^0.8.1 "@subwallet/extension-inject": ^0.8.1 - "@subwallet/extension-koni-base": ^0.8.1 "@subwallet/extension-koni-ui": ^0.8.1 assert: ^2.0.0 babel-loader: ^8.2.5 @@ -6395,7 +6313,6 @@ __metadata: "@polkadot/dev": ^0.67.162 "@subwallet/extension-base": ^0.8.1 "@subwallet/extension-inject": ^0.8.1 - "@subwallet/extension-koni-base": ^0.8.1 "@subwallet/extension-koni-ui": ^0.8.1 assert: ^2.0.0 babel-loader: ^8.2.5