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(interactions): allow filtering interactions by function name #107

Closed dtfiedler closed 4 months ago

dtfiedler commented 4 months ago

Example:

❯ curl -s http://localhost:3000/v1/contract/bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U/interactions\?function\=joinNetwork\&pageSize\=2 | jq '.'
{
  "contractTxId": "bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",
  "sortKey": "000001384313,0000000000000,c32b0e886cca125d6503c9509eab071a751c1ba05a63070068908a64cbd30e20",
  "interactions": [
    {
      "height": 1384303,
      "timestamp": 1710549800,
      "input": {
        "function": "joinNetwork",
        "observerWallet": "Zwh1vYmwfbESP9-rXVXiNS8Ix0MEsUw5GSiObwkVEDE",
        "qty": 10000,
        "label": "KhangNguyenVNB",
        "fqdn": "khang.pro",
        "port": 443,
        "protocol": "https",
        "properties": "FH1aVetOoulPGqgYukj0VE0wIhDy90WiQoV3U2PeY44",
        "note": "Khang Nguyen from VNBnode (VietNam community) https://t.me/VNBnodegroup 😁"
      },
      "owner": "Zwh1vYmwfbESP9-rXVXiNS8Ix0MEsUw5GSiObwkVEDE",
      "sortKey": "000001384303,0000000000000,ad5c733ad8c2d9f52dd6699805ae487ade8b17ac07eea12aa104addefd940e01",
      "valid": true,
      "id": "qKWdrAx20cgOaaId6T3hkrb7LVvlDBJFVTjWXhTCgBM"
    },
    {
      "height": 1384303,
      "timestamp": 1710549800,
      "input": {
        "function": "joinNetwork",
        "observerWallet": "RuqD0_TLZ4METrEEkipMvJikb4EHT1MGAiZQwP_cOlw",
        "qty": 100000,
        "label": "sacittGateway",
        "fqdn": "sacittnoderunner.store",
        "port": 443,
        "protocol": "https",
        "properties": "FH1aVetOoulPGqgYukj0VE0wIhDy90WiQoV3U2PeY44",
        "note": "sacitt from RuesCommunity"
      },
      "owner": "RuqD0_TLZ4METrEEkipMvJikb4EHT1MGAiZQwP_cOlw",
      "sortKey": "000001384303,0000000000000,77afc04235f0be9d4b11818d09293ec5fc7130e3b41fe6c4ed5352b0bbaf9aa9",
      "valid": false,
      "error": "Insufficient funds for this transaction.",
      "id": "bpqpox719iih9F-IRVHbJW5HjxRHs98ygK62bVTC1Vk"
    }
  ],
  "pages": {
    "page": 1,
    "pageSize": 2,
    "totalPages": 2,
    "totalItems": 3,
    "hasNextPage": true
  },
  "evaluationOptions": {
    "maxInteractionEvaluationTimeSeconds": 3600
  }
}