Skip to content

Commit 7f07b49

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fixes
Made-with: Cursor
2 parents 83607ff + b2bb9ff commit 7f07b49

88 files changed

Lines changed: 6155 additions & 727 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tags
99
tags-tmp
1010
tags-lock
1111
.idea
12+
.fallow
1213

1314
*.log
1415

apps/docs/content/docs/getting-started/dependencies.mdx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ description: Complete list of SatSigner mobile app dependencies.
77

88
| Dependency | Used for |
99
| -------------------------------- | -------------------------------------------------------------------- |
10+
| @babel/runtime | Babel runtime helpers required at runtime by compiled modules |
1011
| @bitcoinerlab/secp256k1 | ECC library (used with bitcoinjs-lib to decode transactions) |
12+
| @cashu/cashu-ts | Cashu TypeScript library for ecash tokens |
1113
| @gandlaf21/bolt11-decode | Decode Lightning Network BOLT11 invoices |
1214
| @gorhom/bottom-sheet | A performant interactive bottom sheet |
1315
| @miblanchard/react-native-slider | Slider |
@@ -16,11 +18,12 @@ description: Complete list of SatSigner mobile app dependencies.
1618
| @react-native-community/netinfo | Network Information |
1719
| @react-navigation/drawer | Drawer |
1820
| @scure/base | Bech32, base64, base32, base16 & base58 implementations |
21+
| @secondts/bark-react-native | Ark protocol client (bark) for React Native |
1922
| @shopify/flash-list | Fast & Performant React Native List |
2023
| @shopify/react-native-skia | Utxo Bubbles |
2124
| @tanstack/react-query | Powerful asynchronous state management |
2225
| assert | Assert nodejs core module (required by varuint and/or bitcoinjs) |
23-
| bdk-rn | Bitcoin Development Kit for React Native |
26+
| bech32 | Bech32 and bech32m encoding/decoding |
2427
| bip-321 | Bitcoin URI parsing and encoding (BIP-321) |
2528
| bip32 | BIP32 hierarchical deterministic wallets utils |
2629
| bip39 | BIP39 Word List & mnemonic utils |
@@ -32,49 +35,56 @@ description: Complete list of SatSigner mobile app dependencies.
3235
| electrum-client | Electrum client (keep untill BDK adds support to addr descriptors) |
3336
| events | Events nodejs core module (required by electrum-client) |
3437
| expo | Framework to develop Android and iOS apps easier |
38+
| expo-build-properties | Configure native build properties at prebuild |
3539
| expo-camera | Render preview for the device's front or back camera |
3640
| expo-clipboard | Interface for getting and settings Clipboard content |
3741
| expo-constants | Required by expo-router |
3842
| expo-dev-client | Useful development tools |
3943
| expo-document-picker | Pick files |
4044
| expo-font | Load SF Pro Text |
45+
| expo-haptics | Haptic feedback |
4146
| expo-image | Load images (includes svgs) |
4247
| expo-linear-gradient | Use LinearGradient |
4348
| expo-linking | Required by expo-router |
4449
| expo-localization | Localization |
4550
| expo-navigation-bar | Work with navigation bar |
51+
| expo-print | Print and generate PDFs |
4652
| expo-router | Navigation |
4753
| expo-secure-store | Store and read data in SharedPreferences (android) or Keychain (iOS) |
48-
| expo-share | Share files to other applications |
54+
| expo-sharing | Share files to other applications |
4955
| expo-status-bar | Work with status bar |
5056
| expo-system-ui | To set backgroundColor |
5157
| expo-web-browser | Open web links |
5258
| i18n-js | Localization strings |
59+
| immer | Immutable state updates via drafts |
5360
| nostr-tools | Low-level Nost clienttools (i.e, key generation, event handling) |
5461
| pako | Offers fast zlib compression and decompression |
5562
| process | Implementation of process core module |
5663
| react | React |
5764
| react-native | React Native |
58-
| react-native-aes-crypto | AES encryption/decryption for react-native |
65+
| react-native-bdk-sdk | Bitcoin Development Kit for React Native |
5966
| react-native-bouncy-checkbox | Checkbox |
60-
| react-native-draggable-flatlist | List with drag-and-drop functionality for reordering items |
6167
| react-native-device-info | Get app version and other versioning information |
62-
| react-native-fs | File system operations |
68+
| react-native-draggable-flatlist | List with drag-and-drop functionality for reordering items |
6369
| react-native-gesture-handler | Handle gestures (Utxo Bubbles) |
64-
| react-native-keyevent | Handle key events from physical keyboards |
70+
| react-native-get-random-values | Secure random polyfill for React Native |
6571
| react-native-mmkv | Fast storage solution |
6672
| react-native-nfc-manager | Near Field Communitcation NFC |
73+
| react-native-nitro-modules | Runtime for Nitro native modules |
74+
| react-native-nitro-sqlite | Fast SQLite via Nitro modules |
6775
| react-native-pager-view | Tabs |
6876
| react-native-qrcode-svg | QR Code generator |
77+
| react-native-quick-crypto | Fast native crypto module |
6978
| react-native-reanimated | Animations |
7079
| react-native-safe-area-context | Required by expo-router |
7180
| react-native-screens | Required by expo-router |
7281
| react-native-svg | Required to use react-native-qrcode-svg |
7382
| react-native-tab-view | Tabs |
7483
| react-native-tcp-socket | TCP & TLS nodejs core modules (Required by electrum-client) |
7584
| react-native-uuid | Generate uuids |
85+
| react-native-view-shot | Capture a view as an image |
86+
| react-native-worklets | Worklets runtime used by Reanimated |
7687
| react-timeago | Help us to display timeago |
77-
| rn-nodeify (devDependency) | Allow React Native projects to use nodejs core modules |
7888
| sonner-native | Toaster for notifications |
7989
| varuint-bitcoin | Deal with variable unsigned integers used in raw transactions |
8090
| victory-native | Chart |

