Submit signed transactions through the Solana API #30

Closed
opened 2026-07-18 22:12:37 +02:00 by minimons · 1 comment
Owner

Background

The Solana API currently provides the generic blockchain operations required by higher-level integrations.

Issue #29 adds support for constructing an unsigned Jupiter Perps position-increase transaction. An external wallet can sign this transaction and produce a complete signed Solana transaction.

The remaining generic operation is submitting the signed transaction to the Solana blockchain.

Transaction submission is not Jupiter-specific. SolanaBlockChain should be able to submit any valid signed Solana transaction, regardless of which Solana program the transaction invokes.

Goal

Extend:

com.r35157.libs.solana.SolanaBlockChain

with a method named:

sendTransaction(...)

The method receives a complete signed Solana transaction, submits it through the configured Solana RPC endpoint, and returns the resulting Solana transaction signature.

Possible API:

@NotNull
ΩSolanaTransactionSignatureΩ sendTransaction(
        @NotNull SolanaSignedTransaction transaction
) throws IOException, InterruptedException;

Signed transaction type

Introduce:

com.r35157.libs.solana.SolanaSignedTransaction

Possible representation:

/**
 * A complete serialized Solana transaction containing all required signatures.
 *
 * @param serializedTransaction the signed transaction encoded as Base64
 */
public record SolanaSignedTransaction(
        ΩBase64StringΩ serializedTransaction
) {
}

The type must be created as a .tjava source.

Transaction signature type

Introduce a suitable ValueTag for the transaction identifier returned by Solana:

SolanaTransactionSignature

The type represents the Base58-encoded transaction signature returned by Solana RPC.

Update detag.conf accordingly.

Requirements

  • Add sendTransaction(...) to SolanaBlockChain.
  • Implement the method in the reference Solana implementation.
  • Use the Solana JSON-RPC sendTransaction operation.
  • Submit the transaction using Base64 encoding.
  • Use the existing configured Solana RPC endpoint.
  • Enable RPC preflight validation.
  • Return the transaction signature supplied by Solana RPC.
  • Convert RPC error responses into meaningful Java exceptions.
  • Reject a missing or blank serialized transaction before making the RPC request.
  • Do not access private keys.
  • Do not sign or modify the transaction.
  • Do not use a Jupiter-specific submission endpoint.
  • Update the SolanaBlockChain JavaDoc so it no longer describes the complete interface as read-only.
  • The complete repository must continue to compile.

A suitable initial RPC configuration is:

{
  "encoding": "base64",
  "skipPreflight": false,
  "preflightCommitment": "confirmed"
}

The exact internal JSON records and request identifiers are implementation details.

Verification

Use a real signed transaction produced from the unsigned Jupiter Perps transaction created in issue #29.

Verify that:

  1. sendTransaction(...) accepts the signed transaction.
  2. Solana RPC returns a non-empty transaction signature.
  3. The returned signature can be used to locate the submitted transaction.
  4. The expected blockchain state change can subsequently be observed.

The transaction should initially use a very small amount.

Out of scope

The following are not part of this issue:

  • Transaction construction
  • Private-key handling
  • Transaction signing
  • Wallet implementation
  • Confirmation polling
  • Automatic retries
  • Durable nonce support
  • Priority-fee calculation
  • Jupiter-specific transaction submission
  • Automatic reconstruction of expired transactions

Confirmation handling can be introduced later as a separate generic Solana API operation.

Definition of done

  • SolanaSignedTransaction exists as a public Solana API type.
  • SolanaTransactionSignature exists as an appropriate ValueTag.
  • SolanaBlockChain contains sendTransaction(...).
  • The reference implementation submits signed Base64 transactions through Solana RPC.
  • RPC errors are reported clearly.
  • A real signed transaction can be submitted successfully.
  • A non-empty Solana transaction signature is returned.
  • No private key is accessed by the Solana blockchain implementation.
  • The complete repository compiles.
