Skip to content

Commit

Permalink
fix: correct changelog links
Browse files Browse the repository at this point in the history
  • Loading branch information
prnk28 committed Dec 6, 2024
1 parent f06e4d9 commit 55e7370
Show file tree
Hide file tree
Showing 180 changed files with 652 additions and 404 deletions.
14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

### Improvements

- Txs are now broadcasted directly via the user-specified RPC instead of via the wallet (closes <https://github.com/coinhall/cosmes/issues/17>)
- Txs are now broadcasted directly via the user-specified RPC instead of via the wallet (closes <https://github.com/coinhall/@onsonr/es/issues/17>)
- Update Station extension to use Keplr's API interface

## `v0.0.60`
Expand Down Expand Up @@ -150,7 +150,7 @@

### Features

- Added the `verifyArbitrary` helper function (exported by `cosmes/wallet`) to verify signatures signed using `ConnectedWallet.signArbitrary`
- Added the `verifyArbitrary` helper function (exported by `@onsonr/es/wallet`) to verify signatures signed using `ConnectedWallet.signArbitrary`

### Fixes

Expand Down Expand Up @@ -237,16 +237,16 @@

### Miscellaneous

- Removed the various `fromXxxToYyy` encoding/decoding functions within `cosmes/codec` in favour of `@scure/base` **[breaking change]**
- The `@scure/base` pkg is re-exported in `cosmes/codec`
- Consumers should import the correct encoder or decoder directly from `cosmes/codec`: eg. change `fromHexToUint8Array(...)` to `base16.decode(...)`
- Re-exported `@keplr-wallet/types` from `cosmes/registry`
- Removed the various `fromXxxToYyy` encoding/decoding functions within `@onsonr/es/codec` in favour of `@scure/base` **[breaking change]**
- The `@scure/base` pkg is re-exported in `@onsonr/es/codec`
- Consumers should import the correct encoder or decoder directly from `@onsonr/es/codec`: eg. change `fromHexToUint8Array(...)` to `base16.decode(...)`
- Re-exported `@keplr-wallet/types` from `@onsonr/es/registry`

## `v0.0.35`

### Features

- Added the `cosmes/registry` package with the following additions:
- Added the `@onsonr/es/registry` package with the following additions:
- APIs to dynamically query for data in Chain Registry
- Util function to transform Chain Registry data to Keplr's chain info

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

This is a [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c), written in TypeScript and managed by [pnpm](https://pnpm.io).

- [`/benchmarks`](./benchmarks) - contains bundle size comparisons between `cosmes` and other packages like Cosmos Kit
- [`/examples`](./examples) - contains example applications that consume from the `cosmes` package
- [`/benchmarks`](./benchmarks) - contains bundle size comparisons between `@onsonr/es` and other packages like Cosmos Kit
- [`/examples`](./examples) - contains example applications that consume from the `@onsonr/es` package
- [`/scripts`](./scripts) - contains internal scripts for use in this monorepo
- [`/src`](./src) - contains the source code for the `cosmes` package
- [`/src`](./src) - contains the source code for the `@onsonr/es` package

## Getting Started

Expand Down Expand Up @@ -54,9 +54,9 @@ pnpm add --save-peer [dependency_name]

### Developing

All examples in the `/examples` directory are independent packages that contain a symlink to the root `cosmes` package. This allows us to develop the `cosmes` package and test it in the examples at the same time.
All examples in the `/examples` directory are independent packages that contain a symlink to the root `@onsonr/es` package. This allows us to develop the `@onsonr/es` package and test it in the examples at the same time.

Firstly, to watch the `cosmes` package and rebuild on changes, run the following in the root of the project:
Firstly, to watch the `@onsonr/es` package and rebuild on changes, run the following in the root of the project:

```sh
# Run `pnpm build` first if this is your first time running this command
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# SonrES

[![npm version](https://badge.fury.io/js/cosmes.svg)](https://www.npmjs.com/package/@onsonr/es)
[![npm version](https://badge.fury.io/js/@onsonr/es.svg)](https://www.npmjs.com/package/@onsonr/es)

A tree-shakeable, framework agnostic, [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) alternative of [CosmJS](https://github.com/cosmos/cosmjs) and [Cosmos Kit](https://cosmoskit.com) (**generate bundles up to 10x smaller than Cosmos Kit**).

Expand All @@ -13,11 +13,11 @@ A tree-shakeable, framework agnostic, [pure ESM](https://gist.github.com/sindres
- [Using Station wallet](#using-station-wallet)
- [Examples](#examples)
- [Modules](#modules)
- [`cosmes/client`](#cosmesclient)
- [`cosmes/codec`](#cosmescodec)
- [`cosmes/protobufs`](#cosmesprotobufs)
- [`cosmes/registry`](#cosmesregistry)
- [`cosmes/wallet`](#cosmeswallet)
- [`@onsonr/es/client`](#@onsonr/esclient)
- [`@onsonr/es/codec`](#@onsonr/escodec)
- [`@onsonr/es/protobufs`](#@onsonr/esprotobufs)
- [`@onsonr/es/registry`](#@onsonr/esregistry)
- [`@onsonr/es/wallet`](#@onsonr/eswallet)
- [Benchmarks](#benchmarks)
- [Results](#results)
- [See More](#see-more)
Expand All @@ -39,27 +39,27 @@ A tree-shakeable, framework agnostic, [pure ESM](https://gist.github.com/sindres
For Cosmos SDK v0.47 and below:

```sh
npm install cosmes
npm install @onsonr/es

pnpm add cosmes
pnpm add @onsonr/es

yarn add cosmes
yarn add @onsonr/es
```

For Cosmos SDK v0.50, install using the `sdk50` tag:

```sh
npm install cosmes@sdk50
npm install @onsonr/es@sdk50

pnpm add cosmes@sdk50
pnpm add @onsonr/es@sdk50

yarn add cosmes@sdk50
yarn add @onsonr/es@sdk50
```

> [!IMPORTANT]
> The bump from v0.47 to v0.50 introduces significant breaking changes and is not recommended to be used unless necessary. To reduce the impact on consumers, the `main` branch and the published package on npm with the `latest` tag will continue to target v0.47 until the majority of live chains have migrated to v0.50.
>
> The [`parallel/sdk50`](https://github.com/coinhall/cosmes/tree/parallel/sdk50) branch targetting v0.50 will be developed and maintained in parallel with the `main` branch, where the same patch version number should have feature parity (eg. `cosmes@0.0.69` should have the same features as `cosmes@0.0.69-sdk50.0`).
> The [`parallel/sdk50`](https://github.com/coinhall/@onsonr/es/tree/parallel/sdk50) branch targetting v0.50 will be developed and maintained in parallel with the `main` branch, where the same patch version number should have feature parity (eg. `@onsonr/es@0.0.69` should have the same features as `@onsonr/es@0.0.69-sdk50.0`).
### Using with TypeScript

Expand Down Expand Up @@ -121,25 +121,25 @@ Docs do not exist yet - see the [`examples`](./examples) folder for various work

## Modules

This package is split into multiple subdirectories, with each subdirectory having their own set of functionalities. The root directory does not contain any exports, and all exports are exported from the subdirectories. Thus, imports must be done by referencing the subdirectories (ie. `import { ... } from "cosmes/client"`).
This package is split into multiple subdirectories, with each subdirectory having their own set of functionalities. The root directory does not contain any exports, and all exports are exported from the subdirectories. Thus, imports must be done by referencing the subdirectories (ie. `import { ... } from "@onsonr/es/client"`).

### `cosmes/client`
### `@onsonr/es/client`

This directory contains models and helper functions to interact with Cosmos SDK via the [CometBFT RPC](https://docs.cosmos.network/v0.50/core/grpc_rest#cometbft-rpc).

### `cosmes/codec`
### `@onsonr/es/codec`

This directory contains various encoding and decoding functions that relies solely on [Web APIs](https://developer.mozilla.org/en-US/docs/Web/API) and has no dependencies on Node.js. For modern browsers and Node v16+, this should work out of the box.

### `cosmes/protobufs`
### `@onsonr/es/protobufs`

This directory contains the auto-generated code for various Cosmos SDK based protobufs. See `scripts/gen-protobufs.mjs` for the script that generates the code.

### `cosmes/registry`
### `@onsonr/es/registry`

This directory contains various APIs, data, and types needed for wallet interactions (ie. Keplr). Some types are auto-generated, see `scripts/gen-registry.mjs` for the script that generates the types.

### `cosmes/wallet`
### `@onsonr/es/wallet`

This directory is a [Cosmos Kit](https://cosmoskit.com) alternative to interact with wallets across all Cosmos SDK based blockchains. See [`examples/solid-vite`](./examples/solid-vite) for a working example.

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/cosmes-react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CosmES Benchmark</title>
<title>@onsonr/es Benchmark</title>
</head>
<body>
<div id="root"></div>
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/cosmes-react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cosmes-react",
"name": "@onsonr/es-react",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"cosmes": "link:../..",
"@onsonr/es": "link:../..",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/cosmes-react/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/cosmes-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConnectedWallet, KeplrController, WalletType } from "cosmes/wallet";
import { ConnectedWallet, KeplrController, WalletType } from "@onsonr/es/wallet";
import { useState } from "react";

const WC_PROJECT_ID = "2b7d5a2da89dd74fed821d184acabf95";
Expand Down
4 changes: 2 additions & 2 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins:
- plugin: es
opt: target=ts
out: .
- plugin: cosmes
path: ./scripts/protoc-gen-cosmes.mjs
- plugin: @onsonr/es
path: ./scripts/protoc-gen-@onsonr/es.mjs
opt: target=ts
out: .
2 changes: 1 addition & 1 deletion examples/batch-query/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cosmes/batch-query",
"name": "@@onsonr/es/batch-query",
"private": true,
"main": "src/index.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/batch-query/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/mnemonic-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@cosmes/mnemonic-wallet",
"name": "@@onsonr/es/mnemonic-wallet",
"private": true,
"main": "src/index.ts",
"scripts": {
"start": "tsx src/index.ts"
},
"dependencies": {
"cosmes": "link:../.."
"@onsonr/es": "link:../.."
},
"devDependencies": {
"@types/node": "^20.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/mnemonic-wallet/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/mnemonic-wallet/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MnemonicWallet } from "cosmes/wallet";
import { MnemonicWallet } from "@onsonr/es/wallet";

async function main() {
// Example usage for Osmosis chain
Expand All @@ -19,7 +19,7 @@ async function main() {
console.log("Address:", wallet.address); // prints the bech32 address

// Sign an arbitrary message
const { signature } = await wallet.signArbitrary("Hello from CosmES!");
const { signature } = await wallet.signArbitrary("Hello from @onsonr/es!");
console.log("Signature:", signature);

// Broadcast a transaction
Expand Down
4 changes: 2 additions & 2 deletions examples/solid-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cosmes/solid-vite",
"name": "@@onsonr/es/solid-vite",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -9,7 +9,7 @@
},
"dependencies": {
"buffer": "^6.0.3",
"cosmes": "link:../..",
"@onsonr/es": "link:../..",
"solid-js": "^1.7.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/solid-vite/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/solid-vite/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, createSignal, For, onMount } from "solid-js";
import { createStore } from "solid-js/store";

import { MsgSend } from "cosmes/client";
import { MsgSend } from "@onsonr/es/client";
import {
CompassController,
ConnectedWallet,
Expand All @@ -16,12 +16,12 @@ import {
WalletController,
WalletName,
WalletType,
} from "cosmes/wallet";
} from "@onsonr/es/wallet";

const WC_PROJECT_ID = "2b7d5a2da89dd74fed821d184acabf95";
const SIGN_ARBITRARY_MSG =
"Hi from CosmeES! This is a test message just to prove that the wallet is working.";
const TX_MEMO = "signed via cosmes";
const TX_MEMO = "signed via @onsonr/es";

const CHAINS: Record<string, string> = {
"osmosis-1": "Osmosis",
Expand Down
4 changes: 2 additions & 2 deletions examples/verify-signatures/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@cosmes/verify-signatures",
"name": "@@onsonr/es/verify-signatures",
"private": true,
"main": "src/index.ts",
"scripts": {
"start": "tsx src/index.ts"
},
"dependencies": {
"cosmes": "link:../.."
"@onsonr/es": "link:../.."
},
"devDependencies": {
"@types/node": "^20.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/verify-signatures/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/verify-signatures/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MnemonicWallet, verifyArbitrary } from "cosmes/wallet";
import { MnemonicWallet, verifyArbitrary } from "@onsonr/es/wallet";

async function main() {
// Create a mnemonic wallet to sign an arbitrary message
Expand All @@ -16,7 +16,7 @@ async function main() {
});

// Sign the arbitrary data
const message = "Hello from CosmES!";
const message = "Hello from @onsonr/es!";
const { signature, pubKey } = await wallet.signArbitrary(message);

// Verify the signature of the arbitrary data
Expand Down
6 changes: 3 additions & 3 deletions scripts/protoc-gen-cosmes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* This is a custom plugin for `buf` that generates TS files from the services
* defined in the proto files, and is referred to by the root `buf.gen.yaml`.
* Files generated using this plugin contains the `_cosmes` suffix.
* Files generated using this plugin contains the `_@onsonr/es` suffix.
*
* Do not convert this to a TS file as it runs 4x slower!
*/
Expand All @@ -18,7 +18,7 @@ import {

export function generateTs(schema) {
for (const protoFile of schema.files) {
const file = schema.generateFile(protoFile.name + "_cosmes.ts");
const file = schema.generateFile(protoFile.name + "_@onsonr/es.ts");
file.preamble(protoFile);
for (const service of protoFile.services) {
generateService(schema, file, service);
Expand All @@ -43,7 +43,7 @@ function generateService(schema, f, service) {

runNodeJs(
createEcmaScriptPlugin({
name: "protoc-gen-cosmes",
name: "protoc-gen-@onsonr/es",
version: "v0.0.1",
generateTs,
})
Expand Down
2 changes: 1 addition & 1 deletion src/client/apis/getAccount.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmosAuthV1beta1QueryAccountService as QueryAccountService } from "cosmes/protobufs";
import { CosmosAuthV1beta1QueryAccountService as QueryAccountService } from "@onsonr/es/protobufs";

import { RpcClient } from "../clients/RpcClient";

Expand Down
2 changes: 1 addition & 1 deletion src/client/apis/getNativeBalances.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmosBankV1beta1QueryAllBalancesService as QueryAllBalancesService } from "cosmes/protobufs";
import { CosmosBankV1beta1QueryAllBalancesService as QueryAllBalancesService } from "@onsonr/es/protobufs";

import { RpcClient } from "../clients/RpcClient";

Expand Down
2 changes: 1 addition & 1 deletion src/client/apis/getTx.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
CosmosTxV1beta1GetTxResponse as GetTxResponse,
CosmosTxV1beta1ServiceGetTxService as GetTxService,
} from "cosmes/protobufs";
} from "@onsonr/es/protobufs";

import { RpcClient } from "../clients/RpcClient";

Expand Down
Loading

0 comments on commit 55e7370

Please sign in to comment.