thunder-bridge 2.1.1 → 2.2.0

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/index.d.cts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { R as Resolved } from './qr-CF-YeXU1.cjs';
2
- import { T as ThunderBridge, g as ThunderBridgeOptions, W as WaitOptions } from './bank-CEIuNhV_.cjs';
3
- export { A as AttendOptions, h as BankRailConfig, d as BankVerifyConfig, i as BlindLightningRailConfig, j as CreateOptions, F as FollowOptions, H as Handler, L as Leg, k as LightningRailConfig, l as LightningVerifyConfig, M as Minted, O as Order, P as PaymentRequest, m as PaymentRequestInit, n as PaymentRequestOptions, o as Provable, p as Proven, f as Rail, R as RailConfig, q as Rails, r as Range, s as Relayed, t as Send, u as Serve, v as TicketOptions, w as TriggerConfig, x as WatchTicketConfig, y as WebhookCredential, z as WebhookHandlers, D as WebhookOptions, E as WrapAllowance, G as answerVerifyChallenge, I as carriesProof, J as invoiceFrom, K as proveOrigin, N as proveSettlement, Q as proveWrapped, U as relayedVerifyUrl, V as wrapFeeCeiling } from './bank-CEIuNhV_.cjs';
2
+ import { T as ThunderBridge, r as ThunderBridgeOptions, W as WaitOptions } from './bank-Bg6RjuO-.cjs';
3
+ export { A as AttendOptions, s as BankRailConfig, d as BankVerifyConfig, t as BlindLightningRailConfig, u as CreateOptions, F as FollowOptions, H as Handler, L as Leg, v as LightningRailConfig, w as LightningVerifyConfig, M as Minted, N as NwcConnection, h as NwcRailConfig, i as NwcVerifyConfig, O as Order, P as PaymentRequest, x as PaymentRequestInit, y as PaymentRequestOptions, z as Provable, D as Proven, R as Rail, E as RailConfig, G as Rails, I as Range, J as Relayed, K as SelfConsistent, Q as Send, U as Serve, V as TicketOptions, X as TriggerConfig, Y as WatchTicketConfig, Z as WebhookCredential, _ as WebhookHandlers, $ as WebhookOptions, a0 as WrapAllowance, a1 as agreesWithItself, a2 as answerVerifyChallenge, a3 as carriesProof, a4 as invoiceFrom, a5 as proveOrigin, a6 as proveSettlement, a7 as proveWrapped, a8 as relayedVerifyUrl, a9 as wrapFeeCeiling } from './bank-Bg6RjuO-.cjs';
4
4
  import { H as Handover, P as Payment, e as Held } from './types-DYZ9EkmJ.cjs';
5
5
  export { A as Amount, C as Charge, F as FiatOptions, f as MintedPayment, g as Msat, h as PaymentStatus, i as Priced, Q as Quote, S as Settlement, j as SocketTicket, W as WalletFailure, l as WalletReason, n as WatchedPayment, o as fiat, p as msat, s as sats } from './types-DYZ9EkmJ.cjs';
6
- export { A as AmountError, a as AmountFault, G as GatewayCheatCode, b as GatewayCheatError, I as IdempotencyConflict, c as IdempotencyConflictError, N as NoWalletAvailableError, P as ProblemError, U as UnverifiedRecipientError, W as WrapRefusalCode, d as WrapRefusedError } from './errors-DriqW-lp.cjs';
6
+ import { G as GatewayCheatError } from './errors-DJmsalYZ.cjs';
7
+ export { A as AmountError, a as AmountFault, b as GatewayCheatCode, I as IdempotencyConflict, c as IdempotencyConflictError, N as NoWalletAvailableError, P as ProblemError, U as UnverifiedRecipientError, W as WrapRefusalCode, d as WrapRefusedError } from './errors-DJmsalYZ.cjs';
7
8
 
8
9
  /** What a BOLT11 invoice says about itself, every field null when it does not carry one */
