viem 1.2.7 → 1.2.10

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 (63) hide show
  1. package/dist/cjs/accounts/utils/signTransaction.js.map +1 -1
  2. package/dist/cjs/actions/public/waitForTransactionReceipt.js +3 -4
  3. package/dist/cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
  4. package/dist/cjs/chains/index.js +4 -0
  5. package/dist/cjs/chains/index.js.map +1 -1
  6. package/dist/cjs/chains/serializers/celo.js +85 -0
  7. package/dist/cjs/chains/serializers/celo.js.map +1 -0
  8. package/dist/cjs/errors/version.js +1 -1
  9. package/dist/cjs/errors/version.js.map +1 -1
  10. package/dist/cjs/utils/abi/encodePacked.js.map +1 -1
  11. package/dist/cjs/utils/ens/avatar/utils.js +2 -1
  12. package/dist/cjs/utils/ens/avatar/utils.js.map +1 -1
  13. package/dist/cjs/utils/formatters/extract.js +0 -1
  14. package/dist/cjs/utils/formatters/extract.js.map +1 -1
  15. package/dist/cjs/utils/transaction/prepareRequest.js +1 -1
  16. package/dist/cjs/utils/transaction/prepareRequest.js.map +1 -1
  17. package/dist/esm/accounts/utils/signTransaction.js.map +1 -1
  18. package/dist/esm/actions/public/waitForTransactionReceipt.js +3 -4
  19. package/dist/esm/actions/public/waitForTransactionReceipt.js.map +1 -1
  20. package/dist/esm/chains/index.js +4 -0
  21. package/dist/esm/chains/index.js.map +1 -1
  22. package/dist/esm/chains/serializers/celo.js +93 -0
  23. package/dist/esm/chains/serializers/celo.js.map +1 -0
  24. package/dist/esm/errors/version.js +1 -1
  25. package/dist/esm/errors/version.js.map +1 -1
  26. package/dist/esm/utils/abi/encodePacked.js.map +1 -1
  27. package/dist/esm/utils/ens/avatar/utils.js +3 -1
  28. package/dist/esm/utils/ens/avatar/utils.js.map +1 -1
  29. package/dist/esm/utils/formatters/extract.js +1 -1
  30. package/dist/esm/utils/formatters/extract.js.map +1 -1
  31. package/dist/esm/utils/transaction/prepareRequest.js +1 -1
  32. package/dist/esm/utils/transaction/prepareRequest.js.map +1 -1
  33. package/dist/types/accounts/utils/signTransaction.d.ts +1 -1
  34. package/dist/types/accounts/utils/signTransaction.d.ts.map +1 -1
  35. package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
  36. package/dist/types/actions/wallet/deployContract.d.ts +1 -1
  37. package/dist/types/actions/wallet/deployContract.d.ts.map +1 -1
  38. package/dist/types/chains/index.d.ts.map +1 -1
  39. package/dist/types/chains/serializers/celo.d.ts +21 -0
  40. package/dist/types/chains/serializers/celo.d.ts.map +1 -0
  41. package/dist/types/errors/version.d.ts +1 -1
  42. package/dist/types/errors/version.d.ts.map +1 -1
  43. package/dist/types/types/transaction.d.ts +1 -1
  44. package/dist/types/types/transaction.d.ts.map +1 -1
  45. package/dist/types/types/typedData.d.ts +6 -6
  46. package/dist/types/types/typedData.d.ts.map +1 -1
  47. package/dist/types/utils/ens/avatar/utils.d.ts +1 -1
  48. package/dist/types/utils/ens/avatar/utils.d.ts.map +1 -1
  49. package/dist/types/utils/formatters/extract.d.ts +1 -1
  50. package/dist/types/utils/formatters/extract.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/src/accounts/utils/signTransaction.ts +7 -2
  53. package/src/actions/public/waitForTransactionReceipt.ts +3 -4
  54. package/src/actions/wallet/deployContract.ts +1 -1
  55. package/src/chains/index.ts +4 -0
  56. package/src/chains/serializers/celo.ts +194 -0
  57. package/src/errors/version.ts +1 -1
  58. package/src/types/transaction.ts +1 -1
  59. package/src/types/typedData.ts +6 -6
  60. package/src/utils/abi/encodePacked.ts +1 -1
  61. package/src/utils/ens/avatar/utils.ts +3 -1
  62. package/src/utils/formatters/extract.ts +3 -2
  63. package/src/utils/transaction/prepareRequest.ts +1 -1
@@ -35,7 +35,7 @@ export type TransactionReceipt<
35
35
  logs: Log<TQuantity, TIndex>[]
36
36
  /** Logs bloom filter */
37
37
  logsBloom: Hex
