{"id":31923375,"url":"https://github.com/fuellabs/fuel-station","last_synced_at":"2025-10-13T23:50:05.220Z","repository":{"id":261471582,"uuid":"884411141","full_name":"FuelLabs/fuel-station","owner":"FuelLabs","description":"Prototype for Station, A non-custodial gas paymaster on Fuel","archived":false,"fork":false,"pushed_at":"2025-04-15T12:58:28.000Z","size":2631,"stargazers_count":2,"open_issues_count":3,"forks_count":4,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-21T18:34:19.642Z","etag":null,"topics":["fuel","sway"],"latest_commit_sha":null,"homepage":"https://forum.fuel.network/t/fuel-station-gas-paymaster-on-fuel/7078","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FuelLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-06T17:45:46.000Z","updated_at":"2025-04-15T13:08:29.000Z","dependencies_parsed_at":"2025-01-06T15:27:50.706Z","dependency_job_id":"27fe2f09-4a30-4846-911b-6ee16de60991","html_url":"https://github.com/FuelLabs/fuel-station","commit_stats":null,"previous_names":["bajpai244/fuel-pump","bajpai244/fuel-station","fuellabs/fuel-station"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FuelLabs/fuel-station","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Ffuel-station","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Ffuel-station/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Ffuel-station/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Ffuel-station/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FuelLabs","download_url":"https://codeload.github.com/FuelLabs/fuel-station/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Ffuel-station/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017229,"owners_count":26086016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fuel","sway"],"created_at":"2025-10-13T23:50:02.906Z","updated_at":"2025-10-13T23:50:05.207Z","avatar_url":"https://github.com/FuelLabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./assets/logo.png\" alt=\"fuel-station\" width=\"100\" style=\"border-radius: 100%;\"\u003e\n\n# Station\n\nStation is a non-custodial gas paymaster for the Fuel network, this repo contains a demo implementation of the mentioned prototype.\n\n\u003cimg src=\"./assets/image.png\" alt=\"fuel-station\" width=\"350\"\u003e\n\nRead the [post](https://forum.fuel.network/t/fuel-station-gas-paymaster-on-fuel/7078) on the Fuel Forum for more information.\n\n## Read the Book\n\nRead the fuel-station book to understand how it works and how to use it.\n\n`cd fuel-station-book \u0026\u0026 mdbook serve -p 3001`\n\nIf you don't have `mdbook` installed, you can install it by running `cargo install mdbook`.\n\nThen go to your browser and open `http://localhost:3001/` to read the book.\n\n## Video Demo: Running Fuel Station\n\n[![Watch the video](https://cdn.loom.com/sessions/thumbnails/87952bf1096944adb203b16e7c9f2688-3d789b141945e94c-full-play.gif)](https://youtu.be/maRDd_Ycb70)\n\nStep-by-step how to:  \n- Deploy the Fuel Station server\n- Enable **gasless transactions** for any token  \n\n## API Documentation\n\n### GET /health\n\nReturns the health status of the service.\n\n**Response**\n\n```json\n{\n  \"status\": \"healthy\"\n}\n```\n\n### POST /allocate-coin\n\nAllocates a coin for gas payment. The service will lock an account and its associated coin for 30 seconds.\n\n**Important Notes:**\n\n- The allocated coin will be locked for 30 seconds\n- If the transaction is not completed within this timeframe, the coin will be automatically unlocked\n- Each request gets a unique jobId that must be used for subsequent operations\n\n**Response**\n\n```json\n{\n  \"coin\": {\n    \"id\": \"0x...\",\n    \"amount\": \"0x...\"\n    // ... other coin details\n  },\n  \"jobId\": \"uuid\"\n}\n```\n\n**Error Responses:**\n\n- `404`: No unlocked account/coin found\n- `500`: Internal server error (database operations failed)\n\n### Sign Transaction\n\nhttp\nPOST /sign\n\nSigns a transaction using the allocated coin.\n\n**Request Body:**\n\n```json\n{\n  \"jobId\": \"uuid\",\n  \"request\": {\n    // ScriptTransactionRequest object\n  }\n}\n```\n\n**Important Validations:**\n\n- The job must not be expired\n- The transaction can only use one input coin from the allocated account\n- The output coin amount must not be less than (input amount - MAX_VALUE_PER_COIN)\n- Only one output coin belonging to the account is allowed\n\n**Response**\n\n```json\n{\n  \"signature\": \"0x...\"\n}\n```\n\n**Error Responses:**\n\n- `400`: Invalid request body, expired job, or transaction validation failed\n- `404`: Job or account not found\n- `500`: Internal server error\n\n### Get Metadata\n\nhttp\nGET /metadata\n\nReturns configuration metadata including maximum value allowed per coin.\n\n**Response**\n\n```json\n{\n  \"maxValuePerCoin\": \"0x...\"\n}\n```\n\n### Complete Job\n\nhttp\nPOST /jobs/:jobId/complete\n\nMarks a job as complete and unlocks the associated account.\n\n**URL Parameters:**\n\n- `jobId`: UUID of the job to complete\n\n**Request Body:**\n\n```json\n{\n  \"txnHash\": \"0x...\"\n}\n```\n\n**Response**\n\n```json\n{\n  \"status\": \"success\"\n}\n```\n\n**Error Responses:**\n\n- `400`: Job already completed\n- `404`: Job not found\n- `500`: Failed to unlock account or update job status\n\n## Important Notes\n\n1. **Transaction Flow:**\n\n   - First call `/allocate-coin` to get a coin and jobId\n   - Use the coin in your transaction and call `/sign` with the jobId\n   - After transaction is submitted, call `/jobs/:jobId/complete`\n\n2. **Timeouts:**\n\n   - All allocations timeout after 30 seconds\n   - Always complete or let jobs timeout to prevent coin lockup\n\n3. **Rate Limiting:**\n\n   - Implement your own rate limiting as needed\n   - Service has limited coins available\n\n4. **Error Handling:**\n\n   - Always check for error responses\n   - Implement proper retry logic for failed requests\n   - Handle timeouts gracefully\n\n5. **Security Considerations:**\n   - The service is non-custodial\n   - Validate all transaction parameters before signing\n   - Monitor for potential abuse patterns\n\n## Example Usage\n\ncheck the example folder for a complete example of how to use the API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuellabs%2Ffuel-station","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuellabs%2Ffuel-station","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuellabs%2Ffuel-station/lists"}