@spritz-finance/api-client 0.4.21 → 0.4.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -846,6 +846,40 @@ When creating a payment request, you can specify how the amount should be calcul
846
846
 
847
847
  This allows you to control whether fees are included in or added to the specified amount.
848
848
 
849
+ #### Fee Subsidies (Integrator Feature)
850
+
851
+ Integrators can subsidize transaction fees on behalf of their users. When enabled, you can cover part or all of the transaction fees, which Spritz will invoice to you separately.
852
+
853
+ > **Note**: Fee subsidies are a gated feature and must be enabled by the Spritz team before use. Contact Spritz to request access.
854
+
855
+ **Parameters:**
856
+
857
+ - **`feeSubsidyPercentage`** (string): The percentage of the transaction fee you want to subsidize for the user. For example, `"100"` covers the entire fee, `"50"` covers half.
858
+ - **`maxFeeSubsidyAmount`** (string, optional): The maximum dollar amount you're willing to subsidize per transaction. If the fee exceeds this cap, the user pays the difference.
859
+
860
+ **How it works:**
861
+
862
+ 1. Set `feeSubsidyPercentage` to define what portion of fees you'll cover
863
+ 2. Optionally set `maxFeeSubsidyAmount` to cap your exposure
864
+ 3. Spritz invoices you separately for the subsidized amounts
865
+ 4. Users see reduced or zero fees on their transactions
866
+
867
+ **Example:**
868
+
869
+ ```typescript
870
+ // Cover 100% of fees up to $5 per transaction
871
+ const paymentRequest = await client.paymentRequest.create({
872
+ amount: 100,
873
+ accountId: account.id,
874
+ network: PaymentNetwork.Ethereum,
875
+ feeSubsidyPercentage: '100',
876
+ maxFeeSubsidyAmount: '5',
877
+ })
878
+
879
+ // If transaction fee is $3: integrator pays $3, user pays $0
880
+ // If transaction fee is $8: integrator pays $5, user pays $3
881
+ ```
882
+
849
883
  ```typescript
850
884
  import {PaymentNetwork, AmountMode} from '@spritz-finance/api-client';
851
885
 
@@ -900,7 +934,6 @@ const transactionData = await client.paymentRequest.getWeb3PaymentParams({
900
934
  calldata: '0xd71d9632000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000000000000000000064539a31c1ac408007b12277',
901
935
  value: null,
902
936
  requiredTokenInput: '100000000',
903
- suggestedGasLimit: '110000'
904
937
  }
905
938
  ```
906
939