mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
cosmwasm-stargate: Use cosmjs-types
This commit is contained in:
parent
2f5983c9ea
commit
fc9afd28c1
@ -1,6 +1,14 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { fromBase64, toUtf8 } from "@cosmjs/encoding";
|
import { fromBase64, toUtf8 } from "@cosmjs/encoding";
|
||||||
import { AminoTypes, coins } from "@cosmjs/stargate";
|
import { AminoTypes, coins } from "@cosmjs/stargate";
|
||||||
|
import {
|
||||||
|
MsgClearAdmin,
|
||||||
|
MsgExecuteContract,
|
||||||
|
MsgInstantiateContract,
|
||||||
|
MsgMigrateContract,
|
||||||
|
MsgStoreCode,
|
||||||
|
MsgUpdateAdmin,
|
||||||
|
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||||
import Long from "long";
|
import Long from "long";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -12,14 +20,6 @@ import {
|
|||||||
AminoMsgUpdateAdmin,
|
AminoMsgUpdateAdmin,
|
||||||
cosmWasmTypes,
|
cosmWasmTypes,
|
||||||
} from "./aminotypes";
|
} from "./aminotypes";
|
||||||
import {
|
|
||||||
MsgClearAdmin,
|
|
||||||
MsgExecuteContract,
|
|
||||||
MsgInstantiateContract,
|
|
||||||
MsgMigrateContract,
|
|
||||||
MsgStoreCode,
|
|
||||||
MsgUpdateAdmin,
|
|
||||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
|
||||||
|
|
||||||
describe("AminoTypes", () => {
|
describe("AminoTypes", () => {
|
||||||
describe("toAmino", () => {
|
describe("toAmino", () => {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { fromBase64, fromUtf8, toBase64, toUtf8 } from "@cosmjs/encoding";
|
import { fromBase64, fromUtf8, toBase64, toUtf8 } from "@cosmjs/encoding";
|
||||||
import { AminoConverter, Coin } from "@cosmjs/stargate";
|
import { AminoConverter, Coin } from "@cosmjs/stargate";
|
||||||
import Long from "long";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MsgClearAdmin,
|
MsgClearAdmin,
|
||||||
MsgExecuteContract,
|
MsgExecuteContract,
|
||||||
@ -10,7 +8,8 @@ import {
|
|||||||
MsgMigrateContract,
|
MsgMigrateContract,
|
||||||
MsgStoreCode,
|
MsgStoreCode,
|
||||||
MsgUpdateAdmin,
|
MsgUpdateAdmin,
|
||||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||||
|
import Long from "long";
|
||||||
|
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
/**
|
/**
|
||||||
|
@ -17,8 +17,8 @@ import {
|
|||||||
isBroadcastTxSuccess,
|
isBroadcastTxSuccess,
|
||||||
isMsgSendEncodeObject,
|
isMsgSendEncodeObject,
|
||||||
} from "@cosmjs/stargate";
|
} from "@cosmjs/stargate";
|
||||||
import { TxRaw } from "@cosmjs/stargate/build/codec/cosmos/tx/v1beta1/tx";
|
|
||||||
import { assert, sleep } from "@cosmjs/utils";
|
import { assert, sleep } from "@cosmjs/utils";
|
||||||
|
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
||||||
|
|
||||||
import { CosmWasmClient } from "./cosmwasmclient";
|
import { CosmWasmClient } from "./cosmwasmclient";
|
||||||
import {
|
import {
|
||||||
|
@ -12,8 +12,8 @@ import {
|
|||||||
TxBodyEncodeObject,
|
TxBodyEncodeObject,
|
||||||
} from "@cosmjs/proto-signing";
|
} from "@cosmjs/proto-signing";
|
||||||
import { assertIsBroadcastTxSuccess, coins, logs, MsgSendEncodeObject, StdFee } from "@cosmjs/stargate";
|
import { assertIsBroadcastTxSuccess, coins, logs, MsgSendEncodeObject, StdFee } from "@cosmjs/stargate";
|
||||||
import { TxRaw } from "@cosmjs/stargate/build/codec/cosmos/tx/v1beta1/tx";
|
|
||||||
import { assert, sleep } from "@cosmjs/utils";
|
import { assert, sleep } from "@cosmjs/utils";
|
||||||
|
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
||||||
import { ReadonlyDate } from "readonly-date";
|
import { ReadonlyDate } from "readonly-date";
|
||||||
|
|
||||||
import { CosmWasmClient, PrivateCosmWasmClient } from "./cosmwasmclient";
|
import { CosmWasmClient, PrivateCosmWasmClient } from "./cosmwasmclient";
|
||||||
|
@ -30,9 +30,9 @@ import {
|
|||||||
} from "@cosmjs/stargate";
|
} from "@cosmjs/stargate";
|
||||||
import { Tendermint34Client, toRfc3339WithNanoseconds } from "@cosmjs/tendermint-rpc";
|
import { Tendermint34Client, toRfc3339WithNanoseconds } from "@cosmjs/tendermint-rpc";
|
||||||
import { assert, sleep } from "@cosmjs/utils";
|
import { assert, sleep } from "@cosmjs/utils";
|
||||||
|
import { CodeInfoResponse } from "cosmjs-types/cosmwasm/wasm/v1beta1/query";
|
||||||
|
import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1beta1/types";
|
||||||
|
|
||||||
import { CodeInfoResponse } from "./codec/cosmwasm/wasm/v1beta1/query";
|
|
||||||
import { ContractCodeHistoryOperationType } from "./codec/cosmwasm/wasm/v1beta1/types";
|
|
||||||
import { setupWasmExtension, WasmExtension } from "./queries";
|
import { setupWasmExtension, WasmExtension } from "./queries";
|
||||||
|
|
||||||
// Those types can be copied over to allow them to evolve independently of @cosmjs/cosmwasm-launchpad.
|
// Those types can be copied over to allow them to evolve independently of @cosmjs/cosmwasm-launchpad.
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { EncodeObject } from "@cosmjs/proto-signing";
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MsgClearAdmin,
|
MsgClearAdmin,
|
||||||
MsgExecuteContract,
|
MsgExecuteContract,
|
||||||
@ -7,7 +6,7 @@ import {
|
|||||||
MsgMigrateContract,
|
MsgMigrateContract,
|
||||||
MsgStoreCode,
|
MsgStoreCode,
|
||||||
MsgUpdateAdmin,
|
MsgUpdateAdmin,
|
||||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||||
|
|
||||||
export interface MsgStoreCodeEncodeObject extends EncodeObject {
|
export interface MsgStoreCodeEncodeObject extends EncodeObject {
|
||||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode";
|
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode";
|
||||||
|
@ -13,10 +13,14 @@ import {
|
|||||||
StdFee,
|
StdFee,
|
||||||
} from "@cosmjs/stargate";
|
} from "@cosmjs/stargate";
|
||||||
import { assert } from "@cosmjs/utils";
|
import { assert } from "@cosmjs/utils";
|
||||||
|
import {
|
||||||
|
MsgExecuteContract,
|
||||||
|
MsgInstantiateContract,
|
||||||
|
MsgStoreCode,
|
||||||
|
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||||
|
import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1beta1/types";
|
||||||
import Long from "long";
|
import Long from "long";
|
||||||
|
|
||||||
import { MsgExecuteContract, MsgInstantiateContract, MsgStoreCode } from "../codec/cosmwasm/wasm/v1beta1/tx";
|
|
||||||
import { ContractCodeHistoryOperationType } from "../codec/cosmwasm/wasm/v1beta1/types";
|
|
||||||
import {
|
import {
|
||||||
MsgExecuteContractEncodeObject,
|
MsgExecuteContractEncodeObject,
|
||||||
MsgInstantiateContractEncodeObject,
|
MsgInstantiateContractEncodeObject,
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
import { JsonObject } from "@cosmjs/cosmwasm-launchpad";
|
import { JsonObject } from "@cosmjs/cosmwasm-launchpad";
|
||||||
import { fromUtf8, toAscii } from "@cosmjs/encoding";
|
import { fromUtf8, toAscii } from "@cosmjs/encoding";
|
||||||
import { createPagination, createProtobufRpcClient, QueryClient } from "@cosmjs/stargate";
|
import { createPagination, createProtobufRpcClient, QueryClient } from "@cosmjs/stargate";
|
||||||
import Long from "long";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
QueryAllContractStateResponse,
|
QueryAllContractStateResponse,
|
||||||
QueryClientImpl,
|
QueryClientImpl,
|
||||||
@ -13,7 +11,8 @@ import {
|
|||||||
QueryContractInfoResponse,
|
QueryContractInfoResponse,
|
||||||
QueryContractsByCodeResponse,
|
QueryContractsByCodeResponse,
|
||||||
QueryRawContractStateResponse,
|
QueryRawContractStateResponse,
|
||||||
} from "../codec/cosmwasm/wasm/v1beta1/query";
|
} from "cosmjs-types/cosmwasm/wasm/v1beta1/query";
|
||||||
|
import Long from "long";
|
||||||
|
|
||||||
export interface WasmExtension {
|
export interface WasmExtension {
|
||||||
readonly wasm: {
|
readonly wasm: {
|
||||||
|
@ -14,16 +14,16 @@ import {
|
|||||||
MsgDelegateEncodeObject,
|
MsgDelegateEncodeObject,
|
||||||
MsgSendEncodeObject,
|
MsgSendEncodeObject,
|
||||||
} from "@cosmjs/stargate";
|
} from "@cosmjs/stargate";
|
||||||
import { DeepPartial, MsgSend } from "@cosmjs/stargate/build/codec/cosmos/bank/v1beta1/tx";
|
|
||||||
import { Coin } from "@cosmjs/stargate/build/codec/cosmos/base/v1beta1/coin";
|
|
||||||
import { MsgDelegate } from "@cosmjs/stargate/build/codec/cosmos/staking/v1beta1/tx";
|
|
||||||
import { AuthInfo, TxBody, TxRaw } from "@cosmjs/stargate/build/codec/cosmos/tx/v1beta1/tx";
|
|
||||||
import { assert, sleep } from "@cosmjs/utils";
|
import { assert, sleep } from "@cosmjs/utils";
|
||||||
|
import { DeepPartial, MsgSend } from "cosmjs-types/cosmos/bank/v1beta1/tx";
|
||||||
|
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
||||||
|
import { MsgDelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
||||||
|
import { AuthInfo, TxBody, TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
||||||
|
import { MsgStoreCode } from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||||
import Long from "long";
|
import Long from "long";
|
||||||
import pako from "pako";
|
import pako from "pako";
|
||||||
import protobuf from "protobufjs/minimal";
|
import protobuf from "protobufjs/minimal";
|
||||||
|
|
||||||
import { MsgStoreCode } from "./codec/cosmwasm/wasm/v1beta1/tx";
|
|
||||||
import { MsgStoreCodeEncodeObject } from "./encodeobjects";
|
import { MsgStoreCodeEncodeObject } from "./encodeobjects";
|
||||||
import { SigningCosmWasmClient } from "./signingcosmwasmclient";
|
import { SigningCosmWasmClient } from "./signingcosmwasmclient";
|
||||||
import {
|
import {
|
||||||
|
@ -44,16 +44,12 @@ import {
|
|||||||
SignerData,
|
SignerData,
|
||||||
StdFee,
|
StdFee,
|
||||||
} from "@cosmjs/stargate";
|
} from "@cosmjs/stargate";
|
||||||
import { MsgWithdrawDelegatorReward } from "@cosmjs/stargate/build/codec/cosmos/distribution/v1beta1/tx";
|
|
||||||
import { MsgDelegate, MsgUndelegate } from "@cosmjs/stargate/build/codec/cosmos/staking/v1beta1/tx";
|
|
||||||
import { SignMode } from "@cosmjs/stargate/build/codec/cosmos/tx/signing/v1beta1/signing";
|
|
||||||
import { TxRaw } from "@cosmjs/stargate/build/codec/cosmos/tx/v1beta1/tx";
|
|
||||||
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
||||||
import { assert } from "@cosmjs/utils";
|
import { assert } from "@cosmjs/utils";
|
||||||
import Long from "long";
|
import { MsgWithdrawDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
|
||||||
import pako from "pako";
|
import { MsgDelegate, MsgUndelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
||||||
|
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
|
||||||
import { cosmWasmTypes } from "./aminotypes";
|
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
||||||
import {
|
import {
|
||||||
MsgClearAdmin,
|
MsgClearAdmin,
|
||||||
MsgExecuteContract,
|
MsgExecuteContract,
|
||||||
@ -61,7 +57,11 @@ import {
|
|||||||
MsgMigrateContract,
|
MsgMigrateContract,
|
||||||
MsgStoreCode,
|
MsgStoreCode,
|
||||||
MsgUpdateAdmin,
|
MsgUpdateAdmin,
|
||||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||||
|
import Long from "long";
|
||||||
|
import pako from "pako";
|
||||||
|
|
||||||
|
import { cosmWasmTypes } from "./aminotypes";
|
||||||
import { CosmWasmClient } from "./cosmwasmclient";
|
import { CosmWasmClient } from "./cosmwasmclient";
|
||||||
import {
|
import {
|
||||||
MsgClearAdminEncodeObject,
|
MsgClearAdminEncodeObject,
|
||||||
|
@ -16,9 +16,9 @@ import {
|
|||||||
setupAuthExtension,
|
setupAuthExtension,
|
||||||
setupBankExtension,
|
setupBankExtension,
|
||||||
} from "@cosmjs/stargate";
|
} from "@cosmjs/stargate";
|
||||||
import { SignMode } from "@cosmjs/stargate/build/codec/cosmos/tx/signing/v1beta1/signing";
|
|
||||||
import { AuthInfo, SignDoc, TxBody } from "@cosmjs/stargate/build/codec/cosmos/tx/v1beta1/tx";
|
|
||||||
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
||||||
|
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
|
||||||
|
import { AuthInfo, SignDoc, TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
||||||
|
|
||||||
import { setupWasmExtension, WasmExtension } from "./queries";
|
import { setupWasmExtension, WasmExtension } from "./queries";
|
||||||
import hackatom from "./testdata/contract.json";
|
import hackatom from "./testdata/contract.json";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user