mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Remove types from VCS
This commit is contained in:
parent
31cdd91991
commit
1c6f3ee9a5
@ -1 +0,0 @@
|
||||
export declare function isValidBuilder(builder: string): boolean;
|
65
packages/cosmwasm-launchpad/types/cosmosmsg.d.ts
vendored
65
packages/cosmwasm-launchpad/types/cosmosmsg.d.ts
vendored
@ -1,65 +0,0 @@
|
||||
import { Coin } from "@cosmjs/launchpad";
|
||||
interface BankSendMsg {
|
||||
readonly send: {
|
||||
readonly from_address: string;
|
||||
readonly to_address: string;
|
||||
readonly amount: readonly Coin[];
|
||||
};
|
||||
}
|
||||
export interface BankMsg {
|
||||
readonly bank: BankSendMsg;
|
||||
}
|
||||
export interface CustomMsg {
|
||||
readonly custom: Record<string, unknown>;
|
||||
}
|
||||
interface StakingDelegateMsg {
|
||||
readonly delegate: {
|
||||
readonly validator: string;
|
||||
readonly amount: Coin;
|
||||
};
|
||||
}
|
||||
interface StakingRedelegateMsg {
|
||||
readonly redelgate: {
|
||||
readonly src_validator: string;
|
||||
readonly dst_validator: string;
|
||||
readonly amount: Coin;
|
||||
};
|
||||
}
|
||||
interface StakingUndelegateMsg {
|
||||
readonly undelegate: {
|
||||
readonly validator: string;
|
||||
readonly amount: Coin;
|
||||
};
|
||||
}
|
||||
interface StakingWithdrawMsg {
|
||||
readonly withdraw: {
|
||||
readonly validator: string;
|
||||
readonly recipient?: string;
|
||||
};
|
||||
}
|
||||
export interface StakingMsg {
|
||||
readonly staking: StakingDelegateMsg | StakingRedelegateMsg | StakingUndelegateMsg | StakingWithdrawMsg;
|
||||
}
|
||||
interface WasmExecuteMsg {
|
||||
readonly execute: {
|
||||
readonly contract_address: string;
|
||||
readonly msg: any;
|
||||
readonly send: readonly Coin[];
|
||||
};
|
||||
}
|
||||
interface WasmInstantiateMsg {
|
||||
readonly instantiate: {
|
||||
readonly code_id: string;
|
||||
readonly msg: any;
|
||||
readonly send: readonly Coin[];
|
||||
readonly label?: string;
|
||||
};
|
||||
}
|
||||
export interface WasmMsg {
|
||||
readonly wasm: WasmExecuteMsg | WasmInstantiateMsg;
|
||||
}
|
||||
/** These definitions are derived from CosmWasm:
|
||||
* https://github.com/CosmWasm/cosmwasm/blob/v0.12.0/packages/std/src/results/cosmos_msg.rs#L10-L23
|
||||
*/
|
||||
export declare type CosmosMsg = BankMsg | CustomMsg | StakingMsg | WasmMsg;
|
||||
export {};
|
@ -1,177 +0,0 @@
|
||||
import {
|
||||
AuthExtension,
|
||||
BroadcastMode,
|
||||
BroadcastTxResult,
|
||||
Coin,
|
||||
IndexedTx,
|
||||
LcdClient,
|
||||
PubKey,
|
||||
StdTx,
|
||||
WrappedStdTx,
|
||||
} from "@cosmjs/launchpad";
|
||||
import { WasmExtension } from "./lcdapi/wasm";
|
||||
import { JsonObject } from "./types";
|
||||
export interface GetSequenceResult {
|
||||
readonly accountNumber: number;
|
||||
readonly sequence: number;
|
||||
}
|
||||
export interface Account {
|
||||
/** Bech32 account address */
|
||||
readonly address: string;
|
||||
readonly balance: readonly Coin[];
|
||||
readonly pubkey: PubKey | undefined;
|
||||
readonly accountNumber: number;
|
||||
readonly sequence: number;
|
||||
}
|
||||
export interface SearchByIdQuery {
|
||||
readonly id: string;
|
||||
}
|
||||
export interface SearchByHeightQuery {
|
||||
readonly height: number;
|
||||
}
|
||||
export interface SearchBySentFromOrToQuery {
|
||||
readonly sentFromOrTo: string;
|
||||
}
|
||||
/**
|
||||
* This query type allows you to pass arbitrary key/value pairs to the backend. It is
|
||||
* more powerful and slightly lower level than the other search options.
|
||||
*/
|
||||
export interface SearchByTagsQuery {
|
||||
readonly tags: ReadonlyArray<{
|
||||
readonly key: string;
|
||||
readonly value: string;
|
||||
}>;
|
||||
}
|
||||
export declare type SearchTxQuery = SearchByHeightQuery | SearchBySentFromOrToQuery | SearchByTagsQuery;
|
||||
export interface SearchTxFilter {
|
||||
readonly minHeight?: number;
|
||||
readonly maxHeight?: number;
|
||||
}
|
||||
export interface Code {
|
||||
readonly id: number;
|
||||
/** Bech32 account address */
|
||||
readonly creator: string;
|
||||
/** Hex-encoded sha256 hash of the code stored here */
|
||||
readonly checksum: string;
|
||||
/**
|
||||
* An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly source?: string;
|
||||
/**
|
||||
* A docker image (including version) to reproducibly build the Wasm bytecode from the source code.
|
||||
*
|
||||
* @example ```cosmwasm/rust-optimizer:0.8.0```
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly builder?: string;
|
||||
}
|
||||
export interface CodeDetails extends Code {
|
||||
/** The original wasm bytes */
|
||||
readonly data: Uint8Array;
|
||||
}
|
||||
export interface Contract {
|
||||
readonly address: string;
|
||||
readonly codeId: number;
|
||||
/** Bech32 account address */
|
||||
readonly creator: string;
|
||||
/** Bech32-encoded admin address */
|
||||
readonly admin: string | undefined;
|
||||
readonly label: string;
|
||||
}
|
||||
export interface ContractCodeHistoryEntry {
|
||||
/** The source of this history entry */
|
||||
readonly operation: "Genesis" | "Init" | "Migrate";
|
||||
readonly codeId: number;
|
||||
readonly msg: Record<string, unknown>;
|
||||
}
|
||||
export interface BlockHeader {
|
||||
readonly version: {
|
||||
readonly block: string;
|
||||
readonly app: string;
|
||||
};
|
||||
readonly height: number;
|
||||
readonly chainId: string;
|
||||
/** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */
|
||||
readonly time: string;
|
||||
}
|
||||
export interface Block {
|
||||
/** The ID is a hash of the block header (uppercase hex) */
|
||||
readonly id: string;
|
||||
readonly header: BlockHeader;
|
||||
/** Array of raw transactions */
|
||||
readonly txs: readonly Uint8Array[];
|
||||
}
|
||||
/** Use for testing only */
|
||||
export interface PrivateCosmWasmClient {
|
||||
readonly lcdClient: LcdClient & AuthExtension & WasmExtension;
|
||||
}
|
||||
export declare class CosmWasmClient {
|
||||
protected readonly lcdClient: LcdClient & AuthExtension & WasmExtension;
|
||||
/** Any address the chain considers valid (valid bech32 with proper prefix) */
|
||||
protected anyValidAddress: string | undefined;
|
||||
private readonly codesCache;
|
||||
private chainId;
|
||||
/**
|
||||
* Creates a new client to interact with a CosmWasm blockchain.
|
||||
*
|
||||
* This instance does a lot of caching. In order to benefit from that you should try to use one instance
|
||||
* for the lifetime of your application. When switching backends, a new instance must be created.
|
||||
*
|
||||
* @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API)
|
||||
* @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns
|
||||
*/
|
||||
constructor(apiUrl: string, broadcastMode?: BroadcastMode);
|
||||
getChainId(): Promise<string>;
|
||||
getHeight(): Promise<number>;
|
||||
/**
|
||||
* Returns a 32 byte upper-case hex transaction hash (typically used as the transaction ID)
|
||||
*/
|
||||
getIdentifier(tx: WrappedStdTx): Promise<string>;
|
||||
/**
|
||||
* Returns account number and sequence.
|
||||
*
|
||||
* Throws if the account does not exist on chain.
|
||||
*
|
||||
* @param address returns data for this address. When unset, the client's sender adddress is used.
|
||||
*/
|
||||
getSequence(address: string): Promise<GetSequenceResult>;
|
||||
getAccount(address: string): Promise<Account | undefined>;
|
||||
/**
|
||||
* Gets block header and meta
|
||||
*
|
||||
* @param height The height of the block. If undefined, the latest height is used.
|
||||
*/
|
||||
getBlock(height?: number): Promise<Block>;
|
||||
getTx(id: string): Promise<IndexedTx | null>;
|
||||
searchTx(query: SearchTxQuery, filter?: SearchTxFilter): Promise<readonly IndexedTx[]>;
|
||||
broadcastTx(tx: StdTx): Promise<BroadcastTxResult>;
|
||||
getCodes(): Promise<readonly Code[]>;
|
||||
getCodeDetails(codeId: number): Promise<CodeDetails>;
|
||||
getContracts(codeId: number): Promise<readonly Contract[]>;
|
||||
/**
|
||||
* Throws an error if no contract was found at the address
|
||||
*/
|
||||
getContract(address: string): Promise<Contract>;
|
||||
/**
|
||||
* Throws an error if no contract was found at the address
|
||||
*/
|
||||
getContractCodeHistory(address: string): Promise<readonly ContractCodeHistoryEntry[]>;
|
||||
/**
|
||||
* Returns the data at the key if present (raw contract dependent storage data)
|
||||
* or null if no data at this key.
|
||||
*
|
||||
* Promise is rejected when contract does not exist.
|
||||
*/
|
||||
queryContractRaw(address: string, key: Uint8Array): Promise<Uint8Array | null>;
|
||||
/**
|
||||
* Makes a smart query on the contract, returns the parsed JSON document.
|
||||
*
|
||||
* Promise is rejected when contract does not exist.
|
||||
* Promise is rejected for invalid query format.
|
||||
* Promise is rejected for invalid response format.
|
||||
*/
|
||||
queryContractSmart(address: string, queryMsg: Record<string, unknown>): Promise<JsonObject>;
|
||||
private txsQuery;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
import { Account, BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launchpad";
|
||||
import { CosmosMsg } from "./cosmosmsg";
|
||||
import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient";
|
||||
export declare class Cw1CosmWasmClient extends SigningCosmWasmClient {
|
||||
readonly cw1ContractAddress: string;
|
||||
constructor(
|
||||
apiUrl: string,
|
||||
signerAddress: string,
|
||||
signer: OfflineSigner,
|
||||
cw1ContractAddress: string,
|
||||
gasPrice?: GasPrice,
|
||||
gasLimits?: Partial<GasLimits<CosmWasmFeeTable>>,
|
||||
broadcastMode?: BroadcastMode,
|
||||
);
|
||||
getAccount(address?: string): Promise<Account | undefined>;
|
||||
canSend(msg: CosmosMsg, address?: string): Promise<boolean>;
|
||||
executeCw1(msgs: readonly CosmosMsg[], memo?: string): Promise<ExecuteResult>;
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
import { Coin } from "@cosmjs/launchpad";
|
||||
import { Cw1CosmWasmClient } from "./cw1cosmwasmclient";
|
||||
import { Expiration } from "./interfaces";
|
||||
import { ExecuteResult } from "./signingcosmwasmclient";
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/contracts/cw1-subkeys/src/msg.rs#L88
|
||||
*/
|
||||
export interface Cw1SubkeyAllowanceInfo {
|
||||
readonly balance: readonly Coin[];
|
||||
readonly expires: Expiration;
|
||||
}
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/contracts/cw1-subkeys/src/state.rs#L15
|
||||
*/
|
||||
export interface Cw1SubkeyPermissions {
|
||||
readonly delegate: boolean;
|
||||
readonly redelegate: boolean;
|
||||
readonly undelegate: boolean;
|
||||
readonly withdraw: boolean;
|
||||
}
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/contracts/cw1-subkeys/src/msg.rs#L95
|
||||
*/
|
||||
export interface Cw1SubkeyPermissionsInfo {
|
||||
/** Spender address */
|
||||
readonly spender: string;
|
||||
readonly permissions: readonly Cw1SubkeyPermissions[];
|
||||
}
|
||||
export declare class Cw1SubkeyCosmWasmClient extends Cw1CosmWasmClient {
|
||||
private setAdmins;
|
||||
getAdmins(): Promise<readonly string[]>;
|
||||
isAdmin(address?: string): Promise<boolean>;
|
||||
getAllAllowances(): Promise<readonly Cw1SubkeyAllowanceInfo[]>;
|
||||
getAllowance(address?: string): Promise<Cw1SubkeyAllowanceInfo>;
|
||||
getAllPermissions(): Promise<readonly Cw1SubkeyPermissionsInfo[]>;
|
||||
getPermissions(address?: string): Promise<Cw1SubkeyPermissions>;
|
||||
addAdmin(address: string, memo?: string): Promise<ExecuteResult>;
|
||||
removeAdmin(address: string, memo?: string): Promise<ExecuteResult>;
|
||||
increaseAllowance(
|
||||
address: string,
|
||||
amount: Coin,
|
||||
expires?: Expiration,
|
||||
memo?: string,
|
||||
): Promise<ExecuteResult>;
|
||||
decreaseAllowance(
|
||||
address: string,
|
||||
amount: Coin,
|
||||
expires?: Expiration,
|
||||
memo?: string,
|
||||
): Promise<ExecuteResult>;
|
||||
setPermissions(address: string, permissions: Cw1SubkeyPermissions, memo?: string): Promise<ExecuteResult>;
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
import { BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launchpad";
|
||||
import { CosmosMsg } from "./cosmosmsg";
|
||||
import { Account } from "./cosmwasmclient";
|
||||
import { Expiration } from "./interfaces";
|
||||
import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient";
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/packages/cw3/src/msg.rs#L35
|
||||
*/
|
||||
export declare enum Vote {
|
||||
Yes = "yes",
|
||||
No = "no",
|
||||
Abstain = "abstain",
|
||||
Veto = "veto",
|
||||
}
|
||||
export interface ThresholdResult {
|
||||
readonly absolute_count: {
|
||||
readonly weight_needed: number;
|
||||
readonly total_weight: number;
|
||||
};
|
||||
}
|
||||
export interface ProposalResult {
|
||||
readonly id: number;
|
||||
readonly title: string;
|
||||
readonly description: string;
|
||||
readonly msgs: readonly CosmosMsg[];
|
||||
readonly expires: Expiration;
|
||||
readonly status: string;
|
||||
}
|
||||
export interface ProposalsResult {
|
||||
readonly proposals: readonly ProposalResult[];
|
||||
}
|
||||
export interface VoteResult {
|
||||
readonly vote: Vote;
|
||||
}
|
||||
export interface VotesResult {
|
||||
readonly votes: ReadonlyArray<{
|
||||
readonly vote: Vote;
|
||||
readonly voter: string;
|
||||
readonly weight: number;
|
||||
}>;
|
||||
}
|
||||
export interface VoterResult {
|
||||
readonly addr: string;
|
||||
readonly weight: number;
|
||||
}
|
||||
export interface VotersResult {
|
||||
readonly voters: readonly VoterResult[];
|
||||
}
|
||||
interface StartBeforeNumberPaginationOptions {
|
||||
readonly startBefore?: number;
|
||||
readonly limit?: number;
|
||||
}
|
||||
interface StartAfterNumberPaginationOptions {
|
||||
readonly startAfter?: number;
|
||||
readonly limit?: number;
|
||||
}
|
||||
interface StartAfterStringPaginationOptions {
|
||||
readonly startAfter?: string;
|
||||
readonly limit?: number;
|
||||
}
|
||||
export declare class Cw3CosmWasmClient extends SigningCosmWasmClient {
|
||||
readonly cw3ContractAddress: string;
|
||||
constructor(
|
||||
apiUrl: string,
|
||||
signerAddress: string,
|
||||
signer: OfflineSigner,
|
||||
cw3ContractAddress: string,
|
||||
gasPrice?: GasPrice,
|
||||
gasLimits?: Partial<GasLimits<CosmWasmFeeTable>>,
|
||||
broadcastMode?: BroadcastMode,
|
||||
);
|
||||
getAccount(address?: string): Promise<Account | undefined>;
|
||||
getThreshold(): Promise<ThresholdResult>;
|
||||
getProposal(proposalId: number): Promise<ProposalResult>;
|
||||
listProposals({ startAfter, limit }?: StartAfterNumberPaginationOptions): Promise<ProposalsResult>;
|
||||
reverseProposals({ startBefore, limit }?: StartBeforeNumberPaginationOptions): Promise<ProposalsResult>;
|
||||
getVote(proposalId: number, voter: string): Promise<VoteResult>;
|
||||
listVotes(
|
||||
proposalId: number,
|
||||
{ startAfter, limit }?: StartAfterStringPaginationOptions,
|
||||
): Promise<VotesResult>;
|
||||
getVoter(address: string): Promise<VoterResult>;
|
||||
listVoters({ startAfter, limit }?: StartAfterStringPaginationOptions): Promise<VotersResult>;
|
||||
createMultisigProposal(
|
||||
title: string,
|
||||
description: string,
|
||||
msgs: readonly CosmosMsg[],
|
||||
earliest?: Expiration,
|
||||
latest?: Expiration,
|
||||
memo?: string,
|
||||
): Promise<ExecuteResult>;
|
||||
voteMultisigProposal(proposalId: number, vote: Vote, memo?: string): Promise<ExecuteResult>;
|
||||
executeMultisigProposal(proposalId: number, memo?: string): Promise<ExecuteResult>;
|
||||
closeMultisigProposal(proposalId: number, memo?: string): Promise<ExecuteResult>;
|
||||
}
|
||||
export {};
|
58
packages/cosmwasm-launchpad/types/index.d.ts
vendored
58
packages/cosmwasm-launchpad/types/index.d.ts
vendored
@ -1,58 +0,0 @@
|
||||
export { isValidBuilder } from "./builder";
|
||||
export { Expiration } from "./interfaces";
|
||||
export { setupWasmExtension, WasmExtension } from "./lcdapi/wasm";
|
||||
export { BankMsg, CosmosMsg, CustomMsg, StakingMsg, WasmMsg } from "./cosmosmsg";
|
||||
export {
|
||||
Account,
|
||||
Block,
|
||||
BlockHeader,
|
||||
Code,
|
||||
CodeDetails,
|
||||
Contract,
|
||||
ContractCodeHistoryEntry,
|
||||
CosmWasmClient,
|
||||
GetSequenceResult,
|
||||
SearchByHeightQuery,
|
||||
SearchBySentFromOrToQuery,
|
||||
SearchByTagsQuery,
|
||||
SearchTxQuery,
|
||||
SearchTxFilter,
|
||||
} from "./cosmwasmclient";
|
||||
export { Cw1CosmWasmClient } from "./cw1cosmwasmclient";
|
||||
export {
|
||||
Cw3CosmWasmClient,
|
||||
ProposalResult,
|
||||
ProposalsResult,
|
||||
ThresholdResult,
|
||||
Vote,
|
||||
VoteResult,
|
||||
VotesResult,
|
||||
VoterResult,
|
||||
VotersResult,
|
||||
} from "./cw3cosmwasmclient";
|
||||
export {
|
||||
ChangeAdminResult,
|
||||
ExecuteResult,
|
||||
CosmWasmFeeTable,
|
||||
InstantiateOptions,
|
||||
InstantiateResult,
|
||||
MigrateResult,
|
||||
SigningCosmWasmClient,
|
||||
UploadMeta,
|
||||
UploadResult,
|
||||
} from "./signingcosmwasmclient";
|
||||
export {
|
||||
isMsgClearAdmin,
|
||||
isMsgExecuteContract,
|
||||
isMsgInstantiateContract,
|
||||
isMsgMigrateContract,
|
||||
isMsgUpdateAdmin,
|
||||
isMsgStoreCode,
|
||||
MsgClearAdmin,
|
||||
MsgExecuteContract,
|
||||
MsgInstantiateContract,
|
||||
MsgMigrateContract,
|
||||
MsgUpdateAdmin,
|
||||
MsgStoreCode,
|
||||
} from "./msgs";
|
||||
export { JsonObject, parseWasmData, WasmData } from "./types";
|
@ -1,13 +0,0 @@
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/packages/cw0/src/expiration.rs#L14
|
||||
*/
|
||||
export declare type Expiration =
|
||||
| {
|
||||
readonly at_height: number;
|
||||
}
|
||||
| {
|
||||
readonly at_time: number;
|
||||
}
|
||||
| {
|
||||
readonly never: Record<any, never>;
|
||||
};
|
@ -1 +0,0 @@
|
||||
export { Expiration } from "./cw0";
|
@ -1,80 +0,0 @@
|
||||
import { LcdClient } from "@cosmjs/launchpad";
|
||||
import { JsonObject, Model } from "../types";
|
||||
export interface CodeInfo {
|
||||
readonly id: number;
|
||||
/** Bech32 account address */
|
||||
readonly creator: string;
|
||||
/** Hex-encoded sha256 hash of the code stored here */
|
||||
readonly data_hash: string;
|
||||
/**
|
||||
* An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly source?: string;
|
||||
/**
|
||||
* A docker image (including version) to reproducibly build the Wasm bytecode from the source code.
|
||||
*
|
||||
* @example ```cosmwasm/rust-optimizer:0.8.0```
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly builder?: string;
|
||||
}
|
||||
export interface CodeDetails extends CodeInfo {
|
||||
/** Base64 encoded raw wasm data */
|
||||
readonly data: string;
|
||||
}
|
||||
export interface ContractInfo {
|
||||
readonly address: string;
|
||||
readonly code_id: number;
|
||||
/** Bech32 account address */
|
||||
readonly creator: string;
|
||||
/** Bech32-encoded admin address */
|
||||
readonly admin?: string;
|
||||
readonly label: string;
|
||||
}
|
||||
export interface ContractCodeHistoryEntry {
|
||||
/** The source of this history entry */
|
||||
readonly operation: "Genesis" | "Init" | "Migrate";
|
||||
readonly code_id: number;
|
||||
readonly msg: Record<string, unknown>;
|
||||
}
|
||||
/**
|
||||
* @see https://github.com/cosmwasm/wasmd/blob/master/x/wasm/client/rest/query.go#L19-L27
|
||||
*/
|
||||
export interface WasmExtension {
|
||||
readonly wasm: {
|
||||
readonly listCodeInfo: () => Promise<readonly CodeInfo[]>;
|
||||
/**
|
||||
* Downloads the original wasm bytecode by code ID.
|
||||
*
|
||||
* Throws an error if no code with this id
|
||||
*/
|
||||
readonly getCode: (id: number) => Promise<CodeDetails>;
|
||||
readonly listContractsByCodeId: (id: number) => Promise<readonly ContractInfo[]>;
|
||||
/**
|
||||
* Returns null when contract was not found at this address.
|
||||
*/
|
||||
readonly getContractInfo: (address: string) => Promise<ContractInfo | null>;
|
||||
/**
|
||||
* Returns null when contract history was not found for this address.
|
||||
*/
|
||||
readonly getContractCodeHistory: (address: string) => Promise<ContractCodeHistoryEntry[] | null>;
|
||||
/**
|
||||
* Returns all contract state.
|
||||
* This is an empty array if no such contract, or contract has no data.
|
||||
*/
|
||||
readonly getAllContractState: (address: string) => Promise<readonly Model[]>;
|
||||
/**
|
||||
* Returns the data at the key if present (unknown decoded json),
|
||||
* or null if no data at this (contract address, key) pair
|
||||
*/
|
||||
readonly queryContractRaw: (address: string, key: Uint8Array) => Promise<Uint8Array | null>;
|
||||
/**
|
||||
* Makes a smart query on the contract and parses the response as JSON.
|
||||
* Throws error if no such contract exists, the query format is invalid or the response is invalid.
|
||||
*/
|
||||
readonly queryContractSmart: (address: string, query: Record<string, unknown>) => Promise<JsonObject>;
|
||||
};
|
||||
}
|
||||
export declare function setupWasmExtension(base: LcdClient): WasmExtension;
|
119
packages/cosmwasm-launchpad/types/msgs.d.ts
vendored
119
packages/cosmwasm-launchpad/types/msgs.d.ts
vendored
@ -1,119 +0,0 @@
|
||||
import { Coin, Msg } from "@cosmjs/launchpad";
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/params.go#L68-L71
|
||||
*/
|
||||
export declare type AccessConfig = never;
|
||||
/**
|
||||
* Uploads Wasm code to the chain.
|
||||
* A numeric, auto-incrementing code ID will be generated as a result of the execution of this message.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/msg.go#L10-L20
|
||||
*/
|
||||
export interface MsgStoreCode extends Msg {
|
||||
readonly type: "wasm/MsgStoreCode";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly sender: string;
|
||||
/** Base64 encoded Wasm */
|
||||
readonly wasm_byte_code: string;
|
||||
/** A valid URI reference to the contract's source code. Can be empty. */
|
||||
readonly source: string;
|
||||
/** A docker tag. Can be empty. */
|
||||
readonly builder: string;
|
||||
readonly instantiate_permission?: AccessConfig;
|
||||
};
|
||||
}
|
||||
export declare function isMsgStoreCode(msg: Msg): msg is MsgStoreCode;
|
||||
/**
|
||||
* Creates an instance of contract that was uploaded before.
|
||||
* This will trigger a call to the "init" export.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L104
|
||||
*/
|
||||
export interface MsgInstantiateContract extends Msg {
|
||||
readonly type: "wasm/MsgInstantiateContract";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly sender: string;
|
||||
/** ID of the Wasm code that was uploaded before */
|
||||
readonly code_id: string;
|
||||
/** Human-readable label for this contract */
|
||||
readonly label: string;
|
||||
/** Init message as JavaScript object */
|
||||
readonly init_msg: any;
|
||||
readonly init_funds: readonly Coin[];
|
||||
/** Bech32-encoded admin address */
|
||||
readonly admin?: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgInstantiateContract(msg: Msg): msg is MsgInstantiateContract;
|
||||
/**
|
||||
* Update the admin of a contract
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-beta/x/wasm/internal/types/msg.go#L231
|
||||
*/
|
||||
export interface MsgUpdateAdmin extends Msg {
|
||||
readonly type: "wasm/MsgUpdateAdmin";
|
||||
readonly value: {
|
||||
/** Bech32-encoded sender address. This must be the old admin. */
|
||||
readonly sender: string;
|
||||
/** Bech32-encoded contract address to be updated */
|
||||
readonly contract: string;
|
||||
/** Bech32-encoded address of the new admin */
|
||||
readonly new_admin: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgUpdateAdmin(msg: Msg): msg is MsgUpdateAdmin;
|
||||
/**
|
||||
* Clears the admin of a contract, making it immutable.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-beta/x/wasm/internal/types/msg.go#L269
|
||||
*/
|
||||
export interface MsgClearAdmin extends Msg {
|
||||
readonly type: "wasm/MsgClearAdmin";
|
||||
readonly value: {
|
||||
/** Bech32-encoded sender address. This must be the old admin. */
|
||||
readonly sender: string;
|
||||
/** Bech32-encoded contract address to be updated */
|
||||
readonly contract: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgClearAdmin(msg: Msg): msg is MsgClearAdmin;
|
||||
/**
|
||||
* Execute a smart contract.
|
||||
* This will trigger a call to the "handle" export.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L158
|
||||
*/
|
||||
export interface MsgExecuteContract extends Msg {
|
||||
readonly type: "wasm/MsgExecuteContract";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly sender: string;
|
||||
/** Bech32 account address */
|
||||
readonly contract: string;
|
||||
/** Handle message as JavaScript object */
|
||||
readonly msg: any;
|
||||
readonly sent_funds: readonly Coin[];
|
||||
};
|
||||
}
|
||||
export declare function isMsgExecuteContract(msg: Msg): msg is MsgExecuteContract;
|
||||
/**
|
||||
* Migrates a contract to a new Wasm code.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L195
|
||||
*/
|
||||
export interface MsgMigrateContract extends Msg {
|
||||
readonly type: "wasm/MsgMigrateContract";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly sender: string;
|
||||
/** Bech32 account address */
|
||||
readonly contract: string;
|
||||
/** The new code */
|
||||
readonly code_id: string;
|
||||
/** Migrate message as JavaScript object */
|
||||
readonly msg: any;
|
||||
};
|
||||
}
|
||||
export declare function isMsgMigrateContract(msg: Msg): msg is MsgMigrateContract;
|
@ -1,156 +0,0 @@
|
||||
import {
|
||||
BroadcastMode,
|
||||
BroadcastTxResult,
|
||||
Coin,
|
||||
CosmosFeeTable,
|
||||
GasLimits,
|
||||
GasPrice,
|
||||
logs,
|
||||
Msg,
|
||||
OfflineSigner,
|
||||
StdFee,
|
||||
} from "@cosmjs/launchpad";
|
||||
import { Account, CosmWasmClient, GetSequenceResult } from "./cosmwasmclient";
|
||||
/**
|
||||
* These fees are used by the higher level methods of SigningCosmWasmClient
|
||||
*/
|
||||
export interface CosmWasmFeeTable extends CosmosFeeTable {
|
||||
readonly upload: StdFee;
|
||||
readonly init: StdFee;
|
||||
readonly exec: StdFee;
|
||||
readonly migrate: StdFee;
|
||||
/** Paid when setting the contract admin to a new address or unsetting it */
|
||||
readonly changeAdmin: StdFee;
|
||||
}
|
||||
export interface UploadMeta {
|
||||
/**
|
||||
* An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly source?: string;
|
||||
/**
|
||||
* A docker image (including version) to reproducibly build the Wasm bytecode from the source code.
|
||||
*
|
||||
* @example ```cosmwasm/rust-optimizer:0.8.0```
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly builder?: string;
|
||||
}
|
||||
export interface UploadResult {
|
||||
/** Size of the original wasm code in bytes */
|
||||
readonly originalSize: number;
|
||||
/** A hex encoded sha256 checksum of the original wasm code (that is stored on chain) */
|
||||
readonly originalChecksum: string;
|
||||
/** Size of the compressed wasm code in bytes */
|
||||
readonly compressedSize: number;
|
||||
/** A hex encoded sha256 checksum of the compressed wasm code (that stored in the transaction) */
|
||||
readonly compressedChecksum: string;
|
||||
/** The ID of the code asigned by the chain */
|
||||
readonly codeId: number;
|
||||
readonly logs: readonly logs.Log[];
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly transactionHash: string;
|
||||
}
|
||||
/**
|
||||
* The options of an .instantiate() call.
|
||||
* All properties are optional.
|
||||
*/
|
||||
export interface InstantiateOptions {
|
||||
readonly memo?: string;
|
||||
readonly transferAmount?: readonly Coin[];
|
||||
/**
|
||||
* A bech32 encoded address of an admin account.
|
||||
* Caution: an admin has the privilege to upgrade a contract. If this is not desired, do not set this value.
|
||||
*/
|
||||
readonly admin?: string;
|
||||
}
|
||||
export interface InstantiateResult {
|
||||
/** The address of the newly instantiated contract */
|
||||
readonly contractAddress: string;
|
||||
readonly logs: readonly logs.Log[];
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly transactionHash: string;
|
||||
}
|
||||
/**
|
||||
* Result type of updateAdmin and clearAdmin
|
||||
*/
|
||||
export interface ChangeAdminResult {
|
||||
readonly logs: readonly logs.Log[];
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly transactionHash: string;
|
||||
}
|
||||
export interface MigrateResult {
|
||||
readonly logs: readonly logs.Log[];
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly transactionHash: string;
|
||||
}
|
||||
export interface ExecuteResult {
|
||||
readonly logs: readonly logs.Log[];
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly transactionHash: string;
|
||||
}
|
||||
/** Use for testing only */
|
||||
export interface PrivateSigningCosmWasmClient {
|
||||
readonly fees: CosmWasmFeeTable;
|
||||
}
|
||||
export declare class SigningCosmWasmClient extends CosmWasmClient {
|
||||
readonly signerAddress: string;
|
||||
private readonly signer;
|
||||
private readonly fees;
|
||||
/**
|
||||
* Creates a new client with signing capability to interact with a CosmWasm blockchain. This is the bigger brother of CosmWasmClient.
|
||||
*
|
||||
* This instance does a lot of caching. In order to benefit from that you should try to use one instance
|
||||
* for the lifetime of your application. When switching backends, a new instance must be created.
|
||||
*
|
||||
* @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API)
|
||||
* @param signerAddress The address that will sign transactions using this instance. The `signer` must be able to sign with this address.
|
||||
* @param signer An implementation of OfflineSigner which can provide signatures for transactions, potentially requiring user input.
|
||||
* @param gasPrice The price paid per unit of gas
|
||||
* @param gasLimits Custom overrides for gas limits related to specific transaction types
|
||||
* @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns
|
||||
*/
|
||||
constructor(
|
||||
apiUrl: string,
|
||||
signerAddress: string,
|
||||
signer: OfflineSigner,
|
||||
gasPrice?: GasPrice,
|
||||
gasLimits?: Partial<GasLimits<CosmWasmFeeTable>>,
|
||||
broadcastMode?: BroadcastMode,
|
||||
);
|
||||
getSequence(address?: string): Promise<GetSequenceResult>;
|
||||
getAccount(address?: string): Promise<Account | undefined>;
|
||||
/** Uploads code and returns a receipt, including the code ID */
|
||||
upload(wasmCode: Uint8Array, meta?: UploadMeta, memo?: string): Promise<UploadResult>;
|
||||
instantiate(
|
||||
codeId: number,
|
||||
initMsg: Record<string, unknown>,
|
||||
label: string,
|
||||
options?: InstantiateOptions,
|
||||
): Promise<InstantiateResult>;
|
||||
updateAdmin(contractAddress: string, newAdmin: string, memo?: string): Promise<ChangeAdminResult>;
|
||||
clearAdmin(contractAddress: string, memo?: string): Promise<ChangeAdminResult>;
|
||||
migrate(
|
||||
contractAddress: string,
|
||||
codeId: number,
|
||||
migrateMsg: Record<string, unknown>,
|
||||
memo?: string,
|
||||
): Promise<MigrateResult>;
|
||||
execute(
|
||||
contractAddress: string,
|
||||
handleMsg: Record<string, unknown>,
|
||||
memo?: string,
|
||||
transferAmount?: readonly Coin[],
|
||||
): Promise<ExecuteResult>;
|
||||
sendTokens(
|
||||
recipientAddress: string,
|
||||
transferAmount: readonly Coin[],
|
||||
memo?: string,
|
||||
): Promise<BroadcastTxResult>;
|
||||
/**
|
||||
* Gets account number and sequence from the API, creates a sign doc,
|
||||
* creates a single signature, assembles the signed transaction and broadcasts it.
|
||||
*/
|
||||
signAndBroadcast(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise<BroadcastTxResult>;
|
||||
}
|
14
packages/cosmwasm-launchpad/types/types.d.ts
vendored
14
packages/cosmwasm-launchpad/types/types.d.ts
vendored
@ -1,14 +0,0 @@
|
||||
export interface WasmData {
|
||||
readonly key: string;
|
||||
readonly val: string;
|
||||
}
|
||||
export interface Model {
|
||||
readonly key: Uint8Array;
|
||||
readonly val: Uint8Array;
|
||||
}
|
||||
export declare function parseWasmData({ key, val }: WasmData): Model;
|
||||
/**
|
||||
* An object containing a parsed JSON document. The result of JSON.parse().
|
||||
* This doesn't provide any type safety over `any` but expresses intent in the code.
|
||||
*/
|
||||
export declare type JsonObject = any;
|
@ -1,2 +0,0 @@
|
||||
import { AminoConverter } from "@cosmjs/stargate";
|
||||
export declare const cosmWasmTypes: Record<string, AminoConverter>;
|
@ -1,86 +0,0 @@
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmos.base.query.v1beta1";
|
||||
/**
|
||||
* PageRequest is to be embedded in gRPC request messages for efficient
|
||||
* pagination. Ex:
|
||||
*
|
||||
* message SomeRequest {
|
||||
* Foo some_parameter = 1;
|
||||
* PageRequest pagination = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageRequest {
|
||||
/**
|
||||
* key is a value returned in PageResponse.next_key to begin
|
||||
* querying the next page most efficiently. Only one of offset or key
|
||||
* should be set.
|
||||
*/
|
||||
key: Uint8Array;
|
||||
/**
|
||||
* offset is a numeric offset that can be used when key is unavailable.
|
||||
* It is less efficient than using key. Only one of offset or key should
|
||||
* be set.
|
||||
*/
|
||||
offset: Long;
|
||||
/**
|
||||
* limit is the total number of results to be returned in the result page.
|
||||
* If left empty it will default to a value to be set by each app.
|
||||
*/
|
||||
limit: Long;
|
||||
/**
|
||||
* count_total is set to true to indicate that the result set should include
|
||||
* a count of the total number of items available for pagination in UIs.
|
||||
* count_total is only respected when offset is used. It is ignored when key
|
||||
* is set.
|
||||
*/
|
||||
countTotal: boolean;
|
||||
}
|
||||
/**
|
||||
* PageResponse is to be embedded in gRPC response messages where the
|
||||
* corresponding request message has used PageRequest.
|
||||
*
|
||||
* message SomeResponse {
|
||||
* repeated Bar results = 1;
|
||||
* PageResponse page = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageResponse {
|
||||
/**
|
||||
* next_key is the key to be passed to PageRequest.key to
|
||||
* query the next page most efficiently
|
||||
*/
|
||||
nextKey: Uint8Array;
|
||||
/**
|
||||
* total is total number of results available if PageRequest.count_total
|
||||
* was set, its value is undefined otherwise
|
||||
*/
|
||||
total: Long;
|
||||
}
|
||||
export declare const PageRequest: {
|
||||
encode(message: PageRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PageRequest;
|
||||
fromJSON(object: any): PageRequest;
|
||||
fromPartial(object: DeepPartial<PageRequest>): PageRequest;
|
||||
toJSON(message: PageRequest): unknown;
|
||||
};
|
||||
export declare const PageResponse: {
|
||||
encode(message: PageResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): PageResponse;
|
||||
fromJSON(object: any): PageResponse;
|
||||
fromPartial(object: DeepPartial<PageResponse>): PageResponse;
|
||||
toJSON(message: PageResponse): unknown;
|
||||
};
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
@ -1,269 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.query.v1beta1";
|
||||
|
||||
/**
|
||||
* PageRequest is to be embedded in gRPC request messages for efficient
|
||||
* pagination. Ex:
|
||||
*
|
||||
* message SomeRequest {
|
||||
* Foo some_parameter = 1;
|
||||
* PageRequest pagination = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageRequest {
|
||||
/**
|
||||
* key is a value returned in PageResponse.next_key to begin
|
||||
* querying the next page most efficiently. Only one of offset or key
|
||||
* should be set.
|
||||
*/
|
||||
key: Uint8Array;
|
||||
/**
|
||||
* offset is a numeric offset that can be used when key is unavailable.
|
||||
* It is less efficient than using key. Only one of offset or key should
|
||||
* be set.
|
||||
*/
|
||||
offset: Long;
|
||||
/**
|
||||
* limit is the total number of results to be returned in the result page.
|
||||
* If left empty it will default to a value to be set by each app.
|
||||
*/
|
||||
limit: Long;
|
||||
/**
|
||||
* count_total is set to true to indicate that the result set should include
|
||||
* a count of the total number of items available for pagination in UIs.
|
||||
* count_total is only respected when offset is used. It is ignored when key
|
||||
* is set.
|
||||
*/
|
||||
countTotal: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* PageResponse is to be embedded in gRPC response messages where the
|
||||
* corresponding request message has used PageRequest.
|
||||
*
|
||||
* message SomeResponse {
|
||||
* repeated Bar results = 1;
|
||||
* PageResponse page = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageResponse {
|
||||
/**
|
||||
* next_key is the key to be passed to PageRequest.key to
|
||||
* query the next page most efficiently
|
||||
*/
|
||||
nextKey: Uint8Array;
|
||||
/**
|
||||
* total is total number of results available if PageRequest.count_total
|
||||
* was set, its value is undefined otherwise
|
||||
*/
|
||||
total: Long;
|
||||
}
|
||||
|
||||
const basePageRequest: object = { offset: Long.UZERO, limit: Long.UZERO, countTotal: false };
|
||||
|
||||
export const PageRequest = {
|
||||
encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).bytes(message.key);
|
||||
writer.uint32(16).uint64(message.offset);
|
||||
writer.uint32(24).uint64(message.limit);
|
||||
writer.uint32(32).bool(message.countTotal);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...basePageRequest } as PageRequest;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.key = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.offset = reader.uint64() as Long;
|
||||
break;
|
||||
case 3:
|
||||
message.limit = reader.uint64() as Long;
|
||||
break;
|
||||
case 4:
|
||||
message.countTotal = reader.bool();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageRequest {
|
||||
const message = { ...basePageRequest } as PageRequest;
|
||||
if (object.key !== undefined && object.key !== null) {
|
||||
message.key = bytesFromBase64(object.key);
|
||||
}
|
||||
if (object.offset !== undefined && object.offset !== null) {
|
||||
message.offset = Long.fromString(object.offset);
|
||||
} else {
|
||||
message.offset = Long.UZERO;
|
||||
}
|
||||
if (object.limit !== undefined && object.limit !== null) {
|
||||
message.limit = Long.fromString(object.limit);
|
||||
} else {
|
||||
message.limit = Long.UZERO;
|
||||
}
|
||||
if (object.countTotal !== undefined && object.countTotal !== null) {
|
||||
message.countTotal = Boolean(object.countTotal);
|
||||
} else {
|
||||
message.countTotal = false;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<PageRequest>): PageRequest {
|
||||
const message = { ...basePageRequest } as PageRequest;
|
||||
if (object.key !== undefined && object.key !== null) {
|
||||
message.key = object.key;
|
||||
} else {
|
||||
message.key = new Uint8Array();
|
||||
}
|
||||
if (object.offset !== undefined && object.offset !== null) {
|
||||
message.offset = object.offset as Long;
|
||||
} else {
|
||||
message.offset = Long.UZERO;
|
||||
}
|
||||
if (object.limit !== undefined && object.limit !== null) {
|
||||
message.limit = object.limit as Long;
|
||||
} else {
|
||||
message.limit = Long.UZERO;
|
||||
}
|
||||
if (object.countTotal !== undefined && object.countTotal !== null) {
|
||||
message.countTotal = object.countTotal;
|
||||
} else {
|
||||
message.countTotal = false;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: PageRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.key !== undefined &&
|
||||
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
|
||||
message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString());
|
||||
message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString());
|
||||
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const basePageResponse: object = { total: Long.UZERO };
|
||||
|
||||
export const PageResponse = {
|
||||
encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).bytes(message.nextKey);
|
||||
writer.uint32(16).uint64(message.total);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...basePageResponse } as PageResponse;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.nextKey = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.total = reader.uint64() as Long;
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageResponse {
|
||||
const message = { ...basePageResponse } as PageResponse;
|
||||
if (object.nextKey !== undefined && object.nextKey !== null) {
|
||||
message.nextKey = bytesFromBase64(object.nextKey);
|
||||
}
|
||||
if (object.total !== undefined && object.total !== null) {
|
||||
message.total = Long.fromString(object.total);
|
||||
} else {
|
||||
message.total = Long.UZERO;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<PageResponse>): PageResponse {
|
||||
const message = { ...basePageResponse } as PageResponse;
|
||||
if (object.nextKey !== undefined && object.nextKey !== null) {
|
||||
message.nextKey = object.nextKey;
|
||||
} else {
|
||||
message.nextKey = new Uint8Array();
|
||||
}
|
||||
if (object.total !== undefined && object.total !== null) {
|
||||
message.total = object.total as Long;
|
||||
} else {
|
||||
message.total = Long.UZERO;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: PageResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.nextKey !== undefined &&
|
||||
(obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array()));
|
||||
message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString());
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
declare var self: any | undefined;
|
||||
declare var window: any | undefined;
|
||||
var globalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") return globalThis;
|
||||
if (typeof self !== "undefined") return self;
|
||||
if (typeof window !== "undefined") return window;
|
||||
if (typeof global !== "undefined") return global;
|
||||
throw new Error("Unable to locate global object");
|
||||
})();
|
||||
|
||||
const atob: (b64: string) => string =
|
||||
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
|
||||
function bytesFromBase64(b64: string): Uint8Array {
|
||||
const bin = atob(b64);
|
||||
const arr = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; ++i) {
|
||||
arr[i] = bin.charCodeAt(i);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
const btoa: (bin: string) => string =
|
||||
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
|
||||
function base64FromBytes(arr: Uint8Array): string {
|
||||
const bin: string[] = [];
|
||||
for (let i = 0; i < arr.byteLength; ++i) {
|
||||
bin.push(String.fromCharCode(arr[i]));
|
||||
}
|
||||
return btoa(bin.join(""));
|
||||
}
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
@ -1,72 +0,0 @@
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmos.base.v1beta1";
|
||||
/**
|
||||
* Coin defines a token with a denomination and an amount.
|
||||
*
|
||||
* NOTE: The amount field is an Int which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface Coin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
/**
|
||||
* DecCoin defines a token with a denomination and a decimal amount.
|
||||
*
|
||||
* NOTE: The amount field is an Dec which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface DecCoin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
/** IntProto defines a Protobuf wrapper around an Int object. */
|
||||
export interface IntProto {
|
||||
int: string;
|
||||
}
|
||||
/** DecProto defines a Protobuf wrapper around a Dec object. */
|
||||
export interface DecProto {
|
||||
dec: string;
|
||||
}
|
||||
export declare const Coin: {
|
||||
encode(message: Coin, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Coin;
|
||||
fromJSON(object: any): Coin;
|
||||
fromPartial(object: DeepPartial<Coin>): Coin;
|
||||
toJSON(message: Coin): unknown;
|
||||
};
|
||||
export declare const DecCoin: {
|
||||
encode(message: DecCoin, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DecCoin;
|
||||
fromJSON(object: any): DecCoin;
|
||||
fromPartial(object: DeepPartial<DecCoin>): DecCoin;
|
||||
toJSON(message: DecCoin): unknown;
|
||||
};
|
||||
export declare const IntProto: {
|
||||
encode(message: IntProto, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): IntProto;
|
||||
fromJSON(object: any): IntProto;
|
||||
fromPartial(object: DeepPartial<IntProto>): IntProto;
|
||||
toJSON(message: IntProto): unknown;
|
||||
};
|
||||
export declare const DecProto: {
|
||||
encode(message: DecProto, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DecProto;
|
||||
fromJSON(object: any): DecProto;
|
||||
fromPartial(object: DeepPartial<DecProto>): DecProto;
|
||||
toJSON(message: DecProto): unknown;
|
||||
};
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
@ -1,290 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.v1beta1";
|
||||
|
||||
/**
|
||||
* Coin defines a token with a denomination and an amount.
|
||||
*
|
||||
* NOTE: The amount field is an Int which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface Coin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DecCoin defines a token with a denomination and a decimal amount.
|
||||
*
|
||||
* NOTE: The amount field is an Dec which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface DecCoin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/** IntProto defines a Protobuf wrapper around an Int object. */
|
||||
export interface IntProto {
|
||||
int: string;
|
||||
}
|
||||
|
||||
/** DecProto defines a Protobuf wrapper around a Dec object. */
|
||||
export interface DecProto {
|
||||
dec: string;
|
||||
}
|
||||
|
||||
const baseCoin: object = { denom: "", amount: "" };
|
||||
|
||||
export const Coin = {
|
||||
encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).string(message.denom);
|
||||
writer.uint32(18).string(message.amount);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Coin {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseCoin } as Coin;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Coin {
|
||||
const message = { ...baseCoin } as Coin;
|
||||
if (object.denom !== undefined && object.denom !== null) {
|
||||
message.denom = String(object.denom);
|
||||
} else {
|
||||
message.denom = "";
|
||||
}
|
||||
if (object.amount !== undefined && object.amount !== null) {
|
||||
message.amount = String(object.amount);
|
||||
} else {
|
||||
message.amount = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Coin>): Coin {
|
||||
const message = { ...baseCoin } as Coin;
|
||||
if (object.denom !== undefined && object.denom !== null) {
|
||||
message.denom = object.denom;
|
||||
} else {
|
||||
message.denom = "";
|
||||
}
|
||||
if (object.amount !== undefined && object.amount !== null) {
|
||||
message.amount = object.amount;
|
||||
} else {
|
||||
message.amount = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: Coin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseDecCoin: object = { denom: "", amount: "" };
|
||||
|
||||
export const DecCoin = {
|
||||
encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).string(message.denom);
|
||||
writer.uint32(18).string(message.amount);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseDecCoin } as DecCoin;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecCoin {
|
||||
const message = { ...baseDecCoin } as DecCoin;
|
||||
if (object.denom !== undefined && object.denom !== null) {
|
||||
message.denom = String(object.denom);
|
||||
} else {
|
||||
message.denom = "";
|
||||
}
|
||||
if (object.amount !== undefined && object.amount !== null) {
|
||||
message.amount = String(object.amount);
|
||||
} else {
|
||||
message.amount = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<DecCoin>): DecCoin {
|
||||
const message = { ...baseDecCoin } as DecCoin;
|
||||
if (object.denom !== undefined && object.denom !== null) {
|
||||
message.denom = object.denom;
|
||||
} else {
|
||||
message.denom = "";
|
||||
}
|
||||
if (object.amount !== undefined && object.amount !== null) {
|
||||
message.amount = object.amount;
|
||||
} else {
|
||||
message.amount = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: DecCoin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseIntProto: object = { int: "" };
|
||||
|
||||
export const IntProto = {
|
||||
encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).string(message.int);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): IntProto {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseIntProto } as IntProto;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.int = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): IntProto {
|
||||
const message = { ...baseIntProto } as IntProto;
|
||||
if (object.int !== undefined && object.int !== null) {
|
||||
message.int = String(object.int);
|
||||
} else {
|
||||
message.int = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<IntProto>): IntProto {
|
||||
const message = { ...baseIntProto } as IntProto;
|
||||
if (object.int !== undefined && object.int !== null) {
|
||||
message.int = object.int;
|
||||
} else {
|
||||
message.int = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: IntProto): unknown {
|
||||
const obj: any = {};
|
||||
message.int !== undefined && (obj.int = message.int);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseDecProto: object = { dec: "" };
|
||||
|
||||
export const DecProto = {
|
||||
encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).string(message.dec);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecProto {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseDecProto } as DecProto;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.dec = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecProto {
|
||||
const message = { ...baseDecProto } as DecProto;
|
||||
if (object.dec !== undefined && object.dec !== null) {
|
||||
message.dec = String(object.dec);
|
||||
} else {
|
||||
message.dec = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<DecProto>): DecProto {
|
||||
const message = { ...baseDecProto } as DecProto;
|
||||
if (object.dec !== undefined && object.dec !== null) {
|
||||
message.dec = object.dec;
|
||||
} else {
|
||||
message.dec = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: DecProto): unknown {
|
||||
const obj: any = {};
|
||||
message.dec !== undefined && (obj.dec = message.dec);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
@ -1,286 +0,0 @@
|
||||
import { ContractInfo, ContractCodeHistoryEntry, Model } from "../../../../x/wasm/internal/types/types";
|
||||
import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmwasm.wasm.v1beta1";
|
||||
/** QueryContractInfoRequest is the request type for the Query/ContractInfo RPC method */
|
||||
export interface QueryContractInfoRequest {
|
||||
/** address is the address of the contract to query */
|
||||
address: string;
|
||||
}
|
||||
/** QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method */
|
||||
export interface QueryContractInfoResponse {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
contractInfo?: ContractInfo;
|
||||
}
|
||||
/** QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method */
|
||||
export interface QueryContractHistoryRequest {
|
||||
/** address is the address of the contract to query */
|
||||
address: string;
|
||||
/** pagination defines an optional pagination for the request. */
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
/** QueryContractHistoryResponse is the response type for the Query/ContractHistory RPC method */
|
||||
export interface QueryContractHistoryResponse {
|
||||
entries: ContractCodeHistoryEntry[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
/** QueryContractsByCodeRequest is the request type for the Query/ContractsByCode RPC method */
|
||||
export interface QueryContractsByCodeRequest {
|
||||
/** grpc-gateway_out does not support Go style CodID */
|
||||
codeId: Long;
|
||||
/** pagination defines an optional pagination for the request. */
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
/** ContractInfoWithAddress adds the address (key) to the ContractInfo representation */
|
||||
export interface ContractInfoWithAddress {
|
||||
address: string;
|
||||
contractInfo?: ContractInfo;
|
||||
}
|
||||
/** QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method */
|
||||
export interface QueryContractsByCodeResponse {
|
||||
contractInfos: ContractInfoWithAddress[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
/** QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method */
|
||||
export interface QueryAllContractStateRequest {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
/** pagination defines an optional pagination for the request. */
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
/** QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method */
|
||||
export interface QueryAllContractStateResponse {
|
||||
models: Model[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
/** QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method */
|
||||
export interface QueryRawContractStateRequest {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
queryData: Uint8Array;
|
||||
}
|
||||
/** QueryRawContractStateResponse is the response type for the Query/RawContractState RPC method */
|
||||
export interface QueryRawContractStateResponse {
|
||||
/** Data contains the raw store data */
|
||||
data: Uint8Array;
|
||||
}
|
||||
/** QuerySmartContractStateRequest is the request type for the Query/SmartContractState RPC method */
|
||||
export interface QuerySmartContractStateRequest {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
/** QueryData contains the query data passed to the contract */
|
||||
queryData: Uint8Array;
|
||||
}
|
||||
/** QuerySmartContractStateResponse is the response type for the Query/SmartContractState RPC method */
|
||||
export interface QuerySmartContractStateResponse {
|
||||
/** Data contains the json data returned from the smart contract */
|
||||
data: Uint8Array;
|
||||
}
|
||||
/** QueryCodeRequest is the request type for the Query/Code RPC method */
|
||||
export interface QueryCodeRequest {
|
||||
/** grpc-gateway_out does not support Go style CodID */
|
||||
codeId: Long;
|
||||
}
|
||||
/** CodeInfoResponse contains code meta data from CodeInfo */
|
||||
export interface CodeInfoResponse {
|
||||
/** id for legacy support */
|
||||
codeId: Long;
|
||||
creator: string;
|
||||
dataHash: Uint8Array;
|
||||
source: string;
|
||||
builder: string;
|
||||
}
|
||||
/** QueryCodeResponse is the response type for the Query/Code RPC method */
|
||||
export interface QueryCodeResponse {
|
||||
codeInfo?: CodeInfoResponse;
|
||||
data: Uint8Array;
|
||||
}
|
||||
/** QueryCodesRequest is the request type for the Query/Codes RPC method */
|
||||
export interface QueryCodesRequest {
|
||||
/** pagination defines an optional pagination for the request. */
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
/** QueryCodesResponse is the response type for the Query/Codes RPC method */
|
||||
export interface QueryCodesResponse {
|
||||
codeInfos: CodeInfoResponse[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
export declare const QueryContractInfoRequest: {
|
||||
encode(message: QueryContractInfoRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractInfoRequest;
|
||||
fromJSON(object: any): QueryContractInfoRequest;
|
||||
fromPartial(object: DeepPartial<QueryContractInfoRequest>): QueryContractInfoRequest;
|
||||
toJSON(message: QueryContractInfoRequest): unknown;
|
||||
};
|
||||
export declare const QueryContractInfoResponse: {
|
||||
encode(message: QueryContractInfoResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractInfoResponse;
|
||||
fromJSON(object: any): QueryContractInfoResponse;
|
||||
fromPartial(object: DeepPartial<QueryContractInfoResponse>): QueryContractInfoResponse;
|
||||
toJSON(message: QueryContractInfoResponse): unknown;
|
||||
};
|
||||
export declare const QueryContractHistoryRequest: {
|
||||
encode(message: QueryContractHistoryRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractHistoryRequest;
|
||||
fromJSON(object: any): QueryContractHistoryRequest;
|
||||
fromPartial(object: DeepPartial<QueryContractHistoryRequest>): QueryContractHistoryRequest;
|
||||
toJSON(message: QueryContractHistoryRequest): unknown;
|
||||
};
|
||||
export declare const QueryContractHistoryResponse: {
|
||||
encode(message: QueryContractHistoryResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractHistoryResponse;
|
||||
fromJSON(object: any): QueryContractHistoryResponse;
|
||||
fromPartial(object: DeepPartial<QueryContractHistoryResponse>): QueryContractHistoryResponse;
|
||||
toJSON(message: QueryContractHistoryResponse): unknown;
|
||||
};
|
||||
export declare const QueryContractsByCodeRequest: {
|
||||
encode(message: QueryContractsByCodeRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractsByCodeRequest;
|
||||
fromJSON(object: any): QueryContractsByCodeRequest;
|
||||
fromPartial(object: DeepPartial<QueryContractsByCodeRequest>): QueryContractsByCodeRequest;
|
||||
toJSON(message: QueryContractsByCodeRequest): unknown;
|
||||
};
|
||||
export declare const ContractInfoWithAddress: {
|
||||
encode(message: ContractInfoWithAddress, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ContractInfoWithAddress;
|
||||
fromJSON(object: any): ContractInfoWithAddress;
|
||||
fromPartial(object: DeepPartial<ContractInfoWithAddress>): ContractInfoWithAddress;
|
||||
toJSON(message: ContractInfoWithAddress): unknown;
|
||||
};
|
||||
export declare const QueryContractsByCodeResponse: {
|
||||
encode(message: QueryContractsByCodeResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryContractsByCodeResponse;
|
||||
fromJSON(object: any): QueryContractsByCodeResponse;
|
||||
fromPartial(object: DeepPartial<QueryContractsByCodeResponse>): QueryContractsByCodeResponse;
|
||||
toJSON(message: QueryContractsByCodeResponse): unknown;
|
||||
};
|
||||
export declare const QueryAllContractStateRequest: {
|
||||
encode(message: QueryAllContractStateRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllContractStateRequest;
|
||||
fromJSON(object: any): QueryAllContractStateRequest;
|
||||
fromPartial(object: DeepPartial<QueryAllContractStateRequest>): QueryAllContractStateRequest;
|
||||
toJSON(message: QueryAllContractStateRequest): unknown;
|
||||
};
|
||||
export declare const QueryAllContractStateResponse: {
|
||||
encode(message: QueryAllContractStateResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllContractStateResponse;
|
||||
fromJSON(object: any): QueryAllContractStateResponse;
|
||||
fromPartial(object: DeepPartial<QueryAllContractStateResponse>): QueryAllContractStateResponse;
|
||||
toJSON(message: QueryAllContractStateResponse): unknown;
|
||||
};
|
||||
export declare const QueryRawContractStateRequest: {
|
||||
encode(message: QueryRawContractStateRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRawContractStateRequest;
|
||||
fromJSON(object: any): QueryRawContractStateRequest;
|
||||
fromPartial(object: DeepPartial<QueryRawContractStateRequest>): QueryRawContractStateRequest;
|
||||
toJSON(message: QueryRawContractStateRequest): unknown;
|
||||
};
|
||||
export declare const QueryRawContractStateResponse: {
|
||||
encode(message: QueryRawContractStateResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryRawContractStateResponse;
|
||||
fromJSON(object: any): QueryRawContractStateResponse;
|
||||
fromPartial(object: DeepPartial<QueryRawContractStateResponse>): QueryRawContractStateResponse;
|
||||
toJSON(message: QueryRawContractStateResponse): unknown;
|
||||
};
|
||||
export declare const QuerySmartContractStateRequest: {
|
||||
encode(message: QuerySmartContractStateRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QuerySmartContractStateRequest;
|
||||
fromJSON(object: any): QuerySmartContractStateRequest;
|
||||
fromPartial(object: DeepPartial<QuerySmartContractStateRequest>): QuerySmartContractStateRequest;
|
||||
toJSON(message: QuerySmartContractStateRequest): unknown;
|
||||
};
|
||||
export declare const QuerySmartContractStateResponse: {
|
||||
encode(message: QuerySmartContractStateResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QuerySmartContractStateResponse;
|
||||
fromJSON(object: any): QuerySmartContractStateResponse;
|
||||
fromPartial(object: DeepPartial<QuerySmartContractStateResponse>): QuerySmartContractStateResponse;
|
||||
toJSON(message: QuerySmartContractStateResponse): unknown;
|
||||
};
|
||||
export declare const QueryCodeRequest: {
|
||||
encode(message: QueryCodeRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodeRequest;
|
||||
fromJSON(object: any): QueryCodeRequest;
|
||||
fromPartial(object: DeepPartial<QueryCodeRequest>): QueryCodeRequest;
|
||||
toJSON(message: QueryCodeRequest): unknown;
|
||||
};
|
||||
export declare const CodeInfoResponse: {
|
||||
encode(message: CodeInfoResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CodeInfoResponse;
|
||||
fromJSON(object: any): CodeInfoResponse;
|
||||
fromPartial(object: DeepPartial<CodeInfoResponse>): CodeInfoResponse;
|
||||
toJSON(message: CodeInfoResponse): unknown;
|
||||
};
|
||||
export declare const QueryCodeResponse: {
|
||||
encode(message: QueryCodeResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodeResponse;
|
||||
fromJSON(object: any): QueryCodeResponse;
|
||||
fromPartial(object: DeepPartial<QueryCodeResponse>): QueryCodeResponse;
|
||||
toJSON(message: QueryCodeResponse): unknown;
|
||||
};
|
||||
export declare const QueryCodesRequest: {
|
||||
encode(message: QueryCodesRequest, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodesRequest;
|
||||
fromJSON(object: any): QueryCodesRequest;
|
||||
fromPartial(object: DeepPartial<QueryCodesRequest>): QueryCodesRequest;
|
||||
toJSON(message: QueryCodesRequest): unknown;
|
||||
};
|
||||
export declare const QueryCodesResponse: {
|
||||
encode(message: QueryCodesResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCodesResponse;
|
||||
fromJSON(object: any): QueryCodesResponse;
|
||||
fromPartial(object: DeepPartial<QueryCodesResponse>): QueryCodesResponse;
|
||||
toJSON(message: QueryCodesResponse): unknown;
|
||||
};
|
||||
/** Query provides defines the gRPC querier service */
|
||||
export interface Query {
|
||||
/** ContractInfo gets the contract meta data */
|
||||
ContractInfo(request: QueryContractInfoRequest): Promise<QueryContractInfoResponse>;
|
||||
/** ContractHistory gets the contract code history */
|
||||
ContractHistory(request: QueryContractHistoryRequest): Promise<QueryContractHistoryResponse>;
|
||||
/** ContractsByCode lists all smart contracts for a code id */
|
||||
ContractsByCode(request: QueryContractsByCodeRequest): Promise<QueryContractsByCodeResponse>;
|
||||
/** AllContractState gets all raw store data for a single contract */
|
||||
AllContractState(request: QueryAllContractStateRequest): Promise<QueryAllContractStateResponse>;
|
||||
/** RawContractState gets single key from the raw store data of a contract */
|
||||
RawContractState(request: QueryRawContractStateRequest): Promise<QueryRawContractStateResponse>;
|
||||
/** SmartContractState get smart query result from the contract */
|
||||
SmartContractState(request: QuerySmartContractStateRequest): Promise<QuerySmartContractStateResponse>;
|
||||
/** Code gets the binary code and metadata for a singe wasm code */
|
||||
Code(request: QueryCodeRequest): Promise<QueryCodeResponse>;
|
||||
/** Codes gets the metadata for all stored wasm codes */
|
||||
Codes(request: QueryCodesRequest): Promise<QueryCodesResponse>;
|
||||
}
|
||||
export declare class QueryClientImpl implements Query {
|
||||
private readonly rpc;
|
||||
constructor(rpc: Rpc);
|
||||
ContractInfo(request: QueryContractInfoRequest): Promise<QueryContractInfoResponse>;
|
||||
ContractHistory(request: QueryContractHistoryRequest): Promise<QueryContractHistoryResponse>;
|
||||
ContractsByCode(request: QueryContractsByCodeRequest): Promise<QueryContractsByCodeResponse>;
|
||||
AllContractState(request: QueryAllContractStateRequest): Promise<QueryAllContractStateResponse>;
|
||||
RawContractState(request: QueryRawContractStateRequest): Promise<QueryRawContractStateResponse>;
|
||||
SmartContractState(request: QuerySmartContractStateRequest): Promise<QuerySmartContractStateResponse>;
|
||||
Code(request: QueryCodeRequest): Promise<QueryCodeResponse>;
|
||||
Codes(request: QueryCodesRequest): Promise<QueryCodesResponse>;
|
||||
}
|
||||
interface Rpc {
|
||||
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
File diff suppressed because it is too large
Load Diff
@ -1,223 +0,0 @@
|
||||
import { AccessConfig } from "../../../../x/wasm/internal/types/types";
|
||||
import Long from "long";
|
||||
import { Coin } from "../../../../cosmos/base/v1beta1/coin";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmwasm.wasm.v1beta1";
|
||||
/** MsgStoreCode submit Wasm code to the system */
|
||||
export interface MsgStoreCode {
|
||||
/** Sender is the that actor that signed the messages */
|
||||
sender: string;
|
||||
/** WASMByteCode can be raw or gzip compressed */
|
||||
wasmByteCode: Uint8Array;
|
||||
/** Source is a valid absolute HTTPS URI to the contract's source code, optional */
|
||||
source: string;
|
||||
/** Builder is a valid docker image name with tag, optional */
|
||||
builder: string;
|
||||
/** InstantiatePermission access control to apply on contract creation, optional */
|
||||
instantiatePermission?: AccessConfig;
|
||||
}
|
||||
/** MsgStoreCodeResponse returns store result data. */
|
||||
export interface MsgStoreCodeResponse {
|
||||
/** CodeID is the reference to the stored WASM code */
|
||||
codeId: Long;
|
||||
}
|
||||
/** MsgInstantiateContract create a new smart contract instance for the given code id. */
|
||||
export interface MsgInstantiateContract {
|
||||
/** Sender is the that actor that signed the messages */
|
||||
sender: string;
|
||||
/** Admin is an optional address that can execute migrations */
|
||||
admin: string;
|
||||
/** CodeID is the reference to the stored WASM code */
|
||||
codeId: Long;
|
||||
/** Label is optional metadata to be stored with a contract instance. */
|
||||
label: string;
|
||||
/** InitMsg json encoded message to be passed to the contract on instantiation */
|
||||
initMsg: Uint8Array;
|
||||
/** InitFunds coins that are transferred to the contract on instantiation */
|
||||
initFunds: Coin[];
|
||||
}
|
||||
/** MsgInstantiateContractResponse return instantiation result data */
|
||||
export interface MsgInstantiateContractResponse {
|
||||
/** Address is the bech32 address of the new contract instance. */
|
||||
address: string;
|
||||
}
|
||||
/** MsgExecuteContract submits the given message data to a smart contract */
|
||||
export interface MsgExecuteContract {
|
||||
/** Sender is the that actor that signed the messages */
|
||||
sender: string;
|
||||
/** Contract is the address of the smart contract */
|
||||
contract: string;
|
||||
/** Msg json encoded message to be passed to the contract */
|
||||
msg: Uint8Array;
|
||||
/** SentFunds coins that are transferred to the contract on execution */
|
||||
sentFunds: Coin[];
|
||||
}
|
||||
/** MsgExecuteContractResponse returns execution result data. */
|
||||
export interface MsgExecuteContractResponse {
|
||||
/** Data contains base64-encoded bytes to returned from the contract */
|
||||
data: Uint8Array;
|
||||
}
|
||||
/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */
|
||||
export interface MsgMigrateContract {
|
||||
/** Sender is the that actor that signed the messages */
|
||||
sender: string;
|
||||
/** Contract is the address of the smart contract */
|
||||
contract: string;
|
||||
/** CodeID references the new WASM code */
|
||||
codeId: Long;
|
||||
/** MigrateMsg json encoded message to be passed to the contract on migration */
|
||||
migrateMsg: Uint8Array;
|
||||
}
|
||||
/** MsgMigrateContractResponse returns contract migration result data. */
|
||||
export interface MsgMigrateContractResponse {
|
||||
/**
|
||||
* Data contains same raw bytes returned as data from the wasm contract.
|
||||
* (May be empty)
|
||||
*/
|
||||
data: Uint8Array;
|
||||
}
|
||||
/** MsgUpdateAdmin sets a new admin for a smart contract */
|
||||
export interface MsgUpdateAdmin {
|
||||
/** Sender is the that actor that signed the messages */
|
||||
sender: string;
|
||||
/** NewAdmin address to be set */
|
||||
newAdmin: string;
|
||||
/** Contract is the address of the smart contract */
|
||||
contract: string;
|
||||
}
|
||||
/** MsgUpdateAdminResponse returns empty data */
|
||||
export interface MsgUpdateAdminResponse {}
|
||||
/** MsgClearAdmin removes any admin stored for a smart contract */
|
||||
export interface MsgClearAdmin {
|
||||
/** Sender is the that actor that signed the messages */
|
||||
sender: string;
|
||||
/** Contract is the address of the smart contract */
|
||||
contract: string;
|
||||
}
|
||||
/** MsgClearAdminResponse returns empty data */
|
||||
export interface MsgClearAdminResponse {}
|
||||
export declare const MsgStoreCode: {
|
||||
encode(message: MsgStoreCode, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgStoreCode;
|
||||
fromJSON(object: any): MsgStoreCode;
|
||||
fromPartial(object: DeepPartial<MsgStoreCode>): MsgStoreCode;
|
||||
toJSON(message: MsgStoreCode): unknown;
|
||||
};
|
||||
export declare const MsgStoreCodeResponse: {
|
||||
encode(message: MsgStoreCodeResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgStoreCodeResponse;
|
||||
fromJSON(object: any): MsgStoreCodeResponse;
|
||||
fromPartial(object: DeepPartial<MsgStoreCodeResponse>): MsgStoreCodeResponse;
|
||||
toJSON(message: MsgStoreCodeResponse): unknown;
|
||||
};
|
||||
export declare const MsgInstantiateContract: {
|
||||
encode(message: MsgInstantiateContract, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgInstantiateContract;
|
||||
fromJSON(object: any): MsgInstantiateContract;
|
||||
fromPartial(object: DeepPartial<MsgInstantiateContract>): MsgInstantiateContract;
|
||||
toJSON(message: MsgInstantiateContract): unknown;
|
||||
};
|
||||
export declare const MsgInstantiateContractResponse: {
|
||||
encode(message: MsgInstantiateContractResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgInstantiateContractResponse;
|
||||
fromJSON(object: any): MsgInstantiateContractResponse;
|
||||
fromPartial(object: DeepPartial<MsgInstantiateContractResponse>): MsgInstantiateContractResponse;
|
||||
toJSON(message: MsgInstantiateContractResponse): unknown;
|
||||
};
|
||||
export declare const MsgExecuteContract: {
|
||||
encode(message: MsgExecuteContract, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgExecuteContract;
|
||||
fromJSON(object: any): MsgExecuteContract;
|
||||
fromPartial(object: DeepPartial<MsgExecuteContract>): MsgExecuteContract;
|
||||
toJSON(message: MsgExecuteContract): unknown;
|
||||
};
|
||||
export declare const MsgExecuteContractResponse: {
|
||||
encode(message: MsgExecuteContractResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgExecuteContractResponse;
|
||||
fromJSON(object: any): MsgExecuteContractResponse;
|
||||
fromPartial(object: DeepPartial<MsgExecuteContractResponse>): MsgExecuteContractResponse;
|
||||
toJSON(message: MsgExecuteContractResponse): unknown;
|
||||
};
|
||||
export declare const MsgMigrateContract: {
|
||||
encode(message: MsgMigrateContract, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMigrateContract;
|
||||
fromJSON(object: any): MsgMigrateContract;
|
||||
fromPartial(object: DeepPartial<MsgMigrateContract>): MsgMigrateContract;
|
||||
toJSON(message: MsgMigrateContract): unknown;
|
||||
};
|
||||
export declare const MsgMigrateContractResponse: {
|
||||
encode(message: MsgMigrateContractResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMigrateContractResponse;
|
||||
fromJSON(object: any): MsgMigrateContractResponse;
|
||||
fromPartial(object: DeepPartial<MsgMigrateContractResponse>): MsgMigrateContractResponse;
|
||||
toJSON(message: MsgMigrateContractResponse): unknown;
|
||||
};
|
||||
export declare const MsgUpdateAdmin: {
|
||||
encode(message: MsgUpdateAdmin, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgUpdateAdmin;
|
||||
fromJSON(object: any): MsgUpdateAdmin;
|
||||
fromPartial(object: DeepPartial<MsgUpdateAdmin>): MsgUpdateAdmin;
|
||||
toJSON(message: MsgUpdateAdmin): unknown;
|
||||
};
|
||||
export declare const MsgUpdateAdminResponse: {
|
||||
encode(_: MsgUpdateAdminResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgUpdateAdminResponse;
|
||||
fromJSON(_: any): MsgUpdateAdminResponse;
|
||||
fromPartial(_: DeepPartial<MsgUpdateAdminResponse>): MsgUpdateAdminResponse;
|
||||
toJSON(_: MsgUpdateAdminResponse): unknown;
|
||||
};
|
||||
export declare const MsgClearAdmin: {
|
||||
encode(message: MsgClearAdmin, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgClearAdmin;
|
||||
fromJSON(object: any): MsgClearAdmin;
|
||||
fromPartial(object: DeepPartial<MsgClearAdmin>): MsgClearAdmin;
|
||||
toJSON(message: MsgClearAdmin): unknown;
|
||||
};
|
||||
export declare const MsgClearAdminResponse: {
|
||||
encode(_: MsgClearAdminResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgClearAdminResponse;
|
||||
fromJSON(_: any): MsgClearAdminResponse;
|
||||
fromPartial(_: DeepPartial<MsgClearAdminResponse>): MsgClearAdminResponse;
|
||||
toJSON(_: MsgClearAdminResponse): unknown;
|
||||
};
|
||||
/** Msg defines the wasm Msg service. */
|
||||
export interface Msg {
|
||||
/** StoreCode to submit Wasm code to the system */
|
||||
StoreCode(request: MsgStoreCode): Promise<MsgStoreCodeResponse>;
|
||||
/** Instantiate creates a new smart contract instance for the given code id. */
|
||||
InstantiateContract(request: MsgInstantiateContract): Promise<MsgInstantiateContractResponse>;
|
||||
/** Execute submits the given message data to a smart contract */
|
||||
ExecuteContract(request: MsgExecuteContract): Promise<MsgExecuteContractResponse>;
|
||||
/** Migrate runs a code upgrade/ downgrade for a smart contract */
|
||||
MigrateContract(request: MsgMigrateContract): Promise<MsgMigrateContractResponse>;
|
||||
/** UpdateAdmin sets a new admin for a smart contract */
|
||||
UpdateAdmin(request: MsgUpdateAdmin): Promise<MsgUpdateAdminResponse>;
|
||||
/** ClearAdmin removes any admin stored for a smart contract */
|
||||
ClearAdmin(request: MsgClearAdmin): Promise<MsgClearAdminResponse>;
|
||||
}
|
||||
export declare class MsgClientImpl implements Msg {
|
||||
private readonly rpc;
|
||||
constructor(rpc: Rpc);
|
||||
StoreCode(request: MsgStoreCode): Promise<MsgStoreCodeResponse>;
|
||||
InstantiateContract(request: MsgInstantiateContract): Promise<MsgInstantiateContractResponse>;
|
||||
ExecuteContract(request: MsgExecuteContract): Promise<MsgExecuteContractResponse>;
|
||||
MigrateContract(request: MsgMigrateContract): Promise<MsgMigrateContractResponse>;
|
||||
UpdateAdmin(request: MsgUpdateAdmin): Promise<MsgUpdateAdminResponse>;
|
||||
ClearAdmin(request: MsgClearAdmin): Promise<MsgClearAdminResponse>;
|
||||
}
|
||||
interface Rpc {
|
||||
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
File diff suppressed because it is too large
Load Diff
@ -1,171 +0,0 @@
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmwasm.wasm.v1beta1";
|
||||
/** AccessType permission types */
|
||||
export declare enum AccessType {
|
||||
/** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */
|
||||
ACCESS_TYPE_UNSPECIFIED = 0,
|
||||
/** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */
|
||||
ACCESS_TYPE_NOBODY = 1,
|
||||
/** ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to an address */
|
||||
ACCESS_TYPE_ONLY_ADDRESS = 2,
|
||||
/** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */
|
||||
ACCESS_TYPE_EVERYBODY = 3,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
export declare function accessTypeFromJSON(object: any): AccessType;
|
||||
export declare function accessTypeToJSON(object: AccessType): string;
|
||||
/** ContractCodeHistoryOperationType actions that caused a code change */
|
||||
export declare enum ContractCodeHistoryOperationType {
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0,
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1,
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2,
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
export declare function contractCodeHistoryOperationTypeFromJSON(
|
||||
object: any,
|
||||
): ContractCodeHistoryOperationType;
|
||||
export declare function contractCodeHistoryOperationTypeToJSON(
|
||||
object: ContractCodeHistoryOperationType,
|
||||
): string;
|
||||
/** AccessTypeParam */
|
||||
export interface AccessTypeParam {
|
||||
value: AccessType;
|
||||
}
|
||||
/** AccessConfig access control type. */
|
||||
export interface AccessConfig {
|
||||
permission: AccessType;
|
||||
address: string;
|
||||
}
|
||||
/** Params defines the set of wasm parameters. */
|
||||
export interface Params {
|
||||
codeUploadAccess?: AccessConfig;
|
||||
instantiateDefaultPermission: AccessType;
|
||||
maxWasmCodeSize: Long;
|
||||
}
|
||||
/** CodeInfo is data for the uploaded contract WASM code */
|
||||
export interface CodeInfo {
|
||||
/** CodeHash is the unique CodeID */
|
||||
codeHash: Uint8Array;
|
||||
/** Creator address who initially stored the code */
|
||||
creator: string;
|
||||
/** Source is a valid absolute HTTPS URI to the contract's source code, optional */
|
||||
source: string;
|
||||
/** Builder is a valid docker image name with tag, optional */
|
||||
builder: string;
|
||||
/** InstantiateConfig access control to apply on contract creation, optional */
|
||||
instantiateConfig?: AccessConfig;
|
||||
}
|
||||
/** ContractInfo stores a WASM contract instance */
|
||||
export interface ContractInfo {
|
||||
/** CodeID is the reference to the stored Wasm code */
|
||||
codeId: Long;
|
||||
/** Creator address who initially instantiated the contract */
|
||||
creator: string;
|
||||
/** Admin is an optional address that can execute migrations */
|
||||
admin: string;
|
||||
/** Label is optional metadata to be stored with a contract instance. */
|
||||
label: string;
|
||||
/**
|
||||
* Created Tx position when the contract was instantiated.
|
||||
* This data should kept internal and not be exposed via query results. Just use for sorting
|
||||
*/
|
||||
created?: AbsoluteTxPosition;
|
||||
}
|
||||
/** ContractCodeHistoryEntry metadata to a contract. */
|
||||
export interface ContractCodeHistoryEntry {
|
||||
operation: ContractCodeHistoryOperationType;
|
||||
/** CodeID is the reference to the stored WASM code */
|
||||
codeId: Long;
|
||||
/** Updated Tx position when the operation was executed. */
|
||||
updated?: AbsoluteTxPosition;
|
||||
msg: Uint8Array;
|
||||
}
|
||||
/** AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions. */
|
||||
export interface AbsoluteTxPosition {
|
||||
/** BlockHeight is the block the contract was created at */
|
||||
blockHeight: Long;
|
||||
/** TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) */
|
||||
txIndex: Long;
|
||||
}
|
||||
/** Model is a struct that holds a KV pair */
|
||||
export interface Model {
|
||||
/** hex-encode key to read it better (this is often ascii) */
|
||||
key: Uint8Array;
|
||||
/** base64-encode raw value */
|
||||
value: Uint8Array;
|
||||
}
|
||||
export declare const AccessTypeParam: {
|
||||
encode(message: AccessTypeParam, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AccessTypeParam;
|
||||
fromJSON(object: any): AccessTypeParam;
|
||||
fromPartial(object: DeepPartial<AccessTypeParam>): AccessTypeParam;
|
||||
toJSON(message: AccessTypeParam): unknown;
|
||||
};
|
||||
export declare const AccessConfig: {
|
||||
encode(message: AccessConfig, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AccessConfig;
|
||||
fromJSON(object: any): AccessConfig;
|
||||
fromPartial(object: DeepPartial<AccessConfig>): AccessConfig;
|
||||
toJSON(message: AccessConfig): unknown;
|
||||
};
|
||||
export declare const Params: {
|
||||
encode(message: Params, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
|
||||
fromJSON(object: any): Params;
|
||||
fromPartial(object: DeepPartial<Params>): Params;
|
||||
toJSON(message: Params): unknown;
|
||||
};
|
||||
export declare const CodeInfo: {
|
||||
encode(message: CodeInfo, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CodeInfo;
|
||||
fromJSON(object: any): CodeInfo;
|
||||
fromPartial(object: DeepPartial<CodeInfo>): CodeInfo;
|
||||
toJSON(message: CodeInfo): unknown;
|
||||
};
|
||||
export declare const ContractInfo: {
|
||||
encode(message: ContractInfo, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ContractInfo;
|
||||
fromJSON(object: any): ContractInfo;
|
||||
fromPartial(object: DeepPartial<ContractInfo>): ContractInfo;
|
||||
toJSON(message: ContractInfo): unknown;
|
||||
};
|
||||
export declare const ContractCodeHistoryEntry: {
|
||||
encode(message: ContractCodeHistoryEntry, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ContractCodeHistoryEntry;
|
||||
fromJSON(object: any): ContractCodeHistoryEntry;
|
||||
fromPartial(object: DeepPartial<ContractCodeHistoryEntry>): ContractCodeHistoryEntry;
|
||||
toJSON(message: ContractCodeHistoryEntry): unknown;
|
||||
};
|
||||
export declare const AbsoluteTxPosition: {
|
||||
encode(message: AbsoluteTxPosition, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AbsoluteTxPosition;
|
||||
fromJSON(object: any): AbsoluteTxPosition;
|
||||
fromPartial(object: DeepPartial<AbsoluteTxPosition>): AbsoluteTxPosition;
|
||||
toJSON(message: AbsoluteTxPosition): unknown;
|
||||
};
|
||||
export declare const Model: {
|
||||
encode(message: Model, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Model;
|
||||
fromJSON(object: any): Model;
|
||||
fromPartial(object: DeepPartial<Model>): Model;
|
||||
toJSON(message: Model): unknown;
|
||||
};
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
@ -1,899 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmwasm.wasm.v1beta1";
|
||||
|
||||
/** AccessType permission types */
|
||||
export enum AccessType {
|
||||
/** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */
|
||||
ACCESS_TYPE_UNSPECIFIED = 0,
|
||||
/** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */
|
||||
ACCESS_TYPE_NOBODY = 1,
|
||||
/** ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to an address */
|
||||
ACCESS_TYPE_ONLY_ADDRESS = 2,
|
||||
/** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */
|
||||
ACCESS_TYPE_EVERYBODY = 3,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function accessTypeFromJSON(object: any): AccessType {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "ACCESS_TYPE_UNSPECIFIED":
|
||||
return AccessType.ACCESS_TYPE_UNSPECIFIED;
|
||||
case 1:
|
||||
case "ACCESS_TYPE_NOBODY":
|
||||
return AccessType.ACCESS_TYPE_NOBODY;
|
||||
case 2:
|
||||
case "ACCESS_TYPE_ONLY_ADDRESS":
|
||||
return AccessType.ACCESS_TYPE_ONLY_ADDRESS;
|
||||
case 3:
|
||||
case "ACCESS_TYPE_EVERYBODY":
|
||||
return AccessType.ACCESS_TYPE_EVERYBODY;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return AccessType.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function accessTypeToJSON(object: AccessType): string {
|
||||
switch (object) {
|
||||
case AccessType.ACCESS_TYPE_UNSPECIFIED:
|
||||
return "ACCESS_TYPE_UNSPECIFIED";
|
||||
case AccessType.ACCESS_TYPE_NOBODY:
|
||||
return "ACCESS_TYPE_NOBODY";
|
||||
case AccessType.ACCESS_TYPE_ONLY_ADDRESS:
|
||||
return "ACCESS_TYPE_ONLY_ADDRESS";
|
||||
case AccessType.ACCESS_TYPE_EVERYBODY:
|
||||
return "ACCESS_TYPE_EVERYBODY";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
/** ContractCodeHistoryOperationType actions that caused a code change */
|
||||
export enum ContractCodeHistoryOperationType {
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0,
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1,
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2,
|
||||
/** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */
|
||||
CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED":
|
||||
return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED;
|
||||
case 1:
|
||||
case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT":
|
||||
return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT;
|
||||
case 2:
|
||||
case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE":
|
||||
return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE;
|
||||
case 3:
|
||||
case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS":
|
||||
return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return ContractCodeHistoryOperationType.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string {
|
||||
switch (object) {
|
||||
case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED:
|
||||
return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED";
|
||||
case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT:
|
||||
return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT";
|
||||
case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE:
|
||||
return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE";
|
||||
case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS:
|
||||
return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
/** AccessTypeParam */
|
||||
export interface AccessTypeParam {
|
||||
value: AccessType;
|
||||
}
|
||||
|
||||
/** AccessConfig access control type. */
|
||||
export interface AccessConfig {
|
||||
permission: AccessType;
|
||||
address: string;
|
||||
}
|
||||
|
||||
/** Params defines the set of wasm parameters. */
|
||||
export interface Params {
|
||||
codeUploadAccess?: AccessConfig;
|
||||
instantiateDefaultPermission: AccessType;
|
||||
maxWasmCodeSize: Long;
|
||||
}
|
||||
|
||||
/** CodeInfo is data for the uploaded contract WASM code */
|
||||
export interface CodeInfo {
|
||||
/** CodeHash is the unique CodeID */
|
||||
codeHash: Uint8Array;
|
||||
/** Creator address who initially stored the code */
|
||||
creator: string;
|
||||
/** Source is a valid absolute HTTPS URI to the contract's source code, optional */
|
||||
source: string;
|
||||
/** Builder is a valid docker image name with tag, optional */
|
||||
builder: string;
|
||||
/** InstantiateConfig access control to apply on contract creation, optional */
|
||||
instantiateConfig?: AccessConfig;
|
||||
}
|
||||
|
||||
/** ContractInfo stores a WASM contract instance */
|
||||
export interface ContractInfo {
|
||||
/** CodeID is the reference to the stored Wasm code */
|
||||
codeId: Long;
|
||||
/** Creator address who initially instantiated the contract */
|
||||
creator: string;
|
||||
/** Admin is an optional address that can execute migrations */
|
||||
admin: string;
|
||||
/** Label is optional metadata to be stored with a contract instance. */
|
||||
label: string;
|
||||
/**
|
||||
* Created Tx position when the contract was instantiated.
|
||||
* This data should kept internal and not be exposed via query results. Just use for sorting
|
||||
*/
|
||||
created?: AbsoluteTxPosition;
|
||||
}
|
||||
|
||||
/** ContractCodeHistoryEntry metadata to a contract. */
|
||||
export interface ContractCodeHistoryEntry {
|
||||
operation: ContractCodeHistoryOperationType;
|
||||
/** CodeID is the reference to the stored WASM code */
|
||||
codeId: Long;
|
||||
/** Updated Tx position when the operation was executed. */
|
||||
updated?: AbsoluteTxPosition;
|
||||
msg: Uint8Array;
|
||||
}
|
||||
|
||||
/** AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions. */
|
||||
export interface AbsoluteTxPosition {
|
||||
/** BlockHeight is the block the contract was created at */
|
||||
blockHeight: Long;
|
||||
/** TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) */
|
||||
txIndex: Long;
|
||||
}
|
||||
|
||||
/** Model is a struct that holds a KV pair */
|
||||
export interface Model {
|
||||
/** hex-encode key to read it better (this is often ascii) */
|
||||
key: Uint8Array;
|
||||
/** base64-encode raw value */
|
||||
value: Uint8Array;
|
||||
}
|
||||
|
||||
const baseAccessTypeParam: object = { value: 0 };
|
||||
|
||||
export const AccessTypeParam = {
|
||||
encode(message: AccessTypeParam, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(8).int32(message.value);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): AccessTypeParam {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseAccessTypeParam } as AccessTypeParam;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.value = reader.int32() as any;
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AccessTypeParam {
|
||||
const message = { ...baseAccessTypeParam } as AccessTypeParam;
|
||||
if (object.value !== undefined && object.value !== null) {
|
||||
message.value = accessTypeFromJSON(object.value);
|
||||
} else {
|
||||
message.value = 0;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<AccessTypeParam>): AccessTypeParam {
|
||||
const message = { ...baseAccessTypeParam } as AccessTypeParam;
|
||||
if (object.value !== undefined && object.value !== null) {
|
||||
message.value = object.value;
|
||||
} else {
|
||||
message.value = 0;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: AccessTypeParam): unknown {
|
||||
const obj: any = {};
|
||||
message.value !== undefined && (obj.value = accessTypeToJSON(message.value));
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseAccessConfig: object = { permission: 0, address: "" };
|
||||
|
||||
export const AccessConfig = {
|
||||
encode(message: AccessConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(8).int32(message.permission);
|
||||
writer.uint32(18).string(message.address);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfig {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseAccessConfig } as AccessConfig;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.permission = reader.int32() as any;
|
||||
break;
|
||||
case 2:
|
||||
message.address = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AccessConfig {
|
||||
const message = { ...baseAccessConfig } as AccessConfig;
|
||||
if (object.permission !== undefined && object.permission !== null) {
|
||||
message.permission = accessTypeFromJSON(object.permission);
|
||||
} else {
|
||||
message.permission = 0;
|
||||
}
|
||||
if (object.address !== undefined && object.address !== null) {
|
||||
message.address = String(object.address);
|
||||
} else {
|
||||
message.address = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<AccessConfig>): AccessConfig {
|
||||
const message = { ...baseAccessConfig } as AccessConfig;
|
||||
if (object.permission !== undefined && object.permission !== null) {
|
||||
message.permission = object.permission;
|
||||
} else {
|
||||
message.permission = 0;
|
||||
}
|
||||
if (object.address !== undefined && object.address !== null) {
|
||||
message.address = object.address;
|
||||
} else {
|
||||
message.address = "";
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: AccessConfig): unknown {
|
||||
const obj: any = {};
|
||||
message.permission !== undefined && (obj.permission = accessTypeToJSON(message.permission));
|
||||
message.address !== undefined && (obj.address = message.address);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseParams: object = { instantiateDefaultPermission: 0, maxWasmCodeSize: Long.UZERO };
|
||||
|
||||
export const Params = {
|
||||
encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.codeUploadAccess !== undefined && message.codeUploadAccess !== undefined) {
|
||||
AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
writer.uint32(16).int32(message.instantiateDefaultPermission);
|
||||
writer.uint32(24).uint64(message.maxWasmCodeSize);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseParams } as Params;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.codeUploadAccess = AccessConfig.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 2:
|
||||
message.instantiateDefaultPermission = reader.int32() as any;
|
||||
break;
|
||||
case 3:
|
||||
message.maxWasmCodeSize = reader.uint64() as Long;
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Params {
|
||||
const message = { ...baseParams } as Params;
|
||||
if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) {
|
||||
message.codeUploadAccess = AccessConfig.fromJSON(object.codeUploadAccess);
|
||||
} else {
|
||||
message.codeUploadAccess = undefined;
|
||||
}
|
||||
if (object.instantiateDefaultPermission !== undefined && object.instantiateDefaultPermission !== null) {
|
||||
message.instantiateDefaultPermission = accessTypeFromJSON(object.instantiateDefaultPermission);
|
||||
} else {
|
||||
message.instantiateDefaultPermission = 0;
|
||||
}
|
||||
if (object.maxWasmCodeSize !== undefined && object.maxWasmCodeSize !== null) {
|
||||
message.maxWasmCodeSize = Long.fromString(object.maxWasmCodeSize);
|
||||
} else {
|
||||
message.maxWasmCodeSize = Long.UZERO;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Params>): Params {
|
||||
const message = { ...baseParams } as Params;
|
||||
if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) {
|
||||
message.codeUploadAccess = AccessConfig.fromPartial(object.codeUploadAccess);
|
||||
} else {
|
||||
message.codeUploadAccess = undefined;
|
||||
}
|
||||
if (object.instantiateDefaultPermission !== undefined && object.instantiateDefaultPermission !== null) {
|
||||
message.instantiateDefaultPermission = object.instantiateDefaultPermission;
|
||||
} else {
|
||||
message.instantiateDefaultPermission = 0;
|
||||
}
|
||||
if (object.maxWasmCodeSize !== undefined && object.maxWasmCodeSize !== null) {
|
||||
message.maxWasmCodeSize = object.maxWasmCodeSize as Long;
|
||||
} else {
|
||||
message.maxWasmCodeSize = Long.UZERO;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: Params): unknown {
|
||||
const obj: any = {};
|
||||
message.codeUploadAccess !== undefined &&
|
||||
(obj.codeUploadAccess = message.codeUploadAccess
|
||||
? AccessConfig.toJSON(message.codeUploadAccess)
|
||||
: undefined);
|
||||
message.instantiateDefaultPermission !== undefined &&
|
||||
(obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission));
|
||||
message.maxWasmCodeSize !== undefined &&
|
||||
(obj.maxWasmCodeSize = (message.maxWasmCodeSize || Long.UZERO).toString());
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseCodeInfo: object = { creator: "", source: "", builder: "" };
|
||||
|
||||
export const CodeInfo = {
|
||||
encode(message: CodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).bytes(message.codeHash);
|
||||
writer.uint32(18).string(message.creator);
|
||||
writer.uint32(26).string(message.source);
|
||||
writer.uint32(34).string(message.builder);
|
||||
if (message.instantiateConfig !== undefined && message.instantiateConfig !== undefined) {
|
||||
AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfo {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseCodeInfo } as CodeInfo;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.codeHash = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.creator = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.source = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.builder = reader.string();
|
||||
break;
|
||||
case 5:
|
||||
message.instantiateConfig = AccessConfig.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CodeInfo {
|
||||
const message = { ...baseCodeInfo } as CodeInfo;
|
||||
if (object.codeHash !== undefined && object.codeHash !== null) {
|
||||
message.codeHash = bytesFromBase64(object.codeHash);
|
||||
}
|
||||
if (object.creator !== undefined && object.creator !== null) {
|
||||
message.creator = String(object.creator);
|
||||
} else {
|
||||
message.creator = "";
|
||||
}
|
||||
if (object.source !== undefined && object.source !== null) {
|
||||
message.source = String(object.source);
|
||||
} else {
|
||||
message.source = "";
|
||||
}
|
||||
if (object.builder !== undefined && object.builder !== null) {
|
||||
message.builder = String(object.builder);
|
||||
} else {
|
||||
message.builder = "";
|
||||
}
|
||||
if (object.instantiateConfig !== undefined && object.instantiateConfig !== null) {
|
||||
message.instantiateConfig = AccessConfig.fromJSON(object.instantiateConfig);
|
||||
} else {
|
||||
message.instantiateConfig = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<CodeInfo>): CodeInfo {
|
||||
const message = { ...baseCodeInfo } as CodeInfo;
|
||||
if (object.codeHash !== undefined && object.codeHash !== null) {
|
||||
message.codeHash = object.codeHash;
|
||||
} else {
|
||||
message.codeHash = new Uint8Array();
|
||||
}
|
||||
if (object.creator !== undefined && object.creator !== null) {
|
||||
message.creator = object.creator;
|
||||
} else {
|
||||
message.creator = "";
|
||||
}
|
||||
if (object.source !== undefined && object.source !== null) {
|
||||
message.source = object.source;
|
||||
} else {
|
||||
message.source = "";
|
||||
}
|
||||
if (object.builder !== undefined && object.builder !== null) {
|
||||
message.builder = object.builder;
|
||||
} else {
|
||||
message.builder = "";
|
||||
}
|
||||
if (object.instantiateConfig !== undefined && object.instantiateConfig !== null) {
|
||||
message.instantiateConfig = AccessConfig.fromPartial(object.instantiateConfig);
|
||||
} else {
|
||||
message.instantiateConfig = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: CodeInfo): unknown {
|
||||
const obj: any = {};
|
||||
message.codeHash !== undefined &&
|
||||
(obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array()));
|
||||
message.creator !== undefined && (obj.creator = message.creator);
|
||||
message.source !== undefined && (obj.source = message.source);
|
||||
message.builder !== undefined && (obj.builder = message.builder);
|
||||
message.instantiateConfig !== undefined &&
|
||||
(obj.instantiateConfig = message.instantiateConfig
|
||||
? AccessConfig.toJSON(message.instantiateConfig)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseContractInfo: object = { codeId: Long.UZERO, creator: "", admin: "", label: "" };
|
||||
|
||||
export const ContractInfo = {
|
||||
encode(message: ContractInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(8).uint64(message.codeId);
|
||||
writer.uint32(18).string(message.creator);
|
||||
writer.uint32(26).string(message.admin);
|
||||
writer.uint32(34).string(message.label);
|
||||
if (message.created !== undefined && message.created !== undefined) {
|
||||
AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfo {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseContractInfo } as ContractInfo;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.codeId = reader.uint64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.creator = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.admin = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.label = reader.string();
|
||||
break;
|
||||
case 5:
|
||||
message.created = AbsoluteTxPosition.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ContractInfo {
|
||||
const message = { ...baseContractInfo } as ContractInfo;
|
||||
if (object.codeId !== undefined && object.codeId !== null) {
|
||||
message.codeId = Long.fromString(object.codeId);
|
||||
} else {
|
||||
message.codeId = Long.UZERO;
|
||||
}
|
||||
if (object.creator !== undefined && object.creator !== null) {
|
||||
message.creator = String(object.creator);
|
||||
} else {
|
||||
message.creator = "";
|
||||
}
|
||||
if (object.admin !== undefined && object.admin !== null) {
|
||||
message.admin = String(object.admin);
|
||||
} else {
|
||||
message.admin = "";
|
||||
}
|
||||
if (object.label !== undefined && object.label !== null) {
|
||||
message.label = String(object.label);
|
||||
} else {
|
||||
message.label = "";
|
||||
}
|
||||
if (object.created !== undefined && object.created !== null) {
|
||||
message.created = AbsoluteTxPosition.fromJSON(object.created);
|
||||
} else {
|
||||
message.created = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<ContractInfo>): ContractInfo {
|
||||
const message = { ...baseContractInfo } as ContractInfo;
|
||||
if (object.codeId !== undefined && object.codeId !== null) {
|
||||
message.codeId = object.codeId as Long;
|
||||
} else {
|
||||
message.codeId = Long.UZERO;
|
||||
}
|
||||
if (object.creator !== undefined && object.creator !== null) {
|
||||
message.creator = object.creator;
|
||||
} else {
|
||||
message.creator = "";
|
||||
}
|
||||
if (object.admin !== undefined && object.admin !== null) {
|
||||
message.admin = object.admin;
|
||||
} else {
|
||||
message.admin = "";
|
||||
}
|
||||
if (object.label !== undefined && object.label !== null) {
|
||||
message.label = object.label;
|
||||
} else {
|
||||
message.label = "";
|
||||
}
|
||||
if (object.created !== undefined && object.created !== null) {
|
||||
message.created = AbsoluteTxPosition.fromPartial(object.created);
|
||||
} else {
|
||||
message.created = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: ContractInfo): unknown {
|
||||
const obj: any = {};
|
||||
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
|
||||
message.creator !== undefined && (obj.creator = message.creator);
|
||||
message.admin !== undefined && (obj.admin = message.admin);
|
||||
message.label !== undefined && (obj.label = message.label);
|
||||
message.created !== undefined &&
|
||||
(obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined);
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseContractCodeHistoryEntry: object = { operation: 0, codeId: Long.UZERO };
|
||||
|
||||
export const ContractCodeHistoryEntry = {
|
||||
encode(message: ContractCodeHistoryEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(8).int32(message.operation);
|
||||
writer.uint32(16).uint64(message.codeId);
|
||||
if (message.updated !== undefined && message.updated !== undefined) {
|
||||
AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
writer.uint32(34).bytes(message.msg);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ContractCodeHistoryEntry {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.operation = reader.int32() as any;
|
||||
break;
|
||||
case 2:
|
||||
message.codeId = reader.uint64() as Long;
|
||||
break;
|
||||
case 3:
|
||||
message.updated = AbsoluteTxPosition.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 4:
|
||||
message.msg = reader.bytes();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ContractCodeHistoryEntry {
|
||||
const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry;
|
||||
if (object.operation !== undefined && object.operation !== null) {
|
||||
message.operation = contractCodeHistoryOperationTypeFromJSON(object.operation);
|
||||
} else {
|
||||
message.operation = 0;
|
||||
}
|
||||
if (object.codeId !== undefined && object.codeId !== null) {
|
||||
message.codeId = Long.fromString(object.codeId);
|
||||
} else {
|
||||
message.codeId = Long.UZERO;
|
||||
}
|
||||
if (object.updated !== undefined && object.updated !== null) {
|
||||
message.updated = AbsoluteTxPosition.fromJSON(object.updated);
|
||||
} else {
|
||||
message.updated = undefined;
|
||||
}
|
||||
if (object.msg !== undefined && object.msg !== null) {
|
||||
message.msg = bytesFromBase64(object.msg);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<ContractCodeHistoryEntry>): ContractCodeHistoryEntry {
|
||||
const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry;
|
||||
if (object.operation !== undefined && object.operation !== null) {
|
||||
message.operation = object.operation;
|
||||
} else {
|
||||
message.operation = 0;
|
||||
}
|
||||
if (object.codeId !== undefined && object.codeId !== null) {
|
||||
message.codeId = object.codeId as Long;
|
||||
} else {
|
||||
message.codeId = Long.UZERO;
|
||||
}
|
||||
if (object.updated !== undefined && object.updated !== null) {
|
||||
message.updated = AbsoluteTxPosition.fromPartial(object.updated);
|
||||
} else {
|
||||
message.updated = undefined;
|
||||
}
|
||||
if (object.msg !== undefined && object.msg !== null) {
|
||||
message.msg = object.msg;
|
||||
} else {
|
||||
message.msg = new Uint8Array();
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: ContractCodeHistoryEntry): unknown {
|
||||
const obj: any = {};
|
||||
message.operation !== undefined &&
|
||||
(obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation));
|
||||
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
|
||||
message.updated !== undefined &&
|
||||
(obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined);
|
||||
message.msg !== undefined &&
|
||||
(obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array()));
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseAbsoluteTxPosition: object = { blockHeight: Long.UZERO, txIndex: Long.UZERO };
|
||||
|
||||
export const AbsoluteTxPosition = {
|
||||
encode(message: AbsoluteTxPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(8).uint64(message.blockHeight);
|
||||
writer.uint32(16).uint64(message.txIndex);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): AbsoluteTxPosition {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.blockHeight = reader.uint64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.txIndex = reader.uint64() as Long;
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AbsoluteTxPosition {
|
||||
const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition;
|
||||
if (object.blockHeight !== undefined && object.blockHeight !== null) {
|
||||
message.blockHeight = Long.fromString(object.blockHeight);
|
||||
} else {
|
||||
message.blockHeight = Long.UZERO;
|
||||
}
|
||||
if (object.txIndex !== undefined && object.txIndex !== null) {
|
||||
message.txIndex = Long.fromString(object.txIndex);
|
||||
} else {
|
||||
message.txIndex = Long.UZERO;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<AbsoluteTxPosition>): AbsoluteTxPosition {
|
||||
const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition;
|
||||
if (object.blockHeight !== undefined && object.blockHeight !== null) {
|
||||
message.blockHeight = object.blockHeight as Long;
|
||||
} else {
|
||||
message.blockHeight = Long.UZERO;
|
||||
}
|
||||
if (object.txIndex !== undefined && object.txIndex !== null) {
|
||||
message.txIndex = object.txIndex as Long;
|
||||
} else {
|
||||
message.txIndex = Long.UZERO;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: AbsoluteTxPosition): unknown {
|
||||
const obj: any = {};
|
||||
message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.UZERO).toString());
|
||||
message.txIndex !== undefined && (obj.txIndex = (message.txIndex || Long.UZERO).toString());
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
const baseModel: object = {};
|
||||
|
||||
export const Model = {
|
||||
encode(message: Model, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
writer.uint32(10).bytes(message.key);
|
||||
writer.uint32(18).bytes(message.value);
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Model {
|
||||
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseModel } as Model;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.key = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.value = reader.bytes();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Model {
|
||||
const message = { ...baseModel } as Model;
|
||||
if (object.key !== undefined && object.key !== null) {
|
||||
message.key = bytesFromBase64(object.key);
|
||||
}
|
||||
if (object.value !== undefined && object.value !== null) {
|
||||
message.value = bytesFromBase64(object.value);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Model>): Model {
|
||||
const message = { ...baseModel } as Model;
|
||||
if (object.key !== undefined && object.key !== null) {
|
||||
message.key = object.key;
|
||||
} else {
|
||||
message.key = new Uint8Array();
|
||||
}
|
||||
if (object.value !== undefined && object.value !== null) {
|
||||
message.value = object.value;
|
||||
} else {
|
||||
message.value = new Uint8Array();
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: Model): unknown {
|
||||
const obj: any = {};
|
||||
message.key !== undefined &&
|
||||
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
|
||||
message.value !== undefined &&
|
||||
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
|
||||
return obj;
|
||||
},
|
||||
};
|
||||
|
||||
declare var self: any | undefined;
|
||||
declare var window: any | undefined;
|
||||
var globalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") return globalThis;
|
||||
if (typeof self !== "undefined") return self;
|
||||
if (typeof window !== "undefined") return window;
|
||||
if (typeof global !== "undefined") return global;
|
||||
throw new Error("Unable to locate global object");
|
||||
})();
|
||||
|
||||
const atob: (b64: string) => string =
|
||||
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
|
||||
function bytesFromBase64(b64: string): Uint8Array {
|
||||
const bin = atob(b64);
|
||||
const arr = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; ++i) {
|
||||
arr[i] = bin.charCodeAt(i);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
const btoa: (bin: string) => string =
|
||||
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
|
||||
function base64FromBytes(arr: Uint8Array): string {
|
||||
const bin: string[] = [];
|
||||
for (let i = 0; i < arr.byteLength; ++i) {
|
||||
bin.push(String.fromCharCode(arr[i]));
|
||||
}
|
||||
return btoa(bin.join(""));
|
||||
}
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
@ -1,69 +0,0 @@
|
||||
import {
|
||||
Code,
|
||||
CodeDetails,
|
||||
Contract,
|
||||
ContractCodeHistoryEntry,
|
||||
JsonObject,
|
||||
} from "@cosmjs/cosmwasm-launchpad";
|
||||
import { Block, Coin, SearchTxFilter, SearchTxQuery } from "@cosmjs/launchpad";
|
||||
import {
|
||||
Account,
|
||||
AuthExtension,
|
||||
BankExtension,
|
||||
BroadcastTxResponse,
|
||||
IndexedTx,
|
||||
QueryClient,
|
||||
SequenceResponse,
|
||||
} from "@cosmjs/stargate";
|
||||
import { Client as TendermintClient } from "@cosmjs/tendermint-rpc";
|
||||
import { WasmExtension } from "./queries";
|
||||
/** Use for testing only */
|
||||
export interface PrivateCosmWasmClient {
|
||||
readonly tmClient: TendermintClient;
|
||||
readonly queryClient: QueryClient & AuthExtension & BankExtension & WasmExtension;
|
||||
}
|
||||
export declare class CosmWasmClient {
|
||||
private readonly tmClient;
|
||||
private readonly queryClient;
|
||||
private readonly codesCache;
|
||||
private chainId;
|
||||
static connect(endpoint: string): Promise<CosmWasmClient>;
|
||||
protected constructor(tmClient: TendermintClient);
|
||||
getChainId(): Promise<string>;
|
||||
getHeight(): Promise<number>;
|
||||
getAccount(searchAddress: string): Promise<Account | null>;
|
||||
getSequence(address: string): Promise<SequenceResponse | null>;
|
||||
getBlock(height?: number): Promise<Block>;
|
||||
getBalance(address: string, searchDenom: string): Promise<Coin | null>;
|
||||
getTx(id: string): Promise<IndexedTx | null>;
|
||||
searchTx(query: SearchTxQuery, filter?: SearchTxFilter): Promise<readonly IndexedTx[]>;
|
||||
disconnect(): void;
|
||||
broadcastTx(tx: Uint8Array): Promise<BroadcastTxResponse>;
|
||||
getCodes(): Promise<readonly Code[]>;
|
||||
getCodeDetails(codeId: number): Promise<CodeDetails>;
|
||||
getContracts(codeId: number): Promise<readonly Contract[]>;
|
||||
/**
|
||||
* Throws an error if no contract was found at the address
|
||||
*/
|
||||
getContract(address: string): Promise<Contract>;
|
||||
/**
|
||||
* Throws an error if no contract was found at the address
|
||||
*/
|
||||
getContractCodeHistory(address: string): Promise<readonly ContractCodeHistoryEntry[]>;
|
||||
/**
|
||||
* Returns the data at the key if present (raw contract dependent storage data)
|
||||
* or null if no data at this key.
|
||||
*
|
||||
* Promise is rejected when contract does not exist.
|
||||
*/
|
||||
queryContractRaw(address: string, key: Uint8Array): Promise<Uint8Array | null>;
|
||||
/**
|
||||
* Makes a smart query on the contract, returns the parsed JSON document.
|
||||
*
|
||||
* Promise is rejected when contract does not exist.
|
||||
* Promise is rejected for invalid query format.
|
||||
* Promise is rejected for invalid response format.
|
||||
*/
|
||||
queryContractSmart(address: string, queryMsg: Record<string, unknown>): Promise<JsonObject>;
|
||||
private txsQuery;
|
||||
}
|
3
packages/cosmwasm-stargate/types/index.d.ts
vendored
3
packages/cosmwasm-stargate/types/index.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
export { cosmWasmTypes } from "./aminotypes";
|
||||
export { CosmWasmClient } from "./cosmwasmclient";
|
||||
export { SigningCosmWasmClient, SigningCosmWasmClientOptions } from "./signingcosmwasmclient";
|
@ -1 +0,0 @@
|
||||
export { setupWasmExtension, WasmExtension } from "./wasm";
|
@ -1,58 +0,0 @@
|
||||
import { JsonObject } from "@cosmjs/cosmwasm-launchpad";
|
||||
import { QueryClient } from "@cosmjs/stargate";
|
||||
import {
|
||||
QueryAllContractStateResponse,
|
||||
QueryCodeResponse,
|
||||
QueryCodesResponse,
|
||||
QueryContractHistoryResponse,
|
||||
QueryContractInfoResponse,
|
||||
QueryContractsByCodeResponse,
|
||||
QueryRawContractStateResponse,
|
||||
} from "../codec/x/wasm/internal/types/query";
|
||||
export interface WasmExtension {
|
||||
readonly unverified: {
|
||||
readonly wasm: {
|
||||
readonly listCodeInfo: (paginationKey?: Uint8Array) => Promise<QueryCodesResponse>;
|
||||
/**
|
||||
* Downloads the original wasm bytecode by code ID.
|
||||
*
|
||||
* Throws an error if no code with this id
|
||||
*/
|
||||
readonly getCode: (id: number) => Promise<QueryCodeResponse>;
|
||||
readonly listContractsByCodeId: (
|
||||
id: number,
|
||||
paginationKey?: Uint8Array,
|
||||
) => Promise<QueryContractsByCodeResponse>;
|
||||
/**
|
||||
* Returns null when contract was not found at this address.
|
||||
*/
|
||||
readonly getContractInfo: (address: string) => Promise<QueryContractInfoResponse>;
|
||||
/**
|
||||
* Returns null when contract history was not found for this address.
|
||||
*/
|
||||
readonly getContractCodeHistory: (
|
||||
address: string,
|
||||
paginationKey?: Uint8Array,
|
||||
) => Promise<QueryContractHistoryResponse>;
|
||||
/**
|
||||
* Returns all contract state.
|
||||
* This is an empty array if no such contract, or contract has no data.
|
||||
*/
|
||||
readonly getAllContractState: (
|
||||
address: string,
|
||||
paginationKey?: Uint8Array,
|
||||
) => Promise<QueryAllContractStateResponse>;
|
||||
/**
|
||||
* Returns the data at the key if present (unknown decoded json),
|
||||
* or null if no data at this (contract address, key) pair
|
||||
*/
|
||||
readonly queryContractRaw: (address: string, key: Uint8Array) => Promise<QueryRawContractStateResponse>;
|
||||
/**
|
||||
* Makes a smart query on the contract and parses the response as JSON.
|
||||
* Throws error if no such contract exists, the query format is invalid or the response is invalid.
|
||||
*/
|
||||
readonly queryContractSmart: (address: string, query: Record<string, unknown>) => Promise<JsonObject>;
|
||||
};
|
||||
};
|
||||
}
|
||||
export declare function setupWasmExtension(base: QueryClient): WasmExtension;
|
@ -1,93 +0,0 @@
|
||||
import {
|
||||
ChangeAdminResult,
|
||||
CosmWasmFeeTable,
|
||||
ExecuteResult,
|
||||
InstantiateOptions,
|
||||
InstantiateResult,
|
||||
MigrateResult,
|
||||
UploadMeta,
|
||||
UploadResult,
|
||||
} from "@cosmjs/cosmwasm-launchpad";
|
||||
import { Coin, CosmosFeeTable, GasLimits, GasPrice, StdFee } from "@cosmjs/launchpad";
|
||||
import { EncodeObject, OfflineSigner, Registry } from "@cosmjs/proto-signing";
|
||||
import { AminoTypes, BroadcastTxResponse } from "@cosmjs/stargate";
|
||||
import { CosmWasmClient } from "./cosmwasmclient";
|
||||
export interface SigningCosmWasmClientOptions {
|
||||
readonly registry?: Registry;
|
||||
readonly aminoTypes?: AminoTypes;
|
||||
readonly prefix?: string;
|
||||
readonly gasPrice?: GasPrice;
|
||||
readonly gasLimits?: GasLimits<CosmosFeeTable>;
|
||||
}
|
||||
/** Use for testing only */
|
||||
export interface PrivateSigningCosmWasmClient {
|
||||
readonly fees: CosmWasmFeeTable;
|
||||
readonly registry: Registry;
|
||||
}
|
||||
export declare class SigningCosmWasmClient extends CosmWasmClient {
|
||||
private readonly fees;
|
||||
private readonly registry;
|
||||
private readonly signer;
|
||||
private readonly aminoTypes;
|
||||
static connectWithSigner(
|
||||
endpoint: string,
|
||||
signer: OfflineSigner,
|
||||
options?: SigningCosmWasmClientOptions,
|
||||
): Promise<SigningCosmWasmClient>;
|
||||
private constructor();
|
||||
/** Uploads code and returns a receipt, including the code ID */
|
||||
upload(
|
||||
senderAddress: string,
|
||||
wasmCode: Uint8Array,
|
||||
meta?: UploadMeta,
|
||||
memo?: string,
|
||||
): Promise<UploadResult>;
|
||||
instantiate(
|
||||
senderAddress: string,
|
||||
codeId: number,
|
||||
initMsg: Record<string, unknown>,
|
||||
label: string,
|
||||
options?: InstantiateOptions,
|
||||
): Promise<InstantiateResult>;
|
||||
updateAdmin(
|
||||
senderAddress: string,
|
||||
contractAddress: string,
|
||||
newAdmin: string,
|
||||
memo?: string,
|
||||
): Promise<ChangeAdminResult>;
|
||||
clearAdmin(senderAddress: string, contractAddress: string, memo?: string): Promise<ChangeAdminResult>;
|
||||
migrate(
|
||||
senderAddress: string,
|
||||
contractAddress: string,
|
||||
codeId: number,
|
||||
migrateMsg: Record<string, unknown>,
|
||||
memo?: string,
|
||||
): Promise<MigrateResult>;
|
||||
execute(
|
||||
senderAddress: string,
|
||||
contractAddress: string,
|
||||
handleMsg: Record<string, unknown>,
|
||||
memo?: string,
|
||||
transferAmount?: readonly Coin[],
|
||||
): Promise<ExecuteResult>;
|
||||
sendTokens(
|
||||
senderAddress: string,
|
||||
recipientAddress: string,
|
||||
transferAmount: readonly Coin[],
|
||||
memo?: string,
|
||||
): Promise<BroadcastTxResponse>;
|
||||
/**
|
||||
* Creates a transaction with the given messages, fee and memo. Then signs and broadcasts the transaction.
|
||||
*
|
||||
* @param signerAddress The address that will sign transactions using this instance. The signer must be able to sign with this address.
|
||||
* @param messages
|
||||
* @param fee
|
||||
* @param memo
|
||||
*/
|
||||
signAndBroadcast(
|
||||
signerAddress: string,
|
||||
messages: readonly EncodeObject[],
|
||||
fee: StdFee,
|
||||
memo?: string,
|
||||
): Promise<BroadcastTxResponse>;
|
||||
}
|
1
packages/cosmwasm/types/index.d.ts
vendored
1
packages/cosmwasm/types/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export * from "@cosmjs/cosmwasm-launchpad";
|
22
packages/crypto/types/bip39.d.ts
vendored
22
packages/crypto/types/bip39.d.ts
vendored
@ -1,22 +0,0 @@
|
||||
import { EnglishMnemonic } from "./englishmnemonic";
|
||||
export declare class Bip39 {
|
||||
/**
|
||||
* Encodes raw entropy of length 16, 20, 24, 28 or 32 bytes as an English mnemonic between 12 and 24 words.
|
||||
*
|
||||
* | Entropy | Words |
|
||||
* |--------------------|-------|
|
||||
* | 128 bit (16 bytes) | 12 |
|
||||
* | 160 bit (20 bytes) | 15 |
|
||||
* | 192 bit (24 bytes) | 18 |
|
||||
* | 224 bit (28 bytes) | 21 |
|
||||
* | 256 bit (32 bytes) | 24 |
|
||||
*
|
||||
*
|
||||
* @see https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#generating-the-mnemonic
|
||||
* @param entropy The entropy to be encoded. This must be cryptographically secure.
|
||||
*/
|
||||
static encode(entropy: Uint8Array): EnglishMnemonic;
|
||||
static decode(mnemonic: EnglishMnemonic): Uint8Array;
|
||||
static mnemonicToSeed(mnemonic: EnglishMnemonic, password?: string): Promise<Uint8Array>;
|
||||
private static pbkdf2;
|
||||
}
|
7
packages/crypto/types/englishmnemonic.d.ts
vendored
7
packages/crypto/types/englishmnemonic.d.ts
vendored
@ -1,7 +0,0 @@
|
||||
export declare class EnglishMnemonic {
|
||||
static readonly wordlist: readonly string[];
|
||||
private static readonly mnemonicMatcher;
|
||||
private readonly data;
|
||||
constructor(mnemonic: string);
|
||||
toString(): string;
|
||||
}
|
5
packages/crypto/types/hash.d.ts
vendored
5
packages/crypto/types/hash.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
export interface HashFunction {
|
||||
readonly blockSize: number;
|
||||
readonly update: (_: Uint8Array) => HashFunction;
|
||||
readonly digest: () => Uint8Array;
|
||||
}
|
11
packages/crypto/types/hmac.d.ts
vendored
11
packages/crypto/types/hmac.d.ts
vendored
@ -1,11 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Hmac<H extends HashFunction> implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly messageHasher;
|
||||
private readonly oKeyPad;
|
||||
private readonly iKeyPad;
|
||||
private readonly hash;
|
||||
constructor(hashFunctionConstructor: new () => H, originalKey: Uint8Array);
|
||||
update(data: Uint8Array): Hmac<H>;
|
||||
digest(): Uint8Array;
|
||||
}
|
29
packages/crypto/types/index.d.ts
vendored
29
packages/crypto/types/index.d.ts
vendored
@ -1,29 +0,0 @@
|
||||
export { Bip39 } from "./bip39";
|
||||
export { EnglishMnemonic } from "./englishmnemonic";
|
||||
export { HashFunction } from "./hash";
|
||||
export { Hmac } from "./hmac";
|
||||
export { Keccak256, keccak256 } from "./keccak";
|
||||
export {
|
||||
Xchacha20poly1305Ietf,
|
||||
xchacha20NonceLength,
|
||||
Argon2id,
|
||||
Argon2idOptions,
|
||||
isArgon2idOptions,
|
||||
Ed25519,
|
||||
Ed25519Keypair,
|
||||
} from "./libsodium";
|
||||
export { Random } from "./random";
|
||||
export { Ripemd160, ripemd160 } from "./ripemd";
|
||||
export { Secp256k1, Secp256k1Keypair } from "./secp256k1";
|
||||
export { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature";
|
||||
export { Sha1, sha1, Sha256, sha256, Sha512, sha512 } from "./sha";
|
||||
export {
|
||||
HdPath,
|
||||
pathToString,
|
||||
stringToPath,
|
||||
Slip10,
|
||||
Slip10Curve,
|
||||
Slip10RawIndex,
|
||||
Slip10Result,
|
||||
slip10CurveFromString,
|
||||
} from "./slip10";
|
10
packages/crypto/types/keccak.d.ts
vendored
10
packages/crypto/types/keccak.d.ts
vendored
@ -1,10 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Keccak256 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Keccak256;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Keccak256(data).digest()` */
|
||||
export declare function keccak256(data: Uint8Array): Uint8Array;
|
52
packages/crypto/types/libsodium.d.ts
vendored
52
packages/crypto/types/libsodium.d.ts
vendored
@ -1,52 +0,0 @@
|
||||
export interface Argon2idOptions {
|
||||
/** Output length in bytes */
|
||||
readonly outputLength: number;
|
||||
/**
|
||||
* An integer between 1 and 4294967295 representing the computational difficulty.
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
|
||||
*/
|
||||
readonly opsLimit: number;
|
||||
/**
|
||||
* Memory limit measured in KiB (like argon2 command line tool)
|
||||
*
|
||||
* Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
|
||||
*/
|
||||
readonly memLimitKib: number;
|
||||
}
|
||||
export declare function isArgon2idOptions(thing: unknown): thing is Argon2idOptions;
|
||||
export declare class Argon2id {
|
||||
static execute(password: string, salt: Uint8Array, options: Argon2idOptions): Promise<Uint8Array>;
|
||||
}
|
||||
export declare class Ed25519Keypair {
|
||||
static fromLibsodiumPrivkey(libsodiumPrivkey: Uint8Array): Ed25519Keypair;
|
||||
readonly privkey: Uint8Array;
|
||||
readonly pubkey: Uint8Array;
|
||||
constructor(privkey: Uint8Array, pubkey: Uint8Array);
|
||||
toLibsodiumPrivkey(): Uint8Array;
|
||||
}
|
||||
export declare class Ed25519 {
|
||||
/**
|
||||
* Generates a keypair deterministically from a given 32 bytes seed.
|
||||
*
|
||||
* This seed equals the Ed25519 private key.
|
||||
* For implementation details see crypto_sign_seed_keypair in
|
||||
* https://download.libsodium.org/doc/public-key_cryptography/public-key_signatures.html
|
||||
* and diagram on https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/
|
||||
*/
|
||||
static makeKeypair(seed: Uint8Array): Promise<Ed25519Keypair>;
|
||||
static createSignature(message: Uint8Array, keyPair: Ed25519Keypair): Promise<Uint8Array>;
|
||||
static verifySignature(signature: Uint8Array, message: Uint8Array, pubkey: Uint8Array): Promise<boolean>;
|
||||
}
|
||||
/**
|
||||
* Nonce length in bytes for all flavours of XChaCha20.
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes
|
||||
*/
|
||||
export declare const xchacha20NonceLength = 24;
|
||||
export declare class Xchacha20poly1305Ietf {
|
||||
static encrypt(message: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise<Uint8Array>;
|
||||
static decrypt(ciphertext: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
6
packages/crypto/types/random.d.ts
vendored
6
packages/crypto/types/random.d.ts
vendored
@ -1,6 +0,0 @@
|
||||
export declare class Random {
|
||||
/**
|
||||
* Returns `count` cryptographically secure random bytes
|
||||
*/
|
||||
static getBytes(count: number): Uint8Array;
|
||||
}
|
10
packages/crypto/types/ripemd.d.ts
vendored
10
packages/crypto/types/ripemd.d.ts
vendored
@ -1,10 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Ripemd160 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Ripemd160;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Ripemd160(data).digest()` */
|
||||
export declare function ripemd160(data: Uint8Array): Uint8Array;
|
17
packages/crypto/types/secp256k1.d.ts
vendored
17
packages/crypto/types/secp256k1.d.ts
vendored
@ -1,17 +0,0 @@
|
||||
import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature";
|
||||
export interface Secp256k1Keypair {
|
||||
readonly pubkey: Uint8Array;
|
||||
readonly privkey: Uint8Array;
|
||||
}
|
||||
export declare class Secp256k1 {
|
||||
static makeKeypair(privkey: Uint8Array): Promise<Secp256k1Keypair>;
|
||||
static createSignature(messageHash: Uint8Array, privkey: Uint8Array): Promise<ExtendedSecp256k1Signature>;
|
||||
static verifySignature(
|
||||
signature: Secp256k1Signature,
|
||||
messageHash: Uint8Array,
|
||||
pubkey: Uint8Array,
|
||||
): Promise<boolean>;
|
||||
static recoverPubkey(signature: ExtendedSecp256k1Signature, messageHash: Uint8Array): Uint8Array;
|
||||
static compressPubkey(pubkey: Uint8Array): Uint8Array;
|
||||
static trimRecoveryByte(signature: Uint8Array): Uint8Array;
|
||||
}
|
35
packages/crypto/types/secp256k1signature.d.ts
vendored
35
packages/crypto/types/secp256k1signature.d.ts
vendored
@ -1,35 +0,0 @@
|
||||
export declare class Secp256k1Signature {
|
||||
/**
|
||||
* Takes the pair of integers (r, s) as 2x32 byte of binary data.
|
||||
*
|
||||
* Note: This is the format Cosmos SDK uses natively.
|
||||
*
|
||||
* @param data a 64 byte value containing integers r and s.
|
||||
*/
|
||||
static fromFixedLength(data: Uint8Array): Secp256k1Signature;
|
||||
static fromDer(data: Uint8Array): Secp256k1Signature;
|
||||
private readonly data;
|
||||
constructor(r: Uint8Array, s: Uint8Array);
|
||||
r(length?: number): Uint8Array;
|
||||
s(length?: number): Uint8Array;
|
||||
toFixedLength(): Uint8Array;
|
||||
toDer(): Uint8Array;
|
||||
}
|
||||
/**
|
||||
* A Secp256k1Signature plus the recovery parameter
|
||||
*/
|
||||
export declare class ExtendedSecp256k1Signature extends Secp256k1Signature {
|
||||
/**
|
||||
* Decode extended signature from the simple fixed length encoding
|
||||
* described in toFixedLength().
|
||||
*/
|
||||
static fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature;
|
||||
readonly recovery: number;
|
||||
constructor(r: Uint8Array, s: Uint8Array, recovery: number);
|
||||
/**
|
||||
* A simple custom encoding that encodes the extended signature as
|
||||
* r (32 bytes) | s (32 bytes) | recovery param (1 byte)
|
||||
* where | denotes concatenation of bonary data.
|
||||
*/
|
||||
toFixedLength(): Uint8Array;
|
||||
}
|
28
packages/crypto/types/sha.d.ts
vendored
28
packages/crypto/types/sha.d.ts
vendored
@ -1,28 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Sha1 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Sha1;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Sha1(data).digest()` */
|
||||
export declare function sha1(data: Uint8Array): Uint8Array;
|
||||
export declare class Sha256 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Sha256;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Sha256(data).digest()` */
|
||||
export declare function sha256(data: Uint8Array): Uint8Array;
|
||||
export declare class Sha512 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Sha512;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Sha512(data).digest()` */
|
||||
export declare function sha512(data: Uint8Array): Uint8Array;
|
67
packages/crypto/types/slip10.d.ts
vendored
67
packages/crypto/types/slip10.d.ts
vendored
@ -1,67 +0,0 @@
|
||||
import { Uint32 } from "@cosmjs/math";
|
||||
export interface Slip10Result {
|
||||
readonly chainCode: Uint8Array;
|
||||
readonly privkey: Uint8Array;
|
||||
}
|
||||
/**
|
||||
* Raw values must match the curve string in SLIP-0010 master key generation
|
||||
*
|
||||
* @see https://github.com/satoshilabs/slips/blob/master/slip-0010.md#master-key-generation
|
||||
*/
|
||||
export declare enum Slip10Curve {
|
||||
Secp256k1 = "Bitcoin seed",
|
||||
Ed25519 = "ed25519 seed",
|
||||
}
|
||||
/**
|
||||
* Reverse mapping of Slip10Curve
|
||||
*/
|
||||
export declare function slip10CurveFromString(curveString: string): Slip10Curve;
|
||||
export declare class Slip10RawIndex extends Uint32 {
|
||||
static hardened(hardenedIndex: number): Slip10RawIndex;
|
||||
static normal(normalIndex: number): Slip10RawIndex;
|
||||
isHardened(): boolean;
|
||||
}
|
||||
/**
|
||||
* An array of raw SLIP10 indices.
|
||||
*
|
||||
* This can be constructed via string parsing:
|
||||
*
|
||||
* ```ts
|
||||
* import { stringToPath } from "@cosmjs/crypto";
|
||||
*
|
||||
* const path = stringToPath("m/0'/1/2'/2/1000000000");
|
||||
* ```
|
||||
*
|
||||
* or manually:
|
||||
*
|
||||
* ```ts
|
||||
* import { HdPath, Slip10RawIndex } from "@cosmjs/crypto";
|
||||
*
|
||||
* // m/0'/1/2'/2/1000000000
|
||||
* const path: HdPath = [
|
||||
* Slip10RawIndex.hardened(0),
|
||||
* Slip10RawIndex.normal(1),
|
||||
* Slip10RawIndex.hardened(2),
|
||||
* Slip10RawIndex.normal(2),
|
||||
* Slip10RawIndex.normal(1000000000),
|
||||
* ];
|
||||
* ```
|
||||
*/
|
||||
export declare type HdPath = readonly Slip10RawIndex[];
|
||||
export declare class Slip10 {
|
||||
static derivePath(curve: Slip10Curve, seed: Uint8Array, path: HdPath): Slip10Result;
|
||||
private static master;
|
||||
private static child;
|
||||
/**
|
||||
* Implementation of ser_P(point(k_par)) from BIP-0032
|
||||
*
|
||||
* @see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
|
||||
*/
|
||||
private static serializedPoint;
|
||||
private static childImpl;
|
||||
private static isZero;
|
||||
private static isGteN;
|
||||
private static n;
|
||||
}
|
||||
export declare function pathToString(path: HdPath): string;
|
||||
export declare function stringToPath(input: string): HdPath;
|
2
packages/encoding/types/ascii.d.ts
vendored
2
packages/encoding/types/ascii.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export declare function toAscii(input: string): Uint8Array;
|
||||
export declare function fromAscii(data: Uint8Array): string;
|
2
packages/encoding/types/base64.d.ts
vendored
2
packages/encoding/types/base64.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export declare function toBase64(data: Uint8Array): string;
|
||||
export declare function fromBase64(base64String: string): Uint8Array;
|
10
packages/encoding/types/bech32.d.ts
vendored
10
packages/encoding/types/bech32.d.ts
vendored
@ -1,10 +0,0 @@
|
||||
export declare class Bech32 {
|
||||
static encode(prefix: string, data: Uint8Array, limit?: number): string;
|
||||
static decode(
|
||||
address: string,
|
||||
limit?: number,
|
||||
): {
|
||||
readonly prefix: string;
|
||||
readonly data: Uint8Array;
|
||||
};
|
||||
}
|
2
packages/encoding/types/hex.d.ts
vendored
2
packages/encoding/types/hex.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export declare function toHex(data: Uint8Array): string;
|
||||
export declare function fromHex(hexstring: string): Uint8Array;
|
6
packages/encoding/types/index.d.ts
vendored
6
packages/encoding/types/index.d.ts
vendored
@ -1,6 +0,0 @@
|
||||
export { fromAscii, toAscii } from "./ascii";
|
||||
export { fromBase64, toBase64 } from "./base64";
|
||||
export { Bech32 } from "./bech32";
|
||||
export { fromHex, toHex } from "./hex";
|
||||
export { fromRfc3339, toRfc3339 } from "./rfc3339";
|
||||
export { fromUtf8, toUtf8 } from "./utf8";
|
3
packages/encoding/types/rfc3339.d.ts
vendored
3
packages/encoding/types/rfc3339.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
import { ReadonlyDate } from "readonly-date";
|
||||
export declare function fromRfc3339(str: string): ReadonlyDate;
|
||||
export declare function toRfc3339(date: Date | ReadonlyDate): string;
|
2
packages/encoding/types/utf8.d.ts
vendored
2
packages/encoding/types/utf8.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export declare function toUtf8(str: string): Uint8Array;
|
||||
export declare function fromUtf8(data: Uint8Array): string;
|
@ -1,5 +0,0 @@
|
||||
export declare class FaucetClient {
|
||||
private readonly baseUrl;
|
||||
constructor(baseUrl: string);
|
||||
credit(address: string, denom: string): Promise<void>;
|
||||
}
|
1
packages/faucet-client/types/index.d.ts
vendored
1
packages/faucet-client/types/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export { FaucetClient } from "./faucetclient";
|
23
packages/json-rpc/types/compatibility.d.ts
vendored
23
packages/json-rpc/types/compatibility.d.ts
vendored
@ -1,23 +0,0 @@
|
||||
/**
|
||||
* A single JSON value. This is the missing return type of JSON.parse().
|
||||
*/
|
||||
export declare type JsonCompatibleValue =
|
||||
| JsonCompatibleDictionary
|
||||
| JsonCompatibleArray
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| null;
|
||||
/**
|
||||
* An array of JsonCompatibleValue
|
||||
*/
|
||||
export interface JsonCompatibleArray extends ReadonlyArray<JsonCompatibleValue> {}
|
||||
/**
|
||||
* A string to json value dictionary.
|
||||
*/
|
||||
export interface JsonCompatibleDictionary {
|
||||
readonly [key: string]: JsonCompatibleValue | readonly JsonCompatibleValue[];
|
||||
}
|
||||
export declare function isJsonCompatibleValue(value: unknown): value is JsonCompatibleValue;
|
||||
export declare function isJsonCompatibleArray(value: unknown): value is JsonCompatibleArray;
|
||||
export declare function isJsonCompatibleDictionary(data: unknown): data is JsonCompatibleDictionary;
|
8
packages/json-rpc/types/id.d.ts
vendored
8
packages/json-rpc/types/id.d.ts
vendored
@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Creates a new ID to be used for creating a JSON-RPC request.
|
||||
*
|
||||
* Multiple calls of this produce unique values.
|
||||
*
|
||||
* The output may be any value compatible to JSON-RPC request IDs with an undefined output format and generation logic.
|
||||
*/
|
||||
export declare function makeJsonRpcId(): number;
|
20
packages/json-rpc/types/index.d.ts
vendored
20
packages/json-rpc/types/index.d.ts
vendored
@ -1,20 +0,0 @@
|
||||
export { makeJsonRpcId } from "./id";
|
||||
export { JsonRpcClient, SimpleMessagingConnection } from "./jsonrpcclient";
|
||||
export {
|
||||
parseJsonRpcId,
|
||||
parseJsonRpcRequest,
|
||||
parseJsonRpcResponse,
|
||||
parseJsonRpcErrorResponse,
|
||||
parseJsonRpcSuccessResponse,
|
||||
} from "./parse";
|
||||
export {
|
||||
isJsonRpcErrorResponse,
|
||||
isJsonRpcSuccessResponse,
|
||||
JsonRpcError,
|
||||
JsonRpcErrorResponse,
|
||||
JsonRpcId,
|
||||
JsonRpcRequest,
|
||||
JsonRpcResponse,
|
||||
JsonRpcSuccessResponse,
|
||||
jsonRpcCode,
|
||||
} from "./types";
|
17
packages/json-rpc/types/jsonrpcclient.d.ts
vendored
17
packages/json-rpc/types/jsonrpcclient.d.ts
vendored
@ -1,17 +0,0 @@
|
||||
import { Stream } from "xstream";
|
||||
import { JsonRpcRequest, JsonRpcResponse, JsonRpcSuccessResponse } from "./types";
|
||||
export interface SimpleMessagingConnection<Request, Response> {
|
||||
readonly responseStream: Stream<Response>;
|
||||
readonly sendRequest: (request: Request) => void;
|
||||
}
|
||||
/**
|
||||
* A thin wrapper that is used to bring together requests and responses by ID.
|
||||
*
|
||||
* Using this class is only advised for continous communication channels like
|
||||
* WebSockets or WebWorker messaging.
|
||||
*/
|
||||
export declare class JsonRpcClient {
|
||||
private readonly connection;
|
||||
constructor(connection: SimpleMessagingConnection<JsonRpcRequest, JsonRpcResponse>);
|
||||
run(request: JsonRpcRequest): Promise<JsonRpcSuccessResponse>;
|
||||
}
|
23
packages/json-rpc/types/parse.d.ts
vendored
23
packages/json-rpc/types/parse.d.ts
vendored
@ -1,23 +0,0 @@
|
||||
import {
|
||||
JsonRpcErrorResponse,
|
||||
JsonRpcId,
|
||||
JsonRpcRequest,
|
||||
JsonRpcResponse,
|
||||
JsonRpcSuccessResponse,
|
||||
} from "./types";
|
||||
/**
|
||||
* Extracts ID field from request or response object.
|
||||
*
|
||||
* Returns `null` when no valid ID was found.
|
||||
*/
|
||||
export declare function parseJsonRpcId(data: unknown): JsonRpcId | null;
|
||||
export declare function parseJsonRpcRequest(data: unknown): JsonRpcRequest;
|
||||
/** Throws if data is not a JsonRpcErrorResponse */
|
||||
export declare function parseJsonRpcErrorResponse(data: unknown): JsonRpcErrorResponse;
|
||||
/** Throws if data is not a JsonRpcSuccessResponse */
|
||||
export declare function parseJsonRpcSuccessResponse(data: unknown): JsonRpcSuccessResponse;
|
||||
/**
|
||||
* Returns a JsonRpcErrorResponse if input can be parsed as a JSON-RPC error. Otherwise parses
|
||||
* input as JsonRpcSuccessResponse. Throws if input is neither a valid error nor success response.
|
||||
*/
|
||||
export declare function parseJsonRpcResponse(data: unknown): JsonRpcResponse;
|
46
packages/json-rpc/types/types.d.ts
vendored
46
packages/json-rpc/types/types.d.ts
vendored
@ -1,46 +0,0 @@
|
||||
import { JsonCompatibleArray, JsonCompatibleDictionary, JsonCompatibleValue } from "./compatibility";
|
||||
export declare type JsonRpcId = number | string;
|
||||
export interface JsonRpcRequest {
|
||||
readonly jsonrpc: "2.0";
|
||||
readonly id: JsonRpcId;
|
||||
readonly method: string;
|
||||
readonly params: JsonCompatibleArray | JsonCompatibleDictionary;
|
||||
}
|
||||
export interface JsonRpcSuccessResponse {
|
||||
readonly jsonrpc: "2.0";
|
||||
readonly id: JsonRpcId;
|
||||
readonly result: any;
|
||||
}
|
||||
export interface JsonRpcError {
|
||||
readonly code: number;
|
||||
readonly message: string;
|
||||
readonly data?: JsonCompatibleValue;
|
||||
}
|
||||
/**
|
||||
* And error object as described in https://www.jsonrpc.org/specification#error_object
|
||||
*/
|
||||
export interface JsonRpcErrorResponse {
|
||||
readonly jsonrpc: "2.0";
|
||||
readonly id: JsonRpcId | null;
|
||||
readonly error: JsonRpcError;
|
||||
}
|
||||
export declare type JsonRpcResponse = JsonRpcSuccessResponse | JsonRpcErrorResponse;
|
||||
export declare function isJsonRpcErrorResponse(response: JsonRpcResponse): response is JsonRpcErrorResponse;
|
||||
export declare function isJsonRpcSuccessResponse(
|
||||
response: JsonRpcResponse,
|
||||
): response is JsonRpcSuccessResponse;
|
||||
/**
|
||||
* Error codes as specified in JSON-RPC 2.0
|
||||
*
|
||||
* @see https://www.jsonrpc.org/specification#error_object
|
||||
*/
|
||||
export declare const jsonRpcCode: {
|
||||
parseError: number;
|
||||
invalidRequest: number;
|
||||
methodNotFound: number;
|
||||
invalidParams: number;
|
||||
internalError: number;
|
||||
serverError: {
|
||||
default: number;
|
||||
};
|
||||
};
|
@ -1,2 +0,0 @@
|
||||
/// <reference lib="webworker" />
|
||||
export {};
|
3
packages/launchpad/types/address.d.ts
vendored
3
packages/launchpad/types/address.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
import { PubKey } from "./types";
|
||||
export declare function rawSecp256k1PubkeyToAddress(pubkeyRaw: Uint8Array, prefix: string): string;
|
||||
export declare function pubkeyToAddress(pubkey: PubKey, prefix: string): string;
|
12
packages/launchpad/types/coins.d.ts
vendored
12
packages/launchpad/types/coins.d.ts
vendored
@ -1,12 +0,0 @@
|
||||
export interface Coin {
|
||||
readonly denom: string;
|
||||
readonly amount: string;
|
||||
}
|
||||
/** Creates a coin */
|
||||
export declare function coin(amount: number, denom: string): Coin;
|
||||
/** Creates a list of coins with one element */
|
||||
export declare function coins(amount: number, denom: string): Coin[];
|
||||
/**
|
||||
* Takes a coins list like "819966000ucosm,700000000ustake" and parses it
|
||||
*/
|
||||
export declare function parseCoins(input: string): Coin[];
|
143
packages/launchpad/types/cosmosclient.d.ts
vendored
143
packages/launchpad/types/cosmosclient.d.ts
vendored
@ -1,143 +0,0 @@
|
||||
import { Coin } from "./coins";
|
||||
import { AuthExtension, BroadcastMode, LcdClient } from "./lcdapi";
|
||||
import { Log } from "./logs";
|
||||
import { StdTx, WrappedStdTx } from "./tx";
|
||||
import { PubKey } from "./types";
|
||||
export interface GetSequenceResult {
|
||||
readonly accountNumber: number;
|
||||
readonly sequence: number;
|
||||
}
|
||||
export interface Account {
|
||||
/** Bech32 account address */
|
||||
readonly address: string;
|
||||
readonly balance: readonly Coin[];
|
||||
readonly pubkey: PubKey | undefined;
|
||||
readonly accountNumber: number;
|
||||
readonly sequence: number;
|
||||
}
|
||||
export interface BroadcastTxFailure {
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly transactionHash: string;
|
||||
readonly height: number;
|
||||
readonly code: number;
|
||||
readonly rawLog: string;
|
||||
}
|
||||
export interface BroadcastTxSuccess {
|
||||
readonly logs: readonly Log[];
|
||||
readonly rawLog: string;
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly transactionHash: string;
|
||||
readonly data?: Uint8Array;
|
||||
}
|
||||
export declare type BroadcastTxResult = BroadcastTxSuccess | BroadcastTxFailure;
|
||||
export declare function isBroadcastTxFailure(result: BroadcastTxResult): result is BroadcastTxFailure;
|
||||
export declare function isBroadcastTxSuccess(result: BroadcastTxResult): result is BroadcastTxSuccess;
|
||||
/**
|
||||
* Ensures the given result is a success. Throws a detailed error message otherwise.
|
||||
*/
|
||||
export declare function assertIsBroadcastTxSuccess(
|
||||
result: BroadcastTxResult,
|
||||
): asserts result is BroadcastTxSuccess;
|
||||
export interface SearchByHeightQuery {
|
||||
readonly height: number;
|
||||
}
|
||||
export interface SearchBySentFromOrToQuery {
|
||||
readonly sentFromOrTo: string;
|
||||
}
|
||||
/**
|
||||
* This query type allows you to pass arbitrary key/value pairs to the backend. It is
|
||||
* more powerful and slightly lower level than the other search options.
|
||||
*/
|
||||
export interface SearchByTagsQuery {
|
||||
readonly tags: ReadonlyArray<{
|
||||
readonly key: string;
|
||||
readonly value: string;
|
||||
}>;
|
||||
}
|
||||
export declare type SearchTxQuery = SearchByHeightQuery | SearchBySentFromOrToQuery | SearchByTagsQuery;
|
||||
export declare function isSearchByHeightQuery(query: SearchTxQuery): query is SearchByHeightQuery;
|
||||
export declare function isSearchBySentFromOrToQuery(query: SearchTxQuery): query is SearchBySentFromOrToQuery;
|
||||
export declare function isSearchByTagsQuery(query: SearchTxQuery): query is SearchByTagsQuery;
|
||||
export interface SearchTxFilter {
|
||||
readonly minHeight?: number;
|
||||
readonly maxHeight?: number;
|
||||
}
|
||||
/** A transaction that is indexed as part of the transaction history */
|
||||
export interface IndexedTx {
|
||||
readonly height: number;
|
||||
/** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
|
||||
readonly hash: string;
|
||||
/** Transaction execution error code. 0 on success. */
|
||||
readonly code: number;
|
||||
readonly rawLog: string;
|
||||
readonly logs: readonly Log[];
|
||||
readonly tx: WrappedStdTx;
|
||||
/** The gas limit as set by the user */
|
||||
readonly gasWanted?: number;
|
||||
/** The gas used by the execution */
|
||||
readonly gasUsed?: number;
|
||||
/** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */
|
||||
readonly timestamp: string;
|
||||
}
|
||||
export interface BlockHeader {
|
||||
readonly version: {
|
||||
readonly block: string;
|
||||
readonly app: string;
|
||||
};
|
||||
readonly height: number;
|
||||
readonly chainId: string;
|
||||
/** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */
|
||||
readonly time: string;
|
||||
}
|
||||
export interface Block {
|
||||
/** The ID is a hash of the block header (uppercase hex) */
|
||||
readonly id: string;
|
||||
readonly header: BlockHeader;
|
||||
/** Array of raw transactions */
|
||||
readonly txs: readonly Uint8Array[];
|
||||
}
|
||||
/** Use for testing only */
|
||||
export interface PrivateCosmosClient {
|
||||
readonly lcdClient: LcdClient & AuthExtension;
|
||||
}
|
||||
export declare class CosmosClient {
|
||||
protected readonly lcdClient: LcdClient & AuthExtension;
|
||||
/** Any address the chain considers valid (valid bech32 with proper prefix) */
|
||||
protected anyValidAddress: string | undefined;
|
||||
private chainId;
|
||||
/**
|
||||
* Creates a new client to interact with a CosmWasm blockchain.
|
||||
*
|
||||
* This instance does a lot of caching. In order to benefit from that you should try to use one instance
|
||||
* for the lifetime of your application. When switching backends, a new instance must be created.
|
||||
*
|
||||
* @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API)
|
||||
* @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns
|
||||
*/
|
||||
constructor(apiUrl: string, broadcastMode?: BroadcastMode);
|
||||
getChainId(): Promise<string>;
|
||||
getHeight(): Promise<number>;
|
||||
/**
|
||||
* Returns a 32 byte upper-case hex transaction hash (typically used as the transaction ID)
|
||||
*/
|
||||
getIdentifier(tx: WrappedStdTx): Promise<string>;
|
||||
/**
|
||||
* Returns account number and sequence.
|
||||
*
|
||||
* Throws if the account does not exist on chain.
|
||||
*
|
||||
* @param address returns data for this address. When unset, the client's sender adddress is used.
|
||||
*/
|
||||
getSequence(address: string): Promise<GetSequenceResult>;
|
||||
getAccount(address: string): Promise<Account | undefined>;
|
||||
/**
|
||||
* Gets block header and meta
|
||||
*
|
||||
* @param height The height of the block. If undefined, the latest height is used.
|
||||
*/
|
||||
getBlock(height?: number): Promise<Block>;
|
||||
getTx(id: string): Promise<IndexedTx | null>;
|
||||
searchTx(query: SearchTxQuery, filter?: SearchTxFilter): Promise<readonly IndexedTx[]>;
|
||||
broadcastTx(tx: StdTx): Promise<BroadcastTxResult>;
|
||||
private txsQuery;
|
||||
}
|
26
packages/launchpad/types/encoding.d.ts
vendored
26
packages/launchpad/types/encoding.d.ts
vendored
@ -1,26 +0,0 @@
|
||||
import { Msg } from "./msgs";
|
||||
import { StdFee } from "./types";
|
||||
/** Returns a JSON string with objects sorted by key */
|
||||
export declare function sortedJsonStringify(obj: any): string;
|
||||
/**
|
||||
* The document to be signed
|
||||
*
|
||||
* @see https://docs.cosmos.network/master/modules/auth/03_types.html#stdsigndoc
|
||||
*/
|
||||
export interface StdSignDoc {
|
||||
readonly chain_id: string;
|
||||
readonly account_number: string;
|
||||
readonly sequence: string;
|
||||
readonly fee: StdFee;
|
||||
readonly msgs: readonly Msg[];
|
||||
readonly memo: string;
|
||||
}
|
||||
export declare function makeSignDoc(
|
||||
msgs: readonly Msg[],
|
||||
fee: StdFee,
|
||||
chainId: string,
|
||||
memo: string | undefined,
|
||||
accountNumber: number | string,
|
||||
sequence: number | string,
|
||||
): StdSignDoc;
|
||||
export declare function serializeSignDoc(signDoc: StdSignDoc): Uint8Array;
|
17
packages/launchpad/types/gas.d.ts
vendored
17
packages/launchpad/types/gas.d.ts
vendored
@ -1,17 +0,0 @@
|
||||
import { Decimal } from "@cosmjs/math";
|
||||
import { StdFee } from "./types";
|
||||
export declare type FeeTable = Record<string, StdFee>;
|
||||
export declare class GasPrice {
|
||||
readonly amount: Decimal;
|
||||
readonly denom: string;
|
||||
constructor(amount: Decimal, denom: string);
|
||||
static fromString(gasPrice: string): GasPrice;
|
||||
}
|
||||
export declare type GasLimits<T extends Record<string, StdFee>> = {
|
||||
readonly [key in keyof T]: number;
|
||||
};
|
||||
export declare function buildFeeTable<T extends Record<string, StdFee>>(
|
||||
gasPrice: GasPrice,
|
||||
defaultGasLimits: GasLimits<T>,
|
||||
gasLimits: Partial<GasLimits<T>>,
|
||||
): T;
|
140
packages/launchpad/types/index.d.ts
vendored
140
packages/launchpad/types/index.d.ts
vendored
@ -1,140 +0,0 @@
|
||||
import * as logs from "./logs";
|
||||
export { logs };
|
||||
export { pubkeyToAddress, rawSecp256k1PubkeyToAddress } from "./address";
|
||||
export { Coin, coin, coins, parseCoins } from "./coins";
|
||||
export {
|
||||
Account,
|
||||
assertIsBroadcastTxSuccess,
|
||||
Block,
|
||||
BlockHeader,
|
||||
CosmosClient,
|
||||
GetSequenceResult,
|
||||
IndexedTx,
|
||||
isBroadcastTxFailure,
|
||||
isBroadcastTxSuccess,
|
||||
BroadcastTxFailure,
|
||||
BroadcastTxResult,
|
||||
BroadcastTxSuccess,
|
||||
SearchByHeightQuery,
|
||||
SearchBySentFromOrToQuery,
|
||||
SearchByTagsQuery,
|
||||
SearchTxQuery,
|
||||
SearchTxFilter,
|
||||
isSearchByHeightQuery,
|
||||
isSearchBySentFromOrToQuery,
|
||||
isSearchByTagsQuery,
|
||||
} from "./cosmosclient";
|
||||
export { makeSignDoc, serializeSignDoc, StdSignDoc } from "./encoding";
|
||||
export { buildFeeTable, FeeTable, GasLimits, GasPrice } from "./gas";
|
||||
export {
|
||||
AuthAccountsResponse,
|
||||
AuthExtension,
|
||||
BankBalancesResponse,
|
||||
BankExtension,
|
||||
BaseAccount,
|
||||
BlockResponse,
|
||||
BroadcastMode,
|
||||
DistributionCommunityPoolResponse,
|
||||
DistributionDelegatorRewardResponse,
|
||||
DistributionDelegatorRewardsResponse,
|
||||
DistributionExtension,
|
||||
DistributionParametersResponse,
|
||||
DistributionValidatorOutstandingRewardsResponse,
|
||||
DistributionValidatorResponse,
|
||||
DistributionValidatorRewardsResponse,
|
||||
DistributionWithdrawAddressResponse,
|
||||
EncodeTxResponse,
|
||||
GovExtension,
|
||||
GovParametersResponse,
|
||||
GovProposalsResponse,
|
||||
GovProposalResponse,
|
||||
GovProposerResponse,
|
||||
GovDepositsResponse,
|
||||
GovDepositResponse,
|
||||
GovTallyResponse,
|
||||
GovVotesResponse,
|
||||
GovVoteResponse,
|
||||
LcdApiArray,
|
||||
LcdClient,
|
||||
MintAnnualProvisionsResponse,
|
||||
MintExtension,
|
||||
MintInflationResponse,
|
||||
MintParametersResponse,
|
||||
NodeInfoResponse,
|
||||
normalizeLcdApiArray,
|
||||
normalizePubkey,
|
||||
BroadcastTxsResponse,
|
||||
SearchTxsResponse,
|
||||
setupAuthExtension,
|
||||
setupBankExtension,
|
||||
setupDistributionExtension,
|
||||
setupGovExtension,
|
||||
setupMintExtension,
|
||||
setupSlashingExtension,
|
||||
setupStakingExtension,
|
||||
setupSupplyExtension,
|
||||
SlashingExtension,
|
||||
SlashingParametersResponse,
|
||||
SlashingSigningInfosResponse,
|
||||
StakingExtension,
|
||||
StakingDelegatorDelegationsResponse,
|
||||
StakingDelegatorUnbondingDelegationsResponse,
|
||||
StakingDelegatorTransactionsResponse,
|
||||
StakingDelegatorValidatorsResponse,
|
||||
StakingDelegatorValidatorResponse,
|
||||
StakingDelegationResponse,
|
||||
StakingUnbondingDelegationResponse,
|
||||
StakingRedelegationsResponse,
|
||||
StakingValidatorsResponse,
|
||||
StakingValidatorResponse,
|
||||
StakingValidatorDelegationsResponse,
|
||||
StakingValidatorUnbondingDelegationsResponse,
|
||||
StakingHistoricalInfoResponse,
|
||||
StakingParametersResponse,
|
||||
StakingPoolResponse,
|
||||
SupplyExtension,
|
||||
TxsResponse,
|
||||
uint64ToNumber,
|
||||
uint64ToString,
|
||||
} from "./lcdapi";
|
||||
export {
|
||||
isMsgBeginRedelegate,
|
||||
isMsgCreateValidator,
|
||||
isMsgDelegate,
|
||||
isMsgEditValidator,
|
||||
isMsgFundCommunityPool,
|
||||
isMsgMultiSend,
|
||||
isMsgSend,
|
||||
isMsgSetWithdrawAddress,
|
||||
isMsgUndelegate,
|
||||
isMsgWithdrawDelegatorReward,
|
||||
isMsgWithdrawValidatorCommission,
|
||||
Msg,
|
||||
MsgBeginRedelegate,
|
||||
MsgCreateValidator,
|
||||
MsgDelegate,
|
||||
MsgEditValidator,
|
||||
MsgFundCommunityPool,
|
||||
MsgMultiSend,
|
||||
MsgSend,
|
||||
MsgSetWithdrawAddress,
|
||||
MsgUndelegate,
|
||||
MsgWithdrawDelegatorReward,
|
||||
MsgWithdrawValidatorCommission,
|
||||
} from "./msgs";
|
||||
export {
|
||||
decodeAminoPubkey,
|
||||
decodeBech32Pubkey,
|
||||
encodeAminoPubkey,
|
||||
encodeBech32Pubkey,
|
||||
encodeSecp256k1Pubkey,
|
||||
} from "./pubkey";
|
||||
export { findSequenceForSignedTx } from "./sequence";
|
||||
export { encodeSecp256k1Signature, decodeSignature } from "./signature";
|
||||
export { AccountData, Algo, AminoSignResponse, OfflineSigner } from "./signer";
|
||||
export { CosmosFeeTable, SigningCosmosClient } from "./signingcosmosclient";
|
||||
export { isStdTx, isWrappedStdTx, makeStdTx, CosmosSdkTx, StdTx, WrappedStdTx, WrappedTx } from "./tx";
|
||||
export { pubkeyType, PubKey, StdFee, StdSignature } from "./types";
|
||||
export { makeCosmoshubPath, executeKdf, KdfConfiguration } from "./wallet";
|
||||
export { extractKdfConfiguration, Secp256k1HdWallet } from "./secp256k1hdwallet";
|
||||
export { Secp256k1Wallet } from "./secp256k1wallet";
|
60
packages/launchpad/types/lcdapi/auth.d.ts
vendored
60
packages/launchpad/types/lcdapi/auth.d.ts
vendored
@ -1,60 +0,0 @@
|
||||
import { Coin } from "../coins";
|
||||
import { PubKey } from "../types";
|
||||
import { LcdClient } from "./lcdclient";
|
||||
/**
|
||||
* A Cosmos SDK base account.
|
||||
*
|
||||
* This type describes the base account representation as returned
|
||||
* by the Cosmos SDK 0.37–0.39 LCD API.
|
||||
*
|
||||
* @see https://docs.cosmos.network/master/modules/auth/02_state.html#base-account
|
||||
*/
|
||||
export interface BaseAccount {
|
||||
/** Bech32 account address */
|
||||
readonly address: string;
|
||||
readonly coins: readonly Coin[];
|
||||
/**
|
||||
* The public key of the account. This is not available on-chain as long as the account
|
||||
* did not send a transaction.
|
||||
*
|
||||
* This was a type/value object in Cosmos SDK 0.37, changed to bech32 in Cosmos SDK 0.38 ([1])
|
||||
* and changed back to type/value object in Cosmos SDK 0.39 ([2]).
|
||||
*
|
||||
* [1]: https://github.com/cosmos/cosmos-sdk/pull/5280
|
||||
* [2]: https://github.com/cosmos/cosmos-sdk/pull/6749
|
||||
*/
|
||||
readonly public_key: string | PubKey | null;
|
||||
/**
|
||||
* The account number assigned by the blockchain.
|
||||
*
|
||||
* This was string encoded in Cosmos SDK 0.37, changed to number in Cosmos SDK 0.38 ([1])
|
||||
* and changed back to string in Cosmos SDK 0.39 ([2]).
|
||||
*
|
||||
* [1]: https://github.com/cosmos/cosmos-sdk/pull/5280
|
||||
* [2]: https://github.com/cosmos/cosmos-sdk/pull/6749
|
||||
*/
|
||||
readonly account_number: number | string;
|
||||
/**
|
||||
* The sequence number for replay protection.
|
||||
*
|
||||
* This was string encoded in Cosmos SDK 0.37, changed to number in Cosmos SDK 0.38 ([1])
|
||||
* and changed back to string in Cosmos SDK 0.39 ([2]).
|
||||
*
|
||||
* [1]: https://github.com/cosmos/cosmos-sdk/pull/5280
|
||||
* [2]: https://github.com/cosmos/cosmos-sdk/pull/6749
|
||||
*/
|
||||
readonly sequence: number | string;
|
||||
}
|
||||
export interface AuthAccountsResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly type: "cosmos-sdk/Account";
|
||||
readonly value: BaseAccount;
|
||||
};
|
||||
}
|
||||
export interface AuthExtension {
|
||||
readonly auth: {
|
||||
readonly account: (address: string) => Promise<AuthAccountsResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupAuthExtension(base: LcdClient): AuthExtension;
|
12
packages/launchpad/types/lcdapi/bank.d.ts
vendored
12
packages/launchpad/types/lcdapi/bank.d.ts
vendored
@ -1,12 +0,0 @@
|
||||
import { Coin } from "../coins";
|
||||
import { LcdClient } from "./lcdclient";
|
||||
export interface BankBalancesResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Coin[];
|
||||
}
|
||||
export interface BankExtension {
|
||||
readonly bank: {
|
||||
readonly balances: (address: string) => Promise<BankBalancesResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupBankExtension(base: LcdClient): BankExtension;
|
129
packages/launchpad/types/lcdapi/base.d.ts
vendored
129
packages/launchpad/types/lcdapi/base.d.ts
vendored
@ -1,129 +0,0 @@
|
||||
import { WrappedStdTx } from "../tx";
|
||||
/**
|
||||
* The mode used to send transaction
|
||||
*
|
||||
* @see https://cosmos.network/rpc/#/Transactions/post_txs
|
||||
*/
|
||||
export declare enum BroadcastMode {
|
||||
/** Return after tx commit */
|
||||
Block = "block",
|
||||
/** Return after CheckTx */
|
||||
Sync = "sync",
|
||||
/** Return right away */
|
||||
Async = "async",
|
||||
}
|
||||
/** A response from the /txs/encode endpoint */
|
||||
export interface EncodeTxResponse {
|
||||
/** base64-encoded amino-binary encoded representation */
|
||||
readonly tx: string;
|
||||
}
|
||||
interface NodeInfo {
|
||||
readonly protocol_version: {
|
||||
readonly p2p: string;
|
||||
readonly block: string;
|
||||
readonly app: string;
|
||||
};
|
||||
readonly id: string;
|
||||
readonly listen_addr: string;
|
||||
readonly network: string;
|
||||
readonly version: string;
|
||||
readonly channels: string;
|
||||
readonly moniker: string;
|
||||
readonly other: {
|
||||
readonly tx_index: string;
|
||||
readonly rpc_address: string;
|
||||
};
|
||||
}
|
||||
interface ApplicationVersion {
|
||||
readonly name: string;
|
||||
readonly server_name: string;
|
||||
readonly client_name: string;
|
||||
readonly version: string;
|
||||
readonly commit: string;
|
||||
readonly build_tags: string;
|
||||
readonly go: string;
|
||||
}
|
||||
export interface NodeInfoResponse {
|
||||
readonly node_info: NodeInfo;
|
||||
readonly application_version: ApplicationVersion;
|
||||
}
|
||||
interface BlockId {
|
||||
readonly hash: string;
|
||||
}
|
||||
export interface BlockHeader {
|
||||
readonly version: {
|
||||
readonly block: string;
|
||||
readonly app: string;
|
||||
};
|
||||
readonly height: string;
|
||||
readonly chain_id: string;
|
||||
/** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */
|
||||
readonly time: string;
|
||||
readonly last_commit_hash: string;
|
||||
readonly last_block_id: BlockId;
|
||||
/** Can be empty */
|
||||
readonly data_hash: string;
|
||||
readonly validators_hash: string;
|
||||
readonly next_validators_hash: string;
|
||||
readonly consensus_hash: string;
|
||||
readonly app_hash: string;
|
||||
/** Can be empty */
|
||||
readonly last_results_hash: string;
|
||||
/** Can be empty */
|
||||
readonly evidence_hash: string;
|
||||
readonly proposer_address: string;
|
||||
}
|
||||
interface Block {
|
||||
readonly header: BlockHeader;
|
||||
readonly data: {
|
||||
/** Array of base64 encoded transactions */
|
||||
readonly txs: readonly string[] | null;
|
||||
};
|
||||
}
|
||||
export interface BlockResponse {
|
||||
readonly block_id: BlockId;
|
||||
readonly block: Block;
|
||||
}
|
||||
export interface TxsResponse {
|
||||
readonly height: string;
|
||||
readonly txhash: string;
|
||||
/** 🤷♂️ */
|
||||
readonly codespace?: string;
|
||||
/** Falsy when transaction execution succeeded. Contains error code on error. */
|
||||
readonly code?: number;
|
||||
readonly raw_log: string;
|
||||
readonly logs?: unknown[];
|
||||
readonly tx: WrappedStdTx;
|
||||
/** The gas limit as set by the user */
|
||||
readonly gas_wanted?: string;
|
||||
/** The gas used by the execution */
|
||||
readonly gas_used?: string;
|
||||
readonly timestamp: string;
|
||||
}
|
||||
export interface SearchTxsResponse {
|
||||
readonly total_count: string;
|
||||
readonly count: string;
|
||||
readonly page_number: string;
|
||||
readonly page_total: string;
|
||||
readonly limit: string;
|
||||
readonly txs: readonly TxsResponse[];
|
||||
}
|
||||
export interface BroadcastTxsResponse {
|
||||
readonly height: string;
|
||||
readonly txhash: string;
|
||||
readonly code?: number;
|
||||
/**
|
||||
* The result data of the execution (hex encoded).
|
||||
*
|
||||
* @see https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/types/result.go#L101
|
||||
*/
|
||||
readonly data?: string;
|
||||
readonly raw_log?: string;
|
||||
/** The same as `raw_log` but deserialized? */
|
||||
readonly logs?: unknown[];
|
||||
/** The gas limit as set by the user */
|
||||
readonly gas_wanted?: string;
|
||||
/** The gas used by the execution */
|
||||
readonly gas_used?: string;
|
||||
}
|
||||
export {};
|
@ -1,68 +0,0 @@
|
||||
import { Coin } from "../coins";
|
||||
import { LcdClient } from "./lcdclient";
|
||||
export interface RewardContainer {
|
||||
readonly validator_address: string;
|
||||
readonly reward: readonly Coin[] | null;
|
||||
}
|
||||
export interface DistributionDelegatorRewardsResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly rewards: readonly RewardContainer[] | null;
|
||||
readonly total: readonly Coin[] | null;
|
||||
};
|
||||
}
|
||||
export interface DistributionDelegatorRewardResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Coin[];
|
||||
}
|
||||
export interface DistributionWithdrawAddressResponse {
|
||||
readonly height: string;
|
||||
readonly result: string;
|
||||
}
|
||||
export interface DistributionValidatorResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly operator_address: string;
|
||||
readonly self_bond_rewards: readonly Coin[];
|
||||
readonly val_commission: readonly Coin[];
|
||||
};
|
||||
}
|
||||
export interface DistributionValidatorRewardsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Coin[];
|
||||
}
|
||||
export interface DistributionValidatorOutstandingRewardsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Coin[];
|
||||
}
|
||||
export interface DistributionParametersResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly community_tax: string;
|
||||
readonly base_proposer_reward: string;
|
||||
readonly bonus_proposer_reward: string;
|
||||
readonly withdraw_addr_enabled: boolean;
|
||||
};
|
||||
}
|
||||
export interface DistributionCommunityPoolResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Coin[];
|
||||
}
|
||||
export interface DistributionExtension {
|
||||
readonly distribution: {
|
||||
readonly delegatorRewards: (delegatorAddress: string) => Promise<DistributionDelegatorRewardsResponse>;
|
||||
readonly delegatorReward: (
|
||||
delegatorAddress: string,
|
||||
validatorAddress: string,
|
||||
) => Promise<DistributionDelegatorRewardResponse>;
|
||||
readonly withdrawAddress: (delegatorAddress: string) => Promise<DistributionWithdrawAddressResponse>;
|
||||
readonly validator: (validatorAddress: string) => Promise<DistributionValidatorResponse>;
|
||||
readonly validatorRewards: (validatorAddress: string) => Promise<DistributionValidatorRewardsResponse>;
|
||||
readonly validatorOutstandingRewards: (
|
||||
validatorAddress: string,
|
||||
) => Promise<DistributionValidatorOutstandingRewardsResponse>;
|
||||
readonly parameters: () => Promise<DistributionParametersResponse>;
|
||||
readonly communityPool: () => Promise<DistributionCommunityPoolResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupDistributionExtension(base: LcdClient): DistributionExtension;
|
114
packages/launchpad/types/lcdapi/gov.d.ts
vendored
114
packages/launchpad/types/lcdapi/gov.d.ts
vendored
@ -1,114 +0,0 @@
|
||||
import { Coin } from "../coins";
|
||||
import { LcdClient } from "./lcdclient";
|
||||
export declare enum GovParametersType {
|
||||
Deposit = "deposit",
|
||||
Tallying = "tallying",
|
||||
Voting = "voting",
|
||||
}
|
||||
export interface GovParametersDepositResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly min_deposit: readonly Coin[];
|
||||
readonly max_deposit_period: string;
|
||||
};
|
||||
}
|
||||
export interface GovParametersTallyingResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly quorum: string;
|
||||
readonly threshold: string;
|
||||
readonly veto: string;
|
||||
};
|
||||
}
|
||||
export interface GovParametersVotingResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly voting_period: string;
|
||||
};
|
||||
}
|
||||
export declare type GovParametersResponse =
|
||||
| GovParametersDepositResponse
|
||||
| GovParametersTallyingResponse
|
||||
| GovParametersVotingResponse;
|
||||
export interface Tally {
|
||||
readonly yes: string;
|
||||
readonly abstain: string;
|
||||
readonly no: string;
|
||||
readonly no_with_veto: string;
|
||||
}
|
||||
export interface Proposal {
|
||||
readonly id: string;
|
||||
readonly proposal_status: string;
|
||||
readonly final_tally_result: Tally;
|
||||
readonly submit_time: string;
|
||||
readonly total_deposit: readonly Coin[];
|
||||
readonly deposit_end_time: string;
|
||||
readonly voting_start_time: string;
|
||||
readonly voting_end_time: string;
|
||||
readonly content: {
|
||||
readonly type: string;
|
||||
readonly value: {
|
||||
readonly title: string;
|
||||
readonly description: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
export interface GovProposalsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Proposal[];
|
||||
}
|
||||
export interface GovProposalResponse {
|
||||
readonly height: string;
|
||||
readonly result: Proposal;
|
||||
}
|
||||
export interface GovProposerResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly proposal_id: string;
|
||||
readonly proposer: string;
|
||||
};
|
||||
}
|
||||
export interface Deposit {
|
||||
readonly amount: readonly Coin[];
|
||||
readonly proposal_id: string;
|
||||
readonly depositor: string;
|
||||
}
|
||||
export interface GovDepositsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Deposit[];
|
||||
}
|
||||
export interface GovDepositResponse {
|
||||
readonly height: string;
|
||||
readonly result: Deposit;
|
||||
}
|
||||
export interface GovTallyResponse {
|
||||
readonly height: string;
|
||||
readonly result: Tally;
|
||||
}
|
||||
export interface Vote {
|
||||
readonly voter: string;
|
||||
readonly proposal_id: string;
|
||||
readonly option: string;
|
||||
}
|
||||
export interface GovVotesResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Vote[];
|
||||
}
|
||||
export interface GovVoteResponse {
|
||||
readonly height: string;
|
||||
readonly result: Vote;
|
||||
}
|
||||
export interface GovExtension {
|
||||
readonly gov: {
|
||||
readonly parameters: (parametersType: GovParametersType) => Promise<GovParametersResponse>;
|
||||
readonly proposals: () => Promise<GovProposalsResponse>;
|
||||
readonly proposal: (proposalId: string) => Promise<GovProposalResponse>;
|
||||
readonly proposer: (proposalId: string) => Promise<GovProposerResponse>;
|
||||
readonly deposits: (proposalId: string) => Promise<GovDepositsResponse>;
|
||||
readonly deposit: (proposalId: string, depositorAddress: string) => Promise<GovDepositResponse>;
|
||||
readonly tally: (proposalId: string) => Promise<GovTallyResponse>;
|
||||
readonly votes: (proposalId: string) => Promise<GovVotesResponse>;
|
||||
readonly vote: (proposalId: string, voterAddress: string) => Promise<GovVoteResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupGovExtension(base: LcdClient): GovExtension;
|
71
packages/launchpad/types/lcdapi/index.d.ts
vendored
71
packages/launchpad/types/lcdapi/index.d.ts
vendored
@ -1,71 +0,0 @@
|
||||
export { AuthExtension, AuthAccountsResponse, BaseAccount, setupAuthExtension } from "./auth";
|
||||
export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank";
|
||||
export {
|
||||
DistributionCommunityPoolResponse,
|
||||
DistributionDelegatorRewardResponse,
|
||||
DistributionDelegatorRewardsResponse,
|
||||
DistributionExtension,
|
||||
DistributionParametersResponse,
|
||||
DistributionValidatorOutstandingRewardsResponse,
|
||||
DistributionValidatorResponse,
|
||||
DistributionValidatorRewardsResponse,
|
||||
DistributionWithdrawAddressResponse,
|
||||
setupDistributionExtension,
|
||||
} from "./distribution";
|
||||
export {
|
||||
GovExtension,
|
||||
GovParametersResponse,
|
||||
GovProposalsResponse,
|
||||
GovProposalResponse,
|
||||
GovProposerResponse,
|
||||
GovDepositsResponse,
|
||||
GovDepositResponse,
|
||||
GovTallyResponse,
|
||||
GovVotesResponse,
|
||||
GovVoteResponse,
|
||||
setupGovExtension,
|
||||
} from "./gov";
|
||||
export {
|
||||
MintAnnualProvisionsResponse,
|
||||
MintExtension,
|
||||
MintInflationResponse,
|
||||
MintParametersResponse,
|
||||
setupMintExtension,
|
||||
} from "./mint";
|
||||
export {
|
||||
setupSlashingExtension,
|
||||
SlashingExtension,
|
||||
SlashingParametersResponse,
|
||||
SlashingSigningInfosResponse,
|
||||
} from "./slashing";
|
||||
export {
|
||||
setupStakingExtension,
|
||||
StakingDelegatorDelegationsResponse,
|
||||
StakingDelegatorUnbondingDelegationsResponse,
|
||||
StakingDelegatorTransactionsResponse,
|
||||
StakingDelegatorValidatorsResponse,
|
||||
StakingDelegatorValidatorResponse,
|
||||
StakingDelegationResponse,
|
||||
StakingUnbondingDelegationResponse,
|
||||
StakingRedelegationsResponse,
|
||||
StakingValidatorsResponse,
|
||||
StakingValidatorResponse,
|
||||
StakingValidatorDelegationsResponse,
|
||||
StakingValidatorUnbondingDelegationsResponse,
|
||||
StakingHistoricalInfoResponse,
|
||||
StakingExtension,
|
||||
StakingParametersResponse,
|
||||
StakingPoolResponse,
|
||||
} from "./staking";
|
||||
export { setupSupplyExtension, SupplyExtension, TotalSupplyAllResponse, TotalSupplyResponse } from "./supply";
|
||||
export {
|
||||
BlockResponse,
|
||||
BroadcastMode,
|
||||
EncodeTxResponse,
|
||||
BroadcastTxsResponse,
|
||||
NodeInfoResponse,
|
||||
SearchTxsResponse,
|
||||
TxsResponse,
|
||||
} from "./base";
|
||||
export { LcdApiArray, LcdClient, normalizeLcdApiArray } from "./lcdclient";
|
||||
export { normalizePubkey, uint64ToNumber, uint64ToString } from "./utils";
|
164
packages/launchpad/types/lcdapi/lcdclient.d.ts
vendored
164
packages/launchpad/types/lcdapi/lcdclient.d.ts
vendored
@ -1,164 +0,0 @@
|
||||
import { StdTx, WrappedStdTx } from "../tx";
|
||||
import {
|
||||
BlockResponse,
|
||||
BroadcastMode,
|
||||
BroadcastTxsResponse,
|
||||
EncodeTxResponse,
|
||||
NodeInfoResponse,
|
||||
SearchTxsResponse,
|
||||
TxsResponse,
|
||||
} from "./base";
|
||||
/** Unfortunately, Cosmos SDK encodes empty arrays as null */
|
||||
export declare type LcdApiArray<T> = readonly T[] | null;
|
||||
export declare function normalizeLcdApiArray<T>(backend: LcdApiArray<T>): readonly T[];
|
||||
declare type LcdExtensionSetup<P> = (base: LcdClient) => P;
|
||||
export interface LcdClientBaseOptions {
|
||||
readonly apiUrl: string;
|
||||
readonly broadcastMode?: BroadcastMode;
|
||||
}
|
||||
/**
|
||||
* A client to the LCD's (light client daemon) API.
|
||||
* This light client connects to Tendermint (i.e. the chain), encodes/decodes Amino data for us and provides a convenient JSON interface.
|
||||
*
|
||||
* This _JSON over HTTP_ API is sometimes referred to as "REST" or "RPC", which are both misleading terms
|
||||
* for the same thing.
|
||||
*
|
||||
* Please note that the client to the LCD can not verify light client proofs. When using this,
|
||||
* you need to trust the API provider as well as the network connection between client and API.
|
||||
*
|
||||
* @see https://cosmos.network/rpc
|
||||
*/
|
||||
export declare class LcdClient {
|
||||
/** Constructs an LCD client with 0 extensions */
|
||||
static withExtensions(options: LcdClientBaseOptions): LcdClient;
|
||||
/** Constructs an LCD client with 1 extension */
|
||||
static withExtensions<A extends object>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
): LcdClient & A;
|
||||
/** Constructs an LCD client with 2 extensions */
|
||||
static withExtensions<A extends object, B extends object>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
setupExtensionB: LcdExtensionSetup<B>,
|
||||
): LcdClient & A & B;
|
||||
/** Constructs an LCD client with 3 extensions */
|
||||
static withExtensions<A extends object, B extends object, C extends object>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
setupExtensionB: LcdExtensionSetup<B>,
|
||||
setupExtensionC: LcdExtensionSetup<C>,
|
||||
): LcdClient & A & B & C;
|
||||
/** Constructs an LCD client with 4 extensions */
|
||||
static withExtensions<A extends object, B extends object, C extends object, D extends object>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
setupExtensionB: LcdExtensionSetup<B>,
|
||||
setupExtensionC: LcdExtensionSetup<C>,
|
||||
setupExtensionD: LcdExtensionSetup<D>,
|
||||
): LcdClient & A & B & C & D;
|
||||
/** Constructs an LCD client with 5 extensions */
|
||||
static withExtensions<
|
||||
A extends object,
|
||||
B extends object,
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
setupExtensionB: LcdExtensionSetup<B>,
|
||||
setupExtensionC: LcdExtensionSetup<C>,
|
||||
setupExtensionD: LcdExtensionSetup<D>,
|
||||
setupExtensionE: LcdExtensionSetup<E>,
|
||||
): LcdClient & A & B & C & D & E;
|
||||
/** Constructs an LCD client with 6 extensions */
|
||||
static withExtensions<
|
||||
A extends object,
|
||||
B extends object,
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object,
|
||||
F extends object
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
setupExtensionB: LcdExtensionSetup<B>,
|
||||
setupExtensionC: LcdExtensionSetup<C>,
|
||||
setupExtensionD: LcdExtensionSetup<D>,
|
||||
setupExtensionE: LcdExtensionSetup<E>,
|
||||
setupExtensionF: LcdExtensionSetup<F>,
|
||||
): LcdClient & A & B & C & D & E & F;
|
||||
/** Constructs an LCD client with 7 extensions */
|
||||
static withExtensions<
|
||||
A extends object,
|
||||
B extends object,
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object,
|
||||
F extends object,
|
||||
G extends object
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
setupExtensionB: LcdExtensionSetup<B>,
|
||||
setupExtensionC: LcdExtensionSetup<C>,
|
||||
setupExtensionD: LcdExtensionSetup<D>,
|
||||
setupExtensionE: LcdExtensionSetup<E>,
|
||||
setupExtensionF: LcdExtensionSetup<F>,
|
||||
setupExtensionG: LcdExtensionSetup<G>,
|
||||
): LcdClient & A & B & C & D & E & F & G;
|
||||
/** Constructs an LCD client with 8 extensions */
|
||||
static withExtensions<
|
||||
A extends object,
|
||||
B extends object,
|
||||
C extends object,
|
||||
D extends object,
|
||||
E extends object,
|
||||
F extends object,
|
||||
G extends object,
|
||||
H extends object
|
||||
>(
|
||||
options: LcdClientBaseOptions,
|
||||
setupExtensionA: LcdExtensionSetup<A>,
|
||||
setupExtensionB: LcdExtensionSetup<B>,
|
||||
setupExtensionC: LcdExtensionSetup<C>,
|
||||
setupExtensionD: LcdExtensionSetup<D>,
|
||||
setupExtensionE: LcdExtensionSetup<E>,
|
||||
setupExtensionF: LcdExtensionSetup<F>,
|
||||
setupExtensionG: LcdExtensionSetup<G>,
|
||||
setupExtensionH: LcdExtensionSetup<H>,
|
||||
): LcdClient & A & B & C & D & E & F & G & H;
|
||||
private readonly client;
|
||||
private readonly broadcastMode;
|
||||
/**
|
||||
* Creates a new client to interact with a Cosmos SDK light client daemon.
|
||||
* This class tries to be a direct mapping onto the API. Some basic decoding and normalizatin is done
|
||||
* but things like caching are done at a higher level.
|
||||
*
|
||||
* When building apps, you should not need to use this class directly. If you do, this indicates a missing feature
|
||||
* in higher level components. Feel free to raise an issue in this case.
|
||||
*
|
||||
* @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API)
|
||||
* @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns
|
||||
*/
|
||||
constructor(apiUrl: string, broadcastMode?: BroadcastMode);
|
||||
get(path: string, params?: Record<string, any>): Promise<any>;
|
||||
post(path: string, params: any): Promise<any>;
|
||||
blocksLatest(): Promise<BlockResponse>;
|
||||
blocks(height: number): Promise<BlockResponse>;
|
||||
nodeInfo(): Promise<NodeInfoResponse>;
|
||||
txById(id: string): Promise<TxsResponse>;
|
||||
txsQuery(query: string): Promise<SearchTxsResponse>;
|
||||
/** returns the amino-encoding of the transaction performed by the server */
|
||||
encodeTx(tx: WrappedStdTx): Promise<EncodeTxResponse>;
|
||||
/**
|
||||
* Broadcasts a signed transaction to the transaction pool.
|
||||
* Depending on the client's broadcast mode, this might or might
|
||||
* wait for checkTx or deliverTx to be executed before returning.
|
||||
*
|
||||
* @param tx a signed transaction as StdTx (i.e. not wrapped in type/value container)
|
||||
*/
|
||||
broadcastTx(tx: StdTx): Promise<BroadcastTxsResponse>;
|
||||
}
|
||||
export {};
|
28
packages/launchpad/types/lcdapi/mint.d.ts
vendored
28
packages/launchpad/types/lcdapi/mint.d.ts
vendored
@ -1,28 +0,0 @@
|
||||
import { LcdClient } from "./lcdclient";
|
||||
export interface MintParametersResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly mint_denom: string;
|
||||
readonly inflation_rate_change: string;
|
||||
readonly inflation_max: string;
|
||||
readonly inflation_min: string;
|
||||
readonly goal_bonded: string;
|
||||
readonly blocks_per_year: string;
|
||||
};
|
||||
}
|
||||
export interface MintInflationResponse {
|
||||
readonly height: string;
|
||||
readonly result: string;
|
||||
}
|
||||
export interface MintAnnualProvisionsResponse {
|
||||
readonly height: string;
|
||||
readonly result: string;
|
||||
}
|
||||
export interface MintExtension {
|
||||
readonly mint: {
|
||||
readonly parameters: () => Promise<MintParametersResponse>;
|
||||
readonly inflation: () => Promise<MintInflationResponse>;
|
||||
readonly annualProvisions: () => Promise<MintAnnualProvisionsResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupMintExtension(base: LcdClient): MintExtension;
|
31
packages/launchpad/types/lcdapi/slashing.d.ts
vendored
31
packages/launchpad/types/lcdapi/slashing.d.ts
vendored
@ -1,31 +0,0 @@
|
||||
import { LcdClient } from "./lcdclient";
|
||||
interface SlashingSigningInfo {
|
||||
readonly address: string;
|
||||
readonly start_height: string;
|
||||
readonly index_offset: string;
|
||||
readonly jailed_until: string;
|
||||
readonly tombstoned: boolean;
|
||||
readonly missed_blocks_counter: string;
|
||||
}
|
||||
export interface SlashingSigningInfosResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly SlashingSigningInfo[];
|
||||
}
|
||||
export interface SlashingParametersResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly signed_blocks_window: string;
|
||||
readonly min_signed_per_window: string;
|
||||
readonly downtime_jail_duration: string;
|
||||
readonly slash_fraction_double_sign: string;
|
||||
readonly slash_fraction_downtime: string;
|
||||
};
|
||||
}
|
||||
export interface SlashingExtension {
|
||||
readonly slashing: {
|
||||
readonly signingInfos: () => Promise<SlashingSigningInfosResponse>;
|
||||
readonly parameters: () => Promise<SlashingParametersResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupSlashingExtension(base: LcdClient): SlashingExtension;
|
||||
export {};
|
194
packages/launchpad/types/lcdapi/staking.d.ts
vendored
194
packages/launchpad/types/lcdapi/staking.d.ts
vendored
@ -1,194 +0,0 @@
|
||||
import { Coin } from "../coins";
|
||||
import { BlockHeader, SearchTxsResponse } from "./base";
|
||||
import { LcdClient } from "./lcdclient";
|
||||
/**
|
||||
* Numeric bonding status
|
||||
*
|
||||
* @see https://github.com/cosmos/cosmos-sdk/blob/v0.38.5/types/staking.go#L43-L49
|
||||
*/
|
||||
export declare enum BondStatus {
|
||||
Unbonded = 0,
|
||||
Unbonding = 1,
|
||||
Bonded = 2,
|
||||
}
|
||||
interface Validator {
|
||||
readonly operator_address: string;
|
||||
readonly consensus_pubkey: string;
|
||||
readonly jailed: boolean;
|
||||
readonly status: BondStatus;
|
||||
readonly tokens: string;
|
||||
readonly delegator_shares: string;
|
||||
readonly description: {
|
||||
readonly moniker: string;
|
||||
readonly identity: string;
|
||||
readonly website: string;
|
||||
readonly security_contact: string;
|
||||
readonly details: string;
|
||||
};
|
||||
readonly unbonding_height: string;
|
||||
readonly unbonding_time: string;
|
||||
readonly commission: {
|
||||
readonly commission_rates: {
|
||||
readonly rate: string;
|
||||
readonly max_rate: string;
|
||||
readonly max_change_rate: string;
|
||||
};
|
||||
readonly update_time: string;
|
||||
};
|
||||
readonly min_self_delegation: string;
|
||||
}
|
||||
interface Delegation {
|
||||
readonly delegator_address: string;
|
||||
readonly validator_address: string;
|
||||
readonly shares: string;
|
||||
readonly balance: Coin;
|
||||
}
|
||||
export interface StakingDelegatorDelegationsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Delegation[];
|
||||
}
|
||||
interface UnbondingDelegationEntry {
|
||||
readonly creation_height: string;
|
||||
readonly completion_time: string;
|
||||
readonly initial_balance: string;
|
||||
readonly balance: string;
|
||||
}
|
||||
interface UnbondingDelegation {
|
||||
readonly delegator_address: string;
|
||||
readonly validator_address: string;
|
||||
readonly entries: readonly UnbondingDelegationEntry[];
|
||||
}
|
||||
export interface StakingDelegatorUnbondingDelegationsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly UnbondingDelegation[];
|
||||
}
|
||||
export declare type StakingDelegatorTransactionsResponse = readonly SearchTxsResponse[];
|
||||
export interface StakingDelegatorValidatorsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Validator[];
|
||||
}
|
||||
export interface StakingDelegatorValidatorResponse {
|
||||
readonly height: string;
|
||||
readonly result: Validator;
|
||||
}
|
||||
export interface StakingDelegationResponse {
|
||||
readonly height: string;
|
||||
readonly result: Delegation;
|
||||
}
|
||||
export interface StakingUnbondingDelegationResponse {
|
||||
readonly height: string;
|
||||
readonly result: UnbondingDelegation | null;
|
||||
}
|
||||
interface RedelegationEntry {
|
||||
readonly creation_height: string;
|
||||
readonly completion_time: string;
|
||||
readonly initial_balance: Coin;
|
||||
readonly shares_dst: string;
|
||||
}
|
||||
interface Redelegation {
|
||||
readonly delegator_address: string;
|
||||
readonly validator_src_address: string;
|
||||
readonly validator_dst_address: string;
|
||||
readonly entries: readonly RedelegationEntry[];
|
||||
}
|
||||
export interface StakingRedelegationsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Redelegation[];
|
||||
}
|
||||
export interface StakingValidatorsParams {
|
||||
/** @see https://github.com/cosmos/cosmos-sdk/blob/v0.38.5/types/staking.go#L43-L49 */
|
||||
readonly status?: "bonded" | "unbonded" | "unbonding";
|
||||
readonly page?: number;
|
||||
readonly limit?: number;
|
||||
}
|
||||
export interface StakingValidatorsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Validator[];
|
||||
}
|
||||
export interface StakingValidatorResponse {
|
||||
readonly height: string;
|
||||
readonly result: Validator;
|
||||
}
|
||||
export interface StakingValidatorDelegationsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly Delegation[];
|
||||
}
|
||||
export interface StakingValidatorUnbondingDelegationsResponse {
|
||||
readonly height: string;
|
||||
readonly result: readonly UnbondingDelegation[];
|
||||
}
|
||||
interface HistoricalInfo {
|
||||
readonly header: BlockHeader;
|
||||
readonly validators: readonly Validator[];
|
||||
}
|
||||
export interface StakingHistoricalInfoResponse {
|
||||
readonly height: string;
|
||||
readonly result: HistoricalInfo;
|
||||
}
|
||||
export interface StakingPoolResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly not_bonded_tokens: string;
|
||||
readonly bonded_tokens: string;
|
||||
};
|
||||
}
|
||||
export interface StakingParametersResponse {
|
||||
readonly height: string;
|
||||
readonly result: {
|
||||
readonly unbonding_time: string;
|
||||
readonly max_validators: number;
|
||||
readonly max_entries: number;
|
||||
readonly historical_entries: number;
|
||||
readonly bond_denom: string;
|
||||
};
|
||||
}
|
||||
export interface StakingExtension {
|
||||
readonly staking: {
|
||||
/** Get all delegations from a delegator */
|
||||
readonly delegatorDelegations: (delegatorAddress: string) => Promise<StakingDelegatorDelegationsResponse>;
|
||||
/** Get all unbonding delegations from a delegator */
|
||||
readonly delegatorUnbondingDelegations: (
|
||||
delegatorAddress: string,
|
||||
) => Promise<StakingDelegatorUnbondingDelegationsResponse>;
|
||||
/** Get all staking txs (i.e msgs) from a delegator */
|
||||
readonly delegatorTransactions: (
|
||||
delegatorAddress: string,
|
||||
) => Promise<StakingDelegatorTransactionsResponse>;
|
||||
/** Query all validators that a delegator is bonded to */
|
||||
readonly delegatorValidators: (delegatorAddress: string) => Promise<StakingDelegatorValidatorsResponse>;
|
||||
/** Query a validator that a delegator is bonded to */
|
||||
readonly delegatorValidator: (
|
||||
delegatorAddress: string,
|
||||
validatorAddress: string,
|
||||
) => Promise<StakingDelegatorValidatorResponse>;
|
||||
/** Query a delegation between a delegator and a validator */
|
||||
readonly delegation: (
|
||||
delegatorAddress: string,
|
||||
validatorAddress: string,
|
||||
) => Promise<StakingDelegationResponse>;
|
||||
/** Query all unbonding delegations between a delegator and a validator */
|
||||
readonly unbondingDelegation: (
|
||||
delegatorAddress: string,
|
||||
validatorAddress: string,
|
||||
) => Promise<StakingUnbondingDelegationResponse>;
|
||||
/** Query redelegations (filters in query params) */
|
||||
readonly redelegations: () => Promise<StakingRedelegationsResponse>;
|
||||
/** Get all validators */
|
||||
readonly validators: (options?: StakingValidatorsParams) => Promise<StakingValidatorsResponse>;
|
||||
/** Get a single validator info */
|
||||
readonly validator: (validatorAddress: string) => Promise<StakingValidatorResponse>;
|
||||
readonly validatorDelegations: (validatorAddress: string) => Promise<StakingValidatorDelegationsResponse>;
|
||||
/** Get all unbonding delegations from a validator */
|
||||
readonly validatorUnbondingDelegations: (
|
||||
validatorAddress: string,
|
||||
) => Promise<StakingValidatorUnbondingDelegationsResponse>;
|
||||
/** Get HistoricalInfo at a given height */
|
||||
readonly historicalInfo: (height: string) => Promise<StakingHistoricalInfoResponse>;
|
||||
/** Get the current state of the staking pool */
|
||||
readonly pool: () => Promise<StakingPoolResponse>;
|
||||
/** Get the current staking parameter values */
|
||||
readonly parameters: () => Promise<StakingParametersResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupStakingExtension(base: LcdClient): StakingExtension;
|
||||
export {};
|
18
packages/launchpad/types/lcdapi/supply.d.ts
vendored
18
packages/launchpad/types/lcdapi/supply.d.ts
vendored
@ -1,18 +0,0 @@
|
||||
import { Coin } from "../coins";
|
||||
import { LcdApiArray, LcdClient } from "./lcdclient";
|
||||
export interface TotalSupplyAllResponse {
|
||||
readonly height: string;
|
||||
readonly result: LcdApiArray<Coin>;
|
||||
}
|
||||
export interface TotalSupplyResponse {
|
||||
readonly height: string;
|
||||
/** The amount */
|
||||
readonly result: string;
|
||||
}
|
||||
export interface SupplyExtension {
|
||||
readonly supply: {
|
||||
readonly totalAll: () => Promise<TotalSupplyAllResponse>;
|
||||
readonly total: (denom: string) => Promise<TotalSupplyResponse>;
|
||||
};
|
||||
}
|
||||
export declare function setupSupplyExtension(base: LcdClient): SupplyExtension;
|
22
packages/launchpad/types/lcdapi/utils.d.ts
vendored
22
packages/launchpad/types/lcdapi/utils.d.ts
vendored
@ -1,22 +0,0 @@
|
||||
import { PubKey } from "../types";
|
||||
/**
|
||||
* Converts an integer expressed as number or string to a number.
|
||||
* Throws if input is not a valid uint64 or if the value exceeds MAX_SAFE_INTEGER.
|
||||
*
|
||||
* This is needed for supporting Comsos SDK 0.37/0.38/0.39 with one client.
|
||||
*/
|
||||
export declare function uint64ToNumber(input: number | string): number;
|
||||
/**
|
||||
* Converts an integer expressed as number or string to a string.
|
||||
* Throws if input is not a valid uint64.
|
||||
*
|
||||
* This is needed for supporting Comsos SDK 0.37/0.38/0.39 with one client.
|
||||
*/
|
||||
export declare function uint64ToString(input: number | string): string;
|
||||
/**
|
||||
* Normalizes a pubkey as in `BaseAccount.public_key` to allow supporting
|
||||
* Comsos SDK 0.37–0.39.
|
||||
*
|
||||
* Returns null when unset.
|
||||
*/
|
||||
export declare function normalizePubkey(input: string | PubKey | null): PubKey | null;
|
28
packages/launchpad/types/logs.d.ts
vendored
28
packages/launchpad/types/logs.d.ts
vendored
@ -1,28 +0,0 @@
|
||||
export interface Attribute {
|
||||
readonly key: string;
|
||||
readonly value: string;
|
||||
}
|
||||
export interface Event {
|
||||
readonly type: string;
|
||||
readonly attributes: readonly Attribute[];
|
||||
}
|
||||
export interface Log {
|
||||
readonly msg_index: number;
|
||||
readonly log: string;
|
||||
readonly events: readonly Event[];
|
||||
}
|
||||
export declare function parseAttribute(input: unknown): Attribute;
|
||||
export declare function parseEvent(input: unknown): Event;
|
||||
export declare function parseLog(input: unknown): Log;
|
||||
export declare function parseLogs(input: unknown): readonly Log[];
|
||||
/**
|
||||
* Searches in logs for the first event of the given event type and in that event
|
||||
* for the first first attribute with the given attribute key.
|
||||
*
|
||||
* Throws if the attribute was not found.
|
||||
*/
|
||||
export declare function findAttribute(
|
||||
logs: readonly Log[],
|
||||
eventType: "message" | "transfer",
|
||||
attrKey: string,
|
||||
): Attribute;
|
237
packages/launchpad/types/msgs.d.ts
vendored
237
packages/launchpad/types/msgs.d.ts
vendored
@ -1,237 +0,0 @@
|
||||
import { Coin } from "./coins";
|
||||
export interface Msg {
|
||||
readonly type: string;
|
||||
readonly value: any;
|
||||
}
|
||||
/** A high level transaction of the coin module */
|
||||
export interface MsgSend extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgSend";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly from_address: string;
|
||||
/** Bech32 account address */
|
||||
readonly to_address: string;
|
||||
readonly amount: readonly Coin[];
|
||||
};
|
||||
}
|
||||
export declare function isMsgSend(msg: Msg): msg is MsgSend;
|
||||
interface Input {
|
||||
/** Bech32 account address */
|
||||
readonly address: string;
|
||||
readonly coins: readonly Coin[];
|
||||
}
|
||||
interface Output {
|
||||
/** Bech32 account address */
|
||||
readonly address: string;
|
||||
readonly coins: readonly Coin[];
|
||||
}
|
||||
/** A high level transaction of the coin module */
|
||||
export interface MsgMultiSend extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgMultiSend";
|
||||
readonly value: {
|
||||
readonly inputs: readonly Input[];
|
||||
readonly outputs: readonly Output[];
|
||||
};
|
||||
}
|
||||
export declare function isMsgMultiSend(msg: Msg): msg is MsgMultiSend;
|
||||
/** Verifies a particular invariance */
|
||||
export interface MsgVerifyInvariant extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgVerifyInvariant";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly sender: string;
|
||||
readonly invariant_module_name: string;
|
||||
readonly invariant_route: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgVerifyInvariant(msg: Msg): msg is MsgVerifyInvariant;
|
||||
/** Changes the withdraw address for a delegator (or validator self-delegation) */
|
||||
export interface MsgSetWithdrawAddress extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgModifyWithdrawAddress";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly delegator_address: string;
|
||||
/** Bech32 account address */
|
||||
readonly withdraw_address: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgSetWithdrawAddress(msg: Msg): msg is MsgSetWithdrawAddress;
|
||||
/** Message for delegation withdraw from a single validator */
|
||||
export interface MsgWithdrawDelegatorReward extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgWithdrawDelegationReward";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly delegator_address: string;
|
||||
/** Bech32 account address */
|
||||
readonly validator_address: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgWithdrawDelegatorReward(msg: Msg): msg is MsgWithdrawDelegatorReward;
|
||||
/** Message for validator withdraw */
|
||||
export interface MsgWithdrawValidatorCommission extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgWithdrawValidatorCommission";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly validator_address: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgWithdrawValidatorCommission(msg: Msg): msg is MsgWithdrawValidatorCommission;
|
||||
/** Allows an account to directly fund the community pool. */
|
||||
export interface MsgFundCommunityPool extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgFundCommunityPool";
|
||||
readonly value: {
|
||||
readonly amount: readonly Coin[];
|
||||
/** Bech32 account address */
|
||||
readonly depositor: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgFundCommunityPool(msg: Msg): msg is MsgFundCommunityPool;
|
||||
interface Any {
|
||||
readonly type_url: string;
|
||||
readonly value: Uint8Array;
|
||||
}
|
||||
/** Supports submitting arbitrary evidence */
|
||||
export interface MsgSubmitEvidence extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgSubmitEvidence";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly submitter: string;
|
||||
readonly evidence: Any;
|
||||
};
|
||||
}
|
||||
export declare function isMsgSubmitEvidence(msg: Msg): msg is MsgSubmitEvidence;
|
||||
/** Supports submitting arbitrary proposal content. */
|
||||
export interface MsgSubmitProposal extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgSubmitProposal";
|
||||
readonly value: {
|
||||
readonly content: Any;
|
||||
readonly initial_deposit: readonly Coin[];
|
||||
/** Bech32 account address */
|
||||
readonly proposer: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgSubmitProposal(msg: Msg): msg is MsgSubmitProposal;
|
||||
declare enum VoteOption {
|
||||
VoteOptionUnspecified = 0,
|
||||
VoteOptionYes = 1,
|
||||
VoteOptionAbstain = 2,
|
||||
VoteOptionNo = 3,
|
||||
VoteOptionNoWithVeto = 4,
|
||||
}
|
||||
/** Casts a vote */
|
||||
export interface MsgVote extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgVote";
|
||||
readonly value: {
|
||||
readonly proposal_id: number;
|
||||
/** Bech32 account address */
|
||||
readonly voter: string;
|
||||
readonly option: VoteOption;
|
||||
};
|
||||
}
|
||||
export declare function isMsgVote(msg: Msg): msg is MsgVote;
|
||||
/** Submits a deposit to an existing proposal */
|
||||
export interface MsgDeposit extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgDeposit";
|
||||
readonly value: {
|
||||
readonly proposal_id: number;
|
||||
/** Bech32 account address */
|
||||
readonly depositor: string;
|
||||
readonly amount: readonly Coin[];
|
||||
};
|
||||
}
|
||||
export declare function isMsgDeposit(msg: Msg): msg is MsgDeposit;
|
||||
/** Unjails a jailed validator */
|
||||
export interface MsgUnjail extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgUnjail";
|
||||
readonly value: {
|
||||
/** Bech32 account address */
|
||||
readonly validator_addr: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgUnjail(msg: Msg): msg is MsgUnjail;
|
||||
/** The initial commission rates to be used for creating a validator */
|
||||
interface CommissionRates {
|
||||
readonly rate: string;
|
||||
readonly max_rate: string;
|
||||
readonly max_change_rate: string;
|
||||
}
|
||||
/** A validator description. */
|
||||
interface Description {
|
||||
readonly moniker: string;
|
||||
readonly identity: string;
|
||||
readonly website: string;
|
||||
readonly security_contact: string;
|
||||
readonly details: string;
|
||||
}
|
||||
/** Creates a new validator. */
|
||||
export interface MsgCreateValidator extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgCreateValidator";
|
||||
readonly value: {
|
||||
readonly description: Description;
|
||||
readonly commission: CommissionRates;
|
||||
readonly min_self_delegation: string;
|
||||
/** Bech32 encoded delegator address */
|
||||
readonly delegator_address: string;
|
||||
/** Bech32 encoded validator address */
|
||||
readonly validator_address: string;
|
||||
/** Bech32 encoded public key */
|
||||
readonly pubkey: string;
|
||||
readonly value: Coin;
|
||||
};
|
||||
}
|
||||
export declare function isMsgCreateValidator(msg: Msg): msg is MsgCreateValidator;
|
||||
/** Edits an existing validator. */
|
||||
export interface MsgEditValidator extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgEditValidator";
|
||||
readonly value: {
|
||||
readonly description: Description;
|
||||
/** Bech32 encoded validator address */
|
||||
readonly validator_address: string;
|
||||
readonly commission_rate: string;
|
||||
readonly min_self_delegation: string;
|
||||
};
|
||||
}
|
||||
export declare function isMsgEditValidator(msg: Msg): msg is MsgEditValidator;
|
||||
/**
|
||||
* Performs a delegation from a delegate to a validator.
|
||||
*
|
||||
* @see https://docs.cosmos.network/master/modules/staking/03_messages.html#msgdelegate
|
||||
*/
|
||||
export interface MsgDelegate extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgDelegate";
|
||||
readonly value: {
|
||||
/** Bech32 encoded delegator address */
|
||||
readonly delegator_address: string;
|
||||
/** Bech32 encoded validator address */
|
||||
readonly validator_address: string;
|
||||
readonly amount: Coin;
|
||||
};
|
||||
}
|
||||
export declare function isMsgDelegate(msg: Msg): msg is MsgDelegate;
|
||||
/** Performs a redelegation from a delegate and source validator to a destination validator */
|
||||
export interface MsgBeginRedelegate extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgBeginRedelegate";
|
||||
readonly value: {
|
||||
/** Bech32 encoded delegator address */
|
||||
readonly delegator_address: string;
|
||||
/** Bech32 encoded source validator address */
|
||||
readonly validator_src_address: string;
|
||||
/** Bech32 encoded destination validator address */
|
||||
readonly validator_dst_address: string;
|
||||
readonly amount: Coin;
|
||||
};
|
||||
}
|
||||
export declare function isMsgBeginRedelegate(msg: Msg): msg is MsgBeginRedelegate;
|
||||
/** Performs an undelegation from a delegate and a validator */
|
||||
export interface MsgUndelegate extends Msg {
|
||||
readonly type: "cosmos-sdk/MsgUndelegate";
|
||||
readonly value: {
|
||||
/** Bech32 encoded delegator address */
|
||||
readonly delegator_address: string;
|
||||
/** Bech32 encoded validator address */
|
||||
readonly validator_address: string;
|
||||
readonly amount: Coin;
|
||||
};
|
||||
}
|
||||
export declare function isMsgUndelegate(msg: Msg): msg is MsgUndelegate;
|
||||
export {};
|
24
packages/launchpad/types/pubkey.d.ts
vendored
24
packages/launchpad/types/pubkey.d.ts
vendored
@ -1,24 +0,0 @@
|
||||
import { PubKey } from "./types";
|
||||
export declare function encodeSecp256k1Pubkey(pubkey: Uint8Array): PubKey;
|
||||
/**
|
||||
* Decodes a pubkey in the Amino binary format to a type/value object.
|
||||
*/
|
||||
export declare function decodeAminoPubkey(data: Uint8Array): PubKey;
|
||||
/**
|
||||
* Decodes a bech32 pubkey to Amino binary, which is then decoded to a type/value object.
|
||||
* The bech32 prefix is ignored and discareded.
|
||||
*
|
||||
* @param bechEncoded the bech32 encoded pubkey
|
||||
*/
|
||||
export declare function decodeBech32Pubkey(bechEncoded: string): PubKey;
|
||||
/**
|
||||
* Encodes a public key to binary Amino.
|
||||
*/
|
||||
export declare function encodeAminoPubkey(pubkey: PubKey): Uint8Array;
|
||||
/**
|
||||
* Encodes a public key to binary Amino and then to bech32.
|
||||
*
|
||||
* @param pubkey the public key to encode
|
||||
* @param prefix the bech32 prefix (human readable part)
|
||||
*/
|
||||
export declare function encodeBech32Pubkey(pubkey: PubKey, prefix: string): string;
|
97
packages/launchpad/types/secp256k1hdwallet.d.ts
vendored
97
packages/launchpad/types/secp256k1hdwallet.d.ts
vendored
@ -1,97 +0,0 @@
|
||||
import { EnglishMnemonic, HdPath } from "@cosmjs/crypto";
|
||||
import { StdSignDoc } from "./encoding";
|
||||
import { AccountData, AminoSignResponse, OfflineSigner } from "./signer";
|
||||
import { EncryptionConfiguration, KdfConfiguration } from "./wallet";
|
||||
/**
|
||||
* This interface describes a JSON object holding the encrypted wallet and the meta data.
|
||||
* All fields in here must be JSON types.
|
||||
*/
|
||||
export interface Secp256k1HdWalletSerialization {
|
||||
/** A format+version identifier for this serialization format */
|
||||
readonly type: string;
|
||||
/** Information about the key derivation function (i.e. password to encryption key) */
|
||||
readonly kdf: KdfConfiguration;
|
||||
/** Information about the symmetric encryption */
|
||||
readonly encryption: EncryptionConfiguration;
|
||||
/** An instance of Secp256k1HdWalletData, which is stringified, encrypted and base64 encoded. */
|
||||
readonly data: string;
|
||||
}
|
||||
export declare function extractKdfConfiguration(serialization: string): KdfConfiguration;
|
||||
export declare class Secp256k1HdWallet implements OfflineSigner {
|
||||
/**
|
||||
* Restores a wallet from the given BIP39 mnemonic.
|
||||
*
|
||||
* @param mnemonic Any valid English mnemonic.
|
||||
* @param hdPath The BIP-32/SLIP-10 derivation path. Defaults to the Cosmos Hub/ATOM path `m/44'/118'/0'/0/0`.
|
||||
* @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos".
|
||||
*/
|
||||
static fromMnemonic(mnemonic: string, hdPath?: HdPath, prefix?: string): Promise<Secp256k1HdWallet>;
|
||||
/**
|
||||
* Generates a new wallet with a BIP39 mnemonic of the given length.
|
||||
*
|
||||
* @param length The number of words in the mnemonic (12, 15, 18, 21 or 24).
|
||||
* @param hdPath The BIP-32/SLIP-10 derivation path. Defaults to the Cosmos Hub/ATOM path `m/44'/118'/0'/0/0`.
|
||||
* @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos".
|
||||
*/
|
||||
static generate(
|
||||
length?: 12 | 15 | 18 | 21 | 24,
|
||||
hdPath?: HdPath,
|
||||
prefix?: string,
|
||||
): Promise<Secp256k1HdWallet>;
|
||||
/**
|
||||
* Restores a wallet from an encrypted serialization.
|
||||
*
|
||||
* @param password The user provided password used to generate an encryption key via a KDF.
|
||||
* This is not normalized internally (see "Unicode normalization" to learn more).
|
||||
*/
|
||||
static deserialize(serialization: string, password: string): Promise<Secp256k1HdWallet>;
|
||||
/**
|
||||
* Restores a wallet from an encrypted serialization.
|
||||
*
|
||||
* This is an advanced alternative to calling `deserialize(serialization, password)` directly, which allows
|
||||
* you to offload the KDF execution to a non-UI thread (e.g. in a WebWorker).
|
||||
*
|
||||
* The caller is responsible for ensuring the key was derived with the given KDF configuration. This can be
|
||||
* done using `extractKdfConfiguration(serialization)` and `executeKdf(password, kdfConfiguration)` from this package.
|
||||
*/
|
||||
static deserializeWithEncryptionKey(
|
||||
serialization: string,
|
||||
encryptionKey: Uint8Array,
|
||||
): Promise<Secp256k1HdWallet>;
|
||||
private static deserializeTypeV1;
|
||||
/** Base secret */
|
||||
private readonly secret;
|
||||
/** Derivation instruction */
|
||||
private readonly accounts;
|
||||
/** Derived data */
|
||||
private readonly pubkey;
|
||||
private readonly privkey;
|
||||
protected constructor(
|
||||
mnemonic: EnglishMnemonic,
|
||||
hdPath: HdPath,
|
||||
privkey: Uint8Array,
|
||||
pubkey: Uint8Array,
|
||||
prefix: string,
|
||||
);
|
||||
get mnemonic(): string;
|
||||
private get address();
|
||||
getAccounts(): Promise<readonly AccountData[]>;
|
||||
signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse>;
|
||||
/**
|
||||
* Generates an encrypted serialization of this wallet.
|
||||
*
|
||||
* @param password The user provided password used to generate an encryption key via a KDF.
|
||||
* This is not normalized internally (see "Unicode normalization" to learn more).
|
||||
*/
|
||||
serialize(password: string): Promise<string>;
|
||||
/**
|
||||
* Generates an encrypted serialization of this wallet.
|
||||
*
|
||||
* This is an advanced alternative to calling `serialize(password)` directly, which allows you to
|
||||
* offload the KDF execution to a non-UI thread (e.g. in a WebWorker).
|
||||
*
|
||||
* The caller is responsible for ensuring the key was derived with the given KDF options. If this
|
||||
* is not the case, the wallet cannot be restored with the original password.
|
||||
*/
|
||||
serializeWithEncryptionKey(encryptionKey: Uint8Array, kdfConfiguration: KdfConfiguration): Promise<string>;
|
||||
}
|
23
packages/launchpad/types/secp256k1wallet.d.ts
vendored
23
packages/launchpad/types/secp256k1wallet.d.ts
vendored
@ -1,23 +0,0 @@
|
||||
import { StdSignDoc } from "./encoding";
|
||||
import { AccountData, AminoSignResponse, OfflineSigner } from "./signer";
|
||||
/**
|
||||
* A wallet that holds a single secp256k1 keypair.
|
||||
*
|
||||
* If you want to work with BIP39 mnemonics and multiple accounts, use Secp256k1HdWallet.
|
||||
*/
|
||||
export declare class Secp256k1Wallet implements OfflineSigner {
|
||||
/**
|
||||
* Creates a Secp256k1Wallet from the given private key
|
||||
*
|
||||
* @param privkey The private key.
|
||||
* @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos".
|
||||
*/
|
||||
static fromKey(privkey: Uint8Array, prefix?: string): Promise<Secp256k1Wallet>;
|
||||
private readonly pubkey;
|
||||
private readonly privkey;
|
||||
private readonly prefix;
|
||||
private constructor();
|
||||
private get address();
|
||||
getAccounts(): Promise<readonly AccountData[]>;
|
||||
signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse>;
|
||||
}
|
19
packages/launchpad/types/sequence.d.ts
vendored
19
packages/launchpad/types/sequence.d.ts
vendored
@ -1,19 +0,0 @@
|
||||
import { WrappedStdTx } from "./tx";
|
||||
/**
|
||||
* Serach for sequence s with `min` <= `s` < `upperBound` to find the sequence that was used to sign the transaction
|
||||
*
|
||||
* @param tx The signed transaction
|
||||
* @param chainId The chain ID for which this transaction was signed
|
||||
* @param accountNumber The account number for which this transaction was signed
|
||||
* @param upperBound The upper bound for the testing, i.e. sequence must be lower than this value
|
||||
* @param min The lowest sequence that is tested
|
||||
*
|
||||
* @returns the sequence if a match was found and undefined otherwise
|
||||
*/
|
||||
export declare function findSequenceForSignedTx(
|
||||
tx: WrappedStdTx,
|
||||
chainId: string,
|
||||
accountNumber: number,
|
||||
upperBound: number,
|
||||
min?: number,
|
||||
): Promise<number | undefined>;
|
14
packages/launchpad/types/signature.d.ts
vendored
14
packages/launchpad/types/signature.d.ts
vendored
@ -1,14 +0,0 @@
|
||||
import { StdSignature } from "./types";
|
||||
/**
|
||||
* Takes a binary pubkey and signature to create a signature object
|
||||
*
|
||||
* @param pubkey a compressed secp256k1 public key
|
||||
* @param signature a 64 byte fixed length representation of secp256k1 signature components r and s
|
||||
*/
|
||||
export declare function encodeSecp256k1Signature(pubkey: Uint8Array, signature: Uint8Array): StdSignature;
|
||||
export declare function decodeSignature(
|
||||
signature: StdSignature,
|
||||
): {
|
||||
readonly pubkey: Uint8Array;
|
||||
readonly signature: Uint8Array;
|
||||
};
|
33
packages/launchpad/types/signer.d.ts
vendored
33
packages/launchpad/types/signer.d.ts
vendored
@ -1,33 +0,0 @@
|
||||
import { StdSignDoc } from "./encoding";
|
||||
import { StdSignature } from "./types";
|
||||
export declare type Algo = "secp256k1" | "ed25519" | "sr25519";
|
||||
export interface AccountData {
|
||||
/** A printable address (typically bech32 encoded) */
|
||||
readonly address: string;
|
||||
readonly algo: Algo;
|
||||
readonly pubkey: Uint8Array;
|
||||
}
|
||||
export interface AminoSignResponse {
|
||||
/**
|
||||
* The sign doc that was signed.
|
||||
* This may be different from the input signDoc when the signer modifies it as part of the signing process.
|
||||
*/
|
||||
readonly signed: StdSignDoc;
|
||||
readonly signature: StdSignature;
|
||||
}
|
||||
export interface OfflineSigner {
|
||||
/**
|
||||
* Get AccountData array from wallet. Rejects if not enabled.
|
||||
*/
|
||||
readonly getAccounts: () => Promise<readonly AccountData[]>;
|
||||
/**
|
||||
* Request signature from whichever key corresponds to provided bech32-encoded address. Rejects if not enabled.
|
||||
*
|
||||
* The signer implementation may offer the user the ability to override parts of the signDoc. It must
|
||||
* return the doc that was signed in the response.
|
||||
*
|
||||
* @param signerAddress The address of the account that should sign the transaction
|
||||
* @param signDoc The content that should be signed
|
||||
*/
|
||||
readonly signAmino: (signerAddress: string, signDoc: StdSignDoc) => Promise<AminoSignResponse>;
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
import { Coin } from "./coins";
|
||||
import { Account, BroadcastTxResult, CosmosClient, GetSequenceResult } from "./cosmosclient";
|
||||
import { FeeTable, GasLimits, GasPrice } from "./gas";
|
||||
import { BroadcastMode } from "./lcdapi";
|
||||
import { Msg } from "./msgs";
|
||||
import { OfflineSigner } from "./signer";
|
||||
import { StdTx } from "./tx";
|
||||
import { StdFee } from "./types";
|
||||
/**
|
||||
* These fees are used by the higher level methods of SigningCosmosClient
|
||||
*/
|
||||
export interface CosmosFeeTable extends FeeTable {
|
||||
readonly send: StdFee;
|
||||
}
|
||||
/** Use for testing only */
|
||||
export interface PrivateSigningCosmosClient {
|
||||
readonly fees: CosmosFeeTable;
|
||||
}
|
||||
export declare class SigningCosmosClient extends CosmosClient {
|
||||
readonly signerAddress: string;
|
||||
private readonly signer;
|
||||
private readonly fees;
|
||||
/**
|
||||
* Creates a new client with signing capability to interact with a Cosmos SDK blockchain. This is the bigger brother of CosmosClient.
|
||||
*
|
||||
* This instance does a lot of caching. In order to benefit from that you should try to use one instance
|
||||
* for the lifetime of your application. When switching backends, a new instance must be created.
|
||||
*
|
||||
* @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API)
|
||||
* @param signerAddress The address that will sign transactions using this instance. The `signer` must be able to sign with this address.
|
||||
* @param signer An implementation of OfflineSigner which can provide signatures for transactions, potentially requiring user input.
|
||||
* @param gasPrice The price paid per unit of gas
|
||||
* @param gasLimits Custom overrides for gas limits related to specific transaction types
|
||||
* @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns
|
||||
*/
|
||||
constructor(
|
||||
apiUrl: string,
|
||||
signerAddress: string,
|
||||
signer: OfflineSigner,
|
||||
gasPrice?: GasPrice,
|
||||
gasLimits?: Partial<GasLimits<CosmosFeeTable>>,
|
||||
broadcastMode?: BroadcastMode,
|
||||
);
|
||||
getSequence(address?: string): Promise<GetSequenceResult>;
|
||||
getAccount(address?: string): Promise<Account | undefined>;
|
||||
sendTokens(
|
||||
recipientAddress: string,
|
||||
transferAmount: readonly Coin[],
|
||||
memo?: string,
|
||||
): Promise<BroadcastTxResult>;
|
||||
/**
|
||||
* Gets account number and sequence from the API, creates a sign doc,
|
||||
* creates a single signature, assembles the signed transaction and broadcasts it.
|
||||
*/
|
||||
signAndBroadcast(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise<BroadcastTxResult>;
|
||||
/**
|
||||
* Gets account number and sequence from the API, creates a sign doc,
|
||||
* creates a single signature and assembles the signed transaction.
|
||||
*/
|
||||
sign(msgs: readonly Msg[], fee: StdFee, memo?: string): Promise<StdTx>;
|
||||
/**
|
||||
* Gets account number and sequence from the API, creates a sign doc,
|
||||
* creates a single signature and appends it to the existing signatures.
|
||||
*/
|
||||
appendSignature(signedTx: StdTx): Promise<StdTx>;
|
||||
}
|
36
packages/launchpad/types/tx.d.ts
vendored
36
packages/launchpad/types/tx.d.ts
vendored
@ -1,36 +0,0 @@
|
||||
import { StdSignDoc } from "./encoding";
|
||||
import { Msg } from "./msgs";
|
||||
import { StdFee, StdSignature } from "./types";
|
||||
/**
|
||||
* A Cosmos SDK StdTx
|
||||
*
|
||||
* @see https://docs.cosmos.network/master/modules/auth/03_types.html#stdtx
|
||||
*/
|
||||
export interface StdTx {
|
||||
readonly msg: readonly Msg[];
|
||||
readonly fee: StdFee;
|
||||
readonly signatures: readonly StdSignature[];
|
||||
readonly memo: string | undefined;
|
||||
}
|
||||
export declare function isStdTx(txValue: unknown): txValue is StdTx;
|
||||
export declare function makeStdTx(
|
||||
content: Pick<StdSignDoc, "msgs" | "fee" | "memo">,
|
||||
signatures: StdSignature | readonly StdSignature[],
|
||||
): StdTx;
|
||||
/**
|
||||
* An Amino JSON wrapper around the Tx interface
|
||||
*/
|
||||
export interface WrappedTx {
|
||||
readonly type: string;
|
||||
readonly value: any;
|
||||
}
|
||||
/**
|
||||
* An Amino JSON wrapper around StdTx
|
||||
*/
|
||||
export interface WrappedStdTx extends WrappedTx {
|
||||
readonly type: "cosmos-sdk/StdTx";
|
||||
readonly value: StdTx;
|
||||
}
|
||||
export declare function isWrappedStdTx(wrapped: WrappedTx): wrapped is WrappedStdTx;
|
||||
/** @deprecated use WrappedStdTx */
|
||||
export declare type CosmosSdkTx = WrappedStdTx;
|
21
packages/launchpad/types/types.d.ts
vendored
21
packages/launchpad/types/types.d.ts
vendored
@ -1,21 +0,0 @@
|
||||
import { Coin } from "./coins";
|
||||
export interface StdFee {
|
||||
readonly amount: readonly Coin[];
|
||||
readonly gas: string;
|
||||
}
|
||||
export interface StdSignature {
|
||||
readonly pub_key: PubKey;
|
||||
readonly signature: string;
|
||||
}
|
||||
export interface PubKey {
|
||||
readonly type: string;
|
||||
readonly value: string;
|
||||
}
|
||||
export declare const pubkeyType: {
|
||||
/** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/ed25519/ed25519.go#L22 */
|
||||
secp256k1: "tendermint/PubKeySecp256k1";
|
||||
/** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/secp256k1/secp256k1.go#L23 */
|
||||
ed25519: "tendermint/PubKeyEd25519";
|
||||
/** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/sr25519/codec.go#L12 */
|
||||
sr25519: "tendermint/PubKeySr25519";
|
||||
};
|
46
packages/launchpad/types/wallet.d.ts
vendored
46
packages/launchpad/types/wallet.d.ts
vendored
@ -1,46 +0,0 @@
|
||||
import { HdPath } from "@cosmjs/crypto";
|
||||
/**
|
||||
* The Cosmoshub derivation path in the form `m/44'/118'/0'/0/a`
|
||||
* with 0-based account index `a`.
|
||||
*/
|
||||
export declare function makeCosmoshubPath(a: number): HdPath;
|
||||
/**
|
||||
* A fixed salt is chosen to archive a deterministic password to key derivation.
|
||||
* This reduces the scope of a potential rainbow attack to all CosmJS users.
|
||||
* Must be 16 bytes due to implementation limitations.
|
||||
*/
|
||||
export declare const cosmjsSalt: Uint8Array;
|
||||
export interface KdfConfiguration {
|
||||
/**
|
||||
* An algorithm identifier, such as "argon2id" or "scrypt".
|
||||
*/
|
||||
readonly algorithm: string;
|
||||
/** A map of algorithm-specific parameters */
|
||||
readonly params: Record<string, unknown>;
|
||||
}
|
||||
export declare function executeKdf(password: string, configuration: KdfConfiguration): Promise<Uint8Array>;
|
||||
/**
|
||||
* Configuration how to encrypt data or how data was encrypted.
|
||||
* This is stored as part of the wallet serialization and must only contain JSON types.
|
||||
*/
|
||||
export interface EncryptionConfiguration {
|
||||
/**
|
||||
* An algorithm identifier, such as "xchacha20poly1305-ietf".
|
||||
*/
|
||||
readonly algorithm: string;
|
||||
/** A map of algorithm-specific parameters */
|
||||
readonly params?: Record<string, unknown>;
|
||||
}
|
||||
export declare const supportedAlgorithms: {
|
||||
xchacha20poly1305Ietf: string;
|
||||
};
|
||||
export declare function encrypt(
|
||||
plaintext: Uint8Array,
|
||||
encryptionKey: Uint8Array,
|
||||
config: EncryptionConfiguration,
|
||||
): Promise<Uint8Array>;
|
||||
export declare function decrypt(
|
||||
ciphertext: Uint8Array,
|
||||
encryptionKey: Uint8Array,
|
||||
config: EncryptionConfiguration,
|
||||
): Promise<Uint8Array>;
|
2
packages/ledger-amino/types/index.d.ts
vendored
2
packages/ledger-amino/types/index.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export { LaunchpadLedger } from "./launchpadledger";
|
||||
export { LedgerSigner } from "./ledgersigner";
|
30
packages/ledger-amino/types/launchpadledger.d.ts
vendored
30
packages/ledger-amino/types/launchpadledger.d.ts
vendored
@ -1,30 +0,0 @@
|
||||
/// <reference types="ledgerhq__hw-transport" />
|
||||
import { HdPath } from "@cosmjs/crypto";
|
||||
import Transport from "@ledgerhq/hw-transport";
|
||||
export interface LedgerAppErrorResponse {
|
||||
readonly error_message?: string;
|
||||
readonly device_locked?: boolean;
|
||||
}
|
||||
export interface LaunchpadLedgerOptions {
|
||||
readonly hdPaths?: readonly HdPath[];
|
||||
readonly prefix?: string;
|
||||
readonly testModeAllowed?: boolean;
|
||||
}
|
||||
export declare class LaunchpadLedger {
|
||||
private readonly testModeAllowed;
|
||||
private readonly hdPaths;
|
||||
private readonly prefix;
|
||||
private readonly app;
|
||||
constructor(transport: Transport, options?: LaunchpadLedgerOptions);
|
||||
getCosmosAppVersion(): Promise<string>;
|
||||
getPubkey(hdPath?: HdPath): Promise<Uint8Array>;
|
||||
getPubkeys(): Promise<readonly Uint8Array[]>;
|
||||
getCosmosAddress(pubkey?: Uint8Array): Promise<string>;
|
||||
sign(message: Uint8Array, hdPath?: HdPath): Promise<Uint8Array>;
|
||||
private verifyAppMode;
|
||||
private getOpenAppName;
|
||||
private verifyAppVersion;
|
||||
private verifyCosmosAppIsOpen;
|
||||
private verifyDeviceIsReady;
|
||||
private handleLedgerErrors;
|
||||
}
|
13
packages/ledger-amino/types/ledgersigner.d.ts
vendored
13
packages/ledger-amino/types/ledgersigner.d.ts
vendored
@ -1,13 +0,0 @@
|
||||
/// <reference types="ledgerhq__hw-transport" />
|
||||
import { AccountData, OfflineSigner, StdSignDoc } from "@cosmjs/launchpad";
|
||||
import { AminoSignResponse } from "@cosmjs/launchpad";
|
||||
import Transport from "@ledgerhq/hw-transport";
|
||||
import { LaunchpadLedgerOptions } from "./launchpadledger";
|
||||
export declare class LedgerSigner implements OfflineSigner {
|
||||
private readonly ledger;
|
||||
private readonly hdPaths;
|
||||
private accounts?;
|
||||
constructor(transport: Transport, options?: LaunchpadLedgerOptions);
|
||||
getAccounts(): Promise<readonly AccountData[]>;
|
||||
signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse>;
|
||||
}
|
46
packages/math/types/decimal.d.ts
vendored
46
packages/math/types/decimal.d.ts
vendored
@ -1,46 +0,0 @@
|
||||
import { Uint32, Uint53, Uint64 } from "./integers";
|
||||
/**
|
||||
* A type for arbitrary precision, non-negative decimals.
|
||||
*
|
||||
* Instances of this class are immutable.
|
||||
*/
|
||||
export declare class Decimal {
|
||||
static fromUserInput(input: string, fractionalDigits: number): Decimal;
|
||||
static fromAtomics(atomics: string, fractionalDigits: number): Decimal;
|
||||
private static verifyFractionalDigits;
|
||||
static compare(a: Decimal, b: Decimal): number;
|
||||
get atomics(): string;
|
||||
get fractionalDigits(): number;
|
||||
private readonly data;
|
||||
private constructor();
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns an approximation as a float type. Only use this if no
|
||||
* exact calculation is required.
|
||||
*/
|
||||
toFloatApproximation(): number;
|
||||
/**
|
||||
* a.plus(b) returns a+b.
|
||||
*
|
||||
* Both values need to have the same fractional digits.
|
||||
*/
|
||||
plus(b: Decimal): Decimal;
|
||||
/**
|
||||
* a.minus(b) returns a-b.
|
||||
*
|
||||
* Both values need to have the same fractional digits.
|
||||
* The resulting difference needs to be non-negative.
|
||||
*/
|
||||
minus(b: Decimal): Decimal;
|
||||
/**
|
||||
* a.multiply(b) returns a*b.
|
||||
*
|
||||
* We only allow multiplication by unsigned integers to avoid rounding errors.
|
||||
*/
|
||||
multiply(b: Uint32 | Uint53 | Uint64): Decimal;
|
||||
equals(b: Decimal): boolean;
|
||||
isLessThan(b: Decimal): boolean;
|
||||
isLessThanOrEqual(b: Decimal): boolean;
|
||||
isGreaterThan(b: Decimal): boolean;
|
||||
isGreaterThanOrEqual(b: Decimal): boolean;
|
||||
}
|
2
packages/math/types/index.d.ts
vendored
2
packages/math/types/index.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export { Decimal } from "./decimal";
|
||||
export { Int53, Uint32, Uint53, Uint64 } from "./integers";
|
61
packages/math/types/integers.d.ts
vendored
61
packages/math/types/integers.d.ts
vendored
@ -1,61 +0,0 @@
|
||||
/** Internal interface to ensure all integer types can be used equally */
|
||||
interface Integer {
|
||||
readonly toNumber: () => number;
|
||||
readonly toString: () => string;
|
||||
}
|
||||
interface WithByteConverters {
|
||||
readonly toBytesBigEndian: () => Uint8Array;
|
||||
readonly toBytesLittleEndian: () => Uint8Array;
|
||||
}
|
||||
export declare class Uint32 implements Integer, WithByteConverters {
|
||||
/** @deprecated use Uint32.fromBytes */
|
||||
static fromBigEndianBytes(bytes: ArrayLike<number>): Uint32;
|
||||
/**
|
||||
* Creates a Uint32 from a fixed length byte array.
|
||||
*
|
||||
* @param bytes a list of exactly 4 bytes
|
||||
* @param endianess defaults to big endian
|
||||
*/
|
||||
static fromBytes(bytes: ArrayLike<number>, endianess?: "be" | "le"): Uint32;
|
||||
static fromString(str: string): Uint32;
|
||||
protected readonly data: number;
|
||||
constructor(input: number);
|
||||
toBytesBigEndian(): Uint8Array;
|
||||
toBytesLittleEndian(): Uint8Array;
|
||||
toNumber(): number;
|
||||
toString(): string;
|
||||
}
|
||||
export declare class Int53 implements Integer {
|
||||
static fromString(str: string): Int53;
|
||||
protected readonly data: number;
|
||||
constructor(input: number);
|
||||
toNumber(): number;
|
||||
toString(): string;
|
||||
}
|
||||
export declare class Uint53 implements Integer {
|
||||
static fromString(str: string): Uint53;
|
||||
protected readonly data: Int53;
|
||||
constructor(input: number);
|
||||
toNumber(): number;
|
||||
toString(): string;
|
||||
}
|
||||
export declare class Uint64 implements Integer, WithByteConverters {
|
||||
/** @deprecated use Uint64.fromBytes */
|
||||
static fromBytesBigEndian(bytes: ArrayLike<number>): Uint64;
|
||||
/**
|
||||
* Creates a Uint64 from a fixed length byte array.
|
||||
*
|
||||
* @param bytes a list of exactly 8 bytes
|
||||
* @param endianess defaults to big endian
|
||||
*/
|
||||
static fromBytes(bytes: ArrayLike<number>, endianess?: "be" | "le"): Uint64;
|
||||
static fromString(str: string): Uint64;
|
||||
static fromNumber(input: number): Uint64;
|
||||
private readonly data;
|
||||
private constructor();
|
||||
toBytesBigEndian(): Uint8Array;
|
||||
toBytesLittleEndian(): Uint8Array;
|
||||
toString(): string;
|
||||
toNumber(): number;
|
||||
}
|
||||
export {};
|
11
packages/proto-signing/types/adr27.d.ts
vendored
11
packages/proto-signing/types/adr27.d.ts
vendored
@ -1,11 +0,0 @@
|
||||
/**
|
||||
* Converts default values to null in order to tell protobuf.js
|
||||
* to not serialize them.
|
||||
*
|
||||
* @see https://github.com/cosmos/cosmos-sdk/pull/6979
|
||||
*/
|
||||
export declare function omitDefault<T>(input: T): T | null;
|
||||
/**
|
||||
* Walks through a potentially nested object and calls omitDefault on each element.
|
||||
*/
|
||||
export declare function omitDefaults(input: any): any;
|
@ -1,130 +0,0 @@
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmos.bank.v1beta1";
|
||||
/** Params defines the parameters for the bank module. */
|
||||
export interface Params {
|
||||
sendEnabled: SendEnabled[];
|
||||
defaultSendEnabled: boolean;
|
||||
}
|
||||
/**
|
||||
* SendEnabled maps coin denom to a send_enabled status (whether a denom is
|
||||
* sendable).
|
||||
*/
|
||||
export interface SendEnabled {
|
||||
denom: string;
|
||||
enabled: boolean;
|
||||
}
|
||||
/** Input models transaction input. */
|
||||
export interface Input {
|
||||
address: string;
|
||||
coins: Coin[];
|
||||
}
|
||||
/** Output models transaction outputs. */
|
||||
export interface Output {
|
||||
address: string;
|
||||
coins: Coin[];
|
||||
}
|
||||
/**
|
||||
* Supply represents a struct that passively keeps track of the total supply
|
||||
* amounts in the network.
|
||||
*/
|
||||
export interface Supply {
|
||||
total: Coin[];
|
||||
}
|
||||
/**
|
||||
* DenomUnit represents a struct that describes a given
|
||||
* denomination unit of the basic token.
|
||||
*/
|
||||
export interface DenomUnit {
|
||||
/** denom represents the string name of the given denom unit (e.g uatom). */
|
||||
denom: string;
|
||||
/**
|
||||
* exponent represents power of 10 exponent that one must
|
||||
* raise the base_denom to in order to equal the given DenomUnit's denom
|
||||
* 1 denom = 1^exponent base_denom
|
||||
* (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
|
||||
* exponent = 6, thus: 1 atom = 10^6 uatom).
|
||||
*/
|
||||
exponent: number;
|
||||
/** aliases is a list of string aliases for the given denom */
|
||||
aliases: string[];
|
||||
}
|
||||
/**
|
||||
* Metadata represents a struct that describes
|
||||
* a basic token.
|
||||
*/
|
||||
export interface Metadata {
|
||||
description: string;
|
||||
/** denom_units represents the list of DenomUnit's for a given coin */
|
||||
denomUnits: DenomUnit[];
|
||||
/** base represents the base denom (should be the DenomUnit with exponent = 0). */
|
||||
base: string;
|
||||
/**
|
||||
* display indicates the suggested denom that should be
|
||||
* displayed in clients.
|
||||
*/
|
||||
display: string;
|
||||
}
|
||||
export declare const Params: {
|
||||
encode(message: Params, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
|
||||
fromJSON(object: any): Params;
|
||||
fromPartial(object: DeepPartial<Params>): Params;
|
||||
toJSON(message: Params): unknown;
|
||||
};
|
||||
export declare const SendEnabled: {
|
||||
encode(message: SendEnabled, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SendEnabled;
|
||||
fromJSON(object: any): SendEnabled;
|
||||
fromPartial(object: DeepPartial<SendEnabled>): SendEnabled;
|
||||
toJSON(message: SendEnabled): unknown;
|
||||
};
|
||||
export declare const Input: {
|
||||
encode(message: Input, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Input;
|
||||
fromJSON(object: any): Input;
|
||||
fromPartial(object: DeepPartial<Input>): Input;
|
||||
toJSON(message: Input): unknown;
|
||||
};
|
||||
export declare const Output: {
|
||||
encode(message: Output, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Output;
|
||||
fromJSON(object: any): Output;
|
||||
fromPartial(object: DeepPartial<Output>): Output;
|
||||
toJSON(message: Output): unknown;
|
||||
};
|
||||
export declare const Supply: {
|
||||
encode(message: Supply, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Supply;
|
||||
fromJSON(object: any): Supply;
|
||||
fromPartial(object: DeepPartial<Supply>): Supply;
|
||||
toJSON(message: Supply): unknown;
|
||||
};
|
||||
export declare const DenomUnit: {
|
||||
encode(message: DenomUnit, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DenomUnit;
|
||||
fromJSON(object: any): DenomUnit;
|
||||
fromPartial(object: DeepPartial<DenomUnit>): DenomUnit;
|
||||
toJSON(message: DenomUnit): unknown;
|
||||
};
|
||||
export declare const Metadata: {
|
||||
encode(message: Metadata, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Metadata;
|
||||
fromJSON(object: any): Metadata;
|
||||
fromPartial(object: DeepPartial<Metadata>): Metadata;
|
||||
toJSON(message: Metadata): unknown;
|
||||
};
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
@ -1,77 +0,0 @@
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
import { Input, Output } from "../../../cosmos/bank/v1beta1/bank";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
import Long from "long";
|
||||
export declare const protobufPackage = "cosmos.bank.v1beta1";
|
||||
/** MsgSend represents a message to send coins from one account to another. */
|
||||
export interface MsgSend {
|
||||
fromAddress: string;
|
||||
toAddress: string;
|
||||
amount: Coin[];
|
||||
}
|
||||
/** MsgSendResponse defines the Msg/Send response type. */
|
||||
export interface MsgSendResponse {}
|
||||
/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */
|
||||
export interface MsgMultiSend {
|
||||
inputs: Input[];
|
||||
outputs: Output[];
|
||||
}
|
||||
/** MsgMultiSendResponse defines the Msg/MultiSend response type. */
|
||||
export interface MsgMultiSendResponse {}
|
||||
export declare const MsgSend: {
|
||||
encode(message: MsgSend, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgSend;
|
||||
fromJSON(object: any): MsgSend;
|
||||
fromPartial(object: DeepPartial<MsgSend>): MsgSend;
|
||||
toJSON(message: MsgSend): unknown;
|
||||
};
|
||||
export declare const MsgSendResponse: {
|
||||
encode(_: MsgSendResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgSendResponse;
|
||||
fromJSON(_: any): MsgSendResponse;
|
||||
fromPartial(_: DeepPartial<MsgSendResponse>): MsgSendResponse;
|
||||
toJSON(_: MsgSendResponse): unknown;
|
||||
};
|
||||
export declare const MsgMultiSend: {
|
||||
encode(message: MsgMultiSend, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMultiSend;
|
||||
fromJSON(object: any): MsgMultiSend;
|
||||
fromPartial(object: DeepPartial<MsgMultiSend>): MsgMultiSend;
|
||||
toJSON(message: MsgMultiSend): unknown;
|
||||
};
|
||||
export declare const MsgMultiSendResponse: {
|
||||
encode(_: MsgMultiSendResponse, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgMultiSendResponse;
|
||||
fromJSON(_: any): MsgMultiSendResponse;
|
||||
fromPartial(_: DeepPartial<MsgMultiSendResponse>): MsgMultiSendResponse;
|
||||
toJSON(_: MsgMultiSendResponse): unknown;
|
||||
};
|
||||
/** Msg defines the bank Msg service. */
|
||||
export interface Msg {
|
||||
/** Send defines a method for sending coins from one account to another account. */
|
||||
Send(request: MsgSend): Promise<MsgSendResponse>;
|
||||
/** MultiSend defines a method for sending coins from some accounts to other accounts. */
|
||||
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse>;
|
||||
}
|
||||
export declare class MsgClientImpl implements Msg {
|
||||
private readonly rpc;
|
||||
constructor(rpc: Rpc);
|
||||
Send(request: MsgSend): Promise<MsgSendResponse>;
|
||||
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse>;
|
||||
}
|
||||
interface Rpc {
|
||||
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
@ -1,72 +0,0 @@
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmos.base.v1beta1";
|
||||
/**
|
||||
* Coin defines a token with a denomination and an amount.
|
||||
*
|
||||
* NOTE: The amount field is an Int which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface Coin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
/**
|
||||
* DecCoin defines a token with a denomination and a decimal amount.
|
||||
*
|
||||
* NOTE: The amount field is an Dec which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface DecCoin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
/** IntProto defines a Protobuf wrapper around an Int object. */
|
||||
export interface IntProto {
|
||||
int: string;
|
||||
}
|
||||
/** DecProto defines a Protobuf wrapper around a Dec object. */
|
||||
export interface DecProto {
|
||||
dec: string;
|
||||
}
|
||||
export declare const Coin: {
|
||||
encode(message: Coin, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Coin;
|
||||
fromJSON(object: any): Coin;
|
||||
fromPartial(object: DeepPartial<Coin>): Coin;
|
||||
toJSON(message: Coin): unknown;
|
||||
};
|
||||
export declare const DecCoin: {
|
||||
encode(message: DecCoin, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DecCoin;
|
||||
fromJSON(object: any): DecCoin;
|
||||
fromPartial(object: DeepPartial<DecCoin>): DecCoin;
|
||||
toJSON(message: DecCoin): unknown;
|
||||
};
|
||||
export declare const IntProto: {
|
||||
encode(message: IntProto, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): IntProto;
|
||||
fromJSON(object: any): IntProto;
|
||||
fromPartial(object: DeepPartial<IntProto>): IntProto;
|
||||
toJSON(message: IntProto): unknown;
|
||||
};
|
||||
export declare const DecProto: {
|
||||
encode(message: DecProto, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DecProto;
|
||||
fromJSON(object: any): DecProto;
|
||||
fromPartial(object: DeepPartial<DecProto>): DecProto;
|
||||
toJSON(message: DecProto): unknown;
|
||||
};
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
@ -1,48 +0,0 @@
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
export declare const protobufPackage = "cosmos.crypto.multisig.v1beta1";
|
||||
/**
|
||||
* MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey.
|
||||
* See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers
|
||||
* signed and with which modes.
|
||||
*/
|
||||
export interface MultiSignature {
|
||||
signatures: Uint8Array[];
|
||||
}
|
||||
/**
|
||||
* CompactBitArray is an implementation of a space efficient bit array.
|
||||
* This is used to ensure that the encoded data takes up a minimal amount of
|
||||
* space after proto encoding.
|
||||
* This is not thread safe, and is not intended for concurrent usage.
|
||||
*/
|
||||
export interface CompactBitArray {
|
||||
extraBitsStored: number;
|
||||
elems: Uint8Array;
|
||||
}
|
||||
export declare const MultiSignature: {
|
||||
encode(message: MultiSignature, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MultiSignature;
|
||||
fromJSON(object: any): MultiSignature;
|
||||
fromPartial(object: DeepPartial<MultiSignature>): MultiSignature;
|
||||
toJSON(message: MultiSignature): unknown;
|
||||
};
|
||||
export declare const CompactBitArray: {
|
||||
encode(message: CompactBitArray, writer?: _m0.Writer): _m0.Writer;
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CompactBitArray;
|
||||
fromJSON(object: any): CompactBitArray;
|
||||
fromPartial(object: DeepPartial<CompactBitArray>): CompactBitArray;
|
||||
toJSON(message: CompactBitArray): unknown;
|
||||
};
|
||||
declare type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export declare type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: 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>;
|
||||
export {};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user