9
10
  interface Invoice {
@@ -43,6 +44,13 @@ interface GatewaysOptions extends ThunderBridgeOptions {
43
44
  * than finding out when the one that took it goes away
44
45
  */
45
46
  onRefused?: (baseUrl: string, refusal: unknown) => void;
47
+ /**
48
+ * Called for a gateway caught lying about the payment while you waited on it,
49
+ * with its url and what gave it away. The wait goes on at the others, because
50
+ * one gateway that lies is what watching at several is for, so this is how you
51
+ * learn which one to stop trusting rather than never hearing of it
52
+ */
53
+ onCaught?: (baseUrl: string, cheat: GatewayCheatError) => void;
46
54
  }
47
55
  /**
48
56
  * The same payment watched at several gateways at once, which is what makes any
@@ -57,6 +65,7 @@ declare class Gateways {
57
65
  readonly each: readonly ThunderBridge[];
58
66
  private readonly urls;
59
67
  private readonly onRefused;
68
+ private readonly onCaught;
60
69
  constructor(baseUrls: string[], options?: GatewaysOptions);
61
70
  /** What this payment is called, which every gateway here will agree on */
62
71
  nameFor(paymentHash: string): Promise<string | null>;
@@ -75,4 +84,4 @@ declare class Gateways {
75
84
  settled(held: Held, options?: WaitOptions): Promise<Payment>;
76
85
  }
77
86
 
78
- export { Gateways, type GatewaysOptions, Handover, Held, type Invoice, Payment, ThunderBridge, ThunderBridgeOptions, WaitOptions, decodeInvoice, preimageMatchesHash, seal, unseal };
87
+ export { GatewayCheatError, Gateways, type GatewaysOptions, Handover, Held, type Invoice, Payment, ThunderBridge, ThunderBridgeOptions, WaitOptions, decodeInvoice, preimageMatchesHash, seal, unseal };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { R as Resolved } from './qr-CF-YeXU1.js';
2
- import { T as ThunderBridge, g as ThunderBridgeOptions, W as WaitOptions } from './bank-M8flcMks.js';
3
- export { A as AttendOptions, h as BankRailConfig, d as BankVerifyConfig, i as BlindLightningRailConfig, j as CreateOptions, F as FollowOptions, H as Handler, L as Leg, k as LightningRailConfig, l as LightningVerifyConfig, M as Minted, O as Order, P as PaymentRequest, m as PaymentRequestInit, n as PaymentRequestOptions, o as Provable, p as Proven, f as Rail, R as RailConfig, q as Rails, r as Range, s as Relayed, t as Send, u as Serve, v as TicketOptions, w as TriggerConfig, x as WatchTicketConfig, y as WebhookCredential, z as WebhookHandlers, D as WebhookOptions, E as WrapAllowance, G as answerVerifyChallenge, I as carriesProof, J as invoiceFrom, K as proveOrigin, N as proveSettlement, Q as proveWrapped, U as relayedVerifyUrl, V as wrapFeeCeiling } from './bank-M8flcMks.js';
2
+ import { T as ThunderBridge, r as ThunderBridgeOptions, W as WaitOptions } from './bank-B5MxT_6u.js';
3
+ export { A as AttendOptions, s as BankRailConfig, d as BankVerifyConfig, t as BlindLightningRailConfig, u as CreateOptions, F as FollowOptions, H as Handler, L as Leg, v as LightningRailConfig, w as LightningVerifyConfig, M as Minted, N as NwcConnection, h as NwcRailConfig, i as NwcVerifyConfig, O as Order, P as PaymentRequest, x as PaymentRequestInit, y as PaymentRequestOptions, z as Provable, D as Proven, R as Rail, E as RailConfig, G as Rails, I as Range, J as Relayed, K as SelfConsistent, Q as Send, U as Serve, V as TicketOptions, X as TriggerConfig, Y as WatchTicketConfig, Z as WebhookCredential, _ as WebhookHandlers, $ as WebhookOptions, a0 as WrapAllowance, a1 as agreesWithItself, a2 as answerVerifyChallenge, a3 as carriesProof, a4 as invoiceFrom, a5 as proveOrigin, a6 as proveSettlement, a7 as proveWrapped, a8 as relayedVerifyUrl, a9 as wrapFeeCeiling } from './bank-B5MxT_6u.js';
4
4
  import { H as Handover, P as Payment, e as Held } from './types-DYZ9EkmJ.js';
5
5
  export { A as Amount, C as Charge, F as FiatOptions, f as MintedPayment, g as Msat, h as PaymentStatus, i as Priced, Q as Quote, S as Settlement, j as SocketTicket, W as WalletFailure, l as WalletReason, n as WatchedPayment, o as fiat, p as msat, s as sats } from './types-DYZ9EkmJ.js';
6
- export { A as AmountError, a as AmountFault, G as GatewayCheatCode, b as GatewayCheatError, I as IdempotencyConflict, c as IdempotencyConflictError, N as NoWalletAvailableError, P as ProblemError, U as UnverifiedRecipientError, W as WrapRefusalCode, d as WrapRefusedError } from './errors-ZEUT-MhO.js';
6
+ import { G as GatewayCheatError } from './errors-VX0R18oE.js';
7
+ export { A as AmountError, a as AmountFault, b as GatewayCheatCode, I as IdempotencyConflict, c as IdempotencyConflictError, N as NoWalletAvailableError, P as ProblemError, U as UnverifiedRecipientError, W as WrapRefusalCode, d as WrapRefusedError } from './errors-VX0R18oE.js';
7
8
 
8
9
  /** What a BOLT11 invoice says about itself, every field null when it does not carry one */
9
10
  interface Invoice {
@@ -43,6 +44,13 @@ interface GatewaysOptions extends ThunderBridgeOptions {
43
44
  * than finding out when the one that took it goes away
44
45
  */
45
46
  onRefused?: (baseUrl: string, refusal: unknown) => void;
47
+ /**
48
+ * Called for a gateway caught lying about the payment while you waited on it,
49
+ * with its url and what gave it away. The wait goes on at the others, because
50
+ * one gateway that lies is what watching at several is for, so this is how you
51
+ * learn which one to stop trusting rather than never hearing of it
52
+ */
53
+ onCaught?: (baseUrl: string, cheat: GatewayCheatError) => void;
46
54
  }
47
55
  /**
48
56
  * The same payment watched at several gateways at once, which is what makes any
@@ -57,6 +65,7 @@ declare class Gateways {
57
65
  readonly each: readonly ThunderBridge[];
58
66
  private readonly urls;
59
67
  private readonly onRefused;
68
+ private readonly onCaught;
60
69
  constructor(baseUrls: string[], options?: GatewaysOptions);
61
70
  /** What this payment is called, which every gateway here will agree on */
62
71
  nameFor(paymentHash: string): Promise<string | null>;
@@ -75,4 +84,4 @@ declare class Gateways {
75
84
  settled(held: Held, options?: WaitOptions): Promise<Payment>;
76
85
  }
77
86
 
78
- export { Gateways, type GatewaysOptions, Handover, Held, type Invoice, Payment, ThunderBridge, ThunderBridgeOptions, WaitOptions, decodeInvoice, preimageMatchesHash, seal, unseal };
87
+ export { GatewayCheatError, Gateways, type GatewaysOptions, Handover, Held, type Invoice, Payment, ThunderBridge, ThunderBridgeOptions, WaitOptions, decodeInvoice, preimageMatchesHash, seal, unseal };