We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 39703f7 + 65c7867 commit 3a786c6Copy full SHA for 3a786c6
client-sdk/ts-web/core/src/quantity.ts
@@ -7,6 +7,7 @@ export function toBigInt(q: Uint8Array) {
7
8
export function fromBigInt(bi: bigint) {
9
if (bi === 0n) return new Uint8Array();
10
+ if (bi < 0n) throw new RangeError(`Cannot convert ${bi} to quantity`);
11
let hex = bi.toString(16);
12
if (hex.length % 2) {
13
hex = '0' + hex;
0 commit comments