tzkt / api-sdk-ts

Typed SDK for TzKT API
https://sdk.tzkt.io
MIT License
17 stars 0 forks source link

Select fields does not work as expected #24

Open m-kus opened 1 year ago

m-kus commented 1 year ago
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[])