@0xtorch/evm 0.0.96 → 0.0.97

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.
Files changed (176) hide show
  1. package/_cjs/chain/definitions/arbitrumOne.js +2 -1
  2. package/_cjs/chain/definitions/arbitrumOne.js.map +1 -1
  3. package/_cjs/chain/definitions/astar.js +3 -1
  4. package/_cjs/chain/definitions/astar.js.map +1 -1
  5. package/_cjs/chain/definitions/astarZkEvm.js +3 -1
  6. package/_cjs/chain/definitions/astarZkEvm.js.map +1 -1
  7. package/_cjs/chain/definitions/avalancheC.js +2 -1
  8. package/_cjs/chain/definitions/avalancheC.js.map +1 -1
  9. package/_cjs/chain/definitions/base.js +2 -1
  10. package/_cjs/chain/definitions/base.js.map +1 -1
  11. package/_cjs/chain/definitions/blast.js +2 -1
  12. package/_cjs/chain/definitions/blast.js.map +1 -1
  13. package/_cjs/chain/definitions/bsc.js +2 -1
  14. package/_cjs/chain/definitions/bsc.js.map +1 -1
  15. package/_cjs/chain/definitions/ethereum.js +2 -1
  16. package/_cjs/chain/definitions/ethereum.js.map +1 -1
  17. package/_cjs/chain/definitions/fantom.js +2 -1
  18. package/_cjs/chain/definitions/fantom.js.map +1 -1
  19. package/_cjs/chain/definitions/linea.js +2 -1
  20. package/_cjs/chain/definitions/linea.js.map +1 -1
  21. package/_cjs/chain/definitions/mantaPacific.js +3 -1
  22. package/_cjs/chain/definitions/mantaPacific.js.map +1 -1
  23. package/_cjs/chain/definitions/mantle.js +2 -1
  24. package/_cjs/chain/definitions/mantle.js.map +1 -1
  25. package/_cjs/chain/definitions/metis.js +3 -1
  26. package/_cjs/chain/definitions/metis.js.map +1 -1
  27. package/_cjs/chain/definitions/moonbeam.js +2 -1
  28. package/_cjs/chain/definitions/moonbeam.js.map +1 -1
  29. package/_cjs/chain/definitions/moonriver.js +2 -1
  30. package/_cjs/chain/definitions/moonriver.js.map +1 -1
  31. package/_cjs/chain/definitions/oasys.js +3 -1
  32. package/_cjs/chain/definitions/oasys.js.map +1 -1
  33. package/_cjs/chain/definitions/optimism.js +2 -1
  34. package/_cjs/chain/definitions/optimism.js.map +1 -1
  35. package/_cjs/chain/definitions/polygonPos.js +2 -1
  36. package/_cjs/chain/definitions/polygonPos.js.map +1 -1
  37. package/_cjs/chain/definitions/scroll.js +2 -1
  38. package/_cjs/chain/definitions/scroll.js.map +1 -1
  39. package/_cjs/chain/definitions/zkFair.js +3 -1
  40. package/_cjs/chain/definitions/zkFair.js.map +1 -1
  41. package/_cjs/chain/definitions/zkSyncEra.js +2 -1
  42. package/_cjs/chain/definitions/zkSyncEra.js.map +1 -1
  43. package/_cjs/chain/definitions/zora.js +3 -1
  44. package/_cjs/chain/definitions/zora.js.map +1 -1
  45. package/_cjs/explorer/blockscout/client.js +9 -2
  46. package/_cjs/explorer/blockscout/client.js.map +1 -1
  47. package/_cjs/explorer/blockscout/create.js +2 -2
  48. package/_cjs/explorer/blockscout/create.js.map +1 -1
  49. package/_cjs/explorer/etherscan/create.js +11 -9
  50. package/_cjs/explorer/etherscan/create.js.map +1 -1
  51. package/_esm/chain/definitions/arbitrumOne.js +2 -1
  52. package/_esm/chain/definitions/arbitrumOne.js.map +1 -1
  53. package/_esm/chain/definitions/astar.js +3 -1
  54. package/_esm/chain/definitions/astar.js.map +1 -1
  55. package/_esm/chain/definitions/astarZkEvm.js +3 -1
  56. package/_esm/chain/definitions/astarZkEvm.js.map +1 -1
  57. package/_esm/chain/definitions/avalancheC.js +2 -1
  58. package/_esm/chain/definitions/avalancheC.js.map +1 -1
  59. package/_esm/chain/definitions/base.js +2 -1
  60. package/_esm/chain/definitions/base.js.map +1 -1
  61. package/_esm/chain/definitions/blast.js +2 -1
  62. package/_esm/chain/definitions/blast.js.map +1 -1
  63. package/_esm/chain/definitions/bsc.js +2 -1
  64. package/_esm/chain/definitions/bsc.js.map +1 -1
  65. package/_esm/chain/definitions/ethereum.js +2 -1
  66. package/_esm/chain/definitions/ethereum.js.map +1 -1
  67. package/_esm/chain/definitions/fantom.js +2 -1
  68. package/_esm/chain/definitions/fantom.js.map +1 -1
  69. package/_esm/chain/definitions/linea.js +2 -1
  70. package/_esm/chain/definitions/linea.js.map +1 -1
  71. package/_esm/chain/definitions/mantaPacific.js +3 -1
  72. package/_esm/chain/definitions/mantaPacific.js.map +1 -1
  73. package/_esm/chain/definitions/mantle.js +2 -1
  74. package/_esm/chain/definitions/mantle.js.map +1 -1
  75. package/_esm/chain/definitions/metis.js +3 -1
  76. package/_esm/chain/definitions/metis.js.map +1 -1
  77. package/_esm/chain/definitions/moonbeam.js +2 -1
  78. package/_esm/chain/definitions/moonbeam.js.map +1 -1
  79. package/_esm/chain/definitions/moonriver.js +2 -1
  80. package/_esm/chain/definitions/moonriver.js.map +1 -1
  81. package/_esm/chain/definitions/oasys.js +3 -1
  82. package/_esm/chain/definitions/oasys.js.map +1 -1
  83. package/_esm/chain/definitions/optimism.js +2 -1
  84. package/_esm/chain/definitions/optimism.js.map +1 -1
  85. package/_esm/chain/definitions/polygonPos.js +2 -1
  86. package/_esm/chain/definitions/polygonPos.js.map +1 -1
  87. package/_esm/chain/definitions/scroll.js +2 -1
  88. package/_esm/chain/definitions/scroll.js.map +1 -1
  89. package/_esm/chain/definitions/zkFair.js +3 -1
  90. package/_esm/chain/definitions/zkFair.js.map +1 -1
  91. package/_esm/chain/definitions/zkSyncEra.js +2 -1
  92. package/_esm/chain/definitions/zkSyncEra.js.map +1 -1
  93. package/_esm/chain/definitions/zora.js +3 -1
  94. package/_esm/chain/definitions/zora.js.map +1 -1
  95. package/_esm/explorer/blockscout/client.js +9 -2
  96. package/_esm/explorer/blockscout/client.js.map +1 -1
  97. package/_esm/explorer/blockscout/create.js +2 -2
  98. package/_esm/explorer/blockscout/create.js.map +1 -1
  99. package/_esm/explorer/etherscan/create.js +11 -9
  100. package/_esm/explorer/etherscan/create.js.map +1 -1
  101. package/_types/chain/definitions/arbitrumOne.d.ts +2 -1
  102. package/_types/chain/definitions/arbitrumOne.d.ts.map +1 -1
  103. package/_types/chain/definitions/astar.d.ts +4 -1
  104. package/_types/chain/definitions/astar.d.ts.map +1 -1
  105. package/_types/chain/definitions/astarZkEvm.d.ts +4 -1
  106. package/_types/chain/definitions/astarZkEvm.d.ts.map +1 -1
  107. package/_types/chain/definitions/avalancheC.d.ts +2 -1
  108. package/_types/chain/definitions/avalancheC.d.ts.map +1 -1
  109. package/_types/chain/definitions/base.d.ts +2 -1
  110. package/_types/chain/definitions/base.d.ts.map +1 -1
  111. package/_types/chain/definitions/blast.d.ts +2 -1
  112. package/_types/chain/definitions/blast.d.ts.map +1 -1
  113. package/_types/chain/definitions/bsc.d.ts +2 -1
  114. package/_types/chain/definitions/bsc.d.ts.map +1 -1
  115. package/_types/chain/definitions/ethereum.d.ts +2 -1
  116. package/_types/chain/definitions/ethereum.d.ts.map +1 -1
  117. package/_types/chain/definitions/fantom.d.ts +2 -1
  118. package/_types/chain/definitions/fantom.d.ts.map +1 -1
  119. package/_types/chain/definitions/linea.d.ts +2 -1
  120. package/_types/chain/definitions/linea.d.ts.map +1 -1
  121. package/_types/chain/definitions/mantaPacific.d.ts +4 -1
  122. package/_types/chain/definitions/mantaPacific.d.ts.map +1 -1
  123. package/_types/chain/definitions/mantle.d.ts +2 -1
  124. package/_types/chain/definitions/mantle.d.ts.map +1 -1
  125. package/_types/chain/definitions/metis.d.ts +4 -1
  126. package/_types/chain/definitions/metis.d.ts.map +1 -1
  127. package/_types/chain/definitions/moonbeam.d.ts +2 -1
  128. package/_types/chain/definitions/moonbeam.d.ts.map +1 -1
  129. package/_types/chain/definitions/moonriver.d.ts +2 -1
  130. package/_types/chain/definitions/moonriver.d.ts.map +1 -1
  131. package/_types/chain/definitions/oasys.d.ts +4 -1
  132. package/_types/chain/definitions/oasys.d.ts.map +1 -1
  133. package/_types/chain/definitions/optimism.d.ts +2 -1
  134. package/_types/chain/definitions/optimism.d.ts.map +1 -1
  135. package/_types/chain/definitions/polygonPos.d.ts +2 -1
  136. package/_types/chain/definitions/polygonPos.d.ts.map +1 -1
  137. package/_types/chain/definitions/scroll.d.ts +2 -1
  138. package/_types/chain/definitions/scroll.d.ts.map +1 -1
  139. package/_types/chain/definitions/zkFair.d.ts +4 -1
  140. package/_types/chain/definitions/zkFair.d.ts.map +1 -1
  141. package/_types/chain/definitions/zkSyncEra.d.ts +2 -1
  142. package/_types/chain/definitions/zkSyncEra.d.ts.map +1 -1
  143. package/_types/chain/definitions/zora.d.ts +4 -1
  144. package/_types/chain/definitions/zora.d.ts.map +1 -1
  145. package/_types/explorer/blockscout/client.d.ts +7 -1
  146. package/_types/explorer/blockscout/client.d.ts.map +1 -1
  147. package/_types/explorer/blockscout/create.d.ts +3 -1
  148. package/_types/explorer/blockscout/create.d.ts.map +1 -1
  149. package/_types/explorer/etherscan/create.d.ts +2 -1
  150. package/_types/explorer/etherscan/create.d.ts.map +1 -1
  151. package/chain/definitions/arbitrumOne.ts +3 -0
  152. package/chain/definitions/astar.ts +9 -1
  153. package/chain/definitions/astarZkEvm.ts +9 -1
  154. package/chain/definitions/avalancheC.ts +3 -0
  155. package/chain/definitions/base.ts +3 -0
  156. package/chain/definitions/blast.ts +3 -0
  157. package/chain/definitions/bsc.ts +3 -0
  158. package/chain/definitions/ethereum.ts +3 -0
  159. package/chain/definitions/fantom.ts +3 -0
  160. package/chain/definitions/linea.ts +3 -0
  161. package/chain/definitions/mantaPacific.ts +9 -1
  162. package/chain/definitions/mantle.ts +3 -0
  163. package/chain/definitions/metis.ts +9 -1
  164. package/chain/definitions/moonbeam.ts +3 -0
  165. package/chain/definitions/moonriver.ts +3 -0
  166. package/chain/definitions/oasys.ts +9 -1
  167. package/chain/definitions/optimism.ts +3 -0
  168. package/chain/definitions/polygonPos.ts +3 -0
  169. package/chain/definitions/scroll.ts +3 -0
  170. package/chain/definitions/zkFair.ts +9 -1
  171. package/chain/definitions/zkSyncEra.ts +3 -0
  172. package/chain/definitions/zora.ts +9 -1
  173. package/explorer/blockscout/client.ts +24 -7
  174. package/explorer/blockscout/create.ts +5 -1
  175. package/explorer/etherscan/create.ts +12 -8
  176. package/package.json +1 -1
