forked from elizaOS/eliza
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request elizaOS#2017 from mgavrila/fix/amg/multiversx_plugin
fix: fix multiversx-plugin
- Loading branch information
Showing
3 changed files
with
52 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { z } from "zod"; | ||
|
||
export const createTokenSchema = z.object({ | ||
tokenName: z.string().min(1, { message: "Token name is required." }), | ||
tokenTicker: z.string().min(1, { message: "Token ticker is required." }), | ||
amount: z | ||
.number() | ||
.positive({ message: "Amount must be a positive number." }), | ||
decimals: z | ||
.number() | ||
.int() | ||
.min(0, { message: "Decimals must be at least 0" }) | ||
.max(18, { message: "Decimals must be at most 18" }) | ||
.nullable() | ||
.optional(), | ||
}); | ||
|
||
export const transferSchema = z.object({ | ||
tokenAddress: z.string().min(1, { message: "Token address is required." }), | ||
amount: z.string().min(1, { message: "Amount is required." }), | ||
tokenIdentifier: z | ||
.string() | ||
.transform((val) => (val === "null" ? null : val)) | ||
.nullable() | ||
.optional(), | ||
}); |