Loading...
Loading...
Use this skill when the user asks about Goldsky Compose — the offchain-to-onchain TypeScript framework for onchain oracles, keepers, circuit breakers, and cross-chain automation. Triggers on: 'goldsky compose', 'compose.yaml', 'compose deploy/init/dev', 'compose task', 'cron task onchain', 'sponsored gas', 'writeContract from TypeScript', 'build a price oracle', 'resolve prediction market', 'onchain event listener', 'HTTP-triggered task', 'smart wallet'. Also use when the user wants to run TypeScript against EVM chains with managed gas, schedule onchain writes via cron, react to onchain events, or deploy a serverless task with secrets and a smart wallet. For debugging a broken app, use /compose-doctor. For manifest/CLI/API lookups, use /compose-reference. Do NOT trigger on Goldsky Turbo, Mirror, Subgraphs, Edge, or Datasets — those belong to their respective skills.
npx skill4agent add goldsky-io/goldsky-agent compose/compose-doctor/compose-referencegoldsky login/auth-setup/secretsBashcompose devcompose deploycompose logs -fcurl https://goldsky.com | sh
goldsky logingoldsky compose init <app-name> # scaffolds a Bitcoin-oracle example
cd <app-name>
goldsky compose dev # hot-reload local server on :4000
goldsky compose deploy # bundle + upload to cloud
goldsky compose status # expect RUNNING
goldsky compose logs -f # stream logscompose.yaml# compose.yaml
name: my-oracle
api_version: stable
secrets:
- ORACLE_ADDRESS
tasks:
- name: hourly_update
path: src/tasks/hourly-update.ts
triggers:
- type: cron
expression: "0 * * * *"// src/tasks/hourly-update.ts
import type { TaskContext } from "compose";
export async function main({ evm, env, logEvent }: TaskContext) {
const wallet = await evm.wallet({ name: "updater" });
const tx = await wallet.writeContract(
evm.chains.polygonAmoy,
env.ORACLE_ADDRESS,
"update(uint256)",
[BigInt(Date.now())],
{ confirmations: 3, onReorg: { action: { type: "replay" }, depth: 200 } },
);
await logEvent({ code: "updated", message: "ok", data: { hash: tx.hash } });
}async function main(context, params?)compose.yaml| Type | Fires on | Key config |
|---|---|---|
| schedule | |
| HTTP POST to | |
| decoded log | |
{ env, fetch, callTask, logEvent, evm, collection }context.envsecrets/compose-referenceevm.wallet({ name: "updater" })compose dev --fork-chainsevm.wallet({ privateKey: env.MY_KEY, sponsorGas: true })secrets:goldsky compose secret set --name X --value Ycompose secret sync.envcontext.env/compose-referencehttps://app.goldsky.com/<project_id>/dashboard/compose/<app-name>onReorg: replay# compose.yaml (task entry)
- name: manual_fire
path: src/tasks/manual-fire.ts
triggers:
- type: http
authentication: auth_token// src/tasks/manual-fire.ts
import type { TaskContext } from "compose";
export async function main({ logEvent }: TaskContext, params: { amount: number }) {
await logEvent({ code: "fired", message: "manual", data: params });
return { ok: true, received: params.amount };
}curl -X POST -H "Authorization: Bearer $TOKEN" -d '{"amount": 42}' https://<app-url>/tasks/manual_fire- name: on_transfer
path: src/tasks/on-transfer.ts
triggers:
- type: onchain_event
network: polygon_amoy
contract: "0xYourContract"
events:
- "Transfer(address,address,uint256)"import type { TaskContext } from "compose";
export async function main(
{ evm, logEvent }: TaskContext,
params: { log: { topics: string[]; data: string; address: string } },
) {
const decoded = await evm.decodeEventLog(
[{ type: "event", name: "Transfer", inputs: [/* ABI inputs */] }],
params.log,
);
await logEvent({ code: "transfer", message: "seen", data: decoded });
}const wallet = await evm.wallet({ name: "my-oracle" }); // sponsorGas defaults TRUE
const tx = await wallet.writeContract(
evm.chains.base,
env.FEED_ADDRESS,
"setPrice(uint256)",
[1234n],
);const wallet = await evm.wallet({
privateKey: env.MY_KEY,
sponsorGas: true, // MUST opt in; defaults FALSE
});const runs = await collection<{ id: string; ts: number }>("runs");
await runs.setById("latest", { id: "latest", ts: Date.now() });
const recent = await runs.findOne({ ts: { $gt: Date.now() - 86_400_000 } });src/contracts/Oracle.jsongoldsky compose codegeninitdevdeployevm.contracts.Oracle/compose-referencegoldsky project list 2>&1/auth-setuppolygonAmoybasesponsorGas: trueapi_versionstablegoldsky compose init <name>compose.yamlsecrets:goldsky compose secret set --name X --value Y.envcompose secret syncgoldsky compose wallet create --name <name>wallet list.envenv.Xgoldsky compose dev--fork-chainsgoldsky compose callTask <name> '<json>'goldsky compose deploygoldsky compose status --json # expect .status == "RUNNING"
goldsky compose logs -f # expect app-specific log lineshttps://app.goldsky.com/<project_id>/dashboard/compose/<app-name>compose dev--fork-chainssponsorGas: true.envcompose secret synccompose deploy --sync-envapi_versionstable/compose-doctor/compose-reference/auth-setupgoldsky login/secrets