viem 2.16.4 → 2.16.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/_cjs/chains/definitions/dogechain.js +8 -2
  3. package/_cjs/chains/definitions/dogechain.js.map +1 -1
  4. package/_cjs/chains/definitions/pgn.js +1 -1
  5. package/_cjs/chains/definitions/pgn.js.map +1 -1
  6. package/_cjs/chains/definitions/pgnTestnet.js +1 -1
  7. package/_cjs/chains/definitions/pgnTestnet.js.map +1 -1
  8. package/_cjs/chains/definitions/shibariumTestnet.js +31 -0
  9. package/_cjs/chains/definitions/shibariumTestnet.js.map +1 -0
  10. package/_cjs/chains/definitions/xrSepolia.js +24 -0
  11. package/_cjs/chains/definitions/xrSepolia.js.map +1 -0
  12. package/_cjs/chains/index.js +6 -2
  13. package/_cjs/chains/index.js.map +1 -1
  14. package/_cjs/errors/version.js +1 -1
  15. package/_cjs/zksync/errors/token-is-eth.js +1 -1
  16. package/_cjs/zksync/errors/token-is-eth.js.map +1 -1
  17. package/_esm/actions/getContract.js +1 -1
  18. package/_esm/actions/public/watchContractEvent.js +1 -1
  19. package/_esm/actions/public/watchContractEvent.js.map +1 -1
  20. package/_esm/actions/public/watchEvent.js +1 -1
  21. package/_esm/actions/public/watchEvent.js.map +1 -1
  22. package/_esm/actions/wallet/signTransaction.js +1 -1
  23. package/_esm/chains/definitions/dogechain.js +8 -2
  24. package/_esm/chains/definitions/dogechain.js.map +1 -1
  25. package/_esm/chains/definitions/pgn.js +1 -1
  26. package/_esm/chains/definitions/pgn.js.map +1 -1
  27. package/_esm/chains/definitions/pgnTestnet.js +1 -1
  28. package/_esm/chains/definitions/pgnTestnet.js.map +1 -1
  29. package/_esm/chains/definitions/shibariumTestnet.js +28 -0
  30. package/_esm/chains/definitions/shibariumTestnet.js.map +1 -0
  31. package/_esm/chains/definitions/xrSepolia.js +21 -0
  32. package/_esm/chains/definitions/xrSepolia.js.map +1 -0
  33. package/_esm/chains/index.js +2 -0
  34. package/_esm/chains/index.js.map +1 -1
  35. package/_esm/errors/version.js +1 -1
  36. package/_esm/zksync/actions/signEip712Transaction.js +1 -1
  37. package/_esm/zksync/actions/signTransaction.js +1 -1
  38. package/_esm/zksync/errors/token-is-eth.js +1 -1
  39. package/_esm/zksync/errors/token-is-eth.js.map +1 -1
  40. package/_types/actions/getContract.d.ts +1 -1
  41. package/_types/actions/wallet/sendRawTransaction.d.ts +1 -1
  42. package/_types/actions/wallet/signTransaction.d.ts +1 -1
  43. package/_types/chains/definitions/dogechain.d.ts +8 -10
  44. package/_types/chains/definitions/dogechain.d.ts.map +1 -1
  45. package/_types/chains/definitions/pgn.d.ts +1 -1
  46. package/_types/chains/definitions/pgnTestnet.d.ts +1 -1
  47. package/_types/chains/definitions/shibariumTestnet.d.ts +34 -0
  48. package/_types/chains/definitions/shibariumTestnet.d.ts.map +1 -0
  49. package/_types/chains/definitions/xrSepolia.d.ts +35 -0
  50. package/_types/chains/definitions/xrSepolia.d.ts.map +1 -0
  51. package/_types/chains/index.d.ts +2 -0
  52. package/_types/chains/index.d.ts.map +1 -1
  53. package/_types/errors/version.d.ts +1 -1
  54. package/_types/index.d.ts +1 -1
  55. package/_types/index.d.ts.map +1 -1
  56. package/_types/utils/index.d.ts +1 -1
  57. package/_types/utils/index.d.ts.map +1 -1
  58. package/_types/utils/transaction/getTransactionType.d.ts +1 -1
  59. package/_types/utils/transaction/getTransactionType.d.ts.map +1 -1
  60. package/_types/utils/transaction/serializeTransaction.d.ts +2 -2
  61. package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
  62. package/_types/zksync/actions/signEip712Transaction.d.ts +1 -1
  63. package/_types/zksync/actions/signTransaction.d.ts +1 -1
  64. package/_types/zksync/decorators/eip712.d.ts +1 -1
  65. package/_types/zksync/decorators/publicL1.d.ts +1 -1
  66. package/actions/getContract.ts +1 -1
  67. package/actions/public/watchContractEvent.ts +1 -1
  68. package/actions/public/watchEvent.ts +1 -1
  69. package/actions/wallet/sendRawTransaction.ts +1 -1
  70. package/actions/wallet/signTransaction.ts +1 -1
  71. package/chains/definitions/dogechain.ts +8 -2
  72. package/chains/definitions/pgn.ts +1 -1
  73. package/chains/definitions/pgnTestnet.ts +1 -1
  74. package/chains/definitions/shibariumTestnet.ts +28 -0
  75. package/chains/definitions/xrSepolia.ts +21 -0
  76. package/chains/index.ts +2 -0
  77. package/errors/version.ts +1 -1
  78. package/index.ts +1 -1
  79. package/package.json +1 -1
  80. package/utils/index.ts +1 -1
  81. package/utils/transaction/getTransactionType.ts +1 -1
  82. package/utils/transaction/serializeTransaction.ts +2 -2
  83. package/zksync/actions/signEip712Transaction.ts +1 -1
  84. package/zksync/actions/signTransaction.ts +1 -1
  85. package/zksync/decorators/eip712.ts +1 -1
  86. package/zksync/decorators/publicL1.ts +1 -1
  87. package/zksync/errors/token-is-eth.ts +1 -1
  88. package/zksync/types/log.ts +1 -1
