react-native-nitro-ark 0.0.51 → 0.0.53
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/cpp/HybridArk.cpp +3 -4
- package/cpp/NitroArk.hpp +212 -243
- package/cpp/generated/ark_cxx.h +22 -3
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +12 -3
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +14 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/BarkArkInfo.hpp +5 -5
- package/nitrogen/generated/shared/c++/BarkConfigOpts.hpp +5 -5
- package/nitrogen/generated/shared/c++/BarkVtxo.hpp +5 -5
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/LightningReceive.hpp +80 -0
- package/nitrogen/generated/shared/c++/OffchainBalanceResult.hpp +5 -1
- package/package.json +4 -4
- package/src/NitroArk.nitro.ts +15 -3
- package/src/index.tsx +23 -0
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -809,6 +809,7 @@ namespace bark_cxx {
|
|
|
809
809
|
struct CreateOpts;
|
|
810
810
|
struct SendManyOutput;
|
|
811
811
|
enum class RefreshModeType : ::std::uint8_t;
|
|
812
|
+
struct LightningReceive;
|
|
812
813
|
struct OffchainBalance;
|
|
813
814
|
struct OnChainBalance;
|
|
814
815
|
struct KeyPairResult;
|
|
@@ -820,7 +821,7 @@ namespace bark_cxx {
|
|
|
820
821
|
struct BarkVtxo final {
|
|
821
822
|
::std::uint64_t amount CXX_DEFAULT_VALUE(0);
|
|
822
823
|
::std::uint32_t expiry_height CXX_DEFAULT_VALUE(0);
|
|
823
|
-
::rust::String
|
|
824
|
+
::rust::String server_pubkey;
|
|
824
825
|
::std::uint16_t exit_delta CXX_DEFAULT_VALUE(0);
|
|
825
826
|
::rust::String anchor_point;
|
|
826
827
|
::rust::String point;
|
|
@@ -901,7 +902,7 @@ struct OnchainPaymentResult final {
|
|
|
901
902
|
#define CXXBRIDGE1_STRUCT_bark_cxx$CxxArkInfo
|
|
902
903
|
struct CxxArkInfo final {
|
|
903
904
|
::rust::String network;
|
|
904
|
-
::rust::String
|
|
905
|
+
::rust::String server_pubkey;
|
|
905
906
|
::std::uint64_t round_interval_secs CXX_DEFAULT_VALUE(0);
|
|
906
907
|
::std::uint16_t vtxo_exit_delta CXX_DEFAULT_VALUE(0);
|
|
907
908
|
::std::uint16_t vtxo_expiry_delta CXX_DEFAULT_VALUE(0);
|
|
@@ -915,7 +916,7 @@ struct CxxArkInfo final {
|
|
|
915
916
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$ConfigOpts
|
|
916
917
|
#define CXXBRIDGE1_STRUCT_bark_cxx$ConfigOpts
|
|
917
918
|
struct ConfigOpts final {
|
|
918
|
-
::rust::String
|
|
919
|
+
::rust::String ark;
|
|
919
920
|
::rust::String esplora;
|
|
920
921
|
::rust::String bitcoind;
|
|
921
922
|
::rust::String bitcoind_cookie;
|
|
@@ -964,6 +965,18 @@ enum class RefreshModeType : ::std::uint8_t {
|
|
|
964
965
|
};
|
|
965
966
|
#endif // CXXBRIDGE1_ENUM_bark_cxx$RefreshModeType
|
|
966
967
|
|
|
968
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$LightningReceive
|
|
969
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$LightningReceive
|
|
970
|
+
struct LightningReceive final {
|
|
971
|
+
::rust::String payment_hash;
|
|
972
|
+
::rust::String payment_preimage;
|
|
973
|
+
::rust::String invoice;
|
|
974
|
+
::std::uint64_t const *preimage_revealed_at CXX_DEFAULT_VALUE(nullptr);
|
|
975
|
+
|
|
976
|
+
using IsRelocatable = ::std::true_type;
|
|
977
|
+
};
|
|
978
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$LightningReceive
|
|
979
|
+
|
|
967
980
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$OffchainBalance
|
|
968
981
|
#define CXXBRIDGE1_STRUCT_bark_cxx$OffchainBalance
|
|
969
982
|
struct OffchainBalance final {
|
|
@@ -971,6 +984,8 @@ struct OffchainBalance final {
|
|
|
971
984
|
::std::uint64_t spendable CXX_DEFAULT_VALUE(0);
|
|
972
985
|
// Coins that are in the process of being sent over Lightning.
|
|
973
986
|
::std::uint64_t pending_lightning_send CXX_DEFAULT_VALUE(0);
|
|
987
|
+
// Coins locked in a round.
|
|
988
|
+
::std::uint64_t pending_in_round CXX_DEFAULT_VALUE(0);
|
|
974
989
|
// Coins that are in the process of unilaterally exiting the Ark.
|
|
975
990
|
::std::uint64_t pending_exit CXX_DEFAULT_VALUE(0);
|
|
976
991
|
|
|
@@ -1038,6 +1053,8 @@ bool verify_message(::rust::Str message, ::rust::Str signature, ::rust::Str publ
|
|
|
1038
1053
|
|
|
1039
1054
|
::rust::String bolt11_invoice(::std::uint64_t amount_msat);
|
|
1040
1055
|
|
|
1056
|
+
::bark_cxx::LightningReceive const *lightning_receive_status(::rust::String payment);
|
|
1057
|
+
|
|
1041
1058
|
void maintenance();
|
|
1042
1059
|
|
|
1043
1060
|
void maintenance_refresh();
|
|
@@ -1054,6 +1071,8 @@ void load_wallet(::rust::Str datadir, ::rust::Str mnemonic);
|
|
|
1054
1071
|
|
|
1055
1072
|
::rust::String board_all();
|
|
1056
1073
|
|
|
1074
|
+
void validate_arkoor_address(::rust::Str address);
|
|
1075
|
+
|
|
1057
1076
|
::bark_cxx::ArkoorPaymentResult send_arkoor_payment(::rust::Str destination, ::std::uint64_t amount_sat);
|
|
1058
1077
|
|
|
1059
1078
|
::bark_cxx::Bolt11PaymentResult send_lightning_payment(::rust::Str destination, ::std::uint64_t const *amount_sat);
|
package/lib/module/index.js
CHANGED
|
@@ -288,6 +288,16 @@ export function bolt11Invoice(amountMsat) {
|
|
|
288
288
|
return NitroArkHybridObject.bolt11Invoice(amountMsat);
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Gets the status of a Lightning receive.
|
|
293
|
+
* @param payment The payment hash of the Lightning receive.
|
|
294
|
+
* @returns A promise resolving to the Lightning receive status.
|
|
295
|
+
*/
|
|
296
|
+
|
|
297
|
+
export function lightningReceiveStatus(payment) {
|
|
298
|
+
return NitroArkHybridObject.lightningReceiveStatus(payment);
|
|
299
|
+
}
|
|
300
|
+
|
|
291
301
|
/**
|
|
292
302
|
* Claims a Lightning payment.
|
|
293
303
|
* @param bolt11 The Lightning invoice string to claim.
|
|
@@ -337,6 +347,15 @@ export function boardAll() {
|
|
|
337
347
|
return NitroArkHybridObject.boardAll();
|
|
338
348
|
}
|
|
339
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Validates an Arkoor address.
|
|
352
|
+
* @param address The Arkoor address to validate.
|
|
353
|
+
* @returns A promise resolving to void.
|
|
354
|
+
*/
|
|
355
|
+
export function validateArkoorAddress(address) {
|
|
356
|
+
return NitroArkHybridObject.validateArkoorAddress(address);
|
|
357
|
+
}
|
|
358
|
+
|
|
340
359
|
/**
|
|
341
360
|
* Sends an Arkoor payment.
|
|
342
361
|
* @param destination The destination Arkoor address.
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","mnemonic","closeWallet","isWalletLoaded","persistConfig","maintenance","maintenanceRefresh","sync","syncExits","syncRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","newAddress","signMessage","message","signMesssageWithMnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","getVtxos","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","finishLightningReceive","bolt11","sendLightningPayment","sendLnaddr","addr","comment","boardAmount","boardAll","sendArkoorPayment","sendRoundOnchainPayment","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;
|
|
1
|
+
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","mnemonic","closeWallet","isWalletLoaded","persistConfig","maintenance","maintenanceRefresh","sync","syncExits","syncRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","newAddress","signMessage","message","signMesssageWithMnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","getVtxos","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","lightningReceiveStatus","payment","finishLightningReceive","bolt11","sendLightningPayment","sendLnaddr","addr","comment","boardAmount","boardAll","validateArkoorAddress","address","sendArkoorPayment","sendRoundOnchainPayment","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAmBzD;AACA,OAAO,MAAMC,oBAAoB,GAC/BD,YAAY,CAACE,kBAAkB,CAAW,UAAU,CAAC;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAoB;EAChD,OAAOF,oBAAoB,CAACE,cAAc,CAAC,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAC1BC,OAAe,EACfC,IAAoB,EACL;EACf,OAAOL,oBAAoB,CAACG,YAAY,CAACC,OAAO,EAAEC,IAAI,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,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WAAmB,EACnBC,SAAiB,EACa;EAC9B,OAAOxC,oBAAoB,CAAC0D,iBAAiB,CAACnB,WAAW,EAAEC,SAAS,CAAC;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASmB,uBAAuBA,CACrCpB,WAAmB,EACnBC,SAAiB,EACA;EACjB,OAAOxC,oBAAoB,CAAC2D,uBAAuB,CAACpB,WAAW,EAAEC,SAAS,CAAC;AAC7E;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASoB,gBAAgBA,CAC9BC,OAAiB,EACjBC,kBAA0B,EACT;EACjB,OAAO9D,oBAAoB,CAAC4D,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAO9D,oBAAoB,CAAC+D,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
2
|
export interface BarkConfigOpts {
|
|
3
|
-
|
|
3
|
+
ark?: string;
|
|
4
4
|
esplora?: string;
|
|
5
5
|
bitcoind?: string;
|
|
6
6
|
bitcoind_cookie?: string;
|
|
@@ -19,7 +19,7 @@ export interface BarkCreateOpts {
|
|
|
19
19
|
}
|
|
20
20
|
export interface BarkArkInfo {
|
|
21
21
|
network: string;
|
|
22
|
-
|
|
22
|
+
server_pubkey: string;
|
|
23
23
|
round_interval_secs: number;
|
|
24
24
|
vtxo_exit_delta: number;
|
|
25
25
|
vtxo_expiry_delta: number;
|
|
@@ -33,7 +33,7 @@ export interface BarkSendManyOutput {
|
|
|
33
33
|
export interface BarkVtxo {
|
|
34
34
|
amount: number;
|
|
35
35
|
expiry_height: number;
|
|
36
|
-
|
|
36
|
+
server_pubkey: string;
|
|
37
37
|
exit_delta: number;
|
|
38
38
|
anchor_point: string;
|
|
39
39
|
point: string;
|
|
@@ -65,6 +65,7 @@ export interface OnchainPaymentResult {
|
|
|
65
65
|
export interface OffchainBalanceResult {
|
|
66
66
|
spendable: number;
|
|
67
67
|
pending_lightning_send: number;
|
|
68
|
+
pending_in_round: number;
|
|
68
69
|
pending_exit: number;
|
|
69
70
|
}
|
|
70
71
|
export interface OnchainBalanceResult {
|
|
@@ -82,6 +83,12 @@ export interface KeyPairResult {
|
|
|
82
83
|
public_key: string;
|
|
83
84
|
secret_key: string;
|
|
84
85
|
}
|
|
86
|
+
export interface LightningReceive {
|
|
87
|
+
payment_hash: string;
|
|
88
|
+
payment_preimage: string;
|
|
89
|
+
invoice: string;
|
|
90
|
+
preimage_revealed_at?: number;
|
|
91
|
+
}
|
|
85
92
|
export interface NitroArk extends HybridObject<{
|
|
86
93
|
ios: 'c++';
|
|
87
94
|
android: 'c++';
|
|
@@ -118,11 +125,13 @@ export interface NitroArk extends HybridObject<{
|
|
|
118
125
|
onchainSendMany(outputs: BarkSendManyOutput[], feeRate?: number): Promise<string>;
|
|
119
126
|
boardAmount(amountSat: number): Promise<string>;
|
|
120
127
|
boardAll(): Promise<string>;
|
|
128
|
+
validateArkoorAddress(address: string): Promise<void>;
|
|
121
129
|
sendArkoorPayment(destination: string, amountSat: number): Promise<ArkoorPaymentResult>;
|
|
122
130
|
sendLightningPayment(destination: string, amountSat?: number): Promise<LightningPaymentResult>;
|
|
123
131
|
sendLnaddr(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
124
132
|
sendRoundOnchainPayment(destination: string, amountSat: number): Promise<string>;
|
|
125
133
|
bolt11Invoice(amountMsat: number): Promise<string>;
|
|
134
|
+
lightningReceiveStatus(payment: string): Promise<LightningReceive | undefined>;
|
|
126
135
|
finishLightningReceive(bolt11: string): Promise<void>;
|
|
127
136
|
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
128
137
|
offboardAll(destinationAddress: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NitroArk.nitro.d.ts","sourceRoot":"","sources":["../../../src/NitroArk.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM/D,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"NitroArk.nitro.d.ts","sourceRoot":"","sources":["../../../src/NitroArk.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM/D,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B,CAAC,EAAE,MAAM,C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E,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC/B,uBAAuB,CACrB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,sBAAsB,CACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;IACzC,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGtD,gBAAgB,CACd,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, BarkVtxo, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult } from './NitroArk.nitro';
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, BarkVtxo, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive } from './NitroArk.nitro';
|
|
2
2
|
export declare const NitroArkHybridObject: NitroArk;
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new BIP39 mnemonic phrase.
|
|
@@ -181,6 +181,12 @@ export declare function onchainSendMany(outputs: BarkSendManyOutput[]): Promise<
|
|
|
181
181
|
* @returns A promise resolving to the Bolt 11 invoice string.
|
|
182
182
|
*/
|
|
183
183
|
export declare function bolt11Invoice(amountMsat: number): Promise<string>;
|
|
184
|
+
/**
|
|
185
|
+
* Gets the status of a Lightning receive.
|
|
186
|
+
* @param payment The payment hash of the Lightning receive.
|
|
187
|
+
* @returns A promise resolving to the Lightning receive status.
|
|
188
|
+
*/
|
|
189
|
+
export declare function lightningReceiveStatus(payment: string): Promise<LightningReceive | undefined>;
|
|
184
190
|
/**
|
|
185
191
|
* Claims a Lightning payment.
|
|
186
192
|
* @param bolt11 The Lightning invoice string to claim.
|
|
@@ -213,6 +219,12 @@ export declare function boardAmount(amountSat: number): Promise<string>;
|
|
|
213
219
|
* @returns A promise resolving to a JSON status string.
|
|
214
220
|
*/
|
|
215
221
|
export declare function boardAll(): Promise<string>;
|
|
222
|
+
/**
|
|
223
|
+
* Validates an Arkoor address.
|
|
224
|
+
* @param address The Arkoor address to validate.
|
|
225
|
+
* @returns A promise resolving to void.
|
|
226
|
+
*/
|
|
227
|
+
export declare function validateArkoorAddress(address: string): Promise<void>;
|
|
216
228
|
/**
|
|
217
229
|
* Sends an Arkoor payment.
|
|
218
230
|
* @param destination The destination Arkoor address.
|
|
@@ -242,5 +254,5 @@ export declare function offboardSpecific(vtxoIds: string[], destinationAddress:
|
|
|
242
254
|
* @returns A promise resolving to a JSON result string.
|
|
243
255
|
*/
|
|
244
256
|
export declare function offboardAll(destinationAddress: string): Promise<string>;
|
|
245
|
-
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, } from './NitroArk.nitro';
|
|
257
|
+
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, } from './NitroArk.nitro';
|
|
246
258
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,oBAAoB,UACsB,CAAC;AAIxD;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3E;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3C;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc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qB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -30,7 +30,7 @@ namespace margelo::nitro::nitroark {
|
|
|
30
30
|
struct BarkArkInfo {
|
|
31
31
|
public:
|
|
32
32
|
std::string network SWIFT_PRIVATE;
|
|
33
|
-
std::string
|
|
33
|
+
std::string server_pubkey SWIFT_PRIVATE;
|
|
34
34
|
double round_interval_secs SWIFT_PRIVATE;
|
|
35
35
|
double vtxo_exit_delta SWIFT_PRIVATE;
|
|
36
36
|
double vtxo_expiry_delta SWIFT_PRIVATE;
|
|
@@ -39,7 +39,7 @@ namespace margelo::nitro::nitroark {
|
|
|
39
39
|
|
|
40
40
|
public:
|
|
41
41
|
BarkArkInfo() = default;
|
|
42
|
-
explicit BarkArkInfo(std::string network, std::string
|
|
42
|
+
explicit BarkArkInfo(std::string network, std::string server_pubkey, double round_interval_secs, double vtxo_exit_delta, double vtxo_expiry_delta, double htlc_expiry_delta, double max_vtxo_amount_sat): network(network), server_pubkey(server_pubkey), round_interval_secs(round_interval_secs), vtxo_exit_delta(vtxo_exit_delta), vtxo_expiry_delta(vtxo_expiry_delta), htlc_expiry_delta(htlc_expiry_delta), max_vtxo_amount_sat(max_vtxo_amount_sat) {}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
} // namespace margelo::nitro::nitroark
|
|
@@ -53,7 +53,7 @@ namespace margelo::nitro {
|
|
|
53
53
|
jsi::Object obj = arg.asObject(runtime);
|
|
54
54
|
return margelo::nitro::nitroark::BarkArkInfo(
|
|
55
55
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "network")),
|
|
56
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
56
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "server_pubkey")),
|
|
57
57
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "round_interval_secs")),
|
|
58
58
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "vtxo_exit_delta")),
|
|
59
59
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "vtxo_expiry_delta")),
|
|
@@ -64,7 +64,7 @@ namespace margelo::nitro {
|
|
|
64
64
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkArkInfo& arg) {
|
|
65
65
|
jsi::Object obj(runtime);
|
|
66
66
|
obj.setProperty(runtime, "network", JSIConverter<std::string>::toJSI(runtime, arg.network));
|
|
67
|
-
obj.setProperty(runtime, "
|
|
67
|
+
obj.setProperty(runtime, "server_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.server_pubkey));
|
|
68
68
|
obj.setProperty(runtime, "round_interval_secs", JSIConverter<double>::toJSI(runtime, arg.round_interval_secs));
|
|
69
69
|
obj.setProperty(runtime, "vtxo_exit_delta", JSIConverter<double>::toJSI(runtime, arg.vtxo_exit_delta));
|
|
70
70
|
obj.setProperty(runtime, "vtxo_expiry_delta", JSIConverter<double>::toJSI(runtime, arg.vtxo_expiry_delta));
|
|
@@ -78,7 +78,7 @@ namespace margelo::nitro {
|
|
|
78
78
|
}
|
|
79
79
|
jsi::Object obj = value.getObject(runtime);
|
|
80
80
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "network"))) return false;
|
|
81
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "
|
|
81
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "server_pubkey"))) return false;
|
|
82
82
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "round_interval_secs"))) return false;
|
|
83
83
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "vtxo_exit_delta"))) return false;
|
|
84
84
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "vtxo_expiry_delta"))) return false;
|
|
@@ -30,7 +30,7 @@ namespace margelo::nitro::nitroark {
|
|
|
30
30
|
*/
|
|
31
31
|
struct BarkConfigOpts {
|
|
32
32
|
public:
|
|
33
|
-
std::optional<std::string>
|
|
33
|
+
std::optional<std::string> ark SWIFT_PRIVATE;
|
|
34
34
|
std::optional<std::string> esplora SWIFT_PRIVATE;
|
|
35
35
|
std::optional<std::string> bitcoind SWIFT_PRIVATE;
|
|
36
36
|
std::optional<std::string> bitcoind_cookie SWIFT_PRIVATE;
|
|
@@ -41,7 +41,7 @@ namespace margelo::nitro::nitroark {
|
|
|
41
41
|
|
|
42
42
|
public:
|
|
43
43
|
BarkConfigOpts() = default;
|
|
44
|
-
explicit BarkConfigOpts(std::optional<std::string>
|
|
44
|
+
explicit BarkConfigOpts(std::optional<std::string> ark, std::optional<std::string> esplora, std::optional<std::string> bitcoind, std::optional<std::string> bitcoind_cookie, std::optional<std::string> bitcoind_user, std::optional<std::string> bitcoind_pass, std::optional<double> vtxo_refresh_expiry_threshold, std::optional<double> fallback_fee_rate): ark(ark), esplora(esplora), bitcoind(bitcoind), bitcoind_cookie(bitcoind_cookie), bitcoind_user(bitcoind_user), bitcoind_pass(bitcoind_pass), vtxo_refresh_expiry_threshold(vtxo_refresh_expiry_threshold), fallback_fee_rate(fallback_fee_rate) {}
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
} // namespace margelo::nitro::nitroark
|
|
@@ -54,7 +54,7 @@ namespace margelo::nitro {
|
|
|
54
54
|
static inline margelo::nitro::nitroark::BarkConfigOpts fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
55
55
|
jsi::Object obj = arg.asObject(runtime);
|
|
56
56
|
return margelo::nitro::nitroark::BarkConfigOpts(
|
|
57
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
57
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "ark")),
|
|
58
58
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "esplora")),
|
|
59
59
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bitcoind")),
|
|
60
60
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bitcoind_cookie")),
|
|
@@ -66,7 +66,7 @@ namespace margelo::nitro {
|
|
|
66
66
|
}
|
|
67
67
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkConfigOpts& arg) {
|
|
68
68
|
jsi::Object obj(runtime);
|
|
69
|
-
obj.setProperty(runtime, "
|
|
69
|
+
obj.setProperty(runtime, "ark", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.ark));
|
|
70
70
|
obj.setProperty(runtime, "esplora", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.esplora));
|
|
71
71
|
obj.setProperty(runtime, "bitcoind", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bitcoind));
|
|
72
72
|
obj.setProperty(runtime, "bitcoind_cookie", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bitcoind_cookie));
|
|
@@ -81,7 +81,7 @@ namespace margelo::nitro {
|
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
83
|
jsi::Object obj = value.getObject(runtime);
|
|
84
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "
|
|
84
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "ark"))) return false;
|
|
85
85
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "esplora"))) return false;
|
|
86
86
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bitcoind"))) return false;
|
|
87
87
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bitcoind_cookie"))) return false;
|
|
@@ -31,14 +31,14 @@ namespace margelo::nitro::nitroark {
|
|
|
31
31
|
public:
|
|
32
32
|
double amount SWIFT_PRIVATE;
|
|
33
33
|
double expiry_height SWIFT_PRIVATE;
|
|
34
|
-
std::string
|
|
34
|
+
std::string server_pubkey SWIFT_PRIVATE;
|
|
35
35
|
double exit_delta SWIFT_PRIVATE;
|
|
36
36
|
std::string anchor_point SWIFT_PRIVATE;
|
|
37
37
|
std::string point SWIFT_PRIVATE;
|
|
38
38
|
|
|
39
39
|
public:
|
|
40
40
|
BarkVtxo() = default;
|
|
41
|
-
explicit BarkVtxo(double amount, double expiry_height, std::string
|
|
41
|
+
explicit BarkVtxo(double amount, double expiry_height, std::string server_pubkey, double exit_delta, std::string anchor_point, std::string point): amount(amount), expiry_height(expiry_height), server_pubkey(server_pubkey), exit_delta(exit_delta), anchor_point(anchor_point), point(point) {}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
} // namespace margelo::nitro::nitroark
|
|
@@ -53,7 +53,7 @@ namespace margelo::nitro {
|
|
|
53
53
|
return margelo::nitro::nitroark::BarkVtxo(
|
|
54
54
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount")),
|
|
55
55
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "expiry_height")),
|
|
56
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
56
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "server_pubkey")),
|
|
57
57
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "exit_delta")),
|
|
58
58
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "anchor_point")),
|
|
59
59
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "point"))
|
|
@@ -63,7 +63,7 @@ namespace margelo::nitro {
|
|
|
63
63
|
jsi::Object obj(runtime);
|
|
64
64
|
obj.setProperty(runtime, "amount", JSIConverter<double>::toJSI(runtime, arg.amount));
|
|
65
65
|
obj.setProperty(runtime, "expiry_height", JSIConverter<double>::toJSI(runtime, arg.expiry_height));
|
|
66
|
-
obj.setProperty(runtime, "
|
|
66
|
+
obj.setProperty(runtime, "server_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.server_pubkey));
|
|
67
67
|
obj.setProperty(runtime, "exit_delta", JSIConverter<double>::toJSI(runtime, arg.exit_delta));
|
|
68
68
|
obj.setProperty(runtime, "anchor_point", JSIConverter<std::string>::toJSI(runtime, arg.anchor_point));
|
|
69
69
|
obj.setProperty(runtime, "point", JSIConverter<std::string>::toJSI(runtime, arg.point));
|
|
@@ -76,7 +76,7 @@ namespace margelo::nitro {
|
|
|
76
76
|
jsi::Object obj = value.getObject(runtime);
|
|
77
77
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount"))) return false;
|
|
78
78
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "expiry_height"))) return false;
|
|
79
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "
|
|
79
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "server_pubkey"))) return false;
|
|
80
80
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "exit_delta"))) return false;
|
|
81
81
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "anchor_point"))) return false;
|
|
82
82
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "point"))) return false;
|
|
@@ -46,11 +46,13 @@ namespace margelo::nitro::nitroark {
|
|
|
46
46
|
prototype.registerHybridMethod("onchainSendMany", &HybridNitroArkSpec::onchainSendMany);
|
|
47
47
|
prototype.registerHybridMethod("boardAmount", &HybridNitroArkSpec::boardAmount);
|
|
48
48
|
prototype.registerHybridMethod("boardAll", &HybridNitroArkSpec::boardAll);
|
|
49
|
+
prototype.registerHybridMethod("validateArkoorAddress", &HybridNitroArkSpec::validateArkoorAddress);
|
|
49
50
|
prototype.registerHybridMethod("sendArkoorPayment", &HybridNitroArkSpec::sendArkoorPayment);
|
|
50
51
|
prototype.registerHybridMethod("sendLightningPayment", &HybridNitroArkSpec::sendLightningPayment);
|
|
51
52
|
prototype.registerHybridMethod("sendLnaddr", &HybridNitroArkSpec::sendLnaddr);
|
|
52
53
|
prototype.registerHybridMethod("sendRoundOnchainPayment", &HybridNitroArkSpec::sendRoundOnchainPayment);
|
|
53
54
|
prototype.registerHybridMethod("bolt11Invoice", &HybridNitroArkSpec::bolt11Invoice);
|
|
55
|
+
prototype.registerHybridMethod("lightningReceiveStatus", &HybridNitroArkSpec::lightningReceiveStatus);
|
|
54
56
|
prototype.registerHybridMethod("finishLightningReceive", &HybridNitroArkSpec::finishLightningReceive);
|
|
55
57
|
prototype.registerHybridMethod("offboardSpecific", &HybridNitroArkSpec::offboardSpecific);
|
|
56
58
|
prototype.registerHybridMethod("offboardAll", &HybridNitroArkSpec::offboardAll);
|
|
@@ -39,6 +39,8 @@ namespace margelo::nitro::nitroark { struct ArkoorPaymentResult; }
|
|
|
39
39
|
namespace margelo::nitro::nitroark { struct LightningPaymentResult; }
|
|
40
40
|
// Forward declaration of `LnurlPaymentResult` to properly resolve imports.
|
|
41
41
|
namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
|
|
42
|
+
// Forward declaration of `LightningReceive` to properly resolve imports.
|
|
43
|
+
namespace margelo::nitro::nitroark { struct LightningReceive; }
|
|
42
44
|
|
|
43
45
|
#include <string>
|
|
44
46
|
#include <NitroModules/Promise.hpp>
|
|
@@ -57,6 +59,7 @@ namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
|
|
|
57
59
|
#include "ArkoorPaymentResult.hpp"
|
|
58
60
|
#include "LightningPaymentResult.hpp"
|
|
59
61
|
#include "LnurlPaymentResult.hpp"
|
|
62
|
+
#include "LightningReceive.hpp"
|
|
60
63
|
|
|
61
64
|
namespace margelo::nitro::nitroark {
|
|
62
65
|
|
|
@@ -121,11 +124,13 @@ namespace margelo::nitro::nitroark {
|
|
|
121
124
|
virtual std::shared_ptr<Promise<std::string>> onchainSendMany(const std::vector<BarkSendManyOutput>& outputs, std::optional<double> feeRate) = 0;
|
|
122
125
|
virtual std::shared_ptr<Promise<std::string>> boardAmount(double amountSat) = 0;
|
|
123
126
|
virtual std::shared_ptr<Promise<std::string>> boardAll() = 0;
|
|
127
|
+
virtual std::shared_ptr<Promise<void>> validateArkoorAddress(const std::string& address) = 0;
|
|
124
128
|
virtual std::shared_ptr<Promise<ArkoorPaymentResult>> sendArkoorPayment(const std::string& destination, double amountSat) = 0;
|
|
125
129
|
virtual std::shared_ptr<Promise<LightningPaymentResult>> sendLightningPayment(const std::string& destination, std::optional<double> amountSat) = 0;
|
|
126
130
|
virtual std::shared_ptr<Promise<LnurlPaymentResult>> sendLnaddr(const std::string& addr, double amountSat, const std::string& comment) = 0;
|
|
127
131
|
virtual std::shared_ptr<Promise<std::string>> sendRoundOnchainPayment(const std::string& destination, double amountSat) = 0;
|
|
128
132
|
virtual std::shared_ptr<Promise<std::string>> bolt11Invoice(double amountMsat) = 0;
|
|
133
|
+
virtual std::shared_ptr<Promise<std::optional<LightningReceive>>> lightningReceiveStatus(const std::string& payment) = 0;
|
|
129
134
|
virtual std::shared_ptr<Promise<void>> finishLightningReceive(const std::string& bolt11) = 0;
|
|
130
135
|
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
|
|
131
136
|
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LightningReceive.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
#include <optional>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::nitroark {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (LightningReceive).
|
|
30
|
+
*/
|
|
31
|
+
struct LightningReceive {
|
|
32
|
+
public:
|
|
33
|
+
std::string payment_hash SWIFT_PRIVATE;
|
|
34
|
+
std::string payment_preimage SWIFT_PRIVATE;
|
|
35
|
+
std::string invoice SWIFT_PRIVATE;
|
|
36
|
+
std::optional<double> preimage_revealed_at SWIFT_PRIVATE;
|
|
37
|
+
|
|
38
|
+
public:
|
|
39
|
+
LightningReceive() = default;
|
|
40
|
+
explicit LightningReceive(std::string payment_hash, std::string payment_preimage, std::string invoice, std::optional<double> preimage_revealed_at): payment_hash(payment_hash), payment_preimage(payment_preimage), invoice(invoice), preimage_revealed_at(preimage_revealed_at) {}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
} // namespace margelo::nitro::nitroark
|
|
44
|
+
|
|
45
|
+
namespace margelo::nitro {
|
|
46
|
+
|
|
47
|
+
// C++ LightningReceive <> JS LightningReceive (object)
|
|
48
|
+
template <>
|
|
49
|
+
struct JSIConverter<margelo::nitro::nitroark::LightningReceive> final {
|
|
50
|
+
static inline margelo::nitro::nitroark::LightningReceive fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
51
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
52
|
+
return margelo::nitro::nitroark::LightningReceive(
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "payment_hash")),
|
|
54
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "payment_preimage")),
|
|
55
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "invoice")),
|
|
56
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "preimage_revealed_at"))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::LightningReceive& arg) {
|
|
60
|
+
jsi::Object obj(runtime);
|
|
61
|
+
obj.setProperty(runtime, "payment_hash", JSIConverter<std::string>::toJSI(runtime, arg.payment_hash));
|
|
62
|
+
obj.setProperty(runtime, "payment_preimage", JSIConverter<std::string>::toJSI(runtime, arg.payment_preimage));
|
|
63
|
+
obj.setProperty(runtime, "invoice", JSIConverter<std::string>::toJSI(runtime, arg.invoice));
|
|
64
|
+
obj.setProperty(runtime, "preimage_revealed_at", JSIConverter<std::optional<double>>::toJSI(runtime, arg.preimage_revealed_at));
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
68
|
+
if (!value.isObject()) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
jsi::Object obj = value.getObject(runtime);
|
|
72
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "payment_hash"))) return false;
|
|
73
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "payment_preimage"))) return false;
|
|
74
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "invoice"))) return false;
|
|
75
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "preimage_revealed_at"))) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -31,11 +31,12 @@ namespace margelo::nitro::nitroark {
|
|
|
31
31
|
public:
|
|
32
32
|
double spendable SWIFT_PRIVATE;
|
|
33
33
|
double pending_lightning_send SWIFT_PRIVATE;
|
|
34
|
+
double pending_in_round SWIFT_PRIVATE;
|
|
34
35
|
double pending_exit SWIFT_PRIVATE;
|
|
35
36
|
|
|
36
37
|
public:
|
|
37
38
|
OffchainBalanceResult() = default;
|
|
38
|
-
explicit OffchainBalanceResult(double spendable, double pending_lightning_send, double pending_exit): spendable(spendable), pending_lightning_send(pending_lightning_send), pending_exit(pending_exit) {}
|
|
39
|
+
explicit OffchainBalanceResult(double spendable, double pending_lightning_send, double pending_in_round, double pending_exit): spendable(spendable), pending_lightning_send(pending_lightning_send), pending_in_round(pending_in_round), pending_exit(pending_exit) {}
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
} // namespace margelo::nitro::nitroark
|
|
@@ -50,6 +51,7 @@ namespace margelo::nitro {
|
|
|
50
51
|
return margelo::nitro::nitroark::OffchainBalanceResult(
|
|
51
52
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "spendable")),
|
|
52
53
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_lightning_send")),
|
|
54
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_in_round")),
|
|
53
55
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_exit"))
|
|
54
56
|
);
|
|
55
57
|
}
|
|
@@ -57,6 +59,7 @@ namespace margelo::nitro {
|
|
|
57
59
|
jsi::Object obj(runtime);
|
|
58
60
|
obj.setProperty(runtime, "spendable", JSIConverter<double>::toJSI(runtime, arg.spendable));
|
|
59
61
|
obj.setProperty(runtime, "pending_lightning_send", JSIConverter<double>::toJSI(runtime, arg.pending_lightning_send));
|
|
62
|
+
obj.setProperty(runtime, "pending_in_round", JSIConverter<double>::toJSI(runtime, arg.pending_in_round));
|
|
60
63
|
obj.setProperty(runtime, "pending_exit", JSIConverter<double>::toJSI(runtime, arg.pending_exit));
|
|
61
64
|
return obj;
|
|
62
65
|
}
|
|
@@ -67,6 +70,7 @@ namespace margelo::nitro {
|
|
|
67
70
|
jsi::Object obj = value.getObject(runtime);
|
|
68
71
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "spendable"))) return false;
|
|
69
72
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_lightning_send"))) return false;
|
|
73
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_in_round"))) return false;
|
|
70
74
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_exit"))) return false;
|
|
71
75
|
return true;
|
|
72
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nitro-ark",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"description": "Pure C++ Nitro Modules for Ark client",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"eslint-config-prettier": "^10.1.1",
|
|
83
83
|
"eslint-plugin-prettier": "^5.2.3",
|
|
84
84
|
"jest": "^29.7.0",
|
|
85
|
-
"nitro-codegen": "^0.
|
|
85
|
+
"nitro-codegen": "^0.29.3",
|
|
86
86
|
"prettier": "^3.0.3",
|
|
87
87
|
"react": "19.0.0",
|
|
88
88
|
"react-native": "0.79.5",
|
|
89
89
|
"react-native-builder-bob": "^0.40.13",
|
|
90
|
-
"react-native-nitro-modules": "^0.
|
|
90
|
+
"react-native-nitro-modules": "^0.29.3",
|
|
91
91
|
"release-it": "^17.10.0",
|
|
92
92
|
"turbo": "^1.10.7",
|
|
93
93
|
"typescript": "^5.2.2"
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"react": "*",
|
|
97
97
|
"react-native": "*",
|
|
98
|
-
"react-native-nitro-modules": "^0.
|
|
98
|
+
"react-native-nitro-modules": "^0.29.3"
|
|
99
99
|
},
|
|
100
100
|
"workspaces": [
|
|
101
101
|
"example"
|