SelfPlanAndSendFunctions

type SelfPlanAndSendFunctions = object;

Methods that allow an instruction or instruction plan to plan and send itself.

These methods are added to instruction or instruction plan objects via addSelfPlanAndSendFunctions, enabling a fluent API where you can call .sendTransaction() directly on an instruction without passing it to a separate function.

Examples

Sending a transfer instruction directly.

const result = await getTransferInstruction({ source, destination, amount }).sendTransaction();

Planning multiple transactions from an instruction plan.

const plan = await getComplexInstructionPlan(/* ... */).planTransactions();

See

addSelfPlanAndSendFunctions

Properties

planTransaction()

planTransaction: (config?) => ReturnType<PlanTransaction>;

Plans a single transaction.

Parameters

ParameterType
config?Parameters<PlanTransaction>[1]

Returns

ReturnType<PlanTransaction>


planTransactions()

planTransactions: (config?) => ReturnType<PlanTransactions>;

Plans one or more transactions.

Parameters

ParameterType
config?Parameters<PlanTransactions>[1]

Returns

ReturnType<PlanTransactions>


sendTransaction()

sendTransaction: (config?) => ReturnType<SendTransaction>;

Sends a single transaction.

Parameters

ParameterType
config?Parameters<SendTransaction>[1]

Returns

ReturnType<SendTransaction>


sendTransactions()

sendTransactions: (config?) => ReturnType<SendTransactions>;

Sends one or more transactions.

Parameters

ParameterType
config?Parameters<SendTransactions>[1]

Returns

ReturnType<SendTransactions>

On this page