crosslightning-sdk-base
Advanced tools
Comparing version 9.2.0-beta8 to 9.2.0-beta9
@@ -17,3 +17,3 @@ "use strict"; | ||
const Utils_1 = require("../utils/Utils"); | ||
const randombytes_1 = require("randombytes"); | ||
const randomBytes = require("randombytes"); | ||
var RefundAuthorizationResponseCodes; | ||
@@ -76,3 +76,3 @@ (function (RefundAuthorizationResponseCodes) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const nonce = (0, randombytes_1.default)(32).toString("hex"); | ||
const nonce = randomBytes(32).toString("hex"); | ||
const response = yield (0, Utils_1.httpPost)(baseUrl + "/info", { | ||
@@ -79,0 +79,0 @@ nonce, |
@@ -15,3 +15,3 @@ "use strict"; | ||
const BN = require("bn.js"); | ||
const randombytes_1 = require("randombytes"); | ||
const randomBytes = require("randombytes"); | ||
const IntermediaryError_1 = require("../../errors/IntermediaryError"); | ||
@@ -27,3 +27,3 @@ const Utils_1 = require("../../utils/Utils"); | ||
getRandomSequence() { | ||
return new BN((0, randombytes_1.default)(8)); | ||
return new BN(randomBytes(8)); | ||
} | ||
@@ -30,0 +30,0 @@ /** |
@@ -19,3 +19,3 @@ "use strict"; | ||
const UserError_1 = require("../../../errors/UserError"); | ||
const randombytes_1 = require("randombytes"); | ||
const randomBytes = require("randombytes"); | ||
const create_hash_1 = require("create-hash"); | ||
@@ -124,3 +124,3 @@ const IntermediaryError_1 = require("../../../errors/IntermediaryError"); | ||
getSecretAndHash() { | ||
const secret = (0, randombytes_1.default)(32); | ||
const secret = randomBytes(32); | ||
const paymentHash = (0, create_hash_1.default)("sha256").update(secret).digest(); | ||
@@ -127,0 +127,0 @@ return { secret, paymentHash }; |
@@ -19,3 +19,3 @@ "use strict"; | ||
const buffer_1 = require("buffer"); | ||
const randombytes_1 = require("randombytes"); | ||
const randomBytes = require("randombytes"); | ||
const UserError_1 = require("../../../errors/UserError"); | ||
@@ -60,3 +60,3 @@ const IntermediaryError_1 = require("../../../errors/IntermediaryError"); | ||
buffer_1.Buffer.from(firstPart.toArray("be", 5)), | ||
(0, randombytes_1.default)(3) | ||
randomBytes(3) | ||
]); | ||
@@ -63,0 +63,0 @@ return new BN(nonceBuffer, "be"); |
{ | ||
"name": "crosslightning-sdk-base", | ||
"version": "9.2.0-beta8", | ||
"version": "9.2.0-beta9", | ||
"description": "CrossLightning SDK chain-agnostic base", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -10,3 +10,3 @@ import {RequestError} from "../errors/RequestError"; | ||
import {httpGet, httpPost, tryWithRetries} from "../utils/Utils"; | ||
import randomBytes from "randombytes"; | ||
import * as randomBytes from "randombytes"; | ||
@@ -13,0 +13,0 @@ export type InfoHandlerResponse = { |
@@ -5,3 +5,3 @@ import {IFromBTCSwap} from "./IFromBTCSwap"; | ||
import * as BN from "bn.js"; | ||
import randomBytes from "randombytes"; | ||
import * as randomBytes from "randombytes"; | ||
import {Intermediary} from "../../intermediaries/Intermediary"; | ||
@@ -8,0 +8,0 @@ import {IntermediaryError} from "../../errors/IntermediaryError"; |
@@ -18,3 +18,3 @@ import {FromBTCLNSwap, FromBTCLNSwapState} from "./FromBTCLNSwap"; | ||
import {UserError} from "../../../errors/UserError"; | ||
import randomBytes from "randombytes"; | ||
import * as randomBytes from "randombytes"; | ||
import createHash from "create-hash"; | ||
@@ -21,0 +21,0 @@ import {IntermediaryError} from "../../../errors/IntermediaryError"; |
@@ -19,3 +19,3 @@ import {ToBTCSwap} from "./ToBTCSwap"; | ||
import {Buffer} from "buffer"; | ||
import randomBytes from "randombytes"; | ||
import * as randomBytes from "randombytes"; | ||
import {UserError} from "../../../errors/UserError"; | ||
@@ -22,0 +22,0 @@ import {IntermediaryError} from "../../../errors/IntermediaryError"; |
888078