@atomiqlabs/lp-lib 14.0.0-dev.36 → 14.0.0-dev.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/swaps/escrow/frombtc_abstract/FromBtcAbs.js +1 -1
- package/dist/swaps/escrow/frombtcln_abstract/FromBtcLnAbs.js +2 -2
- package/dist/swaps/escrow/frombtcln_autoinit/FromBtcLnAuto.js +2 -2
- package/dist/swaps/escrow/tobtc_abstract/ToBtcAbs.js +1 -1
- package/dist/swaps/escrow/tobtcln_abstract/ToBtcLnAbs.js +1 -1
- package/dist/swaps/spv_vault_swap/SpvVaultSwapHandler.js +1 -1
- package/dist/swaps/trusted/frombtc_trusted/FromBtcTrusted.js +1 -1
- package/dist/swaps/trusted/frombtcln_trusted/FromBtcLnTrusted.js +2 -2
- package/package.json +2 -2
- package/src/swaps/escrow/frombtc_abstract/FromBtcAbs.ts +1 -1
- package/src/swaps/escrow/frombtcln_abstract/FromBtcLnAbs.ts +2 -2
- package/src/swaps/escrow/frombtcln_autoinit/FromBtcLnAuto.ts +2 -2
- package/src/swaps/escrow/tobtc_abstract/ToBtcAbs.ts +1 -1
- package/src/swaps/escrow/tobtcln_abstract/ToBtcLnAbs.ts +1 -1
- package/src/swaps/spv_vault_swap/SpvVaultSwapHandler.ts +1 -1
- package/src/swaps/trusted/frombtc_trusted/FromBtcTrusted.ts +1 -1
- package/src/swaps/trusted/frombtcln_trusted/FromBtcLnTrusted.ts +2 -2
|
@@ -202,7 +202,7 @@ class FromBtcAbs extends FromBtcBaseSwapHandler_1.FromBtcBaseSwapHandler {
|
|
|
202
202
|
const parsedBody = await req.paramReader.getParams({
|
|
203
203
|
address: (val) => val != null &&
|
|
204
204
|
typeof (val) === "string" &&
|
|
205
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
205
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
206
206
|
amount: SchemaVerifier_1.FieldTypeEnum.BigInt,
|
|
207
207
|
token: (val) => val != null &&
|
|
208
208
|
typeof (val) === "string" &&
|
|
@@ -423,7 +423,7 @@ class FromBtcLnAbs extends FromBtcBaseSwapHandler_1.FromBtcBaseSwapHandler {
|
|
|
423
423
|
address = invoice.description;
|
|
424
424
|
}
|
|
425
425
|
const { chainInterface } = this.getChain(chainIdentifier);
|
|
426
|
-
if (!chainInterface.isValidAddress(address))
|
|
426
|
+
if (!chainInterface.isValidAddress(address, true))
|
|
427
427
|
throw {
|
|
428
428
|
_httpStatus: 200,
|
|
429
429
|
code: 10001,
|
|
@@ -475,7 +475,7 @@ class FromBtcLnAbs extends FromBtcBaseSwapHandler_1.FromBtcBaseSwapHandler {
|
|
|
475
475
|
const parsedBody = await req.paramReader.getParams({
|
|
476
476
|
address: (val) => val != null &&
|
|
477
477
|
typeof (val) === "string" &&
|
|
478
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
478
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
479
479
|
paymentHash: (val) => val != null &&
|
|
480
480
|
typeof (val) === "string" &&
|
|
481
481
|
val.length === 64 &&
|
|
@@ -444,7 +444,7 @@ class FromBtcLnAuto extends FromBtcBaseSwapHandler_1.FromBtcBaseSwapHandler {
|
|
|
444
444
|
address = invoice.description;
|
|
445
445
|
}
|
|
446
446
|
const { chainInterface } = this.getChain(chainIdentifier);
|
|
447
|
-
if (!chainInterface.isValidAddress(address))
|
|
447
|
+
if (!chainInterface.isValidAddress(address, true))
|
|
448
448
|
throw {
|
|
449
449
|
_httpStatus: 200,
|
|
450
450
|
code: 10001,
|
|
@@ -499,7 +499,7 @@ class FromBtcLnAuto extends FromBtcBaseSwapHandler_1.FromBtcBaseSwapHandler {
|
|
|
499
499
|
const parsedBody = await req.paramReader.getParams({
|
|
500
500
|
address: (val) => val != null &&
|
|
501
501
|
typeof (val) === "string" &&
|
|
502
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
502
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
503
503
|
paymentHash: (val) => val != null &&
|
|
504
504
|
typeof (val) === "string" &&
|
|
505
505
|
val.length === 64 &&
|
|
@@ -545,7 +545,7 @@ class ToBtcAbs extends ToBtcBaseSwapHandler_1.ToBtcBaseSwapHandler {
|
|
|
545
545
|
this.isTokenSupported(chainIdentifier, val) ? val : null,
|
|
546
546
|
offerer: (val) => val != null &&
|
|
547
547
|
typeof (val) === "string" &&
|
|
548
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
548
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
549
549
|
exactIn: SchemaVerifier_1.FieldTypeEnum.BooleanOptional
|
|
550
550
|
});
|
|
551
551
|
if (parsedBody == null)
|
|
@@ -629,7 +629,7 @@ class ToBtcLnAbs extends ToBtcBaseSwapHandler_1.ToBtcBaseSwapHandler {
|
|
|
629
629
|
this.isTokenSupported(chainIdentifier, val) ? val : null,
|
|
630
630
|
offerer: (val) => val != null &&
|
|
631
631
|
typeof (val) === "string" &&
|
|
632
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
632
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
633
633
|
exactIn: SchemaVerifier_1.FieldTypeEnum.BooleanOptional,
|
|
634
634
|
amount: SchemaVerifier_1.FieldTypeEnum.BigIntOptional
|
|
635
635
|
});
|
|
@@ -192,7 +192,7 @@ class SpvVaultSwapHandler extends SwapHandler_1.SwapHandler {
|
|
|
192
192
|
const parsedBody = await req.paramReader.getParams({
|
|
193
193
|
address: (val) => val != null &&
|
|
194
194
|
typeof (val) === "string" &&
|
|
195
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
195
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
196
196
|
amount: SchemaVerifier_1.FieldTypeEnum.BigInt,
|
|
197
197
|
token: (val) => val != null &&
|
|
198
198
|
typeof (val) === "string" &&
|
|
@@ -347,7 +347,7 @@ class FromBtcTrusted extends SwapHandler_1.SwapHandler {
|
|
|
347
347
|
const parsedBody = (0, SchemaVerifier_1.verifySchema)(req.query, {
|
|
348
348
|
address: (val) => val != null &&
|
|
349
349
|
typeof (val) === "string" &&
|
|
350
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
350
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
351
351
|
refundAddress: (val) => val == null ? "" :
|
|
352
352
|
typeof (val) === "string" &&
|
|
353
353
|
this.isValidBitcoinAddress(val) ? val : null,
|
|
@@ -275,7 +275,7 @@ class FromBtcLnTrusted extends SwapHandler_1.SwapHandler {
|
|
|
275
275
|
address = invoice.description;
|
|
276
276
|
}
|
|
277
277
|
const { chainInterface } = this.getChain(chainIdentifier);
|
|
278
|
-
if (!chainInterface.isValidAddress(address))
|
|
278
|
+
if (!chainInterface.isValidAddress(address, true))
|
|
279
279
|
throw {
|
|
280
280
|
_httpStatus: 200,
|
|
281
281
|
code: 10001,
|
|
@@ -324,7 +324,7 @@ class FromBtcLnTrusted extends SwapHandler_1.SwapHandler {
|
|
|
324
324
|
const parsedBody = (0, SchemaVerifier_1.verifySchema)(req.query, {
|
|
325
325
|
address: (val) => val != null &&
|
|
326
326
|
typeof (val) === "string" &&
|
|
327
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
327
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
328
328
|
token: (val) => val != null &&
|
|
329
329
|
typeof (val) === "string" &&
|
|
330
330
|
this.isTokenSupported(chainIdentifier, val) ? val : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomiqlabs/lp-lib",
|
|
3
|
-
"version": "14.0.0-dev.
|
|
3
|
+
"version": "14.0.0-dev.37",
|
|
4
4
|
"description": "Main functionality implementation for atomiq LP node",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types:": "./dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"author": "adambor",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atomiqlabs/base": "^10.0.0-dev.
|
|
25
|
+
"@atomiqlabs/base": "^10.0.0-dev.17",
|
|
26
26
|
"@atomiqlabs/server-base": "^3.0.0",
|
|
27
27
|
"@scure/btc-signer": "1.6.0",
|
|
28
28
|
"express": "4.21.1",
|
|
@@ -279,7 +279,7 @@ export class FromBtcAbs extends FromBtcBaseSwapHandler<FromBtcSwapAbs, FromBtcSw
|
|
|
279
279
|
const parsedBody: FromBtcRequestType = await req.paramReader.getParams({
|
|
280
280
|
address: (val: string) => val!=null &&
|
|
281
281
|
typeof(val)==="string" &&
|
|
282
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
282
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
283
283
|
amount: FieldTypeEnum.BigInt,
|
|
284
284
|
token: (val: string) => val!=null &&
|
|
285
285
|
typeof(val)==="string" &&
|
|
@@ -532,7 +532,7 @@ export class FromBtcLnAbs extends FromBtcBaseSwapHandler<FromBtcLnSwapAbs, FromB
|
|
|
532
532
|
address = invoice.description;
|
|
533
533
|
}
|
|
534
534
|
const {chainInterface} = this.getChain(chainIdentifier);
|
|
535
|
-
if(!chainInterface.isValidAddress(address)) throw {
|
|
535
|
+
if(!chainInterface.isValidAddress(address, true)) throw {
|
|
536
536
|
_httpStatus: 200,
|
|
537
537
|
code: 10001,
|
|
538
538
|
msg: "Invoice expired/canceled"
|
|
@@ -595,7 +595,7 @@ export class FromBtcLnAbs extends FromBtcBaseSwapHandler<FromBtcLnSwapAbs, FromB
|
|
|
595
595
|
const parsedBody: FromBtcLnRequestType = await req.paramReader.getParams({
|
|
596
596
|
address: (val: string) => val!=null &&
|
|
597
597
|
typeof(val)==="string" &&
|
|
598
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
598
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
599
599
|
paymentHash: (val: string) => val!=null &&
|
|
600
600
|
typeof(val)==="string" &&
|
|
601
601
|
val.length===64 &&
|
|
@@ -538,7 +538,7 @@ export class FromBtcLnAuto extends FromBtcBaseSwapHandler<FromBtcLnAutoSwap, Fro
|
|
|
538
538
|
address = invoice.description;
|
|
539
539
|
}
|
|
540
540
|
const {chainInterface} = this.getChain(chainIdentifier);
|
|
541
|
-
if(!chainInterface.isValidAddress(address)) throw {
|
|
541
|
+
if(!chainInterface.isValidAddress(address, true)) throw {
|
|
542
542
|
_httpStatus: 200,
|
|
543
543
|
code: 10001,
|
|
544
544
|
msg: "Invoice expired/canceled"
|
|
@@ -602,7 +602,7 @@ export class FromBtcLnAuto extends FromBtcBaseSwapHandler<FromBtcLnAutoSwap, Fro
|
|
|
602
602
|
const parsedBody: FromBtcLnAutoRequestType = await req.paramReader.getParams({
|
|
603
603
|
address: (val: string) => val!=null &&
|
|
604
604
|
typeof(val)==="string" &&
|
|
605
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
605
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
606
606
|
paymentHash: (val: string) => val!=null &&
|
|
607
607
|
typeof(val)==="string" &&
|
|
608
608
|
val.length===64 &&
|
|
@@ -652,7 +652,7 @@ export class ToBtcAbs extends ToBtcBaseSwapHandler<ToBtcSwapAbs, ToBtcSwapState>
|
|
|
652
652
|
this.isTokenSupported(chainIdentifier, val) ? val : null,
|
|
653
653
|
offerer: (val: string) => val!=null &&
|
|
654
654
|
typeof(val)==="string" &&
|
|
655
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
655
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
656
656
|
exactIn: FieldTypeEnum.BooleanOptional
|
|
657
657
|
});
|
|
658
658
|
if (parsedBody==null) throw {
|
|
@@ -811,7 +811,7 @@ export class ToBtcLnAbs extends ToBtcBaseSwapHandler<ToBtcLnSwapAbs, ToBtcLnSwap
|
|
|
811
811
|
this.isTokenSupported(chainIdentifier, val) ? val : null,
|
|
812
812
|
offerer: (val: string) => val!=null &&
|
|
813
813
|
typeof(val)==="string" &&
|
|
814
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
814
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
815
815
|
exactIn: FieldTypeEnum.BooleanOptional,
|
|
816
816
|
amount: FieldTypeEnum.BigIntOptional
|
|
817
817
|
});
|
|
@@ -264,7 +264,7 @@ export class SpvVaultSwapHandler extends SwapHandler<SpvVaultSwap, SpvVaultSwapS
|
|
|
264
264
|
const parsedBody: SpvVaultSwapRequestType = await req.paramReader.getParams({
|
|
265
265
|
address: (val: string) => val!=null &&
|
|
266
266
|
typeof(val)==="string" &&
|
|
267
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
267
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
268
268
|
amount: FieldTypeEnum.BigInt,
|
|
269
269
|
token: (val: string) => val!=null &&
|
|
270
270
|
typeof(val)==="string" &&
|
|
@@ -407,7 +407,7 @@ export class FromBtcTrusted extends SwapHandler<FromBtcTrustedSwap, FromBtcTrust
|
|
|
407
407
|
const parsedBody: FromBtcTrustedRequestType = verifySchema(req.query,{
|
|
408
408
|
address: (val: string) => val!=null &&
|
|
409
409
|
typeof(val)==="string" &&
|
|
410
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
410
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
411
411
|
refundAddress: (val: string) => val==null ? "" :
|
|
412
412
|
typeof(val)==="string" &&
|
|
413
413
|
this.isValidBitcoinAddress(val) ? val : null,
|
|
@@ -325,7 +325,7 @@ export class FromBtcLnTrusted extends SwapHandler<FromBtcLnTrustedSwap, FromBtcL
|
|
|
325
325
|
address = invoice.description;
|
|
326
326
|
}
|
|
327
327
|
const { chainInterface} = this.getChain(chainIdentifier);
|
|
328
|
-
if(!chainInterface.isValidAddress(address)) throw {
|
|
328
|
+
if(!chainInterface.isValidAddress(address, true)) throw {
|
|
329
329
|
_httpStatus: 200,
|
|
330
330
|
code: 10001,
|
|
331
331
|
msg: "Invoice expired/canceled"
|
|
@@ -384,7 +384,7 @@ export class FromBtcLnTrusted extends SwapHandler<FromBtcLnTrustedSwap, FromBtcL
|
|
|
384
384
|
const parsedBody: FromBtcLnTrustedRequestType = verifySchema(req.query,{
|
|
385
385
|
address: (val: string) => val!=null &&
|
|
386
386
|
typeof(val)==="string" &&
|
|
387
|
-
chainInterface.isValidAddress(val) ? val : null,
|
|
387
|
+
chainInterface.isValidAddress(val, true) ? val : null,
|
|
388
388
|
token: (val: string) => val!=null &&
|
|
389
389
|
typeof(val)==="string" &&
|
|
390
390
|
this.isTokenSupported(chainIdentifier, val) ? val : null,
|