@injectivelabs/networks 1.16.38-alpha.2 → 1.16.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,178 @@
1
+ export const getEndpointsMainnetSentry = () => ({
2
+ indexer: 'https://sentry.exchange.grpc-web.injective.network',
3
+ grpc: 'https://sentry.chain.grpc-web.injective.network',
4
+ rpc: 'https://sentry.tm.injective.network',
5
+ rest: 'https://sentry.lcd.injective.network',
6
+ chronos: 'https://sentry.exchange.grpc-web.injective.network',
7
+ explorer: 'https://sentry.explorer.grpc-web.injective.network',
8
+ cacheGrpc: 'https://sentry.chain.grpc-web.injective.network',
9
+ cacheRest: 'https://staging.gateway.grpc-web.injective.network',
10
+ web3gw: 'https://sentry.exchange.grpc-web.injective.network',
11
+ chart: 'https://sentry.exchange.grpc-web.injective.network',
12
+ });
13
+ export const getEndpointsStaging = () => ({
14
+ indexer: 'https://k8s.mainnet.staging.exchange.grpc-web.injective.network',
15
+ grpc: 'https://k8s.global.mainnet.chain.grpc-web.injective.network',
16
+ rpc: 'https://k8s.global.mainnet.tm.injective.network',
17
+ rest: 'https://k8s.global.mainnet.lcd.injective.network',
18
+ chronos: 'https://k8s.mainnet.staging.exchange.grpc-web.injective.network',
19
+ explorer: 'https://k8s.mainnet.staging.exchange.grpc-web.injective.network',
20
+ cacheGrpc: 'https://k8s.global.mainnet.chain.grpc-web.injective.network',
21
+ cacheRest: 'https://k8s.mainnet.staging.exchange.grpc-web.injective.network',
22
+ web3gw: 'https://k8s.mainnet.staging.exchange.grpc-web.injective.network',
23
+ chart: 'https://k8s.mainnet.staging.chart.grpc-web.injective.network',
24
+ });
25
+ export const getEndpointsInternal = () => ({
26
+ indexer: 'https://products.exchange.grpc-web.injective.network',
27
+ grpc: 'https://products.chain.grpc-web.injective.network',
28
+ rpc: 'https://products.tm.injective.network',
29
+ rest: 'https://products.lcd.injective.network',
30
+ chronos: 'https://products.chronos.grpc-web.injective.network',
31
+ explorer: 'https://products.explorer.grpc-web.injective.network',
32
+ cacheGrpc: 'https://products.chain.grpc-web.injective.network',
33
+ cacheRest: 'https://staging.gateway.grpc-web.injective.network',
34
+ web3gw: 'https://products.web3-gateway.injective.network',
35
+ chart: 'https://products.exchange.grpc-web.injective.network',
36
+ });
37
+ export const getEndpointsTestnetSentry = () => ({
38
+ indexer: 'https://testnet.sentry.exchange.grpc-web.injective.network',
39
+ grpc: 'https://testnet.sentry.chain.grpc-web.injective.network',
40
+ rpc: 'https://testnet.sentry.tm.injective.network',
41
+ rest: 'https://testnet.sentry.lcd.injective.network',
42
+ chronos: 'https://testnet.sentry.exchange.grpc-web.injective.network',
43
+ explorer: 'https://testnet.sentry.exchange.grpc-web.injective.network',
44
+ cacheGrpc: 'https://testnet.sentry.chain.grpc-web.injective.network',
45
+ cacheRest: 'https://testnet.sentry.exchange.grpc-web.injective.network',
46
+ web3gw: 'https://testnet.sentry.exchange.grpc-web.injective.network',
47
+ chart: 'https://k8s.testnet.chart.grpc-web.injective.network',
48
+ });
49
+ export const getEndpointsDevnet = () => ({
50
+ indexer: 'https://devnet.api.injective.dev',
51
+ grpc: 'https://devnet.grpc.injective.dev',
52
+ rpc: 'https://devnet.tm.injective.dev',
53
+ rest: 'https://devnet.lcd.injective.dev',
54
+ chronos: 'https://devnet.api.injective.dev',
55
+ explorer: 'https://devnet.api.injective.dev',
56
+ cacheGrpc: 'https://devnet.grpc.injective.dev',
57
+ cacheRest: 'https://devnet.api.injective.dev',
58
+ web3gw: 'https://devnet.api.injective.dev',
59
+ chart: 'https://devnet.api.injective.dev',
60
+ });
61
+ export const getEndpointsDevnet1 = () => ({
62
+ indexer: 'https://devnet-1.api.injective.dev',
63
+ grpc: 'https://devnet-1.grpc.injective.dev',
64
+ rpc: 'https://devnet-1.tm.injective.dev',
65
+ rest: 'https://devnet-1.lcd.injective.dev',
66
+ chronos: 'https://devnet-1.api.injective.dev',
67
+ explorer: 'https://devnet-1.api.injective.dev',
68
+ cacheGrpc: 'https://devnet-1.grpc.injective.dev',
69
+ cacheRest: 'https://devnet-1.api.injective.dev',
70
+ web3gw: 'https://devnet-1.api.injective.dev',
71
+ chart: 'https://devnet-1.api.injective.dev',
72
+ });
73
+ export const getEndpointsDevnet2 = () => ({
74
+ indexer: 'https://devnet-2.api.injective.dev',
75
+ grpc: 'https://devnet-2.grpc.injective.dev',
76
+ rpc: 'https://devnet-2.tm.injective.dev',
77
+ rest: 'https://devnet-2.lcd.injective.dev',
78
+ chronos: 'https://devnet-2.api.injective.dev',
79
+ explorer: 'https://devnet-2.api.injective.dev',
80
+ cacheGrpc: 'https://devnet-2.grpc.injective.dev',
81
+ cacheRest: 'https://devnet-2.api.injective.dev',
82
+ web3gw: 'https://devnet-2.api.injective.dev',
83
+ chart: 'https://devnet-2.api.injective.dev',
84
+ });
85
+ export const getEndpointsDevnet3 = () => ({
86
+ indexer: 'https://devnet-3.api.injective.dev',
87
+ grpc: 'https://devnet-3.grpc.injective.dev',
88
+ rpc: 'https://devnet-3.tm.injective.dev',
89
+ rest: 'https://devnet-3.lcd.injective.dev',
90
+ chronos: 'https://devnet-3.api.injective.dev',
91
+ explorer: 'https://devnet-3.api.injective.dev',
92
+ cacheGrpc: 'https://devnet-3.grpc.injective.dev',
93
+ cacheRest: 'https://devnet-3.api.injective.dev',
94
+ web3gw: 'https://devnet-3.api.injective.dev',
95
+ chart: 'https://devnet-3.api.injective.dev',
96
+ });
97
+ export const getEndpointsLocal = () => ({
98
+ indexer: 'https://localhost:4444',
99
+ grpc: 'http://localhost:10337',
100
+ rpc: 'http://localhost:9092',
101
+ rest: 'http://localhost:10337',
102
+ chronos: 'https://localhost:4442',
103
+ explorer: 'http://localhost:4443',
104
+ cacheGrpc: 'http://localhost:10337',
105
+ cacheRest: 'https://localhost:4444',
106
+ web3gw: 'https://localhost:4444',
107
+ });
108
+ /**
109
+ * @deprecated use TestnetSentry instead
110
+ */
111
+ export const getEndpointsTestnetOld = () => ({
112
+ indexer: 'https://testnet.exchange.grpc-web.injective.network',
113
+ grpc: 'https://testnet.chain.grpc-web.injective.network',
114
+ rpc: 'https://testnet.tm.injective.network',
115
+ rest: 'https://testnet.lcd.injective.network',
116
+ chronos: 'https://testnet.exchange.grpc-web.injective.network',
117
+ explorer: 'https://testnet.exchange.grpc-web.injective.network',
118
+ web3gw: 'https://testnet.exchange.grpc-web.injective.network',
119
+ cacheGrpc: 'https://testnet.exchange.grpc-web.injective.network/',
120
+ cacheRest: 'https://testnet.exchange.grpc-web.injective.network',
121
+ });
122
+ /**
123
+ * @deprecated use TestnetSentry instead
124
+ */
125
+ export const getEndpointsTestnetK8s = () => ({
126
+ indexer: 'https://k8s.testnet.exchange.grpc-web.injective.network',
127
+ grpc: 'https://k8s.testnet.chain.grpc-web.injective.network',
128
+ rpc: 'https://k8s.testnet.tm.injective.network',
129
+ rest: 'https://k8s.testnet.lcd.injective.network',
130
+ chronos: 'https://k8s.testnet.exchange.grpc-web.injective.network',
131
+ explorer: 'https://k8s.testnet.explorer.grpc-web.injective.network',
132
+ cacheGrpc: 'https://k8s.testnet.gateway.grpc.injective.network',
133
+ cacheRest: 'https://k8s.testnet.gateway.grpc-web.injective.network',
134
+ web3gw: 'https://k8s.testnet.exchange.grpc-web.injective.network',
135
+ });
136
+ /**
137
+ * @deprecated use MainnetSentry instead
138
+ */
139
+ export const getEndpointsMainnetLB = () => ({
140
+ indexer: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
141
+ grpc: 'https://k8s.global.mainnet.chain.grpc-web.injective.network',
142
+ rpc: 'https://k8s.global.mainnet.tm.injective.network',
143
+ rest: 'https://k8s.global.mainnet.lcd.injective.network',
144
+ chronos: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
145
+ explorer: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
146
+ cacheGrpc: 'https://k8s.global.mainnet.chain.grpc-web.injective.network',
147
+ cacheRest: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
148
+ web3gw: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
149
+ chart: 'https://k8s.global.mainnet.chart.grpc-web.injective.network',
150
+ });
151
+ /**
152
+ * @deprecated use MainnetSentry instead
153
+ */
154
+ export const getEndpointsMainnetOld = () => ({
155
+ indexer: 'https://api.injective.network',
156
+ grpc: 'https://grpc.injective.network',
157
+ cacheGrpc: 'https://grpc.injective.network',
158
+ rpc: 'https://tm.injective.network',
159
+ rest: 'https://lcd.injective.network',
160
+ cacheRest: 'https://api.injective.network',
161
+ chronos: 'https://api.injective.network',
162
+ explorer: 'https://api.injective.network',
163
+ web3gw: 'https://api.injective.network',
164
+ });
165
+ /**
166
+ * @deprecated use MainnetSentry instead
167
+ */
168
+ export const getEndpointsMainnetK8s = () => ({
169
+ indexer: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
170
+ grpc: 'https://k8s.mainnet.chain.grpc-web.injective.network',
171
+ rpc: 'https://k8s.mainnet.tm.injective.network',
172
+ rest: 'https://k8s.mainnet.lcd.injective.network',
173
+ chronos: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
174
+ explorer: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
175
+ cacheGrpc: 'https://k8s.mainnet.chain.grpc-web.injective.network',
176
+ cacheRest: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
177
+ web3gw: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
178
+ });
@@ -1,69 +1,3 @@
1
- import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
2
-
3
- //#region src/types.d.ts
4
- declare const Network: {
5
- readonly MainnetK8s: "mainnetK8s";
6
- readonly MainnetLB: "mainnetLB";
7
- readonly Mainnet: "mainnet";
8
- readonly MainnetSentry: "mainnetSentry";
9
- readonly MainnetOld: "mainnetOld";
10
- readonly Staging: "staging";
11
- readonly Internal: "internal";
12
- readonly TestnetK8s: "testnetK8s";
13
- readonly TestnetOld: "testnetOld";
14
- readonly TestnetSentry: "testnetSentry";
15
- readonly Testnet: "testnet";
16
- readonly Devnet1: "devnet1";
17
- readonly Devnet2: "devnet2";
18
- readonly Devnet3: "devnet3";
19
- readonly Devnet: "devnet";
20
- readonly Local: "local";
21
- };
22
- type Network = (typeof Network)[keyof typeof Network];
23
- type NetworkEndpoints = {
24
- indexer: string;
25
- grpc: string;
26
- rest: string;
27
- rpc?: string;
28
- cacheGrpc?: string;
29
- cacheRest?: string;
30
- chronos?: string;
31
- web3gw?: string;
32
- explorer?: string;
33
- chart?: string;
34
- };
35
- type UrlEndpoints = NetworkEndpoints;
36
- /** Deprecated */
37
- type ChainInfo = {
38
- feeDenom: string;
39
- chainId: ChainId;
40
- env: string;
41
- evmChainId?: EvmChainId;
42
- };
43
- //#endregion
44
- //#region src/utils.d.ts
45
- declare const CW20_CODE_IDS_BY_NETWORK: (network?: Network) => string[];
46
- declare const getCw20AdapterContractForNetwork: (network?: Network) => "inj1uukt3kqela4vsllvrqnrgllkna5wn3cm588w6k" | "inj1hdvy6tl89llqy3ze8lv6mz5qh66sx9enn0jxg6" | "inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk";
47
- declare const getCw20SwapContractForNetwork: (network?: Network) => "inj177yh38g3ctu7cemxpa3c2kvwh2yslfxfmfa66h" | "inj14d7h5j6ddq6pqppl65z24w7xrtmpcrqjxj8d43" | "inj12yj3mtjarujkhcp6lg3klxjjfrx2v7v8yswgp9" | "inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx";
48
- declare const getIncentivesContractForNetwork: (network?: Network) => "" | "inj16twru668nsl7tqzahxd9q033swhr6a5xuslpkt";
49
- declare const getInjNameRegistryContractForNetwork: (network?: Network) => "inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa" | "inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275";
50
- declare const getInjNameReverseResolverContractForNetwork: (network?: Network) => "inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v" | "inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu";
51
- declare const getPeggyGraphQlEndpointForNetwork: (network: Network) => string;
52
- declare const getAssetPriceServiceForNetwork: (network: Network) => string;
53
- //#endregion
54
- //#region src/network.d.ts
55
- declare const getNetworkEndpoints: (network: Network) => NetworkEndpoints;
56
- /**
57
- * @deprecated - use getNetworkChainInfo instead
58
- * @param network deprecated
59
- * @returns
60
- */
61
- declare const getChainInfoForNetwork: (network: Network) => ChainInfo;
62
- declare const getNetworkChainInfo: (network: Network) => ChainInfo;
63
- declare const getNetworkInfo: (network: Network) => ChainInfo & NetworkEndpoints;
64
- declare const isMainnet: (network: Network) => boolean;
65
- declare const isDevnet: (network: Network) => boolean;
66
- declare const isTestnet: (network: Network) => boolean;
67
- declare const isTestnetOrDevnet: (network: Network) => boolean;
68
- //#endregion
69
- export { CW20_CODE_IDS_BY_NETWORK, ChainInfo, Network, NetworkEndpoints, UrlEndpoints, getAssetPriceServiceForNetwork, getChainInfoForNetwork, getCw20AdapterContractForNetwork, getCw20SwapContractForNetwork, getIncentivesContractForNetwork, getInjNameRegistryContractForNetwork, getInjNameReverseResolverContractForNetwork, getNetworkChainInfo, getNetworkEndpoints, getNetworkInfo, getPeggyGraphQlEndpointForNetwork, isDevnet, isMainnet, isTestnet, isTestnetOrDevnet };
1
+ export * from './network.js';
2
+ export * from './types.js';
3
+ export * from './utils.js';
package/dist/esm/index.js CHANGED
@@ -1,343 +1,3 @@
1
- import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
2
-
3
- //#region src/types.ts
4
- const Network = {
5
- MainnetK8s: "mainnetK8s",
6
- MainnetLB: "mainnetLB",
7
- Mainnet: "mainnet",
8
- MainnetSentry: "mainnetSentry",
9
- MainnetOld: "mainnetOld",
10
- Staging: "staging",
11
- Internal: "internal",
12
- TestnetK8s: "testnetK8s",
13
- TestnetOld: "testnetOld",
14
- TestnetSentry: "testnetSentry",
15
- Testnet: "testnet",
16
- Devnet1: "devnet1",
17
- Devnet2: "devnet2",
18
- Devnet3: "devnet3",
19
- Devnet: "devnet",
20
- Local: "local"
21
- };
22
-
23
- //#endregion
24
- //#region src/chainInfos.ts
25
- const INJ_DENOM = "inj";
26
- const getMainnetChainInfo = () => ({
27
- feeDenom: INJ_DENOM,
28
- chainId: ChainId.Mainnet,
29
- evmChainId: EvmChainId.Mainnet,
30
- env: "mainnet"
31
- });
32
- const getTestnetChainInfo = () => ({
33
- feeDenom: INJ_DENOM,
34
- chainId: ChainId.Testnet,
35
- evmChainId: EvmChainId.Sepolia,
36
- env: "testnet"
37
- });
38
- const getDevnetChainInfo = () => ({
39
- feeDenom: INJ_DENOM,
40
- chainId: ChainId.Devnet,
41
- evmChainId: EvmChainId.Sepolia,
42
- env: "devnet"
43
- });
44
- const getLocalChainInfo = () => ({
45
- feeDenom: INJ_DENOM,
46
- chainId: ChainId.Mainnet,
47
- evmChainId: EvmChainId.Sepolia,
48
- env: "local"
49
- });
50
-
51
- //#endregion
52
- //#region src/endpoints.ts
53
- const getEndpointsMainnetSentry = () => ({
54
- indexer: "https://sentry.exchange.grpc-web.injective.network",
55
- grpc: "https://sentry.chain.grpc-web.injective.network",
56
- rpc: "https://sentry.tm.injective.network",
57
- rest: "https://sentry.lcd.injective.network",
58
- chronos: "https://sentry.exchange.grpc-web.injective.network",
59
- explorer: "https://sentry.explorer.grpc-web.injective.network",
60
- cacheGrpc: "https://sentry.chain.grpc-web.injective.network",
61
- cacheRest: "https://staging.gateway.grpc-web.injective.network",
62
- web3gw: "https://sentry.exchange.grpc-web.injective.network",
63
- chart: "https://sentry.exchange.grpc-web.injective.network"
64
- });
65
- const getEndpointsStaging = () => ({
66
- indexer: "https://k8s.mainnet.staging.exchange.grpc-web.injective.network",
67
- grpc: "https://k8s.global.mainnet.chain.grpc-web.injective.network",
68
- rpc: "https://k8s.global.mainnet.tm.injective.network",
69
- rest: "https://k8s.global.mainnet.lcd.injective.network",
70
- chronos: "https://k8s.mainnet.staging.exchange.grpc-web.injective.network",
71
- explorer: "https://k8s.mainnet.staging.exchange.grpc-web.injective.network",
72
- cacheGrpc: "https://k8s.global.mainnet.chain.grpc-web.injective.network",
73
- cacheRest: "https://k8s.mainnet.staging.exchange.grpc-web.injective.network",
74
- web3gw: "https://k8s.mainnet.staging.exchange.grpc-web.injective.network",
75
- chart: "https://k8s.mainnet.staging.chart.grpc-web.injective.network"
76
- });
77
- const getEndpointsInternal = () => ({
78
- indexer: "https://products.exchange.grpc-web.injective.network",
79
- grpc: "https://products.chain.grpc-web.injective.network",
80
- rpc: "https://products.tm.injective.network",
81
- rest: "https://products.lcd.injective.network",
82
- chronos: "https://products.chronos.grpc-web.injective.network",
83
- explorer: "https://products.explorer.grpc-web.injective.network",
84
- cacheGrpc: "https://products.chain.grpc-web.injective.network",
85
- cacheRest: "https://staging.gateway.grpc-web.injective.network",
86
- web3gw: "https://products.web3-gateway.injective.network",
87
- chart: "https://products.exchange.grpc-web.injective.network"
88
- });
89
- const getEndpointsTestnetSentry = () => ({
90
- indexer: "https://testnet.sentry.exchange.grpc-web.injective.network",
91
- grpc: "https://testnet.sentry.chain.grpc-web.injective.network",
92
- rpc: "https://testnet.sentry.tm.injective.network",
93
- rest: "https://testnet.sentry.lcd.injective.network",
94
- chronos: "https://testnet.sentry.exchange.grpc-web.injective.network",
95
- explorer: "https://testnet.sentry.exchange.grpc-web.injective.network",
96
- cacheGrpc: "https://testnet.sentry.chain.grpc-web.injective.network",
97
- cacheRest: "https://testnet.sentry.exchange.grpc-web.injective.network",
98
- web3gw: "https://testnet.sentry.exchange.grpc-web.injective.network",
99
- chart: "https://k8s.testnet.chart.grpc-web.injective.network"
100
- });
101
- const getEndpointsDevnet = () => ({
102
- indexer: "https://devnet.api.injective.dev",
103
- grpc: "https://devnet.grpc.injective.dev",
104
- rpc: "https://devnet.tm.injective.dev",
105
- rest: "https://devnet.lcd.injective.dev",
106
- chronos: "https://devnet.api.injective.dev",
107
- explorer: "https://devnet.api.injective.dev",
108
- cacheGrpc: "https://devnet.grpc.injective.dev",
109
- cacheRest: "https://devnet.api.injective.dev",
110
- web3gw: "https://devnet.api.injective.dev",
111
- chart: "https://devnet.api.injective.dev"
112
- });
113
- const getEndpointsDevnet1 = () => ({
114
- indexer: "https://devnet-1.api.injective.dev",
115
- grpc: "https://devnet-1.grpc.injective.dev",
116
- rpc: "https://devnet-1.tm.injective.dev",
117
- rest: "https://devnet-1.lcd.injective.dev",
118
- chronos: "https://devnet-1.api.injective.dev",
119
- explorer: "https://devnet-1.api.injective.dev",
120
- cacheGrpc: "https://devnet-1.grpc.injective.dev",
121
- cacheRest: "https://devnet-1.api.injective.dev",
122
- web3gw: "https://devnet-1.api.injective.dev",
123
- chart: "https://devnet-1.api.injective.dev"
124
- });
125
- const getEndpointsDevnet2 = () => ({
126
- indexer: "https://devnet-2.api.injective.dev",
127
- grpc: "https://devnet-2.grpc.injective.dev",
128
- rpc: "https://devnet-2.tm.injective.dev",
129
- rest: "https://devnet-2.lcd.injective.dev",
130
- chronos: "https://devnet-2.api.injective.dev",
131
- explorer: "https://devnet-2.api.injective.dev",
132
- cacheGrpc: "https://devnet-2.grpc.injective.dev",
133
- cacheRest: "https://devnet-2.api.injective.dev",
134
- web3gw: "https://devnet-2.api.injective.dev",
135
- chart: "https://devnet-2.api.injective.dev"
136
- });
137
- const getEndpointsDevnet3 = () => ({
138
- indexer: "https://devnet-3.api.injective.dev",
139
- grpc: "https://devnet-3.grpc.injective.dev",
140
- rpc: "https://devnet-3.tm.injective.dev",
141
- rest: "https://devnet-3.lcd.injective.dev",
142
- chronos: "https://devnet-3.api.injective.dev",
143
- explorer: "https://devnet-3.api.injective.dev",
144
- cacheGrpc: "https://devnet-3.grpc.injective.dev",
145
- cacheRest: "https://devnet-3.api.injective.dev",
146
- web3gw: "https://devnet-3.api.injective.dev",
147
- chart: "https://devnet-3.api.injective.dev"
148
- });
149
- const getEndpointsLocal = () => ({
150
- indexer: "https://localhost:4444",
151
- grpc: "http://localhost:10337",
152
- rpc: "http://localhost:9092",
153
- rest: "http://localhost:10337",
154
- chronos: "https://localhost:4442",
155
- explorer: "http://localhost:4443",
156
- cacheGrpc: "http://localhost:10337",
157
- cacheRest: "https://localhost:4444",
158
- web3gw: "https://localhost:4444"
159
- });
160
- /**
161
- * @deprecated use TestnetSentry instead
162
- */
163
- const getEndpointsTestnetOld = () => ({
164
- indexer: "https://testnet.exchange.grpc-web.injective.network",
165
- grpc: "https://testnet.chain.grpc-web.injective.network",
166
- rpc: "https://testnet.tm.injective.network",
167
- rest: "https://testnet.lcd.injective.network",
168
- chronos: "https://testnet.exchange.grpc-web.injective.network",
169
- explorer: "https://testnet.exchange.grpc-web.injective.network",
170
- web3gw: "https://testnet.exchange.grpc-web.injective.network",
171
- cacheGrpc: "https://testnet.exchange.grpc-web.injective.network/",
172
- cacheRest: "https://testnet.exchange.grpc-web.injective.network"
173
- });
174
- /**
175
- * @deprecated use TestnetSentry instead
176
- */
177
- const getEndpointsTestnetK8s = () => ({
178
- indexer: "https://k8s.testnet.exchange.grpc-web.injective.network",
179
- grpc: "https://k8s.testnet.chain.grpc-web.injective.network",
180
- rpc: "https://k8s.testnet.tm.injective.network",
181
- rest: "https://k8s.testnet.lcd.injective.network",
182
- chronos: "https://k8s.testnet.exchange.grpc-web.injective.network",
183
- explorer: "https://k8s.testnet.explorer.grpc-web.injective.network",
184
- cacheGrpc: "https://k8s.testnet.gateway.grpc.injective.network",
185
- cacheRest: "https://k8s.testnet.gateway.grpc-web.injective.network",
186
- web3gw: "https://k8s.testnet.exchange.grpc-web.injective.network"
187
- });
188
- /**
189
- * @deprecated use MainnetSentry instead
190
- */
191
- const getEndpointsMainnetLB = () => ({
192
- indexer: "https://k8s.global.mainnet.exchange.grpc-web.injective.network",
193
- grpc: "https://k8s.global.mainnet.chain.grpc-web.injective.network",
194
- rpc: "https://k8s.global.mainnet.tm.injective.network",
195
- rest: "https://k8s.global.mainnet.lcd.injective.network",
196
- chronos: "https://k8s.global.mainnet.exchange.grpc-web.injective.network",
197
- explorer: "https://k8s.global.mainnet.exchange.grpc-web.injective.network",
198
- cacheGrpc: "https://k8s.global.mainnet.chain.grpc-web.injective.network",
199
- cacheRest: "https://k8s.global.mainnet.exchange.grpc-web.injective.network",
200
- web3gw: "https://k8s.global.mainnet.exchange.grpc-web.injective.network",
201
- chart: "https://k8s.global.mainnet.chart.grpc-web.injective.network"
202
- });
203
- /**
204
- * @deprecated use MainnetSentry instead
205
- */
206
- const getEndpointsMainnetOld = () => ({
207
- indexer: "https://api.injective.network",
208
- grpc: "https://grpc.injective.network",
209
- cacheGrpc: "https://grpc.injective.network",
210
- rpc: "https://tm.injective.network",
211
- rest: "https://lcd.injective.network",
212
- cacheRest: "https://api.injective.network",
213
- chronos: "https://api.injective.network",
214
- explorer: "https://api.injective.network",
215
- web3gw: "https://api.injective.network"
216
- });
217
- /**
218
- * @deprecated use MainnetSentry instead
219
- */
220
- const getEndpointsMainnetK8s = () => ({
221
- indexer: "https://k8s.mainnet.exchange.grpc-web.injective.network",
222
- grpc: "https://k8s.mainnet.chain.grpc-web.injective.network",
223
- rpc: "https://k8s.mainnet.tm.injective.network",
224
- rest: "https://k8s.mainnet.lcd.injective.network",
225
- chronos: "https://k8s.mainnet.exchange.grpc-web.injective.network",
226
- explorer: "https://k8s.mainnet.exchange.grpc-web.injective.network",
227
- cacheGrpc: "https://k8s.mainnet.chain.grpc-web.injective.network",
228
- cacheRest: "https://k8s.mainnet.exchange.grpc-web.injective.network",
229
- web3gw: "https://k8s.mainnet.exchange.grpc-web.injective.network"
230
- });
231
-
232
- //#endregion
233
- //#region src/network.ts
234
- const getNetworkEndpoints = (network) => {
235
- switch (network) {
236
- case Network.MainnetLB: return getEndpointsMainnetLB();
237
- case Network.MainnetK8s: return getEndpointsMainnetK8s();
238
- case Network.MainnetSentry:
239
- case Network.Mainnet: return getEndpointsMainnetSentry();
240
- case Network.MainnetOld: return getEndpointsMainnetOld();
241
- case Network.Staging: return getEndpointsStaging();
242
- case Network.Internal: return getEndpointsInternal();
243
- case Network.Devnet: return getEndpointsDevnet();
244
- case Network.Devnet1: return getEndpointsDevnet1();
245
- case Network.Devnet2: return getEndpointsDevnet2();
246
- case Network.Devnet3: return getEndpointsDevnet3();
247
- case Network.TestnetK8s: return getEndpointsTestnetK8s();
248
- case Network.TestnetOld: return getEndpointsTestnetOld();
249
- case Network.TestnetSentry:
250
- case Network.Testnet: return getEndpointsTestnetSentry();
251
- case Network.Local: return getEndpointsLocal();
252
- default: throw new Error(`Unknown network: ${network}`);
253
- }
254
- };
255
- /**
256
- * @deprecated - use getNetworkChainInfo instead
257
- * @param network deprecated
258
- * @returns
259
- */
260
- const getChainInfoForNetwork = (network) => getNetworkChainInfo(network);
261
- const getNetworkChainInfo = (network) => {
262
- if (network === Network.Local) return getLocalChainInfo();
263
- if (isTestnet(network)) return getTestnetChainInfo();
264
- if (isDevnet(network)) return getDevnetChainInfo();
265
- return getMainnetChainInfo();
266
- };
267
- const getNetworkInfo = (network) => ({
268
- ...getNetworkChainInfo(network),
269
- ...getNetworkEndpoints(network)
270
- });
271
- const isMainnet = (network) => [
272
- Network.Staging,
273
- Network.Mainnet,
274
- Network.MainnetOld,
275
- Network.MainnetK8s,
276
- Network.MainnetSentry,
277
- Network.Internal,
278
- Network.MainnetLB
279
- ].includes(network);
280
- const isDevnet = (network) => [
281
- Network.Devnet,
282
- Network.Devnet1,
283
- Network.Devnet2,
284
- Network.Devnet3,
285
- Network.Local
286
- ].includes(network);
287
- const isTestnet = (network) => [
288
- Network.Testnet,
289
- Network.TestnetOld,
290
- Network.TestnetK8s,
291
- Network.TestnetSentry
292
- ].includes(network);
293
- const isTestnetOrDevnet = (network) => isDevnet(network) || isTestnet(network);
294
-
295
- //#endregion
296
- //#region src/utils.ts
297
- const CW20_CODE_IDS_BY_NETWORK = (network = Network.Mainnet) => {
298
- if (isTestnet(network)) return ["25"];
299
- return [
300
- "28",
301
- "5",
302
- "42"
303
- ];
304
- };
305
- const getCw20AdapterContractForNetwork = (network = Network.Mainnet) => {
306
- if (isDevnet(network)) return "inj1uukt3kqela4vsllvrqnrgllkna5wn3cm588w6k";
307
- if (isTestnet(network)) return "inj1hdvy6tl89llqy3ze8lv6mz5qh66sx9enn0jxg6";
308
- return "inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk";
309
- };
310
- const getCw20SwapContractForNetwork = (network = Network.Mainnet) => {
311
- if (isDevnet(network)) return "inj177yh38g3ctu7cemxpa3c2kvwh2yslfxfmfa66h";
312
- if (isTestnet(network)) return "inj14d7h5j6ddq6pqppl65z24w7xrtmpcrqjxj8d43";
313
- if (network === Network.Staging) return "inj12yj3mtjarujkhcp6lg3klxjjfrx2v7v8yswgp9";
314
- return "inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx";
315
- };
316
- const getIncentivesContractForNetwork = (network = Network.Mainnet) => {
317
- if (isDevnet(network)) return "";
318
- if (isTestnet(network)) return "inj16twru668nsl7tqzahxd9q033swhr6a5xuslpkt";
319
- return "";
320
- };
321
- const getInjNameRegistryContractForNetwork = (network = Network.Mainnet) => {
322
- if (isDevnet(network)) return "inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa";
323
- if (isTestnet(network)) return "inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa";
324
- return "inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275";
325
- };
326
- const getInjNameReverseResolverContractForNetwork = (network = Network.Mainnet) => {
327
- if (isDevnet(network)) return "inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v";
328
- if (isTestnet(network)) return "inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v";
329
- return "inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu";
330
- };
331
- const getPeggyGraphQlEndpointForNetwork = (network) => {
332
- if (isDevnet(network)) return "https://api.thegraph.com/subgraphs/name/injectivelabsdev/injective-peggo-devnet";
333
- if (isTestnet(network)) return "https://api.thegraph.com/subgraphs/name/injectivelabs/injective-peggo-goerli";
334
- return "https://api.thegraph.com/subgraphs/name/injectivelabs/injective-peggo-mainnet";
335
- };
336
- const getAssetPriceServiceForNetwork = (network) => {
337
- if (isDevnet(network)) return "https://devnet.asset.injective.dev/asset-price/v1";
338
- if (isTestnet(network)) return "https://k8s.testnet.asset.injective.network/asset-price/v1";
339
- return "https://k8s.mainnet.asset.injective.network/asset-price/v1";
340
- };
341
-
342
- //#endregion
343
- export { CW20_CODE_IDS_BY_NETWORK, Network, getAssetPriceServiceForNetwork, getChainInfoForNetwork, getCw20AdapterContractForNetwork, getCw20SwapContractForNetwork, getIncentivesContractForNetwork, getInjNameRegistryContractForNetwork, getInjNameReverseResolverContractForNetwork, getNetworkChainInfo, getNetworkEndpoints, getNetworkInfo, getPeggyGraphQlEndpointForNetwork, isDevnet, isMainnet, isTestnet, isTestnetOrDevnet };
1
+ export * from './network.js';
2
+ export * from './types.js';
3
+ export * from './utils.js';
@@ -0,0 +1,15 @@
1
+ import { Network } from './types.js';
2
+ import type { Network as NetworkType, ChainInfo, NetworkEndpoints } from './types.js';
3
+ export declare const getNetworkEndpoints: (network: Network) => NetworkEndpoints;
4
+ /**
5
+ * @deprecated - use getNetworkChainInfo instead
6
+ * @param network deprecated
7
+ * @returns
8
+ */
9
+ export declare const getChainInfoForNetwork: (network: NetworkType) => ChainInfo;
10
+ export declare const getNetworkChainInfo: (network: Network) => ChainInfo;
11
+ export declare const getNetworkInfo: (network: Network) => ChainInfo & NetworkEndpoints;
12
+ export declare const isMainnet: (network: NetworkType) => boolean;
13
+ export declare const isDevnet: (network: Network) => boolean;
14
+ export declare const isTestnet: (network: Network) => boolean;
15
+ export declare const isTestnetOrDevnet: (network: Network) => boolean;