Skip to content

Commit 8aed52b

Browse files
committed
chore: clean wrappers
1 parent a255940 commit 8aed52b

File tree

20 files changed

+1805
-1802
lines changed

20 files changed

+1805
-1802
lines changed

ios/Classes/frb_generated.h

Lines changed: 146 additions & 146 deletions
Large diffs are not rendered by default.

lib/ldk_node.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ export 'src/root.dart';
5959
export 'src/generated/lib.dart' show U8Array4, U8Array12, U8Array64, U8Array32;
6060
export 'src/utils/default_services.dart';
6161
export 'src/utils/exceptions.dart' show NodeException, BuilderException;
62+
export 'src/utils/extensions.dart';

lib/src/generated/api/bolt11.dart

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,101 +38,105 @@ class FfiBolt11Payment {
3838
required this.opaque,
3939
});
4040

41-
Future<void> claimForHash(
41+
Future<void> claimForHashUnsafe(
4242
{required PaymentHash paymentHash,
4343
required BigInt claimableAmountMsat,
4444
required PaymentPreimage preimage}) =>
45-
core.instance.api.crateApiBolt11FfiBolt11PaymentClaimForHash(
45+
core.instance.api.crateApiBolt11FfiBolt11PaymentClaimForHashUnsafe(
4646
that: this,
4747
paymentHash: paymentHash,
4848
claimableAmountMsat: claimableAmountMsat,
4949
preimage: preimage);
5050

51-
Future<void> failForHash({required PaymentHash paymentHash}) =>
52-
core.instance.api.crateApiBolt11FfiBolt11PaymentFailForHash(
51+
Future<void> failForHashUnsafe({required PaymentHash paymentHash}) =>
52+
core.instance.api.crateApiBolt11FfiBolt11PaymentFailForHashUnsafe(
5353
that: this, paymentHash: paymentHash);
5454

55-
Future<Bolt11Invoice> receive(
56-
{required BigInt amountMsat,
55+
Future<Bolt11Invoice> receiveForHashUnsafe(
56+
{required PaymentHash paymentHash,
57+
required BigInt amountMsat,
5758
required String description,
5859
required int expirySecs}) =>
59-
core.instance.api.crateApiBolt11FfiBolt11PaymentReceive(
60+
core.instance.api.crateApiBolt11FfiBolt11PaymentReceiveForHashUnsafe(
6061
that: this,
62+
paymentHash: paymentHash,
6163
amountMsat: amountMsat,
6264
description: description,
6365
expirySecs: expirySecs);
6466

65-
Future<Bolt11Invoice> receiveForHash(
66-
{required PaymentHash paymentHash,
67-
required BigInt amountMsat,
67+
Future<Bolt11Invoice> receiveUnsafe(
68+
{required BigInt amountMsat,
6869
required String description,
6970
required int expirySecs}) =>
70-
core.instance.api.crateApiBolt11FfiBolt11PaymentReceiveForHash(
71+
core.instance.api.crateApiBolt11FfiBolt11PaymentReceiveUnsafe(
7172
that: this,
72-
paymentHash: paymentHash,
7373
amountMsat: amountMsat,
7474
description: description,
7575
expirySecs: expirySecs);
7676

77-
Future<Bolt11Invoice> receiveVariableAmount(
78-
{required String description, required int expirySecs}) =>
79-
core.instance.api.crateApiBolt11FfiBolt11PaymentReceiveVariableAmount(
80-
that: this, description: description, expirySecs: expirySecs);
81-
82-
Future<Bolt11Invoice> receiveVariableAmountForHash(
77+
Future<Bolt11Invoice> receiveVariableAmountForHashUnsafe(
8378
{required String description,
8479
required int expirySecs,
8580
required PaymentHash paymentHash}) =>
8681
core.instance.api
87-
.crateApiBolt11FfiBolt11PaymentReceiveVariableAmountForHash(
82+
.crateApiBolt11FfiBolt11PaymentReceiveVariableAmountForHashUnsafe(
8883
that: this,
8984
description: description,
9085
expirySecs: expirySecs,
9186
paymentHash: paymentHash);
9287

93-
Future<Bolt11Invoice> receiveVariableAmountViaJitChannel(
88+
Future<Bolt11Invoice> receiveVariableAmountUnsafe(
89+
{required String description, required int expirySecs}) =>
90+
core.instance.api
91+
.crateApiBolt11FfiBolt11PaymentReceiveVariableAmountUnsafe(
92+
that: this, description: description, expirySecs: expirySecs);
93+
94+
Future<Bolt11Invoice> receiveVariableAmountViaJitChannelUnsafe(
9495
{required String description,
9596
required int expirySecs,
9697
BigInt? maxProportionalLspFeeLimitPpmMsat}) =>
9798
core.instance.api
98-
.crateApiBolt11FfiBolt11PaymentReceiveVariableAmountViaJitChannel(
99+
.crateApiBolt11FfiBolt11PaymentReceiveVariableAmountViaJitChannelUnsafe(
99100
that: this,
100101
description: description,
101102
expirySecs: expirySecs,
102103
maxProportionalLspFeeLimitPpmMsat:
103104
maxProportionalLspFeeLimitPpmMsat);
104105

105-
Future<Bolt11Invoice> receiveViaJitChannel(
106+
Future<Bolt11Invoice> receiveViaJitChannelUnsafe(
106107
{required BigInt amountMsat,
107108
required String description,
108109
required int expirySecs,
109110
BigInt? maxTotalLspFeeLimitMsat}) =>
110-
core.instance.api.crateApiBolt11FfiBolt11PaymentReceiveViaJitChannel(
111-
that: this,
112-
amountMsat: amountMsat,
113-
description: description,
114-
expirySecs: expirySecs,
115-
maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat);
111+
core.instance.api
112+
.crateApiBolt11FfiBolt11PaymentReceiveViaJitChannelUnsafe(
113+
that: this,
114+
amountMsat: amountMsat,
115+
description: description,
116+
expirySecs: expirySecs,
117+
maxTotalLspFeeLimitMsat: maxTotalLspFeeLimitMsat);
118+
119+
Future<void> sendProbesUnsafe({required Bolt11Invoice invoice}) =>
120+
core.instance.api.crateApiBolt11FfiBolt11PaymentSendProbesUnsafe(
121+
that: this, invoice: invoice);
116122

117-
Future<PaymentId> send(
123+
Future<void> sendProbesUsingAmountUnsafe(
124+
{required Bolt11Invoice invoice, required BigInt amountMsat}) =>
125+
core.instance.api
126+
.crateApiBolt11FfiBolt11PaymentSendProbesUsingAmountUnsafe(
127+
that: this, invoice: invoice, amountMsat: amountMsat);
128+
129+
Future<PaymentId> sendUnsafe(
118130
{required Bolt11Invoice invoice,
119131
SendingParameters? sendingParameters}) =>
120-
core.instance.api.crateApiBolt11FfiBolt11PaymentSend(
132+
core.instance.api.crateApiBolt11FfiBolt11PaymentSendUnsafe(
121133
that: this, invoice: invoice, sendingParameters: sendingParameters);
122134

123-
Future<void> sendProbes({required Bolt11Invoice invoice}) => core.instance.api
124-
.crateApiBolt11FfiBolt11PaymentSendProbes(that: this, invoice: invoice);
125-
126-
Future<void> sendProbesUsingAmount(
127-
{required Bolt11Invoice invoice, required BigInt amountMsat}) =>
128-
core.instance.api.crateApiBolt11FfiBolt11PaymentSendProbesUsingAmount(
129-
that: this, invoice: invoice, amountMsat: amountMsat);
130-
131-
Future<PaymentId> sendUsingAmount(
135+
Future<PaymentId> sendUsingAmountUnsafe(
132136
{required Bolt11Invoice invoice,
133137
required BigInt amountMsat,
134138
SendingParameters? sendingParameters}) =>
135-
core.instance.api.crateApiBolt11FfiBolt11PaymentSendUsingAmount(
139+
core.instance.api.crateApiBolt11FfiBolt11PaymentSendUsingAmountUnsafe(
136140
that: this,
137141
invoice: invoice,
138142
amountMsat: amountMsat,

lib/src/generated/api/bolt12.dart

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,50 +37,52 @@ class FfiBolt12Payment {
3737
required this.opaque,
3838
});
3939

40-
Future<Refund> initiateRefund(
40+
Future<Refund> initiateRefundUnsafe(
4141
{required BigInt amountMsat,
4242
required int expirySecs,
4343
BigInt? quantity,
4444
String? payerNote}) =>
45-
core.instance.api.crateApiBolt12FfiBolt12PaymentInitiateRefund(
45+
core.instance.api.crateApiBolt12FfiBolt12PaymentInitiateRefundUnsafe(
4646
that: this,
4747
amountMsat: amountMsat,
4848
expirySecs: expirySecs,
4949
quantity: quantity,
5050
payerNote: payerNote);
5151

52-
Future<Offer> receive(
52+
Future<Offer> receiveUnsafe(
5353
{required BigInt amountMsat,
5454
required String description,
5555
int? expirySecs,
5656
BigInt? quantity}) =>
57-
core.instance.api.crateApiBolt12FfiBolt12PaymentReceive(
57+
core.instance.api.crateApiBolt12FfiBolt12PaymentReceiveUnsafe(
5858
that: this,
5959
amountMsat: amountMsat,
6060
description: description,
6161
expirySecs: expirySecs,
6262
quantity: quantity);
6363

64-
Future<Offer> receiveVariableAmount(
64+
Future<Offer> receiveVariableAmountUnsafe(
6565
{required String description, int? expirySecs}) =>
66-
core.instance.api.crateApiBolt12FfiBolt12PaymentReceiveVariableAmount(
67-
that: this, description: description, expirySecs: expirySecs);
66+
core.instance.api
67+
.crateApiBolt12FfiBolt12PaymentReceiveVariableAmountUnsafe(
68+
that: this, description: description, expirySecs: expirySecs);
6869

69-
Future<Bolt12Invoice> requestRefundPayment({required Refund refund}) =>
70-
core.instance.api.crateApiBolt12FfiBolt12PaymentRequestRefundPayment(
71-
that: this, refund: refund);
70+
Future<Bolt12Invoice> requestRefundPaymentUnsafe({required Refund refund}) =>
71+
core.instance.api
72+
.crateApiBolt12FfiBolt12PaymentRequestRefundPaymentUnsafe(
73+
that: this, refund: refund);
7274

73-
Future<PaymentId> send(
75+
Future<PaymentId> sendUnsafe(
7476
{required Offer offer, BigInt? quantity, String? payerNote}) =>
75-
core.instance.api.crateApiBolt12FfiBolt12PaymentSend(
77+
core.instance.api.crateApiBolt12FfiBolt12PaymentSendUnsafe(
7678
that: this, offer: offer, quantity: quantity, payerNote: payerNote);
7779

78-
Future<PaymentId> sendUsingAmount(
80+
Future<PaymentId> sendUsingAmountUnsafe(
7981
{required Offer offer,
8082
required BigInt amountMsat,
8183
BigInt? quantity,
8284
String? payerNote}) =>
83-
core.instance.api.crateApiBolt12FfiBolt12PaymentSendUsingAmount(
85+
core.instance.api.crateApiBolt12FfiBolt12PaymentSendUsingAmountUnsafe(
8486
that: this,
8587
offer: offer,
8688
amountMsat: amountMsat,

lib/src/generated/api/graph.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,24 @@ class FfiNetworkGraph {
112112
});
113113

114114
/// Returns information on a channel with the given id.
115-
Future<ChannelInfo?> channel({required BigInt shortChannelId}) =>
116-
core.instance.api.crateApiGraphFfiNetworkGraphChannel(
115+
Future<ChannelInfo?> channelUnsafe({required BigInt shortChannelId}) =>
116+
core.instance.api.crateApiGraphFfiNetworkGraphChannelUnsafe(
117117
that: this, shortChannelId: shortChannelId);
118118

119119
/// Returns the list of channels in the graph
120-
Future<Uint64List> listChannels() =>
121-
core.instance.api.crateApiGraphFfiNetworkGraphListChannels(
120+
Future<Uint64List> listChannelsUnsafe() =>
121+
core.instance.api.crateApiGraphFfiNetworkGraphListChannelsUnsafe(
122122
that: this,
123123
);
124124

125125
/// Returns the list of nodes in the graph
126-
Future<List<NodeId>> listNodes() =>
127-
core.instance.api.crateApiGraphFfiNetworkGraphListNodes(
126+
Future<List<NodeId>> listNodesUnsafe() =>
127+
core.instance.api.crateApiGraphFfiNetworkGraphListNodesUnsafe(
128128
that: this,
129129
);
130130

131-
Future<NodeInfo?> node({required NodeId nodeId}) => core.instance.api
132-
.crateApiGraphFfiNetworkGraphNode(that: this, nodeId: nodeId);
131+
Future<NodeInfo?> nodeUnsafe({required NodeId nodeId}) => core.instance.api
132+
.crateApiGraphFfiNetworkGraphNodeUnsafe(that: this, nodeId: nodeId);
133133

134134
@override
135135
int get hashCode => opaque.hashCode;

lib/src/generated/api/spontaneous.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,29 @@ class FfiSpontaneousPayment {
1818
required this.opaque,
1919
});
2020

21-
Future<PaymentId> send(
21+
Future<void> sendProbesUnsafe(
22+
{required BigInt amountMsat, required PublicKey nodeId}) =>
23+
core.instance.api
24+
.crateApiSpontaneousFfiSpontaneousPaymentSendProbesUnsafe(
25+
that: this, amountMsat: amountMsat, nodeId: nodeId);
26+
27+
Future<PaymentId> sendUnsafe(
2228
{required BigInt amountMsat,
2329
required PublicKey nodeId,
2430
SendingParameters? sendingParameters}) =>
25-
core.instance.api.crateApiSpontaneousFfiSpontaneousPaymentSend(
31+
core.instance.api.crateApiSpontaneousFfiSpontaneousPaymentSendUnsafe(
2632
that: this,
2733
amountMsat: amountMsat,
2834
nodeId: nodeId,
2935
sendingParameters: sendingParameters);
3036

31-
Future<void> sendProbes(
32-
{required BigInt amountMsat, required PublicKey nodeId}) =>
33-
core.instance.api.crateApiSpontaneousFfiSpontaneousPaymentSendProbes(
34-
that: this, amountMsat: amountMsat, nodeId: nodeId);
35-
36-
Future<PaymentId> sendWithCustomTlvs(
37+
Future<PaymentId> sendWithCustomTlvsUnsafe(
3738
{required BigInt amountMsat,
3839
required PublicKey nodeId,
3940
SendingParameters? sendingParameters,
4041
required List<CustomTlvRecord> customTlvs}) =>
4142
core.instance.api
42-
.crateApiSpontaneousFfiSpontaneousPaymentSendWithCustomTlvs(
43+
.crateApiSpontaneousFfiSpontaneousPaymentSendWithCustomTlvsUnsafe(
4344
that: this,
4445
amountMsat: amountMsat,
4546
nodeId: nodeId,

lib/src/generated/api/unified_qr.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,21 @@ class FfiUnifiedQrPayment {
3838
///
3939
/// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
4040
/// [BOLT 12]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md
41-
Future<String> receive(
41+
Future<String> receiveUnsafe(
4242
{required BigInt amountSats,
4343
required String message,
4444
required int expirySec}) =>
45-
core.instance.api.crateApiUnifiedQrFfiUnifiedQrPaymentReceive(
45+
core.instance.api.crateApiUnifiedQrFfiUnifiedQrPaymentReceiveUnsafe(
4646
that: this,
4747
amountSats: amountSats,
4848
message: message,
4949
expirySec: expirySec);
5050

5151
///Sends a payment given a BIP 21 URI.
5252
///This method parses the provided URI string and attempts to send the payment. If the URI has an offer and or invoice, it will try to pay the offer first followed by the invoice. If they both fail, the on-chain payment will be paid.
53-
Future<QrPaymentResult> send({required String uriStr}) => core.instance.api
54-
.crateApiUnifiedQrFfiUnifiedQrPaymentSend(that: this, uriStr: uriStr);
53+
Future<QrPaymentResult> sendUnsafe({required String uriStr}) =>
54+
core.instance.api.crateApiUnifiedQrFfiUnifiedQrPaymentSendUnsafe(
55+
that: this, uriStr: uriStr);
5556

5657
@override
5758
int get hashCode => opaque.hashCode;

0 commit comments

Comments
 (0)