fix network as chain id
This commit is contained in:
parent
854f12fcf1
commit
ed7db77a34
@ -34,7 +34,7 @@ import {
|
||||
import { DEFAULT_TRANSACTION_MEMO } from '@/constants/analytics';
|
||||
import { DialogTypes } from '@/constants/dialogs';
|
||||
import { UNCOMMITTED_ORDER_TIMEOUT_MS } from '@/constants/trade';
|
||||
import { DydxNetwork, isTestnet } from '@/constants/networks';
|
||||
import { DydxChainId, isTestnet } from '@/constants/networks';
|
||||
|
||||
import { RootStore } from '@/state/_store';
|
||||
import { addUncommittedOrderClientId, removeUncommittedOrderClientId } from '@/state/account';
|
||||
@ -44,7 +44,6 @@ import { StatefulOrderError } from '../errors';
|
||||
import { bytesToBigInt } from '../numbers';
|
||||
import { log } from '../telemetry';
|
||||
import { hashFromTx, getMintscanTxLink } from '../txUtils';
|
||||
import { getDydxChainIdFromNetwork } from '../network';
|
||||
|
||||
(BigInt.prototype as any).toJSON = function () {
|
||||
return this.toString();
|
||||
@ -243,10 +242,7 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
|
||||
|
||||
if (isTestnet) {
|
||||
console.log(
|
||||
getMintscanTxLink(
|
||||
getDydxChainIdFromNetwork(this.compositeClient.network.getString() as DydxNetwork),
|
||||
hash
|
||||
)
|
||||
getMintscanTxLink(this.compositeClient.network.getString() as DydxChainId, hash)
|
||||
);
|
||||
} else console.log(`txHash: ${hash}`);
|
||||
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
import { type DydxNetwork, ENVIRONMENT_CONFIG_MAP, type DydxChainId } from '@/constants/networks';
|
||||
|
||||
export const validateAgainstAvailableEnvironments = (value: DydxNetwork) =>
|
||||
Object.keys(ENVIRONMENT_CONFIG_MAP).includes(value);
|
||||
|
||||
export const getDydxChainIdFromNetwork = (network: DydxNetwork) => {
|
||||
return ENVIRONMENT_CONFIG_MAP[network].dydxChainId as DydxChainId;
|
||||
};
|
||||
Object.keys(ENVIRONMENT_CONFIG_MAP).includes(value);
|
||||
Loading…
Reference in New Issue
Block a user