Skip to content

Commit

Permalink
Merge pull request #4 from Magickbase/ckb2021-addr
Browse files Browse the repository at this point in the history
  • Loading branch information
homura authored Jul 25, 2024
2 parents a02610a + 36343e5 commit 25d6802
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Ckb.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import * as blockchain from "./annotated";
import Blake2b from "blake2b-wasm";
import { bech32m } from "bech32";

// CKB address is longer than the longest Bitcoin address
// The bech32m encoding limit should be increased
const BECH32_LIMIT = 1023;

/**
* Nervos API
*
Expand Down Expand Up @@ -89,7 +93,8 @@ export default class Ckb {
];
const addr = bech32m.encode(
testnet ? "ckt" : "ckb",
bech32m.toWords(addr_contents)
bech32m.toWords(addr_contents),
BECH32_LIMIT
);

return {
Expand Down

0 comments on commit 25d6802

Please sign in to comment.