import Long from 'long';
export * from '../lib/constants';
/**
 * 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
export const DEV_CHAIN_ID = 'ritbit-local';
export const STAGING_CHAIN_ID = 'ritbit-testnet';
export const TESTNET_CHAIN_ID = 'ritbit-testnet';
export const LOCAL_CHAIN_ID = 'ritbit-local';
export const MAINNET_CHAIN_ID = 'ritbit-mainnet';
// ------------ API URLs ------------
export 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 || (IndexerApiHost = {}));
export 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 || (IndexerWSHost = {}));
export var FaucetApiHost;
(function (FaucetApiHost) {
    FaucetApiHost["TESTNET"] = "https://faucet.testnet.tyranodex.xyz";
})(FaucetApiHost || (FaucetApiHost = {}));
export 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 || (ValidatorApiHost = {}));
// ------------ Network IDs ------------
export var NetworkId;
(function (NetworkId) {
    NetworkId["TESTNET"] = "ritbit-testnet";
    NetworkId["MAINNET"] = "ritbit-mainnet";
})(NetworkId || (NetworkId = {}));
export const NETWORK_ID_TESTNET = 'ritbit-testnet';
export const NETWORK_ID_MAINNET = 'ritbit-mainnet';
// ------------ Gas Denoms ------------
export var SelectedGasDenom;
(function (SelectedGasDenom) {
    SelectedGasDenom["NATIVE"] = "NATIVE";
    SelectedGasDenom["USDC"] = "USDC";
})(SelectedGasDenom || (SelectedGasDenom = {}));
// ------------ MsgType URLs ------------
// Default CosmosSDK
// x/bank
export const TYPE_URL_MSG_SEND = '/cosmos.bank.v1beta1.MsgSend';
// x/gov
export const TYPE_URL_MSG_SUBMIT_PROPOSAL = '/cosmos.gov.v1.MsgSubmitProposal';
// x/clob
export const TYPE_URL_MSG_PLACE_ORDER = '/ritbit.clob.MsgPlaceOrder';
export const TYPE_URL_MSG_CANCEL_ORDER = '/ritbit.clob.MsgCancelOrder';
export const TYPE_URL_BATCH_CANCEL = '/ritbit.clob.MsgBatchCancel';
export const TYPE_URL_MSG_CREATE_CLOB_PAIR = '/ritbit.clob.MsgCreateClobPair';
export const TYPE_URL_MSG_UPDATE_CLOB_PAIR = '/ritbit.clob.MsgUpdateClobPair';
// x/delaymsg
export const TYPE_URL_MSG_DELAY_MESSAGE = '/ritbit.delaymsg.MsgDelayMessage';
// x/listing
export const TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS = '/ritbit.listing.MsgCreateMarketPermissionless';
// x/perpetuals
export const TYPE_URL_MSG_CREATE_PERPETUAL = '/ritbit.perpetuals.MsgCreatePerpetual';
// x/prices
export const TYPE_URL_MSG_CREATE_ORACLE_MARKET = '/ritbit.prices.MsgCreateOracleMarket';
// x/sending
export const TYPE_URL_MSG_CREATE_TRANSFER = '/ritbit.sending.MsgCreateTransfer';
export const TYPE_URL_MSG_WITHDRAW_FROM_SUBACCOUNT = '/ritbit.sending.MsgWithdrawFromSubaccount';
export const TYPE_URL_MSG_DEPOSIT_TO_SUBACCOUNT = '/ritbit.sending.MsgDepositToSubaccount';
// x/affiliates
export const TYPE_URL_MSG_REGISTER_AFFILIATE = '/ritbit.affiliates.MsgRegisterAffiliate';
// x/vault
export const TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT = '/ritbit.vault.MsgDepositToMegavault';
export const TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT = '/ritbit.vault.MsgWithdrawFromMegavault';
// x/staking
export const TYPE_URL_MSG_DELEGATE = '/cosmos.staking.v1beta1.MsgDelegate';
export const TYPE_URL_MSG_UNDELEGATE = '/cosmos.staking.v1beta1.MsgUndelegate';
// x/distribution
export const TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD = '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward';
// x/bridge
export const TYPE_URL_MSG_WITHDRAWAL = '/ritbit.bridge.MsgWithdrawal';
// x/accountplus
export const TYPE_URL_MSG_ADD_AUTHENTICATOR = '/ritbit.accountplus.MsgAddAuthenticator';
export const TYPE_URL_MSG_REMOVE_AUTHENTICATOR = '/ritbit.accountplus.MsgRemoveAuthenticator';
// ------------ Chain Constants ------------
// The following are same across different networks / deployments.
export const GOV_MODULE_ADDRESS = 'rit10d07y265gmmuvt4z0w9aw880jnsr700j086rvs';
export const DELAYMSG_MODULE_ADDRESS = 'rit1mkkvp26dngu6n8rmalaxyp3gwkjuzztqg7pc3h';
export const MEGAVAULT_MODULE_ADDRESS = 'rit18tkxrnrkqc2t0lr3zxr5g6a4hdvqksyl6u4m0h';
// ------------ Market Statistic Day Types ------------
export var MarketStatisticDay;
(function (MarketStatisticDay) {
    MarketStatisticDay["ONE"] = "1";
    MarketStatisticDay["SEVEN"] = "7";
    MarketStatisticDay["THIRTY"] = "30";
})(MarketStatisticDay || (MarketStatisticDay = {}));
// ------------ Order Types ------------
// This should match OrderType in Abacus
export 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 || (OrderType = {}));
// ------------ Order Side ------------
// This should match OrderSide in Abacus
export var OrderSide;
(function (OrderSide) {
    OrderSide["BUY"] = "BUY";
    OrderSide["SELL"] = "SELL";
})(OrderSide || (OrderSide = {}));
// ------------ Order TimeInForce ------------
// This should match OrderTimeInForce in Abacus
export var OrderTimeInForce;
(function (OrderTimeInForce) {
    OrderTimeInForce["GTT"] = "GTT";
    OrderTimeInForce["IOC"] = "IOC";
    OrderTimeInForce["FOK"] = "FOK";
})(OrderTimeInForce || (OrderTimeInForce = {}));
// ------------ Order Execution ------------
// This should match OrderExecution in Abacus
export var OrderExecution;
(function (OrderExecution) {
    OrderExecution["DEFAULT"] = "DEFAULT";
    OrderExecution["IOC"] = "IOC";
    OrderExecution["FOK"] = "FOK";
    OrderExecution["POST_ONLY"] = "POST_ONLY";
})(OrderExecution || (OrderExecution = {}));
// ------------ Order Status ------------
// This should match OrderStatus in Abacus
export 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 || (OrderStatus = {}));
export var TickerType;
(function (TickerType) {
    TickerType["PERPETUAL"] = "PERPETUAL";
})(TickerType || (TickerType = {}));
export var PositionStatus;
(function (PositionStatus) {
    PositionStatus["OPEN"] = "OPEN";
    PositionStatus["CLOSED"] = "CLOSED";
    PositionStatus["LIQUIDATED"] = "LIQUIDATED";
})(PositionStatus || (PositionStatus = {}));
// ----------- Time Period for Sparklines -------------
export var TimePeriod;
(function (TimePeriod) {
    TimePeriod["ONE_DAY"] = "ONE_DAY";
    TimePeriod["SEVEN_DAYS"] = "SEVEN_DAYS";
})(TimePeriod || (TimePeriod = {}));
export var PnlTickInterval;
(function (PnlTickInterval) {
    PnlTickInterval["HOUR"] = "hour";
    PnlTickInterval["day"] = "day";
})(PnlTickInterval || (PnlTickInterval = {}));
// ----------- Authenticators -------------
export 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 || (AuthenticatorType = {}));
export var TradingRewardAggregationPeriod;
(function (TradingRewardAggregationPeriod) {
    TradingRewardAggregationPeriod["DAILY"] = "DAILY";
    TradingRewardAggregationPeriod["WEEKLY"] = "WEEKLY";
    TradingRewardAggregationPeriod["MONTHLY"] = "MONTHLY";
})(TradingRewardAggregationPeriod || (TradingRewardAggregationPeriod = {}));
// ------------ API Defaults ------------
export const DEFAULT_API_TIMEOUT = 3000;
export const MAX_MEMO_CHARACTERS = 256;
export const SHORT_BLOCK_WINDOW = 20;
export const SHORT_BLOCK_FORWARD = 15;
// Querying
export const PAGE_REQUEST = {
    key: new Uint8Array(),
    offset: Long.UZERO,
    limit: Long.MAX_UNSIGNED_VALUE,
    countTotal: true,
    reverse: false,
};
export class IndexerConfig {
    constructor(restEndpoint, websocketEndpoint, proxy) {
        this.restEndpoint = restEndpoint;
        this.websocketEndpoint = websocketEndpoint;
        this.proxy = proxy;
    }
}
export 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;
    }
}
export 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, 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, 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, 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, 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;
    }
}
//# sourceMappingURL=data:application/json;base64, 