Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kynesys.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Base Operation

The base operation allow you to group work steps and operations for execution without any additional logic.
import {
    BaseOperation,
    DemosWork,
    prepareXMStep,
} from "@kynesyslabs/demosdk/demoswork"

// Work steps — pass a fully-formed XMScript to prepareXMStep.
// See "Creating Work Steps" for how to build sendEth / sendSol.
const sendEth = prepareXMStep(ethXmScript)
const sendSol = prepareXMStep(solXmScript)

// Base operation
const base = new BaseOperation()
base.addWork(sendEth, sendSol)

const work = new DemosWork()
work.push(base)
Work steps are created and added to the base operation using the addWork method. You can also pass the work steps and operations to the constructor of the BaseOperation class.
const base = new BaseOperation(checkBTCPrice, checkEthPrice)
You can also use operations (eg. conditional operation) and work steps with the BaseOperation class.