@0xtorch/evm 0.0.123 → 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.
- package/_cjs/chain/definitions/soneium.js +59 -0
- package/_cjs/chain/definitions/soneium.js.map +1 -0
- package/_cjs/chain/definitions/sonic.js +78 -0
- package/_cjs/chain/definitions/sonic.js.map +1 -0
- package/_cjs/chain/definitions/taiko.js +99 -0
- package/_cjs/chain/definitions/taiko.js.map +1 -0
- package/_cjs/chain/viemChains/soneium.js +55 -0
- package/_cjs/chain/viemChains/soneium.js.map +1 -0
- package/_cjs/chain/viemChains/sonic.js +30 -0
- package/_cjs/chain/viemChains/sonic.js.map +1 -0
- package/_cjs/client/create.js +2 -2
- package/_cjs/client/create.js.map +1 -1
- package/_esm/chain/definitions/soneium.js +54 -0
- package/_esm/chain/definitions/soneium.js.map +1 -0
- package/_esm/chain/definitions/sonic.js +73 -0
- package/_esm/chain/definitions/sonic.js.map +1 -0
- package/_esm/chain/definitions/taiko.js +106 -0
- package/_esm/chain/definitions/taiko.js.map +1 -0
- package/_esm/chain/viemChains/soneium.js +52 -0
- package/_esm/chain/viemChains/soneium.js.map +1 -0
- package/_esm/chain/viemChains/sonic.js +27 -0
- package/_esm/chain/viemChains/sonic.js.map +1 -0
- package/_esm/client/create.js +2 -2
- package/_esm/client/create.js.map +1 -1
- package/_types/chain/definitions/soneium.d.ts +16 -0
- package/_types/chain/definitions/soneium.d.ts.map +1 -0
- package/_types/chain/definitions/sonic.d.ts +18 -0
- package/_types/chain/definitions/sonic.d.ts.map +1 -0
- package/_types/chain/definitions/taiko.d.ts +18 -0
- package/_types/chain/definitions/taiko.d.ts.map +1 -0
- package/_types/chain/viemChains/soneium.d.ts +306 -0
- package/_types/chain/viemChains/soneium.d.ts.map +1 -0
- package/_types/chain/viemChains/sonic.d.ts +33 -0
- package/_types/chain/viemChains/sonic.d.ts.map +1 -0
- package/chain/definitions/soneium.ts +73 -0
- package/chain/definitions/sonic.ts +96 -0
- package/chain/definitions/taiko.ts +129 -0
- package/chain/viemChains/soneium.ts +53 -0
- package/chain/viemChains/sonic.ts +27 -0
- package/client/create.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type Client, createClient } from '../../client'
|
|
2
|
+
import type { Explorer } from '../../explorer'
|
|
3
|
+
import { createEtherscan } from '../../explorer'
|
|
4
|
+
import type { Chain } from '../types/chain'
|
|
5
|
+
import type { HttpRpc } from '../types/rpc'
|
|
6
|
+
import { sonic } from '../viemChains/sonic'
|
|
7
|
+
|
|
8
|
+
export const createSonicChain = ({
|
|
9
|
+
explorerApiKey: apiKey,
|
|
10
|
+
explorerProxyUrl: proxyUrl,
|
|
11
|
+
explorerPageSize: pageSize,
|
|
12
|
+
}: {
|
|
13
|
+
explorerApiKey?: string
|
|
14
|
+
explorerProxyUrl?: string
|
|
15
|
+
explorerPageSize?: number
|
|
16
|
+
}) =>
|
|
17
|
+
createSonicChainCustom({
|
|
18
|
+
client: createClient({
|
|
19
|
+
chain: sonic,
|
|
20
|
+
httpRpcs: sonicHttpRpcs,
|
|
21
|
+
}),
|
|
22
|
+
explorer: createEtherscan({
|
|
23
|
+
name: 'SonicScan',
|
|
24
|
+
baseUrl: 'https://sonicscan.org',
|
|
25
|
+
apiBaseUrl: 'https://api.sonicscan.org/api',
|
|
26
|
+
apiKey,
|
|
27
|
+
proxyUrl,
|
|
28
|
+
pageSize,
|
|
29
|
+
}),
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
type CreateSonicChainParameters = {
|
|
33
|
+
client: Client
|
|
34
|
+
explorer: Explorer
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const createSonicChainCustom = ({
|
|
38
|
+
client,
|
|
39
|
+
explorer,
|
|
40
|
+
}: CreateSonicChainParameters): Chain => ({
|
|
41
|
+
id: 146,
|
|
42
|
+
network: 'sonic',
|
|
43
|
+
name: 'Sonic',
|
|
44
|
+
nativeToken: {
|
|
45
|
+
name: 'Sonic',
|
|
46
|
+
symbol: 'S',
|
|
47
|
+
decimals: 18,
|
|
48
|
+
currency: {
|
|
49
|
+
type: 'CryptoCurrency',
|
|
50
|
+
id: 'sonic-3',
|
|
51
|
+
name: 'Sonic',
|
|
52
|
+
symbol: 'S',
|
|
53
|
+
market: {
|
|
54
|
+
coingeckoId: 'sonic-3',
|
|
55
|
+
},
|
|
56
|
+
updatedAt: 0,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
wrappedTokenAddresses: new Set([
|
|
60
|
+
'0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38',
|
|
61
|
+
]),
|
|
62
|
+
explorer,
|
|
63
|
+
client,
|
|
64
|
+
blockTime: undefined,
|
|
65
|
+
coingeckoId: 'sonic',
|
|
66
|
+
defillamaId: 'sonic',
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
export const sonicHttpRpcs: HttpRpc[] = [
|
|
70
|
+
{
|
|
71
|
+
url: 'https://rpc.soniclabs.com',
|
|
72
|
+
getLogsIsUsable: true,
|
|
73
|
+
getLogsMaxBlockRange: 10_000n,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
url: 'https://sonic.drpc.org',
|
|
77
|
+
getLogsIsUsable: true,
|
|
78
|
+
getLogsMaxBlockRange: 10_000n,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
url: 'https://rpc.ankr.com/sonic_mainnet',
|
|
82
|
+
getLogsIsUsable: true,
|
|
83
|
+
getLogsMaxBlockRange: 10_000n,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
url: 'https://sonic.gateway.tenderly.co',
|
|
87
|
+
getLogsIsUsable: true,
|
|
88
|
+
getLogsMaxBlockRange: 10_000n,
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
export const sonicWebsocketRpcUrls: readonly string[] = [
|
|
93
|
+
'wss://sonic.drpc.org',
|
|
94
|
+
'wss://rpc.ankr.com/sonic_mainnet/ws',
|
|
95
|
+
'wss://sonic.callstaticrpc.com',
|
|
96
|
+
]
|
|
@@ -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/client/create.ts
CHANGED
|
@@ -199,7 +199,7 @@ export const createClient = ({
|
|
|
199
199
|
|
|
200
200
|
throw error
|
|
201
201
|
} finally {
|
|
202
|
-
|
|
202
|
+
semaphore.release(endpoint, cooldown)
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -369,7 +369,7 @@ export const createClient = ({
|
|
|
369
369
|
}
|
|
370
370
|
throw error
|
|
371
371
|
} finally {
|
|
372
|
-
|
|
372
|
+
semaphore.release(endpoint, cooldown)
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
|