api-sdk-ts icon indicating copy to clipboard operation
api-sdk-ts copied to clipboard

Select fields does not work as expected

Open m-kus opened this issue 1 year ago • 0 comments

const liveBlocks = await blocksGet({
      sort: {
        desc: 'level',
      },
      limit: this.liveBlocksLimit,
      select: { fields: ['hash', 'timestamp'] },
      ...filters,
    });

Returns plain array of hashes although should return list of objects: https://api.tzkt.io/v1/blocks?select.fields=hash,timestamp&limit=2

Probably string array is not joined.

We also need to handle the edge case with a single feed (maybe return Block[] | string[])

m-kus avatar Sep 26 '23 19:09 m-kus