@agglayer/sdk 1.0.0-beta.18 → 1.0.0-beta.19

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.d.mts CHANGED
@@ -346,6 +346,21 @@ type BuildClaimTransactionRequestParam = {
346
346
  };
347
347
  type BuildClaimTransactionResponse = UnsignedTransaction;
348
348
 
349
+ /**
350
+ * Arc API Token Mapping Types
351
+ *
352
+ * Defines the request and response types for the token mapping endpoint.
353
+ */
354
+ type TokenMappingQueryParams = {
355
+ tokenAddress: string;
356
+ };
357
+ type TokenMappingResponse = Array<{
358
+ originTokenNetwork: number;
359
+ originTokenAddress: string;
360
+ wrappedTokenNetwork: number;
361
+ wrappedTokenAddress: string;
362
+ }>;
363
+
349
364
  /**
350
365
  * Chain Types
351
366
  *
@@ -835,6 +850,13 @@ declare class CoreClient {
835
850
  * Get all transactions via web sockets
836
851
  */
837
852
  getTransactions(transactionsRequestQueryParams: TransactionsRequestQueryParams): Promise<TransactionsResponse>;
853
+ /**
854
+ * Get token mappings by token address
855
+ * @developer Note: Do not misinterpret network ID as chain ID.
856
+ *
857
+ * @param tokenAddress
858
+ */
859
+ getTokenMappings(tokenMappingQueryParams: TokenMappingQueryParams): Promise<TokenMappingResponse>;
838
860
  }
839
861
 
840
862
  /**
@@ -888,4 +910,4 @@ declare class AggLayerSDK {
888
910
  getNative(): NativeClient;
889
911
  }
890
912
 
891
- export { AggLayerSDK, ApiError, type ApiResponse, type BaseContractConfig, type BridgeAssetParams, type BridgeConfig, type BridgeMessageParams, type BridgeOptions, type BuildClaimTransactionRequestParam, type BuildClaimTransactionResponse, type BuildTransactionRequestBody, type BuildTransactionResponse, type ChainConfig, type ChainsQueryParams, type ChainsResponse, type ClaimAssetParams, type ClaimMessageParams, type CoreConfig, type CursorPagination, type CustomChainConfig, type ERC20Config, type ErrorResponse, type FeeCost, type GasCost, type IChain, type IsClaimedParams, type NativeConfig, type OffsetPagination, type OriginTokenInfoParams, type Pagination, type PrecalculatedWrapperParams, type ProviderMetadata, type RiskFactors, type RiskLevel, type Route, type RoutePreferences, type RouteStep, type RoutesRequestParams, type RoutesResponse, type SDKConfig, type SDKMode, SDK_MODES, type Step, type StepAction, type StepEstimate, type StepType, type SuccessResponse, type TokenInfo, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
913
+ export { AggLayerSDK, ApiError, type ApiResponse, type BaseContractConfig, type BridgeAssetParams, type BridgeConfig, type BridgeMessageParams, type BridgeOptions, type BuildClaimTransactionRequestParam, type BuildClaimTransactionResponse, type BuildTransactionRequestBody, type BuildTransactionResponse, type ChainConfig, type ChainsQueryParams, type ChainsResponse, type ClaimAssetParams, type ClaimMessageParams, type CoreConfig, type CursorPagination, type CustomChainConfig, type ERC20Config, type ErrorResponse, type FeeCost, type GasCost, type IChain, type IsClaimedParams, type NativeConfig, type OffsetPagination, type OriginTokenInfoParams, type Pagination, type PrecalculatedWrapperParams, type ProviderMetadata, type RiskFactors, type RiskLevel, type Route, type RoutePreferences, type RouteStep, type RoutesRequestParams, type RoutesResponse, type SDKConfig, type SDKMode, SDK_MODES, type Step, type StepAction, type StepEstimate, type StepType, type SuccessResponse, type TokenInfo, type TokenMappingQueryParams, type TokenMappingResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
package/dist/index.d.ts CHANGED
@@ -346,6 +346,21 @@ type BuildClaimTransactionRequestParam = {
346
346
  };
347
347
  type BuildClaimTransactionResponse = UnsignedTransaction;
348
348
 
349
+ /**
350
+ * Arc API Token Mapping Types
351
+ *
352
+ * Defines the request and response types for the token mapping endpoint.
353
+ */
354
+ type TokenMappingQueryParams = {
355
+ tokenAddress: string;
356
+ };
357
+ type TokenMappingResponse = Array<{
358
+ originTokenNetwork: number;
359
+ originTokenAddress: string;
360
+ wrappedTokenNetwork: number;
361
+ wrappedTokenAddress: string;
362
+ }>;
363
+
349
364
  /**
350
365
  * Chain Types
351
366
  *
@@ -835,6 +850,13 @@ declare class CoreClient {
835
850
  * Get all transactions via web sockets
836
851
  */
