T
—
per call · USDC on Solana
Build one unsigned transaction from an IDL instruction
Endpoint
POST https://the-composer.fly.dev/tx/build3
Calls / 30d
1
Unique payers / 30d
Aug 31
Last called
exact
Payment scheme
Call this service
TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);
const res = await fetchWithPay("https://the-composer.fly.dev/tx/build", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"accounts": {
"mint": "<base58 pubkey>"
},
"args": {
"amount": "1000000",
"max_sol_cost": "100000"
},
"instruction": "buy",
"payer": "<base58 pubkey that will sign>",
"programId": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}),
});
const data = await res.json();cURL
curl -X POST \
"https://the-composer.fly.dev/tx/build" \
-H "Content-Type: application/json" \
-d '{"accounts":{"mint":"<base58 pubkey>"},"args":{"amount":"1000000","max_sol_cost":"100000"},"instruction":"buy","payer":"<base58 pubkey that will sign>","programId":"6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}' \
-H "X-PAYMENT: <signed x402 payment>"Example response
{
"resolvedAccounts": [],
"signers": [
"<pubkey>"
],
"transaction": "<base64 v0 tx>"
}Payment details
Pay to
wzmal78srutrf6csxekwuhmadf5hza6jnraepengqpbAsset
epjfwdd5aufqssqem2qn1xzybapc8g4weggkzwytdt1vNetworksSolana
Schemesexact
Is this your API?
Pin it to the top of Onchain Data and the homepage with a featured placement.
More from the-composer & similar services
T
the-composer · Probe
the-composer.fly.dev
Sweep one input and confirm which derived accounts exist
POSTSolanaOther
—7 calls / 30d
T
the-composer · Intent
the-composer.fly.dev
Describe a goal in words; get candidate transactions ranked by whether they actually simulate
POSTSolanaOther
—3 calls / 30d
T
the-composer · TX Batch
the-composer.fly.dev
Compose many instructions into a signable transaction or bundle
POSTSolanaOnchain Data
—3 calls / 30d