stargate: Export some types and functions
This commit is contained in:
parent
e61675f5ce
commit
17a433646a
@ -1,4 +1,5 @@
|
||||
export * as codec from "./codec";
|
||||
export { getMsgType, getMsgTypeUrl } from "./encoding";
|
||||
export {
|
||||
AuthExtension,
|
||||
BankExtension,
|
||||
@ -8,5 +9,17 @@ export {
|
||||
setupBankExtension,
|
||||
setupIbcExtension,
|
||||
} from "./queries";
|
||||
export { assertIsBroadcastTxSuccess, StargateClient } from "./stargateclient";
|
||||
export {
|
||||
Account,
|
||||
accountFromProto,
|
||||
assertIsBroadcastTxSuccess,
|
||||
BroadcastTxFailure,
|
||||
BroadcastTxResponse,
|
||||
BroadcastTxSuccess,
|
||||
coinFromProto,
|
||||
IndexedTx,
|
||||
isBroadcastTxFailure,
|
||||
SequenceResponse,
|
||||
StargateClient,
|
||||
} from "./stargateclient";
|
||||
export { SigningStargateClient } from "./signingstargateclient";
|
||||
|
||||
@ -92,7 +92,7 @@ function uint64FromProto(input: number | Long | null | undefined): Uint64 {
|
||||
return Uint64.fromString(input.toString());
|
||||
}
|
||||
|
||||
function accountFromProto(input: cosmos.auth.v1beta1.IBaseAccount): Account {
|
||||
export function accountFromProto(input: cosmos.auth.v1beta1.IBaseAccount): Account {
|
||||
const { address, pubKey, accountNumber, sequence } = input;
|
||||
const pubkey = decodePubkey(pubKey);
|
||||
assert(address);
|
||||
@ -104,7 +104,7 @@ function accountFromProto(input: cosmos.auth.v1beta1.IBaseAccount): Account {
|
||||
};
|
||||
}
|
||||
|
||||
function coinFromProto(input: cosmos.base.v1beta1.ICoin): Coin {
|
||||
export function coinFromProto(input: cosmos.base.v1beta1.ICoin): Coin {
|
||||
assertDefined(input.amount);
|
||||
assertDefined(input.denom);
|
||||
assert(input.amount !== null);
|
||||
|
||||
15
packages/stargate/types/index.d.ts
vendored
15
packages/stargate/types/index.d.ts
vendored
@ -1,4 +1,5 @@
|
||||
export * as codec from "./codec";
|
||||
export { getMsgType, getMsgTypeUrl } from "./encoding";
|
||||
export {
|
||||
AuthExtension,
|
||||
BankExtension,
|
||||
@ -8,5 +9,17 @@ export {
|
||||
setupBankExtension,
|
||||
setupIbcExtension,
|
||||
} from "./queries";
|
||||
export { assertIsBroadcastTxSuccess, StargateClient } from "./stargateclient";
|
||||
export {
|
||||
Account,
|
||||
accountFromProto,
|
||||
assertIsBroadcastTxSuccess,
|
||||
BroadcastTxFailure,
|
||||
BroadcastTxResponse,
|
||||
BroadcastTxSuccess,
|
||||
coinFromProto,
|
||||
IndexedTx,
|
||||
isBroadcastTxFailure,
|
||||
SequenceResponse,
|
||||
StargateClient,
|
||||
} from "./stargateclient";
|
||||
export { SigningStargateClient } from "./signingstargateclient";
|
||||
|
||||
3
packages/stargate/types/stargateclient.d.ts
vendored
3
packages/stargate/types/stargateclient.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
import { Block, Coin, PubKey, SearchTxFilter, SearchTxQuery } from "@cosmjs/launchpad";
|
||||
import { Client as TendermintClient } from "@cosmjs/tendermint-rpc";
|
||||
import { cosmos } from "./codec";
|
||||
/** A transaction that is indexed as part of the transaction history */
|
||||
export interface IndexedTx {
|
||||
readonly height: number;
|
||||
@ -43,6 +44,8 @@ export declare function isBroadcastTxSuccess(result: BroadcastTxResponse): resul
|
||||
export declare function assertIsBroadcastTxSuccess(
|
||||
result: BroadcastTxResponse,
|
||||
): asserts result is BroadcastTxSuccess;
|
||||
export declare function accountFromProto(input: cosmos.auth.v1beta1.IBaseAccount): Account;
|
||||
export declare function coinFromProto(input: cosmos.base.v1beta1.ICoin): Coin;
|
||||
/** Use for testing only */
|
||||
export interface PrivateStargateClient {
|
||||
readonly tmClient: TendermintClient;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user