react-native-nitro-ark 0.0.93 → 0.0.94
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/android/src/main/jniLibs/arm64-v8a/libcxxbridge1.a +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libcxxbridge1.a +0 -0
- package/android/src/main/jniLibs/x86_64/libcxxbridge1.a +0 -0
- package/cpp/NitroArk.hpp +34 -0
- package/cpp/generated/ark_cxx.h +21 -0
- package/lib/module/index.js +17 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +11 -0
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +14 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/BarkArkInfo.hpp +14 -2
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/MailboxAuthorizationResult.hpp +91 -0
- package/nitrogen/generated/shared/c++/OffchainBalanceResult.hpp +5 -1
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +15 -1
- package/src/index.tsx +24 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cpp/NitroArk.hpp
CHANGED
|
@@ -249,6 +249,7 @@ public:
|
|
|
249
249
|
BarkArkInfo info;
|
|
250
250
|
info.network = std::string(rust_info.network.data(), rust_info.network.length());
|
|
251
251
|
info.server_pubkey = std::string(rust_info.server_pubkey.data(), rust_info.server_pubkey.length());
|
|
252
|
+
info.mailbox_pubkey = std::string(rust_info.mailbox_pubkey.data(), rust_info.mailbox_pubkey.length());
|
|
252
253
|
info.round_interval = static_cast<double>(rust_info.round_interval);
|
|
253
254
|
info.nb_round_nonces = static_cast<double>(rust_info.nb_round_nonces);
|
|
254
255
|
info.vtxo_exit_delta = static_cast<double>(rust_info.vtxo_exit_delta);
|
|
@@ -256,6 +257,8 @@ public:
|
|
|
256
257
|
info.htlc_send_expiry_delta = static_cast<double>(rust_info.htlc_send_expiry_delta);
|
|
257
258
|
info.max_vtxo_amount = static_cast<double>(rust_info.max_vtxo_amount);
|
|
258
259
|
info.required_board_confirmations = static_cast<double>(rust_info.required_board_confirmations);
|
|
260
|
+
info.min_board_amount = static_cast<double>(rust_info.min_board_amount);
|
|
261
|
+
info.ln_receive_anti_dos_required = rust_info.ln_receive_anti_dos_required;
|
|
259
262
|
return info;
|
|
260
263
|
} catch (const rust::Error& e) {
|
|
261
264
|
throw std::runtime_error(e.what());
|
|
@@ -270,6 +273,7 @@ public:
|
|
|
270
273
|
OffchainBalanceResult balance;
|
|
271
274
|
balance.spendable = static_cast<double>(rust_balance.spendable);
|
|
272
275
|
balance.pending_lightning_send = static_cast<double>(rust_balance.pending_lightning_send);
|
|
276
|
+
balance.claimable_lightning_receive = static_cast<double>(rust_balance.claimable_lightning_receive);
|
|
273
277
|
balance.pending_in_round = static_cast<double>(rust_balance.pending_in_round);
|
|
274
278
|
balance.pending_exit = static_cast<double>(rust_balance.pending_exit);
|
|
275
279
|
balance.pending_board = static_cast<double>(rust_balance.pending_board);
|
|
@@ -395,6 +399,36 @@ public:
|
|
|
395
399
|
});
|
|
396
400
|
}
|
|
397
401
|
|
|
402
|
+
std::shared_ptr<Promise<KeyPairResult>> mailboxKeypair() override {
|
|
403
|
+
return Promise<KeyPairResult>::async([]() {
|
|
404
|
+
try {
|
|
405
|
+
bark_cxx::KeyPairResult keypair_rs = bark_cxx::mailbox_keypair();
|
|
406
|
+
KeyPairResult keypair;
|
|
407
|
+
keypair.public_key = std::string(keypair_rs.public_key.data(), keypair_rs.public_key.length());
|
|
408
|
+
keypair.secret_key = std::string(keypair_rs.secret_key.data(), keypair_rs.secret_key.length());
|
|
409
|
+
return keypair;
|
|
410
|
+
} catch (const rust::Error& e) {
|
|
411
|
+
throw std::runtime_error(e.what());
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
std::shared_ptr<Promise<MailboxAuthorizationResult>> mailboxAuthorization(double authorizationExpiry) override {
|
|
417
|
+
return Promise<MailboxAuthorizationResult>::async([authorizationExpiry]() {
|
|
418
|
+
try {
|
|
419
|
+
int64_t expiry_val = static_cast<int64_t>(authorizationExpiry);
|
|
420
|
+
bark_cxx::MailboxAuthorizationResult auth_rs = bark_cxx::mailbox_authorization(expiry_val);
|
|
421
|
+
MailboxAuthorizationResult result;
|
|
422
|
+
result.mailbox_id = std::string(auth_rs.mailbox_id.data(), auth_rs.mailbox_id.length());
|
|
423
|
+
result.expiry = static_cast<double>(auth_rs.expiry);
|
|
424
|
+
result.encoded = std::string(auth_rs.encoded.data(), auth_rs.encoded.length());
|
|
425
|
+
return result;
|
|
426
|
+
} catch (const rust::Error& e) {
|
|
427
|
+
throw std::runtime_error(e.what());
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
398
432
|
std::shared_ptr<Promise<std::vector<BarkMovement>>> history() override {
|
|
399
433
|
return Promise<std::vector<BarkMovement>>::async([]() {
|
|
400
434
|
try {
|
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -818,6 +818,7 @@ namespace bark_cxx {
|
|
|
818
818
|
struct OffchainBalance;
|
|
819
819
|
struct OnChainBalance;
|
|
820
820
|
struct KeyPairResult;
|
|
821
|
+
struct MailboxAuthorizationResult;
|
|
821
822
|
struct BarkMovementDestination;
|
|
822
823
|
struct BarkMovement;
|
|
823
824
|
struct RoundStatus;
|
|
@@ -912,6 +913,7 @@ struct OnchainPaymentResult final {
|
|
|
912
913
|
struct CxxArkInfo final {
|
|
913
914
|
::rust::String network;
|
|
914
915
|
::rust::String server_pubkey;
|
|
916
|
+
::rust::String mailbox_pubkey;
|
|
915
917
|
::std::uint64_t round_interval CXX_DEFAULT_VALUE(0);
|
|
916
918
|
::std::uint16_t nb_round_nonces CXX_DEFAULT_VALUE(0);
|
|
917
919
|
::std::uint16_t vtxo_exit_delta CXX_DEFAULT_VALUE(0);
|
|
@@ -919,6 +921,8 @@ struct CxxArkInfo final {
|
|
|
919
921
|
::std::uint16_t htlc_send_expiry_delta CXX_DEFAULT_VALUE(0);
|
|
920
922
|
::std::uint64_t max_vtxo_amount CXX_DEFAULT_VALUE(0);
|
|
921
923
|
::std::uint8_t required_board_confirmations CXX_DEFAULT_VALUE(0);
|
|
924
|
+
::std::uint64_t min_board_amount CXX_DEFAULT_VALUE(0);
|
|
925
|
+
bool ln_receive_anti_dos_required CXX_DEFAULT_VALUE(false);
|
|
922
926
|
|
|
923
927
|
using IsRelocatable = ::std::true_type;
|
|
924
928
|
};
|
|
@@ -999,6 +1003,8 @@ struct OffchainBalance final {
|
|
|
999
1003
|
::std::uint64_t spendable CXX_DEFAULT_VALUE(0);
|
|
1000
1004
|
// Coins that are in the process of being sent over Lightning.
|
|
1001
1005
|
::std::uint64_t pending_lightning_send CXX_DEFAULT_VALUE(0);
|
|
1006
|
+
// Coins that are in the process of being received over Lightning.
|
|
1007
|
+
::std::uint64_t claimable_lightning_receive CXX_DEFAULT_VALUE(0);
|
|
1002
1008
|
// Coins locked in a round.
|
|
1003
1009
|
::std::uint64_t pending_in_round CXX_DEFAULT_VALUE(0);
|
|
1004
1010
|
// Coins that are in the process of unilaterally exiting the Ark.
|
|
@@ -1036,6 +1042,17 @@ struct KeyPairResult final {
|
|
|
1036
1042
|
};
|
|
1037
1043
|
#endif // CXXBRIDGE1_STRUCT_bark_cxx$KeyPairResult
|
|
1038
1044
|
|
|
1045
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$MailboxAuthorizationResult
|
|
1046
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$MailboxAuthorizationResult
|
|
1047
|
+
struct MailboxAuthorizationResult final {
|
|
1048
|
+
::rust::String mailbox_id;
|
|
1049
|
+
::std::int64_t expiry CXX_DEFAULT_VALUE(0);
|
|
1050
|
+
::rust::String encoded;
|
|
1051
|
+
|
|
1052
|
+
using IsRelocatable = ::std::true_type;
|
|
1053
|
+
};
|
|
1054
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$MailboxAuthorizationResult
|
|
1055
|
+
|
|
1039
1056
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$BarkMovementDestination
|
|
1040
1057
|
#define CXXBRIDGE1_STRUCT_bark_cxx$BarkMovementDestination
|
|
1041
1058
|
struct BarkMovementDestination final {
|
|
@@ -1177,6 +1194,10 @@ void sync_exits();
|
|
|
1177
1194
|
|
|
1178
1195
|
void sync_pending_rounds();
|
|
1179
1196
|
|
|
1197
|
+
::bark_cxx::KeyPairResult mailbox_keypair();
|
|
1198
|
+
|
|
1199
|
+
::bark_cxx::MailboxAuthorizationResult mailbox_authorization(::std::int64_t authorization_expiry);
|
|
1200
|
+
|
|
1180
1201
|
::bark_cxx::OnChainBalance onchain_balance();
|
|
1181
1202
|
|
|
1182
1203
|
void onchain_sync();
|
package/lib/module/index.js
CHANGED
|
@@ -232,6 +232,23 @@ export function verifyMessage(message, signature, publicKey) {
|
|
|
232
232
|
return NitroArkHybridObject.verifyMessage(message, signature, publicKey);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Gets the mailbox keypair for the loaded wallet.
|
|
237
|
+
* @returns A promise resolving to a KeyPairResult object.
|
|
238
|
+
*/
|
|
239
|
+
export function mailboxKeypair() {
|
|
240
|
+
return NitroArkHybridObject.mailboxKeypair();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Gets a mailbox authorization for the loaded wallet.
|
|
245
|
+
* @param authorizationExpiry Unix timestamp (seconds) for when the authorization expires.
|
|
246
|
+
* @returns A promise resolving to a MailboxAuthorizationResult object.
|
|
247
|
+
*/
|
|
248
|
+
export function mailboxAuthorization(authorizationExpiry) {
|
|
249
|
+
return NitroArkHybridObject.mailboxAuthorization(authorizationExpiry);
|
|
250
|
+
}
|
|
251
|
+
|
|
235
252
|
/**
|
|
236
253
|
* Gets a paginated list of wallet history (balance changes).
|
|
237
254
|
* @returns A promise resolving to an array of BarkMovement objects.
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","config","closeWallet","refreshServer","isWalletLoaded","syncPendingBoards","maintenance","maintenanceWithOnchain","maintenanceDelegated","maintenanceWithOnchainDelegated","maintenanceRefresh","sync","syncExits","syncPendingRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","peakAddress","newAddress","signMessage","message","signMesssageWithMnemonic","mnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","history","vtxos","getFirstExpiringVtxoBlockheight","getNextRequiredRefreshBlockheight","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","lightningReceiveStatus","paymentHash","checkLightningPayment","wait","tryClaimLightningReceive","token","tryClaimAllLightningReceives","payLightningInvoice","payLightningOffer","offer","payLightningAddress","addr","comment","boardAmount","boardAll","validateArkoorAddress","address","sendArkoorPayment","sendOnchain","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","config","closeWallet","refreshServer","isWalletLoaded","syncPendingBoards","maintenance","maintenanceWithOnchain","maintenanceDelegated","maintenanceWithOnchainDelegated","maintenanceRefresh","sync","syncExits","syncPendingRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","peakAddress","newAddress","signMessage","message","signMesssageWithMnemonic","mnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","mailboxKeypair","mailboxAuthorization","authorizationExpiry","history","vtxos","getFirstExpiringVtxoBlockheight","getNextRequiredRefreshBlockheight","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","lightningReceiveStatus","paymentHash","checkLightningPayment","wait","tryClaimLightningReceive","token","tryClaimAllLightningReceives","payLightningInvoice","payLightningOffer","offer","payLightningAddress","addr","comment","boardAmount","boardAll","validateArkoorAddress","address","sendArkoorPayment","sendOnchain","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAkDzD;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,CACxBF,OAAe,EACfG,MAAsB,EACP;EACf,OAAOP,oBAAoB,CAACM,UAAU,CAACF,OAAO,EAAEG,MAAM,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAAkB;EAC3C,OAAOR,oBAAoB,CAACQ,WAAW,CAAC,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAA,EAAkB;EAC7C,OAAOT,oBAAoB,CAACS,aAAa,CAAC,CAAC;AAC7C;;AAEA;AAC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SAASC,qBAAqBA,CAACC,OAAe,EAAiB;EACpE,OAAO1E,oBAAoB,CAACyE,qBAAqB,CAACC,OAAO,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BxB,WAAmB,EACnBC,SAAiB,EACa;EAC9B,OAAOpD,oBAAoB,CAAC2E,iBAAiB,CAACxB,WAAW,EAAEC,SAAS,CAAC;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASwB,WAAWA,CACzBzB,WAAmB,EACnBC,SAAiB,EACA;EACjB,OAAOpD,oBAAoB,CAAC4E,WAAW,CAACzB,WAAW,EAAEC,SAAS,CAAC;AACjE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyB,gBAAgBA,CAC9BC,OAAiB,EACjBC,kBAA0B,EACT;EACjB,OAAO/E,oBAAoB,CAAC6E,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAO/E,oBAAoB,CAACgF,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA","ignoreList":[]}
|
|
@@ -23,6 +23,7 @@ export interface BarkCreateOpts {
|
|
|
23
23
|
export interface BarkArkInfo {
|
|
24
24
|
network: string;
|
|
25
25
|
server_pubkey: string;
|
|
26
|
+
mailbox_pubkey: string;
|
|
26
27
|
round_interval: number;
|
|
27
28
|
nb_round_nonces: number;
|
|
28
29
|
vtxo_exit_delta: number;
|
|
@@ -30,6 +31,8 @@ export interface BarkArkInfo {
|
|
|
30
31
|
htlc_send_expiry_delta: number;
|
|
31
32
|
max_vtxo_amount: number;
|
|
32
33
|
required_board_confirmations: number;
|
|
34
|
+
min_board_amount: number;
|
|
35
|
+
ln_receive_anti_dos_required: boolean;
|
|
33
36
|
}
|
|
34
37
|
export interface BarkSendManyOutput {
|
|
35
38
|
destination: string;
|
|
@@ -74,6 +77,7 @@ export interface OnchainPaymentResult {
|
|
|
74
77
|
export interface OffchainBalanceResult {
|
|
75
78
|
spendable: number;
|
|
76
79
|
pending_lightning_send: number;
|
|
80
|
+
claimable_lightning_receive: number;
|
|
77
81
|
pending_in_round: number;
|
|
78
82
|
pending_exit: number;
|
|
79
83
|
pending_board: number;
|
|
@@ -93,6 +97,11 @@ export interface KeyPairResult {
|
|
|
93
97
|
public_key: string;
|
|
94
98
|
secret_key: string;
|
|
95
99
|
}
|
|
100
|
+
export interface MailboxAuthorizationResult {
|
|
101
|
+
mailbox_id: string;
|
|
102
|
+
expiry: number;
|
|
103
|
+
encoded: string;
|
|
104
|
+
}
|
|
96
105
|
export interface LightningReceive {
|
|
97
106
|
payment_hash: string;
|
|
98
107
|
payment_preimage: string;
|
|
@@ -155,6 +164,8 @@ export interface NitroArk extends HybridObject<{
|
|
|
155
164
|
signMesssageWithMnemonic(message: string, mnemonic: string, network: string, index: number): Promise<string>;
|
|
156
165
|
deriveKeypairFromMnemonic(mnemonic: string, network: string, index: number): Promise<KeyPairResult>;
|
|
157
166
|
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
167
|
+
mailboxKeypair(): Promise<KeyPairResult>;
|
|
168
|
+
mailboxAuthorization(authorizationExpiry: number): Promise<MailboxAuthorizationResult>;
|
|
158
169
|
history(): Promise<BarkMovement[]>;
|
|
159
170
|
vtxos(): Promise<BarkVtxo[]>;
|
|
160
171
|
getFirstExpiringVtxoBlockheight(): Promise<number | undefined>;
|
|
@@ -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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,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7B,4BAA4B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG3D,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, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, LightningSendResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, BarkMovement as NitroBarkMovement, BarkMovementDestination as NitroBarkMovementDestination, BoardResult } from './NitroArk.nitro';
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, LightningSendResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, MailboxAuthorizationResult, LightningReceive, BarkMovement as NitroBarkMovement, BarkMovementDestination as NitroBarkMovementDestination, BoardResult } from './NitroArk.nitro';
|
|
2
2
|
export type BarkVtxo = {
|
|
3
3
|
amount: number;
|
|
4
4
|
expiry_height: number;
|
|
@@ -6,9 +6,9 @@ export type BarkVtxo = {
|
|
|
6
6
|
exit_delta: number;
|
|
7
7
|
anchor_point: string;
|
|
8
8
|
point: string;
|
|
9
|
-
state: 'Spendable' | 'Spent' | 'Locked'
|
|
9
|
+
state: 'Spendable' | 'Spent' | 'Locked';
|
|
10
10
|
};
|
|
11
|
-
export type MovementStatus = 'pending' | '
|
|
11
|
+
export type MovementStatus = 'pending' | 'successful' | 'failed' | 'cancelled';
|
|
12
12
|
export type BarkMovementDestination = NitroBarkMovementDestination & {
|
|
13
13
|
payment_method: 'ark' | 'bitcoin' | 'output-script' | 'invoice' | 'offer' | 'lightning-address' | 'custom';
|
|
14
14
|
};
|
|
@@ -166,6 +166,17 @@ export declare function deriveKeypairFromMnemonic(mnemonic: string, network: str
|
|
|
166
166
|
* @returns A promise resolving to true if the signature is valid, false otherwise.
|
|
167
167
|
*/
|
|
168
168
|
export declare function verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
169
|
+
/**
|
|
170
|
+
* Gets the mailbox keypair for the loaded wallet.
|
|
171
|
+
* @returns A promise resolving to a KeyPairResult object.
|
|
172
|
+
*/
|
|
173
|
+
export declare function mailboxKeypair(): Promise<KeyPairResult>;
|
|
174
|
+
/**
|
|
175
|
+
* Gets a mailbox authorization for the loaded wallet.
|
|
176
|
+
* @param authorizationExpiry Unix timestamp (seconds) for when the authorization expires.
|
|
177
|
+
* @returns A promise resolving to a MailboxAuthorizationResult object.
|
|
178
|
+
*/
|
|
179
|
+
export declare function mailboxAuthorization(authorizationExpiry: number): Promise<MailboxAuthorizationResult>;
|
|
169
180
|
/**
|
|
170
181
|
* Gets a paginated list of wallet history (balance changes).
|
|
171
182
|
* @returns A promise resolving to an array of BarkMovement objects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,YAAY,IAAI,iBAAiB,EACjC,uBAAuB,IAAI,4BAA4B,EACvD,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAA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AAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAE9B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvE;AAGD,YAAY,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -41,6 +41,7 @@ namespace margelo::nitro::nitroark {
|
|
|
41
41
|
public:
|
|
42
42
|
std::string network SWIFT_PRIVATE;
|
|
43
43
|
std::string server_pubkey SWIFT_PRIVATE;
|
|
44
|
+
std::string mailbox_pubkey SWIFT_PRIVATE;
|
|
44
45
|
double round_interval SWIFT_PRIVATE;
|
|
45
46
|
double nb_round_nonces SWIFT_PRIVATE;
|
|
46
47
|
double vtxo_exit_delta SWIFT_PRIVATE;
|
|
@@ -48,10 +49,12 @@ namespace margelo::nitro::nitroark {
|
|
|
48
49
|
double htlc_send_expiry_delta SWIFT_PRIVATE;
|
|
49
50
|
double max_vtxo_amount SWIFT_PRIVATE;
|
|
50
51
|
double required_board_confirmations SWIFT_PRIVATE;
|
|
52
|
+
double min_board_amount SWIFT_PRIVATE;
|
|
53
|
+
bool ln_receive_anti_dos_required SWIFT_PRIVATE;
|
|
51
54
|
|
|
52
55
|
public:
|
|
53
56
|
BarkArkInfo() = default;
|
|
54
|
-
explicit BarkArkInfo(std::string network, std::string server_pubkey, double round_interval, double nb_round_nonces, double vtxo_exit_delta, double vtxo_expiry_delta, double htlc_send_expiry_delta, double max_vtxo_amount, double required_board_confirmations): network(network), server_pubkey(server_pubkey), round_interval(round_interval), nb_round_nonces(nb_round_nonces), vtxo_exit_delta(vtxo_exit_delta), vtxo_expiry_delta(vtxo_expiry_delta), htlc_send_expiry_delta(htlc_send_expiry_delta), max_vtxo_amount(max_vtxo_amount), required_board_confirmations(required_board_confirmations) {}
|
|
57
|
+
explicit BarkArkInfo(std::string network, std::string server_pubkey, std::string mailbox_pubkey, double round_interval, double nb_round_nonces, double vtxo_exit_delta, double vtxo_expiry_delta, double htlc_send_expiry_delta, double max_vtxo_amount, double required_board_confirmations, double min_board_amount, bool ln_receive_anti_dos_required): network(network), server_pubkey(server_pubkey), mailbox_pubkey(mailbox_pubkey), round_interval(round_interval), nb_round_nonces(nb_round_nonces), vtxo_exit_delta(vtxo_exit_delta), vtxo_expiry_delta(vtxo_expiry_delta), htlc_send_expiry_delta(htlc_send_expiry_delta), max_vtxo_amount(max_vtxo_amount), required_board_confirmations(required_board_confirmations), min_board_amount(min_board_amount), ln_receive_anti_dos_required(ln_receive_anti_dos_required) {}
|
|
55
58
|
|
|
56
59
|
public:
|
|
57
60
|
friend bool operator==(const BarkArkInfo& lhs, const BarkArkInfo& rhs) = default;
|
|
@@ -69,19 +72,23 @@ namespace margelo::nitro {
|
|
|
69
72
|
return margelo::nitro::nitroark::BarkArkInfo(
|
|
70
73
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "network"))),
|
|
71
74
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "server_pubkey"))),
|
|
75
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox_pubkey"))),
|
|
72
76
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "round_interval"))),
|
|
73
77
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nb_round_nonces"))),
|
|
74
78
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "vtxo_exit_delta"))),
|
|
75
79
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "vtxo_expiry_delta"))),
|
|
76
80
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "htlc_send_expiry_delta"))),
|
|
77
81
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "max_vtxo_amount"))),
|
|
78
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "required_board_confirmations")))
|
|
82
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "required_board_confirmations"))),
|
|
83
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "min_board_amount"))),
|
|
84
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ln_receive_anti_dos_required")))
|
|
79
85
|
);
|
|
80
86
|
}
|
|
81
87
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkArkInfo& arg) {
|
|
82
88
|
jsi::Object obj(runtime);
|
|
83
89
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "network"), JSIConverter<std::string>::toJSI(runtime, arg.network));
|
|
84
90
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "server_pubkey"), JSIConverter<std::string>::toJSI(runtime, arg.server_pubkey));
|
|
91
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mailbox_pubkey"), JSIConverter<std::string>::toJSI(runtime, arg.mailbox_pubkey));
|
|
85
92
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "round_interval"), JSIConverter<double>::toJSI(runtime, arg.round_interval));
|
|
86
93
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "nb_round_nonces"), JSIConverter<double>::toJSI(runtime, arg.nb_round_nonces));
|
|
87
94
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "vtxo_exit_delta"), JSIConverter<double>::toJSI(runtime, arg.vtxo_exit_delta));
|
|
@@ -89,6 +96,8 @@ namespace margelo::nitro {
|
|
|
89
96
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "htlc_send_expiry_delta"), JSIConverter<double>::toJSI(runtime, arg.htlc_send_expiry_delta));
|
|
90
97
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "max_vtxo_amount"), JSIConverter<double>::toJSI(runtime, arg.max_vtxo_amount));
|
|
91
98
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "required_board_confirmations"), JSIConverter<double>::toJSI(runtime, arg.required_board_confirmations));
|
|
99
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "min_board_amount"), JSIConverter<double>::toJSI(runtime, arg.min_board_amount));
|
|
100
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "ln_receive_anti_dos_required"), JSIConverter<bool>::toJSI(runtime, arg.ln_receive_anti_dos_required));
|
|
92
101
|
return obj;
|
|
93
102
|
}
|
|
94
103
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -101,6 +110,7 @@ namespace margelo::nitro {
|
|
|
101
110
|
}
|
|
102
111
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "network")))) return false;
|
|
103
112
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "server_pubkey")))) return false;
|
|
113
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox_pubkey")))) return false;
|
|
104
114
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "round_interval")))) return false;
|
|
105
115
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nb_round_nonces")))) return false;
|
|
106
116
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "vtxo_exit_delta")))) return false;
|
|
@@ -108,6 +118,8 @@ namespace margelo::nitro {
|
|
|
108
118
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "htlc_send_expiry_delta")))) return false;
|
|
109
119
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "max_vtxo_amount")))) return false;
|
|
110
120
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "required_board_confirmations")))) return false;
|
|
121
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "min_board_amount")))) return false;
|
|
122
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ln_receive_anti_dos_required")))) return false;
|
|
111
123
|
return true;
|
|
112
124
|
}
|
|
113
125
|
};
|
|
@@ -39,6 +39,8 @@ namespace margelo::nitro::nitroark {
|
|
|
39
39
|
prototype.registerHybridMethod("signMesssageWithMnemonic", &HybridNitroArkSpec::signMesssageWithMnemonic);
|
|
40
40
|
prototype.registerHybridMethod("deriveKeypairFromMnemonic", &HybridNitroArkSpec::deriveKeypairFromMnemonic);
|
|
41
41
|
prototype.registerHybridMethod("verifyMessage", &HybridNitroArkSpec::verifyMessage);
|
|
42
|
+
prototype.registerHybridMethod("mailboxKeypair", &HybridNitroArkSpec::mailboxKeypair);
|
|
43
|
+
prototype.registerHybridMethod("mailboxAuthorization", &HybridNitroArkSpec::mailboxAuthorization);
|
|
42
44
|
prototype.registerHybridMethod("history", &HybridNitroArkSpec::history);
|
|
43
45
|
prototype.registerHybridMethod("vtxos", &HybridNitroArkSpec::vtxos);
|
|
44
46
|
prototype.registerHybridMethod("getFirstExpiringVtxoBlockheight", &HybridNitroArkSpec::getFirstExpiringVtxoBlockheight);
|
|
@@ -23,6 +23,8 @@ namespace margelo::nitro::nitroark { struct OffchainBalanceResult; }
|
|
|
23
23
|
namespace margelo::nitro::nitroark { struct KeyPairResult; }
|
|
24
24
|
// Forward declaration of `NewAddressResult` to properly resolve imports.
|
|
25
25
|
namespace margelo::nitro::nitroark { struct NewAddressResult; }
|
|
26
|
+
// Forward declaration of `MailboxAuthorizationResult` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitroark { struct MailboxAuthorizationResult; }
|
|
26
28
|
// Forward declaration of `BarkMovement` to properly resolve imports.
|
|
27
29
|
namespace margelo::nitro::nitroark { struct BarkMovement; }
|
|
28
30
|
// Forward declaration of `BarkVtxo` to properly resolve imports.
|
|
@@ -51,6 +53,7 @@ namespace margelo::nitro::nitroark { struct LightningReceive; }
|
|
|
51
53
|
#include "OffchainBalanceResult.hpp"
|
|
52
54
|
#include "KeyPairResult.hpp"
|
|
53
55
|
#include "NewAddressResult.hpp"
|
|
56
|
+
#include "MailboxAuthorizationResult.hpp"
|
|
54
57
|
#include "BarkMovement.hpp"
|
|
55
58
|
#include <vector>
|
|
56
59
|
#include "BarkVtxo.hpp"
|
|
@@ -122,6 +125,8 @@ namespace margelo::nitro::nitroark {
|
|
|
122
125
|
virtual std::shared_ptr<Promise<std::string>> signMesssageWithMnemonic(const std::string& message, const std::string& mnemonic, const std::string& network, double index) = 0;
|
|
123
126
|
virtual std::shared_ptr<Promise<KeyPairResult>> deriveKeypairFromMnemonic(const std::string& mnemonic, const std::string& network, double index) = 0;
|
|
124
127
|
virtual std::shared_ptr<Promise<bool>> verifyMessage(const std::string& message, const std::string& signature, const std::string& publicKey) = 0;
|
|
128
|
+
virtual std::shared_ptr<Promise<KeyPairResult>> mailboxKeypair() = 0;
|
|
129
|
+
virtual std::shared_ptr<Promise<MailboxAuthorizationResult>> mailboxAuthorization(double authorizationExpiry) = 0;
|
|
125
130
|
virtual std::shared_ptr<Promise<std::vector<BarkMovement>>> history() = 0;
|
|
126
131
|
virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> vtxos() = 0;
|
|
127
132
|
virtual std::shared_ptr<Promise<std::optional<double>>> getFirstExpiringVtxoBlockheight() = 0;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MailboxAuthorizationResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 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
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::nitroark {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (MailboxAuthorizationResult).
|
|
39
|
+
*/
|
|
40
|
+
struct MailboxAuthorizationResult final {
|
|
41
|
+
public:
|
|
42
|
+
std::string mailbox_id SWIFT_PRIVATE;
|
|
43
|
+
double expiry SWIFT_PRIVATE;
|
|
44
|
+
std::string encoded SWIFT_PRIVATE;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
MailboxAuthorizationResult() = default;
|
|
48
|
+
explicit MailboxAuthorizationResult(std::string mailbox_id, double expiry, std::string encoded): mailbox_id(mailbox_id), expiry(expiry), encoded(encoded) {}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
friend bool operator==(const MailboxAuthorizationResult& lhs, const MailboxAuthorizationResult& rhs) = default;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
} // namespace margelo::nitro::nitroark
|
|
55
|
+
|
|
56
|
+
namespace margelo::nitro {
|
|
57
|
+
|
|
58
|
+
// C++ MailboxAuthorizationResult <> JS MailboxAuthorizationResult (object)
|
|
59
|
+
template <>
|
|
60
|
+
struct JSIConverter<margelo::nitro::nitroark::MailboxAuthorizationResult> final {
|
|
61
|
+
static inline margelo::nitro::nitroark::MailboxAuthorizationResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
62
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
63
|
+
return margelo::nitro::nitroark::MailboxAuthorizationResult(
|
|
64
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox_id"))),
|
|
65
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expiry"))),
|
|
66
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encoded")))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::MailboxAuthorizationResult& arg) {
|
|
70
|
+
jsi::Object obj(runtime);
|
|
71
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mailbox_id"), JSIConverter<std::string>::toJSI(runtime, arg.mailbox_id));
|
|
72
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "expiry"), JSIConverter<double>::toJSI(runtime, arg.expiry));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "encoded"), JSIConverter<std::string>::toJSI(runtime, arg.encoded));
|
|
74
|
+
return obj;
|
|
75
|
+
}
|
|
76
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
77
|
+
if (!value.isObject()) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
jsi::Object obj = value.getObject(runtime);
|
|
81
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox_id")))) return false;
|
|
85
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expiry")))) return false;
|
|
86
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encoded")))) return false;
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
} // namespace margelo::nitro
|
|
@@ -41,13 +41,14 @@ namespace margelo::nitro::nitroark {
|
|
|
41
41
|
public:
|
|
42
42
|
double spendable SWIFT_PRIVATE;
|
|
43
43
|
double pending_lightning_send SWIFT_PRIVATE;
|
|
44
|
+
double claimable_lightning_receive SWIFT_PRIVATE;
|
|
44
45
|
double pending_in_round SWIFT_PRIVATE;
|
|
45
46
|
double pending_exit SWIFT_PRIVATE;
|
|
46
47
|
double pending_board SWIFT_PRIVATE;
|
|
47
48
|
|
|
48
49
|
public:
|
|
49
50
|
OffchainBalanceResult() = default;
|
|
50
|
-
explicit OffchainBalanceResult(double spendable, double pending_lightning_send, double pending_in_round, double pending_exit, double pending_board): spendable(spendable), pending_lightning_send(pending_lightning_send), pending_in_round(pending_in_round), pending_exit(pending_exit), pending_board(pending_board) {}
|
|
51
|
+
explicit OffchainBalanceResult(double spendable, double pending_lightning_send, double claimable_lightning_receive, double pending_in_round, double pending_exit, double pending_board): spendable(spendable), pending_lightning_send(pending_lightning_send), claimable_lightning_receive(claimable_lightning_receive), pending_in_round(pending_in_round), pending_exit(pending_exit), pending_board(pending_board) {}
|
|
51
52
|
|
|
52
53
|
public:
|
|
53
54
|
friend bool operator==(const OffchainBalanceResult& lhs, const OffchainBalanceResult& rhs) = default;
|
|
@@ -65,6 +66,7 @@ namespace margelo::nitro {
|
|
|
65
66
|
return margelo::nitro::nitroark::OffchainBalanceResult(
|
|
66
67
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "spendable"))),
|
|
67
68
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_lightning_send"))),
|
|
69
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "claimable_lightning_receive"))),
|
|
68
70
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_in_round"))),
|
|
69
71
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_exit"))),
|
|
70
72
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_board")))
|
|
@@ -74,6 +76,7 @@ namespace margelo::nitro {
|
|
|
74
76
|
jsi::Object obj(runtime);
|
|
75
77
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "spendable"), JSIConverter<double>::toJSI(runtime, arg.spendable));
|
|
76
78
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_lightning_send"), JSIConverter<double>::toJSI(runtime, arg.pending_lightning_send));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "claimable_lightning_receive"), JSIConverter<double>::toJSI(runtime, arg.claimable_lightning_receive));
|
|
77
80
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_in_round"), JSIConverter<double>::toJSI(runtime, arg.pending_in_round));
|
|
78
81
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_exit"), JSIConverter<double>::toJSI(runtime, arg.pending_exit));
|
|
79
82
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_board"), JSIConverter<double>::toJSI(runtime, arg.pending_board));
|
|
@@ -89,6 +92,7 @@ namespace margelo::nitro {
|
|
|
89
92
|
}
|
|
90
93
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "spendable")))) return false;
|
|
91
94
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_lightning_send")))) return false;
|
|
95
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "claimable_lightning_receive")))) return false;
|
|
92
96
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_in_round")))) return false;
|
|
93
97
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_exit")))) return false;
|
|
94
98
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_board")))) return false;
|
package/package.json
CHANGED
package/src/NitroArk.nitro.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface BarkCreateOpts {
|
|
|
30
30
|
export interface BarkArkInfo {
|
|
31
31
|
network: string;
|
|
32
32
|
server_pubkey: string;
|
|
33
|
+
mailbox_pubkey: string;
|
|
33
34
|
round_interval: number; // u64
|
|
34
35
|
nb_round_nonces: number; // u16
|
|
35
36
|
vtxo_exit_delta: number; // u16
|
|
@@ -37,6 +38,8 @@ export interface BarkArkInfo {
|
|
|
37
38
|
htlc_send_expiry_delta: number; // u16
|
|
38
39
|
max_vtxo_amount: number; // u64
|
|
39
40
|
required_board_confirmations: number; // u8
|
|
41
|
+
min_board_amount: number; // u64
|
|
42
|
+
ln_receive_anti_dos_required: boolean;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
// Helper interface for sendManyOnchain
|
|
@@ -90,6 +93,7 @@ export interface OnchainPaymentResult {
|
|
|
90
93
|
export interface OffchainBalanceResult {
|
|
91
94
|
spendable: number; // u64
|
|
92
95
|
pending_lightning_send: number; // u64
|
|
96
|
+
claimable_lightning_receive: number; // u64
|
|
93
97
|
pending_in_round: number; // u64
|
|
94
98
|
pending_exit: number; // u64
|
|
95
99
|
pending_board: number; // u64
|
|
@@ -117,6 +121,12 @@ export interface KeyPairResult {
|
|
|
117
121
|
secret_key: string;
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
export interface MailboxAuthorizationResult {
|
|
125
|
+
mailbox_id: string;
|
|
126
|
+
expiry: number; // i64 unix timestamp
|
|
127
|
+
encoded: string; // hex-encoded full protocol encoding
|
|
128
|
+
}
|
|
129
|
+
|
|
120
130
|
export interface LightningReceive {
|
|
121
131
|
payment_hash: string;
|
|
122
132
|
payment_preimage: string;
|
|
@@ -138,7 +148,7 @@ export interface BarkMovementDestination {
|
|
|
138
148
|
|
|
139
149
|
export interface BarkMovement {
|
|
140
150
|
id: number;
|
|
141
|
-
status: string; // 'pending' | '
|
|
151
|
+
status: string; // 'pending' | 'successful' | 'failed' | 'cancelled'
|
|
142
152
|
subsystem: BarkMovementSubsystem;
|
|
143
153
|
metadata_json: string;
|
|
144
154
|
intended_balance_sat: number;
|
|
@@ -198,6 +208,10 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
198
208
|
signature: string,
|
|
199
209
|
publicKey: string
|
|
200
210
|
): Promise<boolean>;
|
|
211
|
+
mailboxKeypair(): Promise<KeyPairResult>;
|
|
212
|
+
mailboxAuthorization(
|
|
213
|
+
authorizationExpiry: number
|
|
214
|
+
): Promise<MailboxAuthorizationResult>;
|
|
201
215
|
history(): Promise<BarkMovement[]>;
|
|
202
216
|
vtxos(): Promise<BarkVtxo[]>;
|
|
203
217
|
getFirstExpiringVtxoBlockheight(): Promise<number | undefined>;
|
package/src/index.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
OnchainBalanceResult,
|
|
13
13
|
NewAddressResult,
|
|
14
14
|
KeyPairResult,
|
|
15
|
+
MailboxAuthorizationResult,
|
|
15
16
|
LightningReceive,
|
|
16
17
|
BarkMovement as NitroBarkMovement,
|
|
17
18
|
BarkMovementDestination as NitroBarkMovementDestination,
|
|
@@ -25,10 +26,10 @@ export type BarkVtxo = {
|
|
|
25
26
|
exit_delta: number; // u16
|
|
26
27
|
anchor_point: string;
|
|
27
28
|
point: string;
|
|
28
|
-
state: 'Spendable' | 'Spent' | 'Locked'
|
|
29
|
+
state: 'Spendable' | 'Spent' | 'Locked';
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
export type MovementStatus = 'pending' | '
|
|
32
|
+
export type MovementStatus = 'pending' | 'successful' | 'failed' | 'cancelled';
|
|
32
33
|
|
|
33
34
|
export type BarkMovementDestination = NitroBarkMovementDestination & {
|
|
34
35
|
payment_method:
|
|
@@ -307,6 +308,27 @@ export function verifyMessage(
|
|
|
307
308
|
return NitroArkHybridObject.verifyMessage(message, signature, publicKey);
|
|
308
309
|
}
|
|
309
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Gets the mailbox keypair for the loaded wallet.
|
|
313
|
+
* @returns A promise resolving to a KeyPairResult object.
|
|
314
|
+
*/
|
|
315
|
+
export function mailboxKeypair(): Promise<KeyPairResult> {
|
|
316
|
+
return NitroArkHybridObject.mailboxKeypair() as Promise<KeyPairResult>;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Gets a mailbox authorization for the loaded wallet.
|
|
321
|
+
* @param authorizationExpiry Unix timestamp (seconds) for when the authorization expires.
|
|
322
|
+
* @returns A promise resolving to a MailboxAuthorizationResult object.
|
|
323
|
+
*/
|
|
324
|
+
export function mailboxAuthorization(
|
|
325
|
+
authorizationExpiry: number
|
|
326
|
+
): Promise<MailboxAuthorizationResult> {
|
|
327
|
+
return NitroArkHybridObject.mailboxAuthorization(
|
|
328
|
+
authorizationExpiry
|
|
329
|
+
) as Promise<MailboxAuthorizationResult>;
|
|
330
|
+
}
|
|
331
|
+
|
|
310
332
|
/**
|
|
311
333
|
* Gets a paginated list of wallet history (balance changes).
|
|
312
334
|
* @returns A promise resolving to an array of BarkMovement objects.
|