Skip to content

Commit

Permalink
v1.0.26 update constants (#131)
Browse files Browse the repository at this point in the history
* v1.0.26 update constants

* move disclaimer
  • Loading branch information
jiajames authored Mar 14, 2024
1 parent d7ebec6 commit a4bb4de
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 deletions.
4 changes: 2 additions & 2 deletions v4-client-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v4-client-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dydxprotocol/v4-client-js",
"version": "1.0.25",
"version": "1.0.26",
"description": "General client library for the new dYdX system (v4 decentralized)",
"main": "build/src/index.js",
"scripts": {
Expand Down
49 changes: 39 additions & 10 deletions v4-client-js/src/clients/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,57 @@ import { BroadcastOptions, DenomConfig } from './types';

export * from '../lib/constants';

/**
* Disclaimer: Note that as of the date hereof, the testnet and dYdX Chain deployment by DYDX
* token holders are the only known deployments of the dYdX v4 software, and other deployment
* options may be added.
* For more information, please see https://dydx.exchange/dydx-chain-front-end-options
*/

// Chain ID
export const DEV_CHAIN_ID = 'dydxprotocol-testnet';
export const STAGING_CHAIN_ID = 'dydxprotocol-testnet';
export const TESTNET_CHAIN_ID = 'dydx-testnet-4';
export const LOCAL_CHAIN_ID = 'localdydxprotocol';
// For the deployment by DYDX token holders
export const MAINNET_CHAIN_ID = 'dydx-mainnet-1';

// ------------ API URLs ------------
export enum IndexerApiHost {
TESTNET = 'https://dydx-testnet.imperator.co',
LOCAL = 'http://localhost:3002'
// TODO: Add MAINNET
LOCAL = 'http://localhost:3002',
// For the deployment by DYDX token holders
MAINNET = 'https://indexer.dydx.trade'
}

export enum IndexerWSHost {
TESTNET = 'wss://dydx-testnet.imperator.co/v4/ws',
// TODO: Add MAINNET
LOCAL = 'ws://localhost:3003'
LOCAL = 'ws://localhost:3003',
// For the deployment by DYDX token holders
MAINNET = 'wss://indexer.dydx.trade/v4/ws',
}

export enum FaucetApiHost {
TESTNET = 'https://faucet.v4testnet.dydx.exchange',
}

export enum ValidatorApiHost {
TESTNET = 'https://test-dydx.kingnodes.com',
// TODO: Add MAINNET
LOCAL = 'http://localhost:26657'
TESTNET = 'https://dydx-ops-rest.kingnodes.com:443',
LOCAL = 'http://localhost:26657',
// For the deployment by DYDX token holders
MAINNET = 'https://dydx-ops-rpc.kingnodes.com:443'
}

// ------------ Network IDs ------------

export enum NetworkId {
TESTNET = 'dydx-testnet-4',
// TODO: Add MAINNET
// For the deployment by DYDX token holders
MAINNET = 'dydx-mainnet-1'
}
export const NETWORK_ID_MAINNET: string | null = null;
export const NETWORK_ID_TESTNET: string = 'dydxprotocol-testnet';
// For the deployment by DYDX token holders
export const NETWORK_ID_MAINNET: string = 'dydx-mainnet-1';

// ------------ MsgType URLs ------------
// Default CosmosSDK
Expand Down Expand Up @@ -237,7 +251,22 @@ export class Network {
return new Network('local', indexerConfig, validatorConfig);
}

// TODO: Add mainnet(): Network
// For the deployment by DYDX token holders.
static mainnet(): Network {
const indexerConfig = new IndexerConfig(
IndexerApiHost.MAINNET,
IndexerWSHost.MAINNET,
);
const validatorConfig = new ValidatorConfig(ValidatorApiHost.MAINNET, MAINNET_CHAIN_ID,
{
CHAINTOKEN_DENOM: 'adydx',
USDC_DENOM: 'ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5',
USDC_GAS_DENOM: 'uusdc',
USDC_DECIMALS: 6,
CHAINTOKEN_DECIMALS: 18,
}, undefined, 'Client Example');
return new Network('mainnet', indexerConfig, validatorConfig);
}

getString(): string {
return this.env;
Expand Down

0 comments on commit a4bb4de

Please sign in to comment.