Skip to content

Commit

Permalink
update initia registry types package
Browse files Browse the repository at this point in the history
  • Loading branch information
ALPAC-4 committed Nov 7, 2024
1 parent 100538b commit e9eb1e1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion _packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@initia/initia-registry-types",
"version": "0.0.20",
"version": "0.0.21",
"description": "The package provides TypeScript type definitions and Zod integration for initia-registry.",
"types": "./dist/types/index.d.ts",
"exports": {
Expand Down
17 changes: 12 additions & 5 deletions _packages/types/src/types/Chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface Chain {
key_algos?: ("secp256k1" | "ethsecp256k1" | "ed25519" | "sr25519" | "bn254")[];
slip44?: number;
alternative_slip44s?: number[];
fees?: {
fees: {
fee_tokens: FeeToken[];
};
staking?: {
Expand Down Expand Up @@ -186,10 +186,10 @@ export interface Chain {
seeds?: Peer[];
persistent_peers?: Peer[];
};
apis?: {
rpc?: Endpoint[];
rest?: Endpoint[];
api?: Endpoint[];
apis: {
rpc: SecureEndpoint[];
rest: SecureEndpoint[];
api?: SecureEndpoint[];
grpc?: Endpoint[];
wss?: Endpoint[];
"grpc-web"?: Endpoint[];
Expand Down Expand Up @@ -269,6 +269,13 @@ export interface Peer {
address: string;
provider?: string;
}
export interface SecureEndpoint {
address: string;
provider?: string;
archive?: boolean;
authorizedUser?: string;
indexForSkip?: number;
}
export interface Endpoint {
address: string;
provider?: string;
Expand Down
56 changes: 25 additions & 31 deletions _packages/types/src/zods/Chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export const ChainSchema = z
.strict()
),
})
.strict()
.optional(),
.strict(),
staking: z
.object({
staking_tokens: z.array(
Expand Down Expand Up @@ -329,37 +328,33 @@ export const ChainSchema = z
.optional(),
apis: z
.object({
rpc: z
.array(
z
.object({
address: z.string().url(),
provider: z.string().optional(),
archive: z.boolean().default(false),
authorizedUser: z.string().optional(),
indexForSkip: z.number().optional(),
})
.strict()
)
.optional(),
rest: z
.array(
z
.object({
address: z.string().url(),
provider: z.string().optional(),
archive: z.boolean().default(false),
authorizedUser: z.string().optional(),
indexForSkip: z.number().optional(),
})
.strict()
)
.optional(),
rpc: z.array(
z
.object({
address: z.string().url().regex(new RegExp("^https://.")),
provider: z.string().optional(),
archive: z.boolean().default(false),
authorizedUser: z.string().optional(),
indexForSkip: z.number().optional(),
})
.strict()
),
rest: z.array(
z
.object({
address: z.string().url().regex(new RegExp("^https://.")),
provider: z.string().optional(),
archive: z.boolean().default(false),
authorizedUser: z.string().optional(),
indexForSkip: z.number().optional(),
})
.strict()
),
api: z
.array(
z
.object({
address: z.string().url(),
address: z.string().url().regex(new RegExp("^https://.")),
provider: z.string().optional(),
archive: z.boolean().default(false),
authorizedUser: z.string().optional(),
Expand Down Expand Up @@ -421,8 +416,7 @@ export const ChainSchema = z
)
.optional(),
})
.strict()
.optional(),
.strict(),
explorers: z
.array(
z
Expand Down

0 comments on commit e9eb1e1

Please sign in to comment.