getOrderPath
Get the path of an order, ie the required intents to fulfill an execution on a target chain.
Usage
const { orderBundle, injectedExecutions } = await orchestrator.getOrderPath(
metaIntent: {
targetChainId: 8453, // Base
tokenTransfers: [
{
tokenAddress: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
amount: 2n,
},
],
targetAccount: '0x9EB7504B7546b1B66e177B364A3566eC10132A40',
targetExecutions: [{
target: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
value: 0n,
callData: encodeFunctionData({
abi: erc20Abi,
functionName: 'transfer',
args: ['0xD1dcdD8e6Fe04c338aC3f76f7D7105bEcab74F77', 1n],
}),
}],
// empty example userOp
userOp: {
sender: zeroAddress,
nonce: 0n,
initCode: '0x',
callData: '0x',
accountGasLimits: zeroHash,
preVerificationGas: 0n,
gasFees: zeroHash,
paymasterAndData: '0x',
signature: '0x',
}
},
userId: 'd6f64241-a62c-4542-bb23-e78d7e1e0cd6',
)
Parameters
metaIntent.targetChainId
- Type:
number
The chain id of the target chain.
metaIntent.tokenTransfers
- Type:
TokenTransfer[]
The token transfers to make in the order.
metaIntent.targetAccount
The address of the target account to receive the funds and execute the execution on.
metaIntent.targetExecutions
- Type:
Execution[]
The executions to make on the target chain.
metaIntent.userOp
- Type:
PackedUserOperation
The user operation to make on the target chain. Note that this is only required when the account is not yet deployed.
metaIntent.accountAccessList (optional)
- Type:
AccountAccessList
The account access list to use for the order.
userId
- Type:
string
The ID of the user account to get the order path for.
Returns
orderBundle
- Type:
Promise<SignedIntent>
The signed intent to execute the order.
injectedExecutions
- Type:
Execution[]
A list of executions to add into the order in order to make sure it is able to execute correctly.