837
852
  getTransactions(transactionsRequestQueryParams: TransactionsRequestQueryParams): Promise<TransactionsResponse>;
853
+ /**
854
+ * Get token mappings by token address
855
+ * @developer Note: Do not misinterpret network ID as chain ID.
856
+ *
857
+ * @param tokenAddress
858
+ */
859
+ getTokenMappings(tokenMappingQueryParams: TokenMappingQueryParams): Promise<TokenMappingResponse>;
838
860
  }
839
861
 
840
862
  /**
@@ -888,4 +910,4 @@ declare class AggLayerSDK {
888
910
  getNative(): NativeClient;
889
911
  }
890
912
 
891
- export { AggLayerSDK, ApiError, type ApiResponse, type BaseContractConfig, type BridgeAssetParams, type BridgeConfig, type BridgeMessageParams, type BridgeOptions, type BuildClaimTransactionRequestParam, type BuildClaimTransactionResponse, type BuildTransactionRequestBody, type BuildTransactionResponse, type ChainConfig, type ChainsQueryParams, type ChainsResponse, type ClaimAssetParams, type ClaimMessageParams, type CoreConfig, type CursorPagination, type CustomChainConfig, type ERC20Config, type ErrorResponse, type FeeCost, type GasCost, type IChain, type IsClaimedParams, type NativeConfig, type OffsetPagination, type OriginTokenInfoParams, type Pagination, type PrecalculatedWrapperParams, type ProviderMetadata, type RiskFactors, type RiskLevel, type Route, type RoutePreferences, type RouteStep, type RoutesRequestParams, type RoutesResponse, type SDKConfig, type SDKMode, SDK_MODES, type Step, type StepAction, type StepEstimate, type StepType, type SuccessResponse, type TokenInfo, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
913
+ export { AggLayerSDK, ApiError, type ApiResponse, type BaseContractConfig, type BridgeAssetParams, type BridgeConfig, type BridgeMessageParams, type BridgeOptions, type BuildClaimTransactionRequestParam, type BuildClaimTransactionResponse, type BuildTransactionRequestBody, type BuildTransactionResponse, type ChainConfig, type ChainsQueryParams, type ChainsResponse, type ClaimAssetParams, type ClaimMessageParams, type CoreConfig, type CursorPagination, type CustomChainConfig, type ERC20Config, type ErrorResponse, type FeeCost, type GasCost, type IChain, type IsClaimedParams, type NativeConfig, type OffsetPagination, type OriginTokenInfoParams, type Pagination, type PrecalculatedWrapperParams, type ProviderMetadata, type RiskFactors, type RiskLevel, type Route, type RoutePreferences, type RouteStep, type RoutesRequestParams, type RoutesResponse, type SDKConfig, type SDKMode, SDK_MODES, type Step, type StepAction, type StepEstimate, type StepType, type SuccessResponse, type TokenInfo, type TokenMappingQueryParams, type TokenMappingResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
package/dist/index.js CHANGED
@@ -1734,6 +1734,10 @@ var ArcApiService = class {
1734
1734
  transactionsRequestQueryParams
1735
1735
  });
1736
1736
  }
1737
+ async tokenMappings(tokenMappingQueryParams) {
1738
+ const { tokenAddress } = tokenMappingQueryParams;
1739
+ return this.httpClient.get(`/token-mappings/${tokenAddress}`);
1740
+ }
1737
1741
  };
1738
1742
 
1739
1743
  // src/core/utils/apiError.ts
@@ -2003,6 +2007,31 @@ var CoreClient = class {
2003
2007
  throw ApiError.createFallbackError(error, "Get transactions");
2004
2008
  }
2005
2009
  }
2010
+ /**
2011
+ * Get token mappings by token address
2012
+ * @developer Note: Do not misinterpret network ID as chain ID.
2013
+ *
2014
+ * @param tokenAddress
2015
+ */
2016
+ async getTokenMappings(tokenMappingQueryParams) {
2017
+ try {
2018
+ const response = await this.arcApiService.tokenMappings(
2019
+ tokenMappingQueryParams
2020
+ );
2021
+ if (response.data.status === "success") {
2022
+ return response.data.data;
2023
+ }
2024
+ throw ApiError.fromErrorResponse(response.data);
2025
+ } catch (error) {
2026
+ if (error instanceof ApiError) {
2027
+ throw error;
2028
+ }
2029
+ throw ApiError.createFallbackError(
2030
+ error,
2031
+ "Get custom token mappings"
2032
+ );
2033
+ }
2034
+ }
2006
2035
  };
2007
2036
 
2008
2037
  // src/index.ts