Skip to content

Commit a70f875

Browse files
authored
fear: stellar gas abstraction (#231)
* feat: add support for stellar gas abstraction * feat: add stellar sponsored examples * chore: remove js files * chore: rebuild sdk * chore: improvements * chore: improvements * chore: improvements * chore: improvements * chore: improvements * chore: improvements
1 parent 8b5c2cf commit a70f875

283 files changed

Lines changed: 3913 additions & 1110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,5 @@ env.d.ts
218218
dist/
219219

220220
.qodo
221+
222+
.nx/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# @openzeppelin/relayer-sdk
22

3+
<<<<<<< HEAD
4+
=======
35

46
## 1.8.0 (2025-12-02)
57

68
- feat: add headers to plugin context type ([#233](https://github.com/OpenZeppelin/openzeppelin-relayer-sdk/pull/233))
79
- fix: fix the failing build ([#236](https://github.com/OpenZeppelin/openzeppelin-relayer-sdk/pull/236))
810

11+
>>>>>>> main
912
## 1.7.0 (2025-11-10)
1013

1114
- feat: introduce rpc client logic and examples ([#225](https://github.com/OpenZeppelin/openzeppelin-relayer-sdk/pull/225))

docs/.openapi-generator/FILES

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Models/ApiResponse_SignTransactionResponse.md
2525
Models/ApiResponse_SignTransactionResponse_data.md
2626
Models/ApiResponse_SignerResponse.md
2727
Models/ApiResponse_SignerResponse_data.md
28+
Models/ApiResponse_SponsoredTransactionBuildResponse.md
29+
Models/ApiResponse_SponsoredTransactionBuildResponse_data.md
30+
Models/ApiResponse_SponsoredTransactionQuoteResponse.md
31+
Models/ApiResponse_SponsoredTransactionQuoteResponse_data.md
2832
Models/ApiResponse_String.md
2933
Models/ApiResponse_TransactionResponse.md
3034
Models/ApiResponse_TransactionResponse_data.md
@@ -49,9 +53,6 @@ Models/ContractSource.md
4953
Models/ContractSource_oneOf.md
5054
Models/ContractSource_oneOf_1.md
5155
Models/CreateRelayerPolicyRequest.md
52-
Models/CreateRelayerPolicyRequest_oneOf.md
53-
Models/CreateRelayerPolicyRequest_oneOf_1.md
54-
Models/CreateRelayerPolicyRequest_oneOf_2.md
5556
Models/CreateRelayerRequest.md
5657
Models/DeletePendingTransactionsResponse.md
5758
Models/DisabledReason.md
@@ -67,8 +68,6 @@ Models/EvmRpcResult.md
6768
Models/EvmTransactionDataSignature.md
6869
Models/EvmTransactionRequest.md
6970
Models/EvmTransactionResponse.md
70-
Models/FeeEstimateRequestParams.md
71-
Models/FeeEstimateResult.md
7271
Models/GetFeaturesEnabledResult.md
7372
Models/GetSupportedTokensItem.md
7473
Models/GetSupportedTokensResult.md
@@ -109,8 +108,6 @@ Models/PaginationMeta.md
109108
Models/PluginCallRequest.md
110109
Models/PluginHandlerError.md
111110
Models/PluginMetadata.md
112-
Models/PrepareTransactionRequestParams.md
113-
Models/PrepareTransactionResult.md
114111
Models/RelayerEvmPolicy.md
115112
Models/RelayerNetworkPolicy.md
116113
Models/RelayerNetworkPolicyResponse.md
@@ -123,6 +120,7 @@ Models/RelayerSolanaPolicy.md
123120
Models/RelayerSolanaSwapConfig.md
124121
Models/RelayerStatus.md
125122
Models/RelayerStellarPolicy.md
123+
Models/RelayerStellarSwapConfig.md
126124
Models/RpcConfig.md
127125
Models/SignAndSendTransactionRequestParams.md
128126
Models/SignAndSendTransactionResult.md
@@ -154,9 +152,13 @@ Models/SignerTypeRequest.md
154152
Models/SolanaAccountMeta.md
155153
Models/SolanaAllowedTokensPolicy.md
156154
Models/SolanaAllowedTokensSwapConfig.md
155+
Models/SolanaFeeEstimateRequestParams.md
156+
Models/SolanaFeeEstimateResult.md
157157
Models/SolanaFeePaymentStrategy.md
158158
Models/SolanaInstructionSpec.md
159159
Models/SolanaPolicyResponse.md
160+
Models/SolanaPrepareTransactionRequestParams.md
161+
Models/SolanaPrepareTransactionResult.md
160162
Models/SolanaRpcRequest.md
161163
Models/SolanaRpcRequest_oneOf.md
162164
Models/SolanaRpcRequest_oneOf_1.md
@@ -180,10 +182,28 @@ Models/SolanaSwapStrategy.md
180182
Models/SolanaTransactionRequest.md
181183
Models/SolanaTransactionResponse.md
182184
Models/Speed.md
185+
Models/SponsoredTransactionBuildRequest.md
186+
Models/SponsoredTransactionBuildResponse.md
187+
Models/SponsoredTransactionQuoteRequest.md
188+
Models/SponsoredTransactionQuoteResponse.md
189+
Models/StellarAllowedTokensPolicy.md
190+
Models/StellarAllowedTokensSwapConfig.md
191+
Models/StellarFeeEstimateRequestParams.md
192+
Models/StellarFeeEstimateResult.md
193+
Models/StellarFeePaymentStrategy.md
183194
Models/StellarPolicyResponse.md
195+
Models/StellarPrepareTransactionRequestParams.md
196+
Models/StellarPrepareTransactionResult.md
184197
Models/StellarRpcRequest.md
185198
Models/StellarRpcRequest_oneOf.md
186199
Models/StellarRpcResult.md
200+
Models/StellarSwapStrategy.md
201+
Models/StellarTokenKind.md
202+
Models/StellarTokenKind_oneOf.md
203+
Models/StellarTokenKind_oneOf_1.md
204+
Models/StellarTokenKind_oneOf_1_contract.md
205+
Models/StellarTokenKind_oneOf_classic.md
206+
Models/StellarTokenMetadata.md
187207
Models/StellarTransactionRequest.md
188208
Models/StellarTransactionResponse.md
189209
Models/TransactionResponse.md

docs/Apis/RelayersApi.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All URIs are relative to *http://localhost*
44

55
| Method | HTTP request | Description |
66
|------------- | ------------- | -------------|
7+
| [**buildSponsoredTransaction**](RelayersApi.md#buildSponsoredTransaction) | **POST** /api/v1/relayers/{relayer_id}/transactions/sponsored/build | Prepares a sponsored (gasless) transaction with fee payments. |
78
| [**cancelTransaction**](RelayersApi.md#cancelTransaction) | **DELETE** /api/v1/relayers/{relayer_id}/transactions/{transaction_id} | Cancels a specific transaction by its ID. |
89
| [**createRelayer**](RelayersApi.md#createRelayer) | **POST** /api/v1/relayers | Creates a new relayer. |
910
| [**deletePendingTransactions**](RelayersApi.md#deletePendingTransactions) | **DELETE** /api/v1/relayers/{relayer_id}/transactions/pending | Deletes all pending transactions for a specific relayer. |
@@ -15,6 +16,7 @@ All URIs are relative to *http://localhost*
1516
| [**getTransactionByNonce**](RelayersApi.md#getTransactionByNonce) | **GET** /api/v1/relayers/{relayer_id}/transactions/by-nonce/{nonce} | Retrieves a transaction by its nonce value. |
1617
| [**listRelayers**](RelayersApi.md#listRelayers) | **GET** /api/v1/relayers | Relayer routes implementation |
1718
| [**listTransactions**](RelayersApi.md#listTransactions) | **GET** /api/v1/relayers/{relayer_id}/transactions/ | Lists all transactions for a specific relayer with pagination. |
19+
| [**quoteSponsoredTransaction**](RelayersApi.md#quoteSponsoredTransaction) | **POST** /api/v1/relayers/{relayer_id}/transactions/sponsored/quote | Estimates fees for a sponsored (gasless) transaction. |
1820
| [**replaceTransaction**](RelayersApi.md#replaceTransaction) | **PUT** /api/v1/relayers/{relayer_id}/transactions/{transaction_id} | Replaces a specific transaction with a new one. |
1921
| [**rpc**](RelayersApi.md#rpc) | **POST** /api/v1/relayers/{relayer_id}/rpc | Performs a JSON-RPC call using the specified relayer. |
2022
| [**sendTransaction**](RelayersApi.md#sendTransaction) | **POST** /api/v1/relayers/{relayer_id}/transactions | Sends a transaction through the specified relayer. |
@@ -24,6 +26,34 @@ All URIs are relative to *http://localhost*
2426
| [**updateRelayer**](RelayersApi.md#updateRelayer) | **PATCH** /api/v1/relayers/{relayer_id} | Updates a relayer&#39;s information based on the provided update request. |
2527

2628

29+
<a name="buildSponsoredTransaction"></a>
30+
# **buildSponsoredTransaction**
31+
> ApiResponse_SponsoredTransactionBuildResponse buildSponsoredTransaction(relayer\_id, SponsoredTransactionBuildRequest)
32+
33+
Prepares a sponsored (gasless) transaction with fee payments.
34+
35+
This endpoint builds a transaction where the relayer will pay the network fees on behalf of the user. The user pays fees in a token of their choice (e.g., USDC) instead of the native network currency. The endpoint accepts either a pre-built transaction XDR or a set of operations to build a transaction from. It returns a prepared transaction that includes: - The transaction XDR (base64 encoded) ready for signing - The fee amount in both the fee token and native currency (stroops for Stellar) - The fee token identifier - The transaction validity timestamp After receiving the prepared transaction, the user must sign it and submit it through the standard transaction submission endpoint. For Stellar, the transaction will be wrapped in a fee-bump transaction where the relayer pays the network fees.
36+
37+
### Parameters
38+
39+
|Name | Type | Description | Notes |
40+
|------------- | ------------- | ------------- | -------------|
41+
| **relayer\_id** | **String**| The unique identifier of the relayer | [default to null] |
42+
| **SponsoredTransactionBuildRequest** | [**SponsoredTransactionBuildRequest**](../Models/SponsoredTransactionBuildRequest.md)| | |
43+
44+
### Return type
45+
46+
[**ApiResponse_SponsoredTransactionBuildResponse**](../Models/ApiResponse_SponsoredTransactionBuildResponse.md)
47+
48+
### Authorization
49+
50+
[bearer_auth](../README.md#bearer_auth)
51+
52+
### HTTP request headers
53+
54+
- **Content-Type**: application/json
55+
- **Accept**: application/json
56+
2757
<a name="cancelTransaction"></a>
2858
# **cancelTransaction**
2959
> ApiResponse_TransactionResponse cancelTransaction(relayer\_id, transaction\_id)
@@ -307,6 +337,34 @@ Lists all transactions for a specific relayer with pagination.
307337
- **Content-Type**: Not defined
308338
- **Accept**: application/json
309339

340+
<a name="quoteSponsoredTransaction"></a>
341+
# **quoteSponsoredTransaction**
342+
> ApiResponse_SponsoredTransactionQuoteResponse quoteSponsoredTransaction(relayer\_id, SponsoredTransactionQuoteRequest)
343+
344+
Estimates fees for a sponsored (gasless) transaction.
345+
346+
This endpoint provides fee estimation for transactions where the relayer will pay the network fees on behalf of the user. The user pays fees in a token of their choice (e.g., USDC) instead of the native network currency (e.g., XLM for Stellar). The endpoint accepts either a pre-built transaction XDR or a set of operations to build a transaction from. It returns the estimated fee amount in the specified fee token and the conversion rate from the native currency.
347+
348+
### Parameters
349+
350+
|Name | Type | Description | Notes |
351+
|------------- | ------------- | ------------- | -------------|
352+
| **relayer\_id** | **String**| The unique identifier of the relayer | [default to null] |
353+
| **SponsoredTransactionQuoteRequest** | [**SponsoredTransactionQuoteRequest**](../Models/SponsoredTransactionQuoteRequest.md)| | |
354+
355+
### Return type
356+
357+
[**ApiResponse_SponsoredTransactionQuoteResponse**](../Models/ApiResponse_SponsoredTransactionQuoteResponse.md)
358+
359+
### Authorization
360+
361+
[bearer_auth](../README.md#bearer_auth)
362+
363+
### HTTP request headers
364+
365+
- **Content-Type**: application/json
366+
- **Accept**: application/json
367+
310368
<a name="replaceTransaction"></a>
311369
# **replaceTransaction**
312370
> ApiResponse_TransactionResponse replaceTransaction(relayer\_id, transaction\_id, NetworkTransactionRequest)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ApiResponse_SponsoredTransactionBuildResponse
2+
## Properties
3+
4+
| Name | Type | Description | Notes |
5+
|------------ | ------------- | ------------- | -------------|
6+
| **data** | [**ApiResponse_SponsoredTransactionBuildResponse_data**](ApiResponse_SponsoredTransactionBuildResponse_data.md) | | [optional] [default to null] |
7+
| **error** | **String** | | [optional] [default to null] |
8+
| **metadata** | [**PluginMetadata**](PluginMetadata.md) | | [optional] [default to null] |
9+
| **pagination** | [**PaginationMeta**](PaginationMeta.md) | | [optional] [default to null] |
10+
| **success** | **Boolean** | | [default to null] |
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ApiResponse_SponsoredTransactionBuildResponse_data
2+
## Properties
3+
4+
| Name | Type | Description | Notes |
5+
|------------ | ------------- | ------------- | -------------|
6+
| **fee\_in\_lamports** | **String** | | [default to null] |
7+
| **fee\_in\_spl** | **String** | | [default to null] |
8+
| **fee\_token** | **String** | Asset identifier for fee token | [default to null] |
9+
| **transaction** | **String** | Extended transaction XDR (base64 encoded) | [default to null] |
10+
| **valid\_until\_blockheight** | **Long** | | [default to null] |
11+
| **fee\_in\_stroops** | **String** | Fee amount in stroops (as string) | [default to null] |
12+
| **fee\_in\_token** | **String** | Fee amount in token (raw units as string) | [default to null] |
13+
| **fee\_in\_token\_ui** | **String** | Fee amount in token (decimal UI representation as string) | [default to null] |
14+
| **valid\_until** | **String** | Transaction validity timestamp (ISO 8601 format) | [default to null] |
15+
16+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
17+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ApiResponse_SponsoredTransactionQuoteResponse
2+
## Properties
3+
4+
| Name | Type | Description | Notes |
5+
|------------ | ------------- | ------------- | -------------|
6+
| **data** | [**ApiResponse_SponsoredTransactionQuoteResponse_data**](ApiResponse_SponsoredTransactionQuoteResponse_data.md) | | [optional] [default to null] |
7+
| **error** | **String** | | [optional] [default to null] |
8+
| **metadata** | [**PluginMetadata**](PluginMetadata.md) | | [optional] [default to null] |
9+
| **pagination** | [**PaginationMeta**](PaginationMeta.md) | | [optional] [default to null] |
10+
| **success** | **Boolean** | | [default to null] |
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ApiResponse_SponsoredTransactionQuoteResponse_data
2+
## Properties
3+
4+
| Name | Type | Description | Notes |
5+
|------------ | ------------- | ------------- | -------------|
6+
| **conversion\_rate** | **String** | Conversion rate from XLM to token (as string) | [default to null] |
7+
| **estimated\_fee** | **String** | | [default to null] |
8+
| **fee\_in\_token** | **String** | Estimated fee in token amount (raw units as string) | [default to null] |
9+
| **fee\_in\_token\_ui** | **String** | Estimated fee in token amount (decimal UI representation as string) | [default to null] |
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+

docs/Models/CreateRelayerPolicyRequest.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,26 @@
33

44
| Name | Type | Description | Notes |
55
|------------ | ------------- | ------------- | -------------|
6-
| **Evm** | [**RelayerEvmPolicy**](RelayerEvmPolicy.md) | | [default to null] |
7-
| **Solana** | [**RelayerSolanaPolicy**](RelayerSolanaPolicy.md) | | [default to null] |
8-
| **Stellar** | [**RelayerStellarPolicy**](RelayerStellarPolicy.md) | | [default to null] |
6+
| **eip1559\_pricing** | **Boolean** | | [optional] [default to null] |
7+
| **gas\_limit\_estimation** | **Boolean** | | [optional] [default to null] |
8+
| **gas\_price\_cap** | **Integer** | | [optional] [default to null] |
9+
| **min\_balance** | **Long** | | [optional] [default to null] |
10+
| **private\_transactions** | **Boolean** | | [optional] [default to null] |
11+
| **whitelist\_receivers** | **List** | | [optional] [default to null] |
12+
| **allowed\_accounts** | **List** | | [optional] [default to null] |
13+
| **allowed\_programs** | **List** | | [optional] [default to null] |
14+
| **allowed\_tokens** | [**List**](StellarAllowedTokensPolicy.md) | | [optional] [default to null] |
15+
| **disallowed\_accounts** | **List** | | [optional] [default to null] |
16+
| **fee\_margin\_percentage** | **Float** | | [optional] [default to null] |
17+
| **fee\_payment\_strategy** | [**StellarFeePaymentStrategy**](StellarFeePaymentStrategy.md) | Fee payment strategy - determines who pays transaction fees (optional) | [optional] [default to null] |
18+
| **max\_allowed\_fee\_lamports** | **Long** | | [optional] [default to null] |
19+
| **max\_signatures** | **Integer** | | [optional] [default to null] |
20+
| **max\_tx\_data\_size** | **Integer** | | [optional] [default to null] |
21+
| **swap\_config** | [**RelayerStellarSwapConfig**](RelayerStellarSwapConfig.md) | | [optional] [default to null] |
22+
| **concurrent\_transactions** | **Boolean** | | [optional] [default to null] |
23+
| **max\_fee** | **Integer** | | [optional] [default to null] |
24+
| **slippage\_percentage** | **Float** | | [optional] [default to null] |
25+
| **timeout\_seconds** | **Long** | | [optional] [default to null] |
926

1027
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1128

docs/Models/FeeEstimateRequestParams.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
| Name | Type | Description | Notes |
55
|------------ | ------------- | ------------- | -------------|
6-
| **fee\_token** | **String** | | [default to null] |
7-
| **transaction** | **String** | | [default to null] |
6+
| **fee\_token** | **String** | Asset identifier for fee token (e.g., \&quot;native\&quot; or \&quot;USDC:GA5Z...\&quot;) | [default to null] |
7+
| **operations** | [**List**](OperationSpec.md) | Operations array to build transaction from Mutually exclusive with transaction_xdr field | [optional] [default to null] |
8+
| **source\_account** | **String** | Source account address (required when operations are provided) For sponsored transactions, this should be the user&#39;s account address | [optional] [default to null] |
9+
| **transaction\_xdr** | **String** | Pre-built transaction XDR (base64 encoded, signed or unsigned) Mutually exclusive with operations field | [optional] [default to null] |
810

911
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1012

0 commit comments

Comments
 (0)