Skip to content

Commit

Permalink
Merge pull request #241 from qwerty-exchange/add-mainnet-sentry
Browse files Browse the repository at this point in the history
Add mainnet sentry endpoint
  • Loading branch information
bangjelkoski authored Sep 26, 2023
2 parents 4ca4169 + f403b30 commit 349defd
Show file tree
Hide file tree
Showing 28 changed files with 46 additions and 23 deletions.
4 changes: 4 additions & 0 deletions packages/contracts/src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export const contractAddressesByNetwork: ContractAddressesForNetwork = {
peggy: '0xF955C57f9EA9Dc8781965FEaE0b6A2acE2BAD6f3',
injective: '0xe28b3B32B6c345A34Ff64674606124Dd5Aceca30',
},
[Network.MainnetSentry]: {
peggy: '0xF955C57f9EA9Dc8781965FEaE0b6A2acE2BAD6f3',
injective: '0xe28b3B32B6c345A34Ff64674606124Dd5Aceca30',
},
[Network.Public]: {
peggy: '0xF955C57f9EA9Dc8781965FEaE0b6A2acE2BAD6f3',
injective: '0xe28b3B32B6c345A34Ff64674606124Dd5Aceca30',
Expand Down
10 changes: 10 additions & 0 deletions packages/networks/src/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import { NetworkEndpoints } from './types'

export const endpointsMainnetSentry: NetworkEndpoints = {
indexer: 'https://sentry.exchange.grpc-web.injective.network/',
grpc: 'https://sentry.chain.grpc-web.injective.network/',
rpc: 'https://sentry.tm.injective.network/',
rest: 'https://sentry.lcd.injective.network/',
chronos: 'https://sentry.exchange.grpc-web.injective.network/',
explorer: 'https://sentry.exchange.grpc-web.injective.network/',
cache: 'https://sentry.exchange.grpc-web.injective.network/'
}

export const endpointsMainnetK8s: NetworkEndpoints = {
indexer: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
grpc: 'https://k8s.mainnet.chain.grpc-web.injective.network',
Expand Down
4 changes: 4 additions & 0 deletions packages/networks/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ import {
endpointsTestnetK8s,
endpointsTestnetOld,
endpointsMainnetK8s,
endpointsMainnetSentry,
endpointsTestnetSentry,
} from './endpoints'
import { Network, ChainInfo, NetworkEndpoints } from './types'

export const networkEndpoints: Record<Network, NetworkEndpoints> = {
[Network.MainnetLB]: endpointsMainnetLB,
[Network.MainnetK8s]: endpointsMainnetK8s,
[Network.MainnetSentry]: endpointsMainnetSentry,
[Network.Staging]: endpointsStaging,
[Network.Mainnet]: endpointsMainnet,
[Network.Public]: endpointsPublic,
Expand All @@ -42,6 +44,7 @@ export const networkEndpoints: Record<Network, NetworkEndpoints> = {
export const chainInfos: Record<Network, ChainInfo> = {
[Network.MainnetLB]: mainnetChainInfo,
[Network.MainnetK8s]: mainnetChainInfo,
[Network.MainnetSentry]: mainnetChainInfo,
[Network.Staging]: mainnetChainInfo,
[Network.Mainnet]: mainnetChainInfo,
[Network.Public]: mainnetChainInfo,
Expand Down Expand Up @@ -83,6 +86,7 @@ export const isMainnet = (network: Network) =>
Network.Staging,
Network.Mainnet,
Network.MainnetK8s,
Network.MainnetSentry,
Network.Internal,
Network.MainnetLB,
].includes(network)
Expand Down
1 change: 1 addition & 0 deletions packages/networks/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum Network {
MainnetK8s = 'mainnetK8s',
MainnetLB = 'mainnetLB',
Mainnet = 'mainnet',
MainnetSentry = 'mainnetSentry',
Staging = 'staging',
Public = 'public',
Internal = 'internal', // @deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { ChainGrpcAuctionTransformer } from '../transformers'
import { ChainGrpcAuctionApi } from './ChainGrpcAuctionApi'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcAuctionApi = new ChainGrpcAuctionApi(endpoints.grpc)

describe('ChainGrpcAuctionApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { mockFactory } from '@injectivelabs/test-utils'
import { ChainGrpcAuthTransformer } from '../transformers/ChainGrpcAuthTransformer'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcAuthApi = new ChainGrpcAuthApi(endpoints.grpc)

describe('ChainGrpcAuthApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChainGrpcBankTransformer } from '../transformers'
import { CosmosBaseV1Beta1Coin } from '@injectivelabs/core-proto-ts'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcBankApi = new ChainGrpcBankApi(endpoints.grpc)

describe('ChainGrpcBankApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChainGrpcStakingApi } from './ChainGrpcStakingApi'
import { ChainGrpcDistributionTransformer } from '../transformers'
import { Delegation, Validator } from '../types'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcDistributionApi = new ChainGrpcDistributionApi(endpoints.grpc)

describe('ChainGrpcDistributionApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { InjectiveExchangeV1Beta1Query } from '@injectivelabs/core-proto-ts'

const injectiveAddress = mockFactory.injectiveAddress
const subaccountId = mockFactory.subaccountId
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc)

describe('ChainGrpcExchangeApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChainGrpcGovApi } from './ChainGrpcGovApi'
import { ChainGrpcGovTransformer } from '../transformers'
import { CosmosGovV1Gov } from '@injectivelabs/core-proto-ts'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc)
const proposalId = 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { sha256 } from '../../../utils/crypto'
import { fromUtf8 } from '../../../utils/utf8'
import { IbcApplicationsTransferV1Transfer } from '@injectivelabs/core-proto-ts'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcIbcApi = new ChainGrpcIbcApi(endpoints.grpc)

describe('ChainGrpcIbcApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ChainGrpcInsuranceFundTransformer } from '../transformers'
import { mockFactory } from '@injectivelabs/test-utils'
import { IndexerGrpcDerivativesApi } from '../../indexer'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcIbcApi = new ChainGrpcInsuranceFundApi(endpoints.grpc)
const injectiveAddress = mockFactory.injectiveAddress
const derivativeMarketId = mockFactory.derivativeMarketId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { ChainGrpcMintApi } from './ChainGrpcMintApi'
import { ChainGrpcMintTransformer } from '../transformers'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcMintApi = new ChainGrpcMintApi(endpoints.grpc)

describe('ChainGrpcMintApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { ChainGrpcOracleApi } from './ChainGrpcOracleApi'
import { OracleModuleParams } from '../types'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcOracleApi = new ChainGrpcOracleApi(endpoints.grpc)

describe('ChainGrpcOracleApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { ChainGrpcPeggyApi } from './ChainGrpcPeggyApi'
import { ChainGrpcPeggyTransformer } from '../transformers'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcPeggyApi = new ChainGrpcPeggyApi(endpoints.grpc)

describe('ChainGrpcPeggyApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChainGrpcStakingTransformer } from '../transformers'
import { Delegation, Validator } from '../types'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc)

describe('ChainGrpcStakingApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { ChainGrpcTokenFactoryApi } from './ChainGrpcTokenFactoryApi'
import { ChainGrpcTokenFactoryTransformer } from '../transformers'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcTokenFactoryApi = new ChainGrpcTokenFactoryApi(endpoints.grpc)

describe('ChainTokenFactoryApi.spec', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IndexerGrpcAccountApi } from './IndexerGrpcAccountApi'

const injectiveAddress = mockFactory.injectiveAddress
const subaccountId = getDefaultSubaccountId(injectiveAddress)
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcAccountApi = new IndexerGrpcAccountApi(endpoints.indexer)

describe('IndexerGrpcAccountApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { IndexerGrpcAuctionTransformer } from '../transformers'
import { IndexerGrpcAuctionApi } from './IndexerGrpcAuctionApi'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcAuctionApi = new IndexerGrpcAuctionApi(endpoints.indexer)

describe('IndexerGrpcAuctionApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DerivativeMarket } from '../types'
import { IndexerGrpcDerivativesApi } from './IndexerGrpcDerivativesApi'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcDerivativesApi = new IndexerGrpcDerivativesApi(
endpoints.indexer,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ExplorerValidator } from '../types'
import { IndexerGrpcExplorerApi } from './IndexerGrpcExplorerApi'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcExplorerApi = new IndexerGrpcExplorerApi(endpoints.indexer)

describe('IndexerGrpcExplorerApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IndexerGrpcInsuranceFundTransformer } from '../transformers'
import { IndexerGrpcInsuranceFundApi } from './IndexerGrpcInsuranceFundApi'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcInsuranceFundApi = new IndexerGrpcInsuranceFundApi(
endpoints.indexer,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { IndexerGrpcMetaApi } from './IndexerGrpcMetaApi'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcMetaApi = new IndexerGrpcMetaApi(endpoints.indexer)

describe('IndexerGrpcMetaApi', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { IndexerGrpcOracleApi } from './IndexerGrpcOracleApi'

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcOracleApi = new IndexerGrpcOracleApi(endpoints.indexer)

describe('IndexerGrpcOracleApi', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IndexerGrpcAccountPortfolioTransformer } from '../transformers'
import { IndexerGrpcAccountPortfolioApi } from './IndexerGrpcPortfolioApi'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcPortfolioApi = new IndexerGrpcAccountPortfolioApi(
endpoints.indexer,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SpotMarket } from '../types'
import { IndexerGrpcSpotApi } from './IndexerGrpcSpotApi'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcSpotApi = new IndexerGrpcSpotApi(endpoints.indexer)

describe('IndexerGrpcSpotApi', () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk-ts/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const CW20_ADAPTER_CONTRACT_BY_NETWORK = {
[Network.Mainnet]: 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk',
[Network.MainnetLB]: 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk',
[Network.MainnetK8s]: 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk',
[Network.MainnetSentry]: 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk',
[Network.Public]: 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk',
[Network.Staging]: 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk',
[Network.Internal]: 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk',
Expand All @@ -36,6 +37,7 @@ export const CW20_SWAP_CONTRACT_BY_NETWORK = {
[Network.Mainnet]: 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx',
[Network.MainnetLB]: 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx',
[Network.MainnetK8s]: 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx',
[Network.MainnetSentry]: 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx',
[Network.Public]: 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx',
[Network.Staging]: 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx',
[Network.Internal]: 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx',
Expand All @@ -53,6 +55,7 @@ export const INJ_NAME_REGISTRY_CONTRACT_BY_NETWORK = {
[Network.Mainnet]: 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275',
[Network.MainnetLB]: 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275',
[Network.MainnetK8s]: 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275',
[Network.MainnetSentry]: 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275',
[Network.Public]: 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275',
[Network.Staging]: 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275',
[Network.Internal]: 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275',
Expand All @@ -70,6 +73,7 @@ export const INJ_NAME_REVERSE_RESOLVER_CONTRACT_BY_NETWORK = {
[Network.Mainnet]: 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu',
[Network.MainnetLB]: 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu',
[Network.MainnetK8s]: 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu',
[Network.MainnetSentry]: 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu',
[Network.Public]: 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu',
[Network.Staging]: 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu',
[Network.Internal]: 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu',
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-ui-ts/src/validators-logo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ValidatorMap {
[validatorAddress: string]: string | undefined
}

const endpoints = getNetworkEndpoints(Network.MainnetK8s)
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc)
const keybaseApi = new HttpRestClient('https://keybase.io/_/api/1.0/')

Expand Down

0 comments on commit 349defd

Please sign in to comment.