diff --git a/env.json b/env.json index bb6ba8d50..aef1f4cc4 100644 --- a/env.json +++ b/env.json @@ -50,7 +50,11 @@ ], "NETWORK_TYPE": "Prod", "CHAIN_GENESIS_HASH": "0x7e4e32d0feafd4f9c9414b0be86373f9a1efa904809b683453a9af6856d38ad5", - "SUB_NETWORKS": {}, + "SUB_NETWORKS": { + "Kusama": "wss://kusama-rpc.polkadot.io", + "KusamaSora": "wss://ws.parachain-collator-1.c1.sora2.soramitsu.co.jp", + "Polkadot": "wss://rpc.polkadot.io" + }, "EVM_NETWORKS_IDS": [56, 8217], "ETH_BRIDGE": { "evmNetwork": 1, diff --git a/package.json b/package.json index ccb098289..4a12e2b2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polkaswap-exchange-web", - "version": "1.24.0", + "version": "1.25.0", "repository": { "type": "git", "url": "https://github.com/sora-xor/polkaswap-exchange-web.git" @@ -24,15 +24,16 @@ }, "dependencies": { "@metamask/detect-provider": "^2.0.0", - "@soramitsu/soraneo-wallet-web": "1.23.4", - "@walletconnect/web3-provider": "^1.8.0", - "core-js": "^3.26.0", + "@soramitsu/soraneo-wallet-web": "1.25.1", + "@walletconnect/ethereum-provider": "^2.10.4", + "@walletconnect/modal": "^2.6.2", + "core-js": "^3.33.2", "country-code-emoji": "^2.3.0", "country-flag-emoji-polyfill": "^0.1.4", "direct-vuex": "^0.12.1", "echarts": "^5.4.1", "email-validator": "^2.0.4", - "ethers": "6.7.1", + "ethers": "6.8.0", "jwt-decode": "^3.1.2", "lodash": "^4.17.21", "uuidv4": "^6.2.13", @@ -45,12 +46,12 @@ "vuex": "^3.1.3" }, "devDependencies": { - "@babel/runtime": "^7.22.11", - "@types/electron-devtools-installer": "^2.2.2", - "@types/jest": "^29.2.0", - "@types/jsdom": "^21.1.1", - "@types/lodash": "^4.14.186", - "@types/node": "^20.5.6", + "@babel/runtime": "^7.23.2", + "@types/electron-devtools-installer": "^2.2.3", + "@types/jest": "^29.5.5", + "@types/jsdom": "^21.1.3", + "@types/lodash": "^4.14.199", + "@types/node": "^20.8.4", "@typescript-eslint/eslint-plugin": "^5.2.0", "@typescript-eslint/parser": "^5.2.0", "@vue/cli-plugin-babel": "5.0.8", @@ -85,7 +86,7 @@ "sass": "^1.66.1", "sass-loader": "^13.3.2", "ts-jest": "^27.0.5", - "typescript": "~4.9.5", + "typescript": "~5.2.2", "vue-cli-plugin-electron-builder": "^3.0.0-alpha.3", "vue-cli-plugin-test-attrs": "^0.1.5", "vue-template-compiler": "2.7.14" diff --git a/public/env.json b/public/env.json index 4fbf04bf9..9adc8b036 100644 --- a/public/env.json +++ b/public/env.json @@ -41,7 +41,8 @@ "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" + "RococoSora": "wss://ws.parachain-collator-1.c1.dev.sora2.soramitsu.co.jp", + "Polkadot": "wss://rpc.polkadot.io" }, "ETH_BRIDGE": { "evmNetwork": 11155111, diff --git a/public/marketing.json b/public/marketing.json index 95504f8fa..2e158f56c 100644 --- a/public/marketing.json +++ b/public/marketing.json @@ -1,4 +1,9 @@ [ + { + "title": "SORA POLKADOT CROWDLOAN", + "img": "/marketing/crowdloan.png", + "link": "https://parachains.info/details/sora_polkadot" + }, { "title": "GET SORA CARD", "img": "/marketing/card.png", diff --git a/public/marketing/crowdloan.png b/public/marketing/crowdloan.png new file mode 100644 index 000000000..39fb227d6 Binary files /dev/null and b/public/marketing/crowdloan.png differ diff --git a/public/wallet/Metamask.svg b/public/wallet/Metamask.svg new file mode 100644 index 000000000..81804366d --- /dev/null +++ b/public/wallet/Metamask.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/wallet/TrustWallet.svg b/public/wallet/TrustWallet.svg new file mode 100644 index 000000000..54485d382 --- /dev/null +++ b/public/wallet/TrustWallet.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/wallet/WalletConnect.svg b/public/wallet/WalletConnect.svg new file mode 100644 index 000000000..d90457adf --- /dev/null +++ b/public/wallet/WalletConnect.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index fdee8d2da..40692408d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -108,8 +108,11 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin) @getter.libraryDesignSystem libraryDesignSystem!: DesignSystem; @mutation.wallet.settings.setSoraNetwork private setSoraNetwork!: (network: WALLET_CONSTS.SoraNetwork) => void; - @mutation.wallet.settings.setSubqueryEndpoint private setSubqueryEndpoint!: (endpoint: string) => void; - @mutation.wallet.settings.setSubsquidEndpoint private setSubsquidEndpoint!: (endpoint: string) => void; + @mutation.wallet.settings.setIndexerEndpoint private setIndexerEndpoint!: (options: { + indexer: WALLET_CONSTS.IndexerType; + endpoint: string; + }) => void; + @mutation.settings.setDefaultNodes private setDefaultNodes!: (nodes: Array) => void; @mutation.settings.setNetworkChainGenesisHash private setNetworkChainGenesisHash!: (hash?: string) => void; @mutation.settings.setFaucetUrl private setFaucetUrl!: (url: string) => void; @@ -243,8 +246,8 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin) api.bridgeProxy.sub.parachainIds = data.PARACHAIN_IDS; } - this.setSubqueryEndpoint(data.SUBQUERY_ENDPOINT); - this.setSubsquidEndpoint(data.SUBSQUID_ENDPOINT); + this.setIndexerEndpoint({ indexer: WALLET_CONSTS.IndexerType.SUBQUERY, endpoint: data.SUBQUERY_ENDPOINT }); + this.setIndexerEndpoint({ indexer: WALLET_CONSTS.IndexerType.SUBSQUID, endpoint: data.SUBSQUID_ENDPOINT }); if (data.FAUCET_URL) { this.setFaucetUrl(data.FAUCET_URL); diff --git a/src/assets/img/metamask.svg b/src/assets/img/metamask.svg deleted file mode 100644 index 4364724dd..000000000 --- a/src/assets/img/metamask.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/components/App/Alerts/CreateAlert.vue b/src/components/App/Alerts/CreateAlert.vue index 1348aac47..5dcf80b12 100644 --- a/src/components/App/Alerts/CreateAlert.vue +++ b/src/components/App/Alerts/CreateAlert.vue @@ -45,14 +45,7 @@ / - {{ deltaPercentage }}% -
- {{ asset.name || asset.symbol }} - - - ({{ getFormattedAddress(asset) }}) - - -
+ {{ t('alerts.alertFrequencyTitle') }} @@ -84,7 +77,7 @@ import type { EditableAlertObject, NumberedAlert } from '@/consts'; import { lazyComponent } from '@/router'; import { getter, mutation, state } from '@/store/decorators'; import { AlertFrequencyTabs, AlertTypeTabs } from '@/types/tabs'; -import { formatAddress, getDeltaPercent } from '@/utils'; +import { getDeltaPercent } from '@/utils'; import type { AccountAsset, Asset, WhitelistIdsBySymbol } from '@sora-substrate/util/build/assets/types'; import type { Alert } from '@soramitsu/soraneo-wallet-web/lib/types/common'; @@ -94,6 +87,7 @@ import type { Alert } from '@soramitsu/soraneo-wallet-web/lib/types/common'; TokenLogo: components.TokenLogo, FormattedAmount: components.FormattedAmount, FormattedAmountWithFiatValue: components.FormattedAmountWithFiatValue, + TokenAddress: components.TokenAddress, AlertsSelectAsset: lazyComponent(Components.SelectToken), TokenSelectButton: lazyComponent(Components.TokenSelectButton), }, @@ -197,10 +191,6 @@ export default class CreateAlert extends Mixins( return this.getFiatAmount('1', this.asset) || ''; } - get copyValueAssetId(): string { - return this.copyTooltip(this.t('assets.assetId')); - } - get btnDisabled(): boolean { return !this.amount; } @@ -263,11 +253,6 @@ export default class CreateAlert extends Mixins( this.asset = selectedAsset; } - getFormattedAddress(asset: AccountAsset): string | undefined { - if (!asset.address) return; - return formatAddress(asset.address, 10); - } - mounted(): void { if (this.isEditMode) { this.amount = this.alertToEdit.price; @@ -375,6 +360,7 @@ export default class CreateAlert extends Mixins( .info { display: flex; align-items: baseline; + justify-content: space-between; .delta-percent { margin-right: calc(var(--s-basic-spacing) / 2); @@ -391,15 +377,5 @@ export default class CreateAlert extends Mixins( opacity: 40%; } } - - .asset-highlight { - margin-left: auto; - color: var(--s-color-base-content-secondary); - font-size: var(--s-font-size-extra-mini); - font-weight: 300; - line-height: var(--s-line-height-medium); - letter-spacing: var(--s-letter-spacing-small); - text-align: right; - } } diff --git a/src/components/App/Footer/AppFooter.vue b/src/components/App/Footer/AppFooter.vue index af2fef491..ed1af754d 100644 --- a/src/components/App/Footer/AppFooter.vue +++ b/src/components/App/Footer/AppFooter.vue @@ -200,17 +200,12 @@ export default class AppFooter extends Mixins(TranslationMixin) { } // Statistics connection - @state.wallet.settings.subqueryStatus private subqueryStatus!: WALLET_TYPES.ConnectionStatus; - @state.wallet.settings.subsquidStatus private subsquidStatus!: WALLET_TYPES.ConnectionStatus; + @state.wallet.settings.indexers private indexersData!: Record; showStatisticsDialog = false; get indexerStatus(): WALLET_TYPES.ConnectionStatus { - if (this.indexerType === WALLET_CONSTS.IndexerType.SUBQUERY) { - return this.subqueryStatus; - } else { - return this.subsquidStatus; - } + return this.indexersData[this.indexerType].status; } get statisticsConnectionClass(): Status { @@ -226,25 +221,12 @@ export default class AppFooter extends Mixins(TranslationMixin) { } } - private get statisticsStatusKey(): string { - switch (this.subqueryStatus) { - case WALLET_TYPES.ConnectionStatus.Unavailable: - return 'unavailable'; - case WALLET_TYPES.ConnectionStatus.Loading: - return 'loading'; - case WALLET_TYPES.ConnectionStatus.Available: - return 'available'; - default: - return 'loading'; - } - } - get statisticsConnectionText(): string { - return this.t(`footer.statistics.title.${this.statisticsStatusKey}`); + return this.t(`footer.statistics.title.${this.indexerStatus}`); } get statisticsConnectionDesc(): string { - return this.t(`footer.statistics.desc.${this.statisticsStatusKey}`); + return this.t(`footer.statistics.desc.${this.indexerStatus}`); } openStatisticsDialog(): void { diff --git a/src/components/App/Footer/Indexer/SelectIndexer.vue b/src/components/App/Footer/Indexer/SelectIndexer.vue index 910effa9b..c62016849 100644 --- a/src/components/App/Footer/Indexer/SelectIndexer.vue +++ b/src/components/App/Footer/Indexer/SelectIndexer.vue @@ -28,7 +28,7 @@
- + {{ t('footer.statistics.dialog.useCeres') }}
@@ -49,7 +49,8 @@ import type { Indexer } from '@/types/indexers'; export default class SelectIndexer extends Mixins(TranslationMixin) { @Prop({ default: () => [], type: Array }) indexers!: Array; - @ModelSync('value', 'input', { type: String }) readonly indexerType!: IndexerType; + @ModelSync('indexer', 'update:indexer', { type: String }) readonly indexerType!: IndexerType; + @ModelSync('ceres', 'update:ceres', { type: Boolean }) readonly useCeres!: boolean; } diff --git a/src/components/App/Footer/StatisticsDialog.vue b/src/components/App/Footer/StatisticsDialog.vue index e65d571de..d5c2deda8 100644 --- a/src/components/App/Footer/StatisticsDialog.vue +++ b/src/components/App/Footer/StatisticsDialog.vue @@ -1,8 +1,8 @@
- -