Smart Account
sa_getSmartAccount
Get the smart account of address. Smart account has the same value in all networks. In other words, the smart account of the same address is the same in the Ether mainnet and the BSC mainnet.
Parameters
Name | Type | Description |
---|---|---|
address | String | Address |
Return Value
Name | Type | Description |
---|---|---|
smartAccount | String | Smart account of address |
Example
sa_getUserOpReceipt
Queries the results of user operation. Unlike regular transactions, user operation must call sc_getUserOpReceipt to check whether execution was successful.
Parameters
Name | Type | Description |
---|---|---|
userOpHash | String | User operation hash |
Return Value
Name | Type | Description |
---|---|---|
userOpHash | String | User operation hash |
success | String | “true” or “false” |
actualGasCost | BigInteger | Gas cost used |
actualGasUsed | BigInteger | Gas volume used |
reason | String | Error details in case of failure |
status |
| Transaction status value See below |
transactionHash | String | Transaction hash |
Transaction status value
Code | Description |
---|---|
0x1 | Success |
0x0 | Fail |
Example
If userOpHash is invalid or pending, the error below is returned.
sa_erc20_transfer
Create and submit an ERC20 token transfer transaction using user operation. The result is a user operation hash. You can check the success of the returned user operation hash through sc_getUserOpReceipt.
Because it is processed as a user operation, it is processed even if neither the owner nor the sender have a balance in the network's main coin (e.g. Ether, BNB) for gas fees. The gas fee will be paid on your behalf from your predefined payment master account.
Parameters
Name | Type | Description |
---|---|---|
contractAddress | String | Token contract address |
owner | String | Owner address of smart account |
sender | String | Sender address (Must be a smart account) |
toAddress | String | To address |
amount | BigDecimal | Amount of transfer |
gasPrice | BigDecimal | Gas price |
tempKey | String | tempKey for “transfer” |
hashKey | String | hash(tempKey | secretKey) |
signature | String | sign ( hash ( contractAddress | owner | sender | toAddress | amount | tempKey | hashKey ) ) by owner’s privateKey using signData API |
Return Value
Name | Type | Description |
---|---|---|
userOpHash | String | User Operation Hash |
Example
Last updated