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(auctions): add generic read interaction endpoint, and resultful endpoint for auctions #49

Closed dtfiedler closed 11 months ago

dtfiedler commented 11 months ago

Example: http://localhost:3000/v1/contract/E-pRI1bokGWQBqHnbut9rsHSt9Ypbldos3bAtwg4JMc/auctions/vilenario

{
"result": {
  "vilenario": {
    "auctionSettingsId": "BfK9WUTsR8ntk5DVEa4FciQWIZbSVg1lroicQisgOyc",
    "floorPrice": 1250,
    "startPrice": 62500,
    "contractTxId": "2_p39rFeakXvY-Hvgxaawe2GeWJa9Fycm4fEuuhTYfc",
    "startHeight": 1266915,
    "type": "permabuy",
    "initiator": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ"
  },
  "endHeight": 1271955,
  "isExpired": false,
  "isAvailableForAuction": false,
  "settings": {
    "id": "BfK9WUTsR8ntk5DVEa4FciQWIZbSVg1lroicQisgOyc",
    "floorPriceMultiplier": 1,
    "startPriceMultiplier": 50,
    "auctionDuration": 5040,
    "decayRate": 0.0225,
    "decayInterval": 30
  },
  "prices": {
    "1266915": 62500,
    "1266945": 61094,
    "1266975": 59720,
    ... rest of prices
  }
  },
  "evaluationOptions": {
    "sourceType": "arweave",
    "unsafeClient": "skip",
    "internalWrites": true,
    "useKVStorage": true,
    "updateCacheForEachInteraction": true,
    "maxInteractionEvaluationTimeSeconds": 60,
    "throwOnInternalWriteError": true
  }
}