Skip to content

Commit 2199713

Browse files
Merge pull request #44 from BitGo/BG-59468-increase-max-bigint
feat(doge): increase max big max satoshi to mongo long
2 parents c43340a + f8e927c commit 2199713

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)