viem 2.13.2 → 2.13.5

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 (87) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/_cjs/chains/definitions/bitkub.js +22 -0
  3. package/_cjs/chains/definitions/bitkub.js.map +1 -0
  4. package/_cjs/chains/definitions/bitkubTestnet.js +24 -0
  5. package/_cjs/chains/definitions/bitkubTestnet.js.map +1 -0
  6. package/_cjs/chains/definitions/btrTestnet.js +1 -0
  7. package/_cjs/chains/definitions/btrTestnet.js.map +1 -1
  8. package/_cjs/chains/definitions/fantomTestnet.js +1 -0
  9. package/_cjs/chains/definitions/fantomTestnet.js.map +1 -1
  10. package/_cjs/chains/definitions/lycan.js +40 -0
  11. package/_cjs/chains/definitions/lycan.js.map +1 -0
  12. package/_cjs/chains/definitions/rootstockTestnet.js +1 -0
  13. package/_cjs/chains/definitions/rootstockTestnet.js.map +1 -1
  14. package/_cjs/chains/definitions/satoshivm.js +24 -0
  15. package/_cjs/chains/definitions/satoshivm.js.map +1 -0
  16. package/_cjs/chains/definitions/satoshivmTestnet.js +25 -0
  17. package/_cjs/chains/definitions/satoshivmTestnet.js.map +1 -0
  18. package/_cjs/chains/definitions/sei.js +27 -0
  19. package/_cjs/chains/definitions/sei.js.map +1 -0
  20. package/_cjs/chains/index.js +18 -6
  21. package/_cjs/chains/index.js.map +1 -1
  22. package/_cjs/errors/version.js +1 -1
  23. package/_cjs/experimental/eip5792/actions/writeContracts.js +2 -1
  24. package/_cjs/experimental/eip5792/actions/writeContracts.js.map +1 -1
  25. package/_cjs/utils/promise/withTimeout.js +1 -1
  26. package/_cjs/utils/promise/withTimeout.js.map +1 -1
  27. package/_esm/chains/definitions/bitkub.js +19 -0
  28. package/_esm/chains/definitions/bitkub.js.map +1 -0
  29. package/_esm/chains/definitions/bitkubTestnet.js +21 -0
  30. package/_esm/chains/definitions/bitkubTestnet.js.map +1 -0
  31. package/_esm/chains/definitions/btrTestnet.js +1 -0
  32. package/_esm/chains/definitions/btrTestnet.js.map +1 -1
  33. package/_esm/chains/definitions/fantomTestnet.js +1 -0
  34. package/_esm/chains/definitions/fantomTestnet.js.map +1 -1
  35. package/_esm/chains/definitions/lycan.js +37 -0
  36. package/_esm/chains/definitions/lycan.js.map +1 -0
  37. package/_esm/chains/definitions/rootstockTestnet.js +1 -0
  38. package/_esm/chains/definitions/rootstockTestnet.js.map +1 -1
  39. package/_esm/chains/definitions/satoshivm.js +21 -0
  40. package/_esm/chains/definitions/satoshivm.js.map +1 -0
  41. package/_esm/chains/definitions/satoshivmTestnet.js +22 -0
  42. package/_esm/chains/definitions/satoshivmTestnet.js.map +1 -0
  43. package/_esm/chains/definitions/sei.js +24 -0
  44. package/_esm/chains/definitions/sei.js.map +1 -0
  45. package/_esm/chains/index.js +6 -0
  46. package/_esm/chains/index.js.map +1 -1
  47. package/_esm/errors/version.js +1 -1
  48. package/_esm/experimental/eip5792/actions/writeContracts.js +2 -1
  49. package/_esm/experimental/eip5792/actions/writeContracts.js.map +1 -1
  50. package/_esm/utils/promise/withTimeout.js +1 -1
  51. package/_esm/utils/promise/withTimeout.js.map +1 -1
  52. package/_types/chains/definitions/bitkub.d.ts +36 -0
  53. package/_types/chains/definitions/bitkub.d.ts.map +1 -0
  54. package/_types/chains/definitions/bitkubTestnet.d.ts +37 -0
  55. package/_types/chains/definitions/bitkubTestnet.d.ts.map +1 -0
  56. package/_types/chains/definitions/btrTestnet.d.ts +1 -1
  57. package/_types/chains/definitions/btrTestnet.d.ts.map +1 -1
  58. package/_types/chains/definitions/fantomTestnet.d.ts +1 -1
  59. package/_types/chains/definitions/fantomTestnet.d.ts.map +1 -1
  60. package/_types/chains/definitions/lycan.d.ts +36 -0
  61. package/_types/chains/definitions/lycan.d.ts.map +1 -0
  62. package/_types/chains/definitions/rootstockTestnet.d.ts +1 -1
  63. package/_types/chains/definitions/rootstockTestnet.d.ts.map +1 -1
  64. package/_types/chains/definitions/satoshivm.d.ts +36 -0
  65. package/_types/chains/definitions/satoshivm.d.ts.map +1 -0
  66. package/_types/chains/definitions/satoshivmTestnet.d.ts +36 -0
  67. package/_types/chains/definitions/satoshivmTestnet.d.ts.map +1 -0
  68. package/_types/chains/definitions/sei.d.ts +33 -0
  69. package/_types/chains/definitions/sei.d.ts.map +1 -0
  70. package/_types/chains/index.d.ts +6 -0
  71. package/_types/chains/index.d.ts.map +1 -1
  72. package/_types/errors/version.d.ts +1 -1
  73. package/_types/experimental/eip5792/actions/writeContracts.d.ts.map +1 -1
  74. package/chains/definitions/bitkub.ts +19 -0
  75. package/chains/definitions/bitkubTestnet.ts +21 -0
  76. package/chains/definitions/btrTestnet.ts +1 -0
  77. package/chains/definitions/fantomTestnet.ts +1 -0
  78. package/chains/definitions/lycan.ts +37 -0
  79. package/chains/definitions/rootstockTestnet.ts +1 -0
  80. package/chains/definitions/satoshivm.ts +21 -0
  81. package/chains/definitions/satoshivmTestnet.ts +22 -0
  82. package/chains/definitions/sei.ts +24 -0
  83. package/chains/index.ts +6 -0
  84. package/errors/version.ts +1 -1
  85. package/experimental/eip5792/actions/writeContracts.ts +6 -1
  86. package/package.json +1 -1
  87. package/utils/promise/withTimeout.ts +1 -1
