Compare commits
2 Commits
main
...
fix-swallo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed7db77a34 | ||
|
|
854f12fcf1 |
@ -34,7 +34,7 @@ import {
|
|||||||
import { DEFAULT_TRANSACTION_MEMO } from '@/constants/analytics';
|
import { DEFAULT_TRANSACTION_MEMO } from '@/constants/analytics';
|
||||||
import { DialogTypes } from '@/constants/dialogs';
|
import { DialogTypes } from '@/constants/dialogs';
|
||||||
import { UNCOMMITTED_ORDER_TIMEOUT_MS } from '@/constants/trade';
|
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 { RootStore } from '@/state/_store';
|
||||||
import { addUncommittedOrderClientId, removeUncommittedOrderClientId } from '@/state/account';
|
import { addUncommittedOrderClientId, removeUncommittedOrderClientId } from '@/state/account';
|
||||||
@ -44,7 +44,10 @@ import { StatefulOrderError } from '../errors';
|
|||||||
import { bytesToBigInt } from '../numbers';
|
import { bytesToBigInt } from '../numbers';
|
||||||
import { log } from '../telemetry';
|
import { log } from '../telemetry';
|
||||||
import { hashFromTx, getMintscanTxLink } from '../txUtils';
|
import { hashFromTx, getMintscanTxLink } from '../txUtils';
|
||||||
import { getDydxChainIdFromNetwork } from '../network';
|
|
||||||
|
(BigInt.prototype as any).toJSON = function () {
|
||||||
|
return this.toString();
|
||||||
|
};
|
||||||
|
|
||||||
class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
|
class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
|
||||||
private compositeClient: CompositeClient | undefined;
|
private compositeClient: CompositeClient | undefined;
|
||||||
@ -239,10 +242,7 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
|
|||||||
|
|
||||||
if (isTestnet) {
|
if (isTestnet) {
|
||||||
console.log(
|
console.log(
|
||||||
getMintscanTxLink(
|
getMintscanTxLink(this.compositeClient.network.getString() as DydxChainId, hash)
|
||||||
getDydxChainIdFromNetwork(this.compositeClient.network.getString() as DydxNetwork),
|
|
||||||
hash
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
} else console.log(`txHash: ${hash}`);
|
} else console.log(`txHash: ${hash}`);
|
||||||
|
|
||||||
@ -538,7 +538,6 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
|
|||||||
const result = await this.cctpWithdraw(params);
|
const result = await this.cctpWithdraw(params);
|
||||||
callback(result);
|
callback(result);
|
||||||
break;
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
import { type DydxNetwork, ENVIRONMENT_CONFIG_MAP, type DydxChainId } from '@/constants/networks';
|
import { type DydxNetwork, ENVIRONMENT_CONFIG_MAP, type DydxChainId } from '@/constants/networks';
|
||||||
|
|
||||||
export const validateAgainstAvailableEnvironments = (value: DydxNetwork) =>
|
export const validateAgainstAvailableEnvironments = (value: DydxNetwork) =>
|
||||||
Object.keys(ENVIRONMENT_CONFIG_MAP).includes(value);
|
Object.keys(ENVIRONMENT_CONFIG_MAP).includes(value);
|
||||||
|
|
||||||
export const getDydxChainIdFromNetwork = (network: DydxNetwork) => {
|
|
||||||
return ENVIRONMENT_CONFIG_MAP[network].dydxChainId as DydxChainId;
|
|
||||||
};
|
|
||||||
Loading…
Reference in New Issue
Block a user