stargate: Clarify pagination type in createPagination
This commit is contained in:
parent
c33bd47648
commit
90246140f8
11
packages/stargate/build/queries/utils.d.ts
vendored
11
packages/stargate/build/queries/utils.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import Long from "long";
|
||||
import { PageRequest } from "../codec/cosmos/base/query/v1beta1/pagination";
|
||||
import { QueryClient } from "./queryclient";
|
||||
/**
|
||||
* Takes a bech32 encoded address and returns the data part. The prefix is ignored and discarded.
|
||||
@ -6,14 +6,7 @@ import { QueryClient } from "./queryclient";
|
||||
* The result is typically 20 bytes long but not restricted to that.
|
||||
*/
|
||||
export declare function toAccAddress(address: string): Uint8Array;
|
||||
export declare function createPagination(
|
||||
paginationKey?: Uint8Array,
|
||||
): {
|
||||
readonly key: Uint8Array;
|
||||
readonly offset: Long;
|
||||
readonly limit: Long;
|
||||
readonly countTotal: boolean;
|
||||
};
|
||||
export declare function createPagination(paginationKey?: Uint8Array): PageRequest | undefined;
|
||||
interface Rpc {
|
||||
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Bech32 } from "@cosmjs/encoding";
|
||||
import Long from "long";
|
||||
|
||||
import { PageRequest } from "../codec/cosmos/base/query/v1beta1/pagination";
|
||||
import { QueryClient } from "./queryclient";
|
||||
|
||||
/**
|
||||
@ -12,20 +13,15 @@ export function toAccAddress(address: string): Uint8Array {
|
||||
return Bech32.decode(address).data;
|
||||
}
|
||||
|
||||
export function createPagination(
|
||||
paginationKey?: Uint8Array,
|
||||
): {
|
||||
readonly key: Uint8Array;
|
||||
readonly offset: Long;
|
||||
readonly limit: Long;
|
||||
readonly countTotal: boolean;
|
||||
} {
|
||||
return {
|
||||
key: paginationKey ?? new Uint8Array(),
|
||||
offset: Long.fromNumber(0, true),
|
||||
limit: Long.fromNumber(0, true),
|
||||
countTotal: false,
|
||||
};
|
||||
export function createPagination(paginationKey?: Uint8Array): PageRequest | undefined {
|
||||
return paginationKey
|
||||
? {
|
||||
key: paginationKey,
|
||||
offset: Long.fromNumber(0, true),
|
||||
limit: Long.fromNumber(0, true),
|
||||
countTotal: false,
|
||||
}
|
||||
: undefined;
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user