@agglayer/sdk 1.0.0-beta.24 → 1.0.0-beta.25
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 +110 -17
- package/dist/index.d.ts +110 -17
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -61,6 +61,21 @@ interface TokenReference {
|
|
|
61
61
|
readonly chainId: number;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Arc API Unsigned Transaction Types
|
|
66
|
+
*
|
|
67
|
+
* Defines the core request and response types for the tokens.
|
|
68
|
+
*/
|
|
69
|
+
interface UnsignedTransaction {
|
|
70
|
+
readonly to: string;
|
|
71
|
+
readonly data: string;
|
|
72
|
+
readonly value: string;
|
|
73
|
+
readonly gasLimit: string;
|
|
74
|
+
readonly gasPrice?: string;
|
|
75
|
+
readonly chainId: number;
|
|
76
|
+
readonly from?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
64
79
|
/**
|
|
65
80
|
* Arc API Chains Types
|
|
66
81
|
*
|
|
@@ -100,21 +115,6 @@ type ChainsResponse = {
|
|
|
100
115
|
readonly chains: IChain[];
|
|
101
116
|
};
|
|
102
117
|
|
|
103
|
-
/**
|
|
104
|
-
* Arc API Unsigned Transaction Types
|
|
105
|
-
*
|
|
106
|
-
* Defines the core request and response types for the tokens.
|
|
107
|
-
*/
|
|
108
|
-
interface UnsignedTransaction {
|
|
109
|
-
readonly to: string;
|
|
110
|
-
readonly data: string;
|
|
111
|
-
readonly value: string;
|
|
112
|
-
readonly gasLimit: string;
|
|
113
|
-
readonly gasPrice?: string;
|
|
114
|
-
readonly chainId: number;
|
|
115
|
-
readonly from?: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
118
|
/**
|
|
119
119
|
* Arc API Routes Types
|
|
120
120
|
*
|
|
@@ -317,7 +317,7 @@ interface Transaction {
|
|
|
317
317
|
}
|
|
318
318
|
interface TransactionsRequestQueryParams {
|
|
319
319
|
readonly address?: string;
|
|
320
|
-
readonly
|
|
320
|
+
readonly sourceNetworkIds?: string;
|
|
321
321
|
readonly destinationNetworkIds?: string;
|
|
322
322
|
readonly limit?: number;
|
|
323
323
|
readonly startAfter?: number;
|
|
@@ -382,6 +382,88 @@ type TokenMetadataResponse = {
|
|
|
382
382
|
decimals: number;
|
|
383
383
|
};
|
|
384
384
|
|
|
385
|
+
/**
|
|
386
|
+
* LiFi API Status Types
|
|
387
|
+
*
|
|
388
|
+
* Defines the request and response types for the LiFi status endpoint.
|
|
389
|
+
*/
|
|
390
|
+
interface LiFiToken {
|
|
391
|
+
readonly address: string;
|
|
392
|
+
readonly chainId: number;
|
|
393
|
+
readonly symbol: string;
|
|
394
|
+
readonly decimals: number;
|
|
395
|
+
readonly name: string;
|
|
396
|
+
readonly coinKey: string;
|
|
397
|
+
readonly logoURI: string;
|
|
398
|
+
readonly priceUSD: string;
|
|
399
|
+
}
|
|
400
|
+
interface LiFiStep {
|
|
401
|
+
readonly tool: string;
|
|
402
|
+
readonly toolDetails: {
|
|
403
|
+
readonly key: string;
|
|
404
|
+
readonly name: string;
|
|
405
|
+
readonly logoURI: string;
|
|
406
|
+
};
|
|
407
|
+
readonly fromAmount: string;
|
|
408
|
+
readonly fromToken: LiFiToken;
|
|
409
|
+
readonly toToken: LiFiToken;
|
|
410
|
+
readonly toAmount: string;
|
|
411
|
+
readonly bridgedAmount: string;
|
|
412
|
+
}
|
|
413
|
+
interface LiFiTransaction {
|
|
414
|
+
readonly txHash: string;
|
|
415
|
+
readonly txLink: string;
|
|
416
|
+
readonly amount: string;
|
|
417
|
+
readonly token: LiFiToken;
|
|
418
|
+
readonly chainId: number;
|
|
419
|
+
readonly gasPrice: string;
|
|
420
|
+
readonly gasUsed: string;
|
|
421
|
+
readonly gasToken: LiFiToken;
|
|
422
|
+
readonly gasAmount: string;
|
|
423
|
+
readonly gasAmountUSD: string;
|
|
424
|
+
readonly amountUSD: string;
|
|
425
|
+
readonly value: string;
|
|
426
|
+
readonly includedSteps: LiFiStep[];
|
|
427
|
+
readonly timestamp: number;
|
|
428
|
+
}
|
|
429
|
+
interface LiFiFeeCost {
|
|
430
|
+
readonly name: string;
|
|
431
|
+
readonly description: string;
|
|
432
|
+
readonly percentage: string;
|
|
433
|
+
readonly token: LiFiToken;
|
|
434
|
+
readonly amount: string;
|
|
435
|
+
readonly amountUSD: string;
|
|
436
|
+
readonly included: boolean;
|
|
437
|
+
}
|
|
438
|
+
interface LiFiMetadata {
|
|
439
|
+
readonly integrator: string;
|
|
440
|
+
readonly [key: string]: unknown;
|
|
441
|
+
}
|
|
442
|
+
type LiFiTransferStatus = 'NOT_FOUND' | 'INVALID' | 'PENDING' | 'DONE' | 'FAILED';
|
|
443
|
+
type LiFiTransferSubstatus = 'WAIT_SOURCE_CONFIRMATIONS' | 'WAIT_DESTINATION_TRANSACTION' | 'BRIDGE_NOT_AVAILABLE' | 'CHAIN_NOT_AVAILABLE' | 'REFUND_IN_PROGRESS' | 'UNKNOWN_ERROR' | 'COMPLETED' | 'PARTIAL' | 'REFUNDED';
|
|
444
|
+
type LiFiBridge = 'hop' | 'cbridge' | 'celercircle' | 'optimism' | 'polygon' | 'arbitrum' | 'avalanche' | 'across' | 'gnosis' | 'omni' | 'relay' | 'celerim' | 'symbiosis' | 'thorswap' | 'squid' | 'allbridge' | 'mayan' | 'debridge' | 'chainflip';
|
|
445
|
+
interface LiFiStatusRequestParams {
|
|
446
|
+
readonly txHash: string;
|
|
447
|
+
readonly bridge?: LiFiBridge;
|
|
448
|
+
readonly fromChain?: string;
|
|
449
|
+
readonly toChain?: string;
|
|
450
|
+
}
|
|
451
|
+
interface LiFiStatusResponse {
|
|
452
|
+
readonly transactionId: string;
|
|
453
|
+
readonly sending: LiFiTransaction;
|
|
454
|
+
readonly receiving?: LiFiTransaction;
|
|
455
|
+
readonly feeCosts: LiFiFeeCost[];
|
|
456
|
+
readonly lifiExplorerLink: string;
|
|
457
|
+
readonly fromAddress: string;
|
|
458
|
+
readonly toAddress: string;
|
|
459
|
+
readonly tool: string;
|
|
460
|
+
readonly status: LiFiTransferStatus;
|
|
461
|
+
readonly substatus?: LiFiTransferSubstatus;
|
|
462
|
+
readonly substatusMessage?: string;
|
|
463
|
+
readonly metadata: LiFiMetadata;
|
|
464
|
+
readonly bridgeExplorerLink?: string;
|
|
465
|
+
}
|
|
466
|
+
|
|
385
467
|
/**
|
|
386
468
|
* Chain Types
|
|
387
469
|
*
|
|
@@ -815,6 +897,7 @@ declare class NativeClient {
|
|
|
815
897
|
declare class CoreClient {
|
|
816
898
|
private config;
|
|
817
899
|
private arcApiService;
|
|
900
|
+
private lifiApiService;
|
|
818
901
|
constructor(config?: CoreConfig);
|
|
819
902
|
/**
|
|
820
903
|
* Generic pagination helper for chains API calls (limit and offset based pagination)
|
|
@@ -884,6 +967,16 @@ declare class CoreClient {
|
|
|
884
967
|
* @param tokenAddress
|
|
885
968
|
*/
|
|
886
969
|
getTokenMappings(tokenMappingQueryParams: TokenMappingQueryParams): Promise<TokenMappingResponse>;
|
|
970
|
+
/**
|
|
971
|
+
* Check the status of a LiFi cross-chain transfer
|
|
972
|
+
*
|
|
973
|
+
* @param lifiStatusRequestParams - Status request parameters
|
|
974
|
+
* @param lifiStatusRequestParams.txHash - The transaction hash on the sending chain, destination chain or lifi step id
|
|
975
|
+
* @param lifiStatusRequestParams.bridge - Optional: The bridging tool used for the transfer
|
|
976
|
+
* @param lifiStatusRequestParams.fromChain - Optional: The sending chain (chain id or chain key)
|
|
977
|
+
* @param lifiStatusRequestParams.toChain - Optional: The receiving chain (chain id or chain key)
|
|
978
|
+
*/
|
|
979
|
+
getLiFiTransferStatus(lifiStatusRequestParams: LiFiStatusRequestParams): Promise<LiFiStatusResponse>;
|
|
887
980
|
}
|
|
888
981
|
|
|
889
982
|
/**
|
|
@@ -937,4 +1030,4 @@ declare class AggLayerSDK {
|
|
|
937
1030
|
getNative(): NativeClient;
|
|
938
1031
|
}
|
|
939
1032
|
|
|
940
|
-
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 PaginatedTransactionsResponse, 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 TokenMetadataRequestParam, type TokenMetadataResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
|
|
1033
|
+
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 LiFiBridge, type LiFiFeeCost, type LiFiMetadata, type LiFiStatusRequestParams, type LiFiStatusResponse, type LiFiStep, type LiFiToken, type LiFiTransaction, type LiFiTransferStatus, type LiFiTransferSubstatus, type NativeConfig, type OffsetPagination, type OriginTokenInfoParams, type PaginatedTransactionsResponse, 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 TokenMetadataRequestParam, type TokenMetadataResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type UnsignedTransaction, type WrappedTokenParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,21 @@ interface TokenReference {
|
|
|
61
61
|
readonly chainId: number;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Arc API Unsigned Transaction Types
|
|
66
|
+
*
|
|
67
|
+
* Defines the core request and response types for the tokens.
|
|
68
|
+
*/
|
|
69
|
+
interface UnsignedTransaction {
|
|
70
|
+
readonly to: string;
|
|
71
|
+
readonly data: string;
|
|
72
|
+
readonly value: string;
|
|
73
|
+
readonly gasLimit: string;
|
|
74
|
+
readonly gasPrice?: string;
|
|
75
|
+
readonly chainId: number;
|
|
76
|
+
readonly from?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
64
79
|
/**
|
|
65
80
|
* Arc API Chains Types
|
|
66
81
|
*
|
|
@@ -100,21 +115,6 @@ type ChainsResponse = {
|
|
|
100
115
|
readonly chains: IChain[];
|
|
101
116
|
};
|
|
102
117
|
|
|
103
|
-
/**
|
|
104
|
-
* Arc API Unsigned Transaction Types
|
|
105
|
-
*
|
|
106
|
-
* Defines the core request and response types for the tokens.
|
|
107
|
-
*/
|
|
108
|
-
interface UnsignedTransaction {
|
|
109
|
-
readonly to: string;
|
|
110
|
-
readonly data: string;
|
|
111
|
-
readonly value: string;
|
|
112
|
-
readonly gasLimit: string;
|
|
113
|
-
readonly gasPrice?: string;
|
|
114
|
-
readonly chainId: number;
|
|
115
|
-
readonly from?: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
118
|
/**
|
|
119
119
|
* Arc API Routes Types
|
|
120
120
|
*
|
|
@@ -317,7 +317,7 @@ interface Transaction {
|
|
|
317
317
|
}
|
|
318
318
|
interface TransactionsRequestQueryParams {
|
|
319
319
|
readonly address?: string;
|
|
320
|
-
readonly
|
|
320
|
+
readonly sourceNetworkIds?: string;
|
|
321
321
|
readonly destinationNetworkIds?: string;
|
|
322
322
|
readonly limit?: number;
|
|
323
323
|
readonly startAfter?: number;
|
|
@@ -382,6 +382,88 @@ type TokenMetadataResponse = {
|
|
|
382
382
|
decimals: number;
|
|
383
383
|
};
|
|
384
384
|
|
|
385
|
+
/**
|
|
386
|
+
* LiFi API Status Types
|
|
387
|
+
*
|
|
388
|
+
* Defines the request and response types for the LiFi status endpoint.
|
|
389
|
+
*/
|
|
390
|
+
interface LiFiToken {
|
|
391
|
+
readonly address: string;
|
|
392
|
+
readonly chainId: number;
|
|
393
|
+
readonly symbol: string;
|
|
394
|
+
readonly decimals: number;
|
|
395
|
+
readonly name: string;
|
|
396
|
+
readonly coinKey: string;
|
|
397
|
+
readonly logoURI: string;
|
|
398
|
+
readonly priceUSD: string;
|
|
399
|
+
}
|
|
400
|
+
interface LiFiStep {
|
|
401
|
+
readonly tool: string;
|
|
402
|
+
readonly toolDetails: {
|
|
403
|
+
readonly key: string;
|
|
404
|
+
readonly name: string;
|
|
405
|
+
readonly logoURI: string;
|
|
406
|
+
};
|
|
407
|
+
readonly fromAmount: string;
|
|
408
|
+
readonly fromToken: LiFiToken;
|
|
409
|
+
readonly toToken: LiFiToken;
|
|
410
|
+
readonly toAmount: string;
|
|
411
|
+
readonly bridgedAmount: string;
|
|
412
|
+
}
|
|
413
|
+
interface LiFiTransaction {
|
|
414
|
+
readonly txHash: string;
|
|
415
|
+
readonly txLink: string;
|
|
416
|
+
readonly amount: string;
|
|
417
|
+
readonly token: LiFiToken;
|
|
418
|
+
readonly chainId: number;
|
|
419
|
+
readonly gasPrice: string;
|
|
420
|
+
readonly gasUsed: string;
|
|
421
|
+
readonly gasToken: LiFiToken;
|
|
422
|
+
readonly gasAmount: string;
|
|
423
|
+
readonly gasAmountUSD: string;
|
|
424
|
+
readonly amountUSD: string;
|
|
425
|
+
readonly value: string;
|
|
426
|
+
readonly includedSteps: LiFiStep[];
|
|
427
|
+
readonly timestamp: number;
|
|
428
|
+
}
|
|
429
|
+
interface LiFiFeeCost {
|
|
430
|
+
readonly name: string;
|
|
431
|
+
readonly description: string;
|
|
432
|
+
readonly percentage: string;
|
|
433
|
+
readonly token: LiFiToken;
|
|
434
|
+
readonly amount: string;
|
|
435
|
+
readonly amountUSD: string;
|
|
436
|
+
readonly included: boolean;
|
|
437
|
+
}
|
|
438
|
+
interface LiFiMetadata {
|
|
439
|
+
readonly integrator: string;
|
|
440
|
+
readonly [key: string]: unknown;
|
|
441
|
+
}
|
|
442
|
+
type LiFiTransferStatus = 'NOT_FOUND' | 'INVALID' | 'PENDING' | 'DONE' | 'FAILED';
|
|
443
|
+
type LiFiTransferSubstatus = 'WAIT_SOURCE_CONFIRMATIONS' | 'WAIT_DESTINATION_TRANSACTION' | 'BRIDGE_NOT_AVAILABLE' | 'CHAIN_NOT_AVAILABLE' | 'REFUND_IN_PROGRESS' | 'UNKNOWN_ERROR' | 'COMPLETED' | 'PARTIAL' | 'REFUNDED';
|
|
444
|
+
type LiFiBridge = 'hop' | 'cbridge' | 'celercircle' | 'optimism' | 'polygon' | 'arbitrum' | 'avalanche' | 'across' | 'gnosis' | 'omni' | 'relay' | 'celerim' | 'symbiosis' | 'thorswap' | 'squid' | 'allbridge' | 'mayan' | 'debridge' | 'chainflip';
|
|
445
|
+
interface LiFiStatusRequestParams {
|
|
446
|
+
readonly txHash: string;
|
|
447
|
+
readonly bridge?: LiFiBridge;
|
|
448
|
+
readonly fromChain?: string;
|
|
449
|
+
readonly toChain?: string;
|
|
450
|
+
}
|
|
451
|
+
interface LiFiStatusResponse {
|
|
452
|
+
readonly transactionId: string;
|
|
453
|
+
readonly sending: LiFiTransaction;
|
|
454
|
+
readonly receiving?: LiFiTransaction;
|
|
455
|
+
readonly feeCosts: LiFiFeeCost[];
|
|
456
|
+
readonly lifiExplorerLink: string;
|
|
457
|
+
readonly fromAddress: string;
|
|
458
|
+
readonly toAddress: string;
|
|
459
|
+
readonly tool: string;
|
|
460
|
+
readonly status: LiFiTransferStatus;
|
|
461
|
+
readonly substatus?: LiFiTransferSubstatus;
|
|
462
|
+
readonly substatusMessage?: string;
|
|
463
|
+
readonly metadata: LiFiMetadata;
|
|
464
|
+
readonly bridgeExplorerLink?: string;
|
|
465
|
+
}
|
|
466
|
+
|
|
385
467
|
/**
|
|
386
468
|
* Chain Types
|
|
387
469
|
*
|
|
@@ -815,6 +897,7 @@ declare class NativeClient {
|
|
|
815
897
|
declare class CoreClient {
|
|
816
898
|
private config;
|
|
817
899
|
private arcApiService;
|
|
900
|
+
private lifiApiService;
|
|
818
901
|
constructor(config?: CoreConfig);
|
|
819
902
|
/**
|
|
820
903
|
* Generic pagination helper for chains API calls (limit and offset based pagination)
|
|
@@ -884,6 +967,16 @@ declare class CoreClient {
|
|
|
884
967
|
* @param tokenAddress
|
|
885
968
|
*/
|
|
886
969
|
getTokenMappings(tokenMappingQueryParams: TokenMappingQueryParams): Promise<TokenMappingResponse>;
|
|
970
|
+
/**
|
|
971
|
+
* Check the status of a LiFi cross-chain transfer
|
|
972
|
+
*
|
|
973
|
+
* @param lifiStatusRequestParams - Status request parameters
|
|
974
|
+
* @param lifiStatusRequestParams.txHash - The transaction hash on the sending chain, destination chain or lifi step id
|
|
975
|
+
* @param lifiStatusRequestParams.bridge - Optional: The bridging tool used for the transfer
|
|
976
|
+
* @param lifiStatusRequestParams.fromChain - Optional: The sending chain (chain id or chain key)
|
|
977
|
+
* @param lifiStatusRequestParams.toChain - Optional: The receiving chain (chain id or chain key)
|
|
978
|
+
*/
|
|
979
|
+
getLiFiTransferStatus(lifiStatusRequestParams: LiFiStatusRequestParams): Promise<LiFiStatusResponse>;
|
|
887
980
|
}
|
|
888
981
|
|
|
889
982
|
/**
|
|
@@ -937,4 +1030,4 @@ declare class AggLayerSDK {
|
|
|
937
1030
|
getNative(): NativeClient;
|
|
938
1031
|
}
|
|
939
1032
|
|
|
940
|
-
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 PaginatedTransactionsResponse, 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 TokenMetadataRequestParam, type TokenMetadataResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
|
|
1033
|
+
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 LiFiBridge, type LiFiFeeCost, type LiFiMetadata, type LiFiStatusRequestParams, type LiFiStatusResponse, type LiFiStep, type LiFiToken, type LiFiTransaction, type LiFiTransferStatus, type LiFiTransferSubstatus, type NativeConfig, type OffsetPagination, type OriginTokenInfoParams, type PaginatedTransactionsResponse, 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 TokenMetadataRequestParam, type TokenMetadataResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type UnsignedTransaction, type WrappedTokenParams };
|
package/dist/index.js
CHANGED
|
@@ -1425,6 +1425,8 @@ var import_viem6 = require("viem");
|
|
|
1425
1425
|
// src/constants.ts
|
|
1426
1426
|
var ARC_API_BASE_URL = "https://arc-api.polygon.technology";
|
|
1427
1427
|
var ARC_API_DEFAULT_TIMEOUT = 3e4;
|
|
1428
|
+
var LIFI_API_BASE_URL = "https://li.quest";
|
|
1429
|
+
var LIFI_API_DEFAULT_TIMEOUT = 5e3;
|
|
1428
1430
|
var DEFAULT_CHAINS_PER_PAGE = 100;
|
|
1429
1431
|
var DEFAULT_CHAINS_WITH_TOKENS_PER_PAGE = 1;
|
|
1430
1432
|
var MAX_TRANSACTIONS_PER_PAGE = 100;
|
|
@@ -1745,6 +1747,39 @@ var ArcApiService = class {
|
|
|
1745
1747
|
}
|
|
1746
1748
|
};
|
|
1747
1749
|
|
|
1750
|
+
// src/core/services/lifiApi.ts
|
|
1751
|
+
var LiFiApiService = class {
|
|
1752
|
+
constructor({ baseUrl, timeout }) {
|
|
1753
|
+
this.httpClient = new HttpClient({ baseUrl, timeout });
|
|
1754
|
+
}
|
|
1755
|
+
/**
|
|
1756
|
+
* Check the status of a cross-chain transfer
|
|
1757
|
+
*
|
|
1758
|
+
* @param params - Status request parameters
|
|
1759
|
+
* @param params.txHash - The transaction hash on the sending chain, destination chain or lifi step id
|
|
1760
|
+
* @param params.bridge - Optional: The bridging tool used for the transfer
|
|
1761
|
+
* @param params.fromChain - Optional: The sending chain (chain id or chain key)
|
|
1762
|
+
* @param params.toChain - Optional: The receiving chain (chain id or chain key)
|
|
1763
|
+
* @returns Promise containing the transfer status response
|
|
1764
|
+
*/
|
|
1765
|
+
async getStatus(params) {
|
|
1766
|
+
const { txHash, bridge, fromChain, toChain } = params;
|
|
1767
|
+
const queryParams = {
|
|
1768
|
+
txHash
|
|
1769
|
+
};
|
|
1770
|
+
if (bridge) {
|
|
1771
|
+
queryParams["bridge"] = bridge;
|
|
1772
|
+
}
|
|
1773
|
+
if (fromChain) {
|
|
1774
|
+
queryParams["fromChain"] = fromChain;
|
|
1775
|
+
}
|
|
1776
|
+
if (toChain) {
|
|
1777
|
+
queryParams["toChain"] = toChain;
|
|
1778
|
+
}
|
|
1779
|
+
return this.httpClient.get("/v1/status", queryParams);
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
|
|
1748
1783
|
// src/core/utils/apiError.ts
|
|
1749
1784
|
var ApiError = class _ApiError extends Error {
|
|
1750
1785
|
constructor(errorResponse) {
|
|
@@ -1803,6 +1838,10 @@ var CoreClient = class {
|
|
|
1803
1838
|
baseUrl: apiBaseUrl || ARC_API_BASE_URL,
|
|
1804
1839
|
timeout: apiTimeout || ARC_API_DEFAULT_TIMEOUT
|
|
1805
1840
|
});
|
|
1841
|
+
this.lifiApiService = new LiFiApiService({
|
|
1842
|
+
baseUrl: LIFI_API_BASE_URL,
|
|
1843
|
+
timeout: LIFI_API_DEFAULT_TIMEOUT
|
|
1844
|
+
});
|
|
1806
1845
|
}
|
|
1807
1846
|
/**
|
|
1808
1847
|
* Generic pagination helper for chains API calls (limit and offset based pagination)
|
|
@@ -2063,6 +2102,31 @@ var CoreClient = class {
|
|
|
2063
2102
|
);
|
|
2064
2103
|
}
|
|
2065
2104
|
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Check the status of a LiFi cross-chain transfer
|
|
2107
|
+
*
|
|
2108
|
+
* @param lifiStatusRequestParams - Status request parameters
|
|
2109
|
+
* @param lifiStatusRequestParams.txHash - The transaction hash on the sending chain, destination chain or lifi step id
|
|
2110
|
+
* @param lifiStatusRequestParams.bridge - Optional: The bridging tool used for the transfer
|
|
2111
|
+
* @param lifiStatusRequestParams.fromChain - Optional: The sending chain (chain id or chain key)
|
|
2112
|
+
* @param lifiStatusRequestParams.toChain - Optional: The receiving chain (chain id or chain key)
|
|
2113
|
+
*/
|
|
2114
|
+
async getLiFiTransferStatus(lifiStatusRequestParams) {
|
|
2115
|
+
try {
|
|
2116
|
+
const response = await this.lifiApiService.getStatus(
|
|
2117
|
+
lifiStatusRequestParams
|
|
2118
|
+
);
|
|
2119
|
+
return response.data;
|
|
2120
|
+
} catch (error) {
|
|
2121
|
+
if (error instanceof ApiError) {
|
|
2122
|
+
throw error;
|
|
2123
|
+
}
|
|
2124
|
+
throw ApiError.createFallbackError(
|
|
2125
|
+
error,
|
|
2126
|
+
"Get LiFi transfer status"
|
|
2127
|
+
);
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2066
2130
|
};
|
|
2067
2131
|
|
|
2068
2132
|
// src/index.ts
|