@@ -11,7 +11,13 @@ type CreateAstarChainParameters = {
11
11
  explorer: Explorer
12
12
  }
13
13
 
14
- export const createAstarChain = (): Chain =>
14
+ export const createAstarChain = ({
15
+ explorerProxyUrl: proxyUrl,
16
+ explorerHeaders: headers,
17
+ }: {
18
+ explorerProxyUrl?: string
19
+ explorerHeaders?: Record<string, string>
20
+ }): Chain =>
15
21
  createAstarChainCustom({
16
22
  client: createClient({
17
23
  chain: viemAstar,
@@ -21,6 +27,8 @@ export const createAstarChain = (): Chain =>
21
27
  name: 'Astar explorer',
22
28
  baseUrl: 'https://astar.blockscout.com',
23
29
  apiBaseUrl: 'https://astar.blockscout.com/api',
30
+ proxyUrl,
31
+ headers,
24
32
  }),
25
33
  })
26
34
 
@@ -11,7 +11,13 @@ type CreateAstarZkEvmChainParameters = {
11
11
  explorer: Explorer
12
12
  }
13
13
 
14
- export const createAstarZkEvmChain = (): Chain =>
14
+ export const createAstarZkEvmChain = ({
15
+ explorerProxyUrl: proxyUrl,
16
+ explorerHeaders: headers,
17
+ }: {
18
+ explorerProxyUrl?: string
19
+ explorerHeaders?: Record<string, string>
20
+ }): Chain =>
15
21
  createAstarZkEvmChainCustom({
16
22
  client: createClient({
17
23
  chain: astarZkEVM,
@@ -21,6 +27,8 @@ export const createAstarZkEvmChain = (): Chain =>
21
27
  name: 'Astar zkEVM explorer',
22
28
  baseUrl: 'https://astar-zkevm.explorer.startale.com',
23
29
  apiBaseUrl: 'https://astar-zkevm.explorer.startale.com/api',
30
+ proxyUrl,
31
+ headers,
24
32
  }),
25
33
  })