apps/mobile/__mocks__/react-native-nitro-sqlite-DatabaseQueue.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/mobile/api/ark/index.ts

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
import type {
2+
ArkBalance,
3+
ArkFeeEstimate,
4+
ArkLightningSendResult,
5+
ArkMovement,
6+
ArkServerId,
7+
ArkVtxo
8+
} from '@/types/models/Ark'
9+
10+
import type {
11+
ArkBolt11Invoice,
12+
ArkNotificationListener,
13+
ArkNotificationUnsubscribe,
14+
ArkWalletArgs
15+
} from './provider'
16+
import { getArkProvider } from './registry'
17+
import './providers/bark'
18+
19+
export type {
20+
ArkBolt11Invoice,
21+
ArkMovementEvent,
22+
ArkMovementEventType,
23+
ArkNotificationListener,
24+
ArkNotificationUnsubscribe,
25+
ArkWalletArgs
26+
} from './provider'
27+
28+
export async function createArkWallet(args: ArkWalletArgs): Promise<void> {
29+
await getArkProvider(args.server.id).createWallet(args)
30+
}
31+
32+
export async function openArkWallet(args: ArkWalletArgs): Promise<void> {
33+
await getArkProvider(args.server.id).openWallet(args)
34+
}
35+
36+
export function releaseArkWallet(
37+
serverId: ArkServerId,
38+
accountId: string
39+
): void {
40+
getArkProvider(serverId).releaseWallet(accountId)
41+
}
42+
43+
export function fetchArkBalance(
44+
serverId: ArkServerId,
45+
accountId: string
46+
): Promise<ArkBalance> {
47+
return getArkProvider(serverId).fetchBalance(accountId)
48+
}
49+
50+
export function newArkAddress(
51+
serverId: ArkServerId,
52+
accountId: string
53+
): Promise<string> {
54+
return getArkProvider(serverId).newAddress(accountId)
55+
}
56+
57+
export function createArkBolt11Invoice(
58+
serverId: ArkServerId,
59+
accountId: string,
60+
amountSats: number
61+
): Promise<ArkBolt11Invoice> {
62+
return getArkProvider(serverId).createBolt11Invoice(accountId, amountSats)
63+
}
64+
65+
export function fetchArkMovements(
66+
serverId: ArkServerId,
67+
accountId: string
68+
): Promise<ArkMovement[]> {
69+
return getArkProvider(serverId).fetchMovements(accountId)
70+
}
71+
72+
export function subscribeArkNotifications(
73+
serverId: ArkServerId,
74+
accountId: string,
75+
listener: ArkNotificationListener
76+
): ArkNotificationUnsubscribe {
77+
return getArkProvider(serverId).subscribeNotifications(accountId, listener)
78+
}
79+
80+
export function sendArkArkoor(
81+
serverId: ArkServerId,
82+
accountId: string,
83+
arkAddress: string,
84+
amountSats: number
85+
): Promise<string> {
86+
return getArkProvider(serverId).sendArkoor(accountId, arkAddress, amountSats)
87+
}
88+
89+
export function payArkBolt11(
90+
serverId: ArkServerId,
91+
accountId: string,
92+
invoice: string,
93+
amountSats?: number
94+
): Promise<ArkLightningSendResult> {
95+
return getArkProvider(serverId).payBolt11(accountId, invoice, amountSats)
96+
}
97+
98+
export function payArkLightningAddress(
99+
serverId: ArkServerId,
100+
accountId: string,
101+
address: string,
102+
amountSats: number,
103+
comment?: string
104+
): Promise<ArkLightningSendResult> {
105+
return getArkProvider(serverId).payLightningAddress(
106+
accountId,
107+
address,
108+
amountSats,
109+
comment
110+
)
111+
}
112+
113+
export function estimateArkArkoorFee(
114+
serverId: ArkServerId,
115+
accountId: string,
116+
amountSats: number
117+
): Promise<ArkFeeEstimate> {
118+
return getArkProvider(serverId).estimateArkoorFee(accountId, amountSats)
119+
}
120+
121+
export function estimateArkLightningSendFee(
122+
serverId: ArkServerId,
123+
accountId: string,
124+
amountSats: number
125+
): Promise<ArkFeeEstimate> {
126+
return getArkProvider(serverId).estimateLightningSendFee(
127+
accountId,
128+
amountSats
129+
)
130+
}
131+
132+
export function listArkSpendableVtxos(
133+
serverId: ArkServerId,
134+
accountId: string
135+
): Promise<ArkVtxo[]> {
136+
return getArkProvider(serverId).listSpendableVtxos(accountId)
137+
}
138+
139+
export function offboardArkVtxos(
140+
serverId: ArkServerId,
141+
accountId: string,
142+
vtxoIds: string[],
143+
bitcoinAddress: string
144+
): Promise<string> {
145+
return getArkProvider(serverId).offboardVtxos(
146+
accountId,
147+
vtxoIds,
148+
bitcoinAddress
149+
)
150+
}
151+
152+
export function estimateArkOffboardFee(
153+
serverId: ArkServerId,
154+
accountId: string,
155+
bitcoinAddress: string,
156+
vtxoIds: string[]
157+
): Promise<ArkFeeEstimate> {
158+
return getArkProvider(serverId).estimateOffboardFee(
159+
accountId,
160+
bitcoinAddress,
161+
vtxoIds
162+
)
163+
}

