Paymaster SDK
ERC-4337 gas sponsorship — sponsor transactions, estimate fees, check ratesOperations
| Method | Description |
|---|---|
lucidSponsorUserOp | Sponsor a UserOp with $LUCID |
lucidGetPaymasterRate | Get LUCID/ETH exchange rate |
lucidEstimateGasLucid | Estimate gas cost in $LUCID |
Generated Reference
Overview
ERC-4337 gas sponsorship — sponsor transactions, estimate fees, check ratesAvailable Operations
- lucidSponsorUserOp - Sponsor a UserOp with $LUCID
- lucidGetPaymasterRate - Get LUCID/ETH exchange rate
- lucidEstimateGasLucid - Estimate gas cost in $LUCID
lucidSponsorUserOp
Sponsor an ERC-4337 UserOperation by paying the gas cost in LUCID tokens. The paymaster signs the UserOp and deducts LUCID from the sender’s balance at the current exchange rate.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.SponsorUserOpRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.SuccessResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidGetPaymasterRate
Retrieve the current LUCID-per-ETH exchange rate used for gas sponsoring on a specific EVM chain. The rate determines how much LUCID is charged per gas unit.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidGetPaymasterRateRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.PaymasterRateResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidEstimateGasLucid
Estimate the LUCID token cost for a UserOperation before submitting it. Returns the estimated gas in ETH and the equivalent LUCID amount at the current exchange rate.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.EstimateGasRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.SuccessResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)