Compose tasks can build, sign, and send Solana transactions using Gill, a lightweight Solana client library. Since Compose tasks run in a sandboxed environment, you’ll wire Gill’s RPC transport through the built-in fetch function so that all network activity remains auditable.Documentation Index
Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
Use this file to discover all available pages before exploring further.
Setup
Install Gill in your Compose project:compose.yaml:
Sandboxed RPC transport
Compose tasks cannot use the globalfetch — all HTTP requests must go through the provided context.fetch. Create a transport adapter that Gill can use:
This pattern applies to any Solana library that accepts a custom transport or fetch function. The key requirement is routing all network calls through
context.fetch so they’re recorded in Compose’s event logs.Loading a keypair
Store your Solana keypair as a secret in the same JSON byte-array format used by the Solana CLI (the output ofsolana-keygen). Then load it in your task:
Building and sending a transaction
Here’s a complete example that fetches Bitcoin’s price, writes it to a Solana program, and stores the result in a collection:What’s happening
- RPC setup — A sandboxed transport wraps
context.fetchso Gill’s RPC calls go through Compose’s auditable network layer. - Load signer — The keypair is loaded from a Compose secret and converted into a Gill transaction signer.
- Fetch off-chain data — The task fetches Bitcoin’s price from CoinGecko with built-in retry logic.
- Derive PDA — A Program Derived Address is computed from seeds so the on-chain program knows where to store the data.
- Build instruction — The instruction data is assembled: an 8-byte Anchor discriminator followed by the key and value.
- Sign and send — The transaction is created, signed, base64-encoded, and submitted to the Solana RPC.
- Store metadata — The price and transaction signature are persisted in a Compose collection for later retrieval.
Next Steps
Packages
Learn more about using npm packages in Compose tasks.
Collections
Store and query state across task runs.
Task Triggers
Trigger your Solana tasks via cron, HTTP, or on-chain events.
Secrets
Securely manage your Solana keypair and RPC URL.