Skip to content

feat: add Ark (Arkade) blockchain integration#3395

Merged
TaprootFreak merged 8 commits intodevelopfrom
feat/ark-blockchain-integration
Mar 13, 2026
Merged

feat: add Ark (Arkade) blockchain integration#3395
TaprootFreak merged 8 commits intodevelopfrom
feat/ark-blockchain-integration

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • Add full Ark protocol (Arkade) support as a Bitcoin L2 blockchain, using @arkade-os/sdk with the Arkadeos server (arkade.computer)
  • Coin-only integration following the same pattern as Spark: blockchain client, service, module, payout strategies, DEX strategies
  • Register Ark across all blockchain maps (enum, registry, exchanges, explorer, crypto service, config, asset service)

New files (9)

  • src/integration/blockchain/ark/ — ArkClient, ArkService, ArkModule
  • Payout: PayoutArkService, payout strategy, prepare strategy (auto-confirm)
  • DEX: DexArkService, check-liquidity strategy, purchase-liquidity strategy (no-purchase)

Modified files (19)

  • blockchain.enum.tsARK = 'Ark'
  • config.ts — address format, env vars (ARK_PRIVATE_KEY, ARK_SERVER_URL)
  • blockchain-registry.service.ts — type unions, COIN_ONLY set, injection, switch case
  • blockchain.module.ts, payout.module.ts, dex.module.ts — module registration
  • crypto.service.tsisArkAddress() detection
  • asset.service.tsgetArkCoin() helper
  • blockchain.util.ts — explorer URLs (none yet)
  • Exchange services (binance, bitstamp, kraken, kucoin, mexc, xt) + test — network maps
  • ref-reward.service.ts — payout limit

Env vars required

ARK_PRIVATE_KEY=<hex private key>
ARK_SERVER_URL=https://arkade.computer  # optional, this is the default

Test plan

  • Verify TypeScript compilation passes (npx tsc --noEmit)
  • Set ARK_PRIVATE_KEY env var and verify wallet initialization
  • Test sending a small BTC amount to an ark1... address
  • Verify balance queries work via getBalance()
  • Verify address detection correctly identifies ark1... addresses
  • Verify payout and DEX strategies register correctly on module init

Add full Ark protocol support as a Bitcoin L2 (coin-only),
using the @arkade-os/sdk with Arkadeos server (arkade.computer).
Follows the same pattern as the existing Spark integration.

Env vars: ARK_PRIVATE_KEY, ARK_SERVER_URL (optional)
- Remove unused reconnectWallet() and reconnectAttempt field
- Improve getTransaction() to use finalizePendingTxs() for outgoing
  tx confirmation instead of only checking VTXOs
The @arkade-os/sdk ships ESM-only sub-dependencies (@scure/btc-signer)
that break Jest's CommonJS transform. Add a moduleNameMapper mock
following the existing @dfinity pattern.
…apter, and user enum

Add ARK cases for payment requests, address detection, signature
verification, and balance updates that were missed in the initial
integration.
Cover signature verification (valid/invalid/edge cases), balance
conversion, transaction lifecycle, health checks, payment request
formatting, and not-implemented guards.
@TaprootFreak
Copy link
Collaborator Author

During review, found a pre-existing bug (not introduced by this PR): Spark address explorer links are broken because Blockchain.SPARK is missing from the addressPaths() switch in blockchain.util.ts.

Tracked in #3400.

Note: Blockchain.ARK is not affected since it has no explorer URL.

TaprootFreak and others added 3 commits March 12, 2026 12:42
…and assetPaths

- Set Ark explorer to https://explorer.arkade.sh with tx path
- Add Spark and Ark to addressPaths switch (fixes broken address
  explorer links for Spark, enables them for Ark)
- Add Spark and Ark to assetPaths switch for completeness

Closes #3400
Add database migration that inserts BTC as a Coin asset on the Ark
blockchain, referencing the existing Kraken BTC/USDT price rule (id 11),
consistent with Bitcoin/BTC and Lightning/BTC.
…vices

Eliminate duplicated signature verification, payment request, and
address helper methods by introducing an abstract Bech32mService.
Fix any-types in sendSignedTransaction for Spark/Ark clients.
@TaprootFreak TaprootFreak merged commit 318b563 into develop Mar 13, 2026
8 checks passed
@TaprootFreak TaprootFreak deleted the feat/ark-blockchain-integration branch March 13, 2026 15:05
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