api3dao / signed-api

A monorepo for managing signed data
MIT License
2 stars 8 forks source link

Expose unsigned data #330

Closed Siegrift closed 4 months ago

Siegrift commented 4 months ago

Closes https://github.com/api3dao/signed-api/issues/325

An example response from the API:

{"count":3,"data":{"0xebba8507d616ed80766292d200a3598fdba656d9938cecc392765d4a284a69a4":{"airnode":"0xbF3137b0a7574563a23a8fC8badC6537F98197CC","templateId":"0xcc35bd1800c06c12856a87311dd95bfcbb3add875844021d59a929d79f3c99bd","timestamp":"1719819852","encodedValue":"0x0000000000000000000000000000000000000000000000047432f4b29a180000"},"0x6f6acbdadaaf116c89faf0e8de1d0c7c2352b01cce7be0eb9deb126ceaefa6ba":{"airnode":"0xbF3137b0a7574563a23a8fC8badC6537F98197CC","templateId":"0x086130c54864b2129f8ac6d8d7ab819fa8181bbe676e35047b1bca4c31d51c66","timestamp":"1719819852","encodedValue":"0x000000000000000000000000000000000000000000000001944d352591748000"},"0x7944f22b40cc691a003e35db4810b41543a83781d94f706b5c0b6980e0a06ed7":{"airnode":"0xbF3137b0a7574563a23a8fC8badC6537F98197CC","templateId":"0x1d65c1f1e127a41cebd2339f823d0290322c63f3044380cbac105db8e522ebb9","timestamp":"1719819852","encodedValue":"0x00000000000000000000000000000000000000000000007e1a3b815ec22a0000"}}}

The response is identical to the full Signed data, except the signature is omitted, making the data unusable for base fee updates.

Note, that this makes it awkward for typing the return response, but the caller will know whether they query the full or unsigned data endpoint, so this should not be an issue. This feature will also be superceded by https://github.com/api3dao/signed-api/issues/327