@agglayer/sdk 1.0.0-beta.16 → 1.0.0-beta.17
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 +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -78,6 +78,11 @@ interface IChain {
|
|
|
78
78
|
name: string;
|
|
79
79
|
symbol: string;
|
|
80
80
|
decimals: number;
|
|
81
|
+
address: string;
|
|
82
|
+
logoURI: string;
|
|
83
|
+
priceUSD: string;
|
|
84
|
+
originTokenAddress?: string;
|
|
85
|
+
originChainId?: number;
|
|
81
86
|
};
|
|
82
87
|
networkId?: number;
|
|
83
88
|
bridgeAddress?: string;
|
|
@@ -328,6 +333,18 @@ type TransactionsResponse = {
|
|
|
328
333
|
type BuildTransactionRequestBody = Step;
|
|
329
334
|
type BuildTransactionResponse = UnsignedTransaction;
|
|
330
335
|
|
|
336
|
+
/**
|
|
337
|
+
* Arc API Build Claim Transaction Types
|
|
338
|
+
*
|
|
339
|
+
* Defines the core request and response types for the build claim transaction endpoint.
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
type BuildClaimTransactionRequestParam = {
|
|
343
|
+
sourceNetworkId: number;
|
|
344
|
+
depositCount: number;
|
|
345
|
+
};
|
|
346
|
+
type BuildClaimTransactionResponse = UnsignedTransaction;
|
|
347
|
+
|
|
331
348
|
/**
|
|
332
349
|
* Chain Types
|
|
333
350
|
*
|
|
@@ -803,6 +820,16 @@ declare class CoreClient {
|
|
|
803
820
|
* Otherwise, call buildTransaction on route.steps[0] and return that as calldata
|
|
804
821
|
*/
|
|
805
822
|
getUnsignedTransaction(route: Route): Promise<UnsignedTransaction>;
|
|
823
|
+
/**
|
|
824
|
+
* Get calldata for claim step
|
|
825
|
+
* Needs to be called separately as claim step is not part of route.
|
|
826
|
+
*
|
|
827
|
+
* @developer Note: Do not misinterpret network ID as chain ID.
|
|
828
|
+
*
|
|
829
|
+
* @param sourceNetworkId - The source network ID where the transfer was initiated.
|
|
830
|
+
* @param depositCount - The deposit count associated with the transfer.
|
|
831
|
+
*/
|
|
832
|
+
getClaimUnsignedTransaction(buildClaimTxParams: BuildClaimTransactionRequestParam): Promise<UnsignedTransaction>;
|
|
806
833
|
/**
|
|
807
834
|
* Get all transactions via web sockets
|
|
808
835
|
*/
|
|
@@ -830,4 +857,4 @@ declare class AggLayerSDK {
|
|
|
830
857
|
getNative(): NativeClient;
|
|
831
858
|
}
|
|
832
859
|
|
|
833
|
-
export { AggLayerSDK, type ApiResponse, type BaseContractConfig, type BridgeAssetParams, type BridgeConfig, type BridgeMessageParams, type BridgeOptions, 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,11 @@ interface IChain {
|
|
|
78
78
|
name: string;
|
|
79
79
|
symbol: string;
|
|
80
80
|
decimals: number;
|
|
81
|
+
address: string;
|
|
82
|
+
logoURI: string;
|
|
83
|
+
priceUSD: string;
|
|
84
|
+
originTokenAddress?: string;
|
|
85
|
+
originChainId?: number;
|
|
81
86
|
};
|
|
82
87
|
networkId?: number;
|
|
83
88
|
bridgeAddress?: string;
|
|
@@ -328,6 +333,18 @@ type TransactionsResponse = {
|
|
|
328
333
|
type BuildTransactionRequestBody = Step;
|
|
329
334
|
type BuildTransactionResponse = UnsignedTransaction;
|
|
330
335
|
|
|
336
|
+
/**
|
|
337
|
+
* Arc API Build Claim Transaction Types
|
|
338
|
+
*
|
|
339
|
+
* Defines the core request and response types for the build claim transaction endpoint.
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
type BuildClaimTransactionRequestParam = {
|
|
343
|
+
sourceNetworkId: number;
|
|
344
|
+
depositCount: number;
|
|
345
|
+
};
|
|
346
|
+
type BuildClaimTransactionResponse = UnsignedTransaction;
|
|
347
|
+
|
|
331
348
|
/**
|
|
332
349
|
* Chain Types
|
|
333
350
|
*
|
|
@@ -803,6 +820,16 @@ declare class CoreClient {
|
|
|
803
820
|
* Otherwise, call buildTransaction on route.steps[0] and return that as calldata
|
|
804
821
|
*/
|
|
805
822
|
getUnsignedTransaction(route: Route): Promise<UnsignedTransaction>;
|
|
823
|
+
/**
|
|
824
|
+
* Get calldata for claim step
|
|
825
|
+
* Needs to be called separately as claim step is not part of route.
|
|
826
|
+
*
|
|
827
|
+
* @developer Note: Do not misinterpret network ID as chain ID.
|
|
828
|
+
*
|
|
829
|
+
* @param sourceNetworkId - The source network ID where the transfer was initiated.
|
|
830
|
+
* @param depositCount - The deposit count associated with the transfer.
|
|
831
|
+
*/
|
|
832
|
+
getClaimUnsignedTransaction(buildClaimTxParams: BuildClaimTransactionRequestParam): Promise<UnsignedTransaction>;
|
|
806
833
|
/**
|
|
807
834
|
* Get all transactions via web sockets
|
|
808
835
|
*/
|
|
@@ -830,4 +857,4 @@ declare class AggLayerSDK {
|
|
|
830
857
|
getNative(): NativeClient;
|
|
831
858
|
}
|
|
832
859
|
|
|
833
|
-
export { AggLayerSDK, type ApiResponse, type BaseContractConfig, type BridgeAssetParams, type BridgeConfig, type BridgeMessageParams, type BridgeOptions, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1704,6 +1704,12 @@ var ArcApiService = class {
|
|
|
1704
1704
|
builtTransactionRequestBody
|
|
1705
1705
|
);
|
|
1706
1706
|
}
|
|
1707
|
+
async buildClaimTransaction(sourceNetworkId, depositCount) {
|
|
1708
|
+
return this.httpClient.get("/routes/build-transaction-for-claim", {
|
|
1709
|
+
sourceNetworkId,
|
|
1710
|
+
depositCount
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1707
1713
|
// supports cursor based pagination only
|
|
1708
1714
|
async transactions(transactionsRequestQueryParams) {
|
|
1709
1715
|
return this.httpClient.get("/transactions", {
|
|
@@ -1853,6 +1859,25 @@ var CoreClient = class {
|
|
|
1853
1859
|
}
|
|
1854
1860
|
throw new Error(response.data.message);
|
|
1855
1861
|
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Get calldata for claim step
|
|
1864
|
+
* Needs to be called separately as claim step is not part of route.
|
|
1865
|
+
*
|
|
1866
|
+
* @developer Note: Do not misinterpret network ID as chain ID.
|
|
1867
|
+
*
|
|
1868
|
+
* @param sourceNetworkId - The source network ID where the transfer was initiated.
|
|
1869
|
+
* @param depositCount - The deposit count associated with the transfer.
|
|
1870
|
+
*/
|
|
1871
|
+
async getClaimUnsignedTransaction(buildClaimTxParams) {
|
|
1872
|
+
const response = await this.arcApiService.buildClaimTransaction(
|
|
1873
|
+
buildClaimTxParams.sourceNetworkId,
|
|
1874
|
+
buildClaimTxParams.depositCount
|
|
1875
|
+
);
|
|
1876
|
+
if (response.data.status === "success") {
|
|
1877
|
+
return response.data.data;
|
|
1878
|
+
}
|
|
1879
|
+
throw new Error(response.data.message);
|
|
1880
|
+
}
|
|
1856
1881
|
/**
|
|
1857
1882
|
* Get all transactions via web sockets
|
|
1858
1883
|
*/
|