react-native-nitro-ark 0.0.129 → 0.0.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -1
- 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 +102 -0
- package/cpp/WalletStateChangeSubscription.hpp +118 -0
- package/cpp/generated/ark_cxx.h +81 -0
- package/lib/module/index.js +27 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +30 -0
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +22 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/android/NitroArk+autolinking.cmake +1 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +19 -3
- package/nitrogen/generated/shared/c++/HybridWalletStateChangeSubscriptionSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridWalletStateChangeSubscriptionSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/WalletSnapshotExpectation.hpp +92 -0
- package/nitrogen/generated/shared/c++/WalletSnapshotInfo.hpp +112 -0
- package/nitrogen/generated/shared/c++/WalletStateChangeEvent.hpp +87 -0
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +37 -0
- package/src/index.tsx +59 -0
package/src/index.tsx
CHANGED
|
@@ -33,6 +33,10 @@ import type {
|
|
|
33
33
|
BoardResult,
|
|
34
34
|
PendingRoundStatus as NitroPendingRoundStatus,
|
|
35
35
|
DelegatedRoundState,
|
|
36
|
+
WalletSnapshotInfo,
|
|
37
|
+
WalletSnapshotExpectation,
|
|
38
|
+
WalletStateChangeEvent as NitroWalletStateChangeEvent,
|
|
39
|
+
WalletStateChangeSubscription,
|
|
36
40
|
} from './NitroArk.nitro';
|
|
37
41
|
|
|
38
42
|
export type VtxoState = 'Spendable' | 'Spent' | 'Locked' | 'Exited' | 'unknown';
|
|
@@ -130,6 +134,24 @@ export type BarkNotificationEvent = Omit<
|
|
|
130
134
|
movement?: BarkMovement;
|
|
131
135
|
};
|
|
132
136
|
|
|
137
|
+
export type WalletStateChangeReason =
|
|
138
|
+
| 'initial'
|
|
139
|
+
| 'databaseChanged'
|
|
140
|
+
| 'resyncRequired';
|
|
141
|
+
|
|
142
|
+
export type WalletStateChangeEvent = Omit<
|
|
143
|
+
NitroWalletStateChangeEvent,
|
|
144
|
+
'reason'
|
|
145
|
+
> & {
|
|
146
|
+
reason: WalletStateChangeReason;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export type {
|
|
150
|
+
WalletSnapshotInfo,
|
|
151
|
+
WalletSnapshotExpectation,
|
|
152
|
+
WalletStateChangeSubscription,
|
|
153
|
+
};
|
|
154
|
+
|
|
133
155
|
export type LightningPaymentState =
|
|
134
156
|
| 'unknown'
|
|
135
157
|
| 'in_progress'
|
|
@@ -216,6 +238,39 @@ export function closeWallet(): Promise<void> {
|
|
|
216
238
|
return NitroArkHybridObject.closeWallet();
|
|
217
239
|
}
|
|
218
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Creates a transactionally consistent SQLite snapshot of the loaded wallet.
|
|
243
|
+
* The destination must not already exist.
|
|
244
|
+
*/
|
|
245
|
+
export function createWalletSnapshot(
|
|
246
|
+
destinationPath: string
|
|
247
|
+
): Promise<WalletSnapshotInfo> {
|
|
248
|
+
return NitroArkHybridObject.createWalletSnapshot(destinationPath);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Validates a wallet snapshot without modifying it. When expected identity
|
|
253
|
+
* fields are omitted, the loaded wallet identity is used when available.
|
|
254
|
+
*/
|
|
255
|
+
export function validateWalletSnapshot(
|
|
256
|
+
path: string,
|
|
257
|
+
expected?: WalletSnapshotExpectation
|
|
258
|
+
): Promise<WalletSnapshotInfo> {
|
|
259
|
+
return NitroArkHybridObject.validateWalletSnapshot(path, expected);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Observes committed native SQLite changes. Sequence values are local to this
|
|
264
|
+
* subscription and reset when a new subscription is created.
|
|
265
|
+
*/
|
|
266
|
+
export function subscribeWalletStateChanges(
|
|
267
|
+
onEvent: (event: WalletStateChangeEvent) => void
|
|
268
|
+
): WalletStateChangeSubscription {
|
|
269
|
+
return NitroArkHybridObject.subscribeWalletStateChanges(
|
|
270
|
+
onEvent as (event: NitroWalletStateChangeEvent) => void
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
219
274
|
/**
|
|
220
275
|
* Refreshes the server state.
|
|
221
276
|
* @returns A promise that resolves on success or rejects on error.
|
|
@@ -770,6 +825,10 @@ export function onchainAddress(): Promise<string> {
|
|
|
770
825
|
return NitroArkHybridObject.onchainAddress();
|
|
771
826
|
}
|
|
772
827
|
|
|
828
|
+
export function onchainIsMine(address: string): Promise<boolean> {
|
|
829
|
+
return NitroArkHybridObject.onchainIsMine(address);
|
|
830
|
+
}
|
|
831
|
+
|
|
773
832
|
/**
|
|
774
833
|
* Sends funds using the onchain wallet.
|
|
775
834
|
* @param destination The destination Bitcoin address.
|