2.6.2 • Published 2 years ago
@switchboard-xyz/task-runner v2.6.2
Task Runner
Install
yarn install
yarn build
ctx
cache
stores items in a temporary cache to share with future job executions
- Anchor IDL's for fetching on-chain accountInfo
- Websockets
- Websocket responses
- Websocket subscriptionss
clients
clients with helper functions for various protocols
- switchboard
- serum
- saber
- raydium
- pyth
- port
- orca
- mercurial
- mango
- jupiter
- chainlink
logger
logger to be used
task
task runner for the OracleJob
interface
const ctx = new JobContext(
taskRunner,
"",
OracleJob.fromObject({}),
undefined,
input ?? ""
);
const result: ITaskResult = await ctx.task.run(ctx, {
valueTask: {
scalar,
},
});
worker
workerpool to off-load CPU related tasks
- can be disabled with
DISABLE_WORKERPOOL
- can disable websocket workers with
DISABLE_WORKERPOOL_WEBSOCKET
- can disable jsonpath worker with
DISABLE_WORKERPOOL_JSONPATH
- can disable twap worker with
DISABLE_WORKERPOOL_TWAP
TaskRunnerReceipt
Returns a receipt of the TaskRunner execution containing the job ID, OracleJob, and an array of TaskResult's for each top level task.
const receipt = await taskRunner.perform(PublicKey.default.toString(), job);
if ("error" in receipt) {
throw new Error(`Job failed with error ${receipt.error}`);
}
console.log(receipt.result);
2.6.2
2 years ago
2.7.0-beta.0
2 years ago
2.6.0
2 years ago
2.5.5
2 years ago
2.5.4
2 years ago
2.5.3
2 years ago
2.5.2
2 years ago
2.5.1
2 years ago
2.5.0
2 years ago
2.2.1
2 years ago
2.2.0
2 years ago
2.1.12
2 years ago
2.1.11
2 years ago
2.1.10
2 years ago
2.1.9
2 years ago
2.1.8
2 years ago
2.1.7
2 years ago
2.1.6
2 years ago
2.1.5
2 years ago
2.1.4
2 years ago
2.1.3
2 years ago
2.1.2
2 years ago