Skip to content

Commit

Permalink
feat(HW-542): All Networks mobile implementation (#2086)
Browse files Browse the repository at this point in the history
* feat(HW-638): All networks selector

* feat(HW-639): ProviderStore refactoring

* feat(HW-639): Fetch balances tokens transactions nfts

* feat(HW-639): all networks fetching fixes

* feat(HW-650): Remove provider from context

* feat(HW-650): Add observers for mobx providers

* feat(HW-650): Fix initialization issues

* feat(HW-650): Fix balance issues

* increase version to 1.9.2
  • Loading branch information
devkudasov committed Sep 9, 2024
1 parent 566ef6c commit 2c01393
Show file tree
Hide file tree
Showing 121 changed files with 1,696 additions and 1,470 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {name as appName} from './app.json';
import {App} from './src/app';
import './src/event-actions';
import {Jailbreak} from './src/jailbreak';
import {Provider} from '@app/models/provider';

if (!global.BigInt) {
const BigInt = require('big-integer');
Expand Down Expand Up @@ -100,8 +101,8 @@ JsonRpcProvider.prototype.send = async function (method, params) {

const eventParams = {
type: 'EVM',
network: app.provider.name,
chainId: `${app.provider.ethChainId}`,
network: Provider.selectedProvider.name,
chainId: `${Provider.selectedProvider.ethChainId}`,
address: parsedAddressFrom,
};

Expand Down
12 changes: 12 additions & 0 deletions ios/haqq/Images.xcassets/networks.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images": [
{
"filename": "networks.svg",
"idiom": "universal"
}
],
"info": {
"author": "xcode",
"version": 1
}
}
11 changes: 11 additions & 0 deletions ios/haqq/Images.xcassets/networks.imageset/networks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haqq",
"version": "1.9.1",
"version": "1.9.2",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
2 changes: 1 addition & 1 deletion src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const App = () => {
sleep(150)
.then(async () => await app.awaitForInitialization())
.then(() => SplashScreen.hide())
.then(() => awaitForEventDone(Events.onAppInitialized))
.then(async () => await awaitForEventDone(Events.onAppInitialized))
.then(async () => await Language.init())
.then(async () => {
await Stories.fetch(true);
Expand Down
8 changes: 4 additions & 4 deletions src/components/account-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {
InfoBlock,
Text,
} from '@app/components/ui';
import {app} from '@app/contexts';
import {createTheme} from '@app/helpers';
import {I18N} from '@app/i18n';
import {Provider} from '@app/models/provider';
import {Wallet} from '@app/models/wallet';
import {sendNotification} from '@app/services';
import {GRADIENT_END, GRADIENT_START} from '@app/variables/common';
Expand Down Expand Up @@ -76,7 +76,7 @@ export const AccountDetail = observer(
title={I18N.evmTitle}
component={null}
/>
{app.provider.config.isBech32Enabled && (
{Provider.selectedProvider.config.isBech32Enabled && (
<TopTabNavigator.Tab
name={TabNames.bech32}
title={I18N.bech32Title}
Expand All @@ -90,8 +90,8 @@ export const AccountDetail = observer(
style={styles.info}
i18n={I18N.modalDetailsQRWarning}
i18params={{
assetName: app.provider.denom,
networkName: app.provider.name,
assetName: Provider.selectedProvider.denom,
networkName: Provider.selectedProvider.name,
}}
icon={<Icon name="warning" color={Color.textYellow1} />}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/animated-balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Timer from 'react-timer-mixin';

import {Color, getColor} from '@app/colors';
import {Text, TextVariant} from '@app/components/ui';
import {app} from '@app/contexts';
import {cleanNumber, createTheme} from '@app/helpers';
import {Provider} from '@app/models/provider';

type Props = {
value: number;
Expand Down Expand Up @@ -85,7 +85,7 @@ export class AnimateNumber extends Component<Props, State> {
color={Color.textBase3}
numberOfLines={1}
style={styles.currencySuffixText}>
{` ${app.provider.denom}`}
{` ${Provider.selectedProvider.denom}`}
</Text>
</View>
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/home-earn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {RefreshControl, ScrollView, TouchableOpacity, View} from 'react-native';
import {RiveRef} from 'rive-react-native';

import {Color} from '@app/colors';
import {app} from '@app/contexts';
import {cleanNumber, createTheme} from '@app/helpers';
import {useThemeSelector} from '@app/hooks';
import {I18N} from '@app/i18n';
import {Provider} from '@app/models/provider';
import {Raffle} from '@app/types';
import {SHADOW_L} from '@app/variables/shadows';

Expand Down Expand Up @@ -114,7 +114,7 @@ export const HomeEarn = observer(
variant={TextVariant.t14}
color={Color.textBase2}
i18n={I18N.earnStakingDescription}
i18params={{symbol: app.provider.denom}}
i18params={{symbol: Provider.selectedProvider.denom}}
/>
</View>
</View>
Expand All @@ -129,7 +129,7 @@ export const HomeEarn = observer(
<Text variant={TextVariant.t14} i18n={I18N.earnRewards} />
<Spacer width={5} />
<Text variant={TextVariant.t13} color={Color.textGreen1}>
{`${formattedRewardAmount} ${app.provider.denom}`}
{`${formattedRewardAmount} ${Provider.selectedProvider.denom}`}
</Text>
<Spacer flex={1} />
{showStakingGetRewardsButtons && (
Expand Down
4 changes: 2 additions & 2 deletions src/components/home-staking/staking-active.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import {
TextPosition,
TextVariant,
} from '@app/components/ui';
import {app} from '@app/contexts';
import {createTheme} from '@app/helpers';
import {useTheme} from '@app/hooks';
import {I18N} from '@app/i18n';
import {Provider} from '@app/models/provider';
import {Balance} from '@app/services/balance';
import {AppTheme} from '@app/types';
import {IS_IOS} from '@app/variables/common';
Expand Down Expand Up @@ -106,7 +106,7 @@ export const StakingActive = observer(
position={TextPosition.center}
color={Color.textBase2}
i18n={I18N.homeStakingEmpty}
i18params={{symbol: app.provider.denom}}
i18params={{symbol: Provider.selectedProvider.denom}}
/>
<Spacer height={36} />
<Lottie
Expand Down
4 changes: 2 additions & 2 deletions src/components/home-staking/staking-empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
TextPosition,
TextVariant,
} from '@app/components/ui';
import {app} from '@app/contexts';
import {createTheme} from '@app/helpers';
import {I18N} from '@app/i18n';
import {Provider} from '@app/models/provider';
import {Balance} from '@app/services/balance';

interface StakingEmptyProps {
Expand All @@ -30,7 +30,7 @@ export const StakingEmpty = observer(({availableSum}: StakingEmptyProps) => {
position={TextPosition.center}
color={Color.textBase2}
i18n={I18N.homeStakingEmpty}
i18params={{symbol: app.provider.denom}}
i18params={{symbol: Provider.selectedProvider.denom}}
/>
<Spacer height={36} />
<View style={styles.circleIconContainer}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/json-rpc-sign/json-rpc-common-transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {shortAddress} from '@app/helpers/short-address';
import {I18N} from '@app/i18n';
import {Contracts} from '@app/models/contracts';
import {Fee} from '@app/models/fee';
import {Provider} from '@app/models/provider';
import {ProviderModel} from '@app/models/provider';
import {Token} from '@app/models/tokens';
import {Balance} from '@app/services/balance';
import {JsonRpcMetadata, JsonRpcTransactionRequest} from '@app/types';
Expand All @@ -34,7 +34,7 @@ export interface JsonRpcCommonTransactionProps {
showSignContratAttention: boolean;
functionName?: string;
isContract: boolean;
provider: Provider | undefined;
provider: ProviderModel | undefined;
isFeeLoading: boolean;
fee: Fee | null | undefined;
tx: Partial<JsonRpcTransactionRequest> | undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/components/json-rpc-sign/json-rpc-swap-transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {I18N} from '@app/i18n';
import {Contracts} from '@app/models/contracts';
import {Currencies} from '@app/models/currencies';
import {Fee} from '@app/models/fee';
import {Provider} from '@app/models/provider';
import {ProviderModel} from '@app/models/provider';
import {Token} from '@app/models/tokens';
import {Wallet} from '@app/models/wallet';
import {Balance} from '@app/services/balance';
Expand All @@ -50,7 +50,7 @@ import {

export interface JsonRpcSwapTransactionProps {
metadata: JsonRpcMetadata;
provider: Provider | undefined;
provider: ProviderModel | undefined;
isFeeLoading: boolean;
functionName: string;
fee: Fee | null | undefined;
Expand Down
Loading

0 comments on commit 2c01393

Please sign in to comment.