apps/mobile/api/ark/provider.ts

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import type {
2+
ArkBalance,
3+
ArkFeeEstimate,
4+
ArkLightningSendResult,
5+
ArkMovement,
6+
ArkServer,
7+
ArkServerId,
8+
ArkVtxo
9+
} from '@/types/models/Ark'
10+
11+
export type ArkWalletArgs = {
12+
accountId: string
13+
mnemonic: string
14+
server: ArkServer
15+
datadir: string
16+
/** Optional bearer for private Ark servers — forwarded as `ark-access-token`. */
17+
serverAccessToken?: string
18+
}
19+
20+
export type ArkBolt11Invoice = {
21+
invoice: string
22+
amountSats: number
23+
}
24+
25+
export type ArkMovementEventType = 'created' | 'updated'
26+
27+
export type ArkMovementEvent = {
28+
type: ArkMovementEventType
29+
accountId: string
30+
movementId: number
31+
status: string
32+
effectiveBalanceSats: number
33+
}
34+
35+
export type ArkNotificationListener = (event: ArkMovementEvent) => void
36+
export type ArkNotificationUnsubscribe = () => void
37+
38+
export interface ArkWalletProvider {
39+
readonly serverId: ArkServerId
40+
createWallet: (args: ArkWalletArgs) => Promise<void>
41+
openWallet: (args: ArkWalletArgs) => Promise<void>
42+
releaseWallet: (accountId: string) => void
43+
fetchBalance: (accountId: string) => Promise<ArkBalance>
44+
newAddress: (accountId: string) => Promise<string>
45+
createBolt11Invoice: (
46+
accountId: string,
47+
amountSats: number
48+
) => Promise<ArkBolt11Invoice>
49+
fetchMovements: (accountId: string) => Promise<ArkMovement[]>
50+
subscribeNotifications: (
51+
accountId: string,
52+
listener: ArkNotificationListener
53+
) => ArkNotificationUnsubscribe
54+
sendArkoor: (
55+
accountId: string,
56+
arkAddress: string,
57+
amountSats: number
58+
) => Promise<string>
59+
payBolt11: (
60+
accountId: string,
61+
invoice: string,
62+
amountSats?: number
63+
) => Promise<ArkLightningSendResult>
64+
payLightningAddress: (
65+
accountId: string,
66+
address: string,
67+
amountSats: number,
68+
comment?: string
69+
) => Promise<ArkLightningSendResult>
70+
estimateArkoorFee: (
71+
accountId: string,
72+
amountSats: number
73+
) => Promise<ArkFeeEstimate>
74+
estimateLightningSendFee: (
75+
accountId: string,
76+
amountSats: number
77+
) => Promise<ArkFeeEstimate>
78+
listSpendableVtxos: (accountId: string) => Promise<ArkVtxo[]>
79+
offboardVtxos: (
80+
accountId: string,
81+
vtxoIds: string[],
82+
bitcoinAddress: string
83+
) => Promise<string>
84+
estimateOffboardFee: (
85+
accountId: string,
86+
bitcoinAddress: string,
87+
vtxoIds: string[]
88+
) => Promise<ArkFeeEstimate>
89+
}

0 commit comments

Comments
 (0)