Create toBech32 and fromBech32 in @cosmjs/encoding (#1058)

* Create toBech32 and fromBech32

* Add changes to CHANGELOG.md

* Fix linting

* Update packages/encoding/src/bech32.ts

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update packages/encoding/src/bech32.ts

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update bech32.ts

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
This commit is contained in:
Milan Steiner
2022-02-22 14:05:34 +01:00
committed by GitHub
co-authored by Simon Warta
parent 9b80dff493
commit 4c8b278c1d
20 changed files with 84 additions and 61 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { Random } from "@cosmjs/crypto";
import { Bech32 } from "@cosmjs/encoding";
import { toBech32 } from "@cosmjs/encoding";
import { makeCosmoshubPath, StargateClient } from "@cosmjs/stargate";
import { assert } from "@cosmjs/utils";
@@ -18,7 +18,7 @@ const defaultTokenConfig: TokenConfiguration = {
const defaultAddressPrefix = "cosmos";
function makeRandomAddress(): string {
return Bech32.encode(defaultAddressPrefix, Random.getBytes(20));
return toBech32(defaultAddressPrefix, Random.getBytes(20));
}
const faucetMnemonic =