Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into webapp…
Browse files Browse the repository at this point in the history
…-dev

# Conflicts:
#	packages/webapp/package.json
  • Loading branch information
lw-cdm committed Oct 2, 2024
2 parents 43ac5cb + 2c00906 commit 8cf1fd6
Show file tree
Hide file tree
Showing 48 changed files with 733 additions and 271 deletions.
3 changes: 2 additions & 1 deletion .123trigger
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,5 @@
1.2.28
1.2.29
1.2.30
1.2.31
1.2.31
1.2.32
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## 1.2.32
Build date: Oct 01, 2024.

Features & Update:
- Improve marketing campaign (#3461, #2807)

Bugs fixed:
- Hot fix handle API status (#3711)

## 1.2.31
Build date: Sep 28, 2024.

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
2838 AnhMTV Release version 1.2.31
2842 AnhMTV Release version 1.2.32
2541 Nam Phạm [Issue 3680] chore: update chainlist
2190 S2kael [Issue-3680] Update stable version for chain-list
2192 S2kael [Issue-3711] Rollback handle pending state for balance item
848 lw-cdm [Issue-3407] WebApp - Support Avail Ledger app
565 nguyentiendung [Issue-2845] Fix UI bugs export accounts
465 Jaco 0.42.5 (#969)
327 bluezdot [Issue-3635] feat: update content
241 Thiendekaco
185 quangdo
160 Automation Bot [CI Skip] Auto increase webapp build number
146 dominhquang [Issue-3468] Improve condition for Marketing campaign
157 dominhquang
118 lw-cdm
104 khainh predefine metadata for Polkadot & Kusama chains
83 Hieu Dao Update README.md
Expand Down
2 changes: 1 addition & 1 deletion 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.2.31",
"version": "1.2.32",
"workspaces": [
"packages/*"
],
Expand Down
12 changes: 6 additions & 6 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.2.31-0",
"version": "1.2.32-0",
"main": "index.js",
"dependencies": {
"@acala-network/api": "^5.0.2",
Expand Down Expand Up @@ -56,10 +56,10 @@
"@sora-substrate/type-definitions": "^1.17.7",
"@substrate/connect": "^0.8.9",
"@subwallet/chain-list": "0.2.88",
"@subwallet/extension-base": "^1.2.31-0",
"@subwallet/extension-chains": "^1.2.31-0",
"@subwallet/extension-dapp": "^1.2.31-0",
"@subwallet/extension-inject": "^1.2.31-0",
"@subwallet/extension-base": "^1.2.32-0",
"@subwallet/extension-chains": "^1.2.32-0",
"@subwallet/extension-dapp": "^1.2.32-0",
"@subwallet/extension-inject": "^1.2.32-0",
"@subwallet/keyring": "^0.1.7",
"@subwallet/ui-keyring": "^0.1.7",
"@walletconnect/keyvaluestorage": "^1.1.1",
Expand Down Expand Up @@ -100,7 +100,7 @@
"web3-utils": "^1.10.0"
},
"devDependencies": {
"@subwallet/extension-mocks": "^1.2.31-0",
"@subwallet/extension-mocks": "^1.2.32-0",
"@types/uuid": "^9.0.1"
}
}
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.2.31-0' };
export const packageInfo = { name: '@subwallet/extension-base', path: 'auto', type: 'auto', version: '1.2.32-0' };
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ export function subscribeBalance (

const substrateApi = await substrateApiMap[chainSlug].isReady;

if (!substrateApi.isApiReady) {
handleUnsupportedOrPendingAddresses(
useAddresses,
chainSlug,
chainAssetMap,
APIItemState.PENDING,
callback
);
}

return subscribeSubstrateBalance(useAddresses, chainInfo, chainAssetMap, substrateApi, evmApi, callback, extrinsicType);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export class SubstrateApi implements _SubstrateApi {

if (this.isApiReadyOnce) {
this.handleApiReady.resolve(this);
this.isApiReady = true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,17 @@ export interface AppPopupData extends AppCommonData {
media: string;
buttons: AppContentButton[];
repeat_every_x_days: number | null;
ios_version_range: string;
app_version_range: string;
}

export interface AppBannerData extends AppCommonData {
priority: number;
media: string;
action: AppContentButtonAction;
instruction: AppContentButtonInstruction | null;
ios_version_range: string;
app_version_range: string;
}

export interface AppConfirmationData extends AppCommonData {
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.2.31-0",
"version": "1.2.32-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.2.31-0"
"@subwallet/extension-inject": "^1.2.32-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.2.31-0' };
export const packageInfo = { name: '@subwallet/extension-chains', path: 'auto', type: 'auto', version: '1.2.32-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.2.31-0",
"version": "1.2.32-0",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.6",
"@metamask/detect-provider": "^1.2.0",
"@polkadot/types": "^11.0.3",
"@polkadot/util": "^12.6.2",
"@subwallet/extension-inject": "^1.2.31-0",
"@subwallet/extension-inject": "^1.2.32-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.2.31-0' };
export const packageInfo = { name: '@subwallet/extension-compat-metamask', path: 'auto', type: 'auto', version: '1.2.32-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.2.31-0",
"version": "1.2.32-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.2.31-0"
"@subwallet/extension-inject": "^1.2.32-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.2.31-0' };
export const packageInfo = { name: '@subwallet/extension-dapp', path: 'auto', type: 'auto', version: '1.2.32-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.2.31-0",
"version": "1.2.32-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.2.31-0' };
export const packageInfo = { name: '@subwallet/extension-inject', path: 'auto', type: 'auto', version: '1.2.32-0' };
14 changes: 8 additions & 6 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.2.31-0",
"version": "1.2.32-0",
"dependencies": {
"@babel/runtime": "^7.20.6",
"@coinbase/cbpay-js": "^1.7.0",
Expand All @@ -35,10 +35,10 @@
"@ramonak/react-progress-bar": "^5.0.3",
"@reduxjs/toolkit": "^1.9.1",
"@subwallet/chain-list": "0.2.88",
"@subwallet/extension-base": "^1.2.31-0",
"@subwallet/extension-chains": "^1.2.31-0",
"@subwallet/extension-dapp": "^1.2.31-0",
"@subwallet/extension-inject": "^1.2.31-0",
"@subwallet/extension-base": "^1.2.32-0",
"@subwallet/extension-chains": "^1.2.32-0",
"@subwallet/extension-dapp": "^1.2.32-0",
"@subwallet/extension-inject": "^1.2.32-0",
"@subwallet/keyring": "^0.1.7",
"@subwallet/react-ui": "5.1.2-b77",
"@subwallet/ui-keyring": "^0.1.7",
Expand All @@ -47,6 +47,7 @@
"boring-avatars": "^1.7.0",
"bowser": "^2.11.0",
"classnames": "^2.3.2",
"compare-versions": "^6.1.1",
"copy-to-clipboard": "^3.3.3",
"cross-fetch": "^4.0.0",
"file-saver": "^2.0.5",
Expand Down Expand Up @@ -79,13 +80,14 @@
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"redux-toolkit": "^1.1.2",
"rehype-raw": "^7.0.0",
"semantic-ui-react": "^2.1.4",
"styled-components": "^5.3.6",
"url-parse": "^1.5.10",
"usehooks-ts": "^2.9.1"
},
"devDependencies": {
"@subwallet/extension-mocks": "^1.2.31-0",
"@subwallet/extension-mocks": "^1.2.32-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 @@ -8,9 +8,10 @@ import { YieldPoolInfo, YieldPoolType } from '@subwallet/extension-base/types';
import { BN_ZERO } from '@subwallet/extension-base/utils';
import { EmptyList, FilterModal, Layout } from '@subwallet/extension-koni-ui/components';
import { EarningOptionItem } from '@subwallet/extension-koni-ui/components/Earning';
import BannerGenerator from '@subwallet/extension-koni-ui/components/StaticContent/BannerGenerator';
import { ASTAR_PORTAL_URL, DEFAULT_EARN_PARAMS, EARN_TRANSACTION } from '@subwallet/extension-koni-ui/constants';
import { HomeContext } from '@subwallet/extension-koni-ui/contexts/screen/HomeContext';
import { useFilterModal, useGroupYieldPosition, useHandleChainConnection, useSelector, useTranslation, useYieldGroupInfo } from '@subwallet/extension-koni-ui/hooks';
import { useFilterModal, useGetBannerByScreen, useGroupYieldPosition, useHandleChainConnection, useSelector, useTranslation, useYieldGroupInfo } from '@subwallet/extension-koni-ui/hooks';
import { getBalanceValue } from '@subwallet/extension-koni-ui/hooks/screen/home/useAccountBalance';
import { ChainConnectionWrapper } from '@subwallet/extension-koni-ui/Popup/Home/Earning/shared/ChainConnectionWrapper';
import { EarningEntryView, EarningPoolsParam, ThemeProps, YieldGroupInfo } from '@subwallet/extension-koni-ui/types';
Expand Down Expand Up @@ -71,7 +72,7 @@ function Component ({ className, hasEarningPositions, setEntryView }: Props) {
const chainInfoMap = useSelector((state) => state.chainStore.chainInfoMap);
const { currentAccount } = useSelector((state) => state.accountState);
const { accountBalance: { tokenBalanceMap } } = useContext(HomeContext);

const { banners, dismissBanner, onClickBanner } = useGetBannerByScreen('earning');
const isShowBalance = useSelector((state) => state.settings.isShowBalance);

const [, setEarnStorage] = useLocalStorage(EARN_TRANSACTION, DEFAULT_EARN_PARAMS);
Expand Down Expand Up @@ -360,6 +361,15 @@ function Component ({ className, hasEarningPositions, setEntryView }: Props) {
subHeaderPaddingVertical={true}
title={t<string>('Earning options')}
>
{!!banners.length && (
<div className={'earning-banner-wrapper'}>
<BannerGenerator
banners={banners}
dismissBanner={dismissBanner}
onClickBanner={onClickBanner}
/>
</div>
)}
<SwList.Section
actionBtnIcon={<Icon phosphorIcon={FadersHorizontal} />}
className={'__section-list-container'}
Expand Down Expand Up @@ -403,6 +413,12 @@ const EarningOptions = styled(Component)<Props>(({ theme: { token } }: Props) =>
'+ .earning-option-item': {
marginTop: token.marginXS
}
},

'.earning-banner-wrapper': {
paddingLeft: token.padding,
paddingRight: token.padding,
marginBottom: token.sizeXS
}
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { ALL_ACCOUNT_KEY } from '@subwallet/extension-base/constants';
import { YieldPoolType, YieldPositionInfo } from '@subwallet/extension-base/types';
import { AlertModal, EmptyList, FilterModal, Layout } from '@subwallet/extension-koni-ui/components';
import { EarningPositionItem } from '@subwallet/extension-koni-ui/components/Earning';
import BannerGenerator from '@subwallet/extension-koni-ui/components/StaticContent/BannerGenerator';
import { ASTAR_PORTAL_URL, BN_TEN, EARNING_WARNING_ANNOUNCEMENT } from '@subwallet/extension-koni-ui/constants';
import { useAlert, useFilterModal, useGetYieldPositionForSpecificAccount, useSelector, useTranslation } from '@subwallet/extension-koni-ui/hooks';
import { useAlert, useFilterModal, useGetBannerByScreen, useGetYieldPositionForSpecificAccount, useSelector, useTranslation } from '@subwallet/extension-koni-ui/hooks';
import { reloadCron } from '@subwallet/extension-koni-ui/messaging';
import { RootState } from '@subwallet/extension-koni-ui/stores';
import { EarningEntryView, EarningPositionDetailParam, ExtraYieldPositionInfo, ThemeProps } from '@subwallet/extension-koni-ui/types';
Expand Down Expand Up @@ -46,6 +47,7 @@ function Component ({ className, earningPositions, setEntryView, setLoading }: P
const { filterSelectionMap, onApplyFilter, onChangeFilterOption, onCloseFilterModal, selectedFilters } = useFilterModal(FILTER_MODAL_ID);
const { alertProps, closeAlert, openAlert } = useAlert(alertModalId);
const specificList = useGetYieldPositionForSpecificAccount(currentAccount?.address);
const { banners, dismissBanner, onClickBanner } = useGetBannerByScreen('earning');
const [announcement, setAnnouncement] = useLocalStorage(EARNING_WARNING_ANNOUNCEMENT, 'nonConfirmed');

const items: ExtraYieldPositionInfo[] = useMemo(() => {
Expand Down Expand Up @@ -369,6 +371,15 @@ function Component ({ className, earningPositions, setEntryView, setLoading }: P
subHeaderPaddingVertical={true}
title={t<string>('Your earning positions')}
>
{!!banners.length && (
<div className={'earning-banner-wrapper'}>
<BannerGenerator
banners={banners}
dismissBanner={dismissBanner}
onClickBanner={onClickBanner}
/>
</div>
)}
<SwList.Section
actionBtnIcon={<Icon phosphorIcon={FadersHorizontal} />}
className={'__section-list-container'}
Expand Down Expand Up @@ -434,6 +445,12 @@ const EarningPositions = styled(Component)<Props>(({ theme: { token } }: Props)
'+ .earning-position-item': {
marginTop: token.marginXS
}
},

'.earning-banner-wrapper': {
paddingLeft: token.padding,
paddingRight: token.padding,
marginBottom: token.sizeXS
}
}));

Expand Down
Loading

0 comments on commit 8cf1fd6

Please sign in to comment.