explorer env configuration updates
This commit is contained in:
@@ -9,4 +9,3 @@ BIG_DIPPER_URL=https://sandbox-blocks.nymtech.net
|
||||
CURRENCY_DENOM=unym
|
||||
CURRENCY_STAKING_DENOM=unyx
|
||||
NYM_MIXNET_CONTRACT=n17srjznxl9dvzdkpwpw24gg668wc73val88a6m5ajg6ankwvz9wtst0cznr
|
||||
COSMOS_KIT_USE_CHAIN=nyx
|
||||
|
||||
+1
-2
@@ -3,5 +3,4 @@ NYM_API_URL=https://validator.nymtech.net
|
||||
VALIDATOR_URL=https://rpc.nymtech.net
|
||||
BIG_DIPPER_URL=https://blocks.nymtech.net
|
||||
CURRENCY_DENOM=unym
|
||||
CURRENCY_STAKING_DENOM=unyx
|
||||
COSMOS_KIT_USE_CHAIN=nyx
|
||||
CURRENCY_STAKING_DENOM=unyx
|
||||
@@ -52,6 +52,7 @@
|
||||
"bs58": "^5.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"chain-registry": "^1.29.1",
|
||||
"@chain-registry/types": "^0.18.1",
|
||||
"cosmjs-types": "^0.9.0",
|
||||
"d3-scale": "^4.0.0",
|
||||
"date-fns": "^2.24.0",
|
||||
@@ -70,7 +71,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.0",
|
||||
"@chain-registry/types": "^0.18.1",
|
||||
"@nymproject/eslint-config-react-typescript": "^1.0.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
||||
"@storybook/addon-actions": "^6.5.8",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// master APIs
|
||||
export const API_BASE_URL = process.env.EXPLORER_API_URL;
|
||||
export const NYM_API_BASE_URL = process.env.NYM_API_URL;
|
||||
export const VALIDATOR_BASE_URL = process.env.VALIDATOR_URL;
|
||||
export const VALIDATOR_BASE_URL = process.env.VALIDATOR_URL || 'https://rpc.nymtech.net';
|
||||
export const BIG_DIPPER = process.env.BIG_DIPPER_URL;
|
||||
|
||||
// specific API routes
|
||||
|
||||
@@ -6,6 +6,7 @@ import { wallets as cosmosstation } from '@cosmos-kit/cosmostation-extension';
|
||||
import { wallets as leap } from '@cosmos-kit/leap-extension';
|
||||
import { assets, chains } from 'chain-registry';
|
||||
import { Chain, AssetList } from '@chain-registry/types';
|
||||
import { VALIDATOR_BASE_URL } from '@src/api/constants';
|
||||
|
||||
const nymSandbox: Chain = {
|
||||
chain_name: 'sandbox',
|
||||
@@ -37,21 +38,37 @@ const nymSandboxAssets: AssetList = {
|
||||
],
|
||||
};
|
||||
|
||||
const CosmosKitProvider = ({ children }: { children: React.ReactNode }) => (
|
||||
<ChainProvider
|
||||
chains={[...chains, nymSandbox]}
|
||||
assetLists={[...assets, nymSandboxAssets]}
|
||||
wallets={[...keplr, ...ledger, ...cosmosstation, ...leap]}
|
||||
endpointOptions={{
|
||||
endpoints: {
|
||||
nyx: {
|
||||
rpc: ['https://rpc.nymtech.net'],
|
||||
const CosmosKitProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
// Only use the nyx chains
|
||||
const chainsFixedUp = React.useMemo(() => {
|
||||
const nyx = chains.find((chain) => chain.chain_id === 'nyx');
|
||||
|
||||
return nyx ? [nymSandbox, nyx] : [nymSandbox];
|
||||
}, [chains]);
|
||||
|
||||
// Only use the nyx assets
|
||||
const assetsFixedUp = React.useMemo(() => {
|
||||
const nyx = assets.find((asset) => asset.chain_name === 'nyx');
|
||||
|
||||
return nyx ? [nymSandboxAssets, nyx] : [nymSandboxAssets];
|
||||
}, [assets]);
|
||||
|
||||
return (
|
||||
<ChainProvider
|
||||
chains={chainsFixedUp}
|
||||
assetLists={assetsFixedUp}
|
||||
wallets={[...keplr, ...ledger, ...cosmosstation, ...leap]}
|
||||
endpointOptions={{
|
||||
endpoints: {
|
||||
nyx: {
|
||||
rpc: [VALIDATOR_BASE_URL],
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</ChainProvider>
|
||||
);
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</ChainProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default CosmosKitProvider;
|
||||
|
||||
@@ -173,7 +173,7 @@ export const DelegationsProvider = ({ children }: { children: React.ReactNode })
|
||||
};
|
||||
|
||||
const handleUndelegate = async (mixId: number) => {
|
||||
const tx = await nymClient?.undelegateFromMixnode({ mixId }, fee);
|
||||
const tx = await nymClient?.undelegateFromMixnode({ mixId }, fee, 'Undelegation from Nym Explorer');
|
||||
|
||||
return tx as unknown as ExecuteResult;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user