"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthenticatorType = exports.PnlTickInterval = exports.TimePeriod = exports.PositionStatus = exports.TickerType = exports.OrderStatus = exports.OrderExecution = exports.OrderTimeInForce = exports.OrderSide = exports.OrderType = exports.MarketStatisticDay = exports.MEGAVAULT_MODULE_ADDRESS = exports.DELAYMSG_MODULE_ADDRESS = exports.GOV_MODULE_ADDRESS = exports.TYPE_URL_MSG_REMOVE_AUTHENTICATOR = exports.TYPE_URL_MSG_ADD_AUTHENTICATOR = exports.TYPE_URL_MSG_WITHDRAWAL = exports.TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD = exports.TYPE_URL_MSG_UNDELEGATE = exports.TYPE_URL_MSG_DELEGATE = exports.TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT = exports.TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT = exports.TYPE_URL_MSG_REGISTER_AFFILIATE = exports.TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT = exports.TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT = exports.TYPE_URL_MSG_CREATE_TRANSFER = exports.TYPE_URL_MSG_CREATE_ORACLE_MARKET = exports.TYPE_URL_MSG_CREATE_PERPETUAL = exports.TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS = exports.TYPE_URL_MSG_DELAY_MESSAGE = exports.TYPE_URL_MSG_UPDATE_CLOB_PAIR = exports.TYPE_URL_MSG_CREATE_CLOB_PAIR = exports.TYPE_URL_BATCH_CANCEL = exports.TYPE_URL_MSG_CANCEL_ORDER = exports.TYPE_URL_MSG_PLACE_ORDER = exports.TYPE_URL_MSG_SUBMIT_PROPOSAL = exports.TYPE_URL_MSG_SEND = exports.SelectedGasDenom = exports.NETWORK_ID_MAINNET = exports.NETWORK_ID_TESTNET = exports.NetworkId = exports.ValidatorApiHost = exports.FaucetApiHost = exports.IndexerWSHost = exports.IndexerApiHost = exports.MAINNET_CHAIN_ID = exports.LOCAL_CHAIN_ID = exports.TESTNET_CHAIN_ID = exports.STAGING_CHAIN_ID = exports.DEV_CHAIN_ID = void 0;
exports.Network = exports.ValidatorConfig = exports.IndexerConfig = exports.PAGE_REQUEST = exports.SHORT_BLOCK_FORWARD = exports.SHORT_BLOCK_WINDOW = exports.MAX_MEMO_CHARACTERS = exports.DEFAULT_API_TIMEOUT = exports.TradingRewardAggregationPeriod = void 0;
const long_1 = __importDefault(require("long"));
__exportStar(require("../lib/constants"), exports);
/**
 * Disclaimer: Note that as of the date hereof, the testnet and RITBIT Chain deployment are the only known deployments of the
 * RITBIT Chain software, and other deployment options may be added.
 */
