@cosmjs/encoding
Advanced tools
Comparing version 0.22.3 to 0.23.0-alpha.0
@@ -25,8 +25,8 @@ "use strict"; | ||
class Bech32 { | ||
static encode(prefix, data) { | ||
const address = bech32.encode(prefix, bech32.toWords(data)); | ||
static encode(prefix, data, limit) { | ||
const address = bech32.encode(prefix, bech32.toWords(data), limit); | ||
return address; | ||
} | ||
static decode(address) { | ||
const decodedAddress = bech32.decode(address); | ||
static decode(address, limit = Infinity) { | ||
const decodedAddress = bech32.decode(address, limit); | ||
return { | ||
@@ -33,0 +33,0 @@ prefix: decodedAddress.prefix, |
{ | ||
"name": "@cosmjs/encoding", | ||
"version": "0.22.3", | ||
"version": "0.23.0-alpha.0", | ||
"description": "Encoding helpers for blockchain projects", | ||
@@ -40,3 +40,5 @@ "contributors": [ | ||
"format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"", | ||
"build": "shx rm -rf ./build && tsc && yarn move-types && yarn format-types", | ||
"prebuild": "shx rm -rf ./build", | ||
"build": "tsc", | ||
"postbuild": "yarn move-types && yarn format-types", | ||
"build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build", | ||
@@ -53,3 +55,3 @@ "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js" | ||
}, | ||
"gitHead": "ee205cc5f7b1154f2e8a5149092b19c82672b951" | ||
"gitHead": "5e79100fe341f7f745d28d8d4616912e2122e1ed" | ||
} |
export declare class Bech32 { | ||
static encode(prefix: string, data: Uint8Array): string; | ||
static encode(prefix: string, data: Uint8Array, limit?: number): string; | ||
static decode( | ||
address: string, | ||
limit?: number, | ||
): { | ||
@@ -6,0 +7,0 @@ readonly prefix: string; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32283
257