Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added RadiumBlock into Shiden's endpoints #1171

Merged
merged 2 commits into from
Feb 8, 2024
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
2 changes: 1 addition & 1 deletion src/config/chainEndpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const providerEndpoints: ChainProvider[] = [
{ name: 'Dwellir', endpoint: 'wss://shiden-rpc.dwellir.com' },
{ name: 'Blast', endpoint: 'wss://shiden.public.blastapi.io' },
{ name: 'OnFinality', endpoint: 'wss://shiden.api.onfinality.io/public-ws' },
// { name: 'RadiumBlock', endpoint: 'wss://shiden.public.curie.radiumblock.co/ws' },
{ name: 'RadiumBlock', endpoint: 'wss://shiden.public.curie.radiumblock.co/ws' },
{ name: 'Light Client (experimental)', endpoint: 'light://substrate-connect/kusama/shiden' },
],
isSupportContract: true,
Expand Down
11 changes: 3 additions & 8 deletions src/hooks/useChainInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ const registry = new TypeRegistry();
export const DEFAULT_DECIMALS = registry.createType('u32', 12);
export const DEFAULT_SS58 = registry.createType('u32', addressDefaults.prefix);

function createInfo(
api: ApiPromise,
systemChain: string,
systemName: string,
specName: string
): ChainInfo {
function createInfo(api: ApiPromise, systemChain: string, specName: string): ChainInfo {
// console.log('chainInfo', `${systemChain} | ${systemName} | ${specName}`);
return {
chain: systemChain,
Expand All @@ -48,11 +43,11 @@ function createInfo(
export function useChainInfo(api: ApiPromise) {
useChainMetadata();
const chainInfo = ref<ChainInfo>();

api.isReady.then(async () => {
const specName: string = api.runtimeVersion.specName.toString();
const systemChain: string = ((await api.rpc.system.chain()) || '<unknown>').toString();
const systemName: string = (await api.rpc.system.name()).toString();
chainInfo.value = createInfo(api, systemChain, systemName, specName);
chainInfo.value = createInfo(api, systemChain, specName);
});

return {
Expand Down
5 changes: 5 additions & 0 deletions src/router/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,10 @@ export const buildNetworkUrl = (network: string) => {
.map((it: string, index: number) => (index === networkIndex ? network : it))
.join('/');

// Memo: `window.open(url, '_self')` won't work with `#`
if (url.includes('#staking')) {
return url.replace('#staking', '');
}

return url;
};
Loading