Skip to content
Merged
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
Binary file added public/image/assethub-kusama-button-mobile.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/image/assethub-paseo-button-mobile.png
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.
Binary file added public/image/paseo-button-mobile.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/image/polkadot-button-mobile.png
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 src/components/ThemeSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { updateStorage } from '../utils/helper/storage';
export const toggleTheme = (theme: THEME, network: Network) => {
let networkName = network;
if (Object.keys(chains).indexOf(networkName) < 0) {
networkName = 'polkadot';
networkName = 'assethub-polkadot';
}
if (document && document.documentElement) {
document.documentElement.setAttribute('data-theme', theme);
Expand Down
32 changes: 25 additions & 7 deletions src/components/modals/SelectNetworkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,31 @@ export const SelectNetworkModal = (props: SelectNetworkModalProps) => {
return getThemeColor(network);
}, [network]);

const networks = useMemo(
() =>
_.values(chains).sort((chain1) => {
return chain1?.name === 'polkadot' ? -1 : chain1?.name === 'kusama' ? -1 : 0;
}),
[]
);
const networks = useMemo(() => {
const priorityOrder = ['assethub-polkadot', 'assethub-kusama', 'assethub-paseo'];

// eslint-disable-next-line complexity
const compareNetworks = (a: NetConfigV2 | undefined, b: NetConfigV2 | undefined): number => {
const aIndex = priorityOrder.indexOf(a?.name || '');
const bIndex = priorityOrder.indexOf(b?.name || '');

if (aIndex !== -1 && bIndex !== -1) {
return aIndex - bIndex;
}

if (aIndex !== -1) {
return -1;
}

if (bIndex !== -1) {
return 1;
}

return (a?.name || '').localeCompare(b?.name || '');
};

return _.values(chains).sort(compareNetworks);
}, []);

const [customNetworks, setCustomNetworks] = useState<NetConfigV2[]>([]);

Expand Down
12 changes: 12 additions & 0 deletions src/config/chains/assethub_kusama.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "assethub-kusama",
"displayName": "Assethub Kusama",
"rpc": "wss://asset-hub-kusama-rpc.n.dwellir.com",
"api": {
"subql": "",
"subscan": "https://assethub-kusama.webapi.subscan.io"
},
"logo": "/image/assethub-kusama-button-mobile.png",
"explorerHostName": "assethub-kusama",
"themeColor": "#000000"
}
12 changes: 12 additions & 0 deletions src/config/chains/assethub_paseo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "assethub-paseo",
"displayName": "Assethub Paseo",
"rpc": "wss://asset-hub-paseo-rpc.n.dwellir.com",
"api": {
"subql": "",
"subscan": "https://assethub-paseo.webapi.subscan.io"
},
"logo": "/image/assethub-paseo-button-mobile.png",
"explorerHostName": "assethub-paseo",
"themeColor": "#38393F"
}
12 changes: 12 additions & 0 deletions src/config/chains/assethub_polkadot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "assethub-polkadot",
"displayName": "Assethub Polkadot",
"rpc": "wss://asset-hub-polkadot-rpc.n.dwellir.com",
"api": {
"subql": "",
"subscan": "https://assethub-polkadot.webapi.subscan.io"
},
"logo": "/image/assethub-polkadot-button-mobile.png",
"explorerHostName": "assethub-polkadot",
"themeColor": "#E90979"
}
12 changes: 0 additions & 12 deletions src/config/chains/kusama.json

This file was deleted.

12 changes: 0 additions & 12 deletions src/config/chains/polkadot.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/config/constant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-magic-numbers */
export const LONG_DURATION = 10 * 1000;

export const DONATE_ADDRESS = '14RYaXRSqb9rPqMaAVp1UZW2czQ6dMNGMbvukwfifi6m8ZgZ';
export const DONATE_ADDRESS = '14rcFm5sH9aek5NJ6vzHuTwo29MKCB4GVEEPj5aXmP4cLce6';
2 changes: 1 addition & 1 deletion src/config/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export enum THEME {
export function getThemeColor(network: string) {
let networkTheme = chains[network];
if (!networkTheme) {
networkTheme = chains['polkadot'];
networkTheme = chains['assethub-polkadot'];
}

return networkTheme?.themeColor;
Expand Down
2 changes: 1 addition & 1 deletion src/model/network.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Config } from './common';

export type Network = 'polkadot' | 'kusama';
export type Network = 'assethub-polkadot' | 'assethub-kusama';

export type Token = 'native';

Expand Down
10 changes: 5 additions & 5 deletions src/providers/api-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const cacheNetwork = (network: Network, rpc: string): void => {
};

const initialState: StoreState = {
network: getInitialSetting<Network>('network', 'polkadot'),
network: getInitialSetting<Network>('network', 'assethub-polkadot'),
rpc: getInitialSetting<string>('rpc', ''),
accounts: null,
networkStatus: 'pending',
Expand Down Expand Up @@ -135,7 +135,7 @@ export const ApiProvider = ({ children }: React.PropsWithChildren<unknown>) => {
}

let selectedNetwork: NetConfigV2 | undefined = undefined;
let networkName: Network = 'polkadot';
let networkName: Network = 'assethub-polkadot';
Object.keys(chains).forEach((key) => {
if (chains[key]?.rpc === state.rpc) {
selectedNetwork = chains[key];
Expand All @@ -146,12 +146,12 @@ export const ApiProvider = ({ children }: React.PropsWithChildren<unknown>) => {
if (!selectedNetwork) {
if (storage.customNetwork && storage.customNetwork.rpc === state.rpc) {
selectedNetwork = storage.customNetwork;
networkName = 'polkadot';
networkName = 'assethub-polkadot';
}
}
if (!selectedNetwork) {
if (chains['polkadot']) {
changeUrlHash(chains['polkadot'].rpc);
if (chains['assethub-polkadot']) {
changeUrlHash(chains['assethub-polkadot'].rpc);
}
return;
}
Expand Down
Loading