@injectivelabs/networks 1.16.38 → 1.17.2-alpha.0

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.
@@ -1,178 +0,0 @@
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,15 +0,0 @@
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;
@@ -1,84 +0,0 @@
1
- import { Network } from './types.js';
2
- import { getLocalChainInfo, getDevnetChainInfo, getMainnetChainInfo, getTestnetChainInfo, } from './chainInfos.js';
3
- import { getEndpointsLocal, getEndpointsDevnet, getEndpointsStaging, getEndpointsDevnet1, getEndpointsDevnet2, getEndpointsDevnet3, getEndpointsInternal, getEndpointsMainnetLB, getEndpointsTestnetOld, getEndpointsTestnetK8s, getEndpointsMainnetOld, getEndpointsMainnetK8s, getEndpointsTestnetSentry, getEndpointsMainnetSentry, } from './endpoints.js';
4
- export const getNetworkEndpoints = (network) => {
5
- switch (network) {
6
- case Network.MainnetLB:
7
- return getEndpointsMainnetLB();
8
- case Network.MainnetK8s:
9
- return getEndpointsMainnetK8s();
10
- case Network.MainnetSentry:
11
- case Network.Mainnet:
12
- return getEndpointsMainnetSentry();
13
- case Network.MainnetOld:
14
- return getEndpointsMainnetOld();
15
- case Network.Staging:
16
- return getEndpointsStaging();
17
- case Network.Internal:
18
- return getEndpointsInternal();
19
- case Network.Devnet:
20
- return getEndpointsDevnet();
21
- case Network.Devnet1:
22
- return getEndpointsDevnet1();
23
- case Network.Devnet2:
24
- return getEndpointsDevnet2();
25
- case Network.Devnet3:
26
- return getEndpointsDevnet3();
27
- case Network.TestnetK8s:
28
- return getEndpointsTestnetK8s();
29
- case Network.TestnetOld:
30
- return getEndpointsTestnetOld();
31
- case Network.TestnetSentry:
32
- case Network.Testnet:
33
- return getEndpointsTestnetSentry();
34
- case Network.Local:
35
- return getEndpointsLocal();
36
- default:
37
- throw new Error(`Unknown network: ${network}`);
38
- }
39
- };
40
- /**
41
- * @deprecated - use getNetworkChainInfo instead
42
- * @param network deprecated
43
- * @returns
44
- */
45
- export const getChainInfoForNetwork = (network) => getNetworkChainInfo(network);
46
- export const getNetworkChainInfo = (network) => {
47
- if (network === Network.Local) {
48
- return getLocalChainInfo();
49
- }
50
- if (isTestnet(network)) {
51
- return getTestnetChainInfo();
52
- }
53
- if (isDevnet(network)) {
54
- return getDevnetChainInfo();
55
- }
56
- return getMainnetChainInfo();
57
- };
58
- export const getNetworkInfo = (network) => ({
59
- ...getNetworkChainInfo(network),
60
- ...getNetworkEndpoints(network),
61
- });
62
- export const isMainnet = (network) => [
63
- Network.Staging,
64
- Network.Mainnet,
65
- Network.MainnetOld,
66
- Network.MainnetK8s,
67
- Network.MainnetSentry,
68
- Network.Internal,
69
- Network.MainnetLB,
70
- ].includes(network);
71
- export const isDevnet = (network) => [
72
- Network.Devnet,
73
- Network.Devnet1,
74
- Network.Devnet2,
75
- Network.Devnet3,
76
- Network.Local,
77
- ].includes(network);
78
- export const isTestnet = (network) => [
79
- Network.Testnet,
80
- Network.TestnetOld,
81
- Network.TestnetK8s,
82
- Network.TestnetSentry,
83
- ].includes(network);
84
- export const isTestnetOrDevnet = (network) => isDevnet(network) || isTestnet(network);
@@ -1,39 +0,0 @@
1
- import type { ChainId, EvmChainId } from '@injectivelabs/ts-types';
2
- export declare const Network: {
3
- readonly MainnetK8s: "mainnetK8s";
4
- readonly MainnetLB: "mainnetLB";
5
- readonly Mainnet: "mainnet";
6
- readonly MainnetSentry: "mainnetSentry";
7
- readonly MainnetOld: "mainnetOld";
8
- readonly Staging: "staging";
9
- readonly Internal: "internal";
10
- readonly TestnetK8s: "testnetK8s";
11
- readonly TestnetOld: "testnetOld";
12
- readonly TestnetSentry: "testnetSentry";
13
- readonly Testnet: "testnet";
14
- readonly Devnet1: "devnet1";
15
- readonly Devnet2: "devnet2";
16
- readonly Devnet3: "devnet3";
17
- readonly Devnet: "devnet";
18
- readonly Local: "local";
19
- };
20
- export type Network = (typeof Network)[keyof typeof Network];
21
- export type NetworkEndpoints = {
22
- indexer: string;
23
- grpc: string;
24
- rest: string;
25
- rpc?: string;
26
- cacheGrpc?: string;
27
- cacheRest?: string;
28
- chronos?: string;
29
- web3gw?: string;
30
- explorer?: string;
31
- chart?: string;
32
- };
33
- export type UrlEndpoints = NetworkEndpoints; /** Deprecated */
34
- export type ChainInfo = {
35
- feeDenom: string;
36
- chainId: ChainId;
37
- env: string;
38
- evmChainId?: EvmChainId;
39
- };
package/dist/esm/types.js DELETED
@@ -1,18 +0,0 @@
1
- export const Network = {
2
- MainnetK8s: 'mainnetK8s',
3
- MainnetLB: 'mainnetLB',
4
- Mainnet: 'mainnet',
5
- MainnetSentry: 'mainnetSentry',
6
- MainnetOld: 'mainnetOld',
7
- Staging: 'staging',
8
- Internal: 'internal', // @deprecated
9
- TestnetK8s: 'testnetK8s',
10
- TestnetOld: 'testnetOld',
11
- TestnetSentry: 'testnetSentry',
12
- Testnet: 'testnet',
13
- Devnet1: 'devnet1',
14
- Devnet2: 'devnet2',
15
- Devnet3: 'devnet3',
16
- Devnet: 'devnet',
17
- Local: 'local',
18
- };
@@ -1,9 +0,0 @@
1
- import { Network } from './types.js';
2
- export declare const CW20_CODE_IDS_BY_NETWORK: (network?: Network) => string[];
3
- export declare const getCw20AdapterContractForNetwork: (network?: Network) => "inj1uukt3kqela4vsllvrqnrgllkna5wn3cm588w6k" | "inj1hdvy6tl89llqy3ze8lv6mz5qh66sx9enn0jxg6" | "inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk";
4
- export declare const getCw20SwapContractForNetwork: (network?: Network) => "inj177yh38g3ctu7cemxpa3c2kvwh2yslfxfmfa66h" | "inj14d7h5j6ddq6pqppl65z24w7xrtmpcrqjxj8d43" | "inj12yj3mtjarujkhcp6lg3klxjjfrx2v7v8yswgp9" | "inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx";
5
- export declare const getIncentivesContractForNetwork: (network?: Network) => "" | "inj16twru668nsl7tqzahxd9q033swhr6a5xuslpkt";
6
- export declare const getInjNameRegistryContractForNetwork: (network?: Network) => "inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa" | "inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275";
7
- export declare const getInjNameReverseResolverContractForNetwork: (network?: Network) => "inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v" | "inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu";
8
- export declare const getPeggyGraphQlEndpointForNetwork: (network: Network) => string;
9
- export declare const getAssetPriceServiceForNetwork: (network: Network) => string;
package/dist/esm/utils.js DELETED
@@ -1,80 +0,0 @@
1
- import { Network } from './types.js';
2
- import { isTestnet, isDevnet } from './network.js';
3
- export const CW20_CODE_IDS_BY_NETWORK = (network = Network.Mainnet) => {
4
- if (isTestnet(network)) {
5
- return ['25'];
6
- }
7
- return ['28', '5', '42'];
8
- };
9
- export const getCw20AdapterContractForNetwork = (network = Network.Mainnet) => {
10
- if (isDevnet(network)) {
11
- return 'inj1uukt3kqela4vsllvrqnrgllkna5wn3cm588w6k';
12
- }
13
- if (isTestnet(network)) {
14
- return 'inj1hdvy6tl89llqy3ze8lv6mz5qh66sx9enn0jxg6';
15
- }
16
- // mainnet
17
- return 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk';
18
- };
19
- export const getCw20SwapContractForNetwork = (network = Network.Mainnet) => {
20
- if (isDevnet(network)) {
21
- return 'inj177yh38g3ctu7cemxpa3c2kvwh2yslfxfmfa66h';
22
- }
23
- if (isTestnet(network)) {
24
- return 'inj14d7h5j6ddq6pqppl65z24w7xrtmpcrqjxj8d43';
25
- }
26
- if (network === Network.Staging) {
27
- return 'inj12yj3mtjarujkhcp6lg3klxjjfrx2v7v8yswgp9';
28
- }
29
- // mainnet
30
- return 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx';
31
- };
32
- export const getIncentivesContractForNetwork = (network = Network.Mainnet) => {
33
- if (isDevnet(network)) {
34
- return '';
35
- }
36
- if (isTestnet(network)) {
37
- return 'inj16twru668nsl7tqzahxd9q033swhr6a5xuslpkt';
38
- }
39
- // mainnet
40
- return '';
41
- };
42
- export const getInjNameRegistryContractForNetwork = (network = Network.Mainnet) => {
43
- if (isDevnet(network)) {
44
- return 'inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa';
45
- }
46
- if (isTestnet(network)) {
47
- return 'inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa';
48
- }
49
- // mainnet
50
- return 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275';
51
- };
52
- export const getInjNameReverseResolverContractForNetwork = (network = Network.Mainnet) => {
53
- if (isDevnet(network)) {
54
- return 'inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v';
55
- }
56
- if (isTestnet(network)) {
57
- return 'inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v';
58
- }
59
- return 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu';
60
- };
61
- export const getPeggyGraphQlEndpointForNetwork = (network) => {
62
- if (isDevnet(network)) {
63
- return 'https://api.thegraph.com/subgraphs/name/injectivelabsdev/injective-peggo-devnet';
64
- }
65
- if (isTestnet(network)) {
66
- return 'https://api.thegraph.com/subgraphs/name/injectivelabs/injective-peggo-goerli';
67
- }
68
- // mainnet
69
- return 'https://api.thegraph.com/subgraphs/name/injectivelabs/injective-peggo-mainnet';
70
- };
71
- export const getAssetPriceServiceForNetwork = (network) => {
72
- if (isDevnet(network)) {
73
- return 'https://devnet.asset.injective.dev/asset-price/v1';
74
- }
75
- if (isTestnet(network)) {
76
- return 'https://k8s.testnet.asset.injective.network/asset-price/v1';
77
- }
78
- // mainnet
79
- return 'https://k8s.mainnet.asset.injective.network/asset-price/v1';
80
- };