@0xtorch/evm 0.0.124 → 0.0.125

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 (36) hide show
  1. package/_cjs/chain/definitions/soneium.js +59 -0
  2. package/_cjs/chain/definitions/soneium.js.map +1 -0
  3. package/_cjs/chain/definitions/sonic.js +78 -0
  4. package/_cjs/chain/definitions/sonic.js.map +1 -0
  5. package/_cjs/chain/definitions/taiko.js +99 -0
  6. package/_cjs/chain/definitions/taiko.js.map +1 -0
  7. package/_cjs/chain/viemChains/soneium.js +55 -0
  8. package/_cjs/chain/viemChains/soneium.js.map +1 -0
  9. package/_cjs/chain/viemChains/sonic.js +30 -0
  10. package/_cjs/chain/viemChains/sonic.js.map +1 -0
  11. package/_esm/chain/definitions/soneium.js +54 -0
  12. package/_esm/chain/definitions/soneium.js.map +1 -0
  13. package/_esm/chain/definitions/sonic.js +73 -0
  14. package/_esm/chain/definitions/sonic.js.map +1 -0
  15. package/_esm/chain/definitions/taiko.js +106 -0
  16. package/_esm/chain/definitions/taiko.js.map +1 -0
  17. package/_esm/chain/viemChains/soneium.js +52 -0
  18. package/_esm/chain/viemChains/soneium.js.map +1 -0
  19. package/_esm/chain/viemChains/sonic.js +27 -0
  20. package/_esm/chain/viemChains/sonic.js.map +1 -0
  21. package/_types/chain/definitions/soneium.d.ts +16 -0
  22. package/_types/chain/definitions/soneium.d.ts.map +1 -0
  23. package/_types/chain/definitions/sonic.d.ts +18 -0
  24. package/_types/chain/definitions/sonic.d.ts.map +1 -0
  25. package/_types/chain/definitions/taiko.d.ts +18 -0
  26. package/_types/chain/definitions/taiko.d.ts.map +1 -0
  27. package/_types/chain/viemChains/soneium.d.ts +306 -0
  28. package/_types/chain/viemChains/soneium.d.ts.map +1 -0
  29. package/_types/chain/viemChains/sonic.d.ts +33 -0
  30. package/_types/chain/viemChains/sonic.d.ts.map +1 -0
  31. package/chain/definitions/soneium.ts +73 -0
  32. package/chain/definitions/sonic.ts +96 -0
  33. package/chain/definitions/taiko.ts +129 -0
  34. package/chain/viemChains/soneium.ts +53 -0
  35. package/chain/viemChains/sonic.ts +27 -0
  36. package/package.json +1 -1