26
34
 
@@ -10,10 +10,12 @@ export const createAvalancheCChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }): Chain =>
18
20
  createAvalancheCChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createAvalancheCChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createBaseChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }): Chain =>
18
20
  createBaseChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createBaseChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createBlastChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }): Chain =>
18
20
  createBlastChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createBlastChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createBscChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }): Chain =>
18
20
  createBscChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createBscChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createEthereumChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }): Chain =>
18
20
  createEthereumChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createEthereumChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createFantomChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }): Chain =>
18
20
  createFantomChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createFantomChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createLineaChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }): Chain =>
18
20
  createLineaChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createLineaChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -6,7 +6,13 @@ import { createBlockscout } from '../../explorer'
6
6
  import type { Chain } from '../types/chain'
7
7
  import type { HttpRpc } from '../types/rpc'
8
8
 
9
- export const createMantaPacificChain = () =>
9
+ export const createMantaPacificChain = ({
10
+ explorerProxyUrl: proxyUrl,
11
+ explorerHeaders: headers,
12
+ }: {
13
+ explorerProxyUrl?: string
14
+ explorerHeaders?: Record<string, string>
15
+ }) =>
10
16
  createMantaPacificChainCustom({
11
17
  client: createClient({
12
18
  chain: viemManta,
@@ -16,6 +22,8 @@ export const createMantaPacificChain = () =>
16
22
  name: 'Manta Pacific explorer',
17
23
  baseUrl: 'https://pacific-explorer.manta.network',
18
24
  apiBaseUrl: 'https://pacific-explorer.manta.network/api',
25
+ proxyUrl,
26
+ headers,
19
27
  }),
20
28
  })