@@ -254,7 +254,7 @@ export function watchContractEvent<
254
254
  else for (const log of logs) emit.onLogs([log] as any)
255
255
  } catch (err) {
256
256
  // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.
257
- // Reinitalize the filter when this occurs
257
+ // Reinitialize the filter when this occurs
258
258
  if (filter && err instanceof InvalidInputRpcError)
259
259
  initialized = false
260
260
  emit.onError?.(err as Error)
@@ -274,7 +274,7 @@ export function watchEvent<
274
274
  else for (const log of logs) emit.onLogs([log] as any)
275
275
  } catch (err) {
276
276
  // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.
277
- // Reinitalize the filter when this occurs
277
+ // Reinitialize the filter when this occurs
278
278
  if (filter && err instanceof InvalidInputRpcError)
279
279
  initialized = false
280
280
  emit.onError?.(err as Error)
@@ -7,7 +7,7 @@ import type { TransactionSerializedGeneric } from '../../types/transaction.js'
7
7
  import type { RequestErrorType } from '../../utils/buildRequest.js'
8
8
 
9
9
  export type SendRawTransactionParameters = {
10
- /** The signed serialized tranasction. */
10
+ /** The signed serialized transaction. */
11
11
  serializedTransaction: TransactionSerializedGeneric
12
12
  }
13
13
 
@@ -81,7 +81,7 @@ export type SignTransactionErrorType =
81
81
  * - Local Accounts: Signs locally. No JSON-RPC request.
82
82
  *
83
83
  * @param args - {@link SignTransactionParameters}
84
- * @returns The signed serialized tranasction. {@link SignTransactionReturnType}
84
+ * @returns The signed serialized transaction. {@link SignTransactionReturnType}
85
85
  *
86
86
  * @example
87
87
  * import { createWalletClient, custom } from 'viem'
@@ -5,8 +5,8 @@ export const dogechain = /*#__PURE__*/ defineChain({
5
5
  name: 'Dogechain',
6
6
  nativeCurrency: {
7
7
  decimals: 18,
8
- name: 'Dogechain',
9
- symbol: 'DC',
8
+ name: 'Wrapped Dogecoin',
9
+ symbol: 'WDOGE',
10
10
  },
11
11
  rpcUrls: {
12
12
  default: { http: ['https://rpc.dogechain.dog'] },
@@ -18,4 +18,10 @@ export const dogechain = /*#__PURE__*/ defineChain({
18
18
  apiUrl: 'https://explorer.dogechain.dog/api',
19
19
  },
20
20
  },
21
+ contracts: {
22
+ multicall3: {
23
+ address: '0x68a8609a60a008EFA633dfdec592c03B030cC508',
24
+ blockCreated: 25384031,
25
+ },
26
+ },
21
27
  })
@@ -19,7 +19,7 @@ export const pgn = /*#__PURE__*/ defineChain({
19
19
  url: 'https://explorer.publicgoods.network',
20
20
  apiUrl: 'https://explorer.publicgoods.network/api',
21
21
  },
22
- blocksout: {
22
+ blockscout: {
23
23
  name: 'PGN Explorer',
24
24
  url: 'https://explorer.publicgoods.network',
25
25
  apiUrl: 'https://explorer.publicgoods.network/api',
@@ -19,7 +19,7 @@ export const pgnTestnet = /*#__PURE__*/ defineChain({
19
19
  url: 'https://explorer.sepolia.publicgoods.network',
20
20
  apiUrl: 'https://explorer.sepolia.publicgoods.network/api',
21
21
  },
22
- blocksout: {
22
+ blockscout: {
23
23
  name: 'PGN Testnet Explorer',
24
24
  url: 'https://explorer.sepolia.publicgoods.network',
25
25
  apiUrl: 'https://explorer.sepolia.publicgoods.network/api',
@@ -0,0 +1,28 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const shibariumTestnet = /*#__PURE__*/ defineChain({
4
+ id: 157,
5
+ name: 'Puppynet Shibarium',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Bone',
9
+ symbol: 'BONE',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://puppynet.shibrpc.com'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Blockscout',
17
+ url: 'https://puppyscan.shib.io',
18
+ apiUrl: 'https://puppyscan.shib.io/api',
19
+ },
20
+ },
21
+ contracts: {
22
+ multicall3: {
23
+ address: '0xA4029b74FBA366c926eDFA7Dd10B21C621170a4c',
24
+ blockCreated: 3035769,
25
+ },
26
+ },
27
+ testnet: true,
28
+ })
@@ -0,0 +1,21 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const xrSepolia = /*#__PURE__*/ defineChain({
4
+ id: 2730,
5
+ name: 'XR Sepolia',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'tXR',
9
+ symbol: 'tXR',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://xr-sepolia-testnet.rpc.caldera.xyz/http'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Blockscout',
17
+ url: 'https://xr-sepolia-testnet.explorer.caldera.xyz',
18
+ },
19
+ },
20
+ testnet: true,
21
+ })
package/chains/index.ts CHANGED
@@ -251,6 +251,7 @@ export { songbirdTestnet } from './definitions/songbirdTestnet.js'
251
251
  export { spicy } from './definitions/spicy.js'
252
252
  export { shardeumSphinx } from './definitions/shardeumSphinx.js'
253
253
  export { shibarium } from './definitions/shibarium.js'
254
+ export { shibariumTestnet } from './definitions/shibariumTestnet.js'
254
255
  export { stratis } from './definitions/stratis.js'
255
256
  export { syscoin } from './definitions/syscoin.js'
256
257
  export { syscoinTestnet } from './definitions/syscoinTestnet.js'
@@ -283,6 +284,7 @@ export { xai } from './definitions/xai.js'
283
284
  export { xaiTestnet } from './definitions/xaiTestnet.js'
284
285
  export { xdc } from './definitions/xdc.js'
285
286
  export { xdcTestnet } from './definitions/xdcTestnet.js'
287
+ export { xrSepolia } from './definitions/xrSepolia.js'
286
288
  export { yooldoVerse } from './definitions/yooldoVerse.js'
287
289
  export { yooldoVerseTestnet } from './definitions/yooldoVerseTestnet.js'
288
290
  export { zetachain } from './definitions/zetachain.js'
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.16.4'
1
+ export const version = '2.16.5'
package/index.ts CHANGED
@@ -1215,7 +1215,7 @@ export {
1215
1215
  } from './utils/transaction/getSerializedTransactionType.js'
1216
1216
  export {
1217
1217
  type GetTransactionType,
1218
- type GetTransationTypeErrorType,
1218
+ type GetTransactionTypeErrorType,
1219
1219
  getTransactionType,
1220
1220
  } from './utils/transaction/getTransactionType.js'
1221
1221
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.16.4",
4
+ "version": "2.16.5",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
package/utils/index.ts CHANGED
@@ -475,7 +475,7 @@ export {
475
475
  getSerializedTransactionType,
476
476
  } from './transaction/getSerializedTransactionType.js'
477
477
  export {
478
- type GetTransationTypeErrorType,
478
+ type GetTransactionTypeErrorType,
479
479
  type GetTransactionType,
480
480
  getTransactionType,
481
481
  } from './transaction/getTransactionType.js'
@@ -109,7 +109,7 @@ export type GetTransactionType<
109
109
  | (transaction['type'] extends string ? transaction['type'] : never),
110
110
  > = IsNever<result> extends false ? result : string
111
111
 
112
- export type GetTransationTypeErrorType =
112
+ export type GetTransactionTypeErrorType =
113
113
  | InvalidSerializableTransactionErrorType
114
114
  | ErrorType
115
115
 
@@ -57,7 +57,7 @@ import {
57
57
  } from './assertTransaction.js'
58
58
  import {
59
59
  type GetTransactionType,
60
- type GetTransationTypeErrorType,
60
+ type GetTransactionTypeErrorType,
61
61
  getTransactionType,
62
62
  } from './getTransactionType.js'
63
63
  import {
@@ -81,7 +81,7 @@ export type SerializeTransactionFn<
81
81
  >
82
82
 
83
83
  export type SerializeTransactionErrorType =
84
- | GetTransationTypeErrorType
84
+ | GetTransactionTypeErrorType
85
85
  | SerializeTransactionEIP1559ErrorType
86
86
  | SerializeTransactionEIP2930ErrorType
87
87
  | SerializeTransactionEIP4844ErrorType
@@ -54,7 +54,7 @@ export type SignEip712TransactionErrorType = SignTransactionErrorType
54
54
  * Signs an EIP712 transaction.
55
55
  *
56
56
  * @param args - {@link SignTransactionParameters}
57
- * @returns The signed serialized tranasction. {@link SignTransactionReturnType}
57
+ * @returns The signed serialized transaction. {@link SignTransactionReturnType}
58
58
  *
59
59
  * @example
60
60
  * import { createWalletClient, custom } from 'viem'
@@ -48,7 +48,7 @@ export type SignTransactionErrorType = SignTransactionErrorType_
48
48
  * - Docs: https://viem.sh/docs/zksync/actions/signTransaction
49
49
  *
50
50
  * @param args - {@link SignTransactionParameters}
51
- * @returns The signed serialized tranasction. {@link SignTransactionReturnType}
51
+ * @returns The signed serialized transaction. {@link SignTransactionReturnType}
52
52
  *
53
53
  * @example
54
54
  * import { createWalletClient, custom } from 'viem'
@@ -86,7 +86,7 @@ export type Eip712WalletActions<
86
86
  * - Local Accounts: Signs locally. No JSON-RPC request.
87
87
  *
88
88
  * @param args - {@link SignTransactionParameters}
89
- * @returns The signed serialized tranasction. {@link SignTransactionReturnType}
89
+ * @returns The signed serialized transaction. {@link SignTransactionReturnType}
90
90
  *
91
91
  * @example
92
92
  * import { createWalletClient, custom } from 'viem'
@@ -74,7 +74,7 @@ export type PublicActionsL1<
74
74
  *
75
75
  * @param client - Client to use
76
76
  * @param parameters - {@link GetL1TokenBalanceParameters}
77
- * @returns The amount of the ERC20 token the client has on specific addresse. {@link GetL1TokenBalanceReturnType}
77
+ * @returns The amount of the ERC20 token the client has on specific address. {@link GetL1TokenBalanceReturnType}
78
78
  *
79
79
  * @example
80
80
  * import { createPublicClient, custom, parseEther } from 'viem'
@@ -8,7 +8,7 @@ export class TokenIsEthError extends BaseError {
8
8
 
9
9
  constructor() {
10
10
  super(
11
- ['Token is an ETH token.', '', 'ETH token cannot be retrived.'].join(
11
+ ['Token is an ETH token.', '', 'ETH token cannot be retrieved.'].join(
12
12
  '\n',
13
13
  ),
14
14
  )
@@ -23,7 +23,7 @@ export type ZkSyncLog<
23
23
 
24
24
  export type ZkSyncRpcLog = RpcLog_ & {
25
25
  l1BatchNumber: Hex | null
26
- // These are returned but doesn't apear in Log structure neither is mentioned in https://era.zksync.io/docs/api/js/types
26
+ // These are returned but doesn't appear in Log structure neither is mentioned in https://era.zksync.io/docs/api/js/types
27
27
  transactionLogIndex: Hex
28
28
  logType: Hex | null
29
29
  }