diff --git a/_package/src/types/Chain.ts b/_package/src/types/Chain.ts index 82f0f77..90d88fa 100644 --- a/_package/src/types/Chain.ts +++ b/_package/src/types/Chain.ts @@ -230,9 +230,9 @@ export interface Chain { | { channel?: { chain_id: string; - port_id?: string; - channel_id?: string; - version?: string; + port_id: string; + channel_id: string; + version: string; }[]; } | { @@ -240,7 +240,7 @@ export interface Chain { chain_id: string; transfer?: string; "nft-transfer"?: string; - }; + }[]; }; }; } diff --git a/_package/src/zods/Chain.ts b/_package/src/zods/Chain.ts index 1ff6d59..b262982 100644 --- a/_package/src/zods/Chain.ts +++ b/_package/src/zods/Chain.ts @@ -506,9 +506,9 @@ export const ChainSchema = z z .object({ chain_id: z.string(), - port_id: z.string().optional(), - channel_id: z.string().optional(), - version: z.string().optional(), + port_id: z.string(), + channel_id: z.string(), + version: z.string(), }) .strict() ) @@ -518,12 +518,15 @@ export const ChainSchema = z z .object({ channel: z - .object({ - chain_id: z.string(), - transfer: z.string().optional(), - "nft-transfer": z.string().optional(), - }) - .strict() + .array( + z + .object({ + chain_id: z.string(), + transfer: z.string().optional(), + "nft-transfer": z.string().optional(), + }) + .strict() + ) .optional(), }) .strict(), diff --git a/chain.schema.json b/chain.schema.json index bd9f635..b3db16e 100644 --- a/chain.schema.json +++ b/chain.schema.json @@ -648,7 +648,10 @@ "items": { "type": "object", "required": [ - "chain_id" + "chain_id", + "port_id", + "channel_id", + "version" ], "properties": { "chain_id": { @@ -674,20 +677,25 @@ "type": "object", "properties": { "channel": { - "type": "object", - "properties": { - "chain_id": { - "type": "string" - }, - "transfer": { - "type": "string" + "type": "array", + "items": { + "type": "object", + "required": [ + "chain_id" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "transfer": { + "type": "string" + }, + "nft-transfer": { + "type": "string" + } }, - "nft-transfer": { - "type": "string" - } - }, - "additionalProperties": false, - "required": ["chain_id"] + "additionalProperties": false + } } }, "additionalProperties": false