@octaflowlabs/onchain-sdk 1.3.5 → 1.3.6

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,3 +1,6 @@
1
1
  /** npm imports */
2
2
  import { JsonRpcProvider } from 'ethers';
3
+ /** local imports */
4
+ import { NetworkId } from '../constants/NETWORKS_REGISTRY';
3
5
  export declare const getProvider: (rpcUrl: string, chainId?: number) => JsonRpcProvider | undefined;
6
+ export declare const getDefaultRpc: (networkId: NetworkId) => string;
@@ -1,5 +1,7 @@
1
1
  /** npm imports */
2
2
  import { JsonRpcProvider, Network } from 'ethers';
3
+ /** local imports */
4
+ import { NETWORKS } from '../constants/NETWORKS_REGISTRY';
3
5
  export const getProvider = (rpcUrl, chainId) => {
4
6
  try {
5
7
  if (!chainId)
@@ -11,3 +13,4 @@ export const getProvider = (rpcUrl, chainId) => {
11
13
  console.warn('Could not create provider with chainId, falling back to rpcUrl only:', error);
12
14
  }
13
15
  };
16
+ export const getDefaultRpc = (networkId) => NETWORKS[networkId].rpcUrl;
@@ -1,3 +1,6 @@
1
1
  /** npm imports */
2
2
  import { JsonRpcProvider } from 'ethers';
3
+ /** local imports */
4
+ import { NetworkId } from '../constants/NETWORKS_REGISTRY';
3
5
  export declare const getProvider: (rpcUrl: string, chainId?: number) => JsonRpcProvider | undefined;
6
+ export declare const getDefaultRpc: (networkId: NetworkId) => string;
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProvider = void 0;
3
+ exports.getDefaultRpc = exports.getProvider = void 0;
4
4
  /** npm imports */
5
5
  const ethers_1 = require("ethers");
6
+ /** local imports */
7
+ const NETWORKS_REGISTRY_1 = require("../constants/NETWORKS_REGISTRY");
6
8
  const getProvider = (rpcUrl, chainId) => {
7
9
  try {
8
10
  if (!chainId)
@@ -15,3 +17,5 @@ const getProvider = (rpcUrl, chainId) => {
15
17
  }
16
18
  };
17
19
  exports.getProvider = getProvider;
20
+ const getDefaultRpc = (networkId) => NETWORKS_REGISTRY_1.NETWORKS[networkId].rpcUrl;
21
+ exports.getDefaultRpc = getDefaultRpc;
@@ -1,5 +1,15 @@
1
+ export declare const NETWORK_IDS: {
2
+ readonly ETHEREUM_MAINNET: "ethereum-mainnet";
3
+ readonly BNB_SMART_CHAIN: "bnb-smart-chain";
4
+ readonly POLYGON_MAINNET: "polygon-mainnet";
5
+ readonly ARBITRUM_MAINNET: "arbitrum-mainnet";
6
+ readonly SEPOLIA_ETH: "sepolia-eth";
7
+ };
8
+ export type NetworkId = (typeof NETWORK_IDS)[keyof typeof NETWORK_IDS];
9
+ export type NetworkCategory = 'popular' | 'custom' | 'testnet';
1
10
  export interface NetworkField {
2
- id: string;
11
+ id: NetworkId;
12
+ category: NetworkCategory;
3
13
  name: string;
4
14
  nameForDisplay: string;
5
15
  chainId: number;
@@ -9,8 +19,5 @@ export interface NetworkField {
9
19
  symbol: string;
10
20
  failoverRpcUrl?: string;
11
21
  }
12
- export interface NetworkRegistry {
13
- category: string;
14
- networks: NetworkField[];
15
- }
16
- export declare const NETWORKS_REGISTRY: NetworkRegistry[];
22
+ export declare const NETWORKS: Record<NetworkId, NetworkField>;
23
+ export declare const getNetworksByCategory: (category: NetworkCategory) => NetworkField[];
@@ -1,70 +1,74 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NETWORKS_REGISTRY = void 0;
4
- exports.NETWORKS_REGISTRY = [
5
- {
3
+ exports.getNetworksByCategory = exports.NETWORKS = exports.NETWORK_IDS = void 0;
4
+ exports.NETWORK_IDS = {
5
+ ETHEREUM_MAINNET: 'ethereum-mainnet',
6
+ BNB_SMART_CHAIN: 'bnb-smart-chain',
7
+ POLYGON_MAINNET: 'polygon-mainnet',
8
+ ARBITRUM_MAINNET: 'arbitrum-mainnet',
9
+ SEPOLIA_ETH: 'sepolia-eth',
10
+ };
11
+ exports.NETWORKS = {
12
+ [exports.NETWORK_IDS.ETHEREUM_MAINNET]: {
13
+ id: exports.NETWORK_IDS.ETHEREUM_MAINNET,
6
14
  category: 'popular',
7
- networks: [
8
- {
9
- id: 'ethereum-mainnet',
10
- name: 'eth-mainnet',
11
- nameForDisplay: 'Ethereum Mainnet',
12
- chainId: 1,
13
- rpcUrl: 'https://ethereum-rpc.publicnode.com',
14
- explorerUrl: 'https://etherscan.io',
15
- iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
16
- symbol: 'ETH',
17
- failoverRpcUrl: 'https://eth.llamarpc.com',
18
- },
19
- {
20
- id: 'bnb-smart-chain',
21
- name: 'bnb-mainnet',
22
- nameForDisplay: 'BNB Smart Chain',
23
- chainId: 56,
24
- rpcUrl: 'https://bsc-dataseed.bnbchain.org',
25
- explorerUrl: 'https://bscscan.com/',
26
- iconUrl: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',
27
- symbol: 'BNB',
28
- failoverRpcUrl: 'https://bsc.llamarpc.com',
29
- },
30
- {
31
- id: 'polygon-mainnet',
32
- name: 'polygon-mainnet',
33
- nameForDisplay: 'Polygon Mainnet',
34
- iconUrl: 'https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png',
35
- chainId: 137,
36
- rpcUrl: 'https://polygon.publicnode.com',
37
- explorerUrl: 'https://polygonscan.com',
38
- symbol: 'POL',
39
- failoverRpcUrl: 'https://polygon.llamarpc.com',
40
- },
41
- {
42
- id: 'arbitrum-mainnet',
43
- name: 'arb-mainnet',
44
- nameForDisplay: 'Arbitrum Mainnet',
45
- chainId: 42161,
46
- rpcUrl: 'https://public-arb-mainnet.fastnode.io',
47
- explorerUrl: 'https://arbiscan.io',
48
- iconUrl: 'https://assets.coingecko.com/coins/images/16547/large/photo_2023-03-29_21.47.00.jpeg',
49
- symbol: 'ARB',
50
- failoverRpcUrl: 'https://arb.llamarpc.com',
51
- },
52
- ],
15
+ name: 'eth-mainnet',
16
+ nameForDisplay: 'Ethereum Mainnet',
17
+ chainId: 1,
18
+ rpcUrl: 'https://ethereum-rpc.publicnode.com',
19
+ explorerUrl: 'https://etherscan.io',
20
+ iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
21
+ symbol: 'ETH',
22
+ failoverRpcUrl: 'https://eth.llamarpc.com',
53
23
  },
54
- {
55
- category: 'custom',
56
- networks: [
57
- {
58
- id: 'sepolia-eth',
59
- name: 'eth-sepolia',
60
- nameForDisplay: 'ETH Sepolia Testnet',
61
- chainId: 11155111,
62
- rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',
63
- explorerUrl: 'https://sepolia.etherscan.io',
64
- iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
65
- symbol: 'ETH',
66
- failoverRpcUrl: 'https://eth-sepolia.llamarpc.com',
67
- },
68
- ],
24
+ [exports.NETWORK_IDS.BNB_SMART_CHAIN]: {
25
+ id: exports.NETWORK_IDS.BNB_SMART_CHAIN,
26
+ category: 'popular',
27
+ name: 'bnb-mainnet',
28
+ nameForDisplay: 'BNB Smart Chain',
29
+ chainId: 56,
30
+ rpcUrl: 'https://bsc-dataseed.bnbchain.org',
31
+ explorerUrl: 'https://bscscan.com/',
32
+ iconUrl: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',
33
+ symbol: 'BNB',
34
+ failoverRpcUrl: 'https://bsc.llamarpc.com',
35
+ },
36
+ [exports.NETWORK_IDS.POLYGON_MAINNET]: {
37
+ id: exports.NETWORK_IDS.POLYGON_MAINNET,
38
+ category: 'popular',
39
+ name: 'polygon-mainnet',
40
+ nameForDisplay: 'Polygon Mainnet',
41
+ chainId: 137,
42
+ rpcUrl: 'https://polygon.publicnode.com',
43
+ explorerUrl: 'https://polygonscan.com',
44
+ iconUrl: 'https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png',
45
+ symbol: 'POL',
46
+ failoverRpcUrl: 'https://polygon.llamarpc.com',
47
+ },
48
+ [exports.NETWORK_IDS.ARBITRUM_MAINNET]: {
49
+ id: exports.NETWORK_IDS.ARBITRUM_MAINNET,
50
+ category: 'popular',
51
+ name: 'arb-mainnet',
52
+ nameForDisplay: 'Arbitrum Mainnet',
53
+ chainId: 42161,
54
+ rpcUrl: 'https://public-arb-mainnet.fastnode.io',
55
+ explorerUrl: 'https://arbiscan.io',
56
+ iconUrl: 'https://assets.coingecko.com/coins/images/16547/large/photo_2023-03-29_21.47.00.jpeg',
57
+ symbol: 'ARB',
58
+ failoverRpcUrl: 'https://arb.llamarpc.com',
59
+ },
60
+ [exports.NETWORK_IDS.SEPOLIA_ETH]: {
61
+ id: exports.NETWORK_IDS.SEPOLIA_ETH,
62
+ category: 'testnet',
63
+ name: 'eth-sepolia',
64
+ nameForDisplay: 'ETH Sepolia Testnet',
65
+ chainId: 11155111,
66
+ rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',
67
+ explorerUrl: 'https://sepolia.etherscan.io',
68
+ iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
69
+ symbol: 'ETH',
70
+ failoverRpcUrl: 'https://eth-sepolia.llamarpc.com',
69
71
  },
70
- ];
72
+ };
73
+ const getNetworksByCategory = (category) => Object.values(exports.NETWORKS).filter((n) => n.category === category);
74
+ exports.getNetworksByCategory = getNetworksByCategory;
@@ -3,13 +3,13 @@ import ERC20_TOKEN_CONTRACT_ABI from './ABIs/ERC20_TOKEN_CONTRACT_ABI';
3
3
  export { ERC20_TOKEN_CONTRACT_ABI };
4
4
  /** constants exports */
5
5
  export { GAS_LIMIT_PER_TX_TYPE, MULTICALL3_ADDRESS } from './constants/constants';
6
- export { NETWORKS_REGISTRY, NetworkField, NetworkRegistry } from './constants/NETWORKS_REGISTRY';
6
+ export { NetworkField, NETWORKS, NetworkId, NetworkCategory, getNetworksByCategory, } from './constants/NETWORKS_REGISTRY';
7
7
  export { BASIC_TOKENS_BY_CHAIN, BasicTokenData, BasicTokenSymbol, ChainTokenDataMap, } from './constants/BASIC_TOKENS_REGISTRY';
8
8
  /** basic blockchain exports */
9
9
  export { buildBaseUnsignedTransferTx, buildMaxNativeTransferTx, buildUnsignedTransferTx, } from './blockchain/buildUnsignedTransferTx';
10
10
  export { broadcastTransaction } from './blockchain/broadcastTransaction';
11
11
  export { estimateGasLimitFromProvider } from './blockchain/estimateGasLimitFromProvider';
12
- export { getProvider } from './blockchain/getProvider';
12
+ export { getProvider, getDefaultRpc } from './blockchain/getProvider';
13
13
  export { txStatus } from './blockchain/txStatus';
14
14
  export { getBalance, getBalances } from './blockchain/getBalances';
15
15
  export { estimateTransaction } from './blockchain/estimateTransaction';
package/dist/cjs/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.normalizeAddress = exports.errorMessagesForGasLimitEstimation = exports.errorMessagesForBroadcast = exports.handleErrorMessages = exports.parsedAmount = exports.formattedAmountForDisplay = exports.NATIVE_TOKENS = exports.transformBigInt = exports.getShortenData = exports.getShortenTransactionHashOrAddress = exports.signTransaction = exports.signMessage = exports.createWallet = exports.EvmWalletService = exports.prepareTransaction = exports.estimateTransaction = exports.getBalances = exports.getBalance = exports.txStatus = exports.getProvider = exports.estimateGasLimitFromProvider = exports.broadcastTransaction = exports.buildUnsignedTransferTx = exports.buildMaxNativeTransferTx = exports.buildBaseUnsignedTransferTx = exports.BASIC_TOKENS_BY_CHAIN = exports.NETWORKS_REGISTRY = exports.MULTICALL3_ADDRESS = exports.GAS_LIMIT_PER_TX_TYPE = exports.ERC20_TOKEN_CONTRACT_ABI = void 0;
6
+ exports.normalizeAddress = exports.errorMessagesForGasLimitEstimation = exports.errorMessagesForBroadcast = exports.handleErrorMessages = exports.parsedAmount = exports.formattedAmountForDisplay = exports.NATIVE_TOKENS = exports.transformBigInt = exports.getShortenData = exports.getShortenTransactionHashOrAddress = exports.signTransaction = exports.signMessage = exports.createWallet = exports.EvmWalletService = exports.prepareTransaction = exports.estimateTransaction = exports.getBalances = exports.getBalance = exports.txStatus = exports.getDefaultRpc = exports.getProvider = exports.estimateGasLimitFromProvider = exports.broadcastTransaction = exports.buildUnsignedTransferTx = exports.buildMaxNativeTransferTx = exports.buildBaseUnsignedTransferTx = exports.BASIC_TOKENS_BY_CHAIN = exports.getNetworksByCategory = exports.NETWORKS = exports.MULTICALL3_ADDRESS = exports.GAS_LIMIT_PER_TX_TYPE = exports.ERC20_TOKEN_CONTRACT_ABI = void 0;
7
7
  /** ABIs exports */
8
8
  const ERC20_TOKEN_CONTRACT_ABI_1 = __importDefault(require("./ABIs/ERC20_TOKEN_CONTRACT_ABI"));
9
9
  exports.ERC20_TOKEN_CONTRACT_ABI = ERC20_TOKEN_CONTRACT_ABI_1.default;
@@ -12,7 +12,8 @@ var constants_1 = require("./constants/constants");
12
12
  Object.defineProperty(exports, "GAS_LIMIT_PER_TX_TYPE", { enumerable: true, get: function () { return constants_1.GAS_LIMIT_PER_TX_TYPE; } });
13
13
  Object.defineProperty(exports, "MULTICALL3_ADDRESS", { enumerable: true, get: function () { return constants_1.MULTICALL3_ADDRESS; } });
14
14
  var NETWORKS_REGISTRY_1 = require("./constants/NETWORKS_REGISTRY");
15
- Object.defineProperty(exports, "NETWORKS_REGISTRY", { enumerable: true, get: function () { return NETWORKS_REGISTRY_1.NETWORKS_REGISTRY; } });
15
+ Object.defineProperty(exports, "NETWORKS", { enumerable: true, get: function () { return NETWORKS_REGISTRY_1.NETWORKS; } });
16
+ Object.defineProperty(exports, "getNetworksByCategory", { enumerable: true, get: function () { return NETWORKS_REGISTRY_1.getNetworksByCategory; } });
16
17
  var BASIC_TOKENS_REGISTRY_1 = require("./constants/BASIC_TOKENS_REGISTRY");
17
18
  Object.defineProperty(exports, "BASIC_TOKENS_BY_CHAIN", { enumerable: true, get: function () { return BASIC_TOKENS_REGISTRY_1.BASIC_TOKENS_BY_CHAIN; } });
18
19
  /** basic blockchain exports */
@@ -26,6 +27,7 @@ var estimateGasLimitFromProvider_1 = require("./blockchain/estimateGasLimitFromP
26
27
  Object.defineProperty(exports, "estimateGasLimitFromProvider", { enumerable: true, get: function () { return estimateGasLimitFromProvider_1.estimateGasLimitFromProvider; } });
27
28
  var getProvider_1 = require("./blockchain/getProvider");
28
29
  Object.defineProperty(exports, "getProvider", { enumerable: true, get: function () { return getProvider_1.getProvider; } });
30
+ Object.defineProperty(exports, "getDefaultRpc", { enumerable: true, get: function () { return getProvider_1.getDefaultRpc; } });
29
31
  var txStatus_1 = require("./blockchain/txStatus");
30
32
  Object.defineProperty(exports, "txStatus", { enumerable: true, get: function () { return txStatus_1.txStatus; } });
31
33
  var getBalances_1 = require("./blockchain/getBalances");
@@ -1,5 +1,15 @@
1
+ export declare const NETWORK_IDS: {
2
+ readonly ETHEREUM_MAINNET: "ethereum-mainnet";
3
+ readonly BNB_SMART_CHAIN: "bnb-smart-chain";
4
+ readonly POLYGON_MAINNET: "polygon-mainnet";
5
+ readonly ARBITRUM_MAINNET: "arbitrum-mainnet";
6
+ readonly SEPOLIA_ETH: "sepolia-eth";
7
+ };
8
+ export type NetworkId = (typeof NETWORK_IDS)[keyof typeof NETWORK_IDS];
9
+ export type NetworkCategory = 'popular' | 'custom' | 'testnet';
1
10
  export interface NetworkField {
2
- id: string;
11
+ id: NetworkId;
12
+ category: NetworkCategory;
3
13
  name: string;
4
14
  nameForDisplay: string;
5
15
  chainId: number;
@@ -9,8 +19,5 @@ export interface NetworkField {
9
19
  symbol: string;
10
20
  failoverRpcUrl?: string;
11
21
  }
12
- export interface NetworkRegistry {
13
- category: string;
14
- networks: NetworkField[];
15
- }
16
- export declare const NETWORKS_REGISTRY: NetworkRegistry[];
22
+ export declare const NETWORKS: Record<NetworkId, NetworkField>;
23
+ export declare const getNetworksByCategory: (category: NetworkCategory) => NetworkField[];
@@ -1,67 +1,70 @@
1
- export const NETWORKS_REGISTRY = [
2
- {
1
+ export const NETWORK_IDS = {
2
+ ETHEREUM_MAINNET: 'ethereum-mainnet',
3
+ BNB_SMART_CHAIN: 'bnb-smart-chain',
4
+ POLYGON_MAINNET: 'polygon-mainnet',
5
+ ARBITRUM_MAINNET: 'arbitrum-mainnet',
6
+ SEPOLIA_ETH: 'sepolia-eth',
7
+ };
8
+ export const NETWORKS = {
9
+ [NETWORK_IDS.ETHEREUM_MAINNET]: {
10
+ id: NETWORK_IDS.ETHEREUM_MAINNET,
3
11
  category: 'popular',
4
- networks: [
5
- {
6
- id: 'ethereum-mainnet',
7
- name: 'eth-mainnet',
8
- nameForDisplay: 'Ethereum Mainnet',
9
- chainId: 1,
10
- rpcUrl: 'https://ethereum-rpc.publicnode.com',
11
- explorerUrl: 'https://etherscan.io',
12
- iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
13
- symbol: 'ETH',
14
- failoverRpcUrl: 'https://eth.llamarpc.com',
15
- },
16
- {
17
- id: 'bnb-smart-chain',
18
- name: 'bnb-mainnet',
19
- nameForDisplay: 'BNB Smart Chain',
20
- chainId: 56,
21
- rpcUrl: 'https://bsc-dataseed.bnbchain.org',
22
- explorerUrl: 'https://bscscan.com/',
23
- iconUrl: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',
24
- symbol: 'BNB',
25
- failoverRpcUrl: 'https://bsc.llamarpc.com',
26
- },
27
- {
28
- id: 'polygon-mainnet',
29
- name: 'polygon-mainnet',
30
- nameForDisplay: 'Polygon Mainnet',
31
- iconUrl: 'https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png',
32
- chainId: 137,
33
- rpcUrl: 'https://polygon.publicnode.com',
34
- explorerUrl: 'https://polygonscan.com',
35
- symbol: 'POL',
36
- failoverRpcUrl: 'https://polygon.llamarpc.com',
37
- },
38
- {
39
- id: 'arbitrum-mainnet',
40
- name: 'arb-mainnet',
41
- nameForDisplay: 'Arbitrum Mainnet',
42
- chainId: 42161,
43
- rpcUrl: 'https://public-arb-mainnet.fastnode.io',
44
- explorerUrl: 'https://arbiscan.io',
45
- iconUrl: 'https://assets.coingecko.com/coins/images/16547/large/photo_2023-03-29_21.47.00.jpeg',
46
- symbol: 'ARB',
47
- failoverRpcUrl: 'https://arb.llamarpc.com',
48
- },
49
- ],
12
+ name: 'eth-mainnet',
13
+ nameForDisplay: 'Ethereum Mainnet',
14
+ chainId: 1,
15
+ rpcUrl: 'https://ethereum-rpc.publicnode.com',
16
+ explorerUrl: 'https://etherscan.io',
17
+ iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
18
+ symbol: 'ETH',
19
+ failoverRpcUrl: 'https://eth.llamarpc.com',
50
20
  },
51
- {
52
- category: 'custom',
53
- networks: [
54
- {
55
- id: 'sepolia-eth',
56
- name: 'eth-sepolia',
57
- nameForDisplay: 'ETH Sepolia Testnet',
58
- chainId: 11155111,
59
- rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',
60
- explorerUrl: 'https://sepolia.etherscan.io',
61
- iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
62
- symbol: 'ETH',
63
- failoverRpcUrl: 'https://eth-sepolia.llamarpc.com',
64
- },
65
- ],
21
+ [NETWORK_IDS.BNB_SMART_CHAIN]: {
22
+ id: NETWORK_IDS.BNB_SMART_CHAIN,
23
+ category: 'popular',
24
+ name: 'bnb-mainnet',
25
+ nameForDisplay: 'BNB Smart Chain',
26
+ chainId: 56,
27
+ rpcUrl: 'https://bsc-dataseed.bnbchain.org',
28
+ explorerUrl: 'https://bscscan.com/',
29
+ iconUrl: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',
30
+ symbol: 'BNB',
31
+ failoverRpcUrl: 'https://bsc.llamarpc.com',
32
+ },
33
+ [NETWORK_IDS.POLYGON_MAINNET]: {
34
+ id: NETWORK_IDS.POLYGON_MAINNET,
35
+ category: 'popular',
36
+ name: 'polygon-mainnet',
37
+ nameForDisplay: 'Polygon Mainnet',
38
+ chainId: 137,
39
+ rpcUrl: 'https://polygon.publicnode.com',
40
+ explorerUrl: 'https://polygonscan.com',
41
+ iconUrl: 'https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png',
42
+ symbol: 'POL',
43
+ failoverRpcUrl: 'https://polygon.llamarpc.com',
44
+ },
45
+ [NETWORK_IDS.ARBITRUM_MAINNET]: {
46
+ id: NETWORK_IDS.ARBITRUM_MAINNET,
47
+ category: 'popular',
48
+ name: 'arb-mainnet',
49
+ nameForDisplay: 'Arbitrum Mainnet',
50
+ chainId: 42161,
51
+ rpcUrl: 'https://public-arb-mainnet.fastnode.io',
52
+ explorerUrl: 'https://arbiscan.io',
53
+ iconUrl: 'https://assets.coingecko.com/coins/images/16547/large/photo_2023-03-29_21.47.00.jpeg',
54
+ symbol: 'ARB',
55
+ failoverRpcUrl: 'https://arb.llamarpc.com',
56
+ },
57
+ [NETWORK_IDS.SEPOLIA_ETH]: {
58
+ id: NETWORK_IDS.SEPOLIA_ETH,
59
+ category: 'testnet',
60
+ name: 'eth-sepolia',
61
+ nameForDisplay: 'ETH Sepolia Testnet',
62
+ chainId: 11155111,
63
+ rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com',
64
+ explorerUrl: 'https://sepolia.etherscan.io',
65
+ iconUrl: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
66
+ symbol: 'ETH',
67
+ failoverRpcUrl: 'https://eth-sepolia.llamarpc.com',
66
68
  },
67
- ];
69
+ };
70
+ export const getNetworksByCategory = (category) => Object.values(NETWORKS).filter((n) => n.category === category);
package/dist/index.d.ts CHANGED
@@ -3,13 +3,13 @@ import ERC20_TOKEN_CONTRACT_ABI from './ABIs/ERC20_TOKEN_CONTRACT_ABI';
3
3
  export { ERC20_TOKEN_CONTRACT_ABI };
4
4
  /** constants exports */
5
5
  export { GAS_LIMIT_PER_TX_TYPE, MULTICALL3_ADDRESS } from './constants/constants';
6
- export { NETWORKS_REGISTRY, NetworkField, NetworkRegistry } from './constants/NETWORKS_REGISTRY';
6
+ export { NetworkField, NETWORKS, NetworkId, NetworkCategory, getNetworksByCategory, } from './constants/NETWORKS_REGISTRY';
7
7
  export { BASIC_TOKENS_BY_CHAIN, BasicTokenData, BasicTokenSymbol, ChainTokenDataMap, } from './constants/BASIC_TOKENS_REGISTRY';
8
8
  /** basic blockchain exports */
9
9
  export { buildBaseUnsignedTransferTx, buildMaxNativeTransferTx, buildUnsignedTransferTx, } from './blockchain/buildUnsignedTransferTx';
10
10
  export { broadcastTransaction } from './blockchain/broadcastTransaction';
11
11
  export { estimateGasLimitFromProvider } from './blockchain/estimateGasLimitFromProvider';
12
- export { getProvider } from './blockchain/getProvider';
12
+ export { getProvider, getDefaultRpc } from './blockchain/getProvider';
13
13
  export { txStatus } from './blockchain/txStatus';
14
14
  export { getBalance, getBalances } from './blockchain/getBalances';
15
15
  export { estimateTransaction } from './blockchain/estimateTransaction';
package/dist/index.js CHANGED
@@ -3,13 +3,13 @@ import ERC20_TOKEN_CONTRACT_ABI from './ABIs/ERC20_TOKEN_CONTRACT_ABI';
3
3
  export { ERC20_TOKEN_CONTRACT_ABI };
4
4
  /** constants exports */
5
5
  export { GAS_LIMIT_PER_TX_TYPE, MULTICALL3_ADDRESS } from './constants/constants';
6
- export { NETWORKS_REGISTRY } from './constants/NETWORKS_REGISTRY';
6
+ export { NETWORKS, getNetworksByCategory, } from './constants/NETWORKS_REGISTRY';
7
7
  export { BASIC_TOKENS_BY_CHAIN, } from './constants/BASIC_TOKENS_REGISTRY';
8
8
  /** basic blockchain exports */
9
9
  export { buildBaseUnsignedTransferTx, buildMaxNativeTransferTx, buildUnsignedTransferTx, } from './blockchain/buildUnsignedTransferTx';
10
10
  export { broadcastTransaction } from './blockchain/broadcastTransaction';
11
11
  export { estimateGasLimitFromProvider } from './blockchain/estimateGasLimitFromProvider';
12
- export { getProvider } from './blockchain/getProvider';
12
+ export { getProvider, getDefaultRpc } from './blockchain/getProvider';
13
13
  export { txStatus } from './blockchain/txStatus';
14
14
  export { getBalance, getBalances } from './blockchain/getBalances';
15
15
  export { estimateTransaction } from './blockchain/estimateTransaction';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octaflowlabs/onchain-sdk",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "onchain methods for web3",
5
5
  "repository": "https://github.com/crisramb665/onchain-sdk.git",
6
6
  "license": "MIT",