@atomicfinance/types 3.3.1 → 3.4.1

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.
@@ -1 +1 @@
1
- @atomicfinance/types:build: cache hit, replaying output 903ea9c0d652a133
1
+ @atomicfinance/types:build: cache hit, replaying output dae3f79f5a66ff5e
@@ -1 +1 @@
1
- @atomicfinance/types:test: cache hit, replaying output 443e642b0b864823
1
+ @atomicfinance/types:test: cache hit, replaying output ff4605f995d2ad7d
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atomicfinance/types
2
2
 
3
+ ## 3.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 9781efe: Add getInputsForDualFunding functionality and bump @node-dlc
8
+
9
+ ## 3.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 314d7d7: Add batch dlc funding transactions
14
+
3
15
  ## 3.3.1
4
16
 
5
17
  ### Patch Changes
package/dist/dlc.d.ts CHANGED
@@ -4,7 +4,7 @@ import { Tx } from '@node-lightning/bitcoin';
4
4
  import { TxOutRequest } from './common';
5
5
  import Input from './models/Input';
6
6
  export interface DlcProvider {
7
- GetInputsForAmount(amount: bigint, feeRatePerVb: bigint, fixedInputs: Input[]): Promise<Input[]>;
7
+ GetInputsForAmount(amounts: bigint[], feeRatePerVb: bigint, fixedInputs: Input[]): Promise<Input[]>;
8
8
  /**
9
9
  * Check whether wallet is offerer of DlcOffer or DlcAccept
10
10
  * @param dlcOffer Dlc Offer Message
@@ -134,10 +134,18 @@ export interface AcceptDlcOfferResponse {
134
134
  dlcAccept: DlcAccept;
135
135
  dlcTransactions: DlcTransactions;
136
136
  }
137
+ export interface BatchAcceptDlcOfferResponse {
138
+ dlcAccepts: DlcAccept[];
139
+ dlcTransactionsList: DlcTransactions[];
140
+ }
137
141
  export interface SignDlcAcceptResponse {
138
142
  dlcSign: DlcSign;
139
143
  dlcTransactions: DlcTransactions;
140
144
  }
145
+ export interface BatchSignDlcAcceptResponse {
146
+ dlcSigns: DlcSign[];
147
+ dlcTransactionsList: DlcTransactions[];
148
+ }
141
149
  export interface GetPayoutsResponse {
142
150
  payouts: PayoutRequest[];
143
151
  payoutGroups: PayoutGroup[];
@@ -263,6 +271,38 @@ export interface CreateDlcTransactionsResponse {
263
271
  fundTxHex: string;
264
272
  cetsHex: string[];
265
273
  refundTxHex: string;
274
+ } /** Create Batch Dlc transactions */
275
+ /** Create Batch Dlc transactions */
276
+ export interface CreateBatchDlcTransactionsRequest {
277
+ localPayouts: (bigint | number)[];
278
+ remotePayouts: (bigint | number)[];
279
+ numPayouts: (bigint | number)[];
280
+ localFundPubkeys: string[];
281
+ localFinalScriptPubkeys: string[];
282
+ remoteFundPubkeys: string[];
283
+ remoteFinalScriptPubkeys: string[];
284
+ localInputAmount: bigint | number;
285
+ localCollateralAmounts: (bigint | number)[];
286
+ localPayoutSerialIds: (bigint | number)[];
287
+ localChangeSerialId: bigint | number;
288
+ remoteInputAmount: bigint | number;
289
+ remoteCollateralAmounts: (bigint | number)[];
290
+ remotePayoutSerialIds: (bigint | number)[];
291
+ remoteChangeSerialId: bigint | number;
292
+ refundLocktimes: (bigint | number)[];
293
+ localInputs: TxInInfoRequest[];
294
+ localChangeScriptPubkey: string;
295
+ remoteInputs: TxInInfoRequest[];
296
+ remoteChangeScriptPubkey: string;
297
+ feeRate: number;
298
+ cetLockTime?: bigint | number;
299
+ fundLockTime?: bigint | number;
300
+ fundOutputSerialIds?: (bigint | number)[];
301
+ }
302
+ export interface CreateBatchDlcTransactionsResponse {
303
+ fundTxHex: string;
304
+ cetsHexList: string[];
305
+ refundTxHexList: string[];
266
306
  }
267
307
  /** Create a fund transaction */
268
308
  export interface CreateFundTransactionRequest {
@@ -284,6 +324,24 @@ export interface CreateFundTransactionRequest {
284
324
  export interface CreateFundTransactionResponse {
285
325
  hex: string;
286
326
  }
327
+ /** Create a batch fund transaction */
328
+ export interface CreateBatchFundTransactionRequest {
329
+ localPubkeys: string[];
330
+ remotePubkeys: string[];
331
+ outputAmounts: (bigint | number)[];
332
+ localInputs: TxInInfoRequest[];
333
+ localChange: TxOutRequest;
334
+ remoteInputs: TxInInfoRequest[];
335
+ remoteChange: TxOutRequest;
336
+ feeRate: bigint | number;
337
+ lockTime?: bigint | number;
338
+ localSerialId?: bigint | number;
339
+ remoteSerialId?: bigint | number;
340
+ outputSerialIds: (bigint | number)[];
341
+ }
342
+ export interface CreateBatchFundTransactionResponse {
343
+ hex: string;
344
+ }
287
345
  /** Create a refund transaction */
288
346
  export interface CreateRefundTransactionRequest {
289
347
  localFinalScriptPubkey: string;
package/lib/dlc.ts CHANGED
@@ -20,7 +20,7 @@ import Input from './models/Input';
20
20
 
21
21
  export interface DlcProvider {
22
22
  GetInputsForAmount(
23
- amount: bigint,
23
+ amounts: bigint[],
24
24
  feeRatePerVb: bigint,
25
25
  fixedInputs: Input[],
26
26
  ): Promise<Input[]>;
@@ -269,11 +269,21 @@ export interface AcceptDlcOfferResponse {
269
269
  dlcTransactions: DlcTransactions;
270
270
  }
271
271
 
272
+ export interface BatchAcceptDlcOfferResponse {
273
+ dlcAccepts: DlcAccept[];
274
+ dlcTransactionsList: DlcTransactions[];
275
+ }
276
+
272
277
  export interface SignDlcAcceptResponse {
273
278
  dlcSign: DlcSign;
274
279
  dlcTransactions: DlcTransactions;
275
280
  }
276
281
 
282
+ export interface BatchSignDlcAcceptResponse {
283
+ dlcSigns: DlcSign[];
284
+ dlcTransactionsList: DlcTransactions[];
285
+ }
286
+
277
287
  export interface GetPayoutsResponse {
278
288
  payouts: PayoutRequest[];
279
289
  payoutGroups: PayoutGroup[];
@@ -428,6 +438,40 @@ export interface CreateDlcTransactionsResponse {
428
438
  fundTxHex: string;
429
439
  cetsHex: string[];
430
440
  refundTxHex: string;
441
+ } /** Create Batch Dlc transactions */
442
+
443
+ /** Create Batch Dlc transactions */
444
+ export interface CreateBatchDlcTransactionsRequest {
445
+ localPayouts: (bigint | number)[];
446
+ remotePayouts: (bigint | number)[];
447
+ numPayouts: (bigint | number)[];
448
+ localFundPubkeys: string[];
449
+ localFinalScriptPubkeys: string[];
450
+ remoteFundPubkeys: string[];
451
+ remoteFinalScriptPubkeys: string[];
452
+ localInputAmount: bigint | number;
453
+ localCollateralAmounts: (bigint | number)[];
454
+ localPayoutSerialIds: (bigint | number)[];
455
+ localChangeSerialId: bigint | number;
456
+ remoteInputAmount: bigint | number;
457
+ remoteCollateralAmounts: (bigint | number)[];
458
+ remotePayoutSerialIds: (bigint | number)[];
459
+ remoteChangeSerialId: bigint | number;
460
+ refundLocktimes: (bigint | number)[];
461
+ localInputs: TxInInfoRequest[];
462
+ localChangeScriptPubkey: string;
463
+ remoteInputs: TxInInfoRequest[];
464
+ remoteChangeScriptPubkey: string;
465
+ feeRate: number;
466
+ cetLockTime?: bigint | number;
467
+ fundLockTime?: bigint | number;
468
+ fundOutputSerialIds?: (bigint | number)[];
469
+ }
470
+
471
+ export interface CreateBatchDlcTransactionsResponse {
472
+ fundTxHex: string;
473
+ cetsHexList: string[];
474
+ refundTxHexList: string[];
431
475
  }
432
476
 
433
477
  /** Create a fund transaction */
@@ -452,6 +496,26 @@ export interface CreateFundTransactionResponse {
452
496
  hex: string;
453
497
  }
454
498
 
499
+ /** Create a batch fund transaction */
500
+ export interface CreateBatchFundTransactionRequest {
501
+ localPubkeys: string[];
502
+ remotePubkeys: string[];
503
+ outputAmounts: (bigint | number)[];
504
+ localInputs: TxInInfoRequest[];
505
+ localChange: TxOutRequest;
506
+ remoteInputs: TxInInfoRequest[];
507
+ remoteChange: TxOutRequest;
508
+ feeRate: bigint | number;
509
+ lockTime?: bigint | number;
510
+ localSerialId?: bigint | number;
511
+ remoteSerialId?: bigint | number;
512
+ outputSerialIds: (bigint | number)[];
513
+ }
514
+
515
+ export interface CreateBatchFundTransactionResponse {
516
+ hex: string;
517
+ }
518
+
455
519
  /** Create a refund transaction */
456
520
  export interface CreateRefundTransactionRequest {
457
521
  localFinalScriptPubkey: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atomicfinance/types",
3
3
  "umdName": "Types",
4
- "version": "3.3.1",
4
+ "version": "3.4.1",
5
5
  "description": "Bitcoin Abstraction Layer Types",
6
6
  "author": "Atomic Finance <info@atomic.finance>",
7
7
  "homepage": "",
@@ -15,7 +15,7 @@
15
15
  "lint:fix": "../../node_modules/.bin/eslint --fix --ignore-path ../../.eslintignore -c ../../.eslintrc.js ."
16
16
  },
17
17
  "dependencies": {
18
- "@node-dlc/messaging": "0.22.4",
18
+ "@node-dlc/messaging": "0.23.0",
19
19
  "@node-lightning/bitcoin": "0.26.1",
20
20
  "@node-lightning/noise": "0.26.1",
21
21
  "lodash": "^4.17.20"