@injectivelabs/networks 1.16.12 → 1.16.13-alpha.1

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.
package/dist/cjs/utils.js CHANGED
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAssetPriceServiceForNetwork = exports.getPeggyGraphQlEndpointForNetwork = exports.getInjNameReverseResolverContractForNetwork = exports.getInjNameRegistryContractForNetwork = exports.getIncentivesContractForNetwork = exports.getCw20SwapContractForNetwork = exports.getCw20AdapterContractForNetwork = exports.CW20_CODE_IDS_BY_NETWORK = void 0;
4
- const constants_js_1 = require("./constants.js");
5
- const network_js_1 = require("./network.js");
6
4
  const types_js_1 = require("./types.js");
5
+ const network_js_1 = require("./network.js");
7
6
  const CW20_CODE_IDS_BY_NETWORK = (network = types_js_1.Network.Mainnet) => {
8
7
  if ((0, network_js_1.isTestnet)(network)) {
9
8
  return ['25'];
@@ -12,44 +11,81 @@ const CW20_CODE_IDS_BY_NETWORK = (network = types_js_1.Network.Mainnet) => {
12
11
  };
13
12
  exports.CW20_CODE_IDS_BY_NETWORK = CW20_CODE_IDS_BY_NETWORK;
14
13
  const getCw20AdapterContractForNetwork = (network = types_js_1.Network.Mainnet) => {
15
- return constants_js_1.CW20_ADAPTER_CONTRACT_BY_NETWORK[network] !== undefined
16
- ? constants_js_1.CW20_ADAPTER_CONTRACT_BY_NETWORK[network]
17
- : constants_js_1.CW20_ADAPTER_CONTRACT_BY_NETWORK[types_js_1.Network.Mainnet];
14
+ if ((0, network_js_1.isDevnet)(network)) {
15
+ return 'inj1uukt3kqela4vsllvrqnrgllkna5wn3cm588w6k';
16
+ }
17
+ if ((0, network_js_1.isTestnet)(network)) {
18
+ return 'inj1hdvy6tl89llqy3ze8lv6mz5qh66sx9enn0jxg6';
19
+ }
20
+ // mainnet
21
+ return 'inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk';
18
22
  };
19
23
  exports.getCw20AdapterContractForNetwork = getCw20AdapterContractForNetwork;
20
24
  const getCw20SwapContractForNetwork = (network = types_js_1.Network.Mainnet) => {
21
- return constants_js_1.CW20_SWAP_CONTRACT_BY_NETWORK[network] !== undefined
22
- ? constants_js_1.CW20_SWAP_CONTRACT_BY_NETWORK[network]
23
- : constants_js_1.CW20_SWAP_CONTRACT_BY_NETWORK[types_js_1.Network.Mainnet];
25
+ if ((0, network_js_1.isDevnet)(network)) {
26
+ return 'inj177yh38g3ctu7cemxpa3c2kvwh2yslfxfmfa66h';
27
+ }
28
+ if ((0, network_js_1.isTestnet)(network)) {
29
+ return 'inj14d7h5j6ddq6pqppl65z24w7xrtmpcrqjxj8d43';
30
+ }
31
+ if (network === types_js_1.Network.Staging) {
32
+ return 'inj12yj3mtjarujkhcp6lg3klxjjfrx2v7v8yswgp9';
33
+ }
34
+ // mainnet
35
+ return 'inj1psk3468yr9teahgz73amwvpfjehnhczvkrhhqx';
24
36
  };
25
37
  exports.getCw20SwapContractForNetwork = getCw20SwapContractForNetwork;
26
38
  const getIncentivesContractForNetwork = (network = types_js_1.Network.Mainnet) => {
27
- return constants_js_1.INCENTIVES_CONTRACT_BY_NETWORK[network] !== undefined
28
- ? constants_js_1.INCENTIVES_CONTRACT_BY_NETWORK[network]
29
- : constants_js_1.INCENTIVES_CONTRACT_BY_NETWORK[types_js_1.Network.Mainnet];
39
+ if ((0, network_js_1.isDevnet)(network)) {
40
+ return '';
41
+ }
42
+ if ((0, network_js_1.isTestnet)(network)) {
43
+ return 'inj16twru668nsl7tqzahxd9q033swhr6a5xuslpkt';
44
+ }
45
+ // mainnet
46
+ return '';
30
47
  };
31
48
  exports.getIncentivesContractForNetwork = getIncentivesContractForNetwork;
32
49
  const getInjNameRegistryContractForNetwork = (network = types_js_1.Network.Mainnet) => {
33
- return constants_js_1.INJ_NAME_REGISTRY_CONTRACT_BY_NETWORK[network] !== undefined
34
- ? constants_js_1.INJ_NAME_REGISTRY_CONTRACT_BY_NETWORK[network]
35
- : constants_js_1.INJ_NAME_REGISTRY_CONTRACT_BY_NETWORK[types_js_1.Network.Mainnet];
50
+ if ((0, network_js_1.isDevnet)(network)) {
51
+ return 'inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa';
52
+ }
53
+ if ((0, network_js_1.isTestnet)(network)) {
54
+ return 'inj1aw59rkpd9afp2ws6rx23nz5mrvq8dlckeslwfa';
55
+ }
56
+ // mainnet
57
+ return 'inj1hm8vs8sr2h9nk0x66vctfs528wrp6k3gtgg275';
36
58
  };
37
59
  exports.getInjNameRegistryContractForNetwork = getInjNameRegistryContractForNetwork;
38
60
  const getInjNameReverseResolverContractForNetwork = (network = types_js_1.Network.Mainnet) => {
39
- return constants_js_1.INJ_NAME_REVERSE_RESOLVER_CONTRACT_BY_NETWORK[network] !== undefined
40
- ? constants_js_1.INJ_NAME_REVERSE_RESOLVER_CONTRACT_BY_NETWORK[network]
41
- : constants_js_1.INJ_NAME_REVERSE_RESOLVER_CONTRACT_BY_NETWORK[types_js_1.Network.Mainnet];
61
+ if ((0, network_js_1.isDevnet)(network)) {
62
+ return 'inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v';
63
+ }
64
+ if ((0, network_js_1.isTestnet)(network)) {
65
+ return 'inj1knf6puyscuuqqhgqglskfc0k99d4885qw5uv7v';
66
+ }
67
+ return 'inj1x9m0hceug9qylcyrrtwqtytslv2jrph433thgu';
42
68
  };
43
69
  exports.getInjNameReverseResolverContractForNetwork = getInjNameReverseResolverContractForNetwork;
44
70
  const getPeggyGraphQlEndpointForNetwork = (network) => {
45
- return constants_js_1.PEGGY_GRAPH_URL_BY_NETWORK[network] !== undefined
46
- ? constants_js_1.PEGGY_GRAPH_URL_BY_NETWORK[network]
47
- : constants_js_1.PEGGY_GRAPH_URL_BY_NETWORK[types_js_1.Network.Mainnet];
71
+ if ((0, network_js_1.isDevnet)(network)) {
72
+ return 'https://api.thegraph.com/subgraphs/name/injectivelabsdev/injective-peggo-devnet';
73
+ }
74
+ if ((0, network_js_1.isTestnet)(network)) {
75
+ return 'https://api.thegraph.com/subgraphs/name/injectivelabs/injective-peggo-goerli';
76
+ }
77
+ // mainnet
78
+ return 'https://api.thegraph.com/subgraphs/name/injectivelabs/injective-peggo-mainnet';
48
79
  };
49
80
  exports.getPeggyGraphQlEndpointForNetwork = getPeggyGraphQlEndpointForNetwork;
50
81
  const getAssetPriceServiceForNetwork = (network) => {
51
- return constants_js_1.ASSET_PRICE_URL_BY_NETWORK[network] !== undefined
52
- ? constants_js_1.ASSET_PRICE_URL_BY_NETWORK[network]
53
- : constants_js_1.ASSET_PRICE_URL_BY_NETWORK[types_js_1.Network.Mainnet];
82
+ if ((0, network_js_1.isDevnet)(network)) {
83
+ return 'https://devnet.asset.injective.dev/asset-price/v1';
84
+ }
85
+ if ((0, network_js_1.isTestnet)(network)) {
86
+ return 'https://k8s.testnet.asset.injective.network/asset-price/v1';
87
+ }
88
+ // mainnet
89
+ return 'https://k8s.mainnet.asset.injective.network/asset-price/v1';
54
90
  };
55
91
  exports.getAssetPriceServiceForNetwork = getAssetPriceServiceForNetwork;
@@ -1,5 +1,5 @@
1
- import { ChainInfo } from './types.js';
2
- export declare const mainnetChainInfo: ChainInfo;
3
- export declare const testnetChainInfo: ChainInfo;
4
- export declare const devnetChainInfo: ChainInfo;
5
- export declare const localChainInfo: ChainInfo;
1
+ import type { ChainInfo } from './types.js';
2
+ export declare const getMainnetChainInfo: () => ChainInfo;
3
+ export declare const getTestnetChainInfo: () => ChainInfo;
4
+ export declare const getDevnetChainInfo: () => ChainInfo;
5
+ export declare const getLocalChainInfo: () => ChainInfo;
@@ -1,26 +1,26 @@
1
1
  import { ChainId, EvmChainId } from '@injectivelabs/ts-types';
2
2
  const INJ_DENOM = 'inj';
3
- export const mainnetChainInfo = {
3
+ export const getMainnetChainInfo = () => ({
4
4
  feeDenom: INJ_DENOM,
5
5
  chainId: ChainId.Mainnet,
6
6
  evmChainId: EvmChainId.Mainnet,
7
7
  env: 'mainnet',
8
- };
9
- export const testnetChainInfo = {
8
+ });
9
+ export const getTestnetChainInfo = () => ({
10
10
  feeDenom: INJ_DENOM,
11
11
  chainId: ChainId.Testnet,
12
12
  evmChainId: EvmChainId.Sepolia,
13
13
  env: 'testnet',
14
- };
15
- export const devnetChainInfo = {
14
+ });
15
+ export const getDevnetChainInfo = () => ({
16
16
  feeDenom: INJ_DENOM,
17
17
  chainId: ChainId.Devnet,
18
18
  evmChainId: EvmChainId.Sepolia,
19
19
  env: 'devnet',
20
- };
21
- export const localChainInfo = {
20
+ });
21
+ export const getLocalChainInfo = () => ({
22
22
  feeDenom: INJ_DENOM,
23
23
  chainId: ChainId.Mainnet,
24
24
  evmChainId: EvmChainId.Mainnet,
25
25
  env: 'local',
26
- };
26
+ });
@@ -1,32 +1,30 @@
1
- import { NetworkEndpoints } from './types.js';
2
- export declare const endpointsMainnetSentry: NetworkEndpoints;
3
- export declare const endpointsMainnet: NetworkEndpoints;
4
- export declare const endpointsStaging: NetworkEndpoints;
5
- export declare const endpointsInternal: NetworkEndpoints;
6
- export declare const endpointsTestnetSentry: NetworkEndpoints;
7
- export declare const endpointsTestnet: NetworkEndpoints;
8
- export declare const endpointsDevnet: NetworkEndpoints;
9
- export declare const endpointsDevnet1: NetworkEndpoints;
10
- export declare const endpointsDevnet2: NetworkEndpoints;
11
- export declare const endpointsDevnet3: NetworkEndpoints;
12
- export declare const endpointsLocal: NetworkEndpoints;
1
+ import type { NetworkEndpoints } from './types.js';
2
+ export declare const getEndpointsMainnetSentry: () => NetworkEndpoints;
3
+ export declare const getEndpointsStaging: () => NetworkEndpoints;
4
+ export declare const getEndpointsInternal: () => NetworkEndpoints;
5
+ export declare const getEndpointsTestnetSentry: () => NetworkEndpoints;
6
+ export declare const getEndpointsDevnet: () => NetworkEndpoints;
7
+ export declare const getEndpointsDevnet1: () => NetworkEndpoints;
8
+ export declare const getEndpointsDevnet2: () => NetworkEndpoints;
9
+ export declare const getEndpointsDevnet3: () => NetworkEndpoints;
10
+ export declare const getEndpointsLocal: () => NetworkEndpoints;
13
11
  /**
14
12
  * @deprecated use TestnetSentry instead
15
13
  */
16
- export declare const endpointsTestnetOld: NetworkEndpoints;
14
+ export declare const getEndpointsTestnetOld: () => NetworkEndpoints;
17
15
  /**
18
16
  * @deprecated use TestnetSentry instead
19
17
  */
20
- export declare const endpointsTestnetK8s: NetworkEndpoints;
18
+ export declare const getEndpointsTestnetK8s: () => NetworkEndpoints;
21
19
  /**
22
20
  * @deprecated use MainnetSentry instead
23
21
  */
24
- export declare const endpointsMainnetLB: NetworkEndpoints;
22
+ export declare const getEndpointsMainnetLB: () => NetworkEndpoints;
25
23
  /**
26
24
  * @deprecated use MainnetSentry instead
27
25
  */
28
- export declare const endpointsMainnetOld: NetworkEndpoints;
26
+ export declare const getEndpointsMainnetOld: () => NetworkEndpoints;
29
27
  /**
30
28
  * @deprecated use MainnetSentry instead
31
29
  */
32
- export declare const endpointsMainnetK8s: NetworkEndpoints;
30
+ export declare const getEndpointsMainnetK8s: () => NetworkEndpoints;
@@ -1,4 +1,4 @@
1
- export const endpointsMainnetSentry = {
1
+ export const getEndpointsMainnetSentry = () => ({
2
2
  indexer: 'https://sentry.exchange.grpc-web.injective.network',
3
3
  grpc: 'https://sentry.chain.grpc-web.injective.network',
4
4
  rpc: 'https://sentry.tm.injective.network',
@@ -9,11 +9,8 @@ export const endpointsMainnetSentry = {
9
9
  cacheRest: 'https://staging.gateway.grpc-web.injective.network',
10
10
  web3gw: 'https://sentry.exchange.grpc-web.injective.network',
11
11
  chart: 'https://sentry.exchange.grpc-web.injective.network',
12
- };
13
- export const endpointsMainnet = {
14
- ...endpointsMainnetSentry,
15
- };
16
- export const endpointsStaging = {
12
+ });
13
+ export const getEndpointsStaging = () => ({
17
14
  indexer: 'https://staging.api.injective.network',
18
15
  grpc: 'https://staging.grpc.injective.network',
19
16
  rpc: 'https://staging.tm.injective.network',
@@ -24,8 +21,8 @@ export const endpointsStaging = {
24
21
  cacheRest: 'https://staging.gateway.grpc-web.injective.network',
25
22
  web3gw: 'https://staging.api.injective.network',
26
23
  chart: 'https://k8s.mainnet.staging.chart.grpc-web.injective.network',
27
- };
28
- export const endpointsInternal = {
24
+ });
25
+ export const getEndpointsInternal = () => ({
29
26
  indexer: 'https://products.exchange.grpc-web.injective.network',
30
27
  grpc: 'https://products.chain.grpc-web.injective.network',
31
28
  rpc: 'https://products.tm.injective.network',
@@ -36,8 +33,8 @@ export const endpointsInternal = {
36
33
  cacheRest: 'https://staging.gateway.grpc-web.injective.network',
37
34
  web3gw: 'https://products.web3-gateway.injective.network',
38
35
  chart: 'https://products.exchange.grpc-web.injective.network',
39
- };
40
- export const endpointsTestnetSentry = {
36
+ });
37
+ export const getEndpointsTestnetSentry = () => ({
41
38
  indexer: 'https://testnet.sentry.exchange.grpc-web.injective.network',
42
39
  grpc: 'https://testnet.sentry.chain.grpc-web.injective.network',
43
40
  rpc: 'https://testnet.sentry.tm.injective.network',
@@ -48,11 +45,8 @@ export const endpointsTestnetSentry = {
48
45
  cacheRest: 'https://testnet.sentry.exchange.grpc-web.injective.network',
49
46
  web3gw: 'https://testnet.sentry.exchange.grpc-web.injective.network',
50
47
  chart: 'https://k8s.testnet.chart.grpc-web.injective.network',
51
- };
52
- export const endpointsTestnet = {
53
- ...endpointsTestnetSentry,
54
- };
55
- export const endpointsDevnet = {
48
+ });
49
+ export const getEndpointsDevnet = () => ({
56
50
  indexer: 'https://devnet.api.injective.dev',
57
51
  grpc: 'https://devnet.grpc.injective.dev',
58
52
  rpc: 'https://devnet.tm.injective.dev',
@@ -63,8 +57,8 @@ export const endpointsDevnet = {
63
57
  cacheRest: 'https://devnet.api.injective.dev',
64
58
  web3gw: 'https://devnet.api.injective.dev',
65
59
  chart: 'https://devnet.api.injective.dev',
66
- };
67
- export const endpointsDevnet1 = {
60
+ });
61
+ export const getEndpointsDevnet1 = () => ({
68
62
  indexer: 'https://devnet-1.api.injective.dev',
69
63
  grpc: 'https://devnet-1.grpc.injective.dev',
70
64
  rpc: 'https://devnet-1.tm.injective.dev',
@@ -75,8 +69,8 @@ export const endpointsDevnet1 = {
75
69
  cacheRest: 'https://devnet-1.api.injective.dev',
76
70
  web3gw: 'https://devnet-1.api.injective.dev',
77
71
  chart: 'https://devnet-1.api.injective.dev',
78
- };
79
- export const endpointsDevnet2 = {
72
+ });
73
+ export const getEndpointsDevnet2 = () => ({
80
74
  indexer: 'https://devnet-2.api.injective.dev',
81
75
  grpc: 'https://devnet-2.grpc.injective.dev',
82
76
  rpc: 'https://devnet-2.tm.injective.dev',
@@ -87,8 +81,8 @@ export const endpointsDevnet2 = {
87
81
  cacheRest: 'https://devnet-2.api.injective.dev',
88
82
  web3gw: 'https://devnet-2.api.injective.dev',
89
83
  chart: 'https://devnet-2.api.injective.dev',
90
- };
91
- export const endpointsDevnet3 = {
84
+ });
85
+ export const getEndpointsDevnet3 = () => ({
92
86
  indexer: 'https://devnet-3.api.injective.dev',
93
87
  grpc: 'https://devnet-3.grpc.injective.dev',
94
88
  rpc: 'https://devnet-3.tm.injective.dev',
@@ -99,8 +93,8 @@ export const endpointsDevnet3 = {
99
93
  cacheRest: 'https://devnet-3.api.injective.dev',
100
94
  web3gw: 'https://devnet-3.api.injective.dev',
101
95
  chart: 'https://devnet-3.api.injective.dev',
102
- };
103
- export const endpointsLocal = {
96
+ });
97
+ export const getEndpointsLocal = () => ({
104
98
  indexer: 'https://localhost:4444',
105
99
  grpc: 'http://localhost:10337',
106
100
  rpc: 'http://localhost:9092',
@@ -110,11 +104,11 @@ export const endpointsLocal = {
110
104
  cacheGrpc: 'http://localhost:10337',
111
105
  cacheRest: 'https://localhost:4444',
112
106
  web3gw: 'https://localhost:4444',
113
- };
107
+ });
114
108
  /**
115
109
  * @deprecated use TestnetSentry instead
116
110
  */
117
- export const endpointsTestnetOld = {
111
+ export const getEndpointsTestnetOld = () => ({
118
112
  indexer: 'https://testnet.exchange.grpc-web.injective.network',
119
113
  grpc: 'https://testnet.chain.grpc-web.injective.network',
120
114
  rpc: 'https://testnet.tm.injective.network',
@@ -124,11 +118,11 @@ export const endpointsTestnetOld = {
124
118
  web3gw: 'https://testnet.exchange.grpc-web.injective.network',
125
119
  cacheGrpc: 'https://testnet.exchange.grpc-web.injective.network/',
126
120
  cacheRest: 'https://testnet.exchange.grpc-web.injective.network',
127
- };
121
+ });
128
122
  /**
129
123
  * @deprecated use TestnetSentry instead
130
124
  */
131
- export const endpointsTestnetK8s = {
125
+ export const getEndpointsTestnetK8s = () => ({
132
126
  indexer: 'https://k8s.testnet.exchange.grpc-web.injective.network',
133
127
  grpc: 'https://k8s.testnet.chain.grpc-web.injective.network',
134
128
  rpc: 'https://k8s.testnet.tm.injective.network',
@@ -138,11 +132,11 @@ export const endpointsTestnetK8s = {
138
132
  cacheGrpc: 'https://k8s.testnet.gateway.grpc.injective.network',
139
133
  cacheRest: 'https://k8s.testnet.gateway.grpc-web.injective.network',
140
134
  web3gw: 'https://k8s.testnet.exchange.grpc-web.injective.network',
141
- };
135
+ });
142
136
  /**
143
137
  * @deprecated use MainnetSentry instead
144
138
  */
145
- export const endpointsMainnetLB = {
139
+ export const getEndpointsMainnetLB = () => ({
146
140
  indexer: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
147
141
  grpc: 'https://k8s.global.mainnet.chain.grpc-web.injective.network',
148
142
  rpc: 'https://k8s.global.mainnet.tm.injective.network',
@@ -153,11 +147,11 @@ export const endpointsMainnetLB = {
153
147
  cacheRest: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
154
148
  web3gw: 'https://k8s.global.mainnet.exchange.grpc-web.injective.network',
155
149
  chart: 'https://k8s.global.mainnet.chart.grpc-web.injective.network',
156
- };
150
+ });
157
151
  /**
158
152
  * @deprecated use MainnetSentry instead
159
153
  */
160
- export const endpointsMainnetOld = {
154
+ export const getEndpointsMainnetOld = () => ({
161
155
  indexer: 'https://api.injective.network',
162
156
  grpc: 'https://grpc.injective.network',
163
157
  cacheGrpc: 'https://grpc.injective.network',
@@ -167,11 +161,11 @@ export const endpointsMainnetOld = {
167
161
  chronos: 'https://api.injective.network',
168
162
  explorer: 'https://api.injective.network',
169
163
  web3gw: 'https://api.injective.network',
170
- };
164
+ });
171
165
  /**
172
166
  * @deprecated use MainnetSentry instead
173
167
  */
174
- export const endpointsMainnetK8s = {
168
+ export const getEndpointsMainnetK8s = () => ({
175
169
  indexer: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
176
170
  grpc: 'https://k8s.mainnet.chain.grpc-web.injective.network',
177
171
  rpc: 'https://k8s.mainnet.tm.injective.network',
@@ -181,4 +175,4 @@ export const endpointsMainnetK8s = {
181
175
  cacheGrpc: 'https://k8s.mainnet.chain.grpc-web.injective.network',
182
176
  cacheRest: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
183
177
  web3gw: 'https://k8s.mainnet.exchange.grpc-web.injective.network',
184
- };
178
+ });
@@ -1,4 +1,3 @@
1
1
  export * from './network.js';
2
2
  export * from './types.js';
3
3
  export * from './utils.js';
4
- export * from './constants.js';
package/dist/esm/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './network.js';
2
2
  export * from './types.js';
3
3
  export * from './utils.js';
4
- export * from './constants.js';
@@ -1,16 +1,15 @@
1
- import { Network, ChainInfo, NetworkEndpoints } from './types.js';
2
- export declare const networkEndpoints: Record<Network, NetworkEndpoints>;
3
- export declare const chainInfos: Record<Network, ChainInfo>;
1
+ import { Network } from './types.js';
2
+ import type { Network as NetworkType, ChainInfo, NetworkEndpoints } from './types.js';
4
3
  export declare const getNetworkEndpoints: (network: Network) => NetworkEndpoints;
5
4
  /**
6
5
  * @deprecated - use getNetworkChainInfo instead
7
- * @param network de
6
+ * @param network deprecated
8
7
  * @returns
9
8
  */
10
- export declare const getChainInfoForNetwork: (network: Network) => ChainInfo;
9
+ export declare const getChainInfoForNetwork: (network: NetworkType) => ChainInfo;
11
10
  export declare const getNetworkChainInfo: (network: Network) => ChainInfo;
12
11
  export declare const getNetworkInfo: (network: Network) => ChainInfo & NetworkEndpoints;
13
- export declare const isMainnet: (network: Network) => boolean;
12
+ export declare const isMainnet: (network: NetworkType) => boolean;
14
13
  export declare const isDevnet: (network: Network) => boolean;
15
14
  export declare const isTestnet: (network: Network) => boolean;
16
15
  export declare const isTestnetOrDevnet: (network: Network) => boolean;
@@ -1,53 +1,63 @@
1
- import { devnetChainInfo, localChainInfo, mainnetChainInfo, testnetChainInfo, } from './chainInfos.js';
2
- import { endpointsLocal, endpointsDevnet, endpointsTestnet, endpointsMainnet, endpointsStaging, endpointsDevnet1, endpointsDevnet2, endpointsDevnet3, endpointsInternal, endpointsMainnetLB, endpointsTestnetK8s, endpointsTestnetOld, endpointsMainnetK8s, endpointsMainnetOld, endpointsMainnetSentry, endpointsTestnetSentry, } from './endpoints.js';
3
1
  import { Network } from './types.js';
4
- export const networkEndpoints = {
5
- [Network.MainnetLB]: endpointsMainnetLB,
6
- [Network.MainnetK8s]: endpointsMainnetK8s,
7
- [Network.MainnetSentry]: endpointsMainnetSentry,
8
- [Network.MainnetOld]: endpointsMainnetOld,
9
- [Network.Staging]: endpointsStaging,
10
- [Network.Mainnet]: endpointsMainnet,
11
- [Network.Internal]: endpointsInternal,
12
- [Network.Devnet]: endpointsDevnet,
13
- [Network.Devnet1]: endpointsDevnet1,
14
- [Network.Devnet2]: endpointsDevnet2,
15
- [Network.Devnet3]: endpointsDevnet3,
16
- [Network.Testnet]: endpointsTestnet,
17
- [Network.TestnetK8s]: endpointsTestnetK8s,
18
- [Network.TestnetOld]: endpointsTestnetOld,
19
- [Network.TestnetSentry]: endpointsTestnetSentry,
20
- [Network.Local]: endpointsLocal,
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
+ }
21
39
  };
22
- export const chainInfos = {
23
- [Network.MainnetLB]: mainnetChainInfo,
24
- [Network.MainnetK8s]: mainnetChainInfo,
25
- [Network.MainnetSentry]: mainnetChainInfo,
26
- [Network.MainnetOld]: mainnetChainInfo,
27
- [Network.Staging]: mainnetChainInfo,
28
- [Network.Mainnet]: mainnetChainInfo,
29
- [Network.Internal]: mainnetChainInfo,
30
- [Network.Devnet]: devnetChainInfo,
31
- [Network.Devnet1]: devnetChainInfo,
32
- [Network.Devnet2]: devnetChainInfo,
33
- [Network.Devnet3]: devnetChainInfo,
34
- [Network.Testnet]: testnetChainInfo,
35
- [Network.TestnetOld]: testnetChainInfo,
36
- [Network.TestnetK8s]: testnetChainInfo,
37
- [Network.TestnetSentry]: testnetChainInfo,
38
- [Network.Local]: localChainInfo,
39
- };
40
- export const getNetworkEndpoints = (network) => networkEndpoints[network];
41
40
  /**
42
41
  * @deprecated - use getNetworkChainInfo instead
43
- * @param network de
42
+ * @param network deprecated
44
43
  * @returns
45
44
  */
46
- export const getChainInfoForNetwork = (network) => chainInfos[network];
47
- export const getNetworkChainInfo = (network) => chainInfos[network];
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
+ };
48
58
  export const getNetworkInfo = (network) => ({
49
- ...chainInfos[network],
50
- ...networkEndpoints[network],
59
+ ...getNetworkChainInfo(network),
60
+ ...getNetworkEndpoints(network),
51
61
  });
52
62
  export const isMainnet = (network) => [
53
63
  Network.Staging,
@@ -1,22 +1,23 @@
1
- import { ChainId, EvmChainId } from '@injectivelabs/ts-types';
2
- export declare enum Network {
3
- MainnetK8s = "mainnetK8s",
4
- MainnetLB = "mainnetLB",
5
- Mainnet = "mainnet",
6
- MainnetSentry = "mainnetSentry",
7
- MainnetOld = "mainnetOld",
8
- Staging = "staging",
9
- Internal = "internal",// @deprecated
10
- TestnetK8s = "testnetK8s",
11
- TestnetOld = "testnetOld",
12
- TestnetSentry = "testnetSentry",
13
- Testnet = "testnet",
14
- Devnet1 = "devnet1",
15
- Devnet2 = "devnet2",
16
- Devnet3 = "devnet3",
17
- Devnet = "devnet",
18
- Local = "local"
19
- }
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];
20
21
  export type NetworkEndpoints = {
21
22
  indexer: string;
22
23
  grpc: string;
package/dist/esm/types.js CHANGED
@@ -1,19 +1,18 @@
1
- export var Network;
2
- (function (Network) {
3
- Network["MainnetK8s"] = "mainnetK8s";
4
- Network["MainnetLB"] = "mainnetLB";
5
- Network["Mainnet"] = "mainnet";
6
- Network["MainnetSentry"] = "mainnetSentry";
7
- Network["MainnetOld"] = "mainnetOld";
8
- Network["Staging"] = "staging";
9
- Network["Internal"] = "internal";
10
- Network["TestnetK8s"] = "testnetK8s";
11
- Network["TestnetOld"] = "testnetOld";
12
- Network["TestnetSentry"] = "testnetSentry";
13
- Network["Testnet"] = "testnet";
14
- Network["Devnet1"] = "devnet1";
15
- Network["Devnet2"] = "devnet2";
16
- Network["Devnet3"] = "devnet3";
17
- Network["Devnet"] = "devnet";
18
- Network["Local"] = "local";
19
- })(Network || (Network = {}));
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 +1,9 @@
1
1
  import { Network } from './types.js';
2
2
  export declare const CW20_CODE_IDS_BY_NETWORK: (network?: Network) => string[];
3
- export declare const getCw20AdapterContractForNetwork: (network?: Network) => string;
4
- export declare const getCw20SwapContractForNetwork: (network?: Network) => string;
5
- export declare const getIncentivesContractForNetwork: (network?: Network) => string;
6
- export declare const getInjNameRegistryContractForNetwork: (network?: Network) => string;
7
- export declare const getInjNameReverseResolverContractForNetwork: (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
8
  export declare const getPeggyGraphQlEndpointForNetwork: (network: Network) => string;
9
9
  export declare const getAssetPriceServiceForNetwork: (network: Network) => string;