Source Bridge Side
Task 1: Implement TransferAndLock API
- Objective: Develop an API endpoint that allows users to transfer tokens and lock them for bridging.
- Acceptance Criteria:
- The API must accept valid user credentials and token transfer details.
- Upon successful transfer and lock, the system must update the token status to "locked".
- A confirmation response must be sent back to the user with transaction details.
- The API must handle errors, including:
- Insufficient balance.
- Invalid user credentials.
- Network failures.
Task 2: Implement GetStatusByTransactionId API
- Objective: Develop an API endpoint to retrieve the status of a transaction using its ID.
- Acceptance Criteria:
- The API must accept a valid transaction ID and return the current status of the transaction.
- The response must include transaction details, such as status, amount, and timestamps.
- The API must handle errors, including:
- Invalid transaction ID.
- Transaction ID not found.
Task 3: Implement GetStatusBySmartContractAndTokenId API
- Objective: Develop an API endpoint to fetch the status of a token by its smart contract and token ID.
- Acceptance Criteria:
- The API must accept a smart contract and token ID as inputs.
- The response must include the current status of the token and associated transaction details.
- The API must handle errors, including:
- Invalid smart contract addresses.
- Invalid token IDs.
Task 4: Implement WithdrawToken API
- Objective: Develop an API endpoint that allows users to request a withdrawal of locked tokens.
- Acceptance Criteria:
- The API must accept valid user credentials and withdrawal requests.
- Upon successful withdrawal initiation, the system must update the token status to "pending withdrawal".
- A confirmation response must be sent to the user with withdrawal request details.
- The API must handle errors, including:
- Invalid withdrawal requests.
- Insufficient locked tokens.
- Network issues.
Task 5: Implement WithdrawTokenResponse API
- Objective: Develop an API endpoint for leaders to respond to withdrawal requests.
- Acceptance Criteria:
- The API must accept responses from authorized leaders regarding withdrawal requests.
- The system must update the token status based on the leader's response (e.g., "withdrawn", "rejected").
- Notifications must be sent to the user with the outcome of the withdrawal request.
- The API must handle errors, including:
- Unauthorized access.
- Invalid response formats.
Task 6: Implement initiateRollback API
- Objective: Develop an API endpoint that allows users to initiate a rollback of a transaction.
- Acceptance Criteria:
- The API must accept valid user credentials and rollback requests.
- Upon successful rollback initiation, the system must reverse the transaction and update the token status.
- A confirmation response must be sent to the user with rollback details.
- The API must handle errors, including:
- Invalid rollback requests.
- Network failures.
Destination Bridge Side