@@ -0,0 +1,19 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const bitkub = /*#__PURE__*/ defineChain({
4
+ id: 96,
5
+ name: 'Bitkub',
6
+ nativeCurrency: { name: 'Bitkub', symbol: 'KUB', decimals: 18 },
7
+ rpcUrls: {
8
+ default: {
9
+ http: ['https://rpc.bitkubchain.io'],
10
+ },
11
+ },
12
+ blockExplorers: {
13
+ default: {
14
+ name: 'Bitkub Chain Mainnet Explorer',
15
+ url: 'https://www.bkcscan.com',
16
+ apiUrl: 'https://www.bkcscan.com/api',
17
+ },
18
+ },
19
+ })
@@ -0,0 +1,21 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const bitkubTestnet = /*#__PURE__*/ defineChain({
4
+ id: 25925,
5
+ name: 'Bitkub Testnet',
6
+ network: 'Bitkub Testnet',
7
+ nativeCurrency: { name: 'Bitkub Test', symbol: 'tKUB', decimals: 18 },
8
+ rpcUrls: {
9
+ default: {
10
+ http: ['https://rpc-testnet.bitkubchain.io'],
11
+ },
12
+ },
13
+ blockExplorers: {
14
+ default: {
15
+ name: 'Bitkub Chain Testnet Explorer',
16
+ url: 'https://testnet.bkcscan.com',
17
+ apiUrl: 'https://testnet.bkcscan.com/api',
18
+ },
19
+ },
20
+ testnet: true,
21
+ })
@@ -24,4 +24,5 @@ export const btrTestnet = /*#__PURE__*/ defineChain({
24
24
  apiUrl: 'https://testnet-scan.bitlayer.org/apis',
25
25
  },
26
26
  },
