SynapseFI / SynapseNode

Node.js Client Library for SynapseFI REST V3.1 API | https://docs.synapsefi.com
MIT License
13 stars 36 forks source link

Add timeout option for transaction creation #84

Open alexquo opened 3 years ago

alexquo commented 3 years ago

We are wondering if there is a timeout option that we can use to timeout transaction creation on your side: https://docs.synapsefi.com/reference#create-transaction

for example something like this:

    const newTX = await synapseUser.createTransaction(
      achNodeID,
      {
        to: {
          // ...
        },
        amount: {
         // ...
        },
        extra: {
          // ...
        },
        fees: [
          // ...
        ],
      },
      idempotencyKey, {
          timeout: 3000,   // timeout request after 3000 ms.  /// <<<< here
    }
    );

is this possible?

jenstroeger commented 3 years ago

@alexquo, why would you want to time out, does the response take too long?

alexquo commented 3 years ago

yeah at times it appears that this api call takes awhile, and an outside block of our code times out after X seconds, so we would want to timeout your api call after say X - 10 seconds or something.

jenstroeger commented 3 years ago

Ah ok, thank you! I would like to suggest to hold off with this for a couple of months — if possible — because we’re currently addressing these issues on the backend. If you continue to have problems, can you please submit a ticket?