Transfer Native Coin
Overview
This SDK method allows you to create a user operation for transferring native coins (e.g., ETH) from your Account Abstraction account.
Method
xellar.accountAbstraction.create.sendNative({
accountId: string,
to: string,
amount: string,
});
Parameters
accountId
(required): The ID of your Account Abstraction account.to
(required): The recipient's address.amount
(required): The amount of native coins to transfer. Must include decimals (e.g., for 1 ETH with 18 decimals, use "1000000000000000000").
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 amount parameter. For example, if you want to transfer 1 ETH (which has 18 decimals), the amount should be "1000000000000000000".