## Background The Solana API currently provides the generic blockchain operations required by higher-level integrations. Issue #29 adds support for constructing an unsigned Jupiter Perps position-increase transaction. An external wallet can sign this transaction and produce a complete signed Solana transaction. The remaining generic operation is submitting the signed transaction to the Solana blockchain. Transaction submission is not Jupiter-specific. `SolanaBlockChain` should be able to submit any valid signed Solana transaction, regardless of which Solana program the transaction invokes. ## Goal Extend: ```java com.r35157.libs.solana.SolanaBlockChain ``` with a method named: ```java sendTransaction(...) ``` The method receives a complete signed Solana transaction, submits it through the configured Solana RPC endpoint, and returns the resulting Solana transaction signature. Possible API: ```java @NotNull ΩSolanaTransactionSignatureΩ sendTransaction( @NotNull SolanaSignedTransaction transaction ) throws IOException, InterruptedException; ``` ## Signed transaction type Introduce: ```java com.r35157.libs.solana.SolanaSignedTransaction ``` Possible representation: ```java /** * A complete serialized Solana transaction containing all required signatures. * * @param serializedTransaction the signed transaction encoded as Base64 */ public record SolanaSignedTransaction( ΩBase64StringΩ serializedTransaction ) { } ``` The type must be created as a `.tjava` source. ## Transaction signature type Introduce a suitable ValueTag for the transaction identifier returned by Solana: ```text SolanaTransactionSignature ``` The type represents the Base58-encoded transaction signature returned by Solana RPC. Update `detag.conf` accordingly. ## Requirements * Add `sendTransaction(...)` to `SolanaBlockChain`. * Implement the method in the reference Solana implementation. * Use the Solana JSON-RPC `sendTransaction` operation. * Submit the transaction using Base64 encoding. * Use the existing configured Solana RPC endpoint. * Enable RPC preflight validation. * Return the transaction signature supplied by Solana RPC. * Convert RPC error responses into meaningful Java exceptions. * Reject a missing or blank serialized transaction before making the RPC request. * Do not access private keys. * Do not sign or modify the transaction. * Do not use a Jupiter-specific submission endpoint. * Update the `SolanaBlockChain` JavaDoc so it no longer describes the complete interface as read-only. * The complete repository must continue to compile. A suitable initial RPC configuration is: ```json { "encoding": "base64", "skipPreflight": false, "preflightCommitment": "confirmed" } ``` The exact internal JSON records and request identifiers are implementation details. ## Verification Use a real signed transaction produced from the unsigned Jupiter Perps transaction created in issue #29. Verify that: 1. `sendTransaction(...)` accepts the signed transaction. 2. Solana RPC returns a non-empty transaction signature. 3. The returned signature can be used to locate the submitted transaction. 4. The expected blockchain state change can subsequently be observed. The transaction should initially use a very small amount. ## Out of scope The following are not part of this issue: * Transaction construction * Private-key handling * Transaction signing * Wallet implementation * Confirmation polling * Automatic retries * Durable nonce support * Priority-fee calculation * Jupiter-specific transaction submission * Automatic reconstruction of expired transactions Confirmation handling can be introduced later as a separate generic Solana API operation. ## Definition of done * `SolanaSignedTransaction` exists as a public Solana API type. * `SolanaTransactionSignature` exists as an appropriate ValueTag. * `SolanaBlockChain` contains `sendTransaction(...)`. * The reference implementation submits signed Base64 transactions through Solana RPC. * RPC errors are reported clearly. * A real signed transaction can be submitted successfully. * A non-empty Solana transaction signature is returned. * No private key is accessed by the Solana blockchain implementation. * The complete repository compiles.
minimons added the enhancement label 2026-07-18 22:12:37 +02:00
minimons self-assigned this 2026-07-18 22:12:37 +02:00
minimons added this to the AssetAZ project 2026-07-18 22:12:37 +02:00
minimons moved this to In Progress in AssetAZ on 2026-07-18 22:34:20 +02:00
Author
Owner
  • A real signed transaction is accepted by Solana RPC.
  • Solana RPC returns the transaction signature embedded in the transaction.
  • The method reports HTTP and RPC errors clearly.
  • Inclusion, confirmation, retry handling, and reliable delivery are outside the scope of this issue.
- A real signed transaction is accepted by Solana RPC. - Solana RPC returns the transaction signature embedded in the transaction. - The method reports HTTP and RPC errors clearly. - Inclusion, confirmation, retry handling, and reliable delivery are outside the scope of this issue.
minimons moved this to Done in AssetAZ on 2026-07-19 01:39:01 +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#30