Skip to content

Commit 19b31eb

Browse files
committed
🐞 fix: build src
1 parent caea960 commit 19b31eb

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

src/address.d.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,12 @@ export interface Bech32Result {
2727
}
2828
/**
2929
* decode address with base58 specification, return address version and address hash if valid
30-
* @example
30+
* @case
3131
* ```ts
32-
* // valid case
33-
* fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH')
34-
* // => {version: 0, hash: <Buffer 75 1e 76 e8 19 91 96 d4 54 94 1c 45 d1 b3 a3 23 f1 43 3b d6>}
35-
*
36-
* // invalid case: address is too short
37-
* fromBase58Check('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx')
38-
* // => throw new TypeError('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx is too short')
39-
*
40-
* // invalid case: address is too long
41-
* fromBase58Check('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe')
42-
* // => throw new TypeError('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe is too long')
32+
* // You can test it here and find more case in test/address.spec.ts
33+
* const result = address.fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH')
34+
* console.log(JSON.stringify(result))
35+
* // => {"version":0,"hash":{"type":"Buffer","data":[117,30,118,232,25,145,150,212,84,148,28,69,209,179,163,35,241,67,59,214]}}
4336
* ```
4437
*/
4538
export declare function fromBase58Check(address: string): Base58CheckResult;

src/address.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,12 @@ function _toFutureSegwitAddress(output, network) {
4343
}
4444
/**
4545
* decode address with base58 specification, return address version and address hash if valid
46-
* @example
46+
* @case
4747
* ```ts
48-
* // valid case
49-
* fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH')
50-
* // => {version: 0, hash: <Buffer 75 1e 76 e8 19 91 96 d4 54 94 1c 45 d1 b3 a3 23 f1 43 3b d6>}
51-
*
52-
* // invalid case: address is too short
53-
* fromBase58Check('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx')
54-
* // => throw new TypeError('7SeEnXWPaCCALbVrTnszCVGfRU8cGfx is too short')
55-
*
56-
* // invalid case: address is too long
57-
* fromBase58Check('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe')
58-
* // => throw new TypeError('j9ywUkWg2fTQrouxxh5rSZhRvrjMkEUfuiKe is too long')
48+
* // You can test it here and find more case in test/address.spec.ts
49+
* const result = address.fromBase58Check('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH')
50+
* console.log(JSON.stringify(result))
51+
* // => {"version":0,"hash":{"type":"Buffer","data":[117,30,118,232,25,145,150,212,84,148,28,69,209,179,163,35,241,67,59,214]}}
5952
* ```
6053
*/
6154
function fromBase58Check(address) {

0 commit comments

Comments
 (0)