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(PE-4063): add owner to records route #23

Closed dtfiedler closed 1 year ago

dtfiedler commented 1 year ago

If the record field has contractTxId - we'll attempt to load the state and return the owner with record field.

❯ curl -iL http://localhost:3000/contract/bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U/records/dylan
HTTP/1.1 200 OK
Vary: Origin
Access-Control-Allow-Origin: 
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=120
Content-Length: 271
Date: Thu, 22 Jun 2023 14:45:39 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{"contract":"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U","name":"dylan","record":{"contractTxId":"gh673M0Koh941OIITVXl9hKabRaYWABQUedZxW-swIA","endTimestamp":1711228201,"tier":"a27dbfe4-6992-4276-91fb-5b97ae8c3ffa"},"owner":"ZjmB2vEUlHlJ7-rgJkYP09N5IzLPhJyStVrK5u9dDEo"}