Hide transaction handling behind high-level service operations #49

Closed
opened 2026-07-28 18:09:32 +02:00 by minimons · 0 comments
Owner

Public service interfaces currently expose intermediate transaction-building and signing steps. Callers should only request the actual wallet or Jupiter operation.

Refactor the APIs as follows:

  • Replace the SOL transaction-building methods on SolanaWallet with high-level operations such as sendSolana(...) and sendAllSolana(...).

  • Let SolanaWalletImpl coordinate transaction building, signing and submission.

  • Remove signTransaction(...) from SolanaWallet; signing remains an internal responsibility of the wallet implementation.

  • Move buildSolanaTransferTransaction(...) and buildSolanaTransferAllTransaction(...) to SolanaBlockChain and its reference implementation.

  • Keep the binary transaction construction in SolanaBlockChainImpl; do not introduce a separate builder abstraction yet.

  • Remove these public methods from JupiterPerpsService:

    • buildPositionIncreaseTransaction(...)
    • buildPositionDecreaseTransaction(...)
  • Rename:

    • executePositionIncreaseTransaction(...) to executePositionIncrease(...)
    • executePositionDecreaseTransaction(...) to executePositionDecrease(...)
  • Change the execution methods to receive the wallet and actual position parameters instead of signed transactions.

  • Let the Jupiter implementation handle transaction building and submission while signing remains the wallet implementation’s responsibility.

  • Do not introduce a separate signer abstraction yet.

  • Update the alarm actions to perform their existing safety checks and then use one high-level Jupiter call.

Acceptance criteria

  • Alarm code no longer builds, signs or submits transactions.
  • SolanaWallet exposes high-level operations rather than transaction handling.
  • JupiterPerpsService exposes only complete position operations.
  • Existing SOL transfer, transfer-all and Jupiter increase/decrease behaviour is preserved.
Public service interfaces currently expose intermediate transaction-building and signing steps. Callers should only request the actual wallet or Jupiter operation. Refactor the APIs as follows: * Replace the SOL transaction-building methods on `SolanaWallet` with high-level operations such as `sendSolana(...)` and `sendAllSolana(...)`. * Let `SolanaWalletImpl` coordinate transaction building, signing and submission. * Remove `signTransaction(...)` from `SolanaWallet`; signing remains an internal responsibility of the wallet implementation. * Move `buildSolanaTransferTransaction(...)` and `buildSolanaTransferAllTransaction(...)` to `SolanaBlockChain` and its reference implementation. * Keep the binary transaction construction in `SolanaBlockChainImpl`; do not introduce a separate builder abstraction yet. * Remove these public methods from `JupiterPerpsService`: * `buildPositionIncreaseTransaction(...)` * `buildPositionDecreaseTransaction(...)` * Rename: * `executePositionIncreaseTransaction(...)` to `executePositionIncrease(...)` * `executePositionDecreaseTransaction(...)` to `executePositionDecrease(...)` * Change the execution methods to receive the wallet and actual position parameters instead of signed transactions. * Let the Jupiter implementation handle transaction building and submission while signing remains the wallet implementation’s responsibility. * Do not introduce a separate signer abstraction yet. * Update the alarm actions to perform their existing safety checks and then use one high-level Jupiter call. ## Acceptance criteria * Alarm code no longer builds, signs or submits transactions. * `SolanaWallet` exposes high-level operations rather than transaction handling. * `JupiterPerpsService` exposes only complete position operations. * Existing SOL transfer, transfer-all and Jupiter increase/decrease behaviour is preserved.
minimons added the enhancement label 2026-07-28 18:09:32 +02:00
minimons self-assigned this 2026-07-28 18:09:32 +02:00
minimons added this to the AssetAZ project 2026-07-28 18:09:32 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#49