@covalenthq/client-sdk
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -183,3 +183,3 @@ "use strict"; | ||
hasNext = false; | ||
console.error(`An error occurred ${data.error_code}:`, data.error_message); | ||
console.error(`An error occurred ${data ? data.error_code : response.status}: `, data ? data.error_message : "401 Authorization Required"); | ||
} | ||
@@ -186,0 +186,0 @@ } |
{ | ||
"name": "@covalenthq/client-sdk", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "dist/index.js", | ||
@@ -10,3 +10,3 @@ "types": "dist/index.d.ts", | ||
"repository": "https://github.com/covalenthq/covalent-api-sdk-js", | ||
"author": "David Zhang", | ||
"author": "Covalenthq", | ||
"license": "MIT", | ||
@@ -13,0 +13,0 @@ "dependencies": { |
@@ -129,3 +129,2 @@ # covalent-api-sdk-js | ||
The Covalent `getAllTransactionsForAddress()` endpoint is currently the only endpoint that supports pagination which return 100 results per page. To get the next page, it uses a link url that is grabbed from the previous call. Here's an example of how to paginate through all recent transactions on the ethereum blockchain for the demo's ENS address: | ||
```ts | ||
@@ -141,4 +140,10 @@ import { Client } from "@covalenthq/client-sdk"; | ||
``` | ||
This endpoint exclusively returns transaction items without the response wrapper, enabling developers to access the list seamlessly, ensuring efficient and straightforward transaction item retrieval. | ||
The `getAllTransactionsForAddress()` endpoint will throw an error message in this format: `An error occurred {error_code}: {error_message}`, when an error occurs. The developer would need to make sure to catch those errors if any. For a status 200 response, the endpoint will streamline all transactions listed back to the developer. This endpoint does not follow our default response format unlike our other endpoints, shown below. | ||
### Retry Mechanism | ||
Each endpoint is equipped with an exponential backoff algorithm that exponentially extends the wait time between retries, making up to a `maximum of 5` retry attempts only. | ||
### Error Handling | ||
The `getAllTransactionsForAddress()` endpoint will throw an error message in this format: `An error occurred {error_code}: {error_message}`, when an error occurs. The developer would need to make sure to catch those errors if any. This endpoint does not follow our default response format unlike our other endpoints, shown below. | ||
```ts | ||
@@ -153,6 +158,2 @@ ❴ | ||
### Retry Mechanism | ||
Each endpoint is equipped with an exponential backoff algorithm that exponentially extends the wait time between retries, making up to a `maximum of 5` retry attempts only. | ||
### Error codes | ||
@@ -159,0 +160,0 @@ Covalent uses standard HTTP response codes to indicate the success or failure of an API request. In general: codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.). Codes in the 5xx range indicate an error with Covalent's servers (these are rare). |
Sorry, the diff of this file is not supported yet
420942
183