27
+ testnet: true,
27
28
  })
@@ -24,4 +24,5 @@ export const fantomTestnet = /*#__PURE__*/ defineChain({
24
24
  blockCreated: 8328688,
25
25
  },
26
26
  },
27
+ testnet: true,
27
28
  })
@@ -0,0 +1,37 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const lycan = /*#__PURE__*/ defineChain({
4
+ id: 721,
5
+ name: 'Lycan',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Lycan',
9
+ symbol: 'LYC',
10
+ },
11
+ rpcUrls: {
12
+ default: {
13
+ http: [
14
+ 'https://rpc.lycanchain.com',
15
+ 'https://us-east.lycanchain.com',
16
+ 'https://us-west.lycanchain.com',
17
+ 'https://eu-north.lycanchain.com',
18
+ 'https://eu-west.lycanchain.com',
19
+ 'https://asia-southeast.lycanchain.com',
20
+ ],
21
+ webSocket: [
22
+ 'wss://rpc.lycanchain.com',
23
+ 'wss://us-east.lycanchain.com',
24
+ 'wss://us-west.lycanchain.com',
25
+ 'wss://eu-north.lycanchain.com',
26
+ 'wss://eu-west.lycanchain.com',
27
+ 'wss://asia-southeast.lycanchain.com',
28
+ ],
29
+ },
30
+ },
31
+ blockExplorers: {
32
+ default: {
33
+ name: 'Lycan Explorer',
34
+ url: 'https://explorer.lycanchain.com',
35
+ },
36
+ },
37
+ })
@@ -18,4 +18,5 @@ export const rootstockTestnet = /*#__PURE__*/ defineChain({
18
18
  url: 'https://explorer.testnet.rootstock.io',
19
19
  },
20
20
  },
21
+ testnet: true,
21
22
  })
@@ -0,0 +1,21 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const satoshiVM = /*#__PURE__*/ defineChain({
4
+ id: 3109,
5
+ name: 'SatoshiVM Alpha Mainnet',
6
+ nativeCurrency: {
7
+ name: 'BTC',
8
+ symbol: 'BTC',
9
+ decimals: 18,
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://alpha-rpc-node-http.svmscan.io'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'blockscout',
17
+ url: 'https://svmscan.io',
18
+ apiUrl: 'https://svmscan.io/api',
19
+ },
20
+ },
21
+ })
@@ -0,0 +1,22 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const satoshiVMTestnet = /*#__PURE__*/ defineChain({
4
+ id: 3110,
5
+ name: 'SatoshiVM Testnet',
6
+ nativeCurrency: {
7
+ name: 'BTC',
8
+ symbol: 'BTC',
9
+ decimals: 18,
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://test-rpc-node-http.svmscan.io'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'blockscout',
17
+ url: 'https://testnet.svmscan.io',
18
+ apiUrl: 'https://testnet.svmscan.io/api',
19
+ },
20
+ },
21
+ testnet: true,
22
+ })
@@ -0,0 +1,24 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const sei = /*#__PURE__*/ defineChain({
4
+ id: 1329,
5
+ name: 'Sei Network',
6
+ nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
7
+ rpcUrls: {
8
+ default: {
9
+ http: ['https://evm-rpc.sei-apis.com/'],
10
+ webSocket: ['wss://evm-ws.sei-apis.com/'],
11
+ },
12
+ },
13
+ blockExplorers: {
14
+ default: {
15
+ name: 'Seitrace',
16
+ url: 'https://seitrace.com',
17
+ },
18
+ },
19
+ contracts: {
20
+ multicall3: {
21
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
22
+ },
23
+ },
24
+ })
package/chains/index.ts CHANGED
@@ -30,6 +30,8 @@ export { bearNetworkChainMainnet } from './definitions/bearNetworkChainMainnet.j
30
30
  export { bearNetworkChainTestnet } from './definitions/bearNetworkChainTestnet.js'
31
31
  export { berachainTestnet } from './definitions/berachainTestnet.js'
32
32
  export { bevmMainnet } from './definitions/bevmMainnet.js'
33
+ export { bitkub } from './definitions/bitkub.js'
34
+ export { bitkubTestnet } from './definitions/bitkubTestnet.js'
33
35
  export { bitTorrent } from './definitions/bitTorrent.js'
34
36
  export { bitTorrentTestnet } from './definitions/bitTorrentTestnet.js'
35
37
  export { blast } from './definitions/blast.js'
@@ -139,6 +141,7 @@ export { liskSepolia } from './definitions/liskSepolia.js'
139
141
  export { localhost } from './definitions/localhost.js'
140
142
  export { lukso } from './definitions/lukso.js'
141
143
  export { luksoTestnet } from './definitions/luksoTestnet.js'
144
+ export { lycan } from './definitions/lycan.js'
142
145
  export { mainnet } from './definitions/mainnet.js'
143
146
  export { mandala } from './definitions/mandala.js'
144
147
  export { manta } from './definitions/manta.js'
@@ -211,8 +214,11 @@ export { rss3Sepolia } from './definitions/rss3Sepolia.js'
211
214
  export { saigon } from './definitions/saigon.js'
212
215
  export { sapphire } from './definitions/sapphire.js'
213
216
  export { sapphireTestnet } from './definitions/sapphireTestnet.js'
217
+ export { satoshiVM } from './definitions/satoshivm.js'
218
+ export { satoshiVMTestnet } from './definitions/satoshivmTestnet.js'
214
219
  export { scroll } from './definitions/scroll.js'
215
220
  export { scrollSepolia } from './definitions/scrollSepolia.js'
221
+ export { sei } from './definitions/sei.js'
216
222
  export { seiDevnet } from './definitions/seiDevnet.js'
217
223
  export { sepolia } from './definitions/sepolia.js'
218
224
  export { shimmer } from './definitions/shimmer.js'
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.13.2'
1
+ export const version = '2.13.5'
@@ -17,6 +17,7 @@ import {
17
17
  type EncodeFunctionDataErrorType,
18
18
  encodeFunctionData,
19
19
  } from '../../../utils/abi/encodeFunctionData.js'
20
+ import { getAction } from '../../../utils/getAction.js'
20
21
  import {
21
22
  type SendCallsErrorType,
22
23
  type SendCallsParameters,
@@ -118,7 +119,11 @@ export async function writeContracts<
118
119
  value,
119
120
  } satisfies SendCallsParameters['calls'][number]
120
121
  })
121
- return sendCalls(client, { ...parameters, calls } as SendCallsParameters)
122
+ return getAction(
123
+ client,
124
+ sendCalls,
125
+ 'sendCalls',
126
+ )({ ...parameters, calls } as SendCallsParameters)
122
127
  }
123
128
 
124
129
  export type WriteContractFunctionParameters<
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.13.2",
4
+ "version": "2.13.5",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -35,7 +35,7 @@ export function withTimeout<TData>(
35
35
  }
36
36
  resolve(await fn({ signal: controller?.signal || null }))
37
37
  } catch (err) {
38
- if ((err as Error).name === 'AbortError') reject(errorInstance)
38
+ if ((err as Error)?.name === 'AbortError') reject(errorInstance)
39
39
  reject(err)
40
40
  } finally {
41
41
  clearTimeout(timeoutId)