Skip to content

Complete Near Intents Tracker #1244

@premiumjibles

Description

@premiumjibles

Context

The ShapeShift affiliate revenue API aggregates fee data from multiple swap providers. Near Intents is a cross-chain swap provider that ShapeShift integrates with. A tracker file exists but has incomplete implementation with TODO comments that need to be resolved.

Current Problem: The Near Intents tracker (nearIntents.ts) has placeholder code and TODO comments for:

  1. Parsing asset IDs from the API response
  2. Determining which transaction hash to use

Current Implementation

Location: node/proxy/api/src/affiliateRevenue/nearIntents.ts

The file exists but has incomplete sections around lines 66-73:

// TODO: Figure out parsing of originAsset/destinationAsset
const chainId = ''
const assetId = `${chainId}/`

// TODO: determine if origin or destination chain tx hash...
txHash: '',

Acceptance Criteria

  • Review the Near Intents API response structure
  • Implement proper parsing of originAsset and destinationAsset to extract chainId and assetId
  • Determine appropriate txHash to use (origin or destination chain)
  • Ensure NEAR_INTENTS_API_KEY environment variable is documented
  • Verify tracker returns valid data with real API calls
  • Ensure 'nearintents' is in the services array in models.ts

Files to Modify

  • node/proxy/api/src/affiliateRevenue/nearIntents.ts
  • node/proxy/api/src/models.ts (verify service is listed)
  • node/proxy/sample.env (document the API key)

Reference

The main ShapeShift app has a Near Intents swapper integration that may provide insight into the API response format:

  • Path: packages/swapper/src/swappers/NearIntentsSwapper/ (in the shapeshift/web repo)

Environment Variables

  • NEAR_INTENTS_API_KEY - Required for API authentication (needs to be added to CircleCI for deployment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions