@agglayer/sdk 1.0.0-beta.17 → 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
@@ -202,7 +202,8 @@ interface ProviderMetadata {
202
202
  readonly transactionRequest?: unknown;
203
203
  };
204
204
  readonly agglayer?: {
205
- readonly bridgeAddress: string | null;
205
+ readonly bridgeAddress: string | undefined;
206
+ readonly claimTransactionRequired: boolean | undefined;
206
207
  };
207
208
  readonly [key: string]: unknown;
208
209
  }
@@ -235,7 +236,7 @@ interface Route {
235
236
  readonly feeCosts: FeeCost[];
236
237
  readonly gasCosts: GasCost[];
237
238
  readonly steps: Step[];
238
- readonly transactionRequest?: UnsignedTransaction;
239
+ readonly transactionRequest?: UnsignedTransaction | undefined;
239
240
  readonly providerMetadata: ProviderMetadata;
240
241
  readonly riskFactors: RiskFactors | null;
241
242
  readonly createdAt: number;
@@ -258,7 +259,7 @@ interface RoutesRequestParams {
258
259
  readonly fromTokenAddress: string;
259
260
  readonly toTokenAddress: string;
260
261
  readonly amount: string;
261
- readonly fromAddress: string;
262
+ readonly fromAddress?: string;
262
263
  readonly toAddress?: string;
263
264
  readonly slippage?: number;
264
265
  readonly preferences?: RoutePreferences;
@@ -345,6 +346,21 @@ type BuildClaimTransactionRequestParam = {
345
346
  };
346
347
  type BuildClaimTransactionResponse = UnsignedTransaction;
347
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
+
348
364
  /**
349
365
  * Chain Types
350
366
  *
@@ -495,9 +511,9 @@ declare const SDK_MODES: {
495
511
  type SDKMode = (typeof SDK_MODES)[keyof typeof SDK_MODES];
496
512
 
497
513
  interface SDKConfig {
498
- mode: SDKMode[];
499
- core: CoreConfig;
500
- native: NativeConfig;
514
+ mode?: SDKMode[];
515
+ core?: CoreConfig;
516
+ native?: NativeConfig;
501
517
  }
502
518
 
503
519
  /**
@@ -778,7 +794,7 @@ declare class NativeClient {
778
794
  declare class CoreClient {
779
795
  private config;
780
796
  private arcApiService;
781
- constructor(config: CoreConfig);
797
+ constructor(config?: CoreConfig);
782
798
  /**
783
799
  * Generic pagination helper for chains API calls (limit and offset based pagination)
784
800
  * Handles automatic pagination to fetch all available data
@@ -834,6 +850,43 @@ declare class CoreClient {
834
850
  * Get all transactions via web sockets
835
851
  */
836
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>;
860
+ }
861
+
862
+ /**
863
+ * API Error Class
864
+ *
865
+ * Custom error class to preserve API error details
866
+ */
867
+
868
+ declare class ApiError extends Error {
869
+ readonly code: number;
870
+ readonly name: string;
871
+ readonly details?: Record<string, unknown> | undefined;
872
+ constructor(errorResponse: ErrorResponse);
873
+ /**
874
+ * Create API error from error response
875
+ */
876
+ static fromErrorResponse(errorResponse: ErrorResponse): ApiError;
877
+ /**
878
+ * Create fallback error when API completely fails
879
+ */
880
+ static createFallbackError(originalError: Error, operation: string): ApiError;
881
+ /**
882
+ * Convert to plain object for serialization
883
+ */
884
+ toJSON(): {
885
+ name: string;
886
+ message: string;
887
+ code: number;
888
+ details: Record<string, unknown> | undefined;
889
+ };
837
890
  }
838
891
 
839
892
  /**
@@ -846,7 +899,7 @@ declare class AggLayerSDK {
846
899
  private config;
847
900
  private core?;
848
901
  private native?;
849
- constructor(config: SDKConfig);
902
+ constructor(config?: SDKConfig);
850
903
  /**
851
904
  * Get core submodule
852
905
  */
@@ -857,4 +910,4 @@ declare class AggLayerSDK {
857
910
  getNative(): NativeClient;
858
911
  }
859
912
 
860
- export { AggLayerSDK, 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
@@ -202,7 +202,8 @@ interface ProviderMetadata {
202
202
  readonly transactionRequest?: unknown;
203
203
  };
204
204
  readonly agglayer?: {
205
- readonly bridgeAddress: string | null;
205
+ readonly bridgeAddress: string | undefined;
206
+ readonly claimTransactionRequired: boolean | undefined;
206
207
  };
207
208
  readonly [key: string]: unknown;
208
209
  }
@@ -235,7 +236,7 @@ interface Route {
235
236
  readonly feeCosts: FeeCost[];
236
237
  readonly gasCosts: GasCost[];
237
238
  readonly steps: Step[];
238
- readonly transactionRequest?: UnsignedTransaction;
239
+ readonly transactionRequest?: UnsignedTransaction | undefined;
239
240
  readonly providerMetadata: ProviderMetadata;
240
241
  readonly riskFactors: RiskFactors | null;
241
242
  readonly createdAt: number;
@@ -258,7 +259,7 @@ interface RoutesRequestParams {
258
259
  readonly fromTokenAddress: string;
259
260
  readonly toTokenAddress: string;
260
261
  readonly amount: string;
261
- readonly fromAddress: string;
262
+ readonly fromAddress?: string;
262
263
  readonly toAddress?: string;
263
264
  readonly slippage?: number;
264
265
  readonly preferences?: RoutePreferences;
@@ -345,6 +346,21 @@ type BuildClaimTransactionRequestParam = {
345
346
  };
346
347
  type BuildClaimTransactionResponse = UnsignedTransaction;
347
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
+
348
364
  /**
349
365
  * Chain Types
350
366
  *
@@ -495,9 +511,9 @@ declare const SDK_MODES: {
495
511
  type SDKMode = (typeof SDK_MODES)[keyof typeof SDK_MODES];
496
512
 
497
513
  interface SDKConfig {
498
- mode: SDKMode[];
499
- core: CoreConfig;
500
- native: NativeConfig;
514
+ mode?: SDKMode[];
515
+ core?: CoreConfig;
516
+ native?: NativeConfig;
501
517
  }
502
518
 
503
519
  /**
@@ -778,7 +794,7 @@ declare class NativeClient {
778
794
  declare class CoreClient {
779
795
  private config;
780
796
  private arcApiService;
781
- constructor(config: CoreConfig);
797
+ constructor(config?: CoreConfig);
782
798
  /**
783
799
  * Generic pagination helper for chains API calls (limit and offset based pagination)
784
800
  * Handles automatic pagination to fetch all available data
@@ -834,6 +850,43 @@ declare class CoreClient {
834
850
  * Get all transactions via web sockets
835
851
  */
836
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>;
860
+ }
861
+
862
+ /**
863
+ * API Error Class
864
+ *
865
+ * Custom error class to preserve API error details
866
+ */
867
+
868
+ declare class ApiError extends Error {
869
+ readonly code: number;
870
+ readonly name: string;
871
+ readonly details?: Record<string, unknown> | undefined;
872
+ constructor(errorResponse: ErrorResponse);
873
+ /**
874
+ * Create API error from error response
875
+ */
876
+ static fromErrorResponse(errorResponse: ErrorResponse): ApiError;
877
+ /**
878
+ * Create fallback error when API completely fails
879
+ */
880
+ static createFallbackError(originalError: Error, operation: string): ApiError;
881
+ /**
882
+ * Convert to plain object for serialization
883
+ */
884
+ toJSON(): {
885
+ name: string;
886
+ message: string;
887
+ code: number;
888
+ details: Record<string, unknown> | undefined;
889
+ };
837
890
  }
838
891
 
839
892
  /**
@@ -846,7 +899,7 @@ declare class AggLayerSDK {
846
899
  private config;
847
900
  private core?;
848
901
  private native?;
849
- constructor(config: SDKConfig);
902
+ constructor(config?: SDKConfig);
850
903
  /**
851
904
  * Get core submodule
852
905
  */
@@ -857,4 +910,4 @@ declare class AggLayerSDK {
857
910
  getNative(): NativeClient;
858
911
  }
859
912
 
860
- export { AggLayerSDK, 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 };