Skip to content

feat: add Edge exchange provider API requirements#3347

Open
TaprootFreak wants to merge 1 commit intodevelopfrom
feat/edge-provider-api-requirements
Open

feat: add Edge exchange provider API requirements#3347
TaprootFreak wants to merge 1 commit intodevelopfrom
feat/edge-provider-api-requirements

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • Chain & Token Identification: Add evmChainId field to AssetInDto with EvmUtil.getBlockchain() reverse lookup, enabling asset resolution via numeric EVM chain ID + contract address
  • Error Handling: Add structured errors array to all quote DTOs (Buy/Sell/Swap) with Edge-compatible error codes (RegionRestricted, OverLimitError, UnderLimitError) including sourceAmountLimit/destinationAmountLimit
  • Transaction Status API: Add unauthenticated GET /transaction/status/:orderId endpoint mapping 14 internal states to 6 Edge-format statuses (pending, processing, infoNeeded, expired, refunded, completed)

Changed files

File Change
asset.dto.ts Add evmChainId to AssetInDto, adjust validation
evm.util.ts Add getBlockchain() reverse lookup
payment-info.service.ts Extend resolveAsset() with evmChainId logic
quote-error.enum.ts Add REGION_RESTRICTED, ASSET_UNSUPPORTED
structured-error.dto.ts New DTO for structured errors
quote-error.util.ts New utility for error mapping
buy-quote.dto.ts / sell-quote.dto.ts / swap-quote.dto.ts Add errors field
buy.controller.ts / sell.controller.ts / swap.controller.ts Populate errors in quote responses
transaction-status.dto.ts New DTO + enum + mapping function
transaction.controller.ts Add GET /transaction/status/:orderId
EDGE_REQUIREMENTS.md Update tracking (Req 1: 70%, Req 3: 80%, Req 5: 100%)

Test plan

  • Verify evmChainId in Swagger UI for AssetInDto
  • Test quote endpoints with evmChainId + chainId (without blockchain)
  • Verify errors array appears in Buy/Sell/Swap quote responses
  • Test GET /transaction/status/:orderId with valid uid/orderUid
  • Verify status mapping returns correct Edge-format status values
  • Confirm backward compatibility: existing clients unaffected by new optional fields

- Add evmChainId to AssetInDto for EVM chain identification
- Add EvmUtil.getBlockchain() reverse lookup (chainId → Blockchain)
- Extend resolveAsset() to support evmChainId + chainId combination
- Add RegionRestricted and AssetUnsupported to QuoteError enum
- Add structured errors array to Buy/Sell/Swap quote DTOs
- Add QuoteErrorUtil to map internal errors to Edge format
- Add GET /transaction/status/:orderId with simplified status mapping
- Update EDGE_REQUIREMENTS.md tracking
@TaprootFreak TaprootFreak marked this pull request as ready for review March 4, 2026 10:52
@davidleomay
Copy link
Member

davidleomay commented Mar 4, 2026

Open points (WIP)

1. Chain and Token Identification

  • Done with this PR:
    • chainNetwork -> blockchain
    • tokenId -> chainId
    • chainId -> evmChainId (leave blockchain empty)

2. Order Identification and Status Page

3. Error Handling

  • TBD

4. Quoting Requirements

5. Transaction Status API

6. Reporting API

  • TBD

7. Account Activation

  • XRP and HBAR not supported

8. Affiliate Revenue Withdrawal

  • TBD

9. User Authentication

  • TBD

10. Regional and Fiat Currency Support

  • TBD

11. KYC Information

  • TBD

12. Bank Information

  • TBD

13. Verification

  • TBD

14. Widgets

  • TBD

15. Off-Ramp Flow

  • TBD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants