mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-23 05:35:48 +00:00
Browser Compatibility Updates (#107)
* BigInt -> big-integer to support older browsers * Buffer read/write BigUInt64 removed for browser compatibility.
This commit is contained in:
@@ -9,6 +9,7 @@ import { sha512Half, transactionID } from "./hashes";
|
||||
import { FieldInstance } from "./enums";
|
||||
import { STObject } from "./types/st-object";
|
||||
import { JsonObject } from "./types/serialized-type";
|
||||
import * as bigInt from "big-integer";
|
||||
|
||||
/**
|
||||
* Construct a BinaryParser
|
||||
@@ -102,9 +103,10 @@ interface ClaimObject extends JsonObject {
|
||||
* @returns the serialized object with appropriate prefix
|
||||
*/
|
||||
function signingClaimData(claim: ClaimObject): Buffer {
|
||||
const num = bigInt(String(claim.amount));
|
||||
const prefix = HashPrefix.paymentChannelClaim;
|
||||
const channel = coreTypes.Hash256.from(claim.channel).toBytes();
|
||||
const amount = coreTypes.UInt64.from(BigInt(claim.amount)).toBytes();
|
||||
const amount = coreTypes.UInt64.from(num).toBytes();
|
||||
|
||||
const bytesList = new BytesList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user