Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

5afe/safe-gelato-relay-service

Repository files navigation

Safe Gelato Relay Service

Coverage Status

⚠️ This service has been incorporated into the Safe Client Gateway. For teams running an instance of it, we strongly advise migrating for new features and related security updates.

The Safe Gelato Relay Service is a web service which allows relaying transactions via the Gelato Relay Service.

This allows for an entity to sponsor on-chain transactions on behalf of the user, allowing them to submit Safe transactions without the need to have a wallet with funds. Fee collection can happen via other means but it is currently not covered.

Docker

Development images are currently being published to Docker Hub.

Requirements

Installation

corepack enable && yarn install

Running the service

Before running the service you need to set up a Gelato API Key – https://docs.gelato.network/developer-services/relay/payment-and-fees/1balance#production. This can be added via an environment variable in the local environment where you are executing the service:

Currently three chains are supported: Goerli (chainId=5), Gnosis Chain (chainId=100) and Sepolia (chainId=11155111).

# To configure Goerli
export GELATO_GOERLI_API_KEY=<GOERLI_GELATO_API_KEY>

# To configure Gnosis Chain
export GELATO_GNOSIS_CHAIN_API_KEY=<GNOSIS_GELATO_API_KEY>

# To configure Sepolia
export GELATO_SEPOLIA_API_KEY=<SEPOLIA_GELATO_API_KEY>

All the chains can be configured simultaneously.


With the API keys configured, to run the service locally:

yarn run start

The service will then be listening for requests under $APPLICATION_PORT. If $APPLICATION_PORT was not set, the default port is 3000.

Other execution modes are available for local development:

# Run in watch mode (live-reload)
yarn run start:dev

# Run in debug mode (if you want to attach a debugger)
yarn run start:debug

# Launch the service without the NestJS CLI (production target)
yarn run start:prod

Test

If you want to execute the tests for the service, you can execute the following:

yarn run test

Additionally, if you want the test coverage to be generated, you can execute the following:

yarn run test:cov

By default, the coverage results will be under <PROJ_FOLDER>/coverage/.

Linter and Style Guide

We use ESLint as a linter and Prettier as a code formatter. You can run yarn run lint to execute ESLint and yarn run format to execute Prettier.

These checks can be automatically executed using Git hooks. If you wish to install the provided git hooks:

yarn install
yarn husky install

About

The Safe Gelato Relay Service is a web service which allows relaying transactions via the Gelato Relay Service.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages