maestro-org / typescript-sdk

TypeScript SDK for the Maestro Dapp Platform
https://www.gomaestro.org/
Apache License 2.0
5 stars 5 forks source link

Change Query Param to Accept Typed Objects #18

Closed HinsonSIDAN closed 7 months ago

HinsonSIDAN commented 11 months ago

Problem

When using the SDK for calling specific endpoints with customized query param, it has a hard time to just pass in one desired query param as it has to follow the specific orders. For example if I only want to restrict the number of utxos returned by Address UTxO, I have to do something like this, which is really annoying:

maestroClient.addresses.utxosByAddress(address, undefined, undefined, 100);

Possible Solution

To change all query param with an object, where the query param key to be the object key and the query param value to be the object value

maestroClient.addresses.utxosByAddress(address, {count: 100});

It is also good to make the query param object typed with default value same as the actual api behaviour.

Side Note

Vardominator commented 11 months ago

@SIDANWhatever We have brought this up internally and know that it's a problem. Please go ahead and proceed with this change. It will be tremendously helpful.