-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added neutron's adminmodule protobufs
- Loading branch information
Showing
57 changed files
with
2,890 additions
and
1,033 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
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
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
93 changes: 93 additions & 0 deletions
93
packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/genesis.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,93 @@ | ||
//@ts-nocheck | ||
import { BinaryReader, BinaryWriter } from "../../../binary"; | ||
/** GenesisState defines the adminmodule module's genesis state. */ | ||
export interface GenesisState { | ||
admins: string[]; | ||
} | ||
export interface GenesisStateProtoMsg { | ||
typeUrl: "/cosmos.adminmodule.adminmodule.GenesisState"; | ||
value: Uint8Array; | ||
} | ||
/** GenesisState defines the adminmodule module's genesis state. */ | ||
export interface GenesisStateAmino { | ||
admins?: string[]; | ||
} | ||
export interface GenesisStateAminoMsg { | ||
type: "cosmos-sdk/GenesisState"; | ||
value: GenesisStateAmino; | ||
} | ||
/** GenesisState defines the adminmodule module's genesis state. */ | ||
export interface GenesisStateSDKType { | ||
admins: string[]; | ||
} | ||
function createBaseGenesisState(): GenesisState { | ||
return { | ||
admins: [] | ||
}; | ||
} | ||
export const GenesisState = { | ||
typeUrl: "/cosmos.adminmodule.adminmodule.GenesisState", | ||
encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { | ||
for (const v of message.admins) { | ||
writer.uint32(10).string(v!); | ||
} | ||
return writer; | ||
}, | ||
decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { | ||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseGenesisState(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.admins.push(reader.string()); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromPartial(object: Partial<GenesisState>): GenesisState { | ||
const message = createBaseGenesisState(); | ||
message.admins = object.admins?.map(e => e) || []; | ||
return message; | ||
}, | ||
fromAmino(object: GenesisStateAmino): GenesisState { | ||
const message = createBaseGenesisState(); | ||
message.admins = object.admins?.map(e => e) || []; | ||
return message; | ||
}, | ||
toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { | ||
const obj: any = {}; | ||
if (message.admins) { | ||
obj.admins = message.admins.map(e => e); | ||
} else { | ||
obj.admins = []; | ||
} | ||
return obj; | ||
}, | ||
fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { | ||
return GenesisState.fromAmino(object.value); | ||
}, | ||
toAminoMsg(message: GenesisState, useInterfaces: boolean = false): GenesisStateAminoMsg { | ||
return { | ||
type: "cosmos-sdk/GenesisState", | ||
value: GenesisState.toAmino(message, useInterfaces) | ||
}; | ||
}, | ||
fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { | ||
return GenesisState.decode(message.value, undefined, useInterfaces); | ||
}, | ||
toProto(message: GenesisState): Uint8Array { | ||
return GenesisState.encode(message).finish(); | ||
}, | ||
toProtoMsg(message: GenesisState): GenesisStateProtoMsg { | ||
return { | ||
typeUrl: "/cosmos.adminmodule.adminmodule.GenesisState", | ||
value: GenesisState.encode(message).finish() | ||
}; | ||
} | ||
}; |
52 changes: 52 additions & 0 deletions
52
packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.rpc.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,52 @@ | ||
import { Rpc } from "../../../helpers"; | ||
import { BinaryReader } from "../../../binary"; | ||
import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; | ||
import { QueryAdminsRequest, QueryAdminsResponse, QueryArchivedProposalsRequest, QueryArchivedProposalsResponse, QueryArchivedProposalsLegacyRequest, QueryArchivedProposalsLegacyResponse } from "./query"; | ||
/** Query defines the gRPC querier service. */ | ||
export interface Query { | ||
/** Queries a list of admins items. */ | ||
admins(request?: QueryAdminsRequest): Promise<QueryAdminsResponse>; | ||
/** Queries a list of archived proposals. */ | ||
archivedProposals(request?: QueryArchivedProposalsRequest): Promise<QueryArchivedProposalsResponse>; | ||
/** Queries a list of archived proposals. */ | ||
archivedProposalsLegacy(request?: QueryArchivedProposalsLegacyRequest): Promise<QueryArchivedProposalsLegacyResponse>; | ||
} | ||
export class QueryClientImpl implements Query { | ||
private readonly rpc: Rpc; | ||
constructor(rpc: Rpc) { | ||
this.rpc = rpc; | ||
this.admins = this.admins.bind(this); | ||
this.archivedProposals = this.archivedProposals.bind(this); | ||
this.archivedProposalsLegacy = this.archivedProposalsLegacy.bind(this); | ||
} | ||
admins(request: QueryAdminsRequest = {}, useInterfaces: boolean = true): Promise<QueryAdminsResponse> { | ||
const data = QueryAdminsRequest.encode(request).finish(); | ||
const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Query", "Admins", data); | ||
return promise.then(data => QueryAdminsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); | ||
} | ||
archivedProposals(request: QueryArchivedProposalsRequest = {}, useInterfaces: boolean = true): Promise<QueryArchivedProposalsResponse> { | ||
const data = QueryArchivedProposalsRequest.encode(request).finish(); | ||
const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Query", "ArchivedProposals", data); | ||
return promise.then(data => QueryArchivedProposalsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); | ||
} | ||
archivedProposalsLegacy(request: QueryArchivedProposalsLegacyRequest = {}, useInterfaces: boolean = true): Promise<QueryArchivedProposalsLegacyResponse> { | ||
const data = QueryArchivedProposalsLegacyRequest.encode(request).finish(); | ||
const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Query", "ArchivedProposalsLegacy", data); | ||
return promise.then(data => QueryArchivedProposalsLegacyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); | ||
} | ||
} | ||
export const createRpcQueryExtension = (base: QueryClient) => { | ||
const rpc = createProtobufRpcClient(base); | ||
const queryService = new QueryClientImpl(rpc); | ||
return { | ||
admins(request?: QueryAdminsRequest, useInterfaces: boolean = true): Promise<QueryAdminsResponse> { | ||
return queryService.admins(request, useInterfaces); | ||
}, | ||
archivedProposals(request?: QueryArchivedProposalsRequest, useInterfaces: boolean = true): Promise<QueryArchivedProposalsResponse> { | ||
return queryService.archivedProposals(request, useInterfaces); | ||
}, | ||
archivedProposalsLegacy(request?: QueryArchivedProposalsLegacyRequest, useInterfaces: boolean = true): Promise<QueryArchivedProposalsLegacyResponse> { | ||
return queryService.archivedProposalsLegacy(request, useInterfaces); | ||
} | ||
}; | ||
}; |
Oops, something went wrong.