Skip to content

Commit

Permalink
Merge branch 'develop' into feature/add-fearless-to-bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Polyakov authored Apr 24, 2024
2 parents faae7a3 + 11c1dd2 commit 479f4d6
Show file tree
Hide file tree
Showing 159 changed files with 4,551 additions and 3,194 deletions.
9 changes: 5 additions & 4 deletions env.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@
"NETWORK_TYPE": "Prod",
"CHAIN_GENESIS_HASH": "0x7e4e32d0feafd4f9c9414b0be86373f9a1efa904809b683453a9af6856d38ad5",
"SUB_NETWORKS": {
"Kusama": "wss://kusama-rpc.dwellir.com",
"KusamaSora": "wss://ws.parachain-collator-2.c2.sora2.soramitsu.co.jp",
"Polkadot": "wss://polkadot-rpc.dwellir.com",
"PolkadotSora": "wss://ws.parachain-collator-3.pc3.sora2.soramitsu.co.jp"
"Kusama": true,
"KusamaSora": true,
"Polkadot": true,
"PolkadotSora": true,
"Liberland": false
},
"EVM_NETWORKS_IDS": [56, 8217],
"ETH_BRIDGE": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@soramitsu/soraneo-wallet-web": "1.32.5",
"@soramitsu/soraneo-wallet-web": "1.33.0",
"@walletconnect/ethereum-provider": "^2.11.2",
"@walletconnect/modal": "^2.6.2",
"core-js": "^3.36.0",
Expand Down
33 changes: 27 additions & 6 deletions public/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"chain": "SORA-dev Testnet #3",
"name": "SORA",
"address": "wss://ws.framenode-3.r0.dev.sora2.soramitsu.co.jp"
},
{
"chain": "SORA-dev Liberland",
"name": "SORA",
"address": "wss://ws.framenode-1.lib1.dev.sora2.soramitsu.co.jp"
}
],
"SUBQUERY_ENDPOINT": "https://api.subquery.network/sq/sora-xor/sora-dev",
Expand All @@ -41,11 +46,27 @@
"CHAIN_GENESIS_HASH": "",
"EVM_NETWORKS_IDS": [97, 1001],
"SUB_NETWORKS": {
"Rococo": "wss://ws.relaychain-node-1.r1.dev.sora2.soramitsu.co.jp",
"RococoSora": "wss://ws.parachain-collator-1.c1.dev.sora2.soramitsu.co.jp",
"Kusama": "wss://kusama-rpc.polkadot.io",
"KusamaSora": "wss://ws.parachain-collator-1.c1.sora2.soramitsu.co.jp",
"Polkadot": "wss://rpc.polkadot.io"
"Rococo": [
{
"chain": "Rococo Dev Testnet",
"name": "Soramitsu",
"address": "wss://ws.relaychain-node-1.r1.dev.sora2.soramitsu.co.jp"
}
],
"RococoSora": [
{
"chain": "SORA Rococo Parachain Dev Testnet",
"name": "Soramitsu",
"address": "wss://ws.parachain-collator-1.c1.dev.sora2.soramitsu.co.jp"
}
],
"Liberland": [
{
"chain": "Liberland Dev Testnet",
"name": "Soramitsu",
"address": "wss://ws.liberland-node-1.lib1.dev.sora2.soramitsu.co.jp"
}
]
},
"ETH_BRIDGE": {
"evmNetwork": 11155111,
Expand All @@ -55,4 +76,4 @@
"OTHER": "0x401c6A23a44f72151D90878DF0aa86E77fBde0e2"
}
}
}
}
7 changes: 6 additions & 1 deletion public/marketing.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
[
{
"title": "ORDERBOOK SURVEY",
"img": "/marketing/orderbook.png",
"link": "https://form.typeform.com/to/DMieGaJI"
},
{
"title": "GET SORA CARD",
"img": "/marketing/card.png",
"link": "/#/card"
"link": "https://soracard.com"
},
{
"title": "CONNECT WITH GOOGLE",
Expand Down
Binary file modified public/marketing/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/marketing/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/marketing/orderbook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/marketing/synths.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 33 additions & 30 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import {
WALLET_CONSTS,
WALLET_TYPES,
AlertsApiService,
initWallet,
waitForCore,
} from '@soramitsu/soraneo-wallet-web';
import debounce from 'lodash/debounce';
import { Component, Mixins, Watch } from 'vue-property-decorator';
Expand All @@ -54,15 +56,15 @@ import AppHeader from '@/components/App/Header/AppHeader.vue';
import AppMenu from '@/components/App/Menu/AppMenu.vue';
import NodeErrorMixin from '@/components/mixins/NodeErrorMixin';
import SoraLogo from '@/components/shared/Logo/Sora.vue';
import { PageNames, Components, Language, BreakpointClass, Breakpoint } from '@/consts';
import { PageNames, Components, Language, BreakpointClass, Breakpoint, WalletPermissions } from '@/consts';
import { getLocale } from '@/lang';
import router, { goTo, lazyComponent } from '@/router';
import { action, getter, mutation, state } from '@/store/decorators';
import { getMobileCssClasses, preloadFontFace, updateDocumentTitle } from '@/utils';
import type { NodesConnection } from '@/utils/connection';
import type { FeatureFlags } from './store/settings/types';
import type { EthBridgeSettings, SubNetworkApps } from './store/web3/types';
import type { ConnectToNodeOptions, Node } from './types/nodes';
import type { History, HistoryItem } from '@sora-substrate/util';
import type { WhitelistArrayItem } from '@sora-substrate/util/build/assets/types';
import type { EvmNetwork } from '@sora-substrate/util/build/bridgeProxy/evm/types';
Expand Down Expand Up @@ -95,14 +97,15 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
showNotifsDarkPage = false;
responsiveClass = BreakpointClass.LargeDesktop;
@state.settings.appConnection appConnection!: NodesConnection;
@state.settings.browserNotifPopupVisibility private browserNotifPopup!: boolean;
@state.settings.browserNotifPopupBlockedVisibility private browserNotifPopupBlocked!: boolean;
@state.wallet.account.assetsToNotifyQueue assetsToNotifyQueue!: Array<WhitelistArrayItem>;
@state.referrals.storageReferrer storageReferrer!: string;
@state.settings.disclaimerVisibility disclaimerVisibility!: boolean;
@state.router.loading pageLoading!: boolean;
@getter.settings.chartsEnabled private chartsEnabled!: boolean;
@getter.settings.nodeIsConnected nodeIsConnected!: boolean;
@getter.wallet.transactions.firstReadyTx firstReadyTransaction!: Nullable<HistoryItem>;
@getter.wallet.account.isLoggedIn isSoraAccountConnected!: boolean;
@getter.libraryTheme libraryTheme!: Theme;
Expand All @@ -114,8 +117,6 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
endpoint: string;
}) => void;
@mutation.settings.setDefaultNodes private setDefaultNodes!: (nodes: Array<Node>) => void;
@mutation.settings.setNetworkChainGenesisHash private setNetworkChainGenesisHash!: (hash?: string) => void;
@mutation.settings.setFaucetUrl private setFaucetUrl!: (url: string) => void;
@mutation.settings.setFeatureFlags private setFeatureFlags!: (data: FeatureFlags) => void;
@mutation.settings.setBrowserNotifsPopupEnabled private setBrowserNotifsPopup!: (flag: boolean) => void;
Expand All @@ -125,15 +126,14 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
@mutation.settings.setScreenBreakpointClass private setScreenBreakpointClass!: (cssClass: string) => void;
@mutation.referrals.unsubscribeFromInvitedUsers private unsubscribeFromInvitedUsers!: FnWithoutArgs;
@mutation.web3.setEvmNetworksApp private setEvmNetworksApp!: (data: EvmNetwork[]) => void;
@mutation.web3.setSubNetworkApps private setSubNetworkApps!: (data: SubNetworkApps) => void;
@mutation.web3.setEthBridgeSettings private setEthBridgeSettings!: (settings: EthBridgeSettings) => Promise<void>;
@mutation.referrals.resetStorageReferrer private resetStorageReferrer!: FnWithoutArgs;
@action.web3.setSubNetworkApps private setSubNetworkApps!: (data: SubNetworkApps) => void;
@action.wallet.settings.setApiKeys private setApiKeys!: (apiKeys: WALLET_TYPES.ApiKeysObject) => Promise<void>;
@action.wallet.subscriptions.resetNetworkSubscriptions private resetNetworkSubscriptions!: AsyncFnWithoutArgs;
@action.wallet.subscriptions.resetInternalSubscriptions private resetInternalSubscriptions!: AsyncFnWithoutArgs;
@action.wallet.subscriptions.activateNetwokSubscriptions private activateNetwokSubscriptions!: AsyncFnWithoutArgs;
@action.settings.connectToNode private connectToNode!: (options: ConnectToNodeOptions) => Promise<void>;
@action.settings.setLanguage private setLanguage!: (lang: Language) => Promise<void>;
@action.settings.setBlockNumber private setBlockNumber!: AsyncFnWithoutArgs;
@action.settings.fetchAdsArray private fetchAdsArray!: AsyncFnWithoutArgs;
Expand Down Expand Up @@ -239,7 +239,6 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
await this.setEthBridgeSettings(data.ETH_BRIDGE);
this.setFeatureFlags(data?.FEATURE_FLAGS);
this.setSoraNetwork(data.NETWORK_TYPE);
this.setDefaultNodes(data?.DEFAULT_NETWORKS);
this.setEvmNetworksApp(data.EVM_NETWORKS_IDS);
this.setSubNetworkApps(data.SUB_NETWORKS);
Expand All @@ -253,9 +252,9 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
if (data.FAUCET_URL) {
this.setFaucetUrl(data.FAUCET_URL);
}
if (data.CHAIN_GENESIS_HASH) {
this.setNetworkChainGenesisHash(data.CHAIN_GENESIS_HASH);
}
this.appConnection.setDefaultNodes(data?.DEFAULT_NETWORKS);
this.appConnection.setNetworkChainGenesisHash(data?.CHAIN_GENESIS_HASH);
// connection to node
await this.runAppConnectionToNode();
Expand All @@ -269,10 +268,6 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
window.addEventListener('resize', this.setResponsiveClassDebounced);
}
private get isSwapPageWithCharts(): boolean {
return this.$route.name === PageNames.Swap && this.chartsEnabled;
}
private get mobileCssClasses(): string[] | undefined {
return getMobileCssClasses();
}
Expand All @@ -281,10 +276,6 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
return this.$route.name === PageNames.About;
}
get isCurrentPageTooWide(): boolean {
return this.isAboutPage || this.isSwapPageWithCharts || this.$route.name === PageNames.Tokens;
}
get dsProviderClasses(): string[] | BreakpointClass {
return this.mobileCssClasses?.length ? [...this.mobileCssClasses, this.responsiveClass] : this.responsiveClass;
}
Expand All @@ -295,9 +286,6 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
if (this.$route.name) {
cssClasses.push(`${baseClass}--${this.$route.name.toLowerCase()}`);
}
if (this.isSwapPageWithCharts) {
cssClasses.push(`${baseClass}--has-charts`);
}
return cssClasses;
}
Expand Down Expand Up @@ -373,14 +361,30 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
}
private async runAppConnectionToNode() {
const walletOptions = {
permissions: WalletPermissions,
appName: WALLET_CONSTS.TranslationConsts.Polkaswap,
};
try {
await this.connectToNode({
onError: (error) => this.handleNodeError(error, true), // prefer notification on connection success
onDisconnect: this.handleNodeDisconnect,
onReconnect: this.handleNodeReconnect,
});
// Run in parallel
// 1) Wallet core initialization (node connection independent)
// 2) Connection to node
await Promise.all([
waitForCore(walletOptions),
this.appConnection.connect({
onError: this.handleNodeError,
onDisconnect: this.handleNodeDisconnect,
onReconnect: this.handleNodeConnect,
}),
]);
} catch (error) {
// we handled error using callback, do nothing
} finally {
// Wallet node connection dependent logic
if (!this.isWalletLoaded) {
await initWallet(walletOptions);
}
}
}
}
Expand Down Expand Up @@ -568,13 +572,12 @@ i.icon-divider {
}
@include desktop {
.app-main {
&.app-main--swap.app-main--has-charts {
.app-main--swap {
&.app-main {
.app-menu {
&:not(.collapsed) {
position: relative;
}
&.collapsed {
& + .app-body {
margin-left: 74px;
Expand Down
7 changes: 4 additions & 3 deletions src/assets/img/networks/avalanche.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 7 additions & 19 deletions src/assets/img/networks/binance-smart-chain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion src/assets/img/networks/ethereum-classic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 479f4d6

Please sign in to comment.