38
- /** `1` if this transaction was successful or `0` if it failed */
38
+ /** `success` if this transaction was successful or `reverted` if it failed */
39
39
  status: TStatus
40
40
  /** Transaction recipient or `null` if deploying a contract */
41
41
  to: Address | null
@@ -15,11 +15,11 @@ export type TypedDataDefinition<
15
15
  GetTypedDataDomain<TTypedData, TPrimaryType>
16
16
 
17
17
  export type GetTypedDataDomain<
18
- TTypedData extends TypedData | { [key: string]: unknown } = TypedData,
18
+ TTypedData extends TypedData | { [key_1: string]: unknown } = TypedData,
19
19
  TPrimaryType extends string = string,
20
20
  TSchema = TTypedData extends TypedData
21
21
  ? TypedDataToPrimitiveTypes<TTypedData>
22
- : { [key: string]: any },
22
+ : { [key_2: string]: any },
23
23
  TDomain = TSchema extends { EIP712Domain: infer Domain }
24
24
  ? Domain
25
25
  : TypedDataDomain,
@@ -32,24 +32,24 @@ export type GetTypedDataDomain<
32
32
  }
33
33
 
34
34
  export type GetTypedDataMessage<
35
- TTypedData extends TypedData | { [key: string]: unknown } = TypedData,
35
+ TTypedData extends TypedData | { [key_1: string]: unknown } = TypedData,
36
36
  TPrimaryType extends string = string,
37
37
  TSchema = TTypedData extends TypedData
38
38
  ? TypedDataToPrimitiveTypes<TTypedData>
39
- : { [key: string]: any },
39
+ : { [key_2: string]: any },
40
40
  TMessage = TSchema[TPrimaryType extends keyof TSchema
41
41
  ? TPrimaryType
42
42
  : keyof TSchema],
43
43
  > = TPrimaryType extends 'EIP712Domain'
44
44
  ? {}
45
- : { [key: string]: any } extends TMessage // Check if we were able to infer the shape of typed data
45
+ : { [key_3: string]: any } extends TMessage // Check if we were able to infer the shape of typed data
46
46
  ? {
47
47
  /**
48
48
  * Data to sign
49
49
  *
50
50
  * Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link types} for type inference.
51
51
  */
52
- message: { [key: string]: unknown }
52
+ message: { [key_4: string]: unknown }
53
53
  }
54
54
  : {
55
55
  /** Data to sign */
@@ -62,7 +62,7 @@ export function encodePacked<
62
62
  function encode<TPackedAbiType extends PackedAbiType | unknown>(
63
63
  type: TPackedAbiType,
64
64
  value: EncodePackedValues<[TPackedAbiType]>[0],
65
- isArray: boolean = false,
65
+ isArray = false,
66
66
  ): Hex {
67
67
  if (type === 'address') {
68
68
  const address = value as Address
@@ -40,6 +40,7 @@ export async function isImageUri(uri: string) {
40
40
  return false
41
41
  }
42
42
  // fail in NodeJS, since the error is not cors but any other network issue
43
+ // rome-ignore lint/suspicious/noPrototypeBuiltins:
43
44
  if (!globalThis.hasOwnProperty('Image')) return false
44
45
  // in case of cors, use image api to validate if given url is an actual image
45
46
  return new Promise((resolve) => {
@@ -179,7 +180,8 @@ type ParsedNft = {
179
180
  tokenID: string
180
181
  }
181
182
 
182
- export function parseNftUri(uri: string): ParsedNft {
183
+ export function parseNftUri(uri_: string): ParsedNft {
184
+ let uri = uri_
183
185
  // parse valid nft spec (CAIP-22/CAIP-29)
184
186
  // @see: https://github.com/ChainAgnostic/CAIPs/tree/master/CAIPs
185
187
  if (uri.startsWith('did:nft:')) {
@@ -9,9 +9,10 @@ export function extract(
9
9
  ) {
10
10
  if (!format) return {}
11
11
  const keys = Object.keys(format({}))
12
- return keys.reduce((data, key) => {
12
+ return keys.reduce((data: Record<string, unknown>, key) => {
13
+ // rome-ignore lint/suspicious/noPrototypeBuiltins:
13
14
  if (value?.hasOwnProperty(key)) {
14
- ;(data as any)[key] = value[key]
15
+ data[key] = value[key]
15
16
  }
16
17
  return data
17
18
  }, {})
@@ -72,7 +72,7 @@ export async function prepareRequest<
72
72
  blockTag: 'pending',
73
73
  })
74
74
 
75
- if (block.baseFeePerGas) {
75
+ if (typeof block.baseFeePerGas === 'bigint') {
76
76
  if (typeof gasPrice !== 'undefined')
77
77
  throw new BaseError('Chain does not support legacy `gasPrice`.')
78
78