Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Avail Network #47

Open
wants to merge 2 commits into
base: webapp-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .123trigger
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@
1.1.61
1.1.62
1.1.63
1.1.64
1.1.64
1.1.65
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# CHANGELOG

## 1.1.65
Build date: May 17, 2024.

Features & Update:
- Update chain-list (#3040)
- Update chainBalanceSlug and explorer for some chains
- Add support for Hyperbridge (Nexus)
- Add support for CESS testnet
- Add support for Pendulum, Amplitude assets
- Add support for BOB and tokens on BOB

Bugs fixed:
- Fixed bug Unable to back screen in case open General settings to Marketing campaign (#3062)
- Fixed bug when transferring PSP22 token (#3041)

## 1.1.64
Build date: May 11, 2024.

Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
2511 AnhMTV Release version 1.1.64
2518 AnhMTV Release version 1.1.65
2352 Nam Phạm [Issue 2754] fix: fix eslint
2027 S2kael [Issue-3020] Update chain-list stable version
813 lw-cdm
2029 S2kael [Issue-3040] Update stable version for chain-list
815 lw-cdm Fix eslint issues
465 Jaco 0.42.5 (#969)
403 nguyentiendung [Issue-3011] Update UI code for change symbol
416 nguyentiendung [Issue-2914] Update yarn.lock
185 quangdo
129 bluezdot [Issue-3020] Update ED for mythos
137 bluezdot Update chainlist dev
106 dominhquang [Issue-2649] Add send crash log feature
104 khainh predefine metadata for Polkadot & Kusama chains
102 Automation Bot [CI Skip] Auto increase webapp build number
101 lw-cdm
99 Automation Bot [CI Skip] Auto increase webapp build number
83 Hieu Dao Update README.md
82 Thibaut Sardan Add account filtering feature (#832)
81 leewong Swap - Change idle time to 300s
73 Thiendekaco [Issue 2859] [fix] Extension - deploy smart contract when use ledger
74 Thiendekaco [Issue 3062] [fix] Extension - Unable to back screen in case open General settings to Marketing campaign
63 Roman fix ui issues
53 Dominhquangdev update Bridge code
48 bluedot [Issue-2771] Update multichain asset logo for ASTR
Expand Down
6 changes: 3 additions & 3 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.64",
"version": "1.1.65",
"workspaces": [
"packages/*"
],
Expand Down Expand Up @@ -79,7 +79,6 @@
"sinon-chrome": "^3.0.1"
},
"resolutions": {
"@subwallet/react-ui": "5.1.2-b77",
"@ethereumjs/common": "^4.1.0",
"@google/model-viewer": "3.1.1",
"@ledgerhq/hw-app-eth": "6.33.4",
Expand All @@ -92,8 +91,9 @@
"@polkadot/types-codec": "10.10.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@subwallet/chain-list": "0.2.60",
"@subwallet/chain-list": "0.2.61",
"@subwallet/keyring": "^0.1.5",
"@subwallet/react-ui": "5.1.2-b77",
"@subwallet/ui-keyring": "^0.1.5",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^29.3.1",
Expand Down
14 changes: 7 additions & 7 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.64-0",
"version": "1.1.65-0",
"main": "index.js",
"dependencies": {
"@acala-network/api": "^5.0.2",
Expand Down Expand Up @@ -50,11 +50,11 @@
"@reduxjs/toolkit": "^1.9.1",
"@sora-substrate/type-definitions": "^1.17.7",
"@substrate/connect": "^0.8.9",
"@subwallet/chain-list": "0.2.60",
"@subwallet/extension-base": "^1.1.64-0",
"@subwallet/extension-chains": "^1.1.64-0",
"@subwallet/extension-dapp": "^1.1.64-0",
"@subwallet/extension-inject": "^1.1.64-0",
"@subwallet/chain-list": "0.2.61",
"@subwallet/extension-base": "^1.1.65-0",
"@subwallet/extension-chains": "^1.1.65-0",
"@subwallet/extension-dapp": "^1.1.65-0",
"@subwallet/extension-inject": "^1.1.65-0",
"@subwallet/keyring": "^0.1.5",
"@subwallet/ui-keyring": "^0.1.5",
"@walletconnect/sign-client": "^2.8.4",
Expand Down Expand Up @@ -92,7 +92,7 @@
"web3-utils": "^1.10.0"
},
"devDependencies": {
"@subwallet/extension-mocks": "^1.1.64-0",
"@subwallet/extension-mocks": "^1.1.65-0",
"@types/uuid": "^9.0.1"
}
}
6 changes: 6 additions & 0 deletions packages/extension-base/src/koni/api/dotsama/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ interface CreateTransferExtrinsicProps {
export const createTransferExtrinsic = async ({ from, networkKey, substrateApi, to, tokenInfo, transferAll, value }: CreateTransferExtrinsicProps): Promise<[SubmittableExtrinsic | null, string]> => {
const api = substrateApi.api;

const isDisableTransfer = tokenInfo.metadata?.isDisableTransfer as boolean;

if (isDisableTransfer) {
return [null, value];
}

// @ts-ignore
let transfer: SubmittableExtrinsic<'promise'> | null = null;
const isTxCurrenciesSupported = !!api && !!api.tx && !!api.tx.currencies;
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-base/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@subwallet/extension-base', path: 'auto', type: 'auto', version: '1.1.64-0' };
export const packageInfo = { name: '@subwallet/extension-base', path: 'auto', type: 'auto', version: '1.1.65-0' };
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain
import { _checkSmartContractSupportByChain, _getChainNativeTokenSlug, _getContractAddressOfToken, _getTokenOnChainAssetId, _getTokenOnChainInfo, _getTokenTypesSupportedByChain, _getXcmAssetMultilocation, _isBridgedToken, _isChainEvmCompatible, _isSubstrateRelayChain } from '@subwallet/extension-base/services/chain-service/utils';
import { BalanceItem, PalletNominationPoolsPoolMember, SubscribeBasePalletBalance, SubscribeSubstratePalletBalance, TokenBalanceRaw } from '@subwallet/extension-base/types';
import { filterAssetsByChainAndType } from '@subwallet/extension-base/utils';
import BigN from 'bignumber.js';
import { combineLatest, Observable } from 'rxjs';

import { ContractPromise } from '@polkadot/api-contract';
Expand Down Expand Up @@ -245,6 +246,18 @@ const subscribeBridgedBalance = async ({ addresses, assetMap, callback, chainInf
};
};

function extractOkResponse<T> (response: Record<string, T>): T | undefined {
if ('ok' in response) {
return response.ok;
}

if ('Ok' in response) {
return response.Ok;
}

return undefined;
}

const subscribePSP22Balance = ({ addresses, assetMap, callback, chainInfo, substrateApi }: SubscribeSubstratePalletBalance) => {
const chain = chainInfo.slug;
const psp22ContractMap = {} as Record<string, ContractPromise>;
Expand All @@ -262,11 +275,13 @@ const subscribePSP22Balance = ({ addresses, assetMap, callback, chainInfo, subst
try {
const _balanceOf = await contract.query['psp22::balanceOf'](address, { gasLimit: getDefaultWeightV2(substrateApi) }, address);
const balanceObj = _balanceOf?.output?.toPrimitive() as Record<string, any>;
const freeResponse = extractOkResponse(balanceObj) as number | string;
const free: string = freeResponse ? new BigN(freeResponse).toString() : '0';

return {
address: address,
tokenSlug: tokenInfo.slug,
free: _balanceOf.output ? (balanceObj.ok as string ?? balanceObj.Ok as string) : '0',
free,
locked: '0',
state: APIItemState.READY
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Logger } from '@polkadot/util/types';

const availChainInfoMap = (() => {
const enableList = [
'avail_mainnet',
'availTuringTest',
'goldberg_testnet',
'ethereum',
Expand Down
4 changes: 2 additions & 2 deletions packages/extension-chains/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "1.1.64-0",
"version": "1.1.65-0",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.6",
"@polkadot/networks": "^12.6.2",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@subwallet/extension-inject": "^1.1.64-0"
"@subwallet/extension-inject": "^1.1.65-0"
},
"peerDependencies": {
"@polkadot/api": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-chains/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@subwallet/extension-chains', path: 'auto', type: 'auto', version: '1.1.64-0' };
export const packageInfo = { name: '@subwallet/extension-chains', path: 'auto', type: 'auto', version: '1.1.65-0' };
4 changes: 2 additions & 2 deletions packages/extension-compat-metamask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "1.1.64-0",
"version": "1.1.65-0",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.6",
"@metamask/detect-provider": "^1.2.0",
"@polkadot/types": "^10.12.4",
"@polkadot/util": "^12.6.2",
"@subwallet/extension-inject": "^1.1.64-0",
"@subwallet/extension-inject": "^1.1.65-0",
"web3": "^1.10.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-compat-metamask/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@subwallet/extension-compat-metamask', path: 'auto', type: 'auto', version: '1.1.64-0' };
export const packageInfo = { name: '@subwallet/extension-compat-metamask', path: 'auto', type: 'auto', version: '1.1.65-0' };
4 changes: 2 additions & 2 deletions packages/extension-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "1.1.64-0",
"version": "1.1.65-0",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.6",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@subwallet/extension-inject": "^1.1.64-0"
"@subwallet/extension-inject": "^1.1.65-0"
},
"peerDependencies": {
"@polkadot/api": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-dapp/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@subwallet/extension-dapp', path: 'auto', type: 'auto', version: '1.1.64-0' };
export const packageInfo = { name: '@subwallet/extension-dapp', path: 'auto', type: 'auto', version: '1.1.65-0' };
2 changes: 1 addition & 1 deletion packages/extension-inject/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"sideEffects": true,
"type": "module",
"version": "1.1.64-0",
"version": "1.1.65-0",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-inject/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@subwallet/extension-inject', path: 'auto', type: 'auto', version: '1.1.64-0' };
export const packageInfo = { name: '@subwallet/extension-inject', path: 'auto', type: 'auto', version: '1.1.65-0' };
14 changes: 7 additions & 7 deletions packages/extension-koni-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"sideEffects": true,
"type": "module",
"version": "1.1.64-0",
"version": "1.1.65-0",
"dependencies": {
"@babel/runtime": "^7.20.6",
"@coinbase/cbpay-js": "^1.7.0",
Expand All @@ -34,11 +34,11 @@
"@polkadot/util-crypto": "^12.6.2",
"@ramonak/react-progress-bar": "^5.0.3",
"@reduxjs/toolkit": "^1.9.1",
"@subwallet/chain-list": "0.2.60",
"@subwallet/extension-base": "^1.1.64-0",
"@subwallet/extension-chains": "^1.1.64-0",
"@subwallet/extension-dapp": "^1.1.64-0",
"@subwallet/extension-inject": "^1.1.64-0",
"@subwallet/chain-list": "0.2.61",
"@subwallet/extension-base": "^1.1.65-0",
"@subwallet/extension-chains": "^1.1.65-0",
"@subwallet/extension-dapp": "^1.1.65-0",
"@subwallet/extension-inject": "^1.1.65-0",
"@subwallet/keyring": "^0.1.5",
"@subwallet/react-ui": "5.1.2-b77",
"@subwallet/ui-keyring": "^0.1.5",
Expand Down Expand Up @@ -83,7 +83,7 @@
"usehooks-ts": "^2.9.1"
},
"devDependencies": {
"@subwallet/extension-mocks": "^1.1.64-0",
"@subwallet/extension-mocks": "^1.1.65-0",
"@types/bn.js": "^5.1.1",
"@types/enzyme": "^3.10.12",
"@types/enzyme-adapter-react-16": "^1.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ function Component ({ className, earningPositions, setEntryView, setLoading }: P
/>
{item.slug === lastItem.slug && <div className={'__footer-button'}>
<Button
icon={<Icon phosphorIcon={Plus} size='sm' />}
icon={(
<Icon
phosphorIcon={Plus}
size='sm'
/>
)}
onClick={onClickExploreEarning}
size={'xs'}
type={'ghost'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ type LoadingMap = {
};
// "TODO: Will be shown when support for the LIGHT theme is implemented."
const isShowWalletTheme = false;
const SettingsListUrl = '/settings/list';

function Component ({ className = '' }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
Expand Down Expand Up @@ -233,6 +234,10 @@ function Component ({ className = '' }: Props): React.ReactElement<Props> {
});
}, []);

const goBackToSettingList = useCallback(() => {
goBack(SettingsListUrl);
}, [goBack]);

const onSelectCurrency = useCallback((value: string) => {
setLoadingMap((prev) => ({
...prev,
Expand Down Expand Up @@ -282,7 +287,7 @@ function Component ({ className = '' }: Props): React.ReactElement<Props> {
resolve={dataContext.awaitStores(['price'])}
>
<Layout.WithSubHeaderOnly
onBack={goBack}
onBack={goBackToSettingList}
title={t('General settings')}
>
<div className={'__scroll-container'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,18 @@ function Component ({ className = '' }: Props): React.ReactElement<Props> {
});
}, [goBack, priceId, showNotification, t, tokenInfo]);

const goBackToSettingList = useCallback(() => {
goBack();
}, [goBack]);

const leftFooterButtonProps = useCallback(() => {
return _isCustomAsset(tokenInfo.slug)
? {
onClick: goBack,
onClick: goBackToSettingList,
children: t('Cancel')
}
: undefined;
}, [goBack, tokenInfo.slug, t]);
}, [goBackToSettingList, tokenInfo.slug, t]);

const rightFooterButtonProps = useCallback(() => {
return _isCustomAsset(tokenInfo.slug)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ const Component = (props: Props, ref: ForwardedRef<InputRef>) => {
/>

<EarningPoolDetailModal
chain={chain}
detailItem={viewDetailItem}
maxPoolMembersValue={maxPoolMembersValue}
onCancel={onCloseDetail}
chain={chain}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default function useDefaultNavigate () {
);

const goBack = useCallback(
() => {
navigate(RouteState.prevDifferentPathNum);
(urlToBack?: string) => {
typeof urlToBack === 'string' ? navigate(urlToBack) : navigate(RouteState.prevDifferentPathNum);
},
[navigate]
);
Expand Down
Loading
Loading