Skip to content

Commit f8e927c

Browse files
feat(doge): increase max big max satoshi to mongo long
WP and IMS supports mongo long (2^63 - 1) range outputs for doge. Supporting the same here. Ticket: BG-59468
1 parent c43340a commit f8e927c

File tree

4 files changed

+122
-119
lines changed

4 files changed

+122
-119
lines changed

src/types.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function Signer(obj) {
4848
}
4949
exports.Signer = Signer;
5050
const SATOSHI_MAX = 21 * 1e14;
51-
const BIG_SATOSHI_MAX = BigInt('1000000000000000000');
51+
// Value 2^63 - 1 is the maximum value stored in mongodb long type
52+
const BIG_SATOSHI_MAX = (1n << 63n) - 1n;
5253
function Satoshi(value) {
5354
return (
5455
(exports.typeforce.UInt53(value) && value <= SATOSHI_MAX) ||

0 commit comments

Comments
 (0)