ar-io / arns-service

Koa microservice that leverages Warp to support the ArNS Portal and ar.io observers.
https://api.arns.app
GNU Affero General Public License v3.0
19 stars 4 forks source link

feat(sortKey): add sortKey to contract response #53

Closed dtfiedler closed 10 months ago

dtfiedler commented 10 months ago

This allows those evaluating contract state using warp to use this service to bootstrap state from our cache

Example:

const contractTxId =  'bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U';

// get contract manifest
const { evaluationOptions = {} } = await getContractManifest({
  contractTxId,
});

// Read the ArNS Registry Contract
const contract = await warp
  .contract(contractTxId)
  .setEvaluationOptions(evaluationOptions)
  .syncState(`http://localhost:3000/v1/contract/${contractTxId}`);