@bennyblader/ddk-rn 0.3.4 → 0.3.5
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/ddk-ffi/Cargo.lock +2 -2
- package/ddk-ffi/Cargo.toml +1 -1
- package/ddk-ffi/src/ddk_ffi.udl +3 -9
- package/ddk-ffi/src/lib.rs +15 -21
- package/lib/commonjs/ddk_ffi.js +10 -54
- package/lib/commonjs/ddk_ffi.js.map +1 -1
- package/lib/module/ddk_ffi.js +9 -53
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +3 -33
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +3 -33
- package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ddk_ffi.ts +14 -73
package/src/ddk_ffi.ts
CHANGED
|
@@ -191,7 +191,7 @@ export function createCets(
|
|
|
191
191
|
fundVout: /*u32*/ number,
|
|
192
192
|
localFinalScriptPubkey: Array</*u8*/ number>,
|
|
193
193
|
remoteFinalScriptPubkey: Array</*u8*/ number>,
|
|
194
|
-
outcomes: Array<
|
|
194
|
+
outcomes: Array<Payout>,
|
|
195
195
|
lockTime: /*u32*/ number,
|
|
196
196
|
localSerialId: /*u64*/ bigint,
|
|
197
197
|
remoteSerialId: /*u64*/ bigint
|
|
@@ -210,7 +210,7 @@ export function createCets(
|
|
|
210
210
|
FfiConverterUInt32.lower(fundVout),
|
|
211
211
|
FfiConverterArrayUInt8.lower(localFinalScriptPubkey),
|
|
212
212
|
FfiConverterArrayUInt8.lower(remoteFinalScriptPubkey),
|
|
213
|
-
|
|
213
|
+
FfiConverterArrayTypePayout.lower(outcomes),
|
|
214
214
|
FfiConverterUInt32.lower(lockTime),
|
|
215
215
|
FfiConverterUInt64.lower(localSerialId),
|
|
216
216
|
FfiConverterUInt64.lower(remoteSerialId),
|
|
@@ -222,7 +222,7 @@ export function createCets(
|
|
|
222
222
|
);
|
|
223
223
|
}
|
|
224
224
|
export function createDlcTransactions(
|
|
225
|
-
outcomes: Array<
|
|
225
|
+
outcomes: Array<Payout>,
|
|
226
226
|
localParams: PartyParams,
|
|
227
227
|
remoteParams: PartyParams,
|
|
228
228
|
refundLocktime: /*u32*/ number,
|
|
@@ -242,7 +242,7 @@ export function createDlcTransactions(
|
|
|
242
242
|
return nativeModule()
|
|
243
243
|
.ubrn_uniffi_ddk_ffi_fn_func_create_dlc_transactions;
|
|
244
244
|
})()(
|
|
245
|
-
|
|
245
|
+
FfiConverterArrayTypePayout.lower(outcomes),
|
|
246
246
|
FfiConverterTypePartyParams.lower(localParams),
|
|
247
247
|
FfiConverterTypePartyParams.lower(remoteParams),
|
|
248
248
|
FfiConverterUInt32.lower(refundLocktime),
|
|
@@ -318,7 +318,7 @@ export function createRefundTransaction(
|
|
|
318
318
|
);
|
|
319
319
|
}
|
|
320
320
|
export function createSplicedDlcTransactions(
|
|
321
|
-
outcomes: Array<
|
|
321
|
+
outcomes: Array<Payout>,
|
|
322
322
|
localParams: PartyParams,
|
|
323
323
|
remoteParams: PartyParams,
|
|
324
324
|
refundLocktime: /*u32*/ number,
|
|
@@ -340,7 +340,7 @@ export function createSplicedDlcTransactions(
|
|
|
340
340
|
return nativeModule()
|
|
341
341
|
.ubrn_uniffi_ddk_ffi_fn_func_create_spliced_dlc_transactions;
|
|
342
342
|
})()(
|
|
343
|
-
|
|
343
|
+
FfiConverterArrayTypePayout.lower(outcomes),
|
|
344
344
|
FfiConverterTypePartyParams.lower(localParams),
|
|
345
345
|
FfiConverterTypePartyParams.lower(remoteParams),
|
|
346
346
|
FfiConverterUInt32.lower(refundLocktime),
|
|
@@ -870,64 +870,6 @@ const FfiConverterTypeDlcInputInfo = (() => {
|
|
|
870
870
|
return new FFIConverter();
|
|
871
871
|
})();
|
|
872
872
|
|
|
873
|
-
export type DlcOutcome = {
|
|
874
|
-
localPayout: /*u64*/ bigint;
|
|
875
|
-
remotePayout: /*u64*/ bigint;
|
|
876
|
-
};
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* Generated factory for {@link DlcOutcome} record objects.
|
|
880
|
-
*/
|
|
881
|
-
export const DlcOutcome = (() => {
|
|
882
|
-
const defaults = () => ({});
|
|
883
|
-
const create = (() => {
|
|
884
|
-
return uniffiCreateRecord<DlcOutcome, ReturnType<typeof defaults>>(
|
|
885
|
-
defaults
|
|
886
|
-
);
|
|
887
|
-
})();
|
|
888
|
-
return Object.freeze({
|
|
889
|
-
/**
|
|
890
|
-
* Create a frozen instance of {@link DlcOutcome}, with defaults specified
|
|
891
|
-
* in Rust, in the {@link ddk_ffi} crate.
|
|
892
|
-
*/
|
|
893
|
-
create,
|
|
894
|
-
|
|
895
|
-
/**
|
|
896
|
-
* Create a frozen instance of {@link DlcOutcome}, with defaults specified
|
|
897
|
-
* in Rust, in the {@link ddk_ffi} crate.
|
|
898
|
-
*/
|
|
899
|
-
new: create,
|
|
900
|
-
|
|
901
|
-
/**
|
|
902
|
-
* Defaults specified in the {@link ddk_ffi} crate.
|
|
903
|
-
*/
|
|
904
|
-
defaults: () => Object.freeze(defaults()) as Partial<DlcOutcome>,
|
|
905
|
-
});
|
|
906
|
-
})();
|
|
907
|
-
|
|
908
|
-
const FfiConverterTypeDlcOutcome = (() => {
|
|
909
|
-
type TypeName = DlcOutcome;
|
|
910
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
911
|
-
read(from: RustBuffer): TypeName {
|
|
912
|
-
return {
|
|
913
|
-
localPayout: FfiConverterUInt64.read(from),
|
|
914
|
-
remotePayout: FfiConverterUInt64.read(from),
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
write(value: TypeName, into: RustBuffer): void {
|
|
918
|
-
FfiConverterUInt64.write(value.localPayout, into);
|
|
919
|
-
FfiConverterUInt64.write(value.remotePayout, into);
|
|
920
|
-
}
|
|
921
|
-
allocationSize(value: TypeName): number {
|
|
922
|
-
return (
|
|
923
|
-
FfiConverterUInt64.allocationSize(value.localPayout) +
|
|
924
|
-
FfiConverterUInt64.allocationSize(value.remotePayout)
|
|
925
|
-
);
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
return new FFIConverter();
|
|
929
|
-
})();
|
|
930
|
-
|
|
931
873
|
export type DlcTransactions = {
|
|
932
874
|
fund: Transaction;
|
|
933
875
|
cets: Array<Transaction>;
|
|
@@ -1960,16 +1902,16 @@ const FfiConverterArrayTypeDlcInputInfo = new FfiConverterArray(
|
|
|
1960
1902
|
FfiConverterTypeDlcInputInfo
|
|
1961
1903
|
);
|
|
1962
1904
|
|
|
1963
|
-
// FfiConverter for Array<DlcOutcome>
|
|
1964
|
-
const FfiConverterArrayTypeDlcOutcome = new FfiConverterArray(
|
|
1965
|
-
FfiConverterTypeDlcOutcome
|
|
1966
|
-
);
|
|
1967
|
-
|
|
1968
1905
|
// FfiConverter for Array<OracleInfo>
|
|
1969
1906
|
const FfiConverterArrayTypeOracleInfo = new FfiConverterArray(
|
|
1970
1907
|
FfiConverterTypeOracleInfo
|
|
1971
1908
|
);
|
|
1972
1909
|
|
|
1910
|
+
// FfiConverter for Array<Payout>
|
|
1911
|
+
const FfiConverterArrayTypePayout = new FfiConverterArray(
|
|
1912
|
+
FfiConverterTypePayout
|
|
1913
|
+
);
|
|
1914
|
+
|
|
1973
1915
|
// FfiConverter for Array<Transaction>
|
|
1974
1916
|
const FfiConverterArrayTypeTransaction = new FfiConverterArray(
|
|
1975
1917
|
FfiConverterTypeTransaction
|
|
@@ -2055,7 +1997,7 @@ function uniffiEnsureInitialized() {
|
|
|
2055
1997
|
);
|
|
2056
1998
|
}
|
|
2057
1999
|
if (
|
|
2058
|
-
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !==
|
|
2000
|
+
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_cets() !== 50529
|
|
2059
2001
|
) {
|
|
2060
2002
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2061
2003
|
'uniffi_ddk_ffi_checksum_func_create_cets'
|
|
@@ -2063,7 +2005,7 @@ function uniffiEnsureInitialized() {
|
|
|
2063
2005
|
}
|
|
2064
2006
|
if (
|
|
2065
2007
|
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_dlc_transactions() !==
|
|
2066
|
-
|
|
2008
|
+
29518
|
|
2067
2009
|
) {
|
|
2068
2010
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2069
2011
|
'uniffi_ddk_ffi_checksum_func_create_dlc_transactions'
|
|
@@ -2087,7 +2029,7 @@ function uniffiEnsureInitialized() {
|
|
|
2087
2029
|
}
|
|
2088
2030
|
if (
|
|
2089
2031
|
nativeModule().ubrn_uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions() !==
|
|
2090
|
-
|
|
2032
|
+
19497
|
|
2091
2033
|
) {
|
|
2092
2034
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
2093
2035
|
'uniffi_ddk_ffi_checksum_func_create_spliced_dlc_transactions'
|
|
@@ -2191,7 +2133,6 @@ export default Object.freeze({
|
|
|
2191
2133
|
FfiConverterTypeChangeOutputAndFees,
|
|
2192
2134
|
FfiConverterTypeDLCError,
|
|
2193
2135
|
FfiConverterTypeDlcInputInfo,
|
|
2194
|
-
FfiConverterTypeDlcOutcome,
|
|
2195
2136
|
FfiConverterTypeDlcTransactions,
|
|
2196
2137
|
FfiConverterTypeExtendedKey,
|
|
2197
2138
|
FfiConverterTypeOracleInfo,
|