Prepare Arbitrary Transaction
Prepare arbitrary transactions using your Smart Account as a signer
Execute any arbitrary transaction using your Smart Account as a signer. This is one of the core functionalities of a Smart Account - it enables you to use your Smart Account like a regular Solana wallet, but with the added security of multi-signature controls and self-custodial programmability.
Key Concepts
-
Smart Account as a Signer: Your Smart Account can act as a signer for any Solana transaction, just like a regular wallet. This means you can interact with any protocol or program on Solana.
-
Multi-signature Security: The transaction will only be executed if it meets the Smart Account’s threshold requirements. For example, if your Smart Account requires 2-of-3 signatures, you’ll need to provide at least 2 valid signatures from authorized signers.
-
Transaction Preparation: The transaction you provide should be properly constructed and encoded in base64 format. This transaction should include all the instructions you want to execute.
Common Use Cases
- Token Transfers: Send tokens from your Smart Account to any recipient
- DeFi Interactions: Interact with DeFi protocols (swaps, lending, etc.)
- NFT Operations: Buy, sell, or transfer NFTs
- Program Interactions: Call any program on Solana with your Smart Account as the signer
Important Notes
- The transaction must be properly constructed and include all necessary instructions
- All provided transaction_signers must be registered signers of the Smart Account
- The number of valid signatures must meet or exceed the Smart Account’s threshold
The submitted instructions must be under 1050 bytes to allow for fee configuration instructions.
Constructing Instructions
When building your instructions, treat them as regular Solana transactions but use your Smart Account’s address wherever you would normally use a signer’s address. For example:
Authorizations
Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"
Headers
Specifies which Solana network to use. Defaults to 'mainnet' if not provided. Valid values are 'devnet' or 'mainnet'.
devnet
, mainnet
Body
Response
Transaction successfully prepared
The response is of type object
.