@agglayer/sdk 1.0.0-beta.21 → 1.0.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1692,6 +1692,11 @@ var ArcApiService = class {
1692
1692
  chainIds
1693
1693
  });
1694
1694
  }
1695
+ async tokenMetadata(tokenMetadataRequestParam) {
1696
+ return this.httpClient.get(
1697
+ `/metadata/tokens/${tokenMetadataRequestParam.tokenAddress}`
1698
+ );
1699
+ }
1695
1700
  async routes(routesRequestParams) {
1696
1701
  return this.httpClient.post("/routes", routesRequestParams);
1697
1702
  }
@@ -1710,7 +1715,7 @@ var ArcApiService = class {
1710
1715
  // supports cursor based pagination only
1711
1716
  async transactions(transactionsRequestQueryParams) {
1712
1717
  return this.httpClient.get("/transactions", {
1713
- transactionsRequestQueryParams
1718
+ ...transactionsRequestQueryParams
1714
1719
  });
1715
1720
  }
1716
1721
  async tokenMappings(tokenMappingQueryParams) {
@@ -1882,6 +1887,26 @@ var CoreClient = class {
1882
1887
  withSupportedTokens: true
1883
1888
  });
1884
1889
  }
1890
+ /**
1891
+ * Get token metadata by token address from ARC API
1892
+ * @param tokenMetadataRequestParam - Object containing the token address
1893
+ */
1894
+ async getTokenMetadata(tokenMetadataRequestParam) {
1895
+ try {
1896
+ const response = await this.arcApiService.tokenMetadata(
1897
+ tokenMetadataRequestParam
1898
+ );
1899
+ if (response.data.status === "success") {
1900
+ return response.data.data;
1901
+ }
1902
+ throw ApiError.fromErrorResponse(response.data);
1903
+ } catch (error) {
1904
+ if (error instanceof ApiError) {
1905
+ throw error;
1906
+ }
1907
+ throw ApiError.createFallbackError(error, "Get token metadata");
1908
+ }
1909
+ }
1885
1910
  /**
1886
1911
  * Get all routes from AggLayer API
1887
1912
  */