stargate: Rename Rpc -> ProtobufRpcClient
This commit is contained in:
parent
f463473284
commit
dc4c48bcc5
@ -5,11 +5,11 @@ export {
|
||||
AuthExtension,
|
||||
BankExtension,
|
||||
createPagination,
|
||||
createRpc,
|
||||
createProtobufRpcClient,
|
||||
DistributionExtension,
|
||||
IbcExtension,
|
||||
ProtobufRpcClient,
|
||||
QueryClient,
|
||||
Rpc,
|
||||
setupAuthExtension,
|
||||
setupBankExtension,
|
||||
setupDistributionExtension,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { QueryClientImpl } from "../codec/cosmos/auth/v1beta1/query";
|
||||
import { Any } from "../codec/google/protobuf/any";
|
||||
import { QueryClient } from "./queryclient";
|
||||
import { createRpc, toAccAddress } from "./utils";
|
||||
import { createProtobufRpcClient, toAccAddress } from "./utils";
|
||||
|
||||
export interface AuthExtension {
|
||||
readonly auth: {
|
||||
@ -27,7 +27,7 @@ export interface AuthExtension {
|
||||
}
|
||||
|
||||
export function setupAuthExtension(base: QueryClient): AuthExtension {
|
||||
const rpc = createRpc(base);
|
||||
const rpc = createProtobufRpcClient(base);
|
||||
// Use this service to get easy typed access to query methods
|
||||
// This cannot be used for proof verification
|
||||
const queryService = new QueryClientImpl(rpc);
|
||||
|
||||
@ -5,7 +5,7 @@ import { assert } from "@cosmjs/utils";
|
||||
import { QueryClientImpl } from "../codec/cosmos/bank/v1beta1/query";
|
||||
import { Coin } from "../codec/cosmos/base/v1beta1/coin";
|
||||
import { QueryClient } from "./queryclient";
|
||||
import { createRpc, toAccAddress } from "./utils";
|
||||
import { createProtobufRpcClient, toAccAddress } from "./utils";
|
||||
|
||||
export interface BankExtension {
|
||||
readonly bank: {
|
||||
@ -20,7 +20,7 @@ export interface BankExtension {
|
||||
}
|
||||
|
||||
export function setupBankExtension(base: QueryClient): BankExtension {
|
||||
const rpc = createRpc(base);
|
||||
const rpc = createProtobufRpcClient(base);
|
||||
// Use this service to get easy typed access to query methods
|
||||
// This cannot be used for proof verification
|
||||
const queryService = new QueryClientImpl(rpc);
|
||||
|
||||
@ -14,7 +14,7 @@ import {
|
||||
QueryValidatorSlashesResponse,
|
||||
} from "../codec/cosmos/distribution/v1beta1/query";
|
||||
import { QueryClient } from "./queryclient";
|
||||
import { createPagination, createRpc } from "./utils";
|
||||
import { createPagination, createProtobufRpcClient } from "./utils";
|
||||
|
||||
export interface DistributionExtension {
|
||||
readonly distribution: {
|
||||
@ -43,7 +43,7 @@ export interface DistributionExtension {
|
||||
}
|
||||
|
||||
export function setupDistributionExtension(base: QueryClient): DistributionExtension {
|
||||
const rpc = createRpc(base);
|
||||
const rpc = createProtobufRpcClient(base);
|
||||
// Use this service to get easy typed access to query methods
|
||||
// This cannot be used for proof verification
|
||||
const queryService = new QueryClientImpl(rpc);
|
||||
|
||||
@ -24,7 +24,7 @@ import {
|
||||
QueryConnectionsResponse,
|
||||
} from "../codec/ibc/core/connection/v1/query";
|
||||
import { QueryClient } from "./queryclient";
|
||||
import { createPagination, createRpc } from "./utils";
|
||||
import { createPagination, createProtobufRpcClient } from "./utils";
|
||||
|
||||
export interface IbcExtension {
|
||||
readonly ibc: {
|
||||
@ -89,7 +89,7 @@ export interface IbcExtension {
|
||||
}
|
||||
|
||||
export function setupIbcExtension(base: QueryClient): IbcExtension {
|
||||
const rpc = createRpc(base);
|
||||
const rpc = createProtobufRpcClient(base);
|
||||
// Use these services to get easy typed access to query methods
|
||||
// These cannot be used for proof verification
|
||||
const channelQueryService = new ChannelQuery(rpc);
|
||||
|
||||
@ -9,4 +9,4 @@ export { BankExtension, setupBankExtension } from "./bank";
|
||||
export { DistributionExtension, setupDistributionExtension } from "./distribution";
|
||||
export { IbcExtension, setupIbcExtension } from "./ibc";
|
||||
export { setupStakingExtension, StakingExtension } from "./staking";
|
||||
export { createPagination, createRpc, Rpc } from "./utils";
|
||||
export { createPagination, createProtobufRpcClient, ProtobufRpcClient } from "./utils";
|
||||
|
||||
@ -20,7 +20,7 @@ import {
|
||||
} from "../codec/cosmos/staking/v1beta1/query";
|
||||
import { BondStatus } from "../codec/cosmos/staking/v1beta1/staking";
|
||||
import { QueryClient } from "./queryclient";
|
||||
import { createPagination, createRpc } from "./utils";
|
||||
import { createPagination, createProtobufRpcClient } from "./utils";
|
||||
|
||||
export type BondStatusString = Exclude<keyof typeof BondStatus, "BOND_STATUS_UNSPECIFIED">;
|
||||
|
||||
@ -74,7 +74,7 @@ export interface StakingExtension {
|
||||
export function setupStakingExtension(base: QueryClient): StakingExtension {
|
||||
// Use this service to get easy typed access to query methods
|
||||
// This cannot be used for proof verification
|
||||
const rpc = createRpc(base);
|
||||
const rpc = createProtobufRpcClient(base);
|
||||
const queryService = new QueryClientImpl(rpc);
|
||||
|
||||
return {
|
||||
|
||||
@ -24,11 +24,11 @@ export function createPagination(paginationKey?: Uint8Array): PageRequest | unde
|
||||
: undefined;
|
||||
}
|
||||
|
||||
export interface Rpc {
|
||||
export interface ProtobufRpcClient {
|
||||
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
export function createRpc(base: QueryClient): Rpc {
|
||||
export function createProtobufRpcClient(base: QueryClient): ProtobufRpcClient {
|
||||
return {
|
||||
request: (service: string, method: string, data: Uint8Array): Promise<Uint8Array> => {
|
||||
const path = `/${service}/${method}`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user