@agglayer/sdk 1.0.0-beta.21 → 1.0.0-beta.23
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 +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -361,6 +361,24 @@ type TokenMappingResponse = Array<{
|
|
|
361
361
|
wrappedTokenAddress: string;
|
|
362
362
|
}>;
|
|
363
363
|
|
|
364
|
+
/**
|
|
365
|
+
* Arc API Token Metadata Types
|
|
366
|
+
*
|
|
367
|
+
* Defines the core request and response types for the token metadata endpoint.
|
|
368
|
+
*/
|
|
369
|
+
type TokenMetadataRequestParam = {
|
|
370
|
+
tokenAddress: string;
|
|
371
|
+
};
|
|
372
|
+
type TokenMetadataResponse = {
|
|
373
|
+
originTokenNetwork: number;
|
|
374
|
+
originTokenAddress: string;
|
|
375
|
+
wrappedTokenAddressV1: string;
|
|
376
|
+
wrappedTokenAddressV2: string;
|
|
377
|
+
name: string;
|
|
378
|
+
symbol: string;
|
|
379
|
+
decimals: number;
|
|
380
|
+
};
|
|
381
|
+
|
|
364
382
|
/**
|
|
365
383
|
* Chain Types
|
|
366
384
|
*
|
|
@@ -826,6 +844,11 @@ declare class CoreClient {
|
|
|
826
844
|
* @param ids - the ids of the chains to get data and tokens for
|
|
827
845
|
*/
|
|
828
846
|
getChainDataAndTokensByChainIds(ids: number[]): Promise<ChainsResponse>;
|
|
847
|
+
/**
|
|
848
|
+
* Get token metadata by token address from ARC API
|
|
849
|
+
* @param tokenMetadataRequestParam - Object containing the token address
|
|
850
|
+
*/
|
|
851
|
+
getTokenMetadata(tokenMetadataRequestParam: TokenMetadataRequestParam): Promise<TokenMetadataResponse>;
|
|
829
852
|
/**
|
|
830
853
|
* Get all routes from AggLayer API
|
|
831
854
|
*/
|
|
@@ -910,4 +933,4 @@ declare class AggLayerSDK {
|
|
|
910
933
|
getNative(): NativeClient;
|
|
911
934
|
}
|
|
912
935
|
|
|
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 };
|
|
936
|
+
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 TokenMetadataRequestParam, type TokenMetadataResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -361,6 +361,24 @@ type TokenMappingResponse = Array<{
|
|
|
361
361
|
wrappedTokenAddress: string;
|
|
362
362
|
}>;
|
|
363
363
|
|
|
364
|
+
/**
|
|
365
|
+
* Arc API Token Metadata Types
|
|
366
|
+
*
|
|
367
|
+
* Defines the core request and response types for the token metadata endpoint.
|
|
368
|
+
*/
|
|
369
|
+
type TokenMetadataRequestParam = {
|
|
370
|
+
tokenAddress: string;
|
|
371
|
+
};
|
|
372
|
+
type TokenMetadataResponse = {
|
|
373
|
+
originTokenNetwork: number;
|
|
374
|
+
originTokenAddress: string;
|
|
375
|
+
wrappedTokenAddressV1: string;
|
|
376
|
+
wrappedTokenAddressV2: string;
|
|
377
|
+
name: string;
|
|
378
|
+
symbol: string;
|
|
379
|
+
decimals: number;
|
|
380
|
+
};
|
|
381
|
+
|
|
364
382
|
/**
|
|
365
383
|
* Chain Types
|
|
366
384
|
*
|
|
@@ -826,6 +844,11 @@ declare class CoreClient {
|
|
|
826
844
|
* @param ids - the ids of the chains to get data and tokens for
|
|
827
845
|
*/
|
|
828
846
|
getChainDataAndTokensByChainIds(ids: number[]): Promise<ChainsResponse>;
|
|
847
|
+
/**
|
|
848
|
+
* Get token metadata by token address from ARC API
|
|
849
|
+
* @param tokenMetadataRequestParam - Object containing the token address
|
|
850
|
+
*/
|
|
851
|
+
getTokenMetadata(tokenMetadataRequestParam: TokenMetadataRequestParam): Promise<TokenMetadataResponse>;
|
|
829
852
|
/**
|
|
830
853
|
* Get all routes from AggLayer API
|
|
831
854
|
*/
|
|
@@ -910,4 +933,4 @@ declare class AggLayerSDK {
|
|
|
910
933
|
getNative(): NativeClient;
|
|
911
934
|
}
|
|
912
935
|
|
|
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 };
|
|
936
|
+
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 TokenMetadataRequestParam, type TokenMetadataResponse, type TokenReference, type ToolDetails, type Transaction, type TransactionParams, type TransactionsRequestQueryParams, type TransactionsResponse, type WrappedTokenParams };
|
package/dist/index.js
CHANGED
|
@@ -1713,6 +1713,11 @@ var ArcApiService = class {
|
|
|
1713
1713
|
chainIds
|
|
1714
1714
|
});
|
|
1715
1715
|
}
|
|
1716
|
+
async tokenMetadata(tokenMetadataRequestParam) {
|
|
1717
|
+
return this.httpClient.get(
|
|
1718
|
+
`/metadata/tokens/${tokenMetadataRequestParam.tokenAddress}`
|
|
1719
|
+
);
|
|
1720
|
+
}
|
|
1716
1721
|
async routes(routesRequestParams) {
|
|
1717
1722
|
return this.httpClient.post("/routes", routesRequestParams);
|
|
1718
1723
|
}
|
|
@@ -1731,7 +1736,7 @@ var ArcApiService = class {
|
|
|
1731
1736
|
// supports cursor based pagination only
|
|
1732
1737
|
async transactions(transactionsRequestQueryParams) {
|
|
1733
1738
|
return this.httpClient.get("/transactions", {
|
|
1734
|
-
transactionsRequestQueryParams
|
|
1739
|
+
...transactionsRequestQueryParams
|
|
1735
1740
|
});
|
|
1736
1741
|
}
|
|
1737
1742
|
async tokenMappings(tokenMappingQueryParams) {
|
|
@@ -1903,6 +1908,26 @@ var CoreClient = class {
|
|
|
1903
1908
|
withSupportedTokens: true
|
|
1904
1909
|
});
|
|
1905
1910
|
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Get token metadata by token address from ARC API
|
|
1913
|
+
* @param tokenMetadataRequestParam - Object containing the token address
|
|
1914
|
+
*/
|
|
1915
|
+
async getTokenMetadata(tokenMetadataRequestParam) {
|
|
1916
|
+
try {
|
|
1917
|
+
const response = await this.arcApiService.tokenMetadata(
|
|
1918
|
+
tokenMetadataRequestParam
|
|
1919
|
+
);
|
|
1920
|
+
if (response.data.status === "success") {
|
|
1921
|
+
return response.data.data;
|
|
1922
|
+
}
|
|
1923
|
+
throw ApiError.fromErrorResponse(response.data);
|
|
1924
|
+
} catch (error) {
|
|
1925
|
+
if (error instanceof ApiError) {
|
|
1926
|
+
throw error;
|
|
1927
|
+
}
|
|
1928
|
+
throw ApiError.createFallbackError(error, "Get token metadata");
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1906
1931
|
/**
|
|
1907
1932
|
* Get all routes from AggLayer API
|
|
1908
1933
|
*/
|