Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/lib/
/node.js
/prebuilds/
/rust/target/
/ios/.uniffi-generated/
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"standard-kit/prettier/typescript"
],
"parserOptions": {
"project": "tsconfig.json"
"project": "tsconfig.eslint.json"
},
"plugins": [
"simple-import-sort"
],
"rules": {
"@typescript-eslint/promise-function-async": "off",
"no-var": "error",
"simple-import-sort/sort": "error"
"simple-import-sort/imports": "error"
}
}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# dash-shielded-native

## Unreleased

- added: Move shielded value out to a Platform or Core address
- added: Resume a shield whose asset lock is already on chain
- added: React Native reaches the same calls as Node
- added: Fund the shielded pool from L1 through an asset lock
- added: Transparent receive address, Core SPV sync, and L1 balance
- added: Smoke test covers the Orchard proving key warm-up
- added: Asset locks from an earlier run are listed and resume after a restart
- changed: Build against dashpay/platform v5.0.1 with Rust 1.98.1
- changed: Stopping a wallet returns an error when its sync workers did not shut down cleanly
- fixed: A stopped wallet can be opened again in the same process
- fixed: Shielded spends after the first no longer fail for lack of an anchor
- fixed: Testnet reaches DAPI on port 1443 instead of an unreachable 443
- fixed: The macOS prebuild loads instead of being killed at require
- fixed: Android ships a library for armeabi-v7a as well as arm64-v8a
- fixed: Stopping a wallet no longer panics the shielded sync task
- fixed: Dependency installs resolve instead of failing on peer conflicts

## 0.1.0 (2026-08-31)

- Initial Node N-API + React Native UniFFI package for Dash Platform shielded addresses and transfers.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ socket npm install
socket npm run build-native-host
socket npm run smoke-node
```

The Rust build pulls `dash-sdk`, whose `dapi-grpc` dependency compiles protobuf
definitions at build time, so `protoc` must be on `PATH` (`brew install protobuf`).
Without it the cargo step fails with `protoc not found in PATH`.

`smoke-node` warms the Halo 2 proving key, which takes roughly 1.5 seconds on an
Apple Silicon host, so the run is not instant even though it moves no funds.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {
minSdkVersion safeExtGet('minSdkVersion', 27)
targetSdkVersion safeExtGet('targetSdkVersion', 35)
ndk {
abiFilters 'arm64-v8a'
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
sourceSets {
Expand Down
130 changes: 130 additions & 0 deletions android/src/main/java/app/edge/rndashshielded/RNDashShieldedModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,136 @@ class RNDashShieldedModule(
}
}

@ReactMethod
fun coreReceiveAddress(alias: String, account: Double, promise: Promise) {
moduleScope.launch {
promise.wrap { uniffi.dash.coreReceiveAddress(alias, account.toUInt()) }
}
}

@ReactMethod
fun startCoreSync(alias: String, fromHeight: Double, promise: Promise) {
moduleScope.launch {
promise.wrap {
uniffi.dash.startCoreSync(alias, fromHeight.toUInt())
null
}
}
}

@ReactMethod
fun coreBalance(alias: String, promise: Promise) {
moduleScope.launch {
promise.wrap {
val balance = uniffi.dash.coreBalance(alias)
Arguments.createMap().apply {
putString("confirmedDuffs", balance.confirmedDuffs)
putString("unconfirmedDuffs", balance.unconfirmedDuffs)
putString("totalDuffs", balance.totalDuffs)
putDouble("syncedHeight", balance.syncedHeight.toDouble())
}
}
}
}

@ReactMethod
fun shieldFromAssetLock(
alias: String,
amountDuffs: String,
accountIndex: Double,
mnemonicSeed: String,
promise: Promise,
) {
moduleScope.launch {
promise.wrap {
uniffi.dash.shieldFromAssetLock(
alias,
amountDuffs,
accountIndex.toUInt(),
mnemonicSeed,
)
}
}
}

@ReactMethod
fun platformReceiveAddress(
alias: String,
account: Double,
promise: Promise,
) {
moduleScope.launch {
promise.wrap { uniffi.dash.platformReceiveAddress(alias, account.toUInt()) }
}
}

@ReactMethod
fun trackedAssetLocks(alias: String, promise: Promise) {
moduleScope.launch {
promise.wrap {
val locks = Arguments.createArray()
uniffi.dash.trackedAssetLocks(alias).forEach { lock ->
val map = Arguments.createMap()
map.putString("txid", lock.txid)
map.putInt("vout", lock.vout.toInt())
map.putString("status", lock.status)
locks.pushMap(map)
}
locks
}
}
}

@ReactMethod
fun resumeShieldFromAssetLock(
alias: String,
txid: String,
vout: Double,
mnemonicSeed: String,
promise: Promise,
) {
moduleScope.launch {
promise.wrap {
uniffi.dash.resumeShieldFromAssetLock(alias, txid, vout.toUInt(), mnemonicSeed)
}
}
}

@ReactMethod
fun unshield(
alias: String,
toAddress: String,
amountCredits: String,
mnemonicSeed: String,
promise: Promise,
) {
moduleScope.launch {
promise.wrap { uniffi.dash.unshield(alias, toAddress, amountCredits, mnemonicSeed) }
}
}

@ReactMethod
fun shieldedWithdraw(
alias: String,
toCoreAddress: String,
amountCredits: String,
coreFeePerByte: Double,
mnemonicSeed: String,
promise: Promise,
) {
moduleScope.launch {
promise.wrap {
uniffi.dash.shieldedWithdraw(
alias,
toCoreAddress,
amountCredits,
coreFeePerByte.toUInt(),
mnemonicSeed,
)
}
}
}

@ReactMethod
fun stop(alias: String, promise: Promise) {
moduleScope.launch {
Expand Down
Loading