@secondts/bark-react-native 0.15.0 → 0.16.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.
- package/README.md +1 -1
- package/cpp/generated/bark.cpp +140 -0
- package/cpp/generated/bark.hpp +8 -0
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +2023 -202
- package/lib/commonjs/generated/bark.js.map +1 -1
- package/lib/module/generated/bark-ffi.js.map +1 -1
- package/lib/module/generated/bark.js +2022 -201
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +8 -0
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +1561 -127
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +8 -0
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +1561 -127
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/generated/bark-ffi.ts +10 -0
- package/src/generated/bark.ts +2678 -212
package/src/generated/bark.ts
CHANGED
|
@@ -292,9 +292,9 @@ export type ArkInfo = {
|
|
|
292
292
|
minBoardAmountSats: /*u64*/ bigint;
|
|
293
293
|
lnReceiveAntiDosRequired: boolean;
|
|
294
294
|
/**
|
|
295
|
-
*
|
|
295
|
+
* The server's fee schedule (board, offboard, refresh, lightning fees).
|
|
296
296
|
*/
|
|
297
|
-
|
|
297
|
+
feeSchedule: FeeSchedule;
|
|
298
298
|
/**
|
|
299
299
|
* Maximum exit depth (genesis chain length) allowed for a VTXO before the
|
|
300
300
|
* server refuses to cosign further OOR transactions spending it.
|
|
@@ -335,7 +335,7 @@ const FfiConverterTypeArkInfo = (() => {
|
|
|
335
335
|
maxUserInvoiceCltvDelta: FfiConverterUInt16.read(from),
|
|
336
336
|
minBoardAmountSats: FfiConverterUInt64.read(from),
|
|
337
337
|
lnReceiveAntiDosRequired: FfiConverterBool.read(from),
|
|
338
|
-
|
|
338
|
+
feeSchedule: FfiConverterTypeFeeSchedule.read(from),
|
|
339
339
|
maxVtxoExitDepth: FfiConverterUInt16.read(from),
|
|
340
340
|
};
|
|
341
341
|
}
|
|
@@ -353,7 +353,7 @@ const FfiConverterTypeArkInfo = (() => {
|
|
|
353
353
|
FfiConverterUInt16.write(value.maxUserInvoiceCltvDelta, into);
|
|
354
354
|
FfiConverterUInt64.write(value.minBoardAmountSats, into);
|
|
355
355
|
FfiConverterBool.write(value.lnReceiveAntiDosRequired, into);
|
|
356
|
-
|
|
356
|
+
FfiConverterTypeFeeSchedule.write(value.feeSchedule, into);
|
|
357
357
|
FfiConverterUInt16.write(value.maxVtxoExitDepth, into);
|
|
358
358
|
}
|
|
359
359
|
allocationSize(value: TypeName): number {
|
|
@@ -371,7 +371,7 @@ const FfiConverterTypeArkInfo = (() => {
|
|
|
371
371
|
FfiConverterUInt16.allocationSize(value.maxUserInvoiceCltvDelta) +
|
|
372
372
|
FfiConverterUInt64.allocationSize(value.minBoardAmountSats) +
|
|
373
373
|
FfiConverterBool.allocationSize(value.lnReceiveAntiDosRequired) +
|
|
374
|
-
|
|
374
|
+
FfiConverterTypeFeeSchedule.allocationSize(value.feeSchedule) +
|
|
375
375
|
FfiConverterUInt16.allocationSize(value.maxVtxoExitDepth)
|
|
376
376
|
);
|
|
377
377
|
}
|
|
@@ -484,6 +484,59 @@ const FfiConverterTypeBlockRef = (() => {
|
|
|
484
484
|
return new FFIConverter();
|
|
485
485
|
})();
|
|
486
486
|
|
|
487
|
+
/**
|
|
488
|
+
* Fees for boarding onchain funds into the Ark.
|
|
489
|
+
*/
|
|
490
|
+
export type BoardFees = {
|
|
491
|
+
minFeeSats: /*u64*/ bigint;
|
|
492
|
+
baseFeeSats: /*u64*/ bigint;
|
|
493
|
+
/**
|
|
494
|
+
* Parts-per-million fee rate on the boarded amount.
|
|
495
|
+
*/
|
|
496
|
+
ppm: /*u64*/ bigint;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Generated factory for {@link BoardFees} record objects.
|
|
501
|
+
*/
|
|
502
|
+
export const BoardFees = (() => {
|
|
503
|
+
const defaults = () => ({});
|
|
504
|
+
const create = (() => {
|
|
505
|
+
return uniffiCreateRecord<BoardFees, ReturnType<typeof defaults>>(defaults);
|
|
506
|
+
})();
|
|
507
|
+
return Object.freeze({
|
|
508
|
+
create,
|
|
509
|
+
new: create,
|
|
510
|
+
defaults: () => Object.freeze(defaults()) as Partial<BoardFees>,
|
|
511
|
+
});
|
|
512
|
+
})();
|
|
513
|
+
|
|
514
|
+
const FfiConverterTypeBoardFees = (() => {
|
|
515
|
+
type TypeName = BoardFees;
|
|
516
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
517
|
+
read(from: RustBuffer): TypeName {
|
|
518
|
+
return {
|
|
519
|
+
minFeeSats: FfiConverterUInt64.read(from),
|
|
520
|
+
baseFeeSats: FfiConverterUInt64.read(from),
|
|
521
|
+
ppm: FfiConverterUInt64.read(from),
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
525
|
+
FfiConverterUInt64.write(value.minFeeSats, into);
|
|
526
|
+
FfiConverterUInt64.write(value.baseFeeSats, into);
|
|
527
|
+
FfiConverterUInt64.write(value.ppm, into);
|
|
528
|
+
}
|
|
529
|
+
allocationSize(value: TypeName): number {
|
|
530
|
+
return (
|
|
531
|
+
FfiConverterUInt64.allocationSize(value.minFeeSats) +
|
|
532
|
+
FfiConverterUInt64.allocationSize(value.baseFeeSats) +
|
|
533
|
+
FfiConverterUInt64.allocationSize(value.ppm)
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return new FFIConverter();
|
|
538
|
+
})();
|
|
539
|
+
|
|
487
540
|
export type Config = {
|
|
488
541
|
serverAddress: string;
|
|
489
542
|
serverAccessToken?: string;
|
|
@@ -761,7 +814,7 @@ const FfiConverterTypeExitClaimTransaction = (() => {
|
|
|
761
814
|
*/
|
|
762
815
|
export type ExitProgressStatus = {
|
|
763
816
|
vtxoId: string;
|
|
764
|
-
state:
|
|
817
|
+
state: ExitState;
|
|
765
818
|
error?: string;
|
|
766
819
|
};
|
|
767
820
|
|
|
@@ -788,19 +841,19 @@ const FfiConverterTypeExitProgressStatus = (() => {
|
|
|
788
841
|
read(from: RustBuffer): TypeName {
|
|
789
842
|
return {
|
|
790
843
|
vtxoId: FfiConverterString.read(from),
|
|
791
|
-
state:
|
|
844
|
+
state: FfiConverterTypeExitState.read(from),
|
|
792
845
|
error: FfiConverterOptionalString.read(from),
|
|
793
846
|
};
|
|
794
847
|
}
|
|
795
848
|
write(value: TypeName, into: RustBuffer): void {
|
|
796
849
|
FfiConverterString.write(value.vtxoId, into);
|
|
797
|
-
|
|
850
|
+
FfiConverterTypeExitState.write(value.state, into);
|
|
798
851
|
FfiConverterOptionalString.write(value.error, into);
|
|
799
852
|
}
|
|
800
853
|
allocationSize(value: TypeName): number {
|
|
801
854
|
return (
|
|
802
855
|
FfiConverterString.allocationSize(value.vtxoId) +
|
|
803
|
-
|
|
856
|
+
FfiConverterTypeExitState.allocationSize(value.state) +
|
|
804
857
|
FfiConverterOptionalString.allocationSize(value.error)
|
|
805
858
|
);
|
|
806
859
|
}
|
|
@@ -813,8 +866,8 @@ const FfiConverterTypeExitProgressStatus = (() => {
|
|
|
813
866
|
*/
|
|
814
867
|
export type ExitTransactionStatus = {
|
|
815
868
|
vtxoId: string;
|
|
816
|
-
state:
|
|
817
|
-
history?: Array<
|
|
869
|
+
state: ExitState;
|
|
870
|
+
history?: Array<ExitState>;
|
|
818
871
|
transactionCount: /*u32*/ number;
|
|
819
872
|
};
|
|
820
873
|
|
|
@@ -842,22 +895,22 @@ const FfiConverterTypeExitTransactionStatus = (() => {
|
|
|
842
895
|
read(from: RustBuffer): TypeName {
|
|
843
896
|
return {
|
|
844
897
|
vtxoId: FfiConverterString.read(from),
|
|
845
|
-
state:
|
|
846
|
-
history:
|
|
898
|
+
state: FfiConverterTypeExitState.read(from),
|
|
899
|
+
history: FfiConverterOptionalArrayTypeExitState.read(from),
|
|
847
900
|
transactionCount: FfiConverterUInt32.read(from),
|
|
848
901
|
};
|
|
849
902
|
}
|
|
850
903
|
write(value: TypeName, into: RustBuffer): void {
|
|
851
904
|
FfiConverterString.write(value.vtxoId, into);
|
|
852
|
-
|
|
853
|
-
|
|
905
|
+
FfiConverterTypeExitState.write(value.state, into);
|
|
906
|
+
FfiConverterOptionalArrayTypeExitState.write(value.history, into);
|
|
854
907
|
FfiConverterUInt32.write(value.transactionCount, into);
|
|
855
908
|
}
|
|
856
909
|
allocationSize(value: TypeName): number {
|
|
857
910
|
return (
|
|
858
911
|
FfiConverterString.allocationSize(value.vtxoId) +
|
|
859
|
-
|
|
860
|
-
|
|
912
|
+
FfiConverterTypeExitState.allocationSize(value.state) +
|
|
913
|
+
FfiConverterOptionalArrayTypeExitState.allocationSize(value.history) +
|
|
861
914
|
FfiConverterUInt32.allocationSize(value.transactionCount)
|
|
862
915
|
);
|
|
863
916
|
}
|
|
@@ -865,13 +918,59 @@ const FfiConverterTypeExitTransactionStatus = (() => {
|
|
|
865
918
|
return new FFIConverter();
|
|
866
919
|
})();
|
|
867
920
|
|
|
921
|
+
/**
|
|
922
|
+
* One transaction in an exit's unilateral broadcast chain.
|
|
923
|
+
*/
|
|
924
|
+
export type ExitTx = {
|
|
925
|
+
txid: string;
|
|
926
|
+
status: ExitTxStatus;
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Generated factory for {@link ExitTx} record objects.
|
|
931
|
+
*/
|
|
932
|
+
export const ExitTx = (() => {
|
|
933
|
+
const defaults = () => ({});
|
|
934
|
+
const create = (() => {
|
|
935
|
+
return uniffiCreateRecord<ExitTx, ReturnType<typeof defaults>>(defaults);
|
|
936
|
+
})();
|
|
937
|
+
return Object.freeze({
|
|
938
|
+
create,
|
|
939
|
+
new: create,
|
|
940
|
+
defaults: () => Object.freeze(defaults()) as Partial<ExitTx>,
|
|
941
|
+
});
|
|
942
|
+
})();
|
|
943
|
+
|
|
944
|
+
const FfiConverterTypeExitTx = (() => {
|
|
945
|
+
type TypeName = ExitTx;
|
|
946
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
947
|
+
read(from: RustBuffer): TypeName {
|
|
948
|
+
return {
|
|
949
|
+
txid: FfiConverterString.read(from),
|
|
950
|
+
status: FfiConverterTypeExitTxStatus.read(from),
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
954
|
+
FfiConverterString.write(value.txid, into);
|
|
955
|
+
FfiConverterTypeExitTxStatus.write(value.status, into);
|
|
956
|
+
}
|
|
957
|
+
allocationSize(value: TypeName): number {
|
|
958
|
+
return (
|
|
959
|
+
FfiConverterString.allocationSize(value.txid) +
|
|
960
|
+
FfiConverterTypeExitTxStatus.allocationSize(value.status)
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
return new FFIConverter();
|
|
965
|
+
})();
|
|
966
|
+
|
|
868
967
|
/**
|
|
869
968
|
* A VTXO that is being unilaterally exited
|
|
870
969
|
*/
|
|
871
970
|
export type ExitVtxo = {
|
|
872
971
|
vtxoId: string;
|
|
873
972
|
amountSats: /*u64*/ bigint;
|
|
874
|
-
state:
|
|
973
|
+
state: ExitState;
|
|
875
974
|
isClaimable: boolean;
|
|
876
975
|
};
|
|
877
976
|
|
|
@@ -897,21 +996,21 @@ const FfiConverterTypeExitVtxo = (() => {
|
|
|
897
996
|
return {
|
|
898
997
|
vtxoId: FfiConverterString.read(from),
|
|
899
998
|
amountSats: FfiConverterUInt64.read(from),
|
|
900
|
-
state:
|
|
999
|
+
state: FfiConverterTypeExitState.read(from),
|
|
901
1000
|
isClaimable: FfiConverterBool.read(from),
|
|
902
1001
|
};
|
|
903
1002
|
}
|
|
904
1003
|
write(value: TypeName, into: RustBuffer): void {
|
|
905
1004
|
FfiConverterString.write(value.vtxoId, into);
|
|
906
1005
|
FfiConverterUInt64.write(value.amountSats, into);
|
|
907
|
-
|
|
1006
|
+
FfiConverterTypeExitState.write(value.state, into);
|
|
908
1007
|
FfiConverterBool.write(value.isClaimable, into);
|
|
909
1008
|
}
|
|
910
1009
|
allocationSize(value: TypeName): number {
|
|
911
1010
|
return (
|
|
912
1011
|
FfiConverterString.allocationSize(value.vtxoId) +
|
|
913
1012
|
FfiConverterUInt64.allocationSize(value.amountSats) +
|
|
914
|
-
|
|
1013
|
+
FfiConverterTypeExitState.allocationSize(value.state) +
|
|
915
1014
|
FfiConverterBool.allocationSize(value.isClaimable)
|
|
916
1015
|
);
|
|
917
1016
|
}
|
|
@@ -972,6 +1071,121 @@ const FfiConverterTypeFeeEstimate = (() => {
|
|
|
972
1071
|
return new FFIConverter();
|
|
973
1072
|
})();
|
|
974
1073
|
|
|
1074
|
+
/**
|
|
1075
|
+
* Network fee rates by urgency, mirroring `bark::chain::FeeRates`.
|
|
1076
|
+
*
|
|
1077
|
+
* Rates are in sat/kwu (satoshis per 1000 weight units) — divide by 250 for
|
|
1078
|
+
* sat/vB.
|
|
1079
|
+
*/
|
|
1080
|
+
export type FeeRates = {
|
|
1081
|
+
fastSatPerKwu: /*u64*/ bigint;
|
|
1082
|
+
regularSatPerKwu: /*u64*/ bigint;
|
|
1083
|
+
slowSatPerKwu: /*u64*/ bigint;
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* Generated factory for {@link FeeRates} record objects.
|
|
1088
|
+
*/
|
|
1089
|
+
export const FeeRates = (() => {
|
|
1090
|
+
const defaults = () => ({});
|
|
1091
|
+
const create = (() => {
|
|
1092
|
+
return uniffiCreateRecord<FeeRates, ReturnType<typeof defaults>>(defaults);
|
|
1093
|
+
})();
|
|
1094
|
+
return Object.freeze({
|
|
1095
|
+
create,
|
|
1096
|
+
new: create,
|
|
1097
|
+
defaults: () => Object.freeze(defaults()) as Partial<FeeRates>,
|
|
1098
|
+
});
|
|
1099
|
+
})();
|
|
1100
|
+
|
|
1101
|
+
const FfiConverterTypeFeeRates = (() => {
|
|
1102
|
+
type TypeName = FeeRates;
|
|
1103
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1104
|
+
read(from: RustBuffer): TypeName {
|
|
1105
|
+
return {
|
|
1106
|
+
fastSatPerKwu: FfiConverterUInt64.read(from),
|
|
1107
|
+
regularSatPerKwu: FfiConverterUInt64.read(from),
|
|
1108
|
+
slowSatPerKwu: FfiConverterUInt64.read(from),
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1112
|
+
FfiConverterUInt64.write(value.fastSatPerKwu, into);
|
|
1113
|
+
FfiConverterUInt64.write(value.regularSatPerKwu, into);
|
|
1114
|
+
FfiConverterUInt64.write(value.slowSatPerKwu, into);
|
|
1115
|
+
}
|
|
1116
|
+
allocationSize(value: TypeName): number {
|
|
1117
|
+
return (
|
|
1118
|
+
FfiConverterUInt64.allocationSize(value.fastSatPerKwu) +
|
|
1119
|
+
FfiConverterUInt64.allocationSize(value.regularSatPerKwu) +
|
|
1120
|
+
FfiConverterUInt64.allocationSize(value.slowSatPerKwu)
|
|
1121
|
+
);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
return new FFIConverter();
|
|
1125
|
+
})();
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* The Ark server's complete fee schedule, mirroring `ark::fees::FeeSchedule`.
|
|
1129
|
+
*/
|
|
1130
|
+
export type FeeSchedule = {
|
|
1131
|
+
board: BoardFees;
|
|
1132
|
+
offboard: OffboardFees;
|
|
1133
|
+
refresh: RefreshFees;
|
|
1134
|
+
lightningReceive: LightningReceiveFees;
|
|
1135
|
+
lightningSend: LightningSendFees;
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* Generated factory for {@link FeeSchedule} record objects.
|
|
1140
|
+
*/
|
|
1141
|
+
export const FeeSchedule = (() => {
|
|
1142
|
+
const defaults = () => ({});
|
|
1143
|
+
const create = (() => {
|
|
1144
|
+
return uniffiCreateRecord<FeeSchedule, ReturnType<typeof defaults>>(
|
|
1145
|
+
defaults
|
|
1146
|
+
);
|
|
1147
|
+
})();
|
|
1148
|
+
return Object.freeze({
|
|
1149
|
+
create,
|
|
1150
|
+
new: create,
|
|
1151
|
+
defaults: () => Object.freeze(defaults()) as Partial<FeeSchedule>,
|
|
1152
|
+
});
|
|
1153
|
+
})();
|
|
1154
|
+
|
|
1155
|
+
const FfiConverterTypeFeeSchedule = (() => {
|
|
1156
|
+
type TypeName = FeeSchedule;
|
|
1157
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1158
|
+
read(from: RustBuffer): TypeName {
|
|
1159
|
+
return {
|
|
1160
|
+
board: FfiConverterTypeBoardFees.read(from),
|
|
1161
|
+
offboard: FfiConverterTypeOffboardFees.read(from),
|
|
1162
|
+
refresh: FfiConverterTypeRefreshFees.read(from),
|
|
1163
|
+
lightningReceive: FfiConverterTypeLightningReceiveFees.read(from),
|
|
1164
|
+
lightningSend: FfiConverterTypeLightningSendFees.read(from),
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1168
|
+
FfiConverterTypeBoardFees.write(value.board, into);
|
|
1169
|
+
FfiConverterTypeOffboardFees.write(value.offboard, into);
|
|
1170
|
+
FfiConverterTypeRefreshFees.write(value.refresh, into);
|
|
1171
|
+
FfiConverterTypeLightningReceiveFees.write(value.lightningReceive, into);
|
|
1172
|
+
FfiConverterTypeLightningSendFees.write(value.lightningSend, into);
|
|
1173
|
+
}
|
|
1174
|
+
allocationSize(value: TypeName): number {
|
|
1175
|
+
return (
|
|
1176
|
+
FfiConverterTypeBoardFees.allocationSize(value.board) +
|
|
1177
|
+
FfiConverterTypeOffboardFees.allocationSize(value.offboard) +
|
|
1178
|
+
FfiConverterTypeRefreshFees.allocationSize(value.refresh) +
|
|
1179
|
+
FfiConverterTypeLightningReceiveFees.allocationSize(
|
|
1180
|
+
value.lightningReceive
|
|
1181
|
+
) +
|
|
1182
|
+
FfiConverterTypeLightningSendFees.allocationSize(value.lightningSend)
|
|
1183
|
+
);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
return new FFIConverter();
|
|
1187
|
+
})();
|
|
1188
|
+
|
|
975
1189
|
export type LightningInvoice = {
|
|
976
1190
|
invoice: string;
|
|
977
1191
|
paymentHash: string;
|
|
@@ -1102,6 +1316,58 @@ const FfiConverterTypeLightningReceive = (() => {
|
|
|
1102
1316
|
return new FFIConverter();
|
|
1103
1317
|
})();
|
|
1104
1318
|
|
|
1319
|
+
/**
|
|
1320
|
+
* Fees for receiving over lightning.
|
|
1321
|
+
*/
|
|
1322
|
+
export type LightningReceiveFees = {
|
|
1323
|
+
baseFeeSats: /*u64*/ bigint;
|
|
1324
|
+
/**
|
|
1325
|
+
* Parts-per-million fee rate on the received amount.
|
|
1326
|
+
*/
|
|
1327
|
+
ppm: /*u64*/ bigint;
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* Generated factory for {@link LightningReceiveFees} record objects.
|
|
1332
|
+
*/
|
|
1333
|
+
export const LightningReceiveFees = (() => {
|
|
1334
|
+
const defaults = () => ({});
|
|
1335
|
+
const create = (() => {
|
|
1336
|
+
return uniffiCreateRecord<
|
|
1337
|
+
LightningReceiveFees,
|
|
1338
|
+
ReturnType<typeof defaults>
|
|
1339
|
+
>(defaults);
|
|
1340
|
+
})();
|
|
1341
|
+
return Object.freeze({
|
|
1342
|
+
create,
|
|
1343
|
+
new: create,
|
|
1344
|
+
defaults: () => Object.freeze(defaults()) as Partial<LightningReceiveFees>,
|
|
1345
|
+
});
|
|
1346
|
+
})();
|
|
1347
|
+
|
|
1348
|
+
const FfiConverterTypeLightningReceiveFees = (() => {
|
|
1349
|
+
type TypeName = LightningReceiveFees;
|
|
1350
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1351
|
+
read(from: RustBuffer): TypeName {
|
|
1352
|
+
return {
|
|
1353
|
+
baseFeeSats: FfiConverterUInt64.read(from),
|
|
1354
|
+
ppm: FfiConverterUInt64.read(from),
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1358
|
+
FfiConverterUInt64.write(value.baseFeeSats, into);
|
|
1359
|
+
FfiConverterUInt64.write(value.ppm, into);
|
|
1360
|
+
}
|
|
1361
|
+
allocationSize(value: TypeName): number {
|
|
1362
|
+
return (
|
|
1363
|
+
FfiConverterUInt64.allocationSize(value.baseFeeSats) +
|
|
1364
|
+
FfiConverterUInt64.allocationSize(value.ppm)
|
|
1365
|
+
);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
return new FFIConverter();
|
|
1369
|
+
})();
|
|
1370
|
+
|
|
1105
1371
|
export type LightningSend = {
|
|
1106
1372
|
invoice: string;
|
|
1107
1373
|
/**
|
|
@@ -1172,6 +1438,60 @@ const FfiConverterTypeLightningSend = (() => {
|
|
|
1172
1438
|
return new FFIConverter();
|
|
1173
1439
|
})();
|
|
1174
1440
|
|
|
1441
|
+
/**
|
|
1442
|
+
* Fees for sending over lightning.
|
|
1443
|
+
*/
|
|
1444
|
+
export type LightningSendFees = {
|
|
1445
|
+
minFeeSats: /*u64*/ bigint;
|
|
1446
|
+
baseFeeSats: /*u64*/ bigint;
|
|
1447
|
+
ppmExpiryTable: Array<PpmExpiryFeeEntry>;
|
|
1448
|
+
};
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* Generated factory for {@link LightningSendFees} record objects.
|
|
1452
|
+
*/
|
|
1453
|
+
export const LightningSendFees = (() => {
|
|
1454
|
+
const defaults = () => ({});
|
|
1455
|
+
const create = (() => {
|
|
1456
|
+
return uniffiCreateRecord<LightningSendFees, ReturnType<typeof defaults>>(
|
|
1457
|
+
defaults
|
|
1458
|
+
);
|
|
1459
|
+
})();
|
|
1460
|
+
return Object.freeze({
|
|
1461
|
+
create,
|
|
1462
|
+
new: create,
|
|
1463
|
+
defaults: () => Object.freeze(defaults()) as Partial<LightningSendFees>,
|
|
1464
|
+
});
|
|
1465
|
+
})();
|
|
1466
|
+
|
|
1467
|
+
const FfiConverterTypeLightningSendFees = (() => {
|
|
1468
|
+
type TypeName = LightningSendFees;
|
|
1469
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1470
|
+
read(from: RustBuffer): TypeName {
|
|
1471
|
+
return {
|
|
1472
|
+
minFeeSats: FfiConverterUInt64.read(from),
|
|
1473
|
+
baseFeeSats: FfiConverterUInt64.read(from),
|
|
1474
|
+
ppmExpiryTable: FfiConverterArrayTypePpmExpiryFeeEntry.read(from),
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1478
|
+
FfiConverterUInt64.write(value.minFeeSats, into);
|
|
1479
|
+
FfiConverterUInt64.write(value.baseFeeSats, into);
|
|
1480
|
+
FfiConverterArrayTypePpmExpiryFeeEntry.write(value.ppmExpiryTable, into);
|
|
1481
|
+
}
|
|
1482
|
+
allocationSize(value: TypeName): number {
|
|
1483
|
+
return (
|
|
1484
|
+
FfiConverterUInt64.allocationSize(value.minFeeSats) +
|
|
1485
|
+
FfiConverterUInt64.allocationSize(value.baseFeeSats) +
|
|
1486
|
+
FfiConverterArrayTypePpmExpiryFeeEntry.allocationSize(
|
|
1487
|
+
value.ppmExpiryTable
|
|
1488
|
+
)
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
return new FFIConverter();
|
|
1493
|
+
})();
|
|
1494
|
+
|
|
1175
1495
|
export type Movement = {
|
|
1176
1496
|
id: /*u32*/ number;
|
|
1177
1497
|
status: string;
|
|
@@ -1283,6 +1603,63 @@ const FfiConverterTypeMovement = (() => {
|
|
|
1283
1603
|
return new FFIConverter();
|
|
1284
1604
|
})();
|
|
1285
1605
|
|
|
1606
|
+
/**
|
|
1607
|
+
* Fees for offboarding VTXOs to an onchain address.
|
|
1608
|
+
*/
|
|
1609
|
+
export type OffboardFees = {
|
|
1610
|
+
baseFeeSats: /*u64*/ bigint;
|
|
1611
|
+
/**
|
|
1612
|
+
* Fixed number of virtual bytes charged on top of the output size.
|
|
1613
|
+
*/
|
|
1614
|
+
fixedAdditionalVb: /*u64*/ bigint;
|
|
1615
|
+
ppmExpiryTable: Array<PpmExpiryFeeEntry>;
|
|
1616
|
+
};
|
|
1617
|
+
|
|
1618
|
+
/**
|
|
1619
|
+
* Generated factory for {@link OffboardFees} record objects.
|
|
1620
|
+
*/
|
|
1621
|
+
export const OffboardFees = (() => {
|
|
1622
|
+
const defaults = () => ({});
|
|
1623
|
+
const create = (() => {
|
|
1624
|
+
return uniffiCreateRecord<OffboardFees, ReturnType<typeof defaults>>(
|
|
1625
|
+
defaults
|
|
1626
|
+
);
|
|
1627
|
+
})();
|
|
1628
|
+
return Object.freeze({
|
|
1629
|
+
create,
|
|
1630
|
+
new: create,
|
|
1631
|
+
defaults: () => Object.freeze(defaults()) as Partial<OffboardFees>,
|
|
1632
|
+
});
|
|
1633
|
+
})();
|
|
1634
|
+
|
|
1635
|
+
const FfiConverterTypeOffboardFees = (() => {
|
|
1636
|
+
type TypeName = OffboardFees;
|
|
1637
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1638
|
+
read(from: RustBuffer): TypeName {
|
|
1639
|
+
return {
|
|
1640
|
+
baseFeeSats: FfiConverterUInt64.read(from),
|
|
1641
|
+
fixedAdditionalVb: FfiConverterUInt64.read(from),
|
|
1642
|
+
ppmExpiryTable: FfiConverterArrayTypePpmExpiryFeeEntry.read(from),
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1646
|
+
FfiConverterUInt64.write(value.baseFeeSats, into);
|
|
1647
|
+
FfiConverterUInt64.write(value.fixedAdditionalVb, into);
|
|
1648
|
+
FfiConverterArrayTypePpmExpiryFeeEntry.write(value.ppmExpiryTable, into);
|
|
1649
|
+
}
|
|
1650
|
+
allocationSize(value: TypeName): number {
|
|
1651
|
+
return (
|
|
1652
|
+
FfiConverterUInt64.allocationSize(value.baseFeeSats) +
|
|
1653
|
+
FfiConverterUInt64.allocationSize(value.fixedAdditionalVb) +
|
|
1654
|
+
FfiConverterArrayTypePpmExpiryFeeEntry.allocationSize(
|
|
1655
|
+
value.ppmExpiryTable
|
|
1656
|
+
)
|
|
1657
|
+
);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
return new FFIConverter();
|
|
1661
|
+
})();
|
|
1662
|
+
|
|
1286
1663
|
export type OffboardResult = {
|
|
1287
1664
|
roundId: string;
|
|
1288
1665
|
};
|
|
@@ -1467,31 +1844,86 @@ const FfiConverterTypePendingBoard = (() => {
|
|
|
1467
1844
|
})();
|
|
1468
1845
|
|
|
1469
1846
|
/**
|
|
1470
|
-
* One
|
|
1847
|
+
* One tier of a PPM-by-expiry fee table.
|
|
1471
1848
|
*
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
1474
|
-
*
|
|
1849
|
+
* The entry applies when a VTXO expires in at most `expiry_blocks_threshold`
|
|
1850
|
+
* blocks and no other entry has a threshold between this one and the VTXO's
|
|
1851
|
+
* actual expiry distance. Tables are sorted ascending by threshold.
|
|
1475
1852
|
*/
|
|
1476
|
-
export type
|
|
1477
|
-
|
|
1478
|
-
|
|
1853
|
+
export type PpmExpiryFeeEntry = {
|
|
1854
|
+
expiryBlocksThreshold: /*u32*/ number;
|
|
1855
|
+
/**
|
|
1856
|
+
* Parts-per-million fee rate applied for this expiry period.
|
|
1857
|
+
*/
|
|
1858
|
+
ppm: /*u64*/ bigint;
|
|
1479
1859
|
};
|
|
1480
1860
|
|
|
1481
1861
|
/**
|
|
1482
|
-
* Generated factory for {@link
|
|
1862
|
+
* Generated factory for {@link PpmExpiryFeeEntry} record objects.
|
|
1483
1863
|
*/
|
|
1484
|
-
export const
|
|
1864
|
+
export const PpmExpiryFeeEntry = (() => {
|
|
1485
1865
|
const defaults = () => ({});
|
|
1486
1866
|
const create = (() => {
|
|
1487
|
-
return uniffiCreateRecord<
|
|
1867
|
+
return uniffiCreateRecord<PpmExpiryFeeEntry, ReturnType<typeof defaults>>(
|
|
1488
1868
|
defaults
|
|
1489
1869
|
);
|
|
1490
1870
|
})();
|
|
1491
1871
|
return Object.freeze({
|
|
1492
1872
|
create,
|
|
1493
1873
|
new: create,
|
|
1494
|
-
defaults: () => Object.freeze(defaults()) as Partial<
|
|
1874
|
+
defaults: () => Object.freeze(defaults()) as Partial<PpmExpiryFeeEntry>,
|
|
1875
|
+
});
|
|
1876
|
+
})();
|
|
1877
|
+
|
|
1878
|
+
const FfiConverterTypePpmExpiryFeeEntry = (() => {
|
|
1879
|
+
type TypeName = PpmExpiryFeeEntry;
|
|
1880
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
1881
|
+
read(from: RustBuffer): TypeName {
|
|
1882
|
+
return {
|
|
1883
|
+
expiryBlocksThreshold: FfiConverterUInt32.read(from),
|
|
1884
|
+
ppm: FfiConverterUInt64.read(from),
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
1888
|
+
FfiConverterUInt32.write(value.expiryBlocksThreshold, into);
|
|
1889
|
+
FfiConverterUInt64.write(value.ppm, into);
|
|
1890
|
+
}
|
|
1891
|
+
allocationSize(value: TypeName): number {
|
|
1892
|
+
return (
|
|
1893
|
+
FfiConverterUInt32.allocationSize(value.expiryBlocksThreshold) +
|
|
1894
|
+
FfiConverterUInt64.allocationSize(value.ppm)
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
return new FFIConverter();
|
|
1899
|
+
})();
|
|
1900
|
+
|
|
1901
|
+
/**
|
|
1902
|
+
* One bucket of a [`RecoveryReport`].
|
|
1903
|
+
*
|
|
1904
|
+
* `total_sats` only sums the VTXOs whose amount is known, so it can
|
|
1905
|
+
* under-count `failed`, where a VTXO may have failed before being fetched.
|
|
1906
|
+
* `vtxo_ids` is sorted, since upstream buckets them unordered.
|
|
1907
|
+
*/
|
|
1908
|
+
export type RecoveryBucket = {
|
|
1909
|
+
vtxoIds: Array<string>;
|
|
1910
|
+
totalSats: /*u64*/ bigint;
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
/**
|
|
1914
|
+
* Generated factory for {@link RecoveryBucket} record objects.
|
|
1915
|
+
*/
|
|
1916
|
+
export const RecoveryBucket = (() => {
|
|
1917
|
+
const defaults = () => ({});
|
|
1918
|
+
const create = (() => {
|
|
1919
|
+
return uniffiCreateRecord<RecoveryBucket, ReturnType<typeof defaults>>(
|
|
1920
|
+
defaults
|
|
1921
|
+
);
|
|
1922
|
+
})();
|
|
1923
|
+
return Object.freeze({
|
|
1924
|
+
create,
|
|
1925
|
+
new: create,
|
|
1926
|
+
defaults: () => Object.freeze(defaults()) as Partial<RecoveryBucket>,
|
|
1495
1927
|
});
|
|
1496
1928
|
})();
|
|
1497
1929
|
|
|
@@ -1613,6 +2045,56 @@ const FfiConverterTypeRecoveryReport = (() => {
|
|
|
1613
2045
|
return new FFIConverter();
|
|
1614
2046
|
})();
|
|
1615
2047
|
|
|
2048
|
+
/**
|
|
2049
|
+
* Fees for refreshing VTXOs in a round.
|
|
2050
|
+
*/
|
|
2051
|
+
export type RefreshFees = {
|
|
2052
|
+
baseFeeSats: /*u64*/ bigint;
|
|
2053
|
+
ppmExpiryTable: Array<PpmExpiryFeeEntry>;
|
|
2054
|
+
};
|
|
2055
|
+
|
|
2056
|
+
/**
|
|
2057
|
+
* Generated factory for {@link RefreshFees} record objects.
|
|
2058
|
+
*/
|
|
2059
|
+
export const RefreshFees = (() => {
|
|
2060
|
+
const defaults = () => ({});
|
|
2061
|
+
const create = (() => {
|
|
2062
|
+
return uniffiCreateRecord<RefreshFees, ReturnType<typeof defaults>>(
|
|
2063
|
+
defaults
|
|
2064
|
+
);
|
|
2065
|
+
})();
|
|
2066
|
+
return Object.freeze({
|
|
2067
|
+
create,
|
|
2068
|
+
new: create,
|
|
2069
|
+
defaults: () => Object.freeze(defaults()) as Partial<RefreshFees>,
|
|
2070
|
+
});
|
|
2071
|
+
})();
|
|
2072
|
+
|
|
2073
|
+
const FfiConverterTypeRefreshFees = (() => {
|
|
2074
|
+
type TypeName = RefreshFees;
|
|
2075
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2076
|
+
read(from: RustBuffer): TypeName {
|
|
2077
|
+
return {
|
|
2078
|
+
baseFeeSats: FfiConverterUInt64.read(from),
|
|
2079
|
+
ppmExpiryTable: FfiConverterArrayTypePpmExpiryFeeEntry.read(from),
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
2083
|
+
FfiConverterUInt64.write(value.baseFeeSats, into);
|
|
2084
|
+
FfiConverterArrayTypePpmExpiryFeeEntry.write(value.ppmExpiryTable, into);
|
|
2085
|
+
}
|
|
2086
|
+
allocationSize(value: TypeName): number {
|
|
2087
|
+
return (
|
|
2088
|
+
FfiConverterUInt64.allocationSize(value.baseFeeSats) +
|
|
2089
|
+
FfiConverterArrayTypePpmExpiryFeeEntry.allocationSize(
|
|
2090
|
+
value.ppmExpiryTable
|
|
2091
|
+
)
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
return new FFIConverter();
|
|
2096
|
+
})();
|
|
2097
|
+
|
|
1616
2098
|
/**
|
|
1617
2099
|
* A pending round state
|
|
1618
2100
|
*/
|
|
@@ -1669,7 +2151,7 @@ export type Vtxo = {
|
|
|
1669
2151
|
amountSats: /*u64*/ bigint;
|
|
1670
2152
|
expiryHeight: /*u32*/ number;
|
|
1671
2153
|
kind: string;
|
|
1672
|
-
state:
|
|
2154
|
+
state: VtxoState;
|
|
1673
2155
|
/**
|
|
1674
2156
|
* Genesis chain length. Compare against `ArkInfo.max_vtxo_exit_depth` to
|
|
1675
2157
|
* detect VTXOs nearing the server's OOR-cosign refusal threshold.
|
|
@@ -1713,7 +2195,7 @@ const FfiConverterTypeVtxo = (() => {
|
|
|
1713
2195
|
amountSats: FfiConverterUInt64.read(from),
|
|
1714
2196
|
expiryHeight: FfiConverterUInt32.read(from),
|
|
1715
2197
|
kind: FfiConverterString.read(from),
|
|
1716
|
-
state:
|
|
2198
|
+
state: FfiConverterTypeVtxoState.read(from),
|
|
1717
2199
|
exitDepth: FfiConverterUInt32.read(from),
|
|
1718
2200
|
exitTxWeightWu: FfiConverterUInt64.read(from),
|
|
1719
2201
|
registered: FfiConverterBool.read(from),
|
|
@@ -1724,7 +2206,7 @@ const FfiConverterTypeVtxo = (() => {
|
|
|
1724
2206
|
FfiConverterUInt64.write(value.amountSats, into);
|
|
1725
2207
|
FfiConverterUInt32.write(value.expiryHeight, into);
|
|
1726
2208
|
FfiConverterString.write(value.kind, into);
|
|
1727
|
-
|
|
2209
|
+
FfiConverterTypeVtxoState.write(value.state, into);
|
|
1728
2210
|
FfiConverterUInt32.write(value.exitDepth, into);
|
|
1729
2211
|
FfiConverterUInt64.write(value.exitTxWeightWu, into);
|
|
1730
2212
|
FfiConverterBool.write(value.registered, into);
|
|
@@ -1735,7 +2217,7 @@ const FfiConverterTypeVtxo = (() => {
|
|
|
1735
2217
|
FfiConverterUInt64.allocationSize(value.amountSats) +
|
|
1736
2218
|
FfiConverterUInt32.allocationSize(value.expiryHeight) +
|
|
1737
2219
|
FfiConverterString.allocationSize(value.kind) +
|
|
1738
|
-
|
|
2220
|
+
FfiConverterTypeVtxoState.allocationSize(value.state) +
|
|
1739
2221
|
FfiConverterUInt32.allocationSize(value.exitDepth) +
|
|
1740
2222
|
FfiConverterUInt64.allocationSize(value.exitTxWeightWu) +
|
|
1741
2223
|
FfiConverterBool.allocationSize(value.registered)
|
|
@@ -1896,6 +2378,90 @@ const FfiConverterTypeWalletProperties = (() => {
|
|
|
1896
2378
|
return new FFIConverter();
|
|
1897
2379
|
})();
|
|
1898
2380
|
|
|
2381
|
+
/**
|
|
2382
|
+
* Summary of one onchain wallet transaction, mirroring
|
|
2383
|
+
* `bark::onchain::WalletTxInfo`.
|
|
2384
|
+
*/
|
|
2385
|
+
export type WalletTransaction = {
|
|
2386
|
+
txid: string;
|
|
2387
|
+
/**
|
|
2388
|
+
* The raw transaction, consensus-serialized as hex.
|
|
2389
|
+
*/
|
|
2390
|
+
txHex: string;
|
|
2391
|
+
/**
|
|
2392
|
+
* Total fee paid by the transaction, when computable. `None` for
|
|
2393
|
+
* inbound or collaboratively-funded txs whose foreign prevouts the
|
|
2394
|
+
* wallet has not indexed.
|
|
2395
|
+
*/
|
|
2396
|
+
onchainFeeSats?: /*u64*/ bigint;
|
|
2397
|
+
/**
|
|
2398
|
+
* Net change to the wallet's balance: received minus sent over
|
|
2399
|
+
* wallet-owned outputs.
|
|
2400
|
+
*/
|
|
2401
|
+
balanceChangeSats: /*i64*/ bigint;
|
|
2402
|
+
/**
|
|
2403
|
+
* `Some` if confirmed in a block, `None` if still in the mempool.
|
|
2404
|
+
*/
|
|
2405
|
+
confirmation?: BlockRef;
|
|
2406
|
+
/**
|
|
2407
|
+
* `true` when this tx spends a P2A fee anchor — i.e. it is a CPFP
|
|
2408
|
+
* child bumping the parent that created the anchor (exit fee txs).
|
|
2409
|
+
*/
|
|
2410
|
+
isCpfp: boolean;
|
|
2411
|
+
};
|
|
2412
|
+
|
|
2413
|
+
/**
|
|
2414
|
+
* Generated factory for {@link WalletTransaction} record objects.
|
|
2415
|
+
*/
|
|
2416
|
+
export const WalletTransaction = (() => {
|
|
2417
|
+
const defaults = () => ({});
|
|
2418
|
+
const create = (() => {
|
|
2419
|
+
return uniffiCreateRecord<WalletTransaction, ReturnType<typeof defaults>>(
|
|
2420
|
+
defaults
|
|
2421
|
+
);
|
|
2422
|
+
})();
|
|
2423
|
+
return Object.freeze({
|
|
2424
|
+
create,
|
|
2425
|
+
new: create,
|
|
2426
|
+
defaults: () => Object.freeze(defaults()) as Partial<WalletTransaction>,
|
|
2427
|
+
});
|
|
2428
|
+
})();
|
|
2429
|
+
|
|
2430
|
+
const FfiConverterTypeWalletTransaction = (() => {
|
|
2431
|
+
type TypeName = WalletTransaction;
|
|
2432
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2433
|
+
read(from: RustBuffer): TypeName {
|
|
2434
|
+
return {
|
|
2435
|
+
txid: FfiConverterString.read(from),
|
|
2436
|
+
txHex: FfiConverterString.read(from),
|
|
2437
|
+
onchainFeeSats: FfiConverterOptionalUInt64.read(from),
|
|
2438
|
+
balanceChangeSats: FfiConverterInt64.read(from),
|
|
2439
|
+
confirmation: FfiConverterOptionalTypeBlockRef.read(from),
|
|
2440
|
+
isCpfp: FfiConverterBool.read(from),
|
|
2441
|
+
};
|
|
2442
|
+
}
|
|
2443
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
2444
|
+
FfiConverterString.write(value.txid, into);
|
|
2445
|
+
FfiConverterString.write(value.txHex, into);
|
|
2446
|
+
FfiConverterOptionalUInt64.write(value.onchainFeeSats, into);
|
|
2447
|
+
FfiConverterInt64.write(value.balanceChangeSats, into);
|
|
2448
|
+
FfiConverterOptionalTypeBlockRef.write(value.confirmation, into);
|
|
2449
|
+
FfiConverterBool.write(value.isCpfp, into);
|
|
2450
|
+
}
|
|
2451
|
+
allocationSize(value: TypeName): number {
|
|
2452
|
+
return (
|
|
2453
|
+
FfiConverterString.allocationSize(value.txid) +
|
|
2454
|
+
FfiConverterString.allocationSize(value.txHex) +
|
|
2455
|
+
FfiConverterOptionalUInt64.allocationSize(value.onchainFeeSats) +
|
|
2456
|
+
FfiConverterInt64.allocationSize(value.balanceChangeSats) +
|
|
2457
|
+
FfiConverterOptionalTypeBlockRef.allocationSize(value.confirmation) +
|
|
2458
|
+
FfiConverterBool.allocationSize(value.isCpfp)
|
|
2459
|
+
);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
return new FFIConverter();
|
|
2463
|
+
})();
|
|
2464
|
+
|
|
1899
2465
|
const stringConverter = {
|
|
1900
2466
|
stringToBytes: (s: string) =>
|
|
1901
2467
|
uniffiCaller.rustCall((status) =>
|
|
@@ -2009,196 +2575,552 @@ const FfiConverterTypeError = (() => {
|
|
|
2009
2575
|
return new FfiConverter();
|
|
2010
2576
|
})();
|
|
2011
2577
|
|
|
2012
|
-
// Enum:
|
|
2013
|
-
export enum
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2578
|
+
// Enum: ExitState
|
|
2579
|
+
export enum ExitState_Tags {
|
|
2580
|
+
Start = "Start",
|
|
2581
|
+
Processing = "Processing",
|
|
2582
|
+
AwaitingDelta = "AwaitingDelta",
|
|
2583
|
+
Claimable = "Claimable",
|
|
2584
|
+
ClaimInProgress = "ClaimInProgress",
|
|
2585
|
+
Claimed = "Claimed",
|
|
2586
|
+
VtxoAlreadySpent = "VtxoAlreadySpent",
|
|
2587
|
+
Canceled = "Canceled",
|
|
2017
2588
|
}
|
|
2018
2589
|
/**
|
|
2019
|
-
*
|
|
2590
|
+
* State of a unilateral exit, mirroring `bark::exit::ExitState`.
|
|
2020
2591
|
*
|
|
2021
|
-
*
|
|
2022
|
-
* `
|
|
2023
|
-
*
|
|
2592
|
+
* Serde/TS tags match upstream's kebab-case serialization (`"start"`,
|
|
2593
|
+
* `"processing"`, `"awaiting-delta"`, `"claimable"`, `"claim-in-progress"`,
|
|
2594
|
+
* `"claimed"`, `"vtxo-already-spent"`, `"canceled"`), with camelCase fields.
|
|
2024
2595
|
*/
|
|
2025
|
-
export const
|
|
2026
|
-
type
|
|
2027
|
-
tag:
|
|
2596
|
+
export const ExitState = (() => {
|
|
2597
|
+
type Start__interface = {
|
|
2598
|
+
tag: ExitState_Tags.Start;
|
|
2599
|
+
inner: Readonly<{ tipHeight: /*u32*/ number }>;
|
|
2028
2600
|
};
|
|
2029
2601
|
|
|
2030
2602
|
/**
|
|
2031
|
-
*
|
|
2603
|
+
* The exit was requested at the given tip.
|
|
2032
2604
|
*/
|
|
2033
|
-
class
|
|
2605
|
+
class Start_ extends UniffiEnum implements Start__interface {
|
|
2034
2606
|
/**
|
|
2035
2607
|
* @private
|
|
2036
2608
|
* This field is private and should not be used, use `tag` instead.
|
|
2037
2609
|
*/
|
|
2038
|
-
readonly [uniffiTypeNameSymbol] = "
|
|
2039
|
-
readonly tag =
|
|
2040
|
-
|
|
2041
|
-
|
|
2610
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2611
|
+
readonly tag = ExitState_Tags.Start;
|
|
2612
|
+
readonly inner: Readonly<{ tipHeight: /*u32*/ number }>;
|
|
2613
|
+
constructor(inner: { tipHeight: /*u32*/ number }) {
|
|
2614
|
+
super("ExitState", "Start");
|
|
2615
|
+
this.inner = Object.freeze(inner);
|
|
2042
2616
|
}
|
|
2043
2617
|
|
|
2044
|
-
static new():
|
|
2045
|
-
return new
|
|
2618
|
+
static new(inner: { tipHeight: /*u32*/ number }): Start_ {
|
|
2619
|
+
return new Start_(inner);
|
|
2046
2620
|
}
|
|
2047
2621
|
|
|
2048
|
-
static instanceOf(obj: any): obj is
|
|
2049
|
-
return obj.tag ===
|
|
2622
|
+
static instanceOf(obj: any): obj is Start_ {
|
|
2623
|
+
return obj.tag === ExitState_Tags.Start;
|
|
2050
2624
|
}
|
|
2051
2625
|
}
|
|
2052
2626
|
|
|
2053
|
-
type
|
|
2054
|
-
tag:
|
|
2055
|
-
inner: Readonly<{
|
|
2627
|
+
type Processing__interface = {
|
|
2628
|
+
tag: ExitState_Tags.Processing;
|
|
2629
|
+
inner: Readonly<{ tipHeight: /*u32*/ number; transactions: Array<ExitTx> }>;
|
|
2056
2630
|
};
|
|
2057
2631
|
|
|
2058
2632
|
/**
|
|
2059
|
-
*
|
|
2633
|
+
* The exit transaction chain is being broadcast and confirmed.
|
|
2060
2634
|
*/
|
|
2061
|
-
class
|
|
2635
|
+
class Processing_ extends UniffiEnum implements Processing__interface {
|
|
2062
2636
|
/**
|
|
2063
2637
|
* @private
|
|
2064
2638
|
* This field is private and should not be used, use `tag` instead.
|
|
2065
2639
|
*/
|
|
2066
|
-
readonly [uniffiTypeNameSymbol] = "
|
|
2067
|
-
readonly tag =
|
|
2068
|
-
readonly inner: Readonly<{
|
|
2069
|
-
|
|
2070
|
-
|
|
2640
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2641
|
+
readonly tag = ExitState_Tags.Processing;
|
|
2642
|
+
readonly inner: Readonly<{
|
|
2643
|
+
tipHeight: /*u32*/ number;
|
|
2644
|
+
transactions: Array<ExitTx>;
|
|
2645
|
+
}>;
|
|
2646
|
+
constructor(inner: {
|
|
2647
|
+
tipHeight: /*u32*/ number;
|
|
2648
|
+
transactions: Array<ExitTx>;
|
|
2649
|
+
}) {
|
|
2650
|
+
super("ExitState", "Processing");
|
|
2071
2651
|
this.inner = Object.freeze(inner);
|
|
2072
2652
|
}
|
|
2073
2653
|
|
|
2074
|
-
static new(inner: {
|
|
2075
|
-
|
|
2654
|
+
static new(inner: {
|
|
2655
|
+
tipHeight: /*u32*/ number;
|
|
2656
|
+
transactions: Array<ExitTx>;
|
|
2657
|
+
}): Processing_ {
|
|
2658
|
+
return new Processing_(inner);
|
|
2076
2659
|
}
|
|
2077
2660
|
|
|
2078
|
-
static instanceOf(obj: any): obj is
|
|
2079
|
-
return obj.tag ===
|
|
2661
|
+
static instanceOf(obj: any): obj is Processing_ {
|
|
2662
|
+
return obj.tag === ExitState_Tags.Processing;
|
|
2080
2663
|
}
|
|
2081
2664
|
}
|
|
2082
2665
|
|
|
2083
|
-
type
|
|
2084
|
-
tag:
|
|
2085
|
-
inner: Readonly<{
|
|
2666
|
+
type AwaitingDelta__interface = {
|
|
2667
|
+
tag: ExitState_Tags.AwaitingDelta;
|
|
2668
|
+
inner: Readonly<{
|
|
2669
|
+
tipHeight: /*u32*/ number;
|
|
2670
|
+
confirmedBlock: BlockRef;
|
|
2671
|
+
claimableHeight: /*u32*/ number;
|
|
2672
|
+
}>;
|
|
2086
2673
|
};
|
|
2087
2674
|
|
|
2088
2675
|
/**
|
|
2089
|
-
*
|
|
2676
|
+
* Fully confirmed; waiting out the exit delta until claimable.
|
|
2090
2677
|
*/
|
|
2091
|
-
class
|
|
2678
|
+
class AwaitingDelta_ extends UniffiEnum implements AwaitingDelta__interface {
|
|
2092
2679
|
/**
|
|
2093
2680
|
* @private
|
|
2094
2681
|
* This field is private and should not be used, use `tag` instead.
|
|
2095
2682
|
*/
|
|
2096
|
-
readonly [uniffiTypeNameSymbol] = "
|
|
2097
|
-
readonly tag =
|
|
2098
|
-
readonly inner: Readonly<{
|
|
2099
|
-
|
|
2100
|
-
|
|
2683
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2684
|
+
readonly tag = ExitState_Tags.AwaitingDelta;
|
|
2685
|
+
readonly inner: Readonly<{
|
|
2686
|
+
tipHeight: /*u32*/ number;
|
|
2687
|
+
confirmedBlock: BlockRef;
|
|
2688
|
+
claimableHeight: /*u32*/ number;
|
|
2689
|
+
}>;
|
|
2690
|
+
constructor(inner: {
|
|
2691
|
+
tipHeight: /*u32*/ number;
|
|
2692
|
+
confirmedBlock: BlockRef;
|
|
2693
|
+
claimableHeight: /*u32*/ number;
|
|
2694
|
+
}) {
|
|
2695
|
+
super("ExitState", "AwaitingDelta");
|
|
2101
2696
|
this.inner = Object.freeze(inner);
|
|
2102
2697
|
}
|
|
2103
2698
|
|
|
2104
|
-
static new(inner: {
|
|
2105
|
-
|
|
2699
|
+
static new(inner: {
|
|
2700
|
+
tipHeight: /*u32*/ number;
|
|
2701
|
+
confirmedBlock: BlockRef;
|
|
2702
|
+
claimableHeight: /*u32*/ number;
|
|
2703
|
+
}): AwaitingDelta_ {
|
|
2704
|
+
return new AwaitingDelta_(inner);
|
|
2106
2705
|
}
|
|
2107
2706
|
|
|
2108
|
-
static instanceOf(obj: any): obj is
|
|
2109
|
-
return obj.tag ===
|
|
2707
|
+
static instanceOf(obj: any): obj is AwaitingDelta_ {
|
|
2708
|
+
return obj.tag === ExitState_Tags.AwaitingDelta;
|
|
2110
2709
|
}
|
|
2111
2710
|
}
|
|
2112
2711
|
|
|
2113
|
-
|
|
2114
|
-
|
|
2712
|
+
type Claimable__interface = {
|
|
2713
|
+
tag: ExitState_Tags.Claimable;
|
|
2714
|
+
inner: Readonly<{
|
|
2715
|
+
tipHeight: /*u32*/ number;
|
|
2716
|
+
claimableSince: BlockRef;
|
|
2717
|
+
lastScannedBlock: BlockRef | undefined;
|
|
2718
|
+
}>;
|
|
2719
|
+
};
|
|
2720
|
+
|
|
2721
|
+
/**
|
|
2722
|
+
* The exit output can be claimed.
|
|
2723
|
+
*/
|
|
2724
|
+
class Claimable_ extends UniffiEnum implements Claimable__interface {
|
|
2725
|
+
/**
|
|
2726
|
+
* @private
|
|
2727
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2728
|
+
*/
|
|
2729
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2730
|
+
readonly tag = ExitState_Tags.Claimable;
|
|
2731
|
+
readonly inner: Readonly<{
|
|
2732
|
+
tipHeight: /*u32*/ number;
|
|
2733
|
+
claimableSince: BlockRef;
|
|
2734
|
+
lastScannedBlock: BlockRef | undefined;
|
|
2735
|
+
}>;
|
|
2736
|
+
constructor(inner: {
|
|
2737
|
+
tipHeight: /*u32*/ number;
|
|
2738
|
+
claimableSince: BlockRef;
|
|
2739
|
+
lastScannedBlock: BlockRef | undefined;
|
|
2740
|
+
}) {
|
|
2741
|
+
super("ExitState", "Claimable");
|
|
2742
|
+
this.inner = Object.freeze(inner);
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
static new(inner: {
|
|
2746
|
+
tipHeight: /*u32*/ number;
|
|
2747
|
+
claimableSince: BlockRef;
|
|
2748
|
+
lastScannedBlock: BlockRef | undefined;
|
|
2749
|
+
}): Claimable_ {
|
|
2750
|
+
return new Claimable_(inner);
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
static instanceOf(obj: any): obj is Claimable_ {
|
|
2754
|
+
return obj.tag === ExitState_Tags.Claimable;
|
|
2755
|
+
}
|
|
2115
2756
|
}
|
|
2116
2757
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
}
|
|
2758
|
+
type ClaimInProgress__interface = {
|
|
2759
|
+
tag: ExitState_Tags.ClaimInProgress;
|
|
2760
|
+
inner: Readonly<{
|
|
2761
|
+
tipHeight: /*u32*/ number;
|
|
2762
|
+
claimableSince: BlockRef;
|
|
2763
|
+
claimTxid: string;
|
|
2764
|
+
}>;
|
|
2765
|
+
};
|
|
2124
2766
|
|
|
2125
|
-
/**
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2767
|
+
/**
|
|
2768
|
+
* A claim transaction has been broadcast.
|
|
2769
|
+
*/
|
|
2770
|
+
class ClaimInProgress_
|
|
2771
|
+
extends UniffiEnum
|
|
2772
|
+
implements ClaimInProgress__interface
|
|
2773
|
+
{
|
|
2774
|
+
/**
|
|
2775
|
+
* @private
|
|
2776
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2777
|
+
*/
|
|
2778
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2779
|
+
readonly tag = ExitState_Tags.ClaimInProgress;
|
|
2780
|
+
readonly inner: Readonly<{
|
|
2781
|
+
tipHeight: /*u32*/ number;
|
|
2782
|
+
claimableSince: BlockRef;
|
|
2783
|
+
claimTxid: string;
|
|
2784
|
+
}>;
|
|
2785
|
+
constructor(inner: {
|
|
2786
|
+
tipHeight: /*u32*/ number;
|
|
2787
|
+
claimableSince: BlockRef;
|
|
2788
|
+
claimTxid: string;
|
|
2789
|
+
}) {
|
|
2790
|
+
super("ExitState", "ClaimInProgress");
|
|
2791
|
+
this.inner = Object.freeze(inner);
|
|
2792
|
+
}
|
|
2132
2793
|
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2794
|
+
static new(inner: {
|
|
2795
|
+
tipHeight: /*u32*/ number;
|
|
2796
|
+
claimableSince: BlockRef;
|
|
2797
|
+
claimTxid: string;
|
|
2798
|
+
}): ClaimInProgress_ {
|
|
2799
|
+
return new ClaimInProgress_(inner);
|
|
2800
|
+
}
|
|
2139
2801
|
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
const ordinalConverter = FfiConverterInt32;
|
|
2143
|
-
type TypeName = LightningSendStatus;
|
|
2144
|
-
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2145
|
-
read(from: RustBuffer): TypeName {
|
|
2146
|
-
switch (ordinalConverter.read(from)) {
|
|
2147
|
-
case 1:
|
|
2148
|
-
return new LightningSendStatus.Unknown();
|
|
2149
|
-
case 2:
|
|
2150
|
-
return new LightningSendStatus.InProgress({
|
|
2151
|
-
send: FfiConverterTypeLightningSend.read(from),
|
|
2152
|
-
});
|
|
2153
|
-
case 3:
|
|
2154
|
-
return new LightningSendStatus.Paid({
|
|
2155
|
-
paymentHash: FfiConverterString.read(from),
|
|
2156
|
-
preimage: FfiConverterString.read(from),
|
|
2157
|
-
});
|
|
2158
|
-
default:
|
|
2159
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2160
|
-
}
|
|
2802
|
+
static instanceOf(obj: any): obj is ClaimInProgress_ {
|
|
2803
|
+
return obj.tag === ExitState_Tags.ClaimInProgress;
|
|
2161
2804
|
}
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
type Claimed__interface = {
|
|
2808
|
+
tag: ExitState_Tags.Claimed;
|
|
2809
|
+
inner: Readonly<{
|
|
2810
|
+
tipHeight: /*u32*/ number;
|
|
2811
|
+
txid: string;
|
|
2812
|
+
block: BlockRef;
|
|
2813
|
+
}>;
|
|
2814
|
+
};
|
|
2815
|
+
|
|
2816
|
+
/**
|
|
2817
|
+
* Terminal: the exit output was claimed (or spent deeper in the tree).
|
|
2818
|
+
*/
|
|
2819
|
+
class Claimed_ extends UniffiEnum implements Claimed__interface {
|
|
2820
|
+
/**
|
|
2821
|
+
* @private
|
|
2822
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2823
|
+
*/
|
|
2824
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2825
|
+
readonly tag = ExitState_Tags.Claimed;
|
|
2826
|
+
readonly inner: Readonly<{
|
|
2827
|
+
tipHeight: /*u32*/ number;
|
|
2828
|
+
txid: string;
|
|
2829
|
+
block: BlockRef;
|
|
2830
|
+
}>;
|
|
2831
|
+
constructor(inner: {
|
|
2832
|
+
tipHeight: /*u32*/ number;
|
|
2833
|
+
txid: string;
|
|
2834
|
+
block: BlockRef;
|
|
2835
|
+
}) {
|
|
2836
|
+
super("ExitState", "Claimed");
|
|
2837
|
+
this.inner = Object.freeze(inner);
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
static new(inner: {
|
|
2841
|
+
tipHeight: /*u32*/ number;
|
|
2842
|
+
txid: string;
|
|
2843
|
+
block: BlockRef;
|
|
2844
|
+
}): Claimed_ {
|
|
2845
|
+
return new Claimed_(inner);
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
static instanceOf(obj: any): obj is Claimed_ {
|
|
2849
|
+
return obj.tag === ExitState_Tags.Claimed;
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2853
|
+
type VtxoAlreadySpent__interface = {
|
|
2854
|
+
tag: ExitState_Tags.VtxoAlreadySpent;
|
|
2855
|
+
inner: Readonly<{ tipHeight: /*u32*/ number }>;
|
|
2856
|
+
};
|
|
2857
|
+
|
|
2858
|
+
/**
|
|
2859
|
+
* Terminal: the VTXO was already spent offchain, so the exit cannot
|
|
2860
|
+
* proceed.
|
|
2861
|
+
*/
|
|
2862
|
+
class VtxoAlreadySpent_
|
|
2863
|
+
extends UniffiEnum
|
|
2864
|
+
implements VtxoAlreadySpent__interface
|
|
2865
|
+
{
|
|
2866
|
+
/**
|
|
2867
|
+
* @private
|
|
2868
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2869
|
+
*/
|
|
2870
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2871
|
+
readonly tag = ExitState_Tags.VtxoAlreadySpent;
|
|
2872
|
+
readonly inner: Readonly<{ tipHeight: /*u32*/ number }>;
|
|
2873
|
+
constructor(inner: { tipHeight: /*u32*/ number }) {
|
|
2874
|
+
super("ExitState", "VtxoAlreadySpent");
|
|
2875
|
+
this.inner = Object.freeze(inner);
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
static new(inner: { tipHeight: /*u32*/ number }): VtxoAlreadySpent_ {
|
|
2879
|
+
return new VtxoAlreadySpent_(inner);
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
static instanceOf(obj: any): obj is VtxoAlreadySpent_ {
|
|
2883
|
+
return obj.tag === ExitState_Tags.VtxoAlreadySpent;
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
type Canceled__interface = {
|
|
2888
|
+
tag: ExitState_Tags.Canceled;
|
|
2889
|
+
inner: Readonly<{ tipHeight: /*u32*/ number }>;
|
|
2890
|
+
};
|
|
2891
|
+
|
|
2892
|
+
/**
|
|
2893
|
+
* Resumable: the user canceled the exit before its final transaction
|
|
2894
|
+
* was broadcast. The VTXO stays spendable.
|
|
2895
|
+
*/
|
|
2896
|
+
class Canceled_ extends UniffiEnum implements Canceled__interface {
|
|
2897
|
+
/**
|
|
2898
|
+
* @private
|
|
2899
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2900
|
+
*/
|
|
2901
|
+
readonly [uniffiTypeNameSymbol] = "ExitState";
|
|
2902
|
+
readonly tag = ExitState_Tags.Canceled;
|
|
2903
|
+
readonly inner: Readonly<{ tipHeight: /*u32*/ number }>;
|
|
2904
|
+
constructor(inner: { tipHeight: /*u32*/ number }) {
|
|
2905
|
+
super("ExitState", "Canceled");
|
|
2906
|
+
this.inner = Object.freeze(inner);
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
static new(inner: { tipHeight: /*u32*/ number }): Canceled_ {
|
|
2910
|
+
return new Canceled_(inner);
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
static instanceOf(obj: any): obj is Canceled_ {
|
|
2914
|
+
return obj.tag === ExitState_Tags.Canceled;
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
function instanceOf(obj: any): obj is ExitState {
|
|
2919
|
+
return obj[uniffiTypeNameSymbol] === "ExitState";
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
return Object.freeze({
|
|
2923
|
+
instanceOf,
|
|
2924
|
+
Start: Start_,
|
|
2925
|
+
Processing: Processing_,
|
|
2926
|
+
AwaitingDelta: AwaitingDelta_,
|
|
2927
|
+
Claimable: Claimable_,
|
|
2928
|
+
ClaimInProgress: ClaimInProgress_,
|
|
2929
|
+
Claimed: Claimed_,
|
|
2930
|
+
VtxoAlreadySpent: VtxoAlreadySpent_,
|
|
2931
|
+
Canceled: Canceled_,
|
|
2932
|
+
});
|
|
2933
|
+
})();
|
|
2934
|
+
|
|
2935
|
+
/**
|
|
2936
|
+
* State of a unilateral exit, mirroring `bark::exit::ExitState`.
|
|
2937
|
+
*
|
|
2938
|
+
* Serde/TS tags match upstream's kebab-case serialization (`"start"`,
|
|
2939
|
+
* `"processing"`, `"awaiting-delta"`, `"claimable"`, `"claim-in-progress"`,
|
|
2940
|
+
* `"claimed"`, `"vtxo-already-spent"`, `"canceled"`), with camelCase fields.
|
|
2941
|
+
*/
|
|
2942
|
+
|
|
2943
|
+
export type ExitState = InstanceType<
|
|
2944
|
+
(typeof ExitState)[keyof Omit<typeof ExitState, "instanceOf">]
|
|
2945
|
+
>;
|
|
2946
|
+
|
|
2947
|
+
// FfiConverter for enum ExitState
|
|
2948
|
+
const FfiConverterTypeExitState = (() => {
|
|
2949
|
+
const ordinalConverter = FfiConverterInt32;
|
|
2950
|
+
type TypeName = ExitState;
|
|
2951
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2952
|
+
read(from: RustBuffer): TypeName {
|
|
2953
|
+
switch (ordinalConverter.read(from)) {
|
|
2954
|
+
case 1:
|
|
2955
|
+
return new ExitState.Start({
|
|
2956
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2957
|
+
});
|
|
2958
|
+
case 2:
|
|
2959
|
+
return new ExitState.Processing({
|
|
2960
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2961
|
+
transactions: FfiConverterArrayTypeExitTx.read(from),
|
|
2962
|
+
});
|
|
2963
|
+
case 3:
|
|
2964
|
+
return new ExitState.AwaitingDelta({
|
|
2965
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2966
|
+
confirmedBlock: FfiConverterTypeBlockRef.read(from),
|
|
2967
|
+
claimableHeight: FfiConverterUInt32.read(from),
|
|
2968
|
+
});
|
|
2969
|
+
case 4:
|
|
2970
|
+
return new ExitState.Claimable({
|
|
2971
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2972
|
+
claimableSince: FfiConverterTypeBlockRef.read(from),
|
|
2973
|
+
lastScannedBlock: FfiConverterOptionalTypeBlockRef.read(from),
|
|
2974
|
+
});
|
|
2975
|
+
case 5:
|
|
2976
|
+
return new ExitState.ClaimInProgress({
|
|
2977
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2978
|
+
claimableSince: FfiConverterTypeBlockRef.read(from),
|
|
2979
|
+
claimTxid: FfiConverterString.read(from),
|
|
2980
|
+
});
|
|
2981
|
+
case 6:
|
|
2982
|
+
return new ExitState.Claimed({
|
|
2983
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2984
|
+
txid: FfiConverterString.read(from),
|
|
2985
|
+
block: FfiConverterTypeBlockRef.read(from),
|
|
2986
|
+
});
|
|
2987
|
+
case 7:
|
|
2988
|
+
return new ExitState.VtxoAlreadySpent({
|
|
2989
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2990
|
+
});
|
|
2991
|
+
case 8:
|
|
2992
|
+
return new ExitState.Canceled({
|
|
2993
|
+
tipHeight: FfiConverterUInt32.read(from),
|
|
2994
|
+
});
|
|
2995
|
+
default:
|
|
2996
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
3000
|
+
switch (value.tag) {
|
|
3001
|
+
case ExitState_Tags.Start: {
|
|
3002
|
+
ordinalConverter.write(1, into);
|
|
3003
|
+
const inner = value.inner;
|
|
3004
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
3005
|
+
return;
|
|
3006
|
+
}
|
|
3007
|
+
case ExitState_Tags.Processing: {
|
|
2169
3008
|
ordinalConverter.write(2, into);
|
|
2170
3009
|
const inner = value.inner;
|
|
2171
|
-
|
|
3010
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
3011
|
+
FfiConverterArrayTypeExitTx.write(inner.transactions, into);
|
|
2172
3012
|
return;
|
|
2173
3013
|
}
|
|
2174
|
-
case
|
|
3014
|
+
case ExitState_Tags.AwaitingDelta: {
|
|
2175
3015
|
ordinalConverter.write(3, into);
|
|
2176
3016
|
const inner = value.inner;
|
|
2177
|
-
|
|
2178
|
-
|
|
3017
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
3018
|
+
FfiConverterTypeBlockRef.write(inner.confirmedBlock, into);
|
|
3019
|
+
FfiConverterUInt32.write(inner.claimableHeight, into);
|
|
3020
|
+
return;
|
|
3021
|
+
}
|
|
3022
|
+
case ExitState_Tags.Claimable: {
|
|
3023
|
+
ordinalConverter.write(4, into);
|
|
3024
|
+
const inner = value.inner;
|
|
3025
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
3026
|
+
FfiConverterTypeBlockRef.write(inner.claimableSince, into);
|
|
3027
|
+
FfiConverterOptionalTypeBlockRef.write(inner.lastScannedBlock, into);
|
|
3028
|
+
return;
|
|
3029
|
+
}
|
|
3030
|
+
case ExitState_Tags.ClaimInProgress: {
|
|
3031
|
+
ordinalConverter.write(5, into);
|
|
3032
|
+
const inner = value.inner;
|
|
3033
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
3034
|
+
FfiConverterTypeBlockRef.write(inner.claimableSince, into);
|
|
3035
|
+
FfiConverterString.write(inner.claimTxid, into);
|
|
3036
|
+
return;
|
|
3037
|
+
}
|
|
3038
|
+
case ExitState_Tags.Claimed: {
|
|
3039
|
+
ordinalConverter.write(6, into);
|
|
3040
|
+
const inner = value.inner;
|
|
3041
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
3042
|
+
FfiConverterString.write(inner.txid, into);
|
|
3043
|
+
FfiConverterTypeBlockRef.write(inner.block, into);
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
case ExitState_Tags.VtxoAlreadySpent: {
|
|
3047
|
+
ordinalConverter.write(7, into);
|
|
3048
|
+
const inner = value.inner;
|
|
3049
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
3050
|
+
return;
|
|
3051
|
+
}
|
|
3052
|
+
case ExitState_Tags.Canceled: {
|
|
3053
|
+
ordinalConverter.write(8, into);
|
|
3054
|
+
const inner = value.inner;
|
|
3055
|
+
FfiConverterUInt32.write(inner.tipHeight, into);
|
|
2179
3056
|
return;
|
|
2180
3057
|
}
|
|
2181
3058
|
default:
|
|
2182
|
-
// Throwing from here means that
|
|
3059
|
+
// Throwing from here means that ExitState_Tags hasn't matched an ordinal.
|
|
2183
3060
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2184
3061
|
}
|
|
2185
3062
|
}
|
|
2186
3063
|
allocationSize(value: TypeName): number {
|
|
2187
3064
|
switch (value.tag) {
|
|
2188
|
-
case
|
|
2189
|
-
|
|
3065
|
+
case ExitState_Tags.Start: {
|
|
3066
|
+
const inner = value.inner;
|
|
3067
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3068
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
3069
|
+
return size;
|
|
2190
3070
|
}
|
|
2191
|
-
case
|
|
3071
|
+
case ExitState_Tags.Processing: {
|
|
2192
3072
|
const inner = value.inner;
|
|
2193
3073
|
let size = ordinalConverter.allocationSize(2);
|
|
2194
|
-
size +=
|
|
3074
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
3075
|
+
size += FfiConverterArrayTypeExitTx.allocationSize(
|
|
3076
|
+
inner.transactions
|
|
3077
|
+
);
|
|
2195
3078
|
return size;
|
|
2196
3079
|
}
|
|
2197
|
-
case
|
|
3080
|
+
case ExitState_Tags.AwaitingDelta: {
|
|
2198
3081
|
const inner = value.inner;
|
|
2199
3082
|
let size = ordinalConverter.allocationSize(3);
|
|
2200
|
-
size +=
|
|
2201
|
-
size +=
|
|
3083
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
3084
|
+
size += FfiConverterTypeBlockRef.allocationSize(inner.confirmedBlock);
|
|
3085
|
+
size += FfiConverterUInt32.allocationSize(inner.claimableHeight);
|
|
3086
|
+
return size;
|
|
3087
|
+
}
|
|
3088
|
+
case ExitState_Tags.Claimable: {
|
|
3089
|
+
const inner = value.inner;
|
|
3090
|
+
let size = ordinalConverter.allocationSize(4);
|
|
3091
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
3092
|
+
size += FfiConverterTypeBlockRef.allocationSize(inner.claimableSince);
|
|
3093
|
+
size += FfiConverterOptionalTypeBlockRef.allocationSize(
|
|
3094
|
+
inner.lastScannedBlock
|
|
3095
|
+
);
|
|
3096
|
+
return size;
|
|
3097
|
+
}
|
|
3098
|
+
case ExitState_Tags.ClaimInProgress: {
|
|
3099
|
+
const inner = value.inner;
|
|
3100
|
+
let size = ordinalConverter.allocationSize(5);
|
|
3101
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
3102
|
+
size += FfiConverterTypeBlockRef.allocationSize(inner.claimableSince);
|
|
3103
|
+
size += FfiConverterString.allocationSize(inner.claimTxid);
|
|
3104
|
+
return size;
|
|
3105
|
+
}
|
|
3106
|
+
case ExitState_Tags.Claimed: {
|
|
3107
|
+
const inner = value.inner;
|
|
3108
|
+
let size = ordinalConverter.allocationSize(6);
|
|
3109
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
3110
|
+
size += FfiConverterString.allocationSize(inner.txid);
|
|
3111
|
+
size += FfiConverterTypeBlockRef.allocationSize(inner.block);
|
|
3112
|
+
return size;
|
|
3113
|
+
}
|
|
3114
|
+
case ExitState_Tags.VtxoAlreadySpent: {
|
|
3115
|
+
const inner = value.inner;
|
|
3116
|
+
let size = ordinalConverter.allocationSize(7);
|
|
3117
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
3118
|
+
return size;
|
|
3119
|
+
}
|
|
3120
|
+
case ExitState_Tags.Canceled: {
|
|
3121
|
+
const inner = value.inner;
|
|
3122
|
+
let size = ordinalConverter.allocationSize(8);
|
|
3123
|
+
size += FfiConverterUInt32.allocationSize(inner.tipHeight);
|
|
2202
3124
|
return size;
|
|
2203
3125
|
}
|
|
2204
3126
|
default:
|
|
@@ -2209,97 +3131,1387 @@ const FfiConverterTypeLightningSendStatus = (() => {
|
|
|
2209
3131
|
return new FFIConverter();
|
|
2210
3132
|
})();
|
|
2211
3133
|
|
|
3134
|
+
// Enum: ExitTxOrigin
|
|
3135
|
+
export enum ExitTxOrigin_Tags {
|
|
3136
|
+
Wallet = "Wallet",
|
|
3137
|
+
Mempool = "Mempool",
|
|
3138
|
+
Block = "Block",
|
|
3139
|
+
}
|
|
2212
3140
|
/**
|
|
2213
|
-
*
|
|
3141
|
+
* Where an exit transaction was first seen, mirroring `bark::exit::ExitTxOrigin`.
|
|
2214
3142
|
*/
|
|
2215
|
-
export
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
Trace,
|
|
2221
|
-
}
|
|
3143
|
+
export const ExitTxOrigin = (() => {
|
|
3144
|
+
type Wallet__interface = {
|
|
3145
|
+
tag: ExitTxOrigin_Tags.Wallet;
|
|
3146
|
+
inner: Readonly<{ confirmedIn: BlockRef | undefined }>;
|
|
3147
|
+
};
|
|
2222
3148
|
|
|
2223
|
-
|
|
3149
|
+
/**
|
|
3150
|
+
* Broadcast by this wallet.
|
|
3151
|
+
*/
|
|
3152
|
+
class Wallet_ extends UniffiEnum implements Wallet__interface {
|
|
3153
|
+
/**
|
|
3154
|
+
* @private
|
|
3155
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3156
|
+
*/
|
|
3157
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxOrigin";
|
|
3158
|
+
readonly tag = ExitTxOrigin_Tags.Wallet;
|
|
3159
|
+
readonly inner: Readonly<{ confirmedIn: BlockRef | undefined }>;
|
|
3160
|
+
constructor(inner: { confirmedIn: BlockRef | undefined }) {
|
|
3161
|
+
super("ExitTxOrigin", "Wallet");
|
|
3162
|
+
this.inner = Object.freeze(inner);
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
static new(inner: { confirmedIn: BlockRef | undefined }): Wallet_ {
|
|
3166
|
+
return new Wallet_(inner);
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
static instanceOf(obj: any): obj is Wallet_ {
|
|
3170
|
+
return obj.tag === ExitTxOrigin_Tags.Wallet;
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
type Mempool__interface = {
|
|
3175
|
+
tag: ExitTxOrigin_Tags.Mempool;
|
|
3176
|
+
};
|
|
3177
|
+
|
|
3178
|
+
/**
|
|
3179
|
+
* Seen in the mempool.
|
|
3180
|
+
*/
|
|
3181
|
+
class Mempool_ extends UniffiEnum implements Mempool__interface {
|
|
3182
|
+
/**
|
|
3183
|
+
* @private
|
|
3184
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3185
|
+
*/
|
|
3186
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxOrigin";
|
|
3187
|
+
readonly tag = ExitTxOrigin_Tags.Mempool;
|
|
3188
|
+
constructor() {
|
|
3189
|
+
super("ExitTxOrigin", "Mempool");
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
static new(): Mempool_ {
|
|
3193
|
+
return new Mempool_();
|
|
3194
|
+
}
|
|
3195
|
+
|
|
3196
|
+
static instanceOf(obj: any): obj is Mempool_ {
|
|
3197
|
+
return obj.tag === ExitTxOrigin_Tags.Mempool;
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
type Block__interface = {
|
|
3202
|
+
tag: ExitTxOrigin_Tags.Block;
|
|
3203
|
+
inner: Readonly<{ confirmedIn: BlockRef }>;
|
|
3204
|
+
};
|
|
3205
|
+
|
|
3206
|
+
/**
|
|
3207
|
+
* Seen confirmed in a block.
|
|
3208
|
+
*/
|
|
3209
|
+
class Block_ extends UniffiEnum implements Block__interface {
|
|
3210
|
+
/**
|
|
3211
|
+
* @private
|
|
3212
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3213
|
+
*/
|
|
3214
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxOrigin";
|
|
3215
|
+
readonly tag = ExitTxOrigin_Tags.Block;
|
|
3216
|
+
readonly inner: Readonly<{ confirmedIn: BlockRef }>;
|
|
3217
|
+
constructor(inner: { confirmedIn: BlockRef }) {
|
|
3218
|
+
super("ExitTxOrigin", "Block");
|
|
3219
|
+
this.inner = Object.freeze(inner);
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
static new(inner: { confirmedIn: BlockRef }): Block_ {
|
|
3223
|
+
return new Block_(inner);
|
|
3224
|
+
}
|
|
3225
|
+
|
|
3226
|
+
static instanceOf(obj: any): obj is Block_ {
|
|
3227
|
+
return obj.tag === ExitTxOrigin_Tags.Block;
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
function instanceOf(obj: any): obj is ExitTxOrigin {
|
|
3232
|
+
return obj[uniffiTypeNameSymbol] === "ExitTxOrigin";
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
return Object.freeze({
|
|
3236
|
+
instanceOf,
|
|
3237
|
+
Wallet: Wallet_,
|
|
3238
|
+
Mempool: Mempool_,
|
|
3239
|
+
Block: Block_,
|
|
3240
|
+
});
|
|
3241
|
+
})();
|
|
3242
|
+
|
|
3243
|
+
/**
|
|
3244
|
+
* Where an exit transaction was first seen, mirroring `bark::exit::ExitTxOrigin`.
|
|
3245
|
+
*/
|
|
3246
|
+
|
|
3247
|
+
export type ExitTxOrigin = InstanceType<
|
|
3248
|
+
(typeof ExitTxOrigin)[keyof Omit<typeof ExitTxOrigin, "instanceOf">]
|
|
3249
|
+
>;
|
|
3250
|
+
|
|
3251
|
+
// FfiConverter for enum ExitTxOrigin
|
|
3252
|
+
const FfiConverterTypeExitTxOrigin = (() => {
|
|
2224
3253
|
const ordinalConverter = FfiConverterInt32;
|
|
2225
|
-
type TypeName =
|
|
3254
|
+
type TypeName = ExitTxOrigin;
|
|
2226
3255
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2227
3256
|
read(from: RustBuffer): TypeName {
|
|
2228
3257
|
switch (ordinalConverter.read(from)) {
|
|
2229
3258
|
case 1:
|
|
2230
|
-
return
|
|
3259
|
+
return new ExitTxOrigin.Wallet({
|
|
3260
|
+
confirmedIn: FfiConverterOptionalTypeBlockRef.read(from),
|
|
3261
|
+
});
|
|
2231
3262
|
case 2:
|
|
2232
|
-
return
|
|
3263
|
+
return new ExitTxOrigin.Mempool();
|
|
2233
3264
|
case 3:
|
|
2234
|
-
return
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
3265
|
+
return new ExitTxOrigin.Block({
|
|
3266
|
+
confirmedIn: FfiConverterTypeBlockRef.read(from),
|
|
3267
|
+
});
|
|
3268
|
+
default:
|
|
3269
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
3273
|
+
switch (value.tag) {
|
|
3274
|
+
case ExitTxOrigin_Tags.Wallet: {
|
|
3275
|
+
ordinalConverter.write(1, into);
|
|
3276
|
+
const inner = value.inner;
|
|
3277
|
+
FfiConverterOptionalTypeBlockRef.write(inner.confirmedIn, into);
|
|
3278
|
+
return;
|
|
3279
|
+
}
|
|
3280
|
+
case ExitTxOrigin_Tags.Mempool: {
|
|
3281
|
+
ordinalConverter.write(2, into);
|
|
3282
|
+
return;
|
|
3283
|
+
}
|
|
3284
|
+
case ExitTxOrigin_Tags.Block: {
|
|
3285
|
+
ordinalConverter.write(3, into);
|
|
3286
|
+
const inner = value.inner;
|
|
3287
|
+
FfiConverterTypeBlockRef.write(inner.confirmedIn, into);
|
|
3288
|
+
return;
|
|
3289
|
+
}
|
|
3290
|
+
default:
|
|
3291
|
+
// Throwing from here means that ExitTxOrigin_Tags hasn't matched an ordinal.
|
|
3292
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3295
|
+
allocationSize(value: TypeName): number {
|
|
3296
|
+
switch (value.tag) {
|
|
3297
|
+
case ExitTxOrigin_Tags.Wallet: {
|
|
3298
|
+
const inner = value.inner;
|
|
3299
|
+
let size = ordinalConverter.allocationSize(1);
|
|
3300
|
+
size += FfiConverterOptionalTypeBlockRef.allocationSize(
|
|
3301
|
+
inner.confirmedIn
|
|
3302
|
+
);
|
|
3303
|
+
return size;
|
|
3304
|
+
}
|
|
3305
|
+
case ExitTxOrigin_Tags.Mempool: {
|
|
3306
|
+
return ordinalConverter.allocationSize(2);
|
|
3307
|
+
}
|
|
3308
|
+
case ExitTxOrigin_Tags.Block: {
|
|
3309
|
+
const inner = value.inner;
|
|
3310
|
+
let size = ordinalConverter.allocationSize(3);
|
|
3311
|
+
size += FfiConverterTypeBlockRef.allocationSize(inner.confirmedIn);
|
|
3312
|
+
return size;
|
|
3313
|
+
}
|
|
2239
3314
|
default:
|
|
2240
3315
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2241
3316
|
}
|
|
2242
3317
|
}
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
3318
|
+
}
|
|
3319
|
+
return new FFIConverter();
|
|
3320
|
+
})();
|
|
3321
|
+
|
|
3322
|
+
// Enum: ExitTxStatus
|
|
3323
|
+
export enum ExitTxStatus_Tags {
|
|
3324
|
+
VerifyInputs = "VerifyInputs",
|
|
3325
|
+
AwaitingInputConfirmation = "AwaitingInputConfirmation",
|
|
3326
|
+
AwaitingCpfpBroadcast = "AwaitingCpfpBroadcast",
|
|
3327
|
+
AwaitingConfirmation = "AwaitingConfirmation",
|
|
3328
|
+
Confirmed = "Confirmed",
|
|
3329
|
+
}
|
|
3330
|
+
/**
|
|
3331
|
+
* Broadcast/confirmation status of one transaction in an exit chain,
|
|
3332
|
+
* mirroring `bark::exit::ExitTxStatus`.
|
|
3333
|
+
*/
|
|
3334
|
+
export const ExitTxStatus = (() => {
|
|
3335
|
+
type VerifyInputs__interface = {
|
|
3336
|
+
tag: ExitTxStatus_Tags.VerifyInputs;
|
|
3337
|
+
};
|
|
3338
|
+
|
|
3339
|
+
/**
|
|
3340
|
+
* Inputs are still being verified.
|
|
3341
|
+
*/
|
|
3342
|
+
class VerifyInputs_ extends UniffiEnum implements VerifyInputs__interface {
|
|
3343
|
+
/**
|
|
3344
|
+
* @private
|
|
3345
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3346
|
+
*/
|
|
3347
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxStatus";
|
|
3348
|
+
readonly tag = ExitTxStatus_Tags.VerifyInputs;
|
|
3349
|
+
constructor() {
|
|
3350
|
+
super("ExitTxStatus", "VerifyInputs");
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
static new(): VerifyInputs_ {
|
|
3354
|
+
return new VerifyInputs_();
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
static instanceOf(obj: any): obj is VerifyInputs_ {
|
|
3358
|
+
return obj.tag === ExitTxStatus_Tags.VerifyInputs;
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
type AwaitingInputConfirmation__interface = {
|
|
3363
|
+
tag: ExitTxStatus_Tags.AwaitingInputConfirmation;
|
|
3364
|
+
inner: Readonly<{ txids: Array<string> }>;
|
|
3365
|
+
};
|
|
3366
|
+
|
|
3367
|
+
/**
|
|
3368
|
+
* Waiting for the given input txids to confirm. Sorted for a stable
|
|
3369
|
+
* order (upstream keeps them in a set).
|
|
3370
|
+
*/
|
|
3371
|
+
class AwaitingInputConfirmation_
|
|
3372
|
+
extends UniffiEnum
|
|
3373
|
+
implements AwaitingInputConfirmation__interface
|
|
3374
|
+
{
|
|
3375
|
+
/**
|
|
3376
|
+
* @private
|
|
3377
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3378
|
+
*/
|
|
3379
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxStatus";
|
|
3380
|
+
readonly tag = ExitTxStatus_Tags.AwaitingInputConfirmation;
|
|
3381
|
+
readonly inner: Readonly<{ txids: Array<string> }>;
|
|
3382
|
+
constructor(inner: { txids: Array<string> }) {
|
|
3383
|
+
super("ExitTxStatus", "AwaitingInputConfirmation");
|
|
3384
|
+
this.inner = Object.freeze(inner);
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
static new(inner: { txids: Array<string> }): AwaitingInputConfirmation_ {
|
|
3388
|
+
return new AwaitingInputConfirmation_(inner);
|
|
3389
|
+
}
|
|
3390
|
+
|
|
3391
|
+
static instanceOf(obj: any): obj is AwaitingInputConfirmation_ {
|
|
3392
|
+
return obj.tag === ExitTxStatus_Tags.AwaitingInputConfirmation;
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
type AwaitingCpfpBroadcast__interface = {
|
|
3397
|
+
tag: ExitTxStatus_Tags.AwaitingCpfpBroadcast;
|
|
3398
|
+
};
|
|
3399
|
+
|
|
3400
|
+
/**
|
|
3401
|
+
* Ready for its CPFP child to be broadcast.
|
|
3402
|
+
*/
|
|
3403
|
+
class AwaitingCpfpBroadcast_
|
|
3404
|
+
extends UniffiEnum
|
|
3405
|
+
implements AwaitingCpfpBroadcast__interface
|
|
3406
|
+
{
|
|
3407
|
+
/**
|
|
3408
|
+
* @private
|
|
3409
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3410
|
+
*/
|
|
3411
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxStatus";
|
|
3412
|
+
readonly tag = ExitTxStatus_Tags.AwaitingCpfpBroadcast;
|
|
3413
|
+
constructor() {
|
|
3414
|
+
super("ExitTxStatus", "AwaitingCpfpBroadcast");
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
static new(): AwaitingCpfpBroadcast_ {
|
|
3418
|
+
return new AwaitingCpfpBroadcast_();
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
static instanceOf(obj: any): obj is AwaitingCpfpBroadcast_ {
|
|
3422
|
+
return obj.tag === ExitTxStatus_Tags.AwaitingCpfpBroadcast;
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
type AwaitingConfirmation__interface = {
|
|
3427
|
+
tag: ExitTxStatus_Tags.AwaitingConfirmation;
|
|
3428
|
+
inner: Readonly<{ childTxid: string; origin: ExitTxOrigin }>;
|
|
3429
|
+
};
|
|
3430
|
+
|
|
3431
|
+
/**
|
|
3432
|
+
* CPFP child broadcast; waiting for confirmation.
|
|
3433
|
+
*/
|
|
3434
|
+
class AwaitingConfirmation_
|
|
3435
|
+
extends UniffiEnum
|
|
3436
|
+
implements AwaitingConfirmation__interface
|
|
3437
|
+
{
|
|
3438
|
+
/**
|
|
3439
|
+
* @private
|
|
3440
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3441
|
+
*/
|
|
3442
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxStatus";
|
|
3443
|
+
readonly tag = ExitTxStatus_Tags.AwaitingConfirmation;
|
|
3444
|
+
readonly inner: Readonly<{ childTxid: string; origin: ExitTxOrigin }>;
|
|
3445
|
+
constructor(inner: { childTxid: string; origin: ExitTxOrigin }) {
|
|
3446
|
+
super("ExitTxStatus", "AwaitingConfirmation");
|
|
3447
|
+
this.inner = Object.freeze(inner);
|
|
3448
|
+
}
|
|
3449
|
+
|
|
3450
|
+
static new(inner: {
|
|
3451
|
+
childTxid: string;
|
|
3452
|
+
origin: ExitTxOrigin;
|
|
3453
|
+
}): AwaitingConfirmation_ {
|
|
3454
|
+
return new AwaitingConfirmation_(inner);
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3457
|
+
static instanceOf(obj: any): obj is AwaitingConfirmation_ {
|
|
3458
|
+
return obj.tag === ExitTxStatus_Tags.AwaitingConfirmation;
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
|
|
3462
|
+
type Confirmed__interface = {
|
|
3463
|
+
tag: ExitTxStatus_Tags.Confirmed;
|
|
3464
|
+
inner: Readonly<{
|
|
3465
|
+
childTxid: string;
|
|
3466
|
+
block: BlockRef;
|
|
3467
|
+
origin: ExitTxOrigin;
|
|
3468
|
+
}>;
|
|
3469
|
+
};
|
|
3470
|
+
|
|
3471
|
+
/**
|
|
3472
|
+
* Confirmed in a block.
|
|
3473
|
+
*/
|
|
3474
|
+
class Confirmed_ extends UniffiEnum implements Confirmed__interface {
|
|
3475
|
+
/**
|
|
3476
|
+
* @private
|
|
3477
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3478
|
+
*/
|
|
3479
|
+
readonly [uniffiTypeNameSymbol] = "ExitTxStatus";
|
|
3480
|
+
readonly tag = ExitTxStatus_Tags.Confirmed;
|
|
3481
|
+
readonly inner: Readonly<{
|
|
3482
|
+
childTxid: string;
|
|
3483
|
+
block: BlockRef;
|
|
3484
|
+
origin: ExitTxOrigin;
|
|
3485
|
+
}>;
|
|
3486
|
+
constructor(inner: {
|
|
3487
|
+
childTxid: string;
|
|
3488
|
+
block: BlockRef;
|
|
3489
|
+
origin: ExitTxOrigin;
|
|
3490
|
+
}) {
|
|
3491
|
+
super("ExitTxStatus", "Confirmed");
|
|
3492
|
+
this.inner = Object.freeze(inner);
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
static new(inner: {
|
|
3496
|
+
childTxid: string;
|
|
3497
|
+
block: BlockRef;
|
|
3498
|
+
origin: ExitTxOrigin;
|
|
3499
|
+
}): Confirmed_ {
|
|
3500
|
+
return new Confirmed_(inner);
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
static instanceOf(obj: any): obj is Confirmed_ {
|
|
3504
|
+
return obj.tag === ExitTxStatus_Tags.Confirmed;
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
function instanceOf(obj: any): obj is ExitTxStatus {
|
|
3509
|
+
return obj[uniffiTypeNameSymbol] === "ExitTxStatus";
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
return Object.freeze({
|
|
3513
|
+
instanceOf,
|
|
3514
|
+
VerifyInputs: VerifyInputs_,
|
|
3515
|
+
AwaitingInputConfirmation: AwaitingInputConfirmation_,
|
|
3516
|
+
AwaitingCpfpBroadcast: AwaitingCpfpBroadcast_,
|
|
3517
|
+
AwaitingConfirmation: AwaitingConfirmation_,
|
|
3518
|
+
Confirmed: Confirmed_,
|
|
3519
|
+
});
|
|
3520
|
+
})();
|
|
3521
|
+
|
|
3522
|
+
/**
|
|
3523
|
+
* Broadcast/confirmation status of one transaction in an exit chain,
|
|
3524
|
+
* mirroring `bark::exit::ExitTxStatus`.
|
|
3525
|
+
*/
|
|
3526
|
+
|
|
3527
|
+
export type ExitTxStatus = InstanceType<
|
|
3528
|
+
(typeof ExitTxStatus)[keyof Omit<typeof ExitTxStatus, "instanceOf">]
|
|
3529
|
+
>;
|
|
3530
|
+
|
|
3531
|
+
// FfiConverter for enum ExitTxStatus
|
|
3532
|
+
const FfiConverterTypeExitTxStatus = (() => {
|
|
3533
|
+
const ordinalConverter = FfiConverterInt32;
|
|
3534
|
+
type TypeName = ExitTxStatus;
|
|
3535
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
3536
|
+
read(from: RustBuffer): TypeName {
|
|
3537
|
+
switch (ordinalConverter.read(from)) {
|
|
3538
|
+
case 1:
|
|
3539
|
+
return new ExitTxStatus.VerifyInputs();
|
|
3540
|
+
case 2:
|
|
3541
|
+
return new ExitTxStatus.AwaitingInputConfirmation({
|
|
3542
|
+
txids: FfiConverterArrayString.read(from),
|
|
3543
|
+
});
|
|
3544
|
+
case 3:
|
|
3545
|
+
return new ExitTxStatus.AwaitingCpfpBroadcast();
|
|
3546
|
+
case 4:
|
|
3547
|
+
return new ExitTxStatus.AwaitingConfirmation({
|
|
3548
|
+
childTxid: FfiConverterString.read(from),
|
|
3549
|
+
origin: FfiConverterTypeExitTxOrigin.read(from),
|
|
3550
|
+
});
|
|
3551
|
+
case 5:
|
|
3552
|
+
return new ExitTxStatus.Confirmed({
|
|
3553
|
+
childTxid: FfiConverterString.read(from),
|
|
3554
|
+
block: FfiConverterTypeBlockRef.read(from),
|
|
3555
|
+
origin: FfiConverterTypeExitTxOrigin.read(from),
|
|
3556
|
+
});
|
|
3557
|
+
default:
|
|
3558
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
3562
|
+
switch (value.tag) {
|
|
3563
|
+
case ExitTxStatus_Tags.VerifyInputs: {
|
|
3564
|
+
ordinalConverter.write(1, into);
|
|
3565
|
+
return;
|
|
3566
|
+
}
|
|
3567
|
+
case ExitTxStatus_Tags.AwaitingInputConfirmation: {
|
|
3568
|
+
ordinalConverter.write(2, into);
|
|
3569
|
+
const inner = value.inner;
|
|
3570
|
+
FfiConverterArrayString.write(inner.txids, into);
|
|
3571
|
+
return;
|
|
3572
|
+
}
|
|
3573
|
+
case ExitTxStatus_Tags.AwaitingCpfpBroadcast: {
|
|
3574
|
+
ordinalConverter.write(3, into);
|
|
3575
|
+
return;
|
|
3576
|
+
}
|
|
3577
|
+
case ExitTxStatus_Tags.AwaitingConfirmation: {
|
|
3578
|
+
ordinalConverter.write(4, into);
|
|
3579
|
+
const inner = value.inner;
|
|
3580
|
+
FfiConverterString.write(inner.childTxid, into);
|
|
3581
|
+
FfiConverterTypeExitTxOrigin.write(inner.origin, into);
|
|
3582
|
+
return;
|
|
3583
|
+
}
|
|
3584
|
+
case ExitTxStatus_Tags.Confirmed: {
|
|
3585
|
+
ordinalConverter.write(5, into);
|
|
3586
|
+
const inner = value.inner;
|
|
3587
|
+
FfiConverterString.write(inner.childTxid, into);
|
|
3588
|
+
FfiConverterTypeBlockRef.write(inner.block, into);
|
|
3589
|
+
FfiConverterTypeExitTxOrigin.write(inner.origin, into);
|
|
3590
|
+
return;
|
|
3591
|
+
}
|
|
3592
|
+
default:
|
|
3593
|
+
// Throwing from here means that ExitTxStatus_Tags hasn't matched an ordinal.
|
|
3594
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
allocationSize(value: TypeName): number {
|
|
3598
|
+
switch (value.tag) {
|
|
3599
|
+
case ExitTxStatus_Tags.VerifyInputs: {
|
|
3600
|
+
return ordinalConverter.allocationSize(1);
|
|
3601
|
+
}
|
|
3602
|
+
case ExitTxStatus_Tags.AwaitingInputConfirmation: {
|
|
3603
|
+
const inner = value.inner;
|
|
3604
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3605
|
+
size += FfiConverterArrayString.allocationSize(inner.txids);
|
|
3606
|
+
return size;
|
|
3607
|
+
}
|
|
3608
|
+
case ExitTxStatus_Tags.AwaitingCpfpBroadcast: {
|
|
3609
|
+
return ordinalConverter.allocationSize(3);
|
|
3610
|
+
}
|
|
3611
|
+
case ExitTxStatus_Tags.AwaitingConfirmation: {
|
|
3612
|
+
const inner = value.inner;
|
|
3613
|
+
let size = ordinalConverter.allocationSize(4);
|
|
3614
|
+
size += FfiConverterString.allocationSize(inner.childTxid);
|
|
3615
|
+
size += FfiConverterTypeExitTxOrigin.allocationSize(inner.origin);
|
|
3616
|
+
return size;
|
|
3617
|
+
}
|
|
3618
|
+
case ExitTxStatus_Tags.Confirmed: {
|
|
3619
|
+
const inner = value.inner;
|
|
3620
|
+
let size = ordinalConverter.allocationSize(5);
|
|
3621
|
+
size += FfiConverterString.allocationSize(inner.childTxid);
|
|
3622
|
+
size += FfiConverterTypeBlockRef.allocationSize(inner.block);
|
|
3623
|
+
size += FfiConverterTypeExitTxOrigin.allocationSize(inner.origin);
|
|
3624
|
+
return size;
|
|
3625
|
+
}
|
|
3626
|
+
default:
|
|
3627
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
return new FFIConverter();
|
|
3632
|
+
})();
|
|
3633
|
+
|
|
3634
|
+
// Enum: LightningSendStatus
|
|
3635
|
+
export enum LightningSendStatus_Tags {
|
|
3636
|
+
Unknown = "Unknown",
|
|
3637
|
+
InProgress = "InProgress",
|
|
3638
|
+
Paid = "Paid",
|
|
3639
|
+
}
|
|
3640
|
+
/**
|
|
3641
|
+
* Terminal/in-flight state of an outgoing lightning send.
|
|
3642
|
+
*
|
|
3643
|
+
* Mirrors `bark`'s `LightningSendState`. `pay_lightning_*` and
|
|
3644
|
+
* `check_lightning_payment` now return this so callers can drive the
|
|
3645
|
+
* crash-safe send flow themselves (initiate with `wait = false`, then poll).
|
|
3646
|
+
*/
|
|
3647
|
+
export const LightningSendStatus = (() => {
|
|
3648
|
+
type Unknown__interface = {
|
|
3649
|
+
tag: LightningSendStatus_Tags.Unknown;
|
|
3650
|
+
};
|
|
3651
|
+
|
|
3652
|
+
/**
|
|
3653
|
+
* No record of this payment (never started, or already pruned).
|
|
3654
|
+
*/
|
|
3655
|
+
class Unknown_ extends UniffiEnum implements Unknown__interface {
|
|
3656
|
+
/**
|
|
3657
|
+
* @private
|
|
3658
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3659
|
+
*/
|
|
3660
|
+
readonly [uniffiTypeNameSymbol] = "LightningSendStatus";
|
|
3661
|
+
readonly tag = LightningSendStatus_Tags.Unknown;
|
|
3662
|
+
constructor() {
|
|
3663
|
+
super("LightningSendStatus", "Unknown");
|
|
3664
|
+
}
|
|
3665
|
+
|
|
3666
|
+
static new(): Unknown_ {
|
|
3667
|
+
return new Unknown_();
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
static instanceOf(obj: any): obj is Unknown_ {
|
|
3671
|
+
return obj.tag === LightningSendStatus_Tags.Unknown;
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3675
|
+
type InProgress__interface = {
|
|
3676
|
+
tag: LightningSendStatus_Tags.InProgress;
|
|
3677
|
+
inner: Readonly<{ send: LightningSend }>;
|
|
3678
|
+
};
|
|
3679
|
+
|
|
3680
|
+
/**
|
|
3681
|
+
* Send is in flight; HTLC VTXOs are locked.
|
|
3682
|
+
*/
|
|
3683
|
+
class InProgress_ extends UniffiEnum implements InProgress__interface {
|
|
3684
|
+
/**
|
|
3685
|
+
* @private
|
|
3686
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3687
|
+
*/
|
|
3688
|
+
readonly [uniffiTypeNameSymbol] = "LightningSendStatus";
|
|
3689
|
+
readonly tag = LightningSendStatus_Tags.InProgress;
|
|
3690
|
+
readonly inner: Readonly<{ send: LightningSend }>;
|
|
3691
|
+
constructor(inner: { send: LightningSend }) {
|
|
3692
|
+
super("LightningSendStatus", "InProgress");
|
|
3693
|
+
this.inner = Object.freeze(inner);
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
static new(inner: { send: LightningSend }): InProgress_ {
|
|
3697
|
+
return new InProgress_(inner);
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3700
|
+
static instanceOf(obj: any): obj is InProgress_ {
|
|
3701
|
+
return obj.tag === LightningSendStatus_Tags.InProgress;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
type Paid__interface = {
|
|
3706
|
+
tag: LightningSendStatus_Tags.Paid;
|
|
3707
|
+
inner: Readonly<{ paymentHash: string; preimage: string }>;
|
|
3708
|
+
};
|
|
3709
|
+
|
|
3710
|
+
/**
|
|
3711
|
+
* Send has settled; the preimage proves payment.
|
|
3712
|
+
*/
|
|
3713
|
+
class Paid_ extends UniffiEnum implements Paid__interface {
|
|
3714
|
+
/**
|
|
3715
|
+
* @private
|
|
3716
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3717
|
+
*/
|
|
3718
|
+
readonly [uniffiTypeNameSymbol] = "LightningSendStatus";
|
|
3719
|
+
readonly tag = LightningSendStatus_Tags.Paid;
|
|
3720
|
+
readonly inner: Readonly<{ paymentHash: string; preimage: string }>;
|
|
3721
|
+
constructor(inner: { paymentHash: string; preimage: string }) {
|
|
3722
|
+
super("LightningSendStatus", "Paid");
|
|
3723
|
+
this.inner = Object.freeze(inner);
|
|
3724
|
+
}
|
|
3725
|
+
|
|
3726
|
+
static new(inner: { paymentHash: string; preimage: string }): Paid_ {
|
|
3727
|
+
return new Paid_(inner);
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
static instanceOf(obj: any): obj is Paid_ {
|
|
3731
|
+
return obj.tag === LightningSendStatus_Tags.Paid;
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
|
|
3735
|
+
function instanceOf(obj: any): obj is LightningSendStatus {
|
|
3736
|
+
return obj[uniffiTypeNameSymbol] === "LightningSendStatus";
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
return Object.freeze({
|
|
3740
|
+
instanceOf,
|
|
3741
|
+
Unknown: Unknown_,
|
|
3742
|
+
InProgress: InProgress_,
|
|
3743
|
+
Paid: Paid_,
|
|
3744
|
+
});
|
|
3745
|
+
})();
|
|
3746
|
+
|
|
3747
|
+
/**
|
|
3748
|
+
* Terminal/in-flight state of an outgoing lightning send.
|
|
3749
|
+
*
|
|
3750
|
+
* Mirrors `bark`'s `LightningSendState`. `pay_lightning_*` and
|
|
3751
|
+
* `check_lightning_payment` now return this so callers can drive the
|
|
3752
|
+
* crash-safe send flow themselves (initiate with `wait = false`, then poll).
|
|
3753
|
+
*/
|
|
3754
|
+
|
|
3755
|
+
export type LightningSendStatus = InstanceType<
|
|
3756
|
+
(typeof LightningSendStatus)[keyof Omit<
|
|
3757
|
+
typeof LightningSendStatus,
|
|
3758
|
+
"instanceOf"
|
|
3759
|
+
>]
|
|
3760
|
+
>;
|
|
3761
|
+
|
|
3762
|
+
// FfiConverter for enum LightningSendStatus
|
|
3763
|
+
const FfiConverterTypeLightningSendStatus = (() => {
|
|
3764
|
+
const ordinalConverter = FfiConverterInt32;
|
|
3765
|
+
type TypeName = LightningSendStatus;
|
|
3766
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
3767
|
+
read(from: RustBuffer): TypeName {
|
|
3768
|
+
switch (ordinalConverter.read(from)) {
|
|
3769
|
+
case 1:
|
|
3770
|
+
return new LightningSendStatus.Unknown();
|
|
3771
|
+
case 2:
|
|
3772
|
+
return new LightningSendStatus.InProgress({
|
|
3773
|
+
send: FfiConverterTypeLightningSend.read(from),
|
|
3774
|
+
});
|
|
3775
|
+
case 3:
|
|
3776
|
+
return new LightningSendStatus.Paid({
|
|
3777
|
+
paymentHash: FfiConverterString.read(from),
|
|
3778
|
+
preimage: FfiConverterString.read(from),
|
|
3779
|
+
});
|
|
3780
|
+
default:
|
|
3781
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3782
|
+
}
|
|
3783
|
+
}
|
|
3784
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
3785
|
+
switch (value.tag) {
|
|
3786
|
+
case LightningSendStatus_Tags.Unknown: {
|
|
3787
|
+
ordinalConverter.write(1, into);
|
|
3788
|
+
return;
|
|
3789
|
+
}
|
|
3790
|
+
case LightningSendStatus_Tags.InProgress: {
|
|
3791
|
+
ordinalConverter.write(2, into);
|
|
3792
|
+
const inner = value.inner;
|
|
3793
|
+
FfiConverterTypeLightningSend.write(inner.send, into);
|
|
3794
|
+
return;
|
|
3795
|
+
}
|
|
3796
|
+
case LightningSendStatus_Tags.Paid: {
|
|
3797
|
+
ordinalConverter.write(3, into);
|
|
3798
|
+
const inner = value.inner;
|
|
3799
|
+
FfiConverterString.write(inner.paymentHash, into);
|
|
3800
|
+
FfiConverterString.write(inner.preimage, into);
|
|
3801
|
+
return;
|
|
3802
|
+
}
|
|
3803
|
+
default:
|
|
3804
|
+
// Throwing from here means that LightningSendStatus_Tags hasn't matched an ordinal.
|
|
3805
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
allocationSize(value: TypeName): number {
|
|
3809
|
+
switch (value.tag) {
|
|
3810
|
+
case LightningSendStatus_Tags.Unknown: {
|
|
3811
|
+
return ordinalConverter.allocationSize(1);
|
|
3812
|
+
}
|
|
3813
|
+
case LightningSendStatus_Tags.InProgress: {
|
|
3814
|
+
const inner = value.inner;
|
|
3815
|
+
let size = ordinalConverter.allocationSize(2);
|
|
3816
|
+
size += FfiConverterTypeLightningSend.allocationSize(inner.send);
|
|
3817
|
+
return size;
|
|
3818
|
+
}
|
|
3819
|
+
case LightningSendStatus_Tags.Paid: {
|
|
3820
|
+
const inner = value.inner;
|
|
3821
|
+
let size = ordinalConverter.allocationSize(3);
|
|
3822
|
+
size += FfiConverterString.allocationSize(inner.paymentHash);
|
|
3823
|
+
size += FfiConverterString.allocationSize(inner.preimage);
|
|
3824
|
+
return size;
|
|
3825
|
+
}
|
|
3826
|
+
default:
|
|
3827
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3828
|
+
}
|
|
3829
|
+
}
|
|
3830
|
+
}
|
|
3831
|
+
return new FFIConverter();
|
|
3832
|
+
})();
|
|
3833
|
+
|
|
3834
|
+
/**
|
|
3835
|
+
* Severity of a log record.
|
|
3836
|
+
*/
|
|
3837
|
+
export enum LogLevel {
|
|
3838
|
+
Error,
|
|
3839
|
+
Warn,
|
|
3840
|
+
Info,
|
|
3841
|
+
Debug,
|
|
3842
|
+
Trace,
|
|
3843
|
+
}
|
|
3844
|
+
|
|
3845
|
+
const FfiConverterTypeLogLevel = (() => {
|
|
3846
|
+
const ordinalConverter = FfiConverterInt32;
|
|
3847
|
+
type TypeName = LogLevel;
|
|
3848
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
3849
|
+
read(from: RustBuffer): TypeName {
|
|
3850
|
+
switch (ordinalConverter.read(from)) {
|
|
3851
|
+
case 1:
|
|
3852
|
+
return LogLevel.Error;
|
|
3853
|
+
case 2:
|
|
3854
|
+
return LogLevel.Warn;
|
|
3855
|
+
case 3:
|
|
3856
|
+
return LogLevel.Info;
|
|
3857
|
+
case 4:
|
|
3858
|
+
return LogLevel.Debug;
|
|
3859
|
+
case 5:
|
|
3860
|
+
return LogLevel.Trace;
|
|
3861
|
+
default:
|
|
3862
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
3866
|
+
switch (value) {
|
|
3867
|
+
case LogLevel.Error:
|
|
3868
|
+
return ordinalConverter.write(1, into);
|
|
3869
|
+
case LogLevel.Warn:
|
|
3870
|
+
return ordinalConverter.write(2, into);
|
|
3871
|
+
case LogLevel.Info:
|
|
3872
|
+
return ordinalConverter.write(3, into);
|
|
3873
|
+
case LogLevel.Debug:
|
|
3874
|
+
return ordinalConverter.write(4, into);
|
|
3875
|
+
case LogLevel.Trace:
|
|
3876
|
+
return ordinalConverter.write(5, into);
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
allocationSize(value: TypeName): number {
|
|
3880
|
+
return ordinalConverter.allocationSize(0);
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
return new FFIConverter();
|
|
3884
|
+
})();
|
|
3885
|
+
|
|
3886
|
+
export enum Network {
|
|
3887
|
+
Bitcoin,
|
|
3888
|
+
Testnet,
|
|
3889
|
+
Signet,
|
|
3890
|
+
Regtest,
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
const FfiConverterTypeNetwork = (() => {
|
|
3894
|
+
const ordinalConverter = FfiConverterInt32;
|
|
3895
|
+
type TypeName = Network;
|
|
3896
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
3897
|
+
read(from: RustBuffer): TypeName {
|
|
3898
|
+
switch (ordinalConverter.read(from)) {
|
|
3899
|
+
case 1:
|
|
3900
|
+
return Network.Bitcoin;
|
|
3901
|
+
case 2:
|
|
3902
|
+
return Network.Testnet;
|
|
3903
|
+
case 3:
|
|
3904
|
+
return Network.Signet;
|
|
3905
|
+
case 4:
|
|
3906
|
+
return Network.Regtest;
|
|
3907
|
+
default:
|
|
3908
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
3912
|
+
switch (value) {
|
|
3913
|
+
case Network.Bitcoin:
|
|
3914
|
+
return ordinalConverter.write(1, into);
|
|
3915
|
+
case Network.Testnet:
|
|
3916
|
+
return ordinalConverter.write(2, into);
|
|
3917
|
+
case Network.Signet:
|
|
3918
|
+
return ordinalConverter.write(3, into);
|
|
3919
|
+
case Network.Regtest:
|
|
3920
|
+
return ordinalConverter.write(4, into);
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
allocationSize(value: TypeName): number {
|
|
3924
|
+
return ordinalConverter.allocationSize(0);
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
return new FFIConverter();
|
|
3928
|
+
})();
|
|
3929
|
+
|
|
3930
|
+
// Enum: OnchainUtxo
|
|
3931
|
+
export enum OnchainUtxo_Tags {
|
|
3932
|
+
Local = "Local",
|
|
3933
|
+
Exit = "Exit",
|
|
3934
|
+
}
|
|
3935
|
+
/**
|
|
3936
|
+
* An onchain UTXO known to the wallet, mirroring `bark::onchain::Utxo`.
|
|
3937
|
+
*/
|
|
3938
|
+
export const OnchainUtxo = (() => {
|
|
3939
|
+
type Local__interface = {
|
|
3940
|
+
tag: OnchainUtxo_Tags.Local;
|
|
3941
|
+
inner: Readonly<{
|
|
3942
|
+
outpoint: OutPoint;
|
|
3943
|
+
amountSats: /*u64*/ bigint;
|
|
3944
|
+
confirmationHeight: /*u32*/ number | undefined;
|
|
3945
|
+
}>;
|
|
3946
|
+
};
|
|
3947
|
+
|
|
3948
|
+
/**
|
|
3949
|
+
* A standard wallet UTXO.
|
|
3950
|
+
*/
|
|
3951
|
+
class Local_ extends UniffiEnum implements Local__interface {
|
|
3952
|
+
/**
|
|
3953
|
+
* @private
|
|
3954
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3955
|
+
*/
|
|
3956
|
+
readonly [uniffiTypeNameSymbol] = "OnchainUtxo";
|
|
3957
|
+
readonly tag = OnchainUtxo_Tags.Local;
|
|
3958
|
+
readonly inner: Readonly<{
|
|
3959
|
+
outpoint: OutPoint;
|
|
3960
|
+
amountSats: /*u64*/ bigint;
|
|
3961
|
+
confirmationHeight: /*u32*/ number | undefined;
|
|
3962
|
+
}>;
|
|
3963
|
+
constructor(inner: {
|
|
3964
|
+
outpoint: OutPoint;
|
|
3965
|
+
amountSats: /*u64*/ bigint;
|
|
3966
|
+
/**
|
|
3967
|
+
* `None` if unconfirmed.
|
|
3968
|
+
*/ confirmationHeight: /*u32*/ number | undefined;
|
|
3969
|
+
}) {
|
|
3970
|
+
super("OnchainUtxo", "Local");
|
|
3971
|
+
this.inner = Object.freeze(inner);
|
|
3972
|
+
}
|
|
3973
|
+
|
|
3974
|
+
static new(inner: {
|
|
3975
|
+
outpoint: OutPoint;
|
|
3976
|
+
amountSats: /*u64*/ bigint;
|
|
3977
|
+
/**
|
|
3978
|
+
* `None` if unconfirmed.
|
|
3979
|
+
*/ confirmationHeight: /*u32*/ number | undefined;
|
|
3980
|
+
}): Local_ {
|
|
3981
|
+
return new Local_(inner);
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
static instanceOf(obj: any): obj is Local_ {
|
|
3985
|
+
return obj.tag === OnchainUtxo_Tags.Local;
|
|
3986
|
+
}
|
|
3987
|
+
}
|
|
3988
|
+
|
|
3989
|
+
type Exit__interface = {
|
|
3990
|
+
tag: OnchainUtxo_Tags.Exit;
|
|
3991
|
+
inner: Readonly<{
|
|
3992
|
+
vtxoId: string;
|
|
3993
|
+
amountSats: /*u64*/ bigint;
|
|
3994
|
+
height: /*u32*/ number;
|
|
3995
|
+
}>;
|
|
3996
|
+
};
|
|
3997
|
+
|
|
3998
|
+
/**
|
|
3999
|
+
* A spendable unilateral-exit output claimed from a VTXO.
|
|
4000
|
+
*/
|
|
4001
|
+
class Exit_ extends UniffiEnum implements Exit__interface {
|
|
4002
|
+
/**
|
|
4003
|
+
* @private
|
|
4004
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4005
|
+
*/
|
|
4006
|
+
readonly [uniffiTypeNameSymbol] = "OnchainUtxo";
|
|
4007
|
+
readonly tag = OnchainUtxo_Tags.Exit;
|
|
4008
|
+
readonly inner: Readonly<{
|
|
4009
|
+
vtxoId: string;
|
|
4010
|
+
amountSats: /*u64*/ bigint;
|
|
4011
|
+
height: /*u32*/ number;
|
|
4012
|
+
}>;
|
|
4013
|
+
constructor(inner: {
|
|
4014
|
+
vtxoId: string;
|
|
4015
|
+
amountSats: /*u64*/ bigint;
|
|
4016
|
+
/**
|
|
4017
|
+
* Block height associated with the exit's validity window.
|
|
4018
|
+
*/ height: /*u32*/ number;
|
|
4019
|
+
}) {
|
|
4020
|
+
super("OnchainUtxo", "Exit");
|
|
4021
|
+
this.inner = Object.freeze(inner);
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
static new(inner: {
|
|
4025
|
+
vtxoId: string;
|
|
4026
|
+
amountSats: /*u64*/ bigint;
|
|
4027
|
+
/**
|
|
4028
|
+
* Block height associated with the exit's validity window.
|
|
4029
|
+
*/ height: /*u32*/ number;
|
|
4030
|
+
}): Exit_ {
|
|
4031
|
+
return new Exit_(inner);
|
|
4032
|
+
}
|
|
4033
|
+
|
|
4034
|
+
static instanceOf(obj: any): obj is Exit_ {
|
|
4035
|
+
return obj.tag === OnchainUtxo_Tags.Exit;
|
|
4036
|
+
}
|
|
4037
|
+
}
|
|
4038
|
+
|
|
4039
|
+
function instanceOf(obj: any): obj is OnchainUtxo {
|
|
4040
|
+
return obj[uniffiTypeNameSymbol] === "OnchainUtxo";
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
return Object.freeze({
|
|
4044
|
+
instanceOf,
|
|
4045
|
+
Local: Local_,
|
|
4046
|
+
Exit: Exit_,
|
|
4047
|
+
});
|
|
4048
|
+
})();
|
|
4049
|
+
|
|
4050
|
+
/**
|
|
4051
|
+
* An onchain UTXO known to the wallet, mirroring `bark::onchain::Utxo`.
|
|
4052
|
+
*/
|
|
4053
|
+
|
|
4054
|
+
export type OnchainUtxo = InstanceType<
|
|
4055
|
+
(typeof OnchainUtxo)[keyof Omit<typeof OnchainUtxo, "instanceOf">]
|
|
4056
|
+
>;
|
|
4057
|
+
|
|
4058
|
+
// FfiConverter for enum OnchainUtxo
|
|
4059
|
+
const FfiConverterTypeOnchainUtxo = (() => {
|
|
4060
|
+
const ordinalConverter = FfiConverterInt32;
|
|
4061
|
+
type TypeName = OnchainUtxo;
|
|
4062
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
4063
|
+
read(from: RustBuffer): TypeName {
|
|
4064
|
+
switch (ordinalConverter.read(from)) {
|
|
4065
|
+
case 1:
|
|
4066
|
+
return new OnchainUtxo.Local({
|
|
4067
|
+
outpoint: FfiConverterTypeOutPoint.read(from),
|
|
4068
|
+
amountSats: FfiConverterUInt64.read(from),
|
|
4069
|
+
confirmationHeight: FfiConverterOptionalUInt32.read(from),
|
|
4070
|
+
});
|
|
4071
|
+
case 2:
|
|
4072
|
+
return new OnchainUtxo.Exit({
|
|
4073
|
+
vtxoId: FfiConverterString.read(from),
|
|
4074
|
+
amountSats: FfiConverterUInt64.read(from),
|
|
4075
|
+
height: FfiConverterUInt32.read(from),
|
|
4076
|
+
});
|
|
4077
|
+
default:
|
|
4078
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4079
|
+
}
|
|
4080
|
+
}
|
|
4081
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
4082
|
+
switch (value.tag) {
|
|
4083
|
+
case OnchainUtxo_Tags.Local: {
|
|
4084
|
+
ordinalConverter.write(1, into);
|
|
4085
|
+
const inner = value.inner;
|
|
4086
|
+
FfiConverterTypeOutPoint.write(inner.outpoint, into);
|
|
4087
|
+
FfiConverterUInt64.write(inner.amountSats, into);
|
|
4088
|
+
FfiConverterOptionalUInt32.write(inner.confirmationHeight, into);
|
|
4089
|
+
return;
|
|
4090
|
+
}
|
|
4091
|
+
case OnchainUtxo_Tags.Exit: {
|
|
4092
|
+
ordinalConverter.write(2, into);
|
|
4093
|
+
const inner = value.inner;
|
|
4094
|
+
FfiConverterString.write(inner.vtxoId, into);
|
|
4095
|
+
FfiConverterUInt64.write(inner.amountSats, into);
|
|
4096
|
+
FfiConverterUInt32.write(inner.height, into);
|
|
4097
|
+
return;
|
|
4098
|
+
}
|
|
4099
|
+
default:
|
|
4100
|
+
// Throwing from here means that OnchainUtxo_Tags hasn't matched an ordinal.
|
|
4101
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4102
|
+
}
|
|
4103
|
+
}
|
|
4104
|
+
allocationSize(value: TypeName): number {
|
|
4105
|
+
switch (value.tag) {
|
|
4106
|
+
case OnchainUtxo_Tags.Local: {
|
|
4107
|
+
const inner = value.inner;
|
|
4108
|
+
let size = ordinalConverter.allocationSize(1);
|
|
4109
|
+
size += FfiConverterTypeOutPoint.allocationSize(inner.outpoint);
|
|
4110
|
+
size += FfiConverterUInt64.allocationSize(inner.amountSats);
|
|
4111
|
+
size += FfiConverterOptionalUInt32.allocationSize(
|
|
4112
|
+
inner.confirmationHeight
|
|
4113
|
+
);
|
|
4114
|
+
return size;
|
|
4115
|
+
}
|
|
4116
|
+
case OnchainUtxo_Tags.Exit: {
|
|
4117
|
+
const inner = value.inner;
|
|
4118
|
+
let size = ordinalConverter.allocationSize(2);
|
|
4119
|
+
size += FfiConverterString.allocationSize(inner.vtxoId);
|
|
4120
|
+
size += FfiConverterUInt64.allocationSize(inner.amountSats);
|
|
4121
|
+
size += FfiConverterUInt32.allocationSize(inner.height);
|
|
4122
|
+
return size;
|
|
4123
|
+
}
|
|
4124
|
+
default:
|
|
4125
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
}
|
|
4129
|
+
return new FFIConverter();
|
|
4130
|
+
})();
|
|
4131
|
+
|
|
4132
|
+
// Enum: VtxoLockHolder
|
|
4133
|
+
export enum VtxoLockHolder_Tags {
|
|
4134
|
+
Action = "Action",
|
|
4135
|
+
Movement = "Movement",
|
|
4136
|
+
}
|
|
4137
|
+
/**
|
|
4138
|
+
* Who holds the lock on a [`VtxoState::Locked`] VTXO.
|
|
4139
|
+
*
|
|
4140
|
+
* Mirrors `bark::vtxo::VtxoLockHolder`. Action-based subsystems lock with
|
|
4141
|
+
* `Action`; pre-action subsystems (round, offboard, board, lightning
|
|
4142
|
+
* receive) lock with `Movement`. As upstream converts subsystems to
|
|
4143
|
+
* actions, new locks migrate from `Movement` to `Action` per-subsystem.
|
|
4144
|
+
*
|
|
4145
|
+
* Serde/TS tags match upstream's serialization: `"action"` / `"movement"`.
|
|
4146
|
+
*/
|
|
4147
|
+
export const VtxoLockHolder = (() => {
|
|
4148
|
+
type Action__interface = {
|
|
4149
|
+
tag: VtxoLockHolder_Tags.Action;
|
|
4150
|
+
inner: Readonly<{ id: string }>;
|
|
4151
|
+
};
|
|
4152
|
+
|
|
4153
|
+
/**
|
|
4154
|
+
* A wallet action checkpoint. `id` is upstream's `WalletActionId`
|
|
4155
|
+
* (an opaque string).
|
|
4156
|
+
*/
|
|
4157
|
+
class Action_ extends UniffiEnum implements Action__interface {
|
|
4158
|
+
/**
|
|
4159
|
+
* @private
|
|
4160
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4161
|
+
*/
|
|
4162
|
+
readonly [uniffiTypeNameSymbol] = "VtxoLockHolder";
|
|
4163
|
+
readonly tag = VtxoLockHolder_Tags.Action;
|
|
4164
|
+
readonly inner: Readonly<{ id: string }>;
|
|
4165
|
+
constructor(inner: { id: string }) {
|
|
4166
|
+
super("VtxoLockHolder", "Action");
|
|
4167
|
+
this.inner = Object.freeze(inner);
|
|
4168
|
+
}
|
|
4169
|
+
|
|
4170
|
+
static new(inner: { id: string }): Action_ {
|
|
4171
|
+
return new Action_(inner);
|
|
4172
|
+
}
|
|
4173
|
+
|
|
4174
|
+
static instanceOf(obj: any): obj is Action_ {
|
|
4175
|
+
return obj.tag === VtxoLockHolder_Tags.Action;
|
|
4176
|
+
}
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
type Movement__interface = {
|
|
4180
|
+
tag: VtxoLockHolder_Tags.Movement;
|
|
4181
|
+
inner: Readonly<{ id: /*u32*/ number }>;
|
|
4182
|
+
};
|
|
4183
|
+
|
|
4184
|
+
/**
|
|
4185
|
+
* A pre-action subsystem, keyed by its movement.
|
|
4186
|
+
*/
|
|
4187
|
+
class Movement_ extends UniffiEnum implements Movement__interface {
|
|
4188
|
+
/**
|
|
4189
|
+
* @private
|
|
4190
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4191
|
+
*/
|
|
4192
|
+
readonly [uniffiTypeNameSymbol] = "VtxoLockHolder";
|
|
4193
|
+
readonly tag = VtxoLockHolder_Tags.Movement;
|
|
4194
|
+
readonly inner: Readonly<{ id: /*u32*/ number }>;
|
|
4195
|
+
constructor(inner: { id: /*u32*/ number }) {
|
|
4196
|
+
super("VtxoLockHolder", "Movement");
|
|
4197
|
+
this.inner = Object.freeze(inner);
|
|
4198
|
+
}
|
|
4199
|
+
|
|
4200
|
+
static new(inner: { id: /*u32*/ number }): Movement_ {
|
|
4201
|
+
return new Movement_(inner);
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
static instanceOf(obj: any): obj is Movement_ {
|
|
4205
|
+
return obj.tag === VtxoLockHolder_Tags.Movement;
|
|
4206
|
+
}
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4209
|
+
function instanceOf(obj: any): obj is VtxoLockHolder {
|
|
4210
|
+
return obj[uniffiTypeNameSymbol] === "VtxoLockHolder";
|
|
4211
|
+
}
|
|
4212
|
+
|
|
4213
|
+
return Object.freeze({
|
|
4214
|
+
instanceOf,
|
|
4215
|
+
Action: Action_,
|
|
4216
|
+
Movement: Movement_,
|
|
4217
|
+
});
|
|
4218
|
+
})();
|
|
4219
|
+
|
|
4220
|
+
/**
|
|
4221
|
+
* Who holds the lock on a [`VtxoState::Locked`] VTXO.
|
|
4222
|
+
*
|
|
4223
|
+
* Mirrors `bark::vtxo::VtxoLockHolder`. Action-based subsystems lock with
|
|
4224
|
+
* `Action`; pre-action subsystems (round, offboard, board, lightning
|
|
4225
|
+
* receive) lock with `Movement`. As upstream converts subsystems to
|
|
4226
|
+
* actions, new locks migrate from `Movement` to `Action` per-subsystem.
|
|
4227
|
+
*
|
|
4228
|
+
* Serde/TS tags match upstream's serialization: `"action"` / `"movement"`.
|
|
4229
|
+
*/
|
|
4230
|
+
|
|
4231
|
+
export type VtxoLockHolder = InstanceType<
|
|
4232
|
+
(typeof VtxoLockHolder)[keyof Omit<typeof VtxoLockHolder, "instanceOf">]
|
|
4233
|
+
>;
|
|
4234
|
+
|
|
4235
|
+
// FfiConverter for enum VtxoLockHolder
|
|
4236
|
+
const FfiConverterTypeVtxoLockHolder = (() => {
|
|
4237
|
+
const ordinalConverter = FfiConverterInt32;
|
|
4238
|
+
type TypeName = VtxoLockHolder;
|
|
4239
|
+
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
4240
|
+
read(from: RustBuffer): TypeName {
|
|
4241
|
+
switch (ordinalConverter.read(from)) {
|
|
4242
|
+
case 1:
|
|
4243
|
+
return new VtxoLockHolder.Action({
|
|
4244
|
+
id: FfiConverterString.read(from),
|
|
4245
|
+
});
|
|
4246
|
+
case 2:
|
|
4247
|
+
return new VtxoLockHolder.Movement({
|
|
4248
|
+
id: FfiConverterUInt32.read(from),
|
|
4249
|
+
});
|
|
4250
|
+
default:
|
|
4251
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
write(value: TypeName, into: RustBuffer): void {
|
|
4255
|
+
switch (value.tag) {
|
|
4256
|
+
case VtxoLockHolder_Tags.Action: {
|
|
4257
|
+
ordinalConverter.write(1, into);
|
|
4258
|
+
const inner = value.inner;
|
|
4259
|
+
FfiConverterString.write(inner.id, into);
|
|
4260
|
+
return;
|
|
4261
|
+
}
|
|
4262
|
+
case VtxoLockHolder_Tags.Movement: {
|
|
4263
|
+
ordinalConverter.write(2, into);
|
|
4264
|
+
const inner = value.inner;
|
|
4265
|
+
FfiConverterUInt32.write(inner.id, into);
|
|
4266
|
+
return;
|
|
4267
|
+
}
|
|
4268
|
+
default:
|
|
4269
|
+
// Throwing from here means that VtxoLockHolder_Tags hasn't matched an ordinal.
|
|
4270
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4273
|
+
allocationSize(value: TypeName): number {
|
|
4274
|
+
switch (value.tag) {
|
|
4275
|
+
case VtxoLockHolder_Tags.Action: {
|
|
4276
|
+
const inner = value.inner;
|
|
4277
|
+
let size = ordinalConverter.allocationSize(1);
|
|
4278
|
+
size += FfiConverterString.allocationSize(inner.id);
|
|
4279
|
+
return size;
|
|
4280
|
+
}
|
|
4281
|
+
case VtxoLockHolder_Tags.Movement: {
|
|
4282
|
+
const inner = value.inner;
|
|
4283
|
+
let size = ordinalConverter.allocationSize(2);
|
|
4284
|
+
size += FfiConverterUInt32.allocationSize(inner.id);
|
|
4285
|
+
return size;
|
|
4286
|
+
}
|
|
4287
|
+
default:
|
|
4288
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4291
|
+
}
|
|
4292
|
+
return new FFIConverter();
|
|
4293
|
+
})();
|
|
4294
|
+
|
|
4295
|
+
// Enum: VtxoState
|
|
4296
|
+
export enum VtxoState_Tags {
|
|
4297
|
+
Spendable = "Spendable",
|
|
4298
|
+
Locked = "Locked",
|
|
4299
|
+
Spent = "Spent",
|
|
4300
|
+
Exited = "Exited",
|
|
4301
|
+
}
|
|
4302
|
+
/**
|
|
4303
|
+
* Rich VTXO state, mirroring `bark::vtxo::VtxoState`.
|
|
4304
|
+
*
|
|
4305
|
+
* Serde/TS tags match upstream's kebab-case serialization:
|
|
4306
|
+
* `"spendable"` | `"locked"` | `"spent"` | `"exited"`.
|
|
4307
|
+
*/
|
|
4308
|
+
export const VtxoState = (() => {
|
|
4309
|
+
type Spendable__interface = {
|
|
4310
|
+
tag: VtxoState_Tags.Spendable;
|
|
4311
|
+
};
|
|
4312
|
+
|
|
4313
|
+
/**
|
|
4314
|
+
* Available; can be spent in a future round.
|
|
4315
|
+
*/
|
|
4316
|
+
class Spendable_ extends UniffiEnum implements Spendable__interface {
|
|
4317
|
+
/**
|
|
4318
|
+
* @private
|
|
4319
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4320
|
+
*/
|
|
4321
|
+
readonly [uniffiTypeNameSymbol] = "VtxoState";
|
|
4322
|
+
readonly tag = VtxoState_Tags.Spendable;
|
|
4323
|
+
constructor() {
|
|
4324
|
+
super("VtxoState", "Spendable");
|
|
4325
|
+
}
|
|
4326
|
+
|
|
4327
|
+
static new(): Spendable_ {
|
|
4328
|
+
return new Spendable_();
|
|
4329
|
+
}
|
|
4330
|
+
|
|
4331
|
+
static instanceOf(obj: any): obj is Spendable_ {
|
|
4332
|
+
return obj.tag === VtxoState_Tags.Spendable;
|
|
4333
|
+
}
|
|
4334
|
+
}
|
|
4335
|
+
|
|
4336
|
+
type Locked__interface = {
|
|
4337
|
+
tag: VtxoState_Tags.Locked;
|
|
4338
|
+
inner: Readonly<{ holder: VtxoLockHolder | undefined }>;
|
|
4339
|
+
};
|
|
4340
|
+
|
|
4341
|
+
/**
|
|
4342
|
+
* Locked by an operation. `holder` is `None` only for the narrow
|
|
4343
|
+
* window between creating a fresh locked VTXO and pinning it to a
|
|
4344
|
+
* specific operation, so a locked VTXO can legitimately carry no
|
|
4345
|
+
* lock reason yet.
|
|
4346
|
+
*/
|
|
4347
|
+
class Locked_ extends UniffiEnum implements Locked__interface {
|
|
4348
|
+
/**
|
|
4349
|
+
* @private
|
|
4350
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4351
|
+
*/
|
|
4352
|
+
readonly [uniffiTypeNameSymbol] = "VtxoState";
|
|
4353
|
+
readonly tag = VtxoState_Tags.Locked;
|
|
4354
|
+
readonly inner: Readonly<{ holder: VtxoLockHolder | undefined }>;
|
|
4355
|
+
constructor(inner: { holder: VtxoLockHolder | undefined }) {
|
|
4356
|
+
super("VtxoState", "Locked");
|
|
4357
|
+
this.inner = Object.freeze(inner);
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
static new(inner: { holder: VtxoLockHolder | undefined }): Locked_ {
|
|
4361
|
+
return new Locked_(inner);
|
|
4362
|
+
}
|
|
4363
|
+
|
|
4364
|
+
static instanceOf(obj: any): obj is Locked_ {
|
|
4365
|
+
return obj.tag === VtxoState_Tags.Locked;
|
|
4366
|
+
}
|
|
4367
|
+
}
|
|
4368
|
+
|
|
4369
|
+
type Spent__interface = {
|
|
4370
|
+
tag: VtxoState_Tags.Spent;
|
|
4371
|
+
};
|
|
4372
|
+
|
|
4373
|
+
/**
|
|
4374
|
+
* Consumed.
|
|
4375
|
+
*/
|
|
4376
|
+
class Spent_ extends UniffiEnum implements Spent__interface {
|
|
4377
|
+
/**
|
|
4378
|
+
* @private
|
|
4379
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4380
|
+
*/
|
|
4381
|
+
readonly [uniffiTypeNameSymbol] = "VtxoState";
|
|
4382
|
+
readonly tag = VtxoState_Tags.Spent;
|
|
4383
|
+
constructor() {
|
|
4384
|
+
super("VtxoState", "Spent");
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4387
|
+
static new(): Spent_ {
|
|
4388
|
+
return new Spent_();
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4391
|
+
static instanceOf(obj: any): obj is Spent_ {
|
|
4392
|
+
return obj.tag === VtxoState_Tags.Spent;
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
|
|
4396
|
+
type Exited__interface = {
|
|
4397
|
+
tag: VtxoState_Tags.Exited;
|
|
4398
|
+
};
|
|
4399
|
+
|
|
4400
|
+
/**
|
|
4401
|
+
* In (or completed) a unilateral exit.
|
|
4402
|
+
*/
|
|
4403
|
+
class Exited_ extends UniffiEnum implements Exited__interface {
|
|
4404
|
+
/**
|
|
4405
|
+
* @private
|
|
4406
|
+
* This field is private and should not be used, use `tag` instead.
|
|
4407
|
+
*/
|
|
4408
|
+
readonly [uniffiTypeNameSymbol] = "VtxoState";
|
|
4409
|
+
readonly tag = VtxoState_Tags.Exited;
|
|
4410
|
+
constructor() {
|
|
4411
|
+
super("VtxoState", "Exited");
|
|
4412
|
+
}
|
|
4413
|
+
|
|
4414
|
+
static new(): Exited_ {
|
|
4415
|
+
return new Exited_();
|
|
2256
4416
|
}
|
|
2257
|
-
|
|
2258
|
-
|
|
4417
|
+
|
|
4418
|
+
static instanceOf(obj: any): obj is Exited_ {
|
|
4419
|
+
return obj.tag === VtxoState_Tags.Exited;
|
|
2259
4420
|
}
|
|
2260
4421
|
}
|
|
2261
|
-
|
|
4422
|
+
|
|
4423
|
+
function instanceOf(obj: any): obj is VtxoState {
|
|
4424
|
+
return obj[uniffiTypeNameSymbol] === "VtxoState";
|
|
4425
|
+
}
|
|
4426
|
+
|
|
4427
|
+
return Object.freeze({
|
|
4428
|
+
instanceOf,
|
|
4429
|
+
Spendable: Spendable_,
|
|
4430
|
+
Locked: Locked_,
|
|
4431
|
+
Spent: Spent_,
|
|
4432
|
+
Exited: Exited_,
|
|
4433
|
+
});
|
|
2262
4434
|
})();
|
|
2263
4435
|
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
4436
|
+
/**
|
|
4437
|
+
* Rich VTXO state, mirroring `bark::vtxo::VtxoState`.
|
|
4438
|
+
*
|
|
4439
|
+
* Serde/TS tags match upstream's kebab-case serialization:
|
|
4440
|
+
* `"spendable"` | `"locked"` | `"spent"` | `"exited"`.
|
|
4441
|
+
*/
|
|
2270
4442
|
|
|
2271
|
-
|
|
4443
|
+
export type VtxoState = InstanceType<
|
|
4444
|
+
(typeof VtxoState)[keyof Omit<typeof VtxoState, "instanceOf">]
|
|
4445
|
+
>;
|
|
4446
|
+
|
|
4447
|
+
// FfiConverter for enum VtxoState
|
|
4448
|
+
const FfiConverterTypeVtxoState = (() => {
|
|
2272
4449
|
const ordinalConverter = FfiConverterInt32;
|
|
2273
|
-
type TypeName =
|
|
4450
|
+
type TypeName = VtxoState;
|
|
2274
4451
|
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
|
|
2275
4452
|
read(from: RustBuffer): TypeName {
|
|
2276
4453
|
switch (ordinalConverter.read(from)) {
|
|
2277
4454
|
case 1:
|
|
2278
|
-
return
|
|
4455
|
+
return new VtxoState.Spendable();
|
|
2279
4456
|
case 2:
|
|
2280
|
-
return
|
|
4457
|
+
return new VtxoState.Locked({
|
|
4458
|
+
holder: FfiConverterOptionalTypeVtxoLockHolder.read(from),
|
|
4459
|
+
});
|
|
2281
4460
|
case 3:
|
|
2282
|
-
return
|
|
4461
|
+
return new VtxoState.Spent();
|
|
2283
4462
|
case 4:
|
|
2284
|
-
return
|
|
4463
|
+
return new VtxoState.Exited();
|
|
2285
4464
|
default:
|
|
2286
4465
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2287
4466
|
}
|
|
2288
4467
|
}
|
|
2289
4468
|
write(value: TypeName, into: RustBuffer): void {
|
|
2290
|
-
switch (value) {
|
|
2291
|
-
case
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
case
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
4469
|
+
switch (value.tag) {
|
|
4470
|
+
case VtxoState_Tags.Spendable: {
|
|
4471
|
+
ordinalConverter.write(1, into);
|
|
4472
|
+
return;
|
|
4473
|
+
}
|
|
4474
|
+
case VtxoState_Tags.Locked: {
|
|
4475
|
+
ordinalConverter.write(2, into);
|
|
4476
|
+
const inner = value.inner;
|
|
4477
|
+
FfiConverterOptionalTypeVtxoLockHolder.write(inner.holder, into);
|
|
4478
|
+
return;
|
|
4479
|
+
}
|
|
4480
|
+
case VtxoState_Tags.Spent: {
|
|
4481
|
+
ordinalConverter.write(3, into);
|
|
4482
|
+
return;
|
|
4483
|
+
}
|
|
4484
|
+
case VtxoState_Tags.Exited: {
|
|
4485
|
+
ordinalConverter.write(4, into);
|
|
4486
|
+
return;
|
|
4487
|
+
}
|
|
4488
|
+
default:
|
|
4489
|
+
// Throwing from here means that VtxoState_Tags hasn't matched an ordinal.
|
|
4490
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
2299
4491
|
}
|
|
2300
4492
|
}
|
|
2301
4493
|
allocationSize(value: TypeName): number {
|
|
2302
|
-
|
|
4494
|
+
switch (value.tag) {
|
|
4495
|
+
case VtxoState_Tags.Spendable: {
|
|
4496
|
+
return ordinalConverter.allocationSize(1);
|
|
4497
|
+
}
|
|
4498
|
+
case VtxoState_Tags.Locked: {
|
|
4499
|
+
const inner = value.inner;
|
|
4500
|
+
let size = ordinalConverter.allocationSize(2);
|
|
4501
|
+
size += FfiConverterOptionalTypeVtxoLockHolder.allocationSize(
|
|
4502
|
+
inner.holder
|
|
4503
|
+
);
|
|
4504
|
+
return size;
|
|
4505
|
+
}
|
|
4506
|
+
case VtxoState_Tags.Spent: {
|
|
4507
|
+
return ordinalConverter.allocationSize(3);
|
|
4508
|
+
}
|
|
4509
|
+
case VtxoState_Tags.Exited: {
|
|
4510
|
+
return ordinalConverter.allocationSize(4);
|
|
4511
|
+
}
|
|
4512
|
+
default:
|
|
4513
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
4514
|
+
}
|
|
2303
4515
|
}
|
|
2304
4516
|
}
|
|
2305
4517
|
return new FFIConverter();
|
|
@@ -3606,6 +5818,10 @@ export interface OnchainWalletLike {
|
|
|
3606
5818
|
balance(asyncOpts_?: {
|
|
3607
5819
|
signal: AbortSignal;
|
|
3608
5820
|
}): /*throws*/ Promise<OnchainBalance>;
|
|
5821
|
+
/**
|
|
5822
|
+
* Cached network fee-rate estimates from the wallet's chain source.
|
|
5823
|
+
*/
|
|
5824
|
+
feeRates(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<FeeRates>;
|
|
3609
5825
|
newAddress(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<string>;
|
|
3610
5826
|
send(
|
|
3611
5827
|
address: string,
|
|
@@ -3616,6 +5832,25 @@ export interface OnchainWalletLike {
|
|
|
3616
5832
|
sync(asyncOpts_?: {
|
|
3617
5833
|
signal: AbortSignal;
|
|
3618
5834
|
}): /*throws*/ Promise</*u64*/ bigint>;
|
|
5835
|
+
/**
|
|
5836
|
+
* Current chain tip height from the wallet's chain source.
|
|
5837
|
+
*/
|
|
5838
|
+
tipHeight(asyncOpts_?: {
|
|
5839
|
+
signal: AbortSignal;
|
|
5840
|
+
}): /*throws*/ Promise</*u32*/ number>;
|
|
5841
|
+
/**
|
|
5842
|
+
* Every wallet transaction with fee, balance change, confirmation and
|
|
5843
|
+
* CPFP flag. Requires a prior `sync` to be meaningful.
|
|
5844
|
+
*/
|
|
5845
|
+
transactions(asyncOpts_?: {
|
|
5846
|
+
signal: AbortSignal;
|
|
5847
|
+
}): /*throws*/ Promise<Array<WalletTransaction>>;
|
|
5848
|
+
/**
|
|
5849
|
+
* The wallet's unspent outputs. Requires a prior `sync` to be meaningful.
|
|
5850
|
+
*/
|
|
5851
|
+
utxos(asyncOpts_?: {
|
|
5852
|
+
signal: AbortSignal;
|
|
5853
|
+
}): /*throws*/ Promise<Array<OnchainUtxo>>;
|
|
3619
5854
|
}
|
|
3620
5855
|
/**
|
|
3621
5856
|
* @deprecated Use `OnchainWalletLike` instead.
|
|
@@ -3739,6 +5974,44 @@ export class OnchainWallet
|
|
|
3739
5974
|
}
|
|
3740
5975
|
}
|
|
3741
5976
|
|
|
5977
|
+
/**
|
|
5978
|
+
* Cached network fee-rate estimates from the wallet's chain source.
|
|
5979
|
+
*/
|
|
5980
|
+
async feeRates(asyncOpts_?: {
|
|
5981
|
+
signal: AbortSignal;
|
|
5982
|
+
}): Promise<FeeRates> /*throws*/ {
|
|
5983
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
5984
|
+
try {
|
|
5985
|
+
return await uniffiRustCallAsync(
|
|
5986
|
+
/*rustCaller:*/ uniffiCaller,
|
|
5987
|
+
/*rustFutureFunc:*/ () => {
|
|
5988
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_fee_rates(
|
|
5989
|
+
uniffiTypeOnchainWalletObjectFactory.clonePointer(this)
|
|
5990
|
+
);
|
|
5991
|
+
},
|
|
5992
|
+
/*pollFunc:*/ nativeModule()
|
|
5993
|
+
.ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
5994
|
+
/*cancelFunc:*/ nativeModule()
|
|
5995
|
+
.ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
|
|
5996
|
+
/*completeFunc:*/ nativeModule()
|
|
5997
|
+
.ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
|
|
5998
|
+
/*freeFunc:*/ nativeModule()
|
|
5999
|
+
.ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
|
|
6000
|
+
/*liftFunc:*/ FfiConverterTypeFeeRates.lift.bind(
|
|
6001
|
+
FfiConverterTypeFeeRates
|
|
6002
|
+
),
|
|
6003
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
6004
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
6005
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
6006
|
+
);
|
|
6007
|
+
} catch (__error: any) {
|
|
6008
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6009
|
+
__error.stack = __stack;
|
|
6010
|
+
}
|
|
6011
|
+
throw __error;
|
|
6012
|
+
}
|
|
6013
|
+
}
|
|
6014
|
+
|
|
3742
6015
|
async newAddress(asyncOpts_?: {
|
|
3743
6016
|
signal: AbortSignal;
|
|
3744
6017
|
}): Promise<string> /*throws*/ {
|
|
@@ -3841,6 +6114,116 @@ export class OnchainWallet
|
|
|
3841
6114
|
}
|
|
3842
6115
|
}
|
|
3843
6116
|
|
|
6117
|
+
/**
|
|
6118
|
+
* Current chain tip height from the wallet's chain source.
|
|
6119
|
+
*/
|
|
6120
|
+
async tipHeight(asyncOpts_?: {
|
|
6121
|
+
signal: AbortSignal;
|
|
6122
|
+
}): Promise</*u32*/ number> /*throws*/ {
|
|
6123
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6124
|
+
try {
|
|
6125
|
+
return await uniffiRustCallAsync(
|
|
6126
|
+
/*rustCaller:*/ uniffiCaller,
|
|
6127
|
+
/*rustFutureFunc:*/ () => {
|
|
6128
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_tip_height(
|
|
6129
|
+
uniffiTypeOnchainWalletObjectFactory.clonePointer(this)
|
|
6130
|
+
);
|
|
6131
|
+
},
|
|
6132
|
+
/*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_u32,
|
|
6133
|
+
/*cancelFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_cancel_u32,
|
|
6134
|
+
/*completeFunc:*/ nativeModule()
|
|
6135
|
+
.ubrn_ffi_bark_ffi_rust_future_complete_u32,
|
|
6136
|
+
/*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_u32,
|
|
6137
|
+
/*liftFunc:*/ FfiConverterUInt32.lift.bind(FfiConverterUInt32),
|
|
6138
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
6139
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
6140
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
6141
|
+
);
|
|
6142
|
+
} catch (__error: any) {
|
|
6143
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6144
|
+
__error.stack = __stack;
|
|
6145
|
+
}
|
|
6146
|
+
throw __error;
|
|
6147
|
+
}
|
|
6148
|
+
}
|
|
6149
|
+
|
|
6150
|
+
/**
|
|
6151
|
+
* Every wallet transaction with fee, balance change, confirmation and
|
|
6152
|
+
* CPFP flag. Requires a prior `sync` to be meaningful.
|
|
6153
|
+
*/
|
|
6154
|
+
async transactions(asyncOpts_?: {
|
|
6155
|
+
signal: AbortSignal;
|
|
6156
|
+
}): Promise<Array<WalletTransaction>> /*throws*/ {
|
|
6157
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6158
|
+
try {
|
|
6159
|
+
return await uniffiRustCallAsync(
|
|
6160
|
+
/*rustCaller:*/ uniffiCaller,
|
|
6161
|
+
/*rustFutureFunc:*/ () => {
|
|
6162
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_transactions(
|
|
6163
|
+
uniffiTypeOnchainWalletObjectFactory.clonePointer(this)
|
|
6164
|
+
);
|
|
6165
|
+
},
|
|
6166
|
+
/*pollFunc:*/ nativeModule()
|
|
6167
|
+
.ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
6168
|
+
/*cancelFunc:*/ nativeModule()
|
|
6169
|
+
.ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
|
|
6170
|
+
/*completeFunc:*/ nativeModule()
|
|
6171
|
+
.ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
|
|
6172
|
+
/*freeFunc:*/ nativeModule()
|
|
6173
|
+
.ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
|
|
6174
|
+
/*liftFunc:*/ FfiConverterArrayTypeWalletTransaction.lift.bind(
|
|
6175
|
+
FfiConverterArrayTypeWalletTransaction
|
|
6176
|
+
),
|
|
6177
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
6178
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
6179
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
6180
|
+
);
|
|
6181
|
+
} catch (__error: any) {
|
|
6182
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6183
|
+
__error.stack = __stack;
|
|
6184
|
+
}
|
|
6185
|
+
throw __error;
|
|
6186
|
+
}
|
|
6187
|
+
}
|
|
6188
|
+
|
|
6189
|
+
/**
|
|
6190
|
+
* The wallet's unspent outputs. Requires a prior `sync` to be meaningful.
|
|
6191
|
+
*/
|
|
6192
|
+
async utxos(asyncOpts_?: {
|
|
6193
|
+
signal: AbortSignal;
|
|
6194
|
+
}): Promise<Array<OnchainUtxo>> /*throws*/ {
|
|
6195
|
+
const __stack = uniffiIsDebug ? new Error().stack : undefined;
|
|
6196
|
+
try {
|
|
6197
|
+
return await uniffiRustCallAsync(
|
|
6198
|
+
/*rustCaller:*/ uniffiCaller,
|
|
6199
|
+
/*rustFutureFunc:*/ () => {
|
|
6200
|
+
return nativeModule().ubrn_uniffi_bark_ffi_fn_method_onchainwallet_utxos(
|
|
6201
|
+
uniffiTypeOnchainWalletObjectFactory.clonePointer(this)
|
|
6202
|
+
);
|
|
6203
|
+
},
|
|
6204
|
+
/*pollFunc:*/ nativeModule()
|
|
6205
|
+
.ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
|
|
6206
|
+
/*cancelFunc:*/ nativeModule()
|
|
6207
|
+
.ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
|
|
6208
|
+
/*completeFunc:*/ nativeModule()
|
|
6209
|
+
.ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
|
|
6210
|
+
/*freeFunc:*/ nativeModule()
|
|
6211
|
+
.ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
|
|
6212
|
+
/*liftFunc:*/ FfiConverterArrayTypeOnchainUtxo.lift.bind(
|
|
6213
|
+
FfiConverterArrayTypeOnchainUtxo
|
|
6214
|
+
),
|
|
6215
|
+
/*liftString:*/ FfiConverterString.lift,
|
|
6216
|
+
/*asyncOpts:*/ asyncOpts_,
|
|
6217
|
+
/*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
|
|
6218
|
+
);
|
|
6219
|
+
} catch (__error: any) {
|
|
6220
|
+
if (uniffiIsDebug && __error instanceof Error) {
|
|
6221
|
+
__error.stack = __stack;
|
|
6222
|
+
}
|
|
6223
|
+
throw __error;
|
|
6224
|
+
}
|
|
6225
|
+
}
|
|
6226
|
+
|
|
3844
6227
|
/**
|
|
3845
6228
|
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
3846
6229
|
*/
|
|
@@ -4152,7 +6535,7 @@ export interface WalletLike {
|
|
|
4152
6535
|
asyncOpts_?: { signal: AbortSignal }
|
|
4153
6536
|
): /*throws*/ Promise<string>;
|
|
4154
6537
|
/**
|
|
4155
|
-
* Pay to a Lightning Address (
|
|
6538
|
+
* Pay to a Lightning Address (`user@domain`), resolved via LNURL-pay.
|
|
4156
6539
|
*/
|
|
4157
6540
|
payLightningAddress(
|
|
4158
6541
|
lightningAddress: string,
|
|
@@ -4174,7 +6557,7 @@ export interface WalletLike {
|
|
|
4174
6557
|
asyncOpts_?: { signal: AbortSignal }
|
|
4175
6558
|
): /*throws*/ Promise<LightningSendStatus>;
|
|
4176
6559
|
/**
|
|
4177
|
-
* Pay a raw LNURL-pay link (`lnurl1…`).
|
|
6560
|
+
* Pay a raw LNURL-pay link (`lnurl1…`).
|
|
4178
6561
|
*
|
|
4179
6562
|
* Resolves the LNURL-pay endpoint to a BOLT11 invoice and pays it. Errors
|
|
4180
6563
|
* if the link decodes to a non-pay LNURL (auth, withdraw, channel).
|
|
@@ -6264,7 +8647,7 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
6264
8647
|
}
|
|
6265
8648
|
|
|
6266
8649
|
/**
|
|
6267
|
-
* Pay to a Lightning Address (
|
|
8650
|
+
* Pay to a Lightning Address (`user@domain`), resolved via LNURL-pay.
|
|
6268
8651
|
*/
|
|
6269
8652
|
async payLightningAddress(
|
|
6270
8653
|
lightningAddress: string,
|
|
@@ -6392,7 +8775,7 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
6392
8775
|
}
|
|
6393
8776
|
|
|
6394
8777
|
/**
|
|
6395
|
-
* Pay a raw LNURL-pay link (`lnurl1…`).
|
|
8778
|
+
* Pay a raw LNURL-pay link (`lnurl1…`).
|
|
6396
8779
|
*
|
|
6397
8780
|
* Resolves the LNURL-pay endpoint to a BOLT11 invoice and pays it. Errors
|
|
6398
8781
|
* if the link decodes to a non-pay LNURL (auth, withdraw, channel).
|
|
@@ -7785,6 +10168,11 @@ const FfiConverterOptionalTypeArkInfo = new FfiConverterOptional(
|
|
|
7785
10168
|
FfiConverterTypeArkInfo
|
|
7786
10169
|
);
|
|
7787
10170
|
|
|
10171
|
+
// FfiConverter for BlockRef | undefined
|
|
10172
|
+
const FfiConverterOptionalTypeBlockRef = new FfiConverterOptional(
|
|
10173
|
+
FfiConverterTypeBlockRef
|
|
10174
|
+
);
|
|
10175
|
+
|
|
7788
10176
|
// FfiConverter for ExitTransactionStatus | undefined
|
|
7789
10177
|
const FfiConverterOptionalTypeExitTransactionStatus = new FfiConverterOptional(
|
|
7790
10178
|
FfiConverterTypeExitTransactionStatus
|
|
@@ -7825,6 +10213,11 @@ const FfiConverterArrayTypeExitProgressStatus = new FfiConverterArray(
|
|
|
7825
10213
|
FfiConverterTypeExitProgressStatus
|
|
7826
10214
|
);
|
|
7827
10215
|
|
|
10216
|
+
// FfiConverter for Array<ExitTx>
|
|
10217
|
+
const FfiConverterArrayTypeExitTx = new FfiConverterArray(
|
|
10218
|
+
FfiConverterTypeExitTx
|
|
10219
|
+
);
|
|
10220
|
+
|
|
7828
10221
|
// FfiConverter for Array<ExitVtxo>
|
|
7829
10222
|
const FfiConverterArrayTypeExitVtxo = new FfiConverterArray(
|
|
7830
10223
|
FfiConverterTypeExitVtxo
|
|
@@ -7850,6 +10243,11 @@ const FfiConverterArrayTypePendingBoard = new FfiConverterArray(
|
|
|
7850
10243
|
FfiConverterTypePendingBoard
|
|
7851
10244
|
);
|
|
7852
10245
|
|
|
10246
|
+
// FfiConverter for Array<PpmExpiryFeeEntry>
|
|
10247
|
+
const FfiConverterArrayTypePpmExpiryFeeEntry = new FfiConverterArray(
|
|
10248
|
+
FfiConverterTypePpmExpiryFeeEntry
|
|
10249
|
+
);
|
|
10250
|
+
|
|
7853
10251
|
// FfiConverter for Array<RoundState>
|
|
7854
10252
|
const FfiConverterArrayTypeRoundState = new FfiConverterArray(
|
|
7855
10253
|
FfiConverterTypeRoundState
|
|
@@ -7858,9 +10256,19 @@ const FfiConverterArrayTypeRoundState = new FfiConverterArray(
|
|
|
7858
10256
|
// FfiConverter for Array<Vtxo>
|
|
7859
10257
|
const FfiConverterArrayTypeVtxo = new FfiConverterArray(FfiConverterTypeVtxo);
|
|
7860
10258
|
|
|
10259
|
+
// FfiConverter for Array<WalletTransaction>
|
|
10260
|
+
const FfiConverterArrayTypeWalletTransaction = new FfiConverterArray(
|
|
10261
|
+
FfiConverterTypeWalletTransaction
|
|
10262
|
+
);
|
|
10263
|
+
|
|
7861
10264
|
// FfiConverter for Array<string>
|
|
7862
10265
|
const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
|
|
7863
10266
|
|
|
10267
|
+
// FfiConverter for VtxoLockHolder | undefined
|
|
10268
|
+
const FfiConverterOptionalTypeVtxoLockHolder = new FfiConverterOptional(
|
|
10269
|
+
FfiConverterTypeVtxoLockHolder
|
|
10270
|
+
);
|
|
10271
|
+
|
|
7864
10272
|
// FfiConverter for WalletNotification | undefined
|
|
7865
10273
|
const FfiConverterOptionalTypeWalletNotification = new FfiConverterOptional(
|
|
7866
10274
|
FfiConverterTypeWalletNotification
|
|
@@ -7871,9 +10279,19 @@ const FfiConverterOptionalTypeOnchainWallet = new FfiConverterOptional(
|
|
|
7871
10279
|
FfiConverterTypeOnchainWallet
|
|
7872
10280
|
);
|
|
7873
10281
|
|
|
7874
|
-
// FfiConverter for Array<
|
|
7875
|
-
const
|
|
7876
|
-
|
|
10282
|
+
// FfiConverter for Array<ExitState>
|
|
10283
|
+
const FfiConverterArrayTypeExitState = new FfiConverterArray(
|
|
10284
|
+
FfiConverterTypeExitState
|
|
10285
|
+
);
|
|
10286
|
+
|
|
10287
|
+
// FfiConverter for Array<OnchainUtxo>
|
|
10288
|
+
const FfiConverterArrayTypeOnchainUtxo = new FfiConverterArray(
|
|
10289
|
+
FfiConverterTypeOnchainUtxo
|
|
10290
|
+
);
|
|
10291
|
+
|
|
10292
|
+
// FfiConverter for Array<ExitState> | undefined
|
|
10293
|
+
const FfiConverterOptionalArrayTypeExitState = new FfiConverterOptional(
|
|
10294
|
+
FfiConverterArrayTypeExitState
|
|
7877
10295
|
);
|
|
7878
10296
|
|
|
7879
10297
|
/**
|
|
@@ -8048,6 +10466,14 @@ function uniffiEnsureInitialized() {
|
|
|
8048
10466
|
"uniffi_bark_ffi_checksum_method_onchainwallet_balance"
|
|
8049
10467
|
);
|
|
8050
10468
|
}
|
|
10469
|
+
if (
|
|
10470
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates() !==
|
|
10471
|
+
30741
|
|
10472
|
+
) {
|
|
10473
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
10474
|
+
"uniffi_bark_ffi_checksum_method_onchainwallet_fee_rates"
|
|
10475
|
+
);
|
|
10476
|
+
}
|
|
8051
10477
|
if (
|
|
8052
10478
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_new_address() !==
|
|
8053
10479
|
7405
|
|
@@ -8072,6 +10498,30 @@ function uniffiEnsureInitialized() {
|
|
|
8072
10498
|
"uniffi_bark_ffi_checksum_method_onchainwallet_sync"
|
|
8073
10499
|
);
|
|
8074
10500
|
}
|
|
10501
|
+
if (
|
|
10502
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_tip_height() !==
|
|
10503
|
+
12254
|
|
10504
|
+
) {
|
|
10505
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
10506
|
+
"uniffi_bark_ffi_checksum_method_onchainwallet_tip_height"
|
|
10507
|
+
);
|
|
10508
|
+
}
|
|
10509
|
+
if (
|
|
10510
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_transactions() !==
|
|
10511
|
+
566
|
|
10512
|
+
) {
|
|
10513
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
10514
|
+
"uniffi_bark_ffi_checksum_method_onchainwallet_transactions"
|
|
10515
|
+
);
|
|
10516
|
+
}
|
|
10517
|
+
if (
|
|
10518
|
+
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_utxos() !==
|
|
10519
|
+
44926
|
|
10520
|
+
) {
|
|
10521
|
+
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
10522
|
+
"uniffi_bark_ffi_checksum_method_onchainwallet_utxos"
|
|
10523
|
+
);
|
|
10524
|
+
}
|
|
8075
10525
|
if (
|
|
8076
10526
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_all_exits_claimable_at_height() !==
|
|
8077
10527
|
59034
|
|
@@ -8506,7 +10956,7 @@ function uniffiEnsureInitialized() {
|
|
|
8506
10956
|
}
|
|
8507
10957
|
if (
|
|
8508
10958
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lightning_address() !==
|
|
8509
|
-
|
|
10959
|
+
43061
|
|
8510
10960
|
) {
|
|
8511
10961
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
8512
10962
|
"uniffi_bark_ffi_checksum_method_wallet_pay_lightning_address"
|
|
@@ -8530,7 +10980,7 @@ function uniffiEnsureInitialized() {
|
|
|
8530
10980
|
}
|
|
8531
10981
|
if (
|
|
8532
10982
|
nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pay_lnurl() !==
|
|
8533
|
-
|
|
10983
|
+
1459
|
|
8534
10984
|
) {
|
|
8535
10985
|
throw new UniffiInternalError.ApiChecksumMismatch(
|
|
8536
10986
|
"uniffi_bark_ffi_checksum_method_wallet_pay_lnurl"
|
|
@@ -8859,6 +11309,7 @@ export default Object.freeze({
|
|
|
8859
11309
|
FfiConverterTypeBalance,
|
|
8860
11310
|
FfiConverterTypeBarkLogger,
|
|
8861
11311
|
FfiConverterTypeBlockRef,
|
|
11312
|
+
FfiConverterTypeBoardFees,
|
|
8862
11313
|
FfiConverterTypeConfig,
|
|
8863
11314
|
FfiConverterTypeCpfpParams,
|
|
8864
11315
|
FfiConverterTypeCustomOnchainWalletCallbacks,
|
|
@@ -8866,29 +11317,44 @@ export default Object.freeze({
|
|
|
8866
11317
|
FfiConverterTypeError,
|
|
8867
11318
|
FfiConverterTypeExitClaimTransaction,
|
|
8868
11319
|
FfiConverterTypeExitProgressStatus,
|
|
11320
|
+
FfiConverterTypeExitState,
|
|
8869
11321
|
FfiConverterTypeExitTransactionStatus,
|
|
11322
|
+
FfiConverterTypeExitTx,
|
|
11323
|
+
FfiConverterTypeExitTxOrigin,
|
|
11324
|
+
FfiConverterTypeExitTxStatus,
|
|
8870
11325
|
FfiConverterTypeExitVtxo,
|
|
8871
11326
|
FfiConverterTypeFeeEstimate,
|
|
11327
|
+
FfiConverterTypeFeeRates,
|
|
11328
|
+
FfiConverterTypeFeeSchedule,
|
|
8872
11329
|
FfiConverterTypeLightningInvoice,
|
|
8873
11330
|
FfiConverterTypeLightningReceive,
|
|
11331
|
+
FfiConverterTypeLightningReceiveFees,
|
|
8874
11332
|
FfiConverterTypeLightningSend,
|
|
11333
|
+
FfiConverterTypeLightningSendFees,
|
|
8875
11334
|
FfiConverterTypeLightningSendStatus,
|
|
8876
11335
|
FfiConverterTypeLogLevel,
|
|
8877
11336
|
FfiConverterTypeMovement,
|
|
8878
11337
|
FfiConverterTypeNetwork,
|
|
8879
11338
|
FfiConverterTypeNotificationHolder,
|
|
11339
|
+
FfiConverterTypeOffboardFees,
|
|
8880
11340
|
FfiConverterTypeOffboardResult,
|
|
8881
11341
|
FfiConverterTypeOnchainBalance,
|
|
11342
|
+
FfiConverterTypeOnchainUtxo,
|
|
8882
11343
|
FfiConverterTypeOnchainWallet,
|
|
8883
11344
|
FfiConverterTypeOutPoint,
|
|
8884
11345
|
FfiConverterTypePendingBoard,
|
|
11346
|
+
FfiConverterTypePpmExpiryFeeEntry,
|
|
8885
11347
|
FfiConverterTypeRecoveryBucket,
|
|
8886
11348
|
FfiConverterTypeRecoveryReport,
|
|
11349
|
+
FfiConverterTypeRefreshFees,
|
|
8887
11350
|
FfiConverterTypeRoundState,
|
|
8888
11351
|
FfiConverterTypeVtxo,
|
|
11352
|
+
FfiConverterTypeVtxoLockHolder,
|
|
11353
|
+
FfiConverterTypeVtxoState,
|
|
8889
11354
|
FfiConverterTypeWallet,
|
|
8890
11355
|
FfiConverterTypeWalletNotification,
|
|
8891
11356
|
FfiConverterTypeWalletOpenArgs,
|
|
8892
11357
|
FfiConverterTypeWalletProperties,
|
|
11358
|
+
FfiConverterTypeWalletTransaction,
|
|
8893
11359
|
},
|
|
8894
11360
|
});
|