Sign Transaction
Overview
This SDK method allows you to create a user operation for signing and executing a custom transaction from your Account Abstraction account.
Method
xellar.accountAbstraction.create.signTransaction({
accountId: string,
to: string,
value: string,
callData: string,
});
Parameters
accountId
(required): The ID of your Account Abstraction account.to
(required): The target contract address.value
(required): The amount of native coins to send with the transaction. Must include decimals (e.g., for 1 ETH with 18 decimals, use "1000000000000000000").callData
(required): The encoded function call data.
Response
The response will include an object with the following properties:
userOpId
(string): The unique identifier of the user operation.hash
(string): The hash of the user operation.validUntil
(number): The timestamp until which the user operation is valid.
Example Response
{
"userOpId": "uop_123456789",
"hash": "0x1234...",
"validUntil": 1234567890
}
⚠️
The user operation must be signed and submitted before the validUntil
timestamp expires.
ℹ️
After creating the user operation, you need to sign it using the
signMessageHash
method and then submit it using the submitUserOp
method.
⚠️
Make sure to include the correct number of decimals in the value parameter. For example, if you want to send 1 ETH (which has 18 decimals), the value should be "1000000000000000000".