How fee sponsorship works
Whether it is an onramp or swap, each Halliday payment has an input currency amount and an output currency amount. Users fund their payment with the specified input amount and expect an approximate output amount based on conversion price, slippage, and fees. Due to the fact that the input amount is fixed, payment fees are incurred on the output currency amount. When fee sponsorship is enabled, a Halliday payment’s output amount is topped up with an approximate amount of the output currency, in effect, covering the fees of a payment. The app developer provides sponsorship for each payment from a single onchain balance of tokens.Sponsorship balance
When enabling this Halliday feature, app developers are assigned an address which holds a balance of the output token as well as the gas token of the output token’s chain. To enable this feature, app developers must toggle fee sponsorship on in the Configuration section of the Halliday developer dashboard.
Configuration and profile
The developer must set the maximum USD amount to cover in the dashboard. After this is configured, specific payments on the organization’s API keys will include fee sponsorship. Sponsorship profiles can be made in the dashboard. Each carries aroutes array and can cover multiple output tokens.
The developer can make make multiple sponsorship profiles, each with its own ID. This profile ID is specified when individual payment quotes are signed and confirmed (see below).
Developers are responsible for maintaining the token balance that is used for fee sponsorship. If the fee sponsorship balance runs out, the end users will cover 100% of their payment fees while the balance is zero without the opportunity for reimbursement.
Eligible Routes
The fee sponsorhip profile builder in the Halliday dashboard has a selector field that limits the input and output tokens shown to valid routes.
Fee sponsorship technical details
Fee sponsorship works for integrations that utilize the Halliday SDK or the Halliday API. To avoid unauthorized use of fee sponsorship, the app developer must cryptographically sign payment quotes using their Halliday secret key. After the quote is signed, it is then confirmed via the Halliday API before the user can fund the payment with the input currency. Quote requests will fail if a signature in the request body is invalid or has already been used. App developers must host infrastructure to provide on-demand quote signatures. It is recommended that the developer host their own API endpoint in which sponsorships are validated and signed using the Halliday secret key. The next section is a walkthrough of configuring the client-side code with the SDK. For apps that use the Halliday API directly instead of the SDK, the following section can be skipped.Client-side SDK configuration for fee sponsorship
Fee sponsorship settings in the SDK widget require an object with two parameters that is passed to the Halliday SDK configuration. TheprofileName is a string that is the name of the sponsorship profile. This is initially created in the Halliday dashboard.
The generateGrant function is passed a quote payload. It must return the signature as a string wrapped in a JavaScript promise.
The payload passed to generateGrant has the following types.
- React
- JavaScript
copy
Client-side API configuration for fee sponsorship
For developers using the API directly from front-end applications instead of the Halliday SDK, the process requires one additional step. Before fetching a collection of quotes from the Halliday API, a signed sponsorship grant payload needs to be created and signed. Thisfee_sponsorship object needs to be included in the /payments/quotes POST request body.
The following is an example for creating the grant_payload that needs to subsequently be signed using the Halliday secret key.
grant_payload using the secret key.
Server-side configuration for fee sponsorship
App developers must create and provide access to a service for cryptographic signing of payment quotes that utilize fee sponsorship. These signatures are created using the secret key.Getting the secret key
When an API key set is created in the Halliday Dashboard, the developer is provided two keys: the public key and the secret key. The public key begins withpk_ and is to be included in client-side app code.
The secret key is provided once to the developer at the time of the key set creation. If this key is lost, the developer will need to create a new key set.
The secret key, which begins with sk_, has organization level admin permissions on the Halliday API. Keep this key secured!
Creating a signature service
To create a valid signature, first create an HMAC key using the Halliday secret key. Remove thesk_ prepend and create the HMAC key, which is a 64-character lowercase hex SHA-256 string.
Next, sign the JSON string of IFeeSponsorshipGrantPayload using the HMAC key.
The following is an example of the signature process in a back-end server API endpoint using Node.js with the Express.js framework.