21
29
 
@@ -9,10 +9,12 @@ export const createMantleChain = ({
9
9
  explorerApiKey: apiKey,
10
10
  explorerProxyUrl: proxyUrl,
11
11
  explorerHeaders: headers,
12
+ explorerPageSize: pageSize,
12
13
  }: {
13
14
  explorerApiKey?: string
14
15
  explorerProxyUrl?: string
15
16
  explorerHeaders?: Record<string, string>
17
+ explorerPageSize?: number
16
18
  }): Chain =>
17
19
  createMantleChainCustom({
18
20
  client: createClient({
@@ -26,6 +28,7 @@ export const createMantleChain = ({
26
28
  apiKey,
27
29
  proxyUrl,
28
30
  headers,
31
+ pageSize,
29
32
  }),
30
33
  })
31
34
 
@@ -5,7 +5,13 @@ import { type Explorer, createBlockscout } from '../../explorer'
5
5
  import type { Chain } from '../types/chain'
6
6
  import type { HttpRpc } from '../types/rpc'
7
7
 
8
- export const createMetisChain = () =>
8
+ export const createMetisChain = ({
9
+ explorerProxyUrl: proxyUrl,
10
+ explorerHeaders: headers,
11
+ }: {
12
+ explorerProxyUrl?: string
13
+ explorerHeaders?: Record<string, string>
14
+ }) =>
9
15
  createMetisChainCustom({
10
16
  client: createClient({
11
17
  chain: viemMetis,
@@ -15,6 +21,8 @@ export const createMetisChain = () =>
15
21
  name: 'Metis Andromeda explorer',
16
22
  baseUrl: 'https://andromeda-explorer.metis.io',
17
23
  apiBaseUrl: 'https://andromeda-explorer.metis.io/api',
24
+ proxyUrl,
25
+ headers,
18
26
  }),
19
27
  })
20
28
 
@@ -10,10 +10,12 @@ export const createMoonbeamChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }) =>
18
20
  createMoonbeamChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createMoonbeamChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createMoonriverChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }) =>
