@atomicfinance/bitcoin-ddk-provider 4.1.12 → 4.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +27 -0
- package/dist/BitcoinDdkProvider.d.ts +28 -23
- package/dist/BitcoinDdkProvider.js +219 -349
- package/dist/BitcoinDdkProvider.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/Utils.d.ts +66 -1
- package/dist/utils/Utils.js +255 -0
- package/dist/utils/Utils.js.map +1 -1
- package/lib/BitcoinDdkProvider.ts +394 -449
- package/lib/index.ts +1 -0
- package/lib/utils/Utils.ts +332 -0
- package/package.json +5 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @atomicfinance/bitcoin-ddk-provider@4.
|
|
3
|
+
> @atomicfinance/bitcoin-ddk-provider@4.2.0 build /Users/matthewblack/code/github.com/AtomicFinance/bitcoin-abstraction-layer/packages/bitcoin-ddk-provider
|
|
4
4
|
> ../../node_modules/.bin/tsc --project tsconfig.json
|
|
5
5
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atomicfinance/bitcoin-ddk-provider
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ec43a60: Implement DDK DLC splicing support + util refactor
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- b718514: Refactor funding input sorting
|
|
12
|
+
- Updated dependencies [ec43a60]
|
|
13
|
+
- Updated dependencies [b718514]
|
|
14
|
+
- @atomicfinance/bitcoin-utils@4.2.0
|
|
15
|
+
- @atomicfinance/provider@4.2.0
|
|
16
|
+
- @atomicfinance/types@4.2.0
|
|
17
|
+
- @atomicfinance/utils@4.2.0
|
|
18
|
+
|
|
19
|
+
## 4.1.13
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 9674167: Ensure consistent sequence numbers in funding sig verification
|
|
24
|
+
- Updated dependencies [9674167]
|
|
25
|
+
- @atomicfinance/bitcoin-utils@4.1.13
|
|
26
|
+
- @atomicfinance/provider@4.1.13
|
|
27
|
+
- @atomicfinance/types@4.1.13
|
|
28
|
+
- @atomicfinance/utils@4.1.13
|
|
29
|
+
|
|
3
30
|
## 4.1.12
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -8,26 +8,6 @@ export default class BitcoinDdkProvider extends Provider {
|
|
|
8
8
|
private _ddk;
|
|
9
9
|
constructor(network: BitcoinNetwork, ddkLib: DdkInterface);
|
|
10
10
|
DdkLoaded(): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Helper function to ensure we have a Buffer object
|
|
13
|
-
* Handles cases where Buffer objects have been serialized/deserialized
|
|
14
|
-
*/
|
|
15
|
-
private ensureBuffer;
|
|
16
|
-
/**
|
|
17
|
-
* Detect if signature is in compact format (64 bytes) or DER format
|
|
18
|
-
* and convert compact to DER if needed, adding SIGHASH_ALL flag
|
|
19
|
-
*/
|
|
20
|
-
private ensureDerSignature;
|
|
21
|
-
/**
|
|
22
|
-
* Detect if signature is in DER format and convert to compact format (64 bytes)
|
|
23
|
-
* by extracting r and s values, removing SIGHASH flag if present
|
|
24
|
-
*/
|
|
25
|
-
private ensureCompactSignature;
|
|
26
|
-
/**
|
|
27
|
-
* Compute contract ID from fund transaction ID, output index, and temporary contract ID
|
|
28
|
-
* Matches the Rust implementation in rust-dlc
|
|
29
|
-
*/
|
|
30
|
-
private computeContractId;
|
|
31
11
|
/**
|
|
32
12
|
* Create refund signature using PSBT method instead of DDK
|
|
33
13
|
*/
|
|
@@ -84,13 +64,38 @@ export default class BitcoinDdkProvider extends Provider {
|
|
|
84
64
|
private getFundOutputValueSats;
|
|
85
65
|
private CreateCetAdaptorAndRefundSigs;
|
|
86
66
|
private VerifyCetAdaptorAndRefundSigs;
|
|
87
|
-
private
|
|
88
|
-
private
|
|
67
|
+
private CreateFundingSigs;
|
|
68
|
+
private VerifyFundingSigs;
|
|
69
|
+
/**
|
|
70
|
+
* Get sighash for funding transaction inputs
|
|
71
|
+
* @param dlcOffer DLC Offer
|
|
72
|
+
* @param dlcAccept DLC Accept
|
|
73
|
+
* @param dlcTxs DLC Transactions
|
|
74
|
+
* @param inputIndex Index of the input to get sighash for (optional, if not provided returns all)
|
|
75
|
+
* @returns Array of sighashes for each input or single sighash if inputIndex specified
|
|
76
|
+
*/
|
|
77
|
+
getFundingTransactionSighash(dlcOffer: DlcOffer, dlcAccept: DlcAccept, dlcTxs: DlcTransactions, inputIndex?: number): Promise<string[] | string>;
|
|
78
|
+
/**
|
|
79
|
+
* Get detailed sighash information for funding transaction (useful for debugging)
|
|
80
|
+
* @param dlcOffer DLC Offer
|
|
81
|
+
* @param dlcAccept DLC Accept
|
|
82
|
+
* @param dlcTxs DLC Transactions
|
|
83
|
+
* @returns Detailed sighash information for each input
|
|
84
|
+
*/
|
|
85
|
+
getFundingTransactionSighashDetails(dlcOffer: DlcOffer, dlcAccept: DlcAccept, dlcTxs: DlcTransactions): Promise<Array<{
|
|
86
|
+
inputIndex: number;
|
|
87
|
+
txid: string;
|
|
88
|
+
vout: number;
|
|
89
|
+
sequence: number;
|
|
90
|
+
scriptPubKey: string;
|
|
91
|
+
value: number;
|
|
92
|
+
sighash: string;
|
|
93
|
+
}>>;
|
|
89
94
|
private VerifyRefundSignatureAlt;
|
|
90
95
|
private CreateFundingScript;
|
|
91
96
|
private CreateFundingTx;
|
|
92
97
|
FindOutcomeIndexFromPolynomialPayoutCurvePiece(dlcOffer: DlcOffer, contractDescriptor: NumericalDescriptor, contractOraclePairIndex: number, polynomialPayoutCurvePiece: PolynomialPayoutCurvePiece, oracleAttestation: OracleAttestation, outcome: bigint): Promise<FindOutcomeResponse>;
|
|
93
|
-
FindOutcomeIndexFromHyperbolaPayoutCurvePiece(
|
|
98
|
+
FindOutcomeIndexFromHyperbolaPayoutCurvePiece(dlcOffer: DlcOffer, contractDescriptor: NumericalDescriptor, contractOraclePairIndex: number, hyperbolaPayoutCurvePiece: HyperbolaPayoutCurvePiece, oracleAttestation: OracleAttestation, outcome: bigint): Promise<FindOutcomeResponse>;
|
|
94
99
|
FindOutcomeIndex(dlcOffer: DlcOffer, oracleAttestation: OracleAttestation): Promise<FindOutcomeResponse>;
|
|
95
100
|
ValidateEvent(dlcOffer: DlcOffer, oracleAttestation: OracleAttestation): void;
|
|
96
101
|
FindAndSignCet(dlcOffer: DlcOffer, dlcAccept: DlcAccept, dlcSign: DlcSign, dlcTxs: DlcTransactions, oracleAttestation: OracleAttestation, isOfferer?: boolean): Promise<Tx>;
|