diff --git a/CHANGELOG.md b/CHANGELOG.md index e58a19d2..7a9efc12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.24.0 (unreleased) +- @cosmjs/cosmwasm: This package is now deprecated. The same functionality is + now available in @cosmjs/cosmwasm-launchpad. - @cosmjs/cosmwasm: `logs` is no longer exported. Use `logs` from @cosmjs/launchpad instead. - @cosmjs/cosmwasm: Export `JsonObject`, `ChangeAdminResult` and `WasmData` diff --git a/HACKING.md b/HACKING.md index 2d8aa7e5..7961ca93 100644 --- a/HACKING.md +++ b/HACKING.md @@ -89,14 +89,14 @@ In the `scripts/` folder, a bunch of blockchains and other backend systems are started for testing purposes. Some ports need to be changed from the default in order to avoid conflicts. Here is an overview of the ports used: -| Port | Application | Usage | -| ----- | --------------------- | ------------------------------------------------------------------------------ | -| 1317 | wasmd LCD API | @cosmjs/launchpad and @cosmjs/cosmwasm tests | -| 1318 | simapp LCD API | Manual Stargate debugging | -| 1319 | wasmd LCD API | Manual Stargate debugging | -| 4444 | socketserver | @cosmjs/sockets tests | -| 4445 | socketserver slow | @cosmjs/sockets tests | -| 11133 | Tendermint 0.33 RPC | @cosmjs/tendermint-rpc tests | -| 11134 | Tendermint 0.34 RPC | @cosmjs/tendermint-rpc tests | -| 26658 | simapp Tendermint RPC | Stargate client tests | -| 26659 | wasmd Tendermint RPC | CosmWasm+Stargate tests ([soon™](https://github.com/cosmos/cosmjs/issues/491)) | +| Port | Application | Usage | +| ----- | --------------------- | ------------------------------------------------------ | +| 1317 | wasmd LCD API | @cosmjs/launchpad and @cosmjs/cosmwasm-launchpad tests | +| 1318 | simapp LCD API | Manual Stargate debugging | +| 1319 | wasmd LCD API | Manual Stargate debugging | +| 4444 | socketserver | @cosmjs/sockets tests | +| 4445 | socketserver slow | @cosmjs/sockets tests | +| 11133 | Tendermint 0.33 RPC | @cosmjs/tendermint-rpc tests | +| 11134 | Tendermint 0.34 RPC | @cosmjs/tendermint-rpc tests | +| 26658 | simapp Tendermint RPC | Stargate client tests | +| 26659 | wasmd Tendermint RPC | @cosmjs/cosmwasm-stargate tests | diff --git a/README.md b/README.md index 93ee6813..18be0d23 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,14 @@ CosmJS is a library that consists of many smaller npm packages within the [@cosmjs namespace](https://www.npmjs.com/org/cosmjs), a so called monorepo. Here are some of them to get an idea: -| Package | Description | Latest | -| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| [@cosmjs/launchpad](packages/launchpad) | A client library for the Cosmos SDK 0.37 (cosmoshub-3), 0.38 and 0.39 (Launchpad) | [![npm version](https://img.shields.io/npm/v/@cosmjs/launchpad.svg)](https://www.npmjs.com/package/@cosmjs/launchpad) | -| [@cosmjs/faucet](packages/faucet) | A faucet application for node.js | [![npm version](https://img.shields.io/npm/v/@cosmjs/faucet.svg)](https://www.npmjs.com/package/@cosmjs/faucet) | -| [@cosmjs/cosmwasm](packages/cosmwasm) | Client for chains with the CosmWasm module enabled | [![npm version](https://img.shields.io/npm/v/@cosmjs/cosmwasm.svg)](https://www.npmjs.com/package/@cosmjs/cosmwasm) | -| [@cosmjs/crypto](packages/crypto) | Cryptography for blockchain projects, e.g. hashing (SHA-2, Keccak256, Ripemd160), signing (secp256k1, ed25519), HD key derivation (BIPO39, SLIP-0010), KDFs and symmetric encryption for key storage (PBKDF2, Argon2, XChaCha20Poly1305) | [![npm version](https://img.shields.io/npm/v/@cosmjs/crypto.svg)](https://www.npmjs.com/package/@cosmjs/crypto) | -| [@cosmjs/encoding](packages/encoding) | Encoding helpers for blockchain projects | [![npm version](https://img.shields.io/npm/v/@cosmjs/encoding.svg)](https://www.npmjs.com/package/@cosmjs/encoding) | -| [@cosmjs/math](packages/math) | Safe integers; decimals for handling financial amounts | [![npm version](https://img.shields.io/npm/v/@cosmjs/math.svg)](https://www.npmjs.com/package/@cosmjs/math) | +| Package | Description | Latest | +| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| [@cosmjs/launchpad](packages/launchpad) | A client library for the Cosmos SDK 0.37 (cosmoshub-3), 0.38 and 0.39 (Launchpad) | [![npm version](https://img.shields.io/npm/v/@cosmjs/launchpad.svg)](https://www.npmjs.com/package/@cosmjs/launchpad) | +| [@cosmjs/faucet](packages/faucet) | A faucet application for node.js | [![npm version](https://img.shields.io/npm/v/@cosmjs/faucet.svg)](https://www.npmjs.com/package/@cosmjs/faucet) | +| [@cosmjs/cosmwasm-launchpad](packages/cosmwasm) | Client for chains with the CosmWasm module enabled | [![npm version](https://img.shields.io/npm/v/@cosmjs/cosmwasm-launchpad.svg)](https://www.npmjs.com/package/@cosmjs/cosmwasm-launchpad) | +| [@cosmjs/crypto](packages/crypto) | Cryptography for blockchain projects, e.g. hashing (SHA-2, Keccak256, Ripemd160), signing (secp256k1, ed25519), HD key derivation (BIPO39, SLIP-0010), KDFs and symmetric encryption for key storage (PBKDF2, Argon2, XChaCha20Poly1305) | [![npm version](https://img.shields.io/npm/v/@cosmjs/crypto.svg)](https://www.npmjs.com/package/@cosmjs/crypto) | +| [@cosmjs/encoding](packages/encoding) | Encoding helpers for blockchain projects | [![npm version](https://img.shields.io/npm/v/@cosmjs/encoding.svg)](https://www.npmjs.com/package/@cosmjs/encoding) | +| [@cosmjs/math](packages/math) | Safe integers; decimals for handling financial amounts | [![npm version](https://img.shields.io/npm/v/@cosmjs/math.svg)](https://www.npmjs.com/package/@cosmjs/math) | ### Modularity diff --git a/packages/cli/package.json b/packages/cli/package.json index a96aa2c6..653bfd60 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -40,7 +40,7 @@ "!**/testdata/" ], "dependencies": { - "@cosmjs/cosmwasm": "^0.24.0-alpha.10", + "@cosmjs/cosmwasm-launchpad": "^0.24.0-alpha.10", "@cosmjs/crypto": "^0.24.0-alpha.10", "@cosmjs/encoding": "^0.24.0-alpha.10", "@cosmjs/faucet-client": "^0.24.0-alpha.10", diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index c0605d88..efbf55d1 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -37,7 +37,7 @@ export async function main(originalArgs: readonly string[]): Promise { const imports = new Map([ [ - "@cosmjs/cosmwasm", + "@cosmjs/cosmwasm-launchpad", [ // cosmwasmclient "Account", diff --git a/packages/cosmwasm-launchpad/.eslintignore b/packages/cosmwasm-launchpad/.eslintignore new file mode 120000 index 00000000..86039baf --- /dev/null +++ b/packages/cosmwasm-launchpad/.eslintignore @@ -0,0 +1 @@ +../../.eslintignore \ No newline at end of file diff --git a/packages/cosmwasm-launchpad/.gitignore b/packages/cosmwasm-launchpad/.gitignore new file mode 100644 index 00000000..68bf3735 --- /dev/null +++ b/packages/cosmwasm-launchpad/.gitignore @@ -0,0 +1,3 @@ +build/ +dist/ +docs/ diff --git a/packages/cosmwasm/.nycrc.yml b/packages/cosmwasm-launchpad/.nycrc.yml similarity index 100% rename from packages/cosmwasm/.nycrc.yml rename to packages/cosmwasm-launchpad/.nycrc.yml diff --git a/packages/cosmwasm-launchpad/README.md b/packages/cosmwasm-launchpad/README.md new file mode 100644 index 00000000..32f1915c --- /dev/null +++ b/packages/cosmwasm-launchpad/README.md @@ -0,0 +1,30 @@ +# @cosmjs/cosmwasm-launchpad + +[![npm version](https://img.shields.io/npm/v/@cosmjs/cosmwasm-launchpad.svg)](https://www.npmjs.com/package/@cosmjs/cosmwasm-launchpad) + +An SDK to build CosmWasm clients. + +## Compatibility + +| CosmWasm | x/wasm | @cosmjs/cosmwasm-launchpad | +| --------- | --------- | -------------------------- | +| 0.10-0.11 | 0.10-0.11 | `^0.23.0` | +| 0.10 | 0.10 | `^0.22.0` | +| 0.9 | 0.9 | `^0.21.0` | +| 0.8 | 0.8 | `^0.20.1` | + +## Development + +Updating Hackatom development contract in `src/testdata/contract.json`: + +```sh +cd packages/cosmwasm-launchpad +export HACKATOM_URL=https://github.com/CosmWasm/cosmwasm-launchpad/releases/download/v0.11.0-alpha4/hackatom.wasm +echo "{\"// source\": \"$HACKATOM_URL\", \"data\": \"$(curl -sS --location $HACKATOM_URL | base64)\" }" | jq > src/testdata/contract.json +``` + +## License + +This package is part of the cosmjs repository, licensed under the Apache License +2.0 (see [NOTICE](https://github.com/CosmWasm/cosmjs/blob/master/NOTICE) and +[LICENSE](https://github.com/CosmWasm/cosmjs/blob/master/LICENSE)). diff --git a/packages/cosmwasm/jasmine-testrunner.js b/packages/cosmwasm-launchpad/jasmine-testrunner.js similarity index 100% rename from packages/cosmwasm/jasmine-testrunner.js rename to packages/cosmwasm-launchpad/jasmine-testrunner.js diff --git a/packages/cosmwasm/karma.conf.js b/packages/cosmwasm-launchpad/karma.conf.js similarity index 100% rename from packages/cosmwasm/karma.conf.js rename to packages/cosmwasm-launchpad/karma.conf.js diff --git a/packages/cosmwasm-launchpad/nonces/README.txt b/packages/cosmwasm-launchpad/nonces/README.txt new file mode 100644 index 00000000..092fe732 --- /dev/null +++ b/packages/cosmwasm-launchpad/nonces/README.txt @@ -0,0 +1 @@ +Directory used to trigger lerna package updates for all packages diff --git a/packages/cosmwasm-launchpad/package.json b/packages/cosmwasm-launchpad/package.json new file mode 100644 index 00000000..d5ca2781 --- /dev/null +++ b/packages/cosmwasm-launchpad/package.json @@ -0,0 +1,57 @@ +{ + "name": "@cosmjs/cosmwasm-launchpad", + "version": "0.24.0-alpha.10", + "description": "CosmWasm SDK for Launchpad", + "contributors": [ + "Ethan Frey ", + "Will Clark " + ], + "license": "Apache-2.0", + "main": "build/index.js", + "types": "types/index.d.ts", + "files": [ + "build/", + "types/", + "*.md", + "!*.spec.*", + "!**/testdata/" + ], + "repository": { + "type": "git", + "url": "https://github.com/CosmWasm/cosmjs/tree/master/packages/cosmwasm-launchpad" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "docs": "typedoc --options typedoc.js", + "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", + "format-text": "prettier --write --prose-wrap always --print-width 80 \"./*.md\"", + "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"", + "lint-fix": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix", + "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && shx rm -rf ./types/testdata ./types/*.spec.d.ts ./types/*/*.spec.d.ts", + "format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", + "prebuild": "shx rm -rf ./build", + "build": "tsc", + "postbuild": "yarn move-types && yarn format-types", + "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", + "test-node": "node jasmine-testrunner.js", + "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox", + "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless", + "test": "yarn build-or-skip && yarn test-node", + "coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet", + "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js" + }, + "dependencies": { + "@cosmjs/crypto": "^0.24.0-alpha.10", + "@cosmjs/encoding": "^0.24.0-alpha.10", + "@cosmjs/launchpad": "^0.24.0-alpha.10", + "@cosmjs/math": "^0.24.0-alpha.10", + "@cosmjs/utils": "^0.24.0-alpha.10", + "pako": "^2.0.2" + }, + "devDependencies": { + "@types/pako": "^1.0.1", + "readonly-date": "^1.0.0" + } +} diff --git a/packages/cosmwasm/src/builder.spec.ts b/packages/cosmwasm-launchpad/src/builder.spec.ts similarity index 100% rename from packages/cosmwasm/src/builder.spec.ts rename to packages/cosmwasm-launchpad/src/builder.spec.ts diff --git a/packages/cosmwasm/src/builder.ts b/packages/cosmwasm-launchpad/src/builder.ts similarity index 100% rename from packages/cosmwasm/src/builder.ts rename to packages/cosmwasm-launchpad/src/builder.ts diff --git a/packages/cosmwasm/src/cosmosmsg.ts b/packages/cosmwasm-launchpad/src/cosmosmsg.ts similarity index 100% rename from packages/cosmwasm/src/cosmosmsg.ts rename to packages/cosmwasm-launchpad/src/cosmosmsg.ts diff --git a/packages/cosmwasm/src/cosmwasmclient.searchtx.spec.ts b/packages/cosmwasm-launchpad/src/cosmwasmclient.searchtx.spec.ts similarity index 100% rename from packages/cosmwasm/src/cosmwasmclient.searchtx.spec.ts rename to packages/cosmwasm-launchpad/src/cosmwasmclient.searchtx.spec.ts diff --git a/packages/cosmwasm/src/cosmwasmclient.spec.ts b/packages/cosmwasm-launchpad/src/cosmwasmclient.spec.ts similarity index 100% rename from packages/cosmwasm/src/cosmwasmclient.spec.ts rename to packages/cosmwasm-launchpad/src/cosmwasmclient.spec.ts diff --git a/packages/cosmwasm/src/cosmwasmclient.ts b/packages/cosmwasm-launchpad/src/cosmwasmclient.ts similarity index 100% rename from packages/cosmwasm/src/cosmwasmclient.ts rename to packages/cosmwasm-launchpad/src/cosmwasmclient.ts diff --git a/packages/cosmwasm/src/cw1cosmwasmclient.spec.ts b/packages/cosmwasm-launchpad/src/cw1cosmwasmclient.spec.ts similarity index 100% rename from packages/cosmwasm/src/cw1cosmwasmclient.spec.ts rename to packages/cosmwasm-launchpad/src/cw1cosmwasmclient.spec.ts diff --git a/packages/cosmwasm/src/cw1cosmwasmclient.ts b/packages/cosmwasm-launchpad/src/cw1cosmwasmclient.ts similarity index 100% rename from packages/cosmwasm/src/cw1cosmwasmclient.ts rename to packages/cosmwasm-launchpad/src/cw1cosmwasmclient.ts diff --git a/packages/cosmwasm/src/cw1subkeycosmwasmclient.spec.ts b/packages/cosmwasm-launchpad/src/cw1subkeycosmwasmclient.spec.ts similarity index 100% rename from packages/cosmwasm/src/cw1subkeycosmwasmclient.spec.ts rename to packages/cosmwasm-launchpad/src/cw1subkeycosmwasmclient.spec.ts diff --git a/packages/cosmwasm/src/cw1subkeycosmwasmclient.ts b/packages/cosmwasm-launchpad/src/cw1subkeycosmwasmclient.ts similarity index 100% rename from packages/cosmwasm/src/cw1subkeycosmwasmclient.ts rename to packages/cosmwasm-launchpad/src/cw1subkeycosmwasmclient.ts diff --git a/packages/cosmwasm/src/cw3cosmwasmclient.spec.ts b/packages/cosmwasm-launchpad/src/cw3cosmwasmclient.spec.ts similarity index 100% rename from packages/cosmwasm/src/cw3cosmwasmclient.spec.ts rename to packages/cosmwasm-launchpad/src/cw3cosmwasmclient.spec.ts diff --git a/packages/cosmwasm/src/cw3cosmwasmclient.ts b/packages/cosmwasm-launchpad/src/cw3cosmwasmclient.ts similarity index 100% rename from packages/cosmwasm/src/cw3cosmwasmclient.ts rename to packages/cosmwasm-launchpad/src/cw3cosmwasmclient.ts diff --git a/packages/cosmwasm-launchpad/src/index.ts b/packages/cosmwasm-launchpad/src/index.ts new file mode 100644 index 00000000..051d36bc --- /dev/null +++ b/packages/cosmwasm-launchpad/src/index.ts @@ -0,0 +1,59 @@ +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"; diff --git a/packages/cosmwasm/src/interfaces/cw0.ts b/packages/cosmwasm-launchpad/src/interfaces/cw0.ts similarity index 100% rename from packages/cosmwasm/src/interfaces/cw0.ts rename to packages/cosmwasm-launchpad/src/interfaces/cw0.ts diff --git a/packages/cosmwasm/src/interfaces/index.ts b/packages/cosmwasm-launchpad/src/interfaces/index.ts similarity index 100% rename from packages/cosmwasm/src/interfaces/index.ts rename to packages/cosmwasm-launchpad/src/interfaces/index.ts diff --git a/packages/cosmwasm/src/lcdapi/wasm.spec.ts b/packages/cosmwasm-launchpad/src/lcdapi/wasm.spec.ts similarity index 100% rename from packages/cosmwasm/src/lcdapi/wasm.spec.ts rename to packages/cosmwasm-launchpad/src/lcdapi/wasm.spec.ts diff --git a/packages/cosmwasm/src/lcdapi/wasm.ts b/packages/cosmwasm-launchpad/src/lcdapi/wasm.ts similarity index 100% rename from packages/cosmwasm/src/lcdapi/wasm.ts rename to packages/cosmwasm-launchpad/src/lcdapi/wasm.ts diff --git a/packages/cosmwasm/src/msgs.ts b/packages/cosmwasm-launchpad/src/msgs.ts similarity index 100% rename from packages/cosmwasm/src/msgs.ts rename to packages/cosmwasm-launchpad/src/msgs.ts diff --git a/packages/cosmwasm/src/signingcosmwasmclient.spec.ts b/packages/cosmwasm-launchpad/src/signingcosmwasmclient.spec.ts similarity index 100% rename from packages/cosmwasm/src/signingcosmwasmclient.spec.ts rename to packages/cosmwasm-launchpad/src/signingcosmwasmclient.spec.ts diff --git a/packages/cosmwasm/src/signingcosmwasmclient.ts b/packages/cosmwasm-launchpad/src/signingcosmwasmclient.ts similarity index 100% rename from packages/cosmwasm/src/signingcosmwasmclient.ts rename to packages/cosmwasm-launchpad/src/signingcosmwasmclient.ts diff --git a/packages/cosmwasm/src/testdata/contract.json b/packages/cosmwasm-launchpad/src/testdata/contract.json similarity index 100% rename from packages/cosmwasm/src/testdata/contract.json rename to packages/cosmwasm-launchpad/src/testdata/contract.json diff --git a/packages/cosmwasm/src/testdata/cosmoshub.json b/packages/cosmwasm-launchpad/src/testdata/cosmoshub.json similarity index 100% rename from packages/cosmwasm/src/testdata/cosmoshub.json rename to packages/cosmwasm-launchpad/src/testdata/cosmoshub.json diff --git a/packages/cosmwasm/src/testutils.spec.ts b/packages/cosmwasm-launchpad/src/testutils.spec.ts similarity index 100% rename from packages/cosmwasm/src/testutils.spec.ts rename to packages/cosmwasm-launchpad/src/testutils.spec.ts diff --git a/packages/cosmwasm/src/types.ts b/packages/cosmwasm-launchpad/src/types.ts similarity index 100% rename from packages/cosmwasm/src/types.ts rename to packages/cosmwasm-launchpad/src/types.ts diff --git a/packages/cosmwasm-launchpad/tsconfig.json b/packages/cosmwasm-launchpad/tsconfig.json new file mode 100644 index 00000000..167e8c02 --- /dev/null +++ b/packages/cosmwasm-launchpad/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "build", + "declarationDir": "build/types", + "rootDir": "src" + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/cosmwasm-launchpad/typedoc.js b/packages/cosmwasm-launchpad/typedoc.js new file mode 100644 index 00000000..4dfbe49d --- /dev/null +++ b/packages/cosmwasm-launchpad/typedoc.js @@ -0,0 +1,13 @@ +const packageJson = require("./package.json"); + +module.exports = { + inputFiles: ["./src"], + out: "docs", + exclude: "**/*.spec.ts", + name: `${packageJson.name} Documentation`, + readme: "README.md", + mode: "file", + excludeExternals: true, + excludeNotExported: true, + excludePrivate: true, +}; diff --git a/packages/cosmwasm/types/builder.d.ts b/packages/cosmwasm-launchpad/types/builder.d.ts similarity index 100% rename from packages/cosmwasm/types/builder.d.ts rename to packages/cosmwasm-launchpad/types/builder.d.ts diff --git a/packages/cosmwasm/types/cosmosmsg.d.ts b/packages/cosmwasm-launchpad/types/cosmosmsg.d.ts similarity index 100% rename from packages/cosmwasm/types/cosmosmsg.d.ts rename to packages/cosmwasm-launchpad/types/cosmosmsg.d.ts diff --git a/packages/cosmwasm/types/cosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cosmwasmclient.d.ts similarity index 100% rename from packages/cosmwasm/types/cosmwasmclient.d.ts rename to packages/cosmwasm-launchpad/types/cosmwasmclient.d.ts diff --git a/packages/cosmwasm/types/cw1cosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cw1cosmwasmclient.d.ts similarity index 100% rename from packages/cosmwasm/types/cw1cosmwasmclient.d.ts rename to packages/cosmwasm-launchpad/types/cw1cosmwasmclient.d.ts diff --git a/packages/cosmwasm/types/cw1subkeycosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cw1subkeycosmwasmclient.d.ts similarity index 100% rename from packages/cosmwasm/types/cw1subkeycosmwasmclient.d.ts rename to packages/cosmwasm-launchpad/types/cw1subkeycosmwasmclient.d.ts diff --git a/packages/cosmwasm/types/cw3cosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/cw3cosmwasmclient.d.ts similarity index 100% rename from packages/cosmwasm/types/cw3cosmwasmclient.d.ts rename to packages/cosmwasm-launchpad/types/cw3cosmwasmclient.d.ts diff --git a/packages/cosmwasm-launchpad/types/index.d.ts b/packages/cosmwasm-launchpad/types/index.d.ts new file mode 100644 index 00000000..3b86b7c0 --- /dev/null +++ b/packages/cosmwasm-launchpad/types/index.d.ts @@ -0,0 +1,58 @@ +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"; diff --git a/packages/cosmwasm/types/interfaces/cw0.d.ts b/packages/cosmwasm-launchpad/types/interfaces/cw0.d.ts similarity index 100% rename from packages/cosmwasm/types/interfaces/cw0.d.ts rename to packages/cosmwasm-launchpad/types/interfaces/cw0.d.ts diff --git a/packages/cosmwasm/types/interfaces/index.d.ts b/packages/cosmwasm-launchpad/types/interfaces/index.d.ts similarity index 100% rename from packages/cosmwasm/types/interfaces/index.d.ts rename to packages/cosmwasm-launchpad/types/interfaces/index.d.ts diff --git a/packages/cosmwasm/types/lcdapi/wasm.d.ts b/packages/cosmwasm-launchpad/types/lcdapi/wasm.d.ts similarity index 100% rename from packages/cosmwasm/types/lcdapi/wasm.d.ts rename to packages/cosmwasm-launchpad/types/lcdapi/wasm.d.ts diff --git a/packages/cosmwasm/types/msgs.d.ts b/packages/cosmwasm-launchpad/types/msgs.d.ts similarity index 100% rename from packages/cosmwasm/types/msgs.d.ts rename to packages/cosmwasm-launchpad/types/msgs.d.ts diff --git a/packages/cosmwasm/types/signingcosmwasmclient.d.ts b/packages/cosmwasm-launchpad/types/signingcosmwasmclient.d.ts similarity index 100% rename from packages/cosmwasm/types/signingcosmwasmclient.d.ts rename to packages/cosmwasm-launchpad/types/signingcosmwasmclient.d.ts diff --git a/packages/cosmwasm/types/types.d.ts b/packages/cosmwasm-launchpad/types/types.d.ts similarity index 100% rename from packages/cosmwasm/types/types.d.ts rename to packages/cosmwasm-launchpad/types/types.d.ts diff --git a/packages/cosmwasm/webpack.web.config.js b/packages/cosmwasm-launchpad/webpack.web.config.js similarity index 100% rename from packages/cosmwasm/webpack.web.config.js rename to packages/cosmwasm-launchpad/webpack.web.config.js diff --git a/packages/cosmwasm-stargate/package.json b/packages/cosmwasm-stargate/package.json index dc720204..2e09a534 100644 --- a/packages/cosmwasm-stargate/package.json +++ b/packages/cosmwasm-stargate/package.json @@ -48,7 +48,7 @@ "postdefine-proto": "prettier --write \"src/codec/generated/codecimpl.*\"" }, "dependencies": { - "@cosmjs/cosmwasm": "^0.24.0-alpha.10", + "@cosmjs/cosmwasm-launchpad": "^0.24.0-alpha.10", "@cosmjs/crypto": "^0.24.0-alpha.10", "@cosmjs/encoding": "^0.24.0-alpha.10", "@cosmjs/launchpad": "^0.24.0-alpha.10", diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts index e1a6f6eb..bbd7cdf5 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { Code } from "@cosmjs/cosmwasm"; +import { Code } from "@cosmjs/cosmwasm-launchpad"; import { sha256 } from "@cosmjs/crypto"; import { Bech32, fromAscii, fromBase64, fromHex, toAscii, toBase64 } from "@cosmjs/encoding"; import { coins, logs, StdFee } from "@cosmjs/launchpad"; diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.ts index ab81b3ff..e99b41ce 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.ts @@ -1,5 +1,11 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { Code, CodeDetails, Contract, ContractCodeHistoryEntry, JsonObject } from "@cosmjs/cosmwasm"; +import { + Code, + CodeDetails, + Contract, + ContractCodeHistoryEntry, + JsonObject, +} from "@cosmjs/cosmwasm-launchpad"; import { fromAscii, toHex } from "@cosmjs/encoding"; import { Block, diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts index 2bc3b8ce..83625076 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { UploadMeta } from "@cosmjs/cosmwasm"; +import { UploadMeta } from "@cosmjs/cosmwasm-launchpad"; import { sha256 } from "@cosmjs/crypto"; import { toHex } from "@cosmjs/encoding"; import { coin, coins, GasPrice } from "@cosmjs/launchpad"; diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts index f310147b..08c1805b 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts @@ -9,7 +9,7 @@ import { MigrateResult, UploadMeta, UploadResult, -} from "@cosmjs/cosmwasm"; +} from "@cosmjs/cosmwasm-launchpad"; import { sha256 } from "@cosmjs/crypto"; import { fromBase64, toAscii, toHex } from "@cosmjs/encoding"; import { diff --git a/packages/cosmwasm-stargate/types/cosmwasmclient.d.ts b/packages/cosmwasm-stargate/types/cosmwasmclient.d.ts index 60f63c08..e17bab72 100644 --- a/packages/cosmwasm-stargate/types/cosmwasmclient.d.ts +++ b/packages/cosmwasm-stargate/types/cosmwasmclient.d.ts @@ -1,4 +1,10 @@ -import { Code, CodeDetails, Contract, ContractCodeHistoryEntry, JsonObject } from "@cosmjs/cosmwasm"; +import { + Code, + CodeDetails, + Contract, + ContractCodeHistoryEntry, + JsonObject, +} from "@cosmjs/cosmwasm-launchpad"; import { Block, Coin, SearchTxFilter, SearchTxQuery } from "@cosmjs/launchpad"; import { Account, diff --git a/packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts b/packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts index 1b7cc383..9bd1dcf6 100644 --- a/packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts +++ b/packages/cosmwasm-stargate/types/signingcosmwasmclient.d.ts @@ -7,7 +7,7 @@ import { MigrateResult, UploadMeta, UploadResult, -} from "@cosmjs/cosmwasm"; +} from "@cosmjs/cosmwasm-launchpad"; import { Coin, CosmosFeeTable, GasLimits, GasPrice, StdFee } from "@cosmjs/launchpad"; import { EncodeObject, OfflineSigner, Registry } from "@cosmjs/proto-signing"; import { BroadcastTxResponse } from "@cosmjs/stargate"; diff --git a/packages/cosmwasm/README.md b/packages/cosmwasm/README.md index 46beca1c..8e70d75b 100644 --- a/packages/cosmwasm/README.md +++ b/packages/cosmwasm/README.md @@ -1,30 +1,5 @@ # @cosmjs/cosmwasm -[![npm version](https://img.shields.io/npm/v/@cosmjs/cosmwasm.svg)](https://www.npmjs.com/package/@cosmjs/cosmwasm) - -An SDK to build CosmWasm clients. - -## Compatibility - -| CosmWasm | x/wasm | @cosmjs/cosmwasm | -| --------- | --------- | ---------------- | -| 0.10-0.11 | 0.10-0.11 | `^0.23.0` | -| 0.10 | 0.10 | `^0.22.0` | -| 0.9 | 0.9 | `^0.21.0` | -| 0.8 | 0.8 | `^0.20.1` | - -## Development - -Updating Hackatom development contract in `src/testdata/contract.json`: - -```sh -cd packages/cosmwasm -export HACKATOM_URL=https://github.com/CosmWasm/cosmwasm/releases/download/v0.11.0-alpha4/hackatom.wasm -echo "{\"// source\": \"$HACKATOM_URL\", \"data\": \"$(curl -sS --location $HACKATOM_URL | base64)\" }" | jq > src/testdata/contract.json -``` - -## License - -This package is part of the cosmjs repository, licensed under the Apache License -2.0 (see [NOTICE](https://github.com/CosmWasm/cosmjs/blob/master/NOTICE) and -[LICENSE](https://github.com/CosmWasm/cosmjs/blob/master/LICENSE)). +This package is deprecated and simply wraps `@cosmjs/cosmwasm-launchpad`, which +should be used for Launchpad support. At some point in the future this package +name will be used for a Stargate-compatible CosmWasm package. diff --git a/packages/cosmwasm/package.json b/packages/cosmwasm/package.json index a9e21f9d..93a093b9 100644 --- a/packages/cosmwasm/package.json +++ b/packages/cosmwasm/package.json @@ -2,7 +2,10 @@ "name": "@cosmjs/cosmwasm", "version": "0.24.0-alpha.10", "description": "CosmWasm SDK", - "author": "Ethan Frey ", + "contributors": [ + "Ethan Frey ", + "Will Clark " + ], "license": "Apache-2.0", "main": "build/index.js", "types": "types/index.d.ts", @@ -26,29 +29,14 @@ "format-text": "prettier --write --prose-wrap always --print-width 80 \"./*.md\"", "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"", "lint-fix": "eslint --max-warnings 0 \"**/*.{js,ts}\" --fix", - "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types && shx rm -rf ./types/testdata ./types/*.spec.d.ts ./types/*/*.spec.d.ts", + "move-types": "shx rm -rf ./types/* && shx mv build/types/* ./types", "format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", "prebuild": "shx rm -rf ./build", "build": "tsc", "postbuild": "yarn move-types && yarn format-types", - "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", - "test-node": "node jasmine-testrunner.js", - "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox", - "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless", - "test": "yarn build-or-skip && yarn test-node", - "coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet", - "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js" + "build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build" }, "dependencies": { - "@cosmjs/crypto": "^0.24.0-alpha.10", - "@cosmjs/encoding": "^0.24.0-alpha.10", - "@cosmjs/launchpad": "^0.24.0-alpha.10", - "@cosmjs/math": "^0.24.0-alpha.10", - "@cosmjs/utils": "^0.24.0-alpha.10", - "pako": "^2.0.2" - }, - "devDependencies": { - "@types/pako": "^1.0.1", - "readonly-date": "^1.0.0" + "@cosmjs/cosmwasm-launchpad": "^0.24.0-alpha.10" } } diff --git a/packages/cosmwasm/src/index.ts b/packages/cosmwasm/src/index.ts index 051d36bc..bdad471c 100644 --- a/packages/cosmwasm/src/index.ts +++ b/packages/cosmwasm/src/index.ts @@ -1,59 +1 @@ -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"; +export * from "@cosmjs/cosmwasm-launchpad"; diff --git a/packages/cosmwasm/types/index.d.ts b/packages/cosmwasm/types/index.d.ts index 3b86b7c0..bdad471c 100644 --- a/packages/cosmwasm/types/index.d.ts +++ b/packages/cosmwasm/types/index.d.ts @@ -1,58 +1 @@ -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"; +export * from "@cosmjs/cosmwasm-launchpad"; diff --git a/packages/launchpad/README.md b/packages/launchpad/README.md index 1319965b..13a31a81 100644 --- a/packages/launchpad/README.md +++ b/packages/launchpad/README.md @@ -169,7 +169,10 @@ allows applications to add their extensions without changing CosmJS. As an example we show how to build a client for a blockchain with a wasm module: ```ts -import { MsgExecuteContract, setupWasmExtension } from "@cosmjs/cosmwasm"; +import { + MsgExecuteContract, + setupWasmExtension, +} from "@cosmjs/cosmwasm-launchpad"; import { assertIsBroadcastTxResult, LcdClient, diff --git a/scripts/launchpad/deploy_cw1.js b/scripts/launchpad/deploy_cw1.js index 5a29333d..613697c2 100755 --- a/scripts/launchpad/deploy_cw1.js +++ b/scripts/launchpad/deploy_cw1.js @@ -1,7 +1,7 @@ #!/usr/bin/env node /* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); +const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-launchpad"); const { Secp256k1HdWallet } = require("@cosmjs/launchpad"); const fs = require("fs"); diff --git a/scripts/launchpad/deploy_cw3.js b/scripts/launchpad/deploy_cw3.js index 38efddab..465d2ae3 100755 --- a/scripts/launchpad/deploy_cw3.js +++ b/scripts/launchpad/deploy_cw3.js @@ -1,7 +1,7 @@ #!/usr/bin/env node /* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); +const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-launchpad"); const { Secp256k1HdWallet } = require("@cosmjs/launchpad"); const fs = require("fs"); diff --git a/scripts/launchpad/deploy_erc20.js b/scripts/launchpad/deploy_erc20.js index ec45e679..87946679 100755 --- a/scripts/launchpad/deploy_erc20.js +++ b/scripts/launchpad/deploy_erc20.js @@ -1,7 +1,7 @@ #!/usr/bin/env node /* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); +const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-launchpad"); const { Secp256k1HdWallet } = require("@cosmjs/launchpad"); const fs = require("fs"); diff --git a/scripts/launchpad/deploy_hackatom.js b/scripts/launchpad/deploy_hackatom.js index b1040861..a9dc6dcb 100755 --- a/scripts/launchpad/deploy_hackatom.js +++ b/scripts/launchpad/deploy_hackatom.js @@ -1,7 +1,7 @@ #!/usr/bin/env node /* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); +const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-launchpad"); const { Secp256k1HdWallet } = require("@cosmjs/launchpad"); const fs = require("fs"); diff --git a/scripts/launchpad/deploy_nameservice.js b/scripts/launchpad/deploy_nameservice.js index fac379b5..112879ae 100755 --- a/scripts/launchpad/deploy_nameservice.js +++ b/scripts/launchpad/deploy_nameservice.js @@ -1,7 +1,7 @@ #!/usr/bin/env node /* eslint-disable @typescript-eslint/naming-convention */ -const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm"); +const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-launchpad"); const { Secp256k1HdWallet } = require("@cosmjs/launchpad"); const fs = require("fs");