@0xtorch/evm 0.0.17 → 0.0.19
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/analyzer/analyze.js +2 -0
- package/_cjs/analyzer/analyze.js.map +1 -1
- package/_cjs/analyzer/fail/analyze.js +39 -0
- package/_cjs/analyzer/fail/analyze.js.map +1 -0
- package/_cjs/analyzer/fail/index.js +6 -0
- package/_cjs/analyzer/fail/index.js.map +1 -0
- package/_cjs/analyzer/index.js +3 -1
- package/_cjs/analyzer/index.js.map +1 -1
- package/_cjs/analyzer/json/components/targetAsset.js +116 -0
- package/_cjs/analyzer/json/components/targetAsset.js.map +1 -0
- package/_cjs/analyzer/json/generator.js +13 -1
- package/_cjs/analyzer/json/generator.js.map +1 -1
- package/_cjs/analyzer/json/schemas/generator.js +19 -1
- package/_cjs/analyzer/json/schemas/generator.js.map +1 -1
- package/_cjs/index.js +3 -2
- package/_cjs/index.js.map +1 -1
- package/_esm/analyzer/analyze.js +2 -0
- package/_esm/analyzer/analyze.js.map +1 -1
- package/_esm/analyzer/fail/analyze.js +37 -0
- package/_esm/analyzer/fail/analyze.js.map +1 -0
- package/_esm/analyzer/fail/index.js +2 -0
- package/_esm/analyzer/fail/index.js.map +1 -0
- package/_esm/analyzer/index.js +1 -0
- package/_esm/analyzer/index.js.map +1 -1
- package/_esm/analyzer/json/components/targetAsset.js +112 -0
- package/_esm/analyzer/json/components/targetAsset.js.map +1 -0
- package/_esm/analyzer/json/generator.js +13 -2
- package/_esm/analyzer/json/generator.js.map +1 -1
- package/_esm/analyzer/json/schemas/generator.js +26 -1
- package/_esm/analyzer/json/schemas/generator.js.map +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_types/analyzer/analyze.d.ts.map +1 -1
- package/_types/analyzer/fail/analyze.d.ts +11 -0
- package/_types/analyzer/fail/analyze.d.ts.map +1 -0
- package/_types/analyzer/fail/index.d.ts +2 -0
- package/_types/analyzer/fail/index.d.ts.map +1 -0
- package/_types/analyzer/index.d.ts +1 -0
- package/_types/analyzer/index.d.ts.map +1 -1
- package/_types/analyzer/json/components/targetAsset.d.ts +20 -0
- package/_types/analyzer/json/components/targetAsset.d.ts.map +1 -0
- package/_types/analyzer/json/generator.d.ts.map +1 -1
- package/_types/analyzer/json/schemas/generator.d.ts +6687 -0
- package/_types/analyzer/json/schemas/generator.d.ts.map +1 -1
- package/_types/analyzer/json/types.d.ts +2 -1
- package/_types/analyzer/json/types.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/analyzer/analyze.ts +2 -0
- package/analyzer/fail/analyze.ts +48 -0
- package/analyzer/fail/index.ts +1 -0
- package/analyzer/index.ts +1 -0
- package/analyzer/json/components/targetAsset.ts +130 -0
- package/analyzer/json/generator.ts +14 -2
- package/analyzer/json/schemas/generator.ts +28 -1
- package/analyzer/json/types.ts +3 -0
- package/index.ts +1 -0
- package/package.json +1 -1
|
@@ -371,6 +371,31 @@ const targetComponentSchema = z.union([
|
|
|
371
371
|
}),
|
|
372
372
|
])
|
|
373
373
|
|
|
374
|
+
export const targetAssetComponentSchema = z.union([
|
|
375
|
+
// erc1155
|
|
376
|
+
erc1155ComponentSchema,
|
|
377
|
+
// custom
|
|
378
|
+
z.object({
|
|
379
|
+
type: z.literal('custom'),
|
|
380
|
+
address: z.union([
|
|
381
|
+
premitiveAddressSchema,
|
|
382
|
+
// transaction from/to
|
|
383
|
+
transactionAddressComponentSchema,
|
|
384
|
+
// erc1155
|
|
385
|
+
erc1155ComponentSchema,
|
|
386
|
+
// log
|
|
387
|
+
logArgumentComponentSchema,
|
|
388
|
+
]),
|
|
389
|
+
tokenId: z.union([
|
|
390
|
+
z.bigint(),
|
|
391
|
+
// erc1155
|
|
392
|
+
erc1155ComponentSchema,
|
|
393
|
+
// log
|
|
394
|
+
logArgumentComponentSchema,
|
|
395
|
+
]),
|
|
396
|
+
}),
|
|
397
|
+
])
|
|
398
|
+
|
|
374
399
|
type ActionGeneratorSchema = z.ZodObject<{
|
|
375
400
|
target: z.ZodOptional<z.ZodArray<typeof targetComponentSchema>>
|
|
376
401
|
action: typeof normalActionActionSchema
|
|
@@ -378,6 +403,7 @@ type ActionGeneratorSchema = z.ZodObject<{
|
|
|
378
403
|
crossId: z.ZodOptional<z.ZodArray<typeof idComponentSchema>>
|
|
379
404
|
crossType: z.ZodOptional<typeof crossTypeSchema>
|
|
380
405
|
loanId: z.ZodOptional<z.ZodArray<typeof idComponentSchema>>
|
|
406
|
+
targetAsset: z.ZodOptional<typeof targetAssetComponentSchema>
|
|
381
407
|
transfers: z.ZodArray<typeof transferComponentSchema>
|
|
382
408
|
}>
|
|
383
409
|
|
|
@@ -392,7 +418,8 @@ export const actionGeneratorSchema: ActionGeneratorSchema = z.object({
|
|
|
392
418
|
crossType: crossTypeSchema.optional(),
|
|
393
419
|
/** id component で取得した値を結合して loanId 生成 */
|
|
394
420
|
loanId: z.array(idComponentSchema).optional(),
|
|
395
|
-
|
|
421
|
+
/** component に基づいて valuedown/up 用の target asset 生成 */
|
|
422
|
+
targetAsset: targetAssetComponentSchema.optional(),
|
|
396
423
|
/** component に基づいて transfer 生成 */
|
|
397
424
|
transfers: z.array(transferComponentSchema),
|
|
398
425
|
})
|
package/analyzer/json/types.ts
CHANGED
|
@@ -36,6 +36,7 @@ import type {
|
|
|
36
36
|
logArgumentComponentSchema,
|
|
37
37
|
logArgumentRawComponentSchema,
|
|
38
38
|
logArgumentValueConditionSchema,
|
|
39
|
+
targetAssetComponentSchema,
|
|
39
40
|
transferComponentSchema,
|
|
40
41
|
transferCustomAddressComponentSchema,
|
|
41
42
|
transferCustomAmountComponentSchema,
|
|
@@ -132,6 +133,8 @@ export type TransferCustomAmountComponent = z.infer<
|
|
|
132
133
|
typeof transferCustomAmountComponentSchema
|
|
133
134
|
>
|
|
134
135
|
|
|
136
|
+
export type TargetAssetComponent = z.infer<typeof targetAssetComponentSchema>
|
|
137
|
+
|
|
135
138
|
export type TransferComponent = z.infer<typeof transferComponentSchema>
|
|
136
139
|
|
|
137
140
|
export type Target<Price extends CryptoCurrencyPrice | undefined> = {
|
package/index.ts
CHANGED