@bennyblader/ddk-rn 0.3.22 → 0.3.25

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.
@@ -85,6 +85,16 @@ interface NativeModuleInterface {
85
85
  fundOutputSerialId: bigint,
86
86
  uniffi_out_err: UniffiRustCallStatus
87
87
  ): Uint8Array;
88
+ ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path(
89
+ extkey: Uint8Array,
90
+ path: Uint8Array,
91
+ uniffi_out_err: UniffiRustCallStatus
92
+ ): Uint8Array;
93
+ ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed(
94
+ seed: Uint8Array,
95
+ network: Uint8Array,
96
+ uniffi_out_err: UniffiRustCallStatus
97
+ ): Uint8Array;
88
98
  ubrn_uniffi_ddk_ffi_fn_func_create_fund_tx_locking_script(
89
99
  localFundPubkey: Uint8Array,
90
100
  remoteFundPubkey: Uint8Array,
@@ -112,7 +122,7 @@ interface NativeModuleInterface {
112
122
  uniffi_out_err: UniffiRustCallStatus
113
123
  ): Uint8Array;
114
124
  ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path(
115
- xpriv: Uint8Array,
125
+ seedOrXpriv: Uint8Array,
116
126
  baseDerivationPath: Uint8Array,
117
127
  network: Uint8Array,
118
128
  path: Uint8Array,
@@ -123,6 +133,11 @@ interface NativeModuleInterface {
123
133
  feeRate: bigint,
124
134
  uniffi_out_err: UniffiRustCallStatus
125
135
  ): Uint8Array;
136
+ ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey(
137
+ extkey: Uint8Array,
138
+ network: Uint8Array,
139
+ uniffi_out_err: UniffiRustCallStatus
140
+ ): Uint8Array;
126
141
  ubrn_uniffi_ddk_ffi_fn_func_get_raw_funding_transaction_input_signature(
127
142
  fundingTransaction: Uint8Array,
128
143
  privkey: Uint8Array,
@@ -208,11 +223,14 @@ interface NativeModuleInterface {
208
223
  ubrn_uniffi_ddk_ffi_checksum_func_create_cet_adaptor_sigs_from_oracle_info(): number;
209
224
  ubrn_uniffi_ddk_ffi_checksum_func_create_cets(): number;
210
225
  ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions(): number;
226
+ ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path(): number;
227
+ ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed(): number;
211
228
  ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script(): number;
212
229
  ubrn_uniffi_ddk_ffi_checksum_func_create_refund_transaction(): number;
213
230
  ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions(): number;
214
231
  ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path(): number;
215
232
  ubrn_uniffi_ddk_ffi_checksum_func_get_change_output_and_fees(): number;
233
+ ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey(): number;
216
234
  ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature(): number;
217
235
  ubrn_uniffi_ddk_ffi_checksum_func_get_total_input_vsize(): number;
218
236
  ubrn_uniffi_ddk_ffi_checksum_func_get_xpub_from_xpriv(): number;
package/src/ddk_ffi.ts CHANGED
@@ -287,6 +287,56 @@ export function createDlcTransactions(
287
287
  )
288
288
  );
289
289
  }
290
+ export function createExtkeyFromParentPath(
291
+ extkey: Array</*u8*/ number>,
292
+ path: string
293
+ ): Array</*u8*/ number> /*throws*/ {
294
+ return FfiConverterArrayUInt8.lift(
295
+ uniffiCaller.rustCallWithError(
296
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
297
+ FfiConverterTypeDLCError
298
+ ),
299
+ /*caller:*/ (callStatus) => {
300
+ return (() => {
301
+ console.debug(
302
+ `-- uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path`
303
+ );
304
+ return nativeModule()
305
+ .ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_parent_path;
306
+ })()(
307
+ FfiConverterArrayUInt8.lower(extkey),
308
+ FfiConverterString.lower(path),
309
+ callStatus
310
+ );
311
+ },
312
+ /*liftString:*/ FfiConverterString.lift
313
+ )
314
+ );
315
+ }
316
+ export function createExtkeyFromSeed(
317
+ seed: Array</*u8*/ number>,
318
+ network: string
319
+ ): Array</*u8*/ number> /*throws*/ {
320
+ return FfiConverterArrayUInt8.lift(
321
+ uniffiCaller.rustCallWithError(
322
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
323
+ FfiConverterTypeDLCError
324
+ ),
325
+ /*caller:*/ (callStatus) => {
326
+ return (() => {
327
+ console.debug(`-- uniffi_ddk_ffi_fn_func_create_extkey_from_seed`);
328
+ return nativeModule()
329
+ .ubrn_uniffi_ddk_ffi_fn_func_create_extkey_from_seed;
330
+ })()(
331
+ FfiConverterArrayUInt8.lower(seed),
332
+ FfiConverterString.lower(network),
333
+ callStatus
334
+ );
335
+ },
336
+ /*liftString:*/ FfiConverterString.lift
337
+ )
338
+ );
339
+ }
290
340
  export function createFundTxLockingScript(
291
341
  localFundPubkey: Array</*u8*/ number>,
292
342
  remoteFundPubkey: Array</*u8*/ number>
@@ -386,7 +436,7 @@ export function createSplicedDlcTransactions(
386
436
  );
387
437
  }
