Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Operations API Reference

All operation classes and their methods.

Common Interface

All operations implement:

interface IOperation {
    type: OperationType;
    toCalldata(): Call;
}

FundOperation

class FundOperation {
    type: OperationType.Fund;
    approve?: Call;

    async populateApprove(): Promise<void>;
    toCalldata(): Call;
}

TransferOperation

class TransferOperation {
    type: OperationType.Transfer;

    toCalldata(): Call;
}

WithdrawOperation

class WithdrawOperation {
    type: OperationType.Withdraw;

    toCalldata(): Call;
}

RollOverOperation

class RollOverOperation {
    type: OperationType.Rollover;

    toCalldata(): Call;
}

RagequitOperation

class RagequitOperation {
    type: OperationType.Ragequit;

    toCalldata(): Call;
}

Usage

// Create operation
const op = await account.transfer({...});

// Convert to calldata
const calldata = op.toCalldata();

// Execute
await signer.execute([calldata]);