Solana Raw Transactions

A general Solana transaction is used mainly for invoking non-transfers transactions.

Fordefi can handle any single-signature Solana transaction. While raw Solana transactions can be used to create transfers, it is recommended to use their request formats.

Fordefi supports both legacy and v0 versions. To invoke a general transaction using the Fordefi platform, you need to provide the following:

  • The version
  • An array of instructions
  • The interacted accounts list
  • An address table, if relevant

Any transaction must have at least one instruction.

📘

Note

API users must strongly authenticate transaction requests that are created programmatically by signing them. Learn more.

The following example creates a transaction request that adds liquidity to Marinade Finance. The request should be inside the body, as demonstrated here. For a better understanding, visit the Solana blockchain explorer to view the transaction that was created by this code.

{  
    "signer_type": "api_signer",  
    "type": "solana_transaction",  
    "details": {  
        "type": "solana_raw_transaction",  
        "chain": "solana_mainnet",  
        "version": "legacy",  
        "instructions": [{  
            "program_index": 8,  
            "data": "tZ1ZQ4+2NEjwSQIAAAAAAA==",  
            "account_indexes": [1, 3, 7, 6, 4, 0, 2, 5, 9]  
        }],  
        "accounts": [{  
                "address": "8TpGoWWzx9Q7rR7UizToMQ7K3G8TPncHjkJiBBfxwBC4",  
                "writable": true,  
                "signer": true  
            },  
            {  
                "address": "8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC",  
                "writable": true,  
                "signer": false  
            },  
            {  
                "address": "De2cHMWmygZ6Ss8HDaBXovesoniXBFs5B4MKQVthaVM2",  
                "writable": true,  
                "signer": false  
            },  
            {  
                "address": "LPmSozJJ8Jh69ut2WP3XmVohTjL4ipR18yiCzxrUmVj",  
                "writable": true,  
                "signer": false  
            },  
            {  
                "address": "UefNb6z6yvArqe4cJHTXCqStRsKmWhGxnZzuHbikP5Q",  
                "writable": true,  
                "signer": false  
            },  
            {  
                "address": "11111111111111111111111111111111",  
                "writable": false,  
                "signer": false  
            },  
            {  
                "address": "7GgPYjS5Dza89wV6FpZ23kUJRG5vbQ1GM25ezspYFSoE",  
                "writable": false,  
                "signer": false  
            },  
            {  
                "address": "HZsepB79dnpvH6qfVgvMpS738EndHw3qSHo4Gv5WX1KA",  
                "writable": false,  
                "signer": false  
            },  
            {  
                "address": "MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD",  
                "writable": false,  
                "signer": false  
            },  
            {  
                "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",  
                "writable": false,  
                "signer": false  
            }  
        ],  
        "address_table_lookups":[]  
    },  
    "note": "Adding liquidity to Marinade Finance",  
    "vault_id": "8988893a-cf29-4a02-acc7-5bb723c74f47"  
}