18
20
  createMoonriverChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createMoonriverChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -6,7 +6,13 @@ import { createBlockscout } from '../../explorer'
6
6
  import type { Chain } from '../types/chain'
7
7
  import type { HttpRpc } from '../types/rpc'
8
8
 
9
- export const createOasysChain = () =>
9
+ export const createOasysChain = ({
10
+ explorerProxyUrl: proxyUrl,
11
+ explorerHeaders: headers,
12
+ }: {
13
+ explorerProxyUrl?: string
14
+ explorerHeaders?: Record<string, string>
15
+ }) =>
10
16
  createOasysChainCustom({
11
17
  client: createClient({
12
18
  chain: viemOasys,
@@ -16,6 +22,8 @@ export const createOasysChain = () =>
16
22
  name: 'Oasys-Hub Mainnet explorer',
17
23
  baseUrl: 'https://explorer.oasys.games/',
18
24
  apiBaseUrl: 'https://explorer.oasys.games/api',
25
+ proxyUrl,
26
+ headers,
19
27
  }),
20
28
  })
21
29
 
@@ -10,10 +10,12 @@ export const createOptimismChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }) =>
18
20
  createOptimismChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createOptimismChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createPolygonPosChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }) =>
18
20
  createPolygonPosChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createPolygonPosChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -10,10 +10,12 @@ export const createScrollChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }) =>
18
20
  createScrollChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createScrollChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -6,7 +6,13 @@ import { createBlockscout } from '../../explorer'
6
6
  import type { Chain } from '../types/chain'
7
7
  import type { HttpRpc } from '../types/rpc'
8
8
 
9
- export const createZkFairChain = () =>
9
+ export const createZkFairChain = ({
10
+ explorerProxyUrl: proxyUrl,
11
+ explorerHeaders: headers,
12
+ }: {
13
+ explorerProxyUrl?: string
14
+ explorerHeaders?: Record<string, string>
15
+ }) =>
10
16
  createZkFairChainCustom({
11
17
  client: createClient({
12
18
  chain: zkFair,
@@ -16,6 +22,8 @@ export const createZkFairChain = () =>
16
22
  name: 'ZKFair-Mainnet explorer',
17
23
  baseUrl: 'https://scan.zkfair.io',
18
24
  apiBaseUrl: 'https://scan.zkfair.io/api',
25
+ proxyUrl,
26
+ headers,
19
27
  }),
20
28
  })
21
29
 
@@ -10,10 +10,12 @@ export const createZkSyncEraChain = ({
10
10
  explorerApiKey: apiKey,
11
11
  explorerProxyUrl: proxyUrl,
12
12
  explorerHeaders: headers,
13
+ explorerPageSize: pageSize,
13
14
  }: {
14
15
  explorerApiKey?: string
15
16
  explorerProxyUrl?: string
16
17
  explorerHeaders?: Record<string, string>
18
+ explorerPageSize?: number
17
19
  }) =>
