Skip to content

Expose explicit Ark channel operations in the web and React Native SDKs - #97

Open
sputn1ck wants to merge 6 commits into
mainfrom
kon/sdk-ark-channel-client
Open

sputn1ck wants to merge 6 commits into
mainfrom
kon/sdk-ark-channel-client

Conversation

@sputn1ck

Copy link
Copy Markdown
Member

What changes

Adds a typed ArkChannelClient capability to the official web and React Native factories without requiring custom WavelengthClient implementations to change. Applications opt in with arkChannelsEnabled and explicitly promote VTXOs, pay an invoice with a fee cap, or issue an invoice against existing inbound liquidity. No automatic retry or swap fallback.

The native bridge detects complete channel bindings before dispatch, including after a JS-only update. Web debug logs redact payment preimages. PR CI now exercises the React Native transport tests.

Runtime compatibility

This SDK-only PR does not bump package versions, the v0.2.1 runtime pin, asset digests, or native dependency pins. Existing released binaries do not provide the new operations. Using them requires a channel-capable runtime and hub; this PR does not deliver or deploy either.

Verification

  • Built each logical code commit and ran focused tests for it.
  • Workspace build and typecheck; all four SDK package suites; publint and attw.
  • Android and iOS compatibility harnesses against legacy artifacts and partial/complete ABI fixtures; iOS device and simulator release link checks.
  • Built the web demo using the official pinned WASM. The demo smoke suite exercises legacy wallet behavior, not live Ark channel settlement.

Keep settlement proofs out of debug output before exposing channel payments. Exercise both worker and main-thread logging with nested results.
Register the three facade names and resolve them as one capability. Keep the released AAR and XCFramework usable without referencing missing symbols, and exercise the legacy and channel-capable ABIs.
Expose promotion, pay and receive as an additive client capability. Validate amounts, fee caps and caller-owned replay keys before dispatch, then normalize replies without retrying or falling back to swaps.
Reject unsupported app binaries before starting a channel-enabled wallet or dispatching a payment. Preserve native errors and leave legacy startup and custom clients unchanged.
Make the capability available in worker and main-thread modes. Document the runtime and liquidity prerequisites alongside explicit pay and receive examples.
The bridge and consumer capability checks run under Node without an emulator. Keep them in the build job alongside the other SDK suites.
Copilot AI balanced review requested due to automatic review settings November 18, 2026 17:39

Copilot AI 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.

🔵 Needs a closer look

The unavailable channel-capable daemon and hub leave money-moving wire contracts and live promotion, fee-cap enforcement, payment, and receive behavior unverified beyond fixtures and mocks.

No open issues 🎉

What changed in this PR

Adds explicit Ark channel operations to the shared SDK contract and official web and React Native clients without changing custom WavelengthClient implementations. These operations require a channel-capable runtime and hub; runtime and dependency pins remain unchanged.

Changes:

  • Adds typed promotion, payment, and receive methods with configuration and request validation, without automatic retries or swap fallback.
  • Adds native capability detection and compatibility handling for older bindings.
  • Redacts payment preimages from web debug logs and expands tests, including React Native transport coverage in CI.
File Description
packages/​web/​src/​wavewalletdk-worker.js Redacts preimages in worker debug logs.
packages/​web/​src/​util.ts Redacts preimages in shared web logging.
packages/​web/​src/​index.ts Exposes channel capability from the web factory.
packages/​web/​src/​debug-redaction.test.ts Tests nested payment-preimage redaction.
packages/​web/​README.md Documents channel usage and runtime requirements.
packages/​react-native/​WavelengthReactNative.podspec Includes the private C++ bindings header.
packages/​react-native/​test-native/​check-ark-bindings.sh Adds native compatibility harness commands.
packages/​react-native/​test-native/​ArkChannelBindingsCheck.kt Checks Android binding detection and dispatch.
packages/​react-native/​test-native/​ark-bindings.mm Checks iOS binding detection and linking.
packages/​react-native/​src/​NativeWavelength.ts Declares the native channel-capability probe.
packages/​react-native/​src/​native-dispatch.test.ts Extends native dispatch checks to channel methods.
packages/​react-native/​src/​index.ts Exposes channel capability from the native factory.
packages/​react-native/​src/​client.ts Gates channel calls on native support and preserves errors.
packages/​react-native/​src/​client.test.ts Tests dispatch, compatibility guards, and error propagation.
packages/​react-native/​ios/​WavelengthModule.mm Adds channel dispatch and response validation.
packages/​react-native/​ios/​WavelengthArkBindings.hpp Detects complete iOS bindings at compile time.
packages/​react-native/​android/​src/​main/​java/​engineering/​lightning/​wavelength/​reactnative/​WavelengthModule.kt Exposes channel support and routes channel calls.
packages/​react-native/​android/​src/​main/​java/​engineering/​lightning/​wavelength/​reactnative/​ArkChannelBindings.kt Detects and invokes optional Android bindings.
packages/​react-native/​android/​consumer-rules.pro Preserves reflectively accessed channel methods.
packages/​react-native/​android/​build.gradle Registers consumer shrinker rules.
packages/​core/​src/​results.ts Defines promotion and payment result types.
packages/​core/​src/​response-normalization.ts Normalizes channel receive activity entries.
packages/​core/​src/​requests.ts Defines promotion and fee-capped payment requests.
packages/​core/​src/​public-api-assertions.ts Checks additive channel API signatures.
packages/​core/​src/​index.ts Exports channel contracts and types.
packages/​core/​src/​facade.ts Adds channel verbs, configuration mapping, and request validation.
packages/​core/​src/​facade.test.ts Tests channel configuration forwarding.
packages/​core/​src/​errors.ts Adds the channel-request validation error code.
packages/​core/​src/​config.ts Adds and validates channel opt-in.
packages/​core/​src/​config.test.ts Covers invalid channel configurations.
packages/​core/​src/​client.ts Defines the additive ArkChannelClient interface.
packages/​core/​src/​casing.ts Normalizes ChannelID to channelId.
packages/​core/​src/​base-client.ts Implements shared channel operations.
packages/​core/​src/​base-client.test.ts Tests validation, normalization, and no-fallback behavior.
.github/​workflows/​ci.yml Runs React Native transport tests in CI.

Review effort: Balanced

@claude

claude Bot commented Nov 18, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@litbot-9000

Copy link
Copy Markdown
Collaborator

@sputn1ck, remember to re-request review from reviewers when ready

This branch has not been deployed

No deployments
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.

3 participants