Skip to content

Commit

Permalink
fix: fix mahalo type
Browse files Browse the repository at this point in the history
  • Loading branch information
ALPAC-4 committed Mar 19, 2024
1 parent 4548469 commit b160be4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 27 deletions.
8 changes: 4 additions & 4 deletions _package/src/types/Chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,17 @@ export interface Chain {
| {
channel?: {
chain_id: string;
port_id?: string;
channel_id?: string;
version?: string;
port_id: string;
channel_id: string;
version: string;
}[];
}
| {
channel?: {
chain_id: string;
transfer?: string;
"nft-transfer"?: string;
};
}[];
};
};
}
Expand Down
21 changes: 12 additions & 9 deletions _package/src/zods/Chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand All @@ -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(),
Expand Down
36 changes: 22 additions & 14 deletions chain.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,10 @@
"items": {
"type": "object",
"required": [
"chain_id"
"chain_id",
"port_id",
"channel_id",
"version"
],
"properties": {
"chain_id": {
Expand All @@ -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
Expand Down

0 comments on commit b160be4

Please sign in to comment.