@0xtorch/evm 0.0.76 → 0.0.77

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.
@@ -1 +1 @@
1
- {"version":3,"file":"simpleValue.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/simpleValue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAKV,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,eAAO,MAAM,cAAc,+CAIxB;IACD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;IAClD,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;CACzC,KAAG,MA2TH,CAAA"}
1
+ {"version":3,"file":"simpleValue.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/simpleValue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAKV,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,eAAO,MAAM,cAAc,+CAIxB;IACD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;IAClD,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;CACzC,KAAG,MA8TH,CAAA"}
@@ -36,6 +36,10 @@ export const addressInSchema = z.object({
36
36
  .min(1),
37
37
  })
38
38
 
39
+ const chainIdValueSchema = z.object({
40
+ type: z.literal('chain-id'),
41
+ })
42
+
39
43
  const fromValueSchema = z.object({
40
44
  type: z.literal('from'),
41
45
  })
@@ -128,6 +132,7 @@ const erc1155ValueSchema = z.object({
128
132
 
129
133
  export const simpleValueSchema = z.union([
130
134
  z.string(),
135
+ chainIdValueSchema,
131
136
  fromValueSchema,
132
137
  toValueSchema,
133
138
  valueValueSchema,
@@ -27,6 +27,9 @@ export const getSimpleValue = ({
27
27
  }
28
28
 
29
29
  switch (schema.type) {
30
+ case 'chain-id': {
31
+ return transaction.chainId.toString()
32
+ }
30
33
  case 'from': {
31
34
  return transaction.from.address
32
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xtorch/evm",
3
- "version": "0.0.76",
3
+ "version": "0.0.77",
4
4
  "description": "Cryptorch EVM extension",
5
5
  "keywords": [
6
6
  "cryptorch",
@@ -5,7 +5,7 @@ export const bigintTextSchema = z.string().regex(/^\d+$/).transform(BigInt)
5
5
 
6
6
  export const lowerHexSchema = z
7
7
  .string()
8
- .regex(/^0x[0-9a-f]+$/)
8
+ .regex(/^0x[0-9a-f]*$/)
9
9
  .transform((v) => v as LowerHex)
10
10
 
11
11
  export const txHashSchema = z