@@ -0,0 +1,129 @@
1
+ import { ethereum } from '@0xtorch/core'
2
+ import { taiko } from 'viem/chains'
3
+ import { type Client, createClient } from '../../client'
4
+ import type { Explorer } from '../../explorer'
5
+ import { createEtherscan } from '../../explorer'
6
+ import type { Chain } from '../types/chain'
7
+ import type { HttpRpc } from '../types/rpc'
8
+
9
+ export const createTaikoChain = ({
10
+ explorerApiKey: apiKey,
11
+ explorerProxyUrl: proxyUrl,
12
+ explorerPageSize: pageSize,
13
+ }: {
14
+ explorerApiKey?: string
15
+ explorerProxyUrl?: string
16
+ explorerPageSize?: number
17
+ }) =>
18
+ createTaikoChainCustom({
19
+ client: createClient({
20
+ chain: taiko,
21
+ httpRpcs: taikoHttpRpcs,
22
+ }),
23
+ explorer: createEtherscan({
24
+ name: 'Taiko Mainnet Explorer',
25
+ baseUrl: 'https://taikoscan.io',
26
+ apiBaseUrl: 'https://api.taikoscan.io/api',
27
+ apiKey,
28
+ proxyUrl,
29
+ pageSize,
30
+ }),
31
+ })
32
+
33
+ type CreateTaikoChainParameters = {
34
+ client: Client
35
+ explorer: Explorer
36
+ }
37
+
38
+ export const createTaikoChainCustom = ({
39
+ client,
40
+ explorer,
41
+ }: CreateTaikoChainParameters): Chain => ({
42
+ id: 167_000,
43
+ network: 'taiko',
44
+ name: 'Taiko',
45
+ nativeToken: {
46
+ name: 'Ethereum',
47
+ symbol: 'ETH',
48
+ decimals: 18,
49
+ currency: ethereum,
50
+ },
51
+ wrappedTokenAddresses: new Set([
52
+ '0xa51894664a773981c6c112c43ce576f315d5b1b6',
53
+ ]),
54
+ explorer,
55
+ client,
56
+ blockTime: undefined,
57
+ coingeckoId: 'taiko',
58
+ defillamaId: 'taiko',
59
+ })
60
+
61
+ export const taikoHttpRpcs: HttpRpc[] = [
62
+ {
63
+ url: 'https://rpc.taiko.xyz',
64
+ getLogsIsUsable: true,
65
+ getLogsMaxBlockRange: 10_000n,
66
+ },
67
+ {
68
+ url: 'https://rpc.ankr.com/taiko',
69
+ getLogsIsUsable: true,
70
+ getLogsMaxBlockRange: 10_000n,
71
+ },
72
+ {
73
+ url: 'https://rpc.taiko.tools',
74
+ getLogsIsUsable: true,
75
+ getLogsMaxBlockRange: 10_000n,
76
+ },
77
+ {
78
+ url: 'https://taiko-mainnet.4everland.org/v1/37fa9972c1b1cd5fab542c7bdd4cde2f',
79
+ getLogsIsUsable: true,
80
+ getLogsMaxBlockRange: 10_000n,
81
+ },
82
+ {
83
+ url: 'https://taiko.drpc.org',
84
+ getLogsIsUsable: true,
85
+ getLogsMaxBlockRange: 10_000n,
86
+ },
87
+ {
88
+ url: 'https://taiko-mainnet.rpc.porters.xyz/taiko-public',
89
+ getLogsIsUsable: true,
90
+ getLogsMaxBlockRange: 10_000n,
91
+ },
92
+ {
93
+ url: 'https://taiko-mainnet.gateway.tenderly.co',
94
+ getLogsIsUsable: true,
95
+ getLogsMaxBlockRange: 10_000n,
96
+ },
97
+ // Endpoint is not working
98
+ // {
99
+ // url: 'https://taiko-json-rpc.stakely.io',
100
+ // getLogsIsUsable: true,
101
+ // getLogsMaxBlockRange: 10_000n,
102
+ // },
103
+ // Endpoint is not working
104
+ // {
105
+ // url: 'https://node.histori.xyz/taiko-mainnet/8ry9f6t9dct1se2hlagxnd9n2a',
106
+ // getLogsIsUsable: true,
107
+ // getLogsMaxBlockRange: 10_000n,
108
+ // },
109
+ {
110
+ url: 'https://taiko-rpc.publicnode.com',
111
+ getLogsIsUsable: true,
112
+ getLogsMaxBlockRange: 10_000n,
113
+ },
114
+ {
115
+ url: 'https://rpc.mainnet.taiko.xyz',
116
+ getLogsIsUsable: true,
117
+ getLogsMaxBlockRange: 10_000n,
118
+ },
119
+ {
120
+ url: 'https://167000.rpc.thirdweb.com',
121
+ getLogsIsUsable: false,
122
+ getLogsMaxBlockRange: 0n,
123
+ },
124
+ ]
125
+
126
+ export const taikoWebsocketRpcUrls: readonly string[] = [
127
+ 'wss://taiko-mainnet.4everland.org/ws/v1/37fa9972c1b1cd5fab542c7bdd4cde2f',
128
+ 'wss://taiko.drpc.org',
129
+ ]
@@ -0,0 +1,53 @@
1
+ import { defineChain } from 'viem'
2
+ import { chainConfig } from 'viem/op-stack'
3
+
4
+ const sourceId = 1 // mainnet
5
+
6
+ export const soneium = /*#__PURE__*/ defineChain({
7
+ ...chainConfig,
8
+ id: 1868,
9
+ name: 'Soneium Mainnet',
10
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
11
+ rpcUrls: {
12
+ default: {
13
+ http: ['https://rpc.soneium.org'],
14
+ },
15
+ },
16
+ blockExplorers: {
17
+ default: {
18
+ name: 'Blockscout',
19
+ url: 'https://soneium.blockscout.com',
20
+ apiUrl: 'https://soneium.blockscout.com/api',
21
+ },
22
+ },
23
+ contracts: {
24
+ ...chainConfig.contracts,
25
+ disputeGameFactory: {
26
+ [sourceId]: {
27
+ address: '0x512a3d2c7a43bd9261d2b8e8c9c70d4bd4d503c0',
28
+ },
29
+ },
30
+ l2OutputOracle: {
31
+ [sourceId]: {
32
+ address: '0x0000000000000000000000000000000000000000',
33
+ },
34
+ },
35
+ portal: {
36
+ [sourceId]: {
37
+ address: '0x88e529a6ccd302c948689cd5156c83d4614fae92',
38
+ blockCreated: 7061266,
39
+ },
40
+ },
41
+ l1StandardBridge: {
42
+ [sourceId]: {
43
+ address: '0xeb9bf100225c214efc3e7c651ebbadcf85177607',
44
+ blockCreated: 7061266,
45
+ },
46
+ },
47
+ multicall3: {
48
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
49
+ blockCreated: 1,
50
+ },
51
+ },
52
+ sourceId,
53
+ })
@@ -0,0 +1,27 @@
1
+ import { defineChain } from 'viem'
2
+
3
+ export const sonic = /*#__PURE__*/ defineChain({
4
+ id: 146,
5
+ name: 'Sonic',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Sonic',
9
+ symbol: 'S',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://rpc.soniclabs.com'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Sonic Explorer',
17
+ url: 'https://sonicscan.org/',
18
+ },
19
+ },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0xca11bde05977b3631167028862be2a173976ca11',
23
+ blockCreated: 60,
24
+ },
25
+ },
26
+ testnet: false,
27
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xtorch/evm",
3
- "version": "0.0.124",
3
+ "version": "0.0.125",
4
4
  "description": "Cryptorch EVM extension",
5
5
  "keywords": [
6
6
  "cryptorch",