388
438
  export function createXprivFromParentPath(
389
- xpriv: Array</*u8*/ number>,
439
+ seedOrXpriv: Array</*u8*/ number>,
390
440
  baseDerivationPath: string,
391
441
  network: string,
392
442
  path: string
@@ -404,7 +454,7 @@ export function createXprivFromParentPath(
404
454
  return nativeModule()
405
455
  .ubrn_uniffi_ddk_ffi_fn_func_create_xpriv_from_parent_path;
406
456
  })()(
407
- FfiConverterArrayUInt8.lower(xpriv),
457
+ FfiConverterArrayUInt8.lower(seedOrXpriv),
408
458
  FfiConverterString.lower(baseDerivationPath),
409
459
  FfiConverterString.lower(network),
410
460
  FfiConverterString.lower(path),
@@ -439,6 +489,30 @@ export function getChangeOutputAndFees(
439
489
  )
440
490
  );
441
491
  }
492
+ export function getPubkeyFromExtkey(
493
+ extkey: Array</*u8*/ number>,
494
+ network: string
495
+ ): Array</*u8*/ number> /*throws*/ {
496
+ return FfiConverterArrayUInt8.lift(
497
+ uniffiCaller.rustCallWithError(
498
+ /*liftError:*/ FfiConverterTypeDLCError.lift.bind(
499
+ FfiConverterTypeDLCError
500
+ ),
501
+ /*caller:*/ (callStatus) => {
502
+ return (() => {
503
+ console.debug(`-- uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey`);
504
+ return nativeModule()
505
+ .ubrn_uniffi_ddk_ffi_fn_func_get_pubkey_from_extkey;
506
+ })()(
507
+ FfiConverterArrayUInt8.lower(extkey),
508
+ FfiConverterString.lower(network),
509
+ callStatus
510
+ );
511
+ },
512
+ /*liftString:*/ FfiConverterString.lift
513
+ )
514
+ );
515
+ }
442
516
  export function getRawFundingTransactionInputSignature(
443
517
  fundingTransaction: Transaction,
444
518
  privkey: Array</*u8*/ number>,
@@ -2082,6 +2156,22 @@ function uniffiEnsureInitialized() {
2082
2156
  'uniffi_ddk_ffi_checksum_func_create_dlc_transactions'
2083
2157
  );
2084
2158
  }
2159
+ if (
2160
+ nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path() !==
2161
+ 26671
2162
+ ) {
2163
+ throw new UniffiInternalError.ApiChecksumMismatch(
2164
+ 'uniffi_ddk_ffi_checksum_func_create_extkey_from_parent_path'
2165
+ );
2166
+ }
2167
+ if (
2168
+ nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_extkey_from_seed() !==
2169
+ 12526
2170
+ ) {
2171
+ throw new UniffiInternalError.ApiChecksumMismatch(
2172
+ 'uniffi_ddk_ffi_checksum_func_create_extkey_from_seed'
2173
+ );
2174
+ }
2085
2175
  if (
2086
2176
  nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_fund_tx_locking_script() !==
2087
2177
  2761
@@ -2108,7 +2198,7 @@ function uniffiEnsureInitialized() {
2108
2198
  }
2109
2199
  if (
2110
2200
  nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path() !==
2111
- 50010
2201
+ 34808
2112
2202
  ) {
2113
2203
  throw new UniffiInternalError.ApiChecksumMismatch(
2114
2204
  'uniffi_ddk_ffi_checksum_func_create_xpriv_from_parent_path'
@@ -2122,6 +2212,14 @@ function uniffiEnsureInitialized() {
2122
2212
  'uniffi_ddk_ffi_checksum_func_get_change_output_and_fees'
2123
2213
  );
2124
2214
  }
2215
+ if (
2216
+ nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey() !==
2217
+ 64637
2218
+ ) {
2219
+ throw new UniffiInternalError.ApiChecksumMismatch(
2220
+ 'uniffi_ddk_ffi_checksum_func_get_pubkey_from_extkey'
2221
+ );
2222
+ }
2125
2223
  if (
2126
2224
  nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_get_raw_funding_transaction_input_signature() !==
2127
2225
  35708