-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4f39a8
commit 4de89dd
Showing
3 changed files
with
381 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { CanisterIdTextSchema } from '$lib/types/canister'; | ||
import { CoingeckoCoinsIdSchema } from '$lib/types/coingecko'; | ||
import { TokenSchema } from '$lib/types/token'; | ||
import { UrlSchema } from '$lib/validation/url.validation'; | ||
import { z } from 'zod'; | ||
|
||
export const IcFeeSchema = z.object({ | ||
fee: z.bigint() | ||
}); | ||
|
||
export const IcAppMetadataSchema = z.object({ | ||
exchangeCoinId: CoingeckoCoinsIdSchema.optional(), | ||
position: z.number(), | ||
explorerUrl: UrlSchema.optional() | ||
}); | ||
|
||
export const IcCanistersSchema = z.object({ | ||
ledgerCanisterId: CanisterIdTextSchema, | ||
indexCanisterId: CanisterIdTextSchema | ||
}); | ||
|
||
export const IcCkLinkedAssetsSchema = z.object({ | ||
twinToken: TokenSchema, | ||
feeLedgerCanisterId: CanisterIdTextSchema.optional() | ||
}); | ||
|
||
export const IcCkMetadataSchema = IcCkLinkedAssetsSchema.partial().extend({ | ||
minterCanisterId: CanisterIdTextSchema | ||
}); | ||
|
||
export const IcInterfaceSchema = IcCanistersSchema.merge(IcAppMetadataSchema); | ||
|
||
export const IcTokenSchema = TokenSchema.merge(IcFeeSchema).merge(IcInterfaceSchema); | ||
|
||
export const IcTokenWithoutIdSchema = IcTokenSchema.omit({ id: true }).strict(); | ||
|
||
export const IcCkTokenSchema = IcTokenSchema.merge(IcCkMetadataSchema.partial()); | ||
|
||
export const IcCkInterfaceSchema = IcInterfaceSchema.merge(IcCkMetadataSchema); |
Oops, something went wrong.