// Chain ID
exports.DEV_CHAIN_ID = 'ritbit-local';
exports.STAGING_CHAIN_ID = 'ritbit-testnet';
exports.TESTNET_CHAIN_ID = 'ritbit-testnet';
exports.LOCAL_CHAIN_ID = 'ritbit-local';
exports.MAINNET_CHAIN_ID = 'ritbit-mainnet';
// ------------ API URLs ------------
var IndexerApiHost;
(function (IndexerApiHost) {
    IndexerApiHost["TESTNET"] = "https://indexer.testnet.tyranodex.xyz/";
    IndexerApiHost["STAGING"] = "https://indexer.testnet.tyranodex.xyz/";
    IndexerApiHost["LOCAL"] = "http://local.ritbit.ru:3002";
    IndexerApiHost["MAINNET"] = "https://indexer.tyranodex.xyz";
})(IndexerApiHost || (exports.IndexerApiHost = IndexerApiHost = {}));
var IndexerWSHost;
(function (IndexerWSHost) {
    IndexerWSHost["TESTNET"] = "wss://indexer.testnet.tyranodex.xyz/v4/ws";
    IndexerWSHost["STAGING"] = "wss://indexer.testnet.tyranodex.xyz/v4/ws";
    IndexerWSHost["LOCAL"] = "ws://local.ritbit.ru:3003";
    IndexerWSHost["MAINNET"] = "wss://indexer.tyranodex.xyz/v4/ws";
})(IndexerWSHost || (exports.IndexerWSHost = IndexerWSHost = {}));
var FaucetApiHost;
(function (FaucetApiHost) {
    FaucetApiHost["TESTNET"] = "https://faucet.testnet.tyranodex.xyz";
})(FaucetApiHost || (exports.FaucetApiHost = FaucetApiHost = {}));
var ValidatorApiHost;
(function (ValidatorApiHost) {
    ValidatorApiHost["TESTNET"] = "https://rpc.testnet.tyranodex.xyz";
    ValidatorApiHost["STAGING"] = "https://rpc.testnet.tyranodex.xyz";
    ValidatorApiHost["LOCAL"] = "http://local.ritbit.ru:26657";
    ValidatorApiHost["MAINNET"] = "https://rpc.tyranodex.xyz";
})(ValidatorApiHost || (exports.ValidatorApiHost = ValidatorApiHost = {}));
// ------------ Network IDs ------------
var NetworkId;
(function (NetworkId) {
    NetworkId["TESTNET"] = "ritbit-testnet";
    NetworkId["MAINNET"] = "ritbit-mainnet";
})(NetworkId || (exports.NetworkId = NetworkId = {}));
exports.NETWORK_ID_TESTNET = 'ritbit-testnet';
exports.NETWORK_ID_MAINNET = 'ritbit-mainnet';
// ------------ Gas Denoms ------------
var SelectedGasDenom;
(function (SelectedGasDenom) {
    SelectedGasDenom["NATIVE"] = "NATIVE";
    SelectedGasDenom["USDC"] = "USDC";
})(SelectedGasDenom || (exports.SelectedGasDenom = SelectedGasDenom = {}));
// ------------ MsgType URLs ------------
// Default CosmosSDK
// x/bank
exports.TYPE_URL_MSG_SEND = '/cosmos.bank.v1beta1.MsgSend';
// x/gov
exports.TYPE_URL_MSG_SUBMIT_PROPOSAL = '/cosmos.gov.v1.MsgSubmitProposal';
// x/clob
exports.TYPE_URL_MSG_PLACE_ORDER = '/ritbit.clob.MsgPlaceOrder';
exports.TYPE_URL_MSG_CANCEL_ORDER = '/ritbit.clob.MsgCancelOrder';
exports.TYPE_URL_BATCH_CANCEL = '/ritbit.clob.MsgBatchCancel';
exports.TYPE_URL_MSG_CREATE_CLOB_PAIR = '/ritbit.clob.MsgCreateClobPair';
exports.TYPE_URL_MSG_UPDATE_CLOB_PAIR = '/ritbit.clob.MsgUpdateClobPair';
// x/delaymsg
exports.TYPE_URL_MSG_DELAY_MESSAGE = '/ritbit.delaymsg.MsgDelayMessage';
// x/listing
exports.TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS = '/ritbit.listing.MsgCreateMarketPermissionless';
// x/perpetuals
exports.TYPE_URL_MSG_CREATE_PERPETUAL = '/ritbit.perpetuals.MsgCreatePerpetual';
// x/prices
exports.TYPE_URL_MSG_CREATE_ORACLE_MARKET = '/ritbit.prices.MsgCreateOracleMarket';
// x/sending
exports.TYPE_URL_MSG_CREATE_TRANSFER = '/ritbit.sending.MsgCreateTransfer';
exports.TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT = '/ritbit.sending.MsgWithdrawFromSubaccount';
exports.TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT = '/ritbit.sending.MsgDepositToSubaccount';
// x/affiliates
exports.TYPE_URL_MSG_REGISTER_AFFILIATE = '/ritbit.affiliates.MsgRegisterAffiliate';
// x/vault
exports.TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT = '/ritbit.vault.MsgDepositToMegavault';
exports.TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT = '/ritbit.vault.MsgWithdrawFromMegavault';
// x/staking
exports.TYPE_URL_MSG_DELEGATE = '/cosmos.staking.v1beta1.MsgDelegate';
exports.TYPE_URL_MSG_UNDELEGATE = '/cosmos.staking.v1beta1.MsgUndelegate';
// x/distribution
exports.TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD = '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward';
// x/bridge
exports.TYPE_URL_MSG_WITHDRAWAL = '/ritbit.bridge.MsgWithdrawal';
// x/accountplus
exports.TYPE_URL_MSG_ADD_AUTHENTICATOR = '/ritbit.accountplus.MsgAddAuthenticator';
exports.TYPE_URL_MSG_REMOVE_AUTHENTICATOR = '/ritbit.accountplus.MsgRemoveAuthenticator';
// ------------ Chain Constants ------------
// The following are same across different networks / deployments.
exports.GOV_MODULE_ADDRESS = 'rit10d07y265gmmuvt4z0w9aw880jnsr700j086rvs';
exports.DELAYMSG_MODULE_ADDRESS = 'rit1mkkvp26dngu6n8rmalaxyp3gwkjuzztqg7pc3h';
exports.MEGAVAULT_MODULE_ADDRESS = 'rit18tkxrnrkqc2t0lr3zxr5g6a4hdvqksyl6u4m0h';
// ------------ Market Statistic Day Types ------------
var MarketStatisticDay;
(function (MarketStatisticDay) {
    MarketStatisticDay["ONE"] = "1";
    MarketStatisticDay["SEVEN"] = "7";
    MarketStatisticDay["THIRTY"] = "30";
})(MarketStatisticDay || (exports.MarketStatisticDay = MarketStatisticDay = {}));
// ------------ Order Types ------------
// This should match OrderType in Abacus
var OrderType;
(function (OrderType) {
    OrderType["LIMIT"] = "LIMIT";
    OrderType["MARKET"] = "MARKET";
    OrderType["STOP_LIMIT"] = "STOP_LIMIT";
    OrderType["TAKE_PROFIT_LIMIT"] = "TAKE_PROFIT";
    OrderType["STOP_MARKET"] = "STOP_MARKET";
    OrderType["TAKE_PROFIT_MARKET"] = "TAKE_PROFIT_MARKET";
})(OrderType || (exports.OrderType = OrderType = {}));
// ------------ Order Side ------------
// This should match OrderSide in Abacus
var OrderSide;
(function (OrderSide) {
    OrderSide["BUY"] = "BUY";
    OrderSide["SELL"] = "SELL";
})(OrderSide || (exports.OrderSide = OrderSide = {}));
// ------------ Order TimeInForce ------------
// This should match OrderTimeInForce in Abacus
var OrderTimeInForce;
(function (OrderTimeInForce) {
    OrderTimeInForce["GTT"] = "GTT";
    OrderTimeInForce["IOC"] = "IOC";
    OrderTimeInForce["FOK"] = "FOK";
})(OrderTimeInForce || (exports.OrderTimeInForce = OrderTimeInForce = {}));
// ------------ Order Execution ------------
// This should match OrderExecution in Abacus
var OrderExecution;
(function (OrderExecution) {
    OrderExecution["DEFAULT"] = "DEFAULT";
    OrderExecution["IOC"] = "IOC";
    OrderExecution["FOK"] = "FOK";
    OrderExecution["POST_ONLY"] = "POST_ONLY";
})(OrderExecution || (exports.OrderExecution = OrderExecution = {}));
// ------------ Order Status ------------
// This should match OrderStatus in Abacus
var OrderStatus;
(function (OrderStatus) {
    OrderStatus["BEST_EFFORT_OPENED"] = "BEST_EFFORT_OPENED";
    OrderStatus["OPEN"] = "OPEN";
    OrderStatus["FILLED"] = "FILLED";
    OrderStatus["BEST_EFFORT_CANCELED"] = "BEST_EFFORT_CANCELED";
    OrderStatus["CANCELED"] = "CANCELED";
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
var TickerType;
(function (TickerType) {
    TickerType["PERPETUAL"] = "PERPETUAL";
})(TickerType || (exports.TickerType = TickerType = {}));
var PositionStatus;
(function (PositionStatus) {
    PositionStatus["OPEN"] = "OPEN";
    PositionStatus["CLOSED"] = "CLOSED";
    PositionStatus["LIQUIDATED"] = "LIQUIDATED";
})(PositionStatus || (exports.PositionStatus = PositionStatus = {}));
// ----------- Time Period for Sparklines -------------
var TimePeriod;
(function (TimePeriod) {
    TimePeriod["ONE_DAY"] = "ONE_DAY";
    TimePeriod["SEVEN_DAYS"] = "SEVEN_DAYS";
})(TimePeriod || (exports.TimePeriod = TimePeriod = {}));
var PnlTickInterval;
(function (PnlTickInterval) {
    PnlTickInterval["HOUR"] = "hour";
    PnlTickInterval["day"] = "day";
})(PnlTickInterval || (exports.PnlTickInterval = PnlTickInterval = {}));
// ----------- Authenticators -------------
var AuthenticatorType;
(function (AuthenticatorType) {
    AuthenticatorType["ALL_OF"] = "AllOf";
    AuthenticatorType["ANY_OF"] = "AnyOf";
    AuthenticatorType["SIGNATURE_VERIFICATION"] = "SignatureVerification";
    AuthenticatorType["MESSAGE_FILTER"] = "MessageFilter";
    AuthenticatorType["CLOB_PAIR_ID_FILTER"] = "ClobPairIdFilter";
    AuthenticatorType["SUBACCOUNT_FILTER"] = "SubaccountFilter";
})(AuthenticatorType || (exports.AuthenticatorType = AuthenticatorType = {}));
var TradingRewardAggregationPeriod;
(function (TradingRewardAggregationPeriod) {
    TradingRewardAggregationPeriod["DAILY"] = "DAILY";
    TradingRewardAggregationPeriod["WEEKLY"] = "WEEKLY";
    TradingRewardAggregationPeriod["MONTHLY"] = "MONTHLY";
})(TradingRewardAggregationPeriod || (exports.TradingRewardAggregationPeriod = TradingRewardAggregationPeriod = {}));
// ------------ API Defaults ------------
exports.DEFAULT_API_TIMEOUT = 3000;
exports.MAX_MEMO_CHARACTERS = 256;
exports.SHORT_BLOCK_WINDOW = 20;
exports.SHORT_BLOCK_FORWARD = 15;
// Querying
exports.PAGE_REQUEST = {
    key: new Uint8Array(),
    offset: long_1.default.UZERO,
    limit: long_1.default.MAX_UNSIGNED_VALUE,
    countTotal: true,
    reverse: false,
};
class IndexerConfig {
    constructor(restEndpoint, websocketEndpoint, proxy) {
        this.restEndpoint = restEndpoint;
        this.websocketEndpoint = websocketEndpoint;
        this.proxy = proxy;
    }
}
exports.IndexerConfig = IndexerConfig;
class ValidatorConfig {
    constructor(restEndpoint, chainId, denoms, broadcastOptions, defaultClientMemo, useTimestampNonce, timestampNonceOffsetMs) {
        this.restEndpoint = (restEndpoint === null || restEndpoint === void 0 ? void 0 : restEndpoint.endsWith('/')) ? restEndpoint.slice(0, -1) : restEndpoint;
        this.chainId = chainId;
        this.denoms = denoms;
        this.broadcastOptions = broadcastOptions;
        this.defaultClientMemo = defaultClientMemo;
        this.useTimestampNonce = useTimestampNonce;
        this.timestampNonceOffsetMs = timestampNonceOffsetMs;
    }
}
exports.ValidatorConfig = ValidatorConfig;
class Network {
    constructor(env, indexerConfig, validatorConfig) {
        this.env = env;
        this.indexerConfig = indexerConfig;
        this.validatorConfig = validatorConfig;
    }
    static testnet() {
        const indexerConfig = new IndexerConfig(IndexerApiHost.TESTNET, IndexerWSHost.TESTNET);
        const validatorConfig = new ValidatorConfig(ValidatorApiHost.TESTNET, exports.TESTNET_CHAIN_ID, {
            CHAINTOKEN_DENOM: 'urit',
            USDC_DENOM: 'uusdc',
            USDC_GAS_DENOM: 'uusdc',
            USDC_DECIMALS: 6,
            CHAINTOKEN_DECIMALS: 18,
        }, undefined, 'Client Example');
        return new Network('testnet', indexerConfig, validatorConfig);
    }
    static staging() {
        const indexerConfig = new IndexerConfig(IndexerApiHost.STAGING, IndexerWSHost.STAGING);
        const validatorConfig = new ValidatorConfig(ValidatorApiHost.STAGING, exports.STAGING_CHAIN_ID, {
            CHAINTOKEN_DENOM: 'urit',
            USDC_DENOM: 'uusdc',
            USDC_GAS_DENOM: 'uusdc',
            USDC_DECIMALS: 6,
            CHAINTOKEN_DECIMALS: 18,
        }, undefined, 'Client Example');
        return new Network('staging', indexerConfig, validatorConfig);
    }
    static local() {
        const indexerConfig = new IndexerConfig(IndexerApiHost.LOCAL, IndexerWSHost.LOCAL);
        const validatorConfig = new ValidatorConfig(ValidatorApiHost.LOCAL, exports.LOCAL_CHAIN_ID, {
            CHAINTOKEN_DENOM: 'urit',
            USDC_DENOM: 'uusdc',
            USDC_GAS_DENOM: 'uusdc',
            USDC_DECIMALS: 6,
            CHAINTOKEN_DECIMALS: 18,
        }, undefined, 'Client Example');
        return new Network('local', indexerConfig, validatorConfig);
    }
    static mainnet() {
        const indexerConfig = new IndexerConfig(IndexerApiHost.MAINNET, IndexerWSHost.MAINNET);
        const validatorConfig = new ValidatorConfig(ValidatorApiHost.MAINNET, exports.MAINNET_CHAIN_ID, {
            CHAINTOKEN_DENOM: 'urit',
            USDC_DENOM: 'uusdc',
            USDC_GAS_DENOM: 'uusdc',
            USDC_DECIMALS: 6,
            CHAINTOKEN_DECIMALS: 18,
        }, undefined, 'Client Example');
        return new Network('mainnet', indexerConfig, validatorConfig);
    }
    getString() {
        return this.env;
    }
}
exports.Network = Network;
//# sourceMappingURL=data:application/json;base64, 