Skip to content

Commit cc393a9

Browse files
authored
chore: release v0.25.1 (#2970)
chore: release v0.25.1
2 parents deaa513 + b687ef3 commit cc393a9

File tree

6 files changed

+169
-65
lines changed

6 files changed

+169
-65
lines changed

Diff for: changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [`v0.25.1`](https://github.com/ignite/cli/releases/tag/v0.25.1)
2+
3+
### Changes
4+
5+
- [#2968](https://github.com/ignite/cli/pull/2968) Dragonberry security fix upgrading Cosmos SDK to `v0.46.3`
6+
17
# Changelog
28

39
## [`v0.25.0`](https://github.com/ignite/cli/releases/tag/v0.25.0)

Diff for: docs/docs/clients/01-typescript.md

+111-13
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,32 @@ You will also need to polyfill the client's dependencies. The following is an ex
4444

4545
```bash
4646
npm create vite@latest my-frontend-app -- --template vanilla-ts
47-
npm install --save-dev buffer @rollup/plugin-node-resolve
47+
npm install --save-dev @esbuild-plugins/node-globals-polyfill @rollup/plugin-node-resolve
4848
```
4949

5050
You must then create the necessary `vite.config.ts` file.
5151

5252
```typescript
5353
import { nodeResolve } from '@rollup/plugin-node-resolve'
54-
import { Buffer } from 'buffer'
54+
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
5555
import { defineConfig } from 'vite'
5656
5757
export default defineConfig({
58-
define: {
59-
global: {
60-
Buffer: Buffer
61-
}
62-
},
63-
plugins: [nodeResolve()],
58+
59+
plugins: [nodeResolve()],
60+
61+
optimizeDeps: {
62+
esbuildOptions: {
63+
define: {
64+
global: 'globalThis',
65+
},
66+
plugins: [
67+
NodeGlobalsPolyfillPlugin({
68+
buffer:true
69+
}),
70+
],
71+
},
72+
}
6473
})
6574
```
6675

@@ -76,17 +85,21 @@ By default, the generated client exports a client class that includes all the Co
7685

7786
To instantiate the client you need to provide environment information (endpoints and chain prefix) and an optional wallet (implementing the CosmJS OfflineSigner interface).
7887

79-
For example, to connect to a local chain instance running under the Ignite CLI defaults, using Keplr as a wallet:
88+
For example, to connect to a local chain instance running under the Ignite CLI defaults, using a CosmJS wallet:
8089

8190
```typescript
8291
import { Client } from '<path-to-ts-client>';
92+
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
93+
94+
const mnemonic = "surround miss nominee dream gap cross assault thank captain prosper drop duty group candy wealth weather scale put";
95+
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic);
8396
8497
const client = new Client({
8598
apiURL: "http://localhost:1317",
8699
rpcURL: "http://localhost:26657",
87100
prefix: "cosmos"
88101
},
89-
window.keplr.getOfflineSigner()
102+
wallet
90103
);
91104
```
92105

@@ -125,15 +138,18 @@ If you prefer, you can construct a lighter client using only the modules you are
125138
import { IgniteClient } from '<path-to-ts-client>/client';
126139
import { Module as CosmosBankV1Beta1 } from '<path-to-ts-client>/cosmos.bank.v1beta1'
127140
import { Module as CosmosStakingV1Beta1 } from '<path-to-ts-client>/cosmos.staking.v1beta1'
141+
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
128142
143+
const mnemonic = "surround miss nominee dream gap cross assault thank captain prosper drop duty group candy wealth weather scale put";
144+
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic);
129145
const CustomClient = IgniteClient.plugin([CosmosBankV1Beta1, CosmosStakingV1Beta1]);
130146
131147
const client = new CustomClient({
132148
apiURL: "http://localhost:1317",
133149
rpcURL: "http://localhost:26657",
134150
prefix: "cosmos"
135151
},
136-
window.keplr.getOfflineSigner()
152+
wallet
137153
);
138154
```
139155

@@ -186,9 +202,13 @@ and
186202

187203
```typescript
188204
import { txClient } from '<path-to-ts-client>/cosmos.bank.v1beta1';
205+
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
206+
207+
const mnemonic = "surround miss nominee dream gap cross assault thank captain prosper drop duty group candy wealth weather scale put";
208+
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic);
189209
190210
const client = txClient({
191-
signer: window.keplr.getOfflineSigner(),
211+
signer: wallet,
192212
prefix: 'cosmos',
193213
addr: 'http://localhost:26657'
194214
});
@@ -209,4 +229,82 @@ const tx_result = await client.sendMsgSend(
209229
memo
210230
}
211231
);
212-
```
232+
```
233+
234+
## Usage with Keplr
235+
236+
Normally, Keplr provides a wallet object implementing the OfflineSigner interface so you can simply replace the wallet argument in client instantiation with it like so:
237+
238+
239+
```typescript
240+
import { Client } from '<path-to-ts-client>';
241+
242+
const chainId = 'mychain-1'
243+
const client = new Client({
244+
apiURL: "http://localhost:1317",
245+
rpcURL: "http://localhost:26657",
246+
prefix: "cosmos"
247+
},
248+
window.keplr.getOfflineSigner(chainId)
249+
);
250+
```
251+
252+
The problem is that for a new Ignite CLI scaffolded chain, Keplr has no knowledge of it thus requiring an initial call to [`experimentalSuggestChain()`](https://docs.keplr.app/api/suggest-chain.html) method to add the chain information to the user's Keplr instance.
253+
254+
The generated client makes this easier by offering a `useKeplr()` method that autodiscovers the chain information and sets it up for you. Thus you can instantiate the client without a wallet and then call `useKeplr()` to enable transacting via Keplr like so:
255+
256+
```typescript
257+
import { Client } from '<path-to-ts-client>';
258+
259+
const client = new Client({
260+
apiURL: "http://localhost:1317",
261+
rpcURL: "http://localhost:26657",
262+
prefix: "cosmos"
263+
}
264+
);
265+
await client.useKeplr();
266+
```
267+
268+
`useKeplr()` optionally accepts an object argument that contains one or more of the same keys as the `ChainInfo` type argument of `experimentalSuggestChain()` allowing you to override the auto-discovered values.
269+
270+
For example, the default chain name and token precision (which are not recorded on-chain) are set to `<chainId> Network` and `0` while the ticker for the denom is set to the denom name in uppercase. If you wanted to override these, you could do something like:
271+
272+
273+
```typescript
274+
import { Client } from '<path-to-ts-client>';
275+
276+
const client = new Client({
277+
apiURL: "http://localhost:1317",
278+
rpcURL: "http://localhost:26657",
279+
prefix: "cosmos"
280+
}
281+
);
282+
await client.useKeplr({ chainName: 'My Great Chain', stakeCurrency : { coinDenom: 'TOKEN', coinMinimalDenom: 'utoken', coinDecimals: '6' } });
283+
```
284+
285+
## Wallet switching
286+
287+
The client also allows you to switch out the wallet for a different one on an already instantiated client like so:
288+
289+
```typescript
290+
import { Client } from '<path-to-ts-client>';
291+
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
292+
293+
const mnemonic = "surround miss nominee dream gap cross assault thank captain prosper drop duty group candy wealth weather scale put";
294+
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic);
295+
296+
297+
const client = new Client({
298+
apiURL: "http://localhost:1317",
299+
rpcURL: "http://localhost:26657",
300+
prefix: "cosmos"
301+
}
302+
);
303+
await client.useKeplr();
304+
305+
// transact using Keplr Wallet
306+
307+
client.useSigner(wallet);
308+
309+
//transact using CosmJS wallet
310+
```

Diff for: go.mod

+16-16
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/buger/jsonparser v1.1.1
1414
github.com/cenkalti/backoff v2.2.1+incompatible
1515
github.com/charmbracelet/glow v1.4.0
16-
github.com/cosmos/cosmos-sdk v0.46.2
16+
github.com/cosmos/cosmos-sdk v0.46.3
1717
github.com/cosmos/go-bip39 v1.0.0
1818
github.com/cosmos/ibc-go/v5 v5.0.0
1919
github.com/docker/docker v20.10.17+incompatible
@@ -53,7 +53,7 @@ require (
5353
github.com/takuoki/gocase v1.0.0
5454
github.com/tendermint/flutter/v2 v2.0.4
5555
github.com/tendermint/spn v0.2.1-0.20220921200247-8bafad876bdd
56-
github.com/tendermint/tendermint v0.34.21
56+
github.com/tendermint/tendermint v0.34.22
5757
github.com/tendermint/tm-db v0.6.7
5858
github.com/vektra/mockery/v2 v2.14.0
5959
go.etcd.io/bbolt v1.3.6
@@ -63,7 +63,7 @@ require (
6363
golang.org/x/text v0.3.7
6464
golang.org/x/tools v0.1.13-0.20220803210227-8b9a1fbdf5c3
6565
golang.org/x/vuln v0.0.0-20220919155316-41b1fc70d0a6
66-
google.golang.org/grpc v1.49.0
66+
google.golang.org/grpc v1.50.0
6767
google.golang.org/protobuf v1.28.1
6868
gopkg.in/yaml.v2 v2.4.0
6969
mvdan.cc/gofumpt v0.3.1
@@ -82,7 +82,7 @@ require (
8282
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect
8383
github.com/Masterminds/semver v1.5.0 // indirect
8484
github.com/Microsoft/go-winio v0.6.0 // indirect
85-
github.com/Microsoft/hcsshim v0.9.3 // indirect
85+
github.com/Microsoft/hcsshim v0.9.4 // indirect
8686
github.com/OpenPeeDeeP/depguard v1.1.0 // indirect
8787
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
8888
github.com/Workiva/go-datastructures v1.0.53 // indirect
@@ -121,11 +121,11 @@ require (
121121
github.com/confio/ics23/go v0.7.0 // indirect
122122
github.com/containerd/cgroups v1.0.3 // indirect
123123
github.com/containerd/console v1.0.3 // indirect
124-
github.com/containerd/containerd v1.6.6 // indirect
124+
github.com/containerd/containerd v1.6.8 // indirect
125125
github.com/cosmos/btcutil v1.0.4 // indirect
126126
github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect
127127
github.com/cosmos/gorocksdb v1.2.0 // indirect
128-
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313 // indirect
128+
github.com/cosmos/iavl v0.19.3 // indirect
129129
github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect
130130
github.com/cosmos/ledger-go v0.9.2 // indirect
131131
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
@@ -219,7 +219,7 @@ require (
219219
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
220220
github.com/hexops/gotextdiff v1.0.3 // indirect
221221
github.com/improbable-eng/grpc-web v0.15.0 // indirect
222-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
222+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
223223
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
224224
github.com/jgautheron/goconst v1.5.1 // indirect
225225
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
@@ -258,7 +258,7 @@ require (
258258
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
259259
github.com/microcosm-cc/bluemonday v1.0.20 // indirect
260260
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a // indirect
261-
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
261+
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
262262
github.com/minio/highwayhash v1.0.2 // indirect
263263
github.com/mitchellh/go-homedir v1.1.0 // indirect
264264
github.com/moby/sys/mount v0.3.1 // indirect
@@ -278,7 +278,7 @@ require (
278278
github.com/opencontainers/go-digest v1.0.0 // indirect
279279
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
280280
github.com/opencontainers/runc v1.1.3 // indirect
281-
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
281+
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
282282
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
283283
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect
284284
github.com/pmezard/go-difflib v1.0.0 // indirect
@@ -292,7 +292,7 @@ require (
292292
github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect
293293
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
294294
github.com/rakyll/statik v0.1.7 // indirect
295-
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
295+
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
296296
github.com/regen-network/cosmos-proto v0.3.1 // indirect
297297
github.com/rivo/uniseg v0.2.0 // indirect
298298
github.com/rogpeppe/go-internal v1.8.1 // indirect
@@ -303,7 +303,7 @@ require (
303303
github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 // indirect
304304
github.com/sahilm/fuzzy v0.1.0 // indirect
305305
github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect
306-
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
306+
github.com/sasha-s/go-deadlock v0.3.1 // indirect
307307
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
308308
github.com/sashamelentyev/usestdlibvars v1.13.0 // indirect
309309
github.com/securego/gosec/v2 v2.13.1 // indirect
@@ -320,11 +320,11 @@ require (
320320
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e // indirect
321321
github.com/spf13/afero v1.8.2 // indirect
322322
github.com/spf13/jwalterweatherman v1.1.0 // indirect
323-
github.com/spf13/viper v1.12.0 // indirect
323+
github.com/spf13/viper v1.13.0 // indirect
324324
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
325325
github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect
326326
github.com/stretchr/objx v0.4.0 // indirect
327-
github.com/subosito/gotenv v1.4.0 // indirect
327+
github.com/subosito/gotenv v1.4.1 // indirect
328328
github.com/sylvia7788/contextcheck v1.0.6 // indirect
329329
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
330330
github.com/tdakkota/asciicheck v0.1.1 // indirect
@@ -349,17 +349,17 @@ require (
349349
github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect
350350
gitlab.com/bosi/decorder v0.2.3 // indirect
351351
go.opencensus.io v0.23.0 // indirect
352-
go.uber.org/atomic v1.9.0 // indirect
352+
go.uber.org/atomic v1.10.0 // indirect
353353
go.uber.org/multierr v1.8.0 // indirect
354-
go.uber.org/zap v1.21.0 // indirect
354+
go.uber.org/zap v1.22.0 // indirect
355355
golang.org/x/crypto v0.0.0-20220924013350-4ba4fb4dd9e7 // indirect
356356
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
357357
golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d // indirect
358358
golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect
359359
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
360360
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
361361
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect
362-
gopkg.in/ini.v1 v1.66.6 // indirect
362+
gopkg.in/ini.v1 v1.67.0 // indirect
363363
gopkg.in/warnings.v0 v0.1.2 // indirect
364364
gopkg.in/yaml.v3 v3.0.1 // indirect
365365
honnef.co/go/tools v0.3.3 // indirect

0 commit comments

Comments
 (0)