Skip to content

Replace react-native-piratechain with react-native-pirate-wallet - #6021

Open
j0ntz wants to merge 2 commits into
developfrom
agent/1214721783909451
Open

Replace react-native-piratechain with react-native-pirate-wallet#6021
j0ntz wants to merge 2 commits into
developfrom
agent/1214721783909451

Conversation

@j0ntz

@j0ntz j0ntz commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Technical Design Document

piratechain-sdk-v115-reconcile.md

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

EdgeApp/edge-currency-accountbased#1055

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Asana: https://app.asana.com/0/1215088146871429/1214721783909451

Swaps react-native-piratechain for react-native-pirate-wallet@0.2.1, the Pirate Chain team's react-native binding from their unified orchard-upgrade SDK (Pirate-Unified-Light-Wallet). The reimplemented piratechain plugin (EdgeApp/edge-currency-accountbased#1055) consumes it through the existing makePiratechainIo nativeIo bridge, so the dependency swap is the only GUI change.

The package went up on npm on 2026-08-06, which retires the packaging question this PR was previously parked on: the dependency is now a plain version pin, not a file: sibling.

How the native artifacts arrive

The published wrapper carries only JS and the ObjC/Swift/Kotlin bridge (18 files, 81KB unpacked). The native binaries ship as four optionalDependencies pinned to the exact wrapper version:

Package Contents
react-native-pirate-wallet-android jniLibs for arm64-v8a (89MB) and armeabi-v7a (79MB)
react-native-pirate-wallet-android-x86_64 jniLibs for x86_64 (93MB)
react-native-pirate-wallet-ios-device PirateWalletNative.xcframework ios-arm64 slice (192MB)
react-native-pirate-wallet-ios-simulator PirateWalletNative.xcframework ios-arm64_x86_64-simulator slice (368MB)

The wrapper's postinstall hard-links the two iOS slices into the PirateWalletNative.xcframework its podspec vendors. This repo sets ignore-scripts=true in .npmrc, so that hook can never fire and pod install would vendor a framework that does not exist. The assembly call therefore lives in scripts/prepare.sh, alongside the patch-package / jetify / native-header steps that are already there for the same reason, and ahead of prepare.ios. It no-ops off macOS, and the two iOS packages declare os: ["darwin"], so Linux CI skips 560MB it cannot use.

Verified from a clean git clone + npm ci + npm run prepare: the xcframework assembles with both slices and all three Android ABIs land.

Also here

testIDs on the send scene's address-tile actions (Enter / Myself / Scan / Paste). They render as icon buttons whose labels only appear in an aggregated parent accessibilityText, so maestro could not select them by text and every automated send drive fell back to coordinate taps.

Known issue: the iOS binary does not link on current develop

Building this branch for the iOS simulator fails at link:

ld: fixup error (kind=arm64_b26) at '__ZN5boost6chrono12system_clock3nowEv'+0x450994
    from libmonero-module.a[arm64][2](monero-module.o),
    B/BL out of range (displacement=172428060, max is +/-128MB)
final section layout: __TEXT size=0x00afd4000   (184MB)

__TEXT reaches 184MB against the arm64 ±128MB branch range, and the linker cannot place a branch island. This is not specific to the npm swap: the same 373MB Pirate library linked fine on 2026-08-04, and the failure reproduces with the older vendored copy. The static-library payload is now Pirate 373MB (~187MB arm64), zcashlc 111MB, monero-module 53MB, zano-module 30MB, with zcashlc and pirate_ffi_native each carrying a full Rust std.

Tried and refuted, each a real relink: DEAD_CODE_STRIPPING=YES (displacement unchanged; -dead_strip is already in the link line), moving -l"pirate_ffi_native" last (172.4MB → 169.2MB), and -Wl,-ld_classic (fails identically from inside LMDB). Locally excluding react-native-zcash, react-native-monero and react-native-zano from autolinking links the app, which is how the ARRR testing below was done. A real fix needs the Pirate library as a dynamic framework, or a smaller Rust staticlib, and is worth raising with the Pirate team alongside the broadcast issue.

Testing

On the iOS simulator, against edge-currency-accountbased#1055 linked in via updot and the three other large native libraries locally excluded so the binary links:

  • ARRR wallets sync to completion. My Pirate 2 and My Pirate scanned from their birthdays to SYNCED at ~1,800 blocks/sec, localHeight == targetHeight == 4085959, wallet DBs growing 1.5MB → 233MB, sync banner cleared. This needed the set_lightd_endpoint fix in Reimplement Pirate Chain plugin over react-native-pirate-wallet edge-currency-accountbased#1055; without it both wallets sat at stage: "Headers", blocksPerSecond: 0 indefinitely.
  • The device-scoped registry holds every wallet in one Library/Application Support/PirateWallet/accounts/edge-pirate-device/ directory, and the send scene derives another wallet's shielded z-address without switching namespaces.
  • The send does not broadcast. Three funded attempts from the synced, spendable wallet failed inside the SDK with Broadcast failed: Status error: status: Cancelled, message: "Timeout expired", against two different lightwalletd nodes. No principal moved. Details in Reimplement Pirate Chain plugin over react-native-pirate-wallet edge-currency-accountbased#1055.

@socket-security

socket-security Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedreact-native-pirate-wallet@​0.2.17010010086100

View full report

Comment thread package.json Outdated
@j0ntz
j0ntz force-pushed the agent/1214721783909451 branch from bd3b5d1 to 6b506f3 Compare August 4, 2026 03:49
The send scene's address tile renders Enter/Myself/Scan/Paste as icon buttons
whose labels only appear in an aggregated parent accessibilityText, so maestro
cannot select them by text and every automated send drive had to fall back to
coordinate taps.
@j0ntz
j0ntz force-pushed the agent/1214721783909451 branch from 6b506f3 to 54f256b Compare August 12, 2026 00:37
The Pirate Chain team's orchard upgrade ships a unified SDK whose
react-native binding (react-native-pirate-wallet) replaces the
react-native-piratechain wrapper Edge wrote. The reimplemented
piratechain plugin in edge-currency-accountbased consumes the new
module through the same makePiratechainIo nativeIo bridge, so no GUI
code changes are needed beyond the dependency swap.

The package is not yet published to npm (it only exists as a zip asset
on PirateNetwork GitHub releases), so the dependency points at a
vendored sibling checkout (file:../react-native-pirate-wallet) staged
from the official v1.1.4 release artifacts. Swap to a hosted tgz or
npm version once a packaging decision is made.
@j0ntz
j0ntz force-pushed the agent/1214721783909451 branch from 54f256b to f39d1ec Compare August 12, 2026 03:26
@j0ntz
j0ntz marked this pull request as ready for review August 12, 2026 03:26
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f39d1ec. Configure here.

Comment thread package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants