Relayer Backend for HeartBit by Fileverse, leveraging Smart Accounts with Safe Protocol enabled via Pimlico.
Before you begin, ensure you have the following installed:
- Node.js
To set up the Heartbit Backend on your local machine, follow these steps:
- Clone the repository:
git clone https://github.com/fileverse/heartbit-backend.git
- Navigate into the cloned directory:
cd heartbit-backend
- Install the necessary dependencies using NPM or Yarn:
npm install or yarn
To run the Heartbit Backend in development mode, use one of the following commands:
npm run start:dev
or
yarn start:dev
The backend facilitates the Heartbit mint functionality by accepting POST requests. These requests can contain either the user's signature or the user wallet address to initiate the minting process.
To mint using a signature, send a POST request as shown below:
curl --request POST \
--url http://localhost:3000/signed-mint \
--header 'Content-Type: application/json' \
--data '{
"message": "hello world!",
"signature": "0x6a38315bd7e55a7f28867e101bd40c9d2085d7d3c48beeb5d7642e74c942b1886577683b80918fe6b5a7ae3edee6b812a6cb6b7da1b2162f28cec5c58f1ed7b81c",
"startTime": 1711975039,
"endTime": 1711975090,
"hash": "hello world!"
}
To mint using the user wallet address, send a POST request as follows:
curl --request POST \
--url http://localhost:3000/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"account": "0x6516aE3dC7f16487207F442723eC5f15B3A57C75",
"startTime": 1711975039,
"endTime": 1711975090,
"hash": "hello world!"
}