18
20
  createZkSyncEraChainCustom({
19
21
  client: createClient({
@@ -27,6 +29,7 @@ export const createZkSyncEraChain = ({
27
29
  apiKey,
28
30
  proxyUrl,
29
31
  headers,
32
+ pageSize,
30
33
  }),
31
34
  })
32
35
 
@@ -5,7 +5,13 @@ import { type Explorer, createBlockscout } from '../../explorer'
5
5
  import type { Chain } from '../types/chain'
6
6
  import type { HttpRpc } from '../types/rpc'
7
7
 
8
- export const createZoraChain = () =>
8
+ export const createZoraChain = ({
9
+ explorerProxyUrl: proxyUrl,
10
+ explorerHeaders: headers,
11
+ }: {
12
+ explorerProxyUrl?: string
13
+ explorerHeaders?: Record<string, string>
14
+ }) =>
9
15
  createZoraChainCustom({
10
16
  client: createClient({
11
17
  chain: zora,
@@ -15,6 +21,8 @@ export const createZoraChain = () =>
15
21
  name: 'Zora Mainnet explorer',
16
22
  baseUrl: 'https://explorer.zora.energy/',
17
23
  apiBaseUrl: 'https://explorer.zora.energy/api',
24
+ proxyUrl,
25
+ headers,
18
26
  }),
19
27
  })
20
28
 
@@ -13,9 +13,17 @@ export type BlockscoutClient = {
13
13
  }) => Promise<Output>
14
14
  }
15
15
 
16
- export const createBlockscoutClient = (
17
- apiBaseUrl: string,
18
- ): BlockscoutClient => {
16
+ type CreateBlockscoutClientParameters = {
17
+ apiBaseUrl: string
18
+ proxyUrl?: string
19
+ headers?: Record<string, string>
20
+ }
21
+
22
+ export const createBlockscoutClient = ({
23
+ apiBaseUrl,
24
+ proxyUrl,
25
+ headers,
26
+ }: CreateBlockscoutClientParameters): BlockscoutClient => {
19
27
  const rateLimitPerSecond = 5
20
28
  const requestTimestamps: number[] = []
21
29
 
@@ -73,9 +81,19 @@ export const createBlockscoutClient = (
73
81
  url.searchParams.append(key, value)
74
82
  }
75
83
  console.debug(`[GET] ${url.toString()}`)
76
- const { status, message, result } = await rest(url.toString(), {
77
- schema: responseSchema,
78
- })
84
+ const { status, message, result } = await rest(
85
+ proxyUrl === undefined
86
+ ? url.toString()
87
+ : `${proxyUrl}${encodeURIComponent(url.toString())}`,
88
+ {
89
+ schema: responseSchema,
90
+ fetchOptions: {
91
+ headers: {
92
+ ...headers,
93
+ },
94
+ },
95
+ },
96
+ )
79
97
  if (status !== '1') {
80
98
  throw typeof result === 'string'
81
99
  ? new Error(result)
@@ -98,7 +116,6 @@ export const createBlockscoutClient = (
98
116
  await new Promise((resolve) => setTimeout(resolve, 5000))
99
117
  return await get({ path, query, resultSchema }, repeat + 1)
100
118
  }
101
-
102
119
  throw error
103
120
  }
104
121
  }
@@ -17,14 +17,18 @@ type CreateBlockscoutParameters = {
17
17
  name: string
18
18
  baseUrl: string
19
19
  apiBaseUrl: string
20
+ proxyUrl?: string
21
+ headers?: Record<string, string>
20
22
  }
21
23
 
22
24
  export const createBlockscout = ({
23
25
  name,
24
26
  baseUrl,
25
27
  apiBaseUrl,
28
+ proxyUrl,
29
+ headers,
26
30
  }: CreateBlockscoutParameters): Explorer => {
27
- const client = createBlockscoutClient(apiBaseUrl)
31
+ const client = createBlockscoutClient({ apiBaseUrl, proxyUrl, headers })
28
32
 
29
33
  return {
30
34
  name,
@@ -22,6 +22,7 @@ type CreateEtherscanParameters = {
22
22
  apiKey?: string
23
23
  proxyUrl?: string
24
24
  headers?: Record<string, string>
25
+ pageSize?: number
25
26
  }
26
27
 
27
28
  export const createEtherscan = ({
@@ -31,6 +32,7 @@ export const createEtherscan = ({
31
32
  apiKey,
32
33
  proxyUrl,
33
34
  headers,
35
+ pageSize = 10_000,
34
36
  }: CreateEtherscanParameters): Explorer => {
35
37
  const client = createEtherscanClient({
36
38
  apiBaseUrl,
@@ -49,13 +51,13 @@ export const createEtherscan = ({
49
51
  >()
50
52
  let startblock = fromBlock
51
53
  const endblock = toBlock
52
- const maxPageSize = 10_000
53
54
  while (true) {
54
55
  const result = await getListOfInternalTransactionsByAddress({
55
56
  client,
56
57
  address,
57
58
  startblock,
58
59
  endblock,
60
+ offset: pageSize,
59
61
  })
60
62
  for (const transaction of result) {
61
63
  const id = createInternalTransactionId(transaction)
@@ -63,7 +65,7 @@ export const createEtherscan = ({
63
65
  internalTransactions.set(id, transaction)
64
66
  }
65
67
  }
66
- if (result.length < maxPageSize) {
68
+ if (result.length < pageSize) {
67
69
  break
68
70
  }
69
71
  const maxBlockNumber = Math.max(...result.map((x) => x.blockNumber))
@@ -75,20 +77,20 @@ export const createEtherscan = ({
75
77
  const indexes = new Map<LowerHex, TransactionIndex>()
76
78
  let startblock = fromBlock
77
79
  const endblock = toBlock
78
- const maxPageSize = 10_000
79
80
  while (true) {
80
81
  const result = await getListOfNormalTransactionsByAddress({
81
82
  client,
82
83
  address,
83
84
  startblock,
84
85
  endblock,
86
+ offset: pageSize,
85
87
  })
86
88
  for (const index of result) {
87
89
  if (!indexes.has(index.hash)) {
88
90
  indexes.set(index.hash, index)
89
91
  }
90
92
  }
91
- if (result.length < maxPageSize) {
93
+ if (result.length < pageSize) {
92
94
  break
93
95
  }
94
96
  const maxBlockNumber = Math.max(...result.map((x) => x.blockNumber))
@@ -98,7 +100,6 @@ export const createEtherscan = ({
98
100
  },
99
101
  getAddressTokenTransferIndexes: async ({ address, fromBlock, toBlock }) => {
100
102
  const indexes = new Map<LowerHex, TransactionIndex>()
101
- const maxPageSize = 10_000
102
103
  const endblock = toBlock
103
104
 
104
105
  // ERC20
@@ -109,13 +110,14 @@ export const createEtherscan = ({
109
110
  address,
110
111
  startblock,
111
112
  endblock,
113
+ offset: pageSize,
112
114
  })
113
115
  for (const index of result) {
114
116
  if (!indexes.has(index.hash)) {
115
117
  indexes.set(index.hash, index)
116
118
  }
117
119
  }
118
- if (result.length < maxPageSize) {
120
+ if (result.length < pageSize) {
119
121
  break
120
122
  }
121
123
  const maxBlockNumber = Math.max(...result.map((x) => x.blockNumber))
@@ -130,13 +132,14 @@ export const createEtherscan = ({
130
132
  address,
131
133
  startblock,
132
134
  endblock,
135
+ offset: pageSize,
133
136
  })
134
137
  for (const index of result) {
135
138
  if (!indexes.has(index.hash)) {
136
139
  indexes.set(index.hash, index)
137
140
  }
138
141
  }
139
- if (result.length < maxPageSize) {
142
+ if (result.length < pageSize) {
140
143
  break
141
144
  }
142
145
  const maxBlockNumber = Math.max(...result.map((x) => x.blockNumber))
@@ -151,13 +154,14 @@ export const createEtherscan = ({
151
154
  address,
152
155
  startblock,
153
156
  endblock,
157
+ offset: pageSize,
154
158
  })
155
159
  for (const index of result) {
156
160
  if (!indexes.has(index.hash)) {
157
161
  indexes.set(index.hash, index)
158
162
  }
159
163
  }
160
- if (result.length < maxPageSize) {
164
+ if (result.length < pageSize) {
161
165
  break
162
166
  }
163
167
  const maxBlockNumber = Math.max(...result.map((x) => x.blockNumber))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xtorch/evm",
3
- "version": "0.0.96",
3
+ "version": "0.0.97",
4
4
  "description": "Cryptorch EVM extension",
5
5
  "keywords": [
6
6
  "cryptorch",