Skip to content

Commit

Permalink
Merge branch 'refs/heads/subwallet-dev' into koni/dev/issue-2853
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/extension-base/package.json
#	yarn.lock
  • Loading branch information
nampc1 committed Apr 12, 2024
2 parents 00e23a5 + 0eaa764 commit 6639d31
Show file tree
Hide file tree
Showing 101 changed files with 1,991 additions and 597 deletions.
5 changes: 4 additions & 1 deletion .123trigger
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@
1.1.47
1.1.48
1.1.49
1.1.50
1.1.50
1.1.51
1.1.52
1.1.53
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# CHANGELOG

## 1.1.54
Build date: Apl 09, 2024.

Bugs fixed:
- Fix issue in transaction screen (#2891)
- Fix error in setting screen

## 1.1.53
Build date: Apl 08, 2024.

Bugs fixed:
- Fixed bug fetching balance with Enjin Relay Chain (#2885)
- Fixed bug Wallet Connect not show connection popup (#2407)
- Fixed bug Some required methods are missing when connecting Dapp to Subwallet via WalletConnect (#2860)

## 1.1.52
Build date: Apl 05, 2024.

Features & Update:
- Update balance service (#2416)
- Improve UX UI for earning feature (#2827)
- Update message when navigate user to the Astar portal to stake (#2847)
- Update chain-list (#2851)
- Add support for X Layer mainnet, X Layer testnet
- Add support for ASTR token on Astar zkEVM
- Add support DOTA token on Polkadot Asset Hub
- Add support BNCS for Moonbeam

Bugs fixed:
- Fixed bug show earnings screen although back to home (#2742)


## 1.1.51
Build date: Apl 02, 2024.

Features & Update:
- Update withdraw time for parachain staking (#2829)

## 1.1.50
Build date: Mar 28, 2024.

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
2358 AnhMTV Update chain list patch with fixed version
2381 AnhMTV
2173 Nam Phạm [Issue 2786] feat: enable some tokens automatically
1980 S2kael [Issue-2824] Handle case online data is null
2001 S2kael [Issue-2885] Fix error when fetching balance with Enjin relay chain
620 lw-cdm Fix eslint issues
465 Jaco 0.42.5 (#969)
185 quangdo
104 khainh predefine metadata for Polkadot & Kusama chains
99 lw-cdm
88 dominhquang [Issue-2649] Add send crash log feature
87 nguyentiendung [Issue-2827] Extension - Just only show Testnet network
83 Hieu Dao Update README.md
82 nguyentiendung [Issue-2784] Update url for redirect swap extension
82 Thibaut Sardan Add account filtering feature (#832)
81 bluezdot [Issue-2851] Update x layer testnet block explorer
80 leewong Update account filter for earn transaction
77 bluezdot [Issue-2805] Update chainlist
63 Roman fix ui issues
53 Dominhquangdev update Bridge code
48 bluedot [Issue-2771] Update multichain asset logo for ASTR
34 Thiendekaco [Issue 2785] Extension - Support connect Ledger device for Asset Hub
39 Thiendekaco [Issue 2891] Extension - Show dApp confirmation although performing transaction in app
29 Automation Bot [CI Skip] Auto increase webapp build number
24 S2kael
10 Trang Trịnh api get karura and acala nfts
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/Koniverse/Subwallet-V2.git"
},
"sideEffects": false,
"version": "1.1.51-1",
"version": "1.1.54",
"workspaces": [
"packages/*"
],
Expand Down Expand Up @@ -91,9 +91,9 @@
"@polkadot/types-codec": "10.10.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@subwallet/chain-list": "0.2.53",
"@subwallet/keyring": "^0.1.3",
"@subwallet/ui-keyring": "^0.1.3",
"@subwallet/chain-list": "0.2.54",
"@subwallet/keyring": "^0.1.5",
"@subwallet/ui-keyring": "^0.1.5",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^29.3.1",
"browserify-sign": "^4.2.2",
Expand Down
18 changes: 9 additions & 9 deletions packages/extension-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "1.1.51-1",
"version": "1.1.54-0",
"main": "index.js",
"dependencies": {
"@acala-network/api": "^5.0.2",
Expand Down Expand Up @@ -48,13 +48,13 @@
"@reduxjs/toolkit": "^1.9.1",
"@sora-substrate/type-definitions": "^1.17.7",
"@substrate/connect": "^0.8.9",
"@subwallet/chain-list": "0.2.53",
"@subwallet/extension-base": "^1.1.51-1",
"@subwallet/extension-chains": "^1.1.51-1",
"@subwallet/extension-dapp": "^1.1.51-1",
"@subwallet/extension-inject": "^1.1.51-1",
"@subwallet/keyring": "^0.1.3",
"@subwallet/ui-keyring": "^0.1.3",
"@subwallet/chain-list": "0.2.54",
"@subwallet/extension-base": "^1.1.54-0",
"@subwallet/extension-chains": "^1.1.54-0",
"@subwallet/extension-dapp": "^1.1.54-0",
"@subwallet/extension-inject": "^1.1.54-0",
"@subwallet/keyring": "^0.1.5",
"@subwallet/ui-keyring": "^0.1.5",
"@walletconnect/sign-client": "^2.8.4",
"@walletconnect/types": "^2.8.4",
"@walletconnect/utils": "^2.8.4",
Expand Down Expand Up @@ -90,7 +90,7 @@
"web3-utils": "^1.10.0"
},
"devDependencies": {
"@subwallet/extension-mocks": "^1.1.51-1",
"@subwallet/extension-mocks": "^1.1.54-0",
"@types/uuid": "^9.0.1"
}
}
12 changes: 12 additions & 0 deletions packages/extension-base/src/background/KoniTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,17 @@ export interface ResponseAccountExportPrivateKey {
publicKey: string;
}

// Export batch accounts

export interface RequestAccountBatchExportV2 {
password: string;
addresses?: string[];
}

export interface ResponseAccountBatchExportV2 {
exportedJson: KeyringPairs$Json;
}

// Get account info with private key

export interface RequestCheckPublicAndSecretKey {
Expand Down Expand Up @@ -2286,6 +2297,7 @@ export interface KoniRequestSignatures {
'pri(json.batchRestoreV2)': [RequestBatchRestoreV2, void];

// Export account
'pri(accounts.batchExportV2)': [RequestAccountBatchExportV2, ResponseAccountBatchExportV2];
'pri(accounts.exportPrivateKey)': [RequestAccountExportPrivateKey, ResponseAccountExportPrivateKey];

// Current account
Expand Down
2 changes: 2 additions & 0 deletions packages/extension-base/src/background/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export interface AccountJson extends AbstractAddressJson {
isMasterAccount?: boolean;
isMasterPassword?: boolean;
isReadOnly?: boolean;
isSubWallet?: boolean; // import from SubWallet
pendingMigrate?: boolean;
originGenesisHash?: string | null;
parentAddress?: string;
source?: string;
Expand Down
4 changes: 1 addition & 3 deletions packages/extension-base/src/koni/api/tokens/evm/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

import { _EvmApi } from '@subwallet/extension-base/services/chain-service/types';

export async function getEVMBalance (networkKey: string, addresses: string[], evmApiMap: Record<string, _EvmApi>): Promise<string[]> {
const web3Api = evmApiMap[networkKey];

export async function getEVMBalance (networkKey: string, addresses: string[], web3Api: _EvmApi): Promise<string[]> {
return await Promise.all(addresses.map(async (address) => {
try {
return await web3Api.api.eth.getBalance(address);
Expand Down
8 changes: 3 additions & 5 deletions packages/extension-base/src/koni/api/tokens/evm/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ export async function getEVMTransactionObject (
to: string,
value: string,
transferAll: boolean,
evmApiMap: Record<string, _EvmApi>
web3Api: _EvmApi
): Promise<[TransactionConfig, string]> {
const networkKey = chainInfo.slug;
const web3Api = evmApiMap[networkKey];

const priority = await calculateGasFeeParams(web3Api, networkKey);

Expand Down Expand Up @@ -101,11 +100,10 @@ export async function getERC20TransactionObject (
to: string,
value: string,
transferAll: boolean,
evmApiMap: Record<string, _EvmApi>
evmApi: _EvmApi
): Promise<[TransactionConfig, string]> {
const networkKey = chainInfo.slug;
const evmApi = evmApiMap[networkKey];
const erc20Contract = getERC20Contract(networkKey, assetAddress, evmApiMap);
const erc20Contract = getERC20Contract(assetAddress, evmApi);

let freeAmount = new BigN(0);
let transferValue = value;
Expand Down
4 changes: 2 additions & 2 deletions packages/extension-base/src/koni/api/tokens/evm/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { _ERC20_ABI } from '@subwallet/extension-base/services/chain-service/hel
import { _EvmApi } from '@subwallet/extension-base/services/chain-service/types';
import { Contract } from 'web3-eth-contract';

export const getERC20Contract = (networkKey: string, assetAddress: string, evmApiMap: Record<string, _EvmApi>, options = {}): Contract => {
export const getERC20Contract = (assetAddress: string, evmApi: _EvmApi, options = {}): Contract => {
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access
return new evmApiMap[networkKey].api.eth.Contract(_ERC20_ABI, assetAddress, options);
return new evmApi.api.eth.Contract(_ERC20_ABI, assetAddress, options);
};
Loading

0 comments on commit 6639d31

Please sign in to comment.