@agglayer/sdk 1.0.0-beta.22 → 1.0.0-beta.24

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
  */
@@ -1962,7 +1987,8 @@ var CoreClient = class {
1962
1987
  }
1963
1988
  }
1964
1989
  /**
1965
- * Get all transactions via web sockets
1990
+ * Get all transactions with pagination information
1991
+ * @param transactionsRequestQueryParams - Parameters for the transactions API call
1966
1992
  */
1967
1993
  async getTransactions(transactionsRequestQueryParams) {
1968
1994
  if (transactionsRequestQueryParams.limit && transactionsRequestQueryParams.limit > MAX_TRANSACTIONS_PER_PAGE) {
@@ -1976,7 +2002,12 @@ var CoreClient = class {
1976
2002
  transactionsRequestQueryParams
1977
2003
  );
1978
2004
  if (response.data.status === "success") {
1979
- return response.data.data;
2005
+ return {
2006
+ transactions: response.data.data,
2007
+ ...response.data.pagination && {
2008
+ pagination: response.data.pagination
2009
+ }
2010
+ };
1980
2011
  }
1981
2012
  throw ApiError.fromErrorResponse(response.data);
1982
2013
  } catch (error) {