-
Notifications
You must be signed in to change notification settings - Fork 42
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 #43 from confio/ica-types
Add ibc.applications.interchain_accounts types
- Loading branch information
Showing
10 changed files
with
1,501 additions
and
0 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
89 changes: 89 additions & 0 deletions
89
src/ibc/applications/interchain_accounts/controller/v1/controller.ts
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,89 @@ | ||
/* eslint-disable */ | ||
import Long from "long"; | ||
import _m0 from "protobufjs/minimal"; | ||
|
||
export const protobufPackage = "ibc.applications.interchain_accounts.controller.v1"; | ||
|
||
/** | ||
* Params defines the set of on-chain interchain accounts parameters. | ||
* The following parameters may be used to disable the controller submodule. | ||
*/ | ||
export interface Params { | ||
/** controller_enabled enables or disables the controller submodule. */ | ||
controllerEnabled: boolean; | ||
} | ||
|
||
function createBaseParams(): Params { | ||
return { controllerEnabled: false }; | ||
} | ||
|
||
export const Params = { | ||
encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.controllerEnabled === true) { | ||
writer.uint32(8).bool(message.controllerEnabled); | ||
} | ||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): Params { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseParams(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.controllerEnabled = reader.bool(); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
|
||
fromJSON(object: any): Params { | ||
return { controllerEnabled: isSet(object.controllerEnabled) ? Boolean(object.controllerEnabled) : false }; | ||
}, | ||
|
||
toJSON(message: Params): unknown { | ||
const obj: any = {}; | ||
message.controllerEnabled !== undefined && (obj.controllerEnabled = message.controllerEnabled); | ||
return obj; | ||
}, | ||
|
||
fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params { | ||
const message = createBaseParams(); | ||
message.controllerEnabled = object.controllerEnabled ?? false; | ||
return message; | ||
}, | ||
}; | ||
|
||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; | ||
|
||
export type DeepPartial<T> = T extends Builtin | ||
? T | ||
: T extends Long | ||
? string | number | Long | ||
: T extends Array<infer U> | ||
? Array<DeepPartial<U>> | ||
: T extends ReadonlyArray<infer U> | ||
? ReadonlyArray<DeepPartial<U>> | ||
: T extends {} | ||
? { [K in keyof T]?: DeepPartial<T[K]> } | ||
: Partial<T>; | ||
|
||
type KeysOfUnion<T> = T extends T ? keyof T : never; | ||
export type Exact<P, I extends P> = P extends Builtin | ||
? P | ||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never }; | ||
|
||
if (_m0.util.Long !== Long) { | ||
_m0.util.Long = Long as any; | ||
_m0.configure(); | ||
} | ||
|
||
function isSet(value: any): boolean { | ||
return value !== null && value !== undefined; | ||
} |
157 changes: 157 additions & 0 deletions
157
src/ibc/applications/interchain_accounts/controller/v1/query.ts
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,157 @@ | ||
/* eslint-disable */ | ||
import Long from "long"; | ||
import _m0 from "protobufjs/minimal"; | ||
import { Params } from "./controller"; | ||
|
||
export const protobufPackage = "ibc.applications.interchain_accounts.controller.v1"; | ||
|
||
/** QueryParamsRequest is the request type for the Query/Params RPC method. */ | ||
export interface QueryParamsRequest {} | ||
|
||
/** QueryParamsResponse is the response type for the Query/Params RPC method. */ | ||
export interface QueryParamsResponse { | ||
/** params defines the parameters of the module. */ | ||
params?: Params; | ||
} | ||
|
||
function createBaseQueryParamsRequest(): QueryParamsRequest { | ||
return {}; | ||
} | ||
|
||
export const QueryParamsRequest = { | ||
encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseQueryParamsRequest(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
|
||
fromJSON(_: any): QueryParamsRequest { | ||
return {}; | ||
}, | ||
|
||
toJSON(_: QueryParamsRequest): unknown { | ||
const obj: any = {}; | ||
return obj; | ||
}, | ||
|
||
fromPartial<I extends Exact<DeepPartial<QueryParamsRequest>, I>>(_: I): QueryParamsRequest { | ||
const message = createBaseQueryParamsRequest(); | ||
return message; | ||
}, | ||
}; | ||
|
||
function createBaseQueryParamsResponse(): QueryParamsResponse { | ||
return { params: undefined }; | ||
} | ||
|
||
export const QueryParamsResponse = { | ||
encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.params !== undefined) { | ||
Params.encode(message.params, writer.uint32(10).fork()).ldelim(); | ||
} | ||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseQueryParamsResponse(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.params = Params.decode(reader, reader.uint32()); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
|
||
fromJSON(object: any): QueryParamsResponse { | ||
return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; | ||
}, | ||
|
||
toJSON(message: QueryParamsResponse): unknown { | ||
const obj: any = {}; | ||
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); | ||
return obj; | ||
}, | ||
|
||
fromPartial<I extends Exact<DeepPartial<QueryParamsResponse>, I>>(object: I): QueryParamsResponse { | ||
const message = createBaseQueryParamsResponse(); | ||
message.params = | ||
object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; | ||
return message; | ||
}, | ||
}; | ||
|
||
/** Query provides defines the gRPC querier service. */ | ||
export interface Query { | ||
/** Params queries all parameters of the ICA controller submodule. */ | ||
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>; | ||
} | ||
|
||
export class QueryClientImpl implements Query { | ||
private readonly rpc: Rpc; | ||
constructor(rpc: Rpc) { | ||
this.rpc = rpc; | ||
this.Params = this.Params.bind(this); | ||
} | ||
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> { | ||
const data = QueryParamsRequest.encode(request).finish(); | ||
const promise = this.rpc.request( | ||
"ibc.applications.interchain_accounts.controller.v1.Query", | ||
"Params", | ||
data, | ||
); | ||
return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); | ||
} | ||
} | ||
|
||
interface Rpc { | ||
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>; | ||
} | ||
|
||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; | ||
|
||
export type DeepPartial<T> = T extends Builtin | ||
? T | ||
: T extends Long | ||
? string | number | Long | ||
: T extends Array<infer U> | ||
? Array<DeepPartial<U>> | ||
: T extends ReadonlyArray<infer U> | ||
? ReadonlyArray<DeepPartial<U>> | ||
: T extends {} | ||
? { [K in keyof T]?: DeepPartial<T[K]> } | ||
: Partial<T>; | ||
|
||
type KeysOfUnion<T> = T extends T ? keyof T : never; | ||
export type Exact<P, I extends P> = P extends Builtin | ||
? P | ||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never }; | ||
|
||
if (_m0.util.Long !== Long) { | ||
_m0.util.Long = Long as any; | ||
_m0.configure(); | ||
} | ||
|
||
function isSet(value: any): boolean { | ||
return value !== null && value !== undefined; | ||
} |
108 changes: 108 additions & 0 deletions
108
src/ibc/applications/interchain_accounts/host/v1/host.ts
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,108 @@ | ||
/* eslint-disable */ | ||
import Long from "long"; | ||
import _m0 from "protobufjs/minimal"; | ||
|
||
export const protobufPackage = "ibc.applications.interchain_accounts.host.v1"; | ||
|
||
/** | ||
* Params defines the set of on-chain interchain accounts parameters. | ||
* The following parameters may be used to disable the host submodule. | ||
*/ | ||
export interface Params { | ||
/** host_enabled enables or disables the host submodule. */ | ||
hostEnabled: boolean; | ||
/** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ | ||
allowMessages: string[]; | ||
} | ||
|
||
function createBaseParams(): Params { | ||
return { hostEnabled: false, allowMessages: [] }; | ||
} | ||
|
||
export const Params = { | ||
encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.hostEnabled === true) { | ||
writer.uint32(8).bool(message.hostEnabled); | ||
} | ||
for (const v of message.allowMessages) { | ||
writer.uint32(18).string(v!); | ||
} | ||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): Params { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseParams(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.hostEnabled = reader.bool(); | ||
break; | ||
case 2: | ||
message.allowMessages.push(reader.string()); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
|
||
fromJSON(object: any): Params { | ||
return { | ||
hostEnabled: isSet(object.hostEnabled) ? Boolean(object.hostEnabled) : false, | ||
allowMessages: Array.isArray(object?.allowMessages) | ||
? object.allowMessages.map((e: any) => String(e)) | ||
: [], | ||
}; | ||
}, | ||
|
||
toJSON(message: Params): unknown { | ||
const obj: any = {}; | ||
message.hostEnabled !== undefined && (obj.hostEnabled = message.hostEnabled); | ||
if (message.allowMessages) { | ||
obj.allowMessages = message.allowMessages.map((e) => e); | ||
} else { | ||
obj.allowMessages = []; | ||
} | ||
return obj; | ||
}, | ||
|
||
fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params { | ||
const message = createBaseParams(); | ||
message.hostEnabled = object.hostEnabled ?? false; | ||
message.allowMessages = object.allowMessages?.map((e) => e) || []; | ||
return message; | ||
}, | ||
}; | ||
|
||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; | ||
|
||
export type DeepPartial<T> = T extends Builtin | ||
? T | ||
: T extends Long | ||
? string | number | Long | ||
: T extends Array<infer U> | ||
? Array<DeepPartial<U>> | ||
: T extends ReadonlyArray<infer U> | ||
? ReadonlyArray<DeepPartial<U>> | ||
: T extends {} | ||
? { [K in keyof T]?: DeepPartial<T[K]> } | ||
: Partial<T>; | ||
|
||
type KeysOfUnion<T> = T extends T ? keyof T : never; | ||
export type Exact<P, I extends P> = P extends Builtin | ||
? P | ||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never }; | ||
|
||
if (_m0.util.Long !== Long) { | ||
_m0.util.Long = Long as any; | ||
_m0.configure(); | ||
} | ||
|
||
function isSet(value: any): boolean { | ||
return value !== null && value !== undefined; | ||
} |
Oops, something went wrong.