AFK-AlignedFamKernel / afk_monorepo

AFK: Aligned Fam Kernel - Monorepo
https://afk-community.xyz
MIT License
15 stars 44 forks source link

Funkit backend onramp/offramp #131

Closed MSghais closed 1 month ago

MSghais commented 2 months ago

Description

We want to add onramp/offramp for Starknet like Vault one. Fun kit offramp/onramp integration in the backend.

Some examples of the database and backend are here in Vault repo.

https://github.com/keep-starknet-strange/vault/tree/main/backend/src/routes

Todo

Optional or can be split in another issues:

ShantelPeters commented 2 months ago

Hi @MSghais i will like to take this up Kindly assign

onlydustapp[bot] commented 2 months ago

Hi @ShantelPeters! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

Bosun-Josh121 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

software engineer(backend) and contributor in similar project from last hacthons(https://app.onlydust.com/u/Josh-121). looking to make first contribution here

How I plan on tackling this issue

Set Up Database Models Review Vault Repo: Analyze the existing database models in the Vault repository under the src/routes directory to understand how data is structured. Define Models for Onramp/Offramp: Create new database models for the onramp/offramp process. This should include fields such as: Nostr Pubkey/Starknet Address: For user identification. Passkey (if applicable): As an alternative to Starknet or Nostr keys. Transaction Data: Include fields for tracking transaction status (e.g., pending, completed, failed), timestamps, and any metadata related to the onramp/offramp process. Migration Scripts: Write database migration scripts to add these models to the existing schema.

  1. FunKit SDK Integration Install FunKit SDK: Integrate the FunKit SDK into the backend. Ensure all necessary SDK functions for Starknet onramp/offramp are imported. Handle Onramp/Offramp Logic: Write service functions using the FunKit SDK to handle: Onramp: Depositing assets from external sources to Starknet. Offramp: Withdrawing assets from Starknet to external sources. Ensure proper error handling and logging for potential issues in the onramp/offramp process.
  2. Create Backend Routes & Endpoints Write New API Endpoints: Onramp Endpoint: Allow users to initiate an onramp transaction by sending their Nostr pubkey/Starknet address and relevant onramp data. Offramp Endpoint: Allow users to initiate an offramp transaction similarly. Read/Write to Database: Ensure these routes can both log transactions (write) and query their status (read) by interacting with the database models. Security & Validation: Implement necessary validation for Starknet addresses, Nostr pubkeys, and Passkeys. Add security measures such as rate limiting and input sanitization to avoid abuse.
  3. Testing and Validation Unit Testing: Write tests for the new models, service functions, and API routes. Mock the FunKit SDK calls to simulate successful and failed transactions. Integration Testing: Test the end-to-end flow for both onramp and offramp to ensure data is correctly written to the database and transactions complete without errors.
EjembiEmmanuel commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @ @MSghais please kindly assigned as discussed.

ETA: 2 days

thesledge04 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience in developing backend systems and integrating various SDKs, including FunKit, which aligns with the requirements for adding onramp/offramp functionality for Starknet. My familiarity with database modeling and API route implementation will enable me to efficiently create the necessary models and endpoints. Additionally, I have a strong understanding of React Native, which will be beneficial if UI integration is pursued in a future task.

How I plan on tackling this issue

Review existing code for insights into database models and structure. Create database models for onramp/offramp. Integrate Funkit SDK for transactions. Develop routes and endpoints for handling requests. Test functionality thoroughly.

ScottyDavies commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a solid background in backend development and database management, with experience in integrating APIs and SDKs

How I plan on tackling this issue

To implement this, I would:

Examine the Vault repo to understand the current database models and backend structure.

Create new database models for onramp/offramp functionality that include Nostr pubkey, Starknet address, or Passkey.

Set up the Funkit SDK in the backend to handle onramp/offramp transactions.

Create the necessary routes and endpoints for reading and writing data related to onramp/offramp operations.

Implement unit and integration tests to ensure functionality and reliability.

If needed, outline a plan for simple UI integration in the React Native app for user interaction.

onlydustapp[bot] commented 2 months ago

The maintainer MSghais has assigned EjembiEmmanuel to this issue via OnlyDust Platform. Good luck!