@imtbl/checkout-sdk 2.0.0-alpha.0
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/LICENSE.md +176 -0
- package/README.md +58 -0
- package/dist/browser/index.js +6566 -0
- package/dist/node/index.cjs +6566 -0
- package/dist/node/index.js +6566 -0
- package/dist/types/api/blockscout/blockscout.d.ts +53 -0
- package/dist/types/api/blockscout/blockscout.test.d.ts +1 -0
- package/dist/types/api/blockscout/blockscoutType.d.ts +33 -0
- package/dist/types/api/blockscout/index.d.ts +2 -0
- package/dist/types/api/http/httpClient.d.ts +14 -0
- package/dist/types/api/http/httpClient.test.d.ts +1 -0
- package/dist/types/api/http/index.d.ts +1 -0
- package/dist/types/availability/availability.d.ts +6 -0
- package/dist/types/availability/availability.test.d.ts +1 -0
- package/dist/types/availability/index.d.ts +1 -0
- package/dist/types/balances/balances.d.ts +9 -0
- package/dist/types/balances/balances.test.d.ts +1 -0
- package/dist/types/balances/index.d.ts +1 -0
- package/dist/types/blockExplorer/blockExplorer.d.ts +9 -0
- package/dist/types/blockExplorer/blockExplorer.test.d.ts +1 -0
- package/dist/types/blockExplorer/index.d.ts +1 -0
- package/dist/types/config/config.d.ts +26 -0
- package/dist/types/config/config.test.d.ts +1 -0
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/config/remoteConfigFetcher.d.ts +19 -0
- package/dist/types/config/remoteConfigFetcher.test.d.ts +1 -0
- package/dist/types/config/tokensFetcher.d.ts +23 -0
- package/dist/types/config/tokensFetcher.test.d.ts +1 -0
- package/dist/types/connect/connect.d.ts +4 -0
- package/dist/types/connect/connect.test.d.ts +1 -0
- package/dist/types/connect/index.d.ts +1 -0
- package/dist/types/env/constants.d.ts +150 -0
- package/dist/types/env/env.d.ts +3 -0
- package/dist/types/env/env.test.d.ts +1 -0
- package/dist/types/env/index.d.ts +2 -0
- package/dist/types/errors/checkoutError.d.ts +80 -0
- package/dist/types/errors/checkoutError.test.d.ts +1 -0
- package/dist/types/errors/index.d.ts +1 -0
- package/dist/types/fiatRamp/fiatRamp.d.ts +23 -0
- package/dist/types/fiatRamp/fiatRamp.test.d.ts +1 -0
- package/dist/types/fiatRamp/index.d.ts +1 -0
- package/dist/types/gasEstimate/bridgeGasEstimate.d.ts +4 -0
- package/dist/types/gasEstimate/bridgeGasEstimate.test.d.ts +1 -0
- package/dist/types/gasEstimate/bridgeGasEstimateType.d.ts +5 -0
- package/dist/types/gasEstimate/gasEstimator.d.ts +4 -0
- package/dist/types/gasEstimate/gasEstimator.test.d.ts +1 -0
- package/dist/types/gasEstimate/gasPriceInWei.d.ts +2 -0
- package/dist/types/gasEstimate/gasPriceInWei.test.d.ts +1 -0
- package/dist/types/gasEstimate/index.d.ts +3 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/instance/contract.d.ts +2 -0
- package/dist/types/instance/index.d.ts +2 -0
- package/dist/types/instance/instance.d.ts +11 -0
- package/dist/types/instance/instance.test.d.ts +1 -0
- package/dist/types/logger/debugLogger.d.ts +3 -0
- package/dist/types/logger/debugLogger.test.d.ts +1 -0
- package/dist/types/network/index.d.ts +1 -0
- package/dist/types/network/network.d.ts +7 -0
- package/dist/types/network/network.test.d.ts +1 -0
- package/dist/types/provider/getUnderlyingProvider.d.ts +8 -0
- package/dist/types/provider/getUnderlyingProvider.test.d.ts +1 -0
- package/dist/types/provider/index.d.ts +4 -0
- package/dist/types/provider/injected/index.d.ts +3 -0
- package/dist/types/provider/injected/index.test.d.ts +1 -0
- package/dist/types/provider/injected/register.d.ts +20 -0
- package/dist/types/provider/injected/store.d.ts +42 -0
- package/dist/types/provider/injected/utils.d.ts +19 -0
- package/dist/types/provider/injected/window.d.ts +8 -0
- package/dist/types/provider/injectedProvidersManager.d.ts +19 -0
- package/dist/types/provider/provider.d.ts +3 -0
- package/dist/types/provider/provider.test.d.ts +1 -0
- package/dist/types/provider/providerDetail.d.ts +5 -0
- package/dist/types/provider/validateProvider.d.ts +5 -0
- package/dist/types/provider/validateProvider.test.d.ts +1 -0
- package/dist/types/readOnlyProviders/readOnlyProvider.d.ts +4 -0
- package/dist/types/readOnlyProviders/readOnlyProviders.test.d.ts +1 -0
- package/dist/types/riskAssessment/index.d.ts +1 -0
- package/dist/types/riskAssessment/riskAssessment.d.ts +14 -0
- package/dist/types/riskAssessment/riskAssessment.test.d.ts +1 -0
- package/dist/types/sdk.d.ts +216 -0
- package/dist/types/sdk.test.d.ts +1 -0
- package/dist/types/smartCheckout/actions/getUnsignedActions.d.ts +7 -0
- package/dist/types/smartCheckout/actions/getUnsignedActions.test.d.ts +1 -0
- package/dist/types/smartCheckout/actions/index.d.ts +2 -0
- package/dist/types/smartCheckout/actions/signActions.d.ts +6 -0
- package/dist/types/smartCheckout/actions/signActions.test.d.ts +1 -0
- package/dist/types/smartCheckout/actions/types.d.ts +32 -0
- package/dist/types/smartCheckout/aggregators/allowanceAggregator.d.ts +2 -0
- package/dist/types/smartCheckout/aggregators/allowanceAggregator.test.d.ts +1 -0
- package/dist/types/smartCheckout/aggregators/balanceAggregator.d.ts +5 -0
- package/dist/types/smartCheckout/aggregators/balanceAggregator.test.d.ts +1 -0
- package/dist/types/smartCheckout/aggregators/index.d.ts +2 -0
- package/dist/types/smartCheckout/aggregators/itemAggregator.d.ts +6 -0
- package/dist/types/smartCheckout/aggregators/itemAggregator.test.d.ts +1 -0
- package/dist/types/smartCheckout/allowList/allowListCheck.d.ts +11 -0
- package/dist/types/smartCheckout/allowList/allowListCheck.test.d.ts +1 -0
- package/dist/types/smartCheckout/allowList/index.d.ts +1 -0
- package/dist/types/smartCheckout/allowList/types.d.ts +6 -0
- package/dist/types/smartCheckout/allowance/erc1155.d.ts +9 -0
- package/dist/types/smartCheckout/allowance/erc1155.test.d.ts +1 -0
- package/dist/types/smartCheckout/allowance/erc20.d.ts +9 -0
- package/dist/types/smartCheckout/allowance/erc20.test.d.ts +1 -0
- package/dist/types/smartCheckout/allowance/erc721.d.ts +12 -0
- package/dist/types/smartCheckout/allowance/erc721.test.d.ts +1 -0
- package/dist/types/smartCheckout/allowance/index.d.ts +3 -0
- package/dist/types/smartCheckout/allowance/types.d.ts +30 -0
- package/dist/types/smartCheckout/balanceCheck/balanceCheck.d.ts +7 -0
- package/dist/types/smartCheckout/balanceCheck/balanceCheck.test.d.ts +1 -0
- package/dist/types/smartCheckout/balanceCheck/balanceRequirement.d.ts +17 -0
- package/dist/types/smartCheckout/balanceCheck/balanceRequirement.test.d.ts +1 -0
- package/dist/types/smartCheckout/balanceCheck/index.d.ts +1 -0
- package/dist/types/smartCheckout/balanceCheck/types.d.ts +30 -0
- package/dist/types/smartCheckout/buy/buy.d.ts +7 -0
- package/dist/types/smartCheckout/buy/buy.test.d.ts +1 -0
- package/dist/types/smartCheckout/buy/index.d.ts +1 -0
- package/dist/types/smartCheckout/cancel/cancel.d.ts +3 -0
- package/dist/types/smartCheckout/cancel/cancel.test.d.ts +1 -0
- package/dist/types/smartCheckout/cancel/index.d.ts +1 -0
- package/dist/types/smartCheckout/fees/fees.d.ts +5 -0
- package/dist/types/smartCheckout/fees/fees.test.d.ts +1 -0
- package/dist/types/smartCheckout/gas/gasCalculator.d.ts +6 -0
- package/dist/types/smartCheckout/gas/gasCalculator.test.d.ts +1 -0
- package/dist/types/smartCheckout/gas/index.d.ts +1 -0
- package/dist/types/smartCheckout/index.d.ts +1 -0
- package/dist/types/smartCheckout/itemRequirements/index.d.ts +1 -0
- package/dist/types/smartCheckout/itemRequirements/itemRequirements.d.ts +2 -0
- package/dist/types/smartCheckout/itemRequirements/itemRequirements.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridge/bridgeRoute.d.ts +11 -0
- package/dist/types/smartCheckout/routing/bridge/bridgeRoute.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridge/getBridgeFeeEstimate.d.ts +7 -0
- package/dist/types/smartCheckout/routing/bridge/getBridgeFeeEstimate.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridge/getEthBalance.d.ts +2 -0
- package/dist/types/smartCheckout/routing/bridge/getEthBalance.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.d.ts +15 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.d.ts +9 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/fetchL1ToL2Mapping.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/fetchL1ToL2Mappings.d.ts +4 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/getBalancesByChain.d.ts +7 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/getBalancesByChain.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/getDexQuotes.d.ts +5 -0
- package/dist/types/smartCheckout/routing/bridgeAndSwap/getDexQuotes.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/geoBlocking.d.ts +3 -0
- package/dist/types/smartCheckout/routing/geoBlocking.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/index.d.ts +1 -0
- package/dist/types/smartCheckout/routing/indexer/fetchL1Representation.d.ts +9 -0
- package/dist/types/smartCheckout/routing/indexer/fetchL1Representation.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/onRamp/index.d.ts +1 -0
- package/dist/types/smartCheckout/routing/onRamp/onRampRoute.d.ts +4 -0
- package/dist/types/smartCheckout/routing/onRamp/onRampRoute.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/routingCalculator.d.ts +13 -0
- package/dist/types/smartCheckout/routing/routingCalculator.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/routingOptions.d.ts +7 -0
- package/dist/types/smartCheckout/routing/routingOptions.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/swap/quoteFetcher.d.ts +7 -0
- package/dist/types/smartCheckout/routing/swap/quoteFetcher.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/swap/swapRoute.d.ts +24 -0
- package/dist/types/smartCheckout/routing/swap/swapRoute.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/tokenBalances.d.ts +5 -0
- package/dist/types/smartCheckout/routing/tokenBalances.test.d.ts +1 -0
- package/dist/types/smartCheckout/routing/types.d.ts +15 -0
- package/dist/types/smartCheckout/sell/index.d.ts +1 -0
- package/dist/types/smartCheckout/sell/sell.d.ts +7 -0
- package/dist/types/smartCheckout/sell/sell.test.d.ts +1 -0
- package/dist/types/smartCheckout/smartCheckout.d.ts +6 -0
- package/dist/types/smartCheckout/smartCheckout.test.d.ts +1 -0
- package/dist/types/swap/index.d.ts +1 -0
- package/dist/types/swap/swap.d.ts +7 -0
- package/dist/types/swap/swap.test.d.ts +1 -0
- package/dist/types/tokens/index.d.ts +1 -0
- package/dist/types/tokens/tokens.d.ts +12 -0
- package/dist/types/tokens/tokens.test.d.ts +1 -0
- package/dist/types/transaction/index.d.ts +1 -0
- package/dist/types/transaction/transaction.d.ts +21 -0
- package/dist/types/transaction/transaction.test.d.ts +1 -0
- package/dist/types/types/balances.d.ts +52 -0
- package/dist/types/types/buy.d.ts +15 -0
- package/dist/types/types/cancel.d.ts +15 -0
- package/dist/types/types/chains.d.ts +48 -0
- package/dist/types/types/config.d.ts +265 -0
- package/dist/types/types/connect.d.ts +34 -0
- package/dist/types/types/eip1193.d.ts +47 -0
- package/dist/types/types/eip6963.d.ts +29 -0
- package/dist/types/types/fees.d.ts +10 -0
- package/dist/types/types/fiatRamp.d.ts +25 -0
- package/dist/types/types/gasEstimate.d.ts +64 -0
- package/dist/types/types/index.d.ts +20 -0
- package/dist/types/types/network.d.ts +77 -0
- package/dist/types/types/networkInfo.d.ts +15 -0
- package/dist/types/types/provider.d.ts +45 -0
- package/dist/types/types/sell.d.ts +13 -0
- package/dist/types/types/smartCheckout.d.ts +918 -0
- package/dist/types/types/swap.d.ts +47 -0
- package/dist/types/types/token.d.ts +40 -0
- package/dist/types/types/tokenInfo.d.ts +27 -0
- package/dist/types/types/transaction.d.ts +18 -0
- package/dist/types/types/wallet.d.ts +49 -0
- package/dist/types/types/widgets.d.ts +11 -0
- package/dist/types/utils/utils.d.ts +11 -0
- package/dist/types/utils/utils.test.d.ts +1 -0
- package/dist/types/wallet/index.d.ts +1 -0
- package/dist/types/wallet/wallet.d.ts +2 -0
- package/dist/types/wallet/wallet.test.d.ts +1 -0
- package/dist/types/widgets/definitions/configurations/addTokens.d.ts +5 -0
- package/dist/types/widgets/definitions/configurations/bridge.d.ts +5 -0
- package/dist/types/widgets/definitions/configurations/commerce.d.ts +17 -0
- package/dist/types/widgets/definitions/configurations/connect.d.ts +5 -0
- package/dist/types/widgets/definitions/configurations/index.d.ts +11 -0
- package/dist/types/widgets/definitions/configurations/onramp.d.ts +5 -0
- package/dist/types/widgets/definitions/configurations/purchase.d.ts +2 -0
- package/dist/types/widgets/definitions/configurations/sale.d.ts +8 -0
- package/dist/types/widgets/definitions/configurations/swap.d.ts +5 -0
- package/dist/types/widgets/definitions/configurations/theme.d.ts +7 -0
- package/dist/types/widgets/definitions/configurations/wallet.d.ts +12 -0
- package/dist/types/widgets/definitions/configurations/widget.d.ts +31 -0
- package/dist/types/widgets/definitions/events/addTokens.d.ts +41 -0
- package/dist/types/widgets/definitions/events/bridge.d.ts +52 -0
- package/dist/types/widgets/definitions/events/commerce.d.ts +134 -0
- package/dist/types/widgets/definitions/events/connect.d.ts +47 -0
- package/dist/types/widgets/definitions/events/index.d.ts +11 -0
- package/dist/types/widgets/definitions/events/onramp.d.ts +28 -0
- package/dist/types/widgets/definitions/events/orchestration.d.ts +84 -0
- package/dist/types/widgets/definitions/events/purchase.d.ts +30 -0
- package/dist/types/widgets/definitions/events/sale.d.ts +103 -0
- package/dist/types/widgets/definitions/events/swap.d.ts +40 -0
- package/dist/types/widgets/definitions/events/wallet.d.ts +28 -0
- package/dist/types/widgets/definitions/events/widgets.d.ts +35 -0
- package/dist/types/widgets/definitions/global.d.ts +73 -0
- package/dist/types/widgets/definitions/parameters/addTokens.d.ts +20 -0
- package/dist/types/widgets/definitions/parameters/bridge.d.ts +20 -0
- package/dist/types/widgets/definitions/parameters/commerce.d.ts +44 -0
- package/dist/types/widgets/definitions/parameters/connect.d.ts +16 -0
- package/dist/types/widgets/definitions/parameters/index.d.ts +9 -0
- package/dist/types/widgets/definitions/parameters/onramp.d.ts +20 -0
- package/dist/types/widgets/definitions/parameters/purchase.d.ts +18 -0
- package/dist/types/widgets/definitions/parameters/sale.d.ts +50 -0
- package/dist/types/widgets/definitions/parameters/swap.d.ts +31 -0
- package/dist/types/widgets/definitions/parameters/wallet.d.ts +12 -0
- package/dist/types/widgets/definitions/types.d.ts +282 -0
- package/dist/types/widgets/load.d.ts +2 -0
- package/dist/types/widgets/load.test.d.ts +1 -0
- package/dist/types/widgets/version.d.ts +23 -0
- package/dist/types/widgets/version.test.d.ts +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ChainId } from '../../types';
|
|
2
|
+
import { BlockscoutNativeTokenData, BlockscoutToken, BlockscoutTokenPagination, BlockscoutTokens, BlockscoutTokenType } from './blockscoutType';
|
|
3
|
+
import { HttpClient } from '../http';
|
|
4
|
+
/**
|
|
5
|
+
* Blockscout class provides a client abstraction for the Immutable 3rd party indexer.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Blockscout {
|
|
8
|
+
readonly url: string;
|
|
9
|
+
readonly nativeToken: BlockscoutNativeTokenData;
|
|
10
|
+
readonly ttl: number;
|
|
11
|
+
readonly chainId: ChainId;
|
|
12
|
+
private cacheMap;
|
|
13
|
+
private httpClient;
|
|
14
|
+
private setCache;
|
|
15
|
+
private getCache;
|
|
16
|
+
/**
|
|
17
|
+
* Blockscout constructor
|
|
18
|
+
* @param httpClient Client used for http requests
|
|
19
|
+
* @param chainId target chain
|
|
20
|
+
* @param ttl cache TTL
|
|
21
|
+
*/
|
|
22
|
+
constructor(httpClient: HttpClient, chainId: ChainId, ttl?: number);
|
|
23
|
+
/**
|
|
24
|
+
* isChainSupported verifies if the chain is supported by Blockscout
|
|
25
|
+
* @param chainId
|
|
26
|
+
*/
|
|
27
|
+
static isChainSupported: (chainId: ChainId) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* isBlockscoutError verifies if the error is a Blockscout client error
|
|
30
|
+
* @param err error to evaluate
|
|
31
|
+
*/
|
|
32
|
+
static isBlockscoutError: (err: any) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* getTokensByWalletAddress fetches the list of tokens (by type) owned by the wallet address.
|
|
35
|
+
* @param walletAddress wallet address
|
|
36
|
+
* @param tokenType token type
|
|
37
|
+
* @param nextPage parameters for the next page, to be provided alongside walletAddress and tokenType
|
|
38
|
+
* @returns list of tokens given the wallet address and the token types
|
|
39
|
+
*/
|
|
40
|
+
getTokensByWalletAddress(params: {
|
|
41
|
+
walletAddress: string;
|
|
42
|
+
tokenType: BlockscoutTokenType;
|
|
43
|
+
nextPage?: BlockscoutTokenPagination | null;
|
|
44
|
+
}): Promise<BlockscoutTokens>;
|
|
45
|
+
/**
|
|
46
|
+
* getNativeTokenByWalletAddress fetches the native token owned by the wallet address.
|
|
47
|
+
* @param walletAddress wallet address
|
|
48
|
+
* @returns list of tokens given the wallet address and the token types
|
|
49
|
+
*/
|
|
50
|
+
getNativeTokenByWalletAddress(params: {
|
|
51
|
+
walletAddress: string;
|
|
52
|
+
}): Promise<BlockscoutToken>;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HttpStatusCode } from 'axios';
|
|
2
|
+
export declare enum BlockscoutTokenType {
|
|
3
|
+
ERC20 = "ERC-20"
|
|
4
|
+
}
|
|
5
|
+
export interface BlockscoutTokens {
|
|
6
|
+
items: BlockscoutToken[];
|
|
7
|
+
next_page_params: BlockscoutTokenPagination | null;
|
|
8
|
+
}
|
|
9
|
+
export interface BlockscoutTokenPagination {
|
|
10
|
+
[key: string]: string | number | null;
|
|
11
|
+
}
|
|
12
|
+
export interface BlockscoutToken {
|
|
13
|
+
token: BlockscoutTokenData | BlockscoutNativeTokenData;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BlockscoutTokenData {
|
|
17
|
+
address: string;
|
|
18
|
+
decimals: string;
|
|
19
|
+
name: string;
|
|
20
|
+
symbol: string;
|
|
21
|
+
icon_url: string;
|
|
22
|
+
type: BlockscoutTokenType;
|
|
23
|
+
}
|
|
24
|
+
export interface BlockscoutError {
|
|
25
|
+
code: HttpStatusCode;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface BlockscoutNativeTokenData {
|
|
29
|
+
address: string;
|
|
30
|
+
decimals: string;
|
|
31
|
+
name: string;
|
|
32
|
+
symbol: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { CheckoutModuleConfiguration } from '../../types';
|
|
3
|
+
export declare class HttpClient {
|
|
4
|
+
protected config: any;
|
|
5
|
+
protected axiosInstance: AxiosInstance;
|
|
6
|
+
constructor(config?: CheckoutModuleConfiguration);
|
|
7
|
+
private shouldAddPublishableKey;
|
|
8
|
+
private setupInterceptors;
|
|
9
|
+
request(config: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
+
get(url: string, config?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
|
|
11
|
+
post(url: string, data?: any, config?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
+
put(url: string, data?: any, config?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
|
+
delete(url: string, data?: any, config?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HttpClient } from './httpClient';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './availability';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
|
+
import { ChainId, GetAllBalancesResult, GetBalanceResult, GetBalancesResult, WrappedBrowserProvider, TokenInfo } from '../types';
|
|
3
|
+
import { CheckoutConfiguration } from '../config';
|
|
4
|
+
export declare const getBalance: (config: CheckoutConfiguration, provider: JsonRpcProvider | WrappedBrowserProvider, walletAddress: string) => Promise<GetBalanceResult>;
|
|
5
|
+
export declare function getERC20Balance(provider: JsonRpcProvider | WrappedBrowserProvider, walletAddress: string, tokenAddress: string): Promise<GetBalanceResult>;
|
|
6
|
+
export declare const resetBlockscoutClientMap: () => void;
|
|
7
|
+
export declare const getBlockscoutBalance: (config: CheckoutConfiguration, walletAddress: string, chainId: ChainId, filterTokens: TokenInfo[] | undefined) => Promise<GetAllBalancesResult>;
|
|
8
|
+
export declare const getBalances: (config: CheckoutConfiguration, provider: JsonRpcProvider | WrappedBrowserProvider, walletAddress: string, tokens: TokenInfo[]) => Promise<GetBalancesResult>;
|
|
9
|
+
export declare const getAllBalances: (config: CheckoutConfiguration, provider: JsonRpcProvider | WrappedBrowserProvider | undefined, walletAddress: string | undefined, chainId: ChainId, forceFetch?: boolean) => Promise<GetAllBalancesResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './balances';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChainId } from '../types';
|
|
2
|
+
export declare class BlockExplorerService {
|
|
3
|
+
/**
|
|
4
|
+
* getTransationLink returns the link to the transaction on blockscout
|
|
5
|
+
* @param hash transaction hash
|
|
6
|
+
* @returns link to the transaction on blockscout
|
|
7
|
+
*/
|
|
8
|
+
static getTransactionLink(chainId: ChainId, hash: string): string | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BlockExplorerService } from './blockExplorer';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Environment } from '@imtbl/config';
|
|
2
|
+
import { CheckoutModuleConfiguration, ChainId, NetworkMap } from '../types';
|
|
3
|
+
import { RemoteConfigFetcher } from './remoteConfigFetcher';
|
|
4
|
+
import { HttpClient } from '../api/http/httpClient';
|
|
5
|
+
import { TokensFetcher } from './tokensFetcher';
|
|
6
|
+
export declare class CheckoutConfigurationError extends Error {
|
|
7
|
+
message: string;
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare const getL1ChainId: (config: CheckoutConfiguration) => ChainId;
|
|
11
|
+
export declare const getL2ChainId: (config: CheckoutConfiguration) => ChainId;
|
|
12
|
+
export declare class CheckoutConfiguration {
|
|
13
|
+
readonly isDevelopment: boolean;
|
|
14
|
+
readonly isProduction: boolean;
|
|
15
|
+
readonly isOnRampEnabled: boolean;
|
|
16
|
+
readonly isSwapEnabled: boolean;
|
|
17
|
+
readonly isBridgeEnabled: boolean;
|
|
18
|
+
readonly remote: RemoteConfigFetcher;
|
|
19
|
+
readonly tokens: TokensFetcher;
|
|
20
|
+
readonly environment: Environment;
|
|
21
|
+
readonly networkMap: NetworkMap;
|
|
22
|
+
readonly publishableKey: string;
|
|
23
|
+
readonly overrides: CheckoutModuleConfiguration['overrides'];
|
|
24
|
+
constructor(config: CheckoutModuleConfiguration, httpClient: HttpClient);
|
|
25
|
+
get sdkVersion(): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RemoteConfiguration } from '../types';
|
|
2
|
+
import { HttpClient } from '../api/http';
|
|
3
|
+
export type RemoteConfigParams = {
|
|
4
|
+
isDevelopment: boolean;
|
|
5
|
+
isProduction: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare class RemoteConfigFetcher {
|
|
8
|
+
private httpClient;
|
|
9
|
+
private isDevelopment;
|
|
10
|
+
private isProduction;
|
|
11
|
+
private configCache;
|
|
12
|
+
private version;
|
|
13
|
+
constructor(httpClient: HttpClient, params: RemoteConfigParams);
|
|
14
|
+
private getEndpoint;
|
|
15
|
+
private parseResponse;
|
|
16
|
+
private loadConfig;
|
|
17
|
+
getConfig(key?: keyof RemoteConfiguration): Promise<RemoteConfiguration | RemoteConfiguration[keyof RemoteConfiguration] | undefined>;
|
|
18
|
+
getHttpClient: () => HttpClient;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChainId, ChainTokensConfig, TokenInfo } from '../types';
|
|
2
|
+
import { HttpClient } from '../api/http';
|
|
3
|
+
import { RemoteConfigFetcher } from './remoteConfigFetcher';
|
|
4
|
+
export type RemoteConfigParams = {
|
|
5
|
+
isDevelopment: boolean;
|
|
6
|
+
isProduction: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class TokensFetcher {
|
|
9
|
+
private httpClient;
|
|
10
|
+
private remoteConfig;
|
|
11
|
+
private readonly isDevelopment;
|
|
12
|
+
private readonly isProduction;
|
|
13
|
+
private tokensCache;
|
|
14
|
+
constructor(httpClient: HttpClient, remoteConfig: RemoteConfigFetcher, params: RemoteConfigParams);
|
|
15
|
+
private getBaseUrl;
|
|
16
|
+
private getChainSlug;
|
|
17
|
+
private loadTokens;
|
|
18
|
+
getChainTokensConfig(): Promise<ChainTokensConfig>;
|
|
19
|
+
getTokensConfig(chainId: ChainId): Promise<TokenInfo[]>;
|
|
20
|
+
private getMappingsForTokensResponse;
|
|
21
|
+
private parseResponse;
|
|
22
|
+
private fetchIMXTokenMappings;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CheckConnectionResult, WrappedBrowserProvider } from '../types';
|
|
2
|
+
export declare function checkIsWalletConnected(browserProvider: WrappedBrowserProvider): Promise<CheckConnectionResult>;
|
|
3
|
+
export declare function connectSite(browserProvider: WrappedBrowserProvider): Promise<WrappedBrowserProvider>;
|
|
4
|
+
export declare function requestPermissions(browserProvider: WrappedBrowserProvider): Promise<WrappedBrowserProvider>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './connect';
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Environment } from '@imtbl/config';
|
|
2
|
+
import { TokenInfo } from '../types/tokenInfo';
|
|
3
|
+
import { NetworkMap } from '../types';
|
|
4
|
+
export declare const ENV_DEVELOPMENT: Environment;
|
|
5
|
+
export declare const DEFAULT_TOKEN_DECIMALS = 18;
|
|
6
|
+
export declare const DEFAULT_TOKEN_FORMATTING_DECIMALS = 6;
|
|
7
|
+
export declare const NATIVE = "native";
|
|
8
|
+
export declare const ZKEVM_NATIVE_TOKEN: {
|
|
9
|
+
name: string;
|
|
10
|
+
symbol: string;
|
|
11
|
+
decimals: number;
|
|
12
|
+
address: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const ZKEVM_NATIVE_SANDBOX_TOKEN: {
|
|
15
|
+
name: string;
|
|
16
|
+
symbol: string;
|
|
17
|
+
decimals: number;
|
|
18
|
+
address: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Base URL for the Immutable API based on the environment.
|
|
22
|
+
* @property {string} DEVELOPMENT - The base URL for the development environment.
|
|
23
|
+
* @property {string} SANDBOX - The base URL for the sandbox environment.
|
|
24
|
+
* @property {string} PRODUCTION - The base URL for the production environment.
|
|
25
|
+
*/
|
|
26
|
+
export declare const IMMUTABLE_API_BASE_URL: {
|
|
27
|
+
[x: string]: string;
|
|
28
|
+
sandbox: string;
|
|
29
|
+
production: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Base URL for the checkout CDN based on the environment.
|
|
33
|
+
* @property {string} DEVELOPMENT - The base URL for the development environment.
|
|
34
|
+
* @property {string} SANDBOX - The base URL for the sandbox environment.
|
|
35
|
+
* @property {string} PRODUCTION - The base URL for the production environment.
|
|
36
|
+
*/
|
|
37
|
+
export declare const CHECKOUT_CDN_BASE_URL: {
|
|
38
|
+
[x: string]: string;
|
|
39
|
+
sandbox: string;
|
|
40
|
+
production: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Smart Checkout routing default onramp enabled flag
|
|
44
|
+
*/
|
|
45
|
+
export declare const DEFAULT_ON_RAMP_ENABLED = true;
|
|
46
|
+
/**
|
|
47
|
+
* Smart Checkout routing default swap enabled flag
|
|
48
|
+
*/
|
|
49
|
+
export declare const DEFAULT_SWAP_ENABLED = true;
|
|
50
|
+
/**
|
|
51
|
+
* Smart Checkout routing default bridge enabled flag
|
|
52
|
+
*/
|
|
53
|
+
export declare const DEFAULT_BRIDGE_ENABLED = true;
|
|
54
|
+
export declare const TRANSAK_API_BASE_URL: {
|
|
55
|
+
sandbox: string;
|
|
56
|
+
production: string;
|
|
57
|
+
};
|
|
58
|
+
export declare const PRODUCTION_CHAIN_ID_NETWORK_MAP: NetworkMap;
|
|
59
|
+
export declare const SANDBOX_CHAIN_ID_NETWORK_MAP: NetworkMap;
|
|
60
|
+
export declare const DEV_CHAIN_ID_NETWORK_MAP: NetworkMap;
|
|
61
|
+
/**
|
|
62
|
+
* Blockscout API configuration per chain
|
|
63
|
+
*/
|
|
64
|
+
export declare const BLOCKSCOUT_CHAIN_URL_MAP: {
|
|
65
|
+
[key: string]: {
|
|
66
|
+
url: string;
|
|
67
|
+
nativeToken: TokenInfo;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare const ERC20ABI: ({
|
|
71
|
+
constant: boolean;
|
|
72
|
+
inputs: {
|
|
73
|
+
name: string;
|
|
74
|
+
type: string;
|
|
75
|
+
}[];
|
|
76
|
+
name: string;
|
|
77
|
+
outputs: {
|
|
78
|
+
name: string;
|
|
79
|
+
type: string;
|
|
80
|
+
}[];
|
|
81
|
+
payable: boolean;
|
|
82
|
+
type: string;
|
|
83
|
+
stateMutability?: undefined;
|
|
84
|
+
} | {
|
|
85
|
+
constant: boolean;
|
|
86
|
+
inputs: {
|
|
87
|
+
name: string;
|
|
88
|
+
type: string;
|
|
89
|
+
}[];
|
|
90
|
+
name: string;
|
|
91
|
+
outputs: {
|
|
92
|
+
name: string;
|
|
93
|
+
type: string;
|
|
94
|
+
}[];
|
|
95
|
+
payable: boolean;
|
|
96
|
+
stateMutability: string;
|
|
97
|
+
type: string;
|
|
98
|
+
})[];
|
|
99
|
+
export declare const ERC721ABI: ({
|
|
100
|
+
constant: boolean;
|
|
101
|
+
inputs: {
|
|
102
|
+
internalType: string;
|
|
103
|
+
name: string;
|
|
104
|
+
type: string;
|
|
105
|
+
}[];
|
|
106
|
+
name: string;
|
|
107
|
+
outputs: {
|
|
108
|
+
internalType: string;
|
|
109
|
+
name: string;
|
|
110
|
+
type: string;
|
|
111
|
+
}[];
|
|
112
|
+
payable: boolean;
|
|
113
|
+
stateMutability: string;
|
|
114
|
+
type: string;
|
|
115
|
+
} | {
|
|
116
|
+
inputs: {
|
|
117
|
+
internalType: string;
|
|
118
|
+
name: string;
|
|
119
|
+
type: string;
|
|
120
|
+
}[];
|
|
121
|
+
name: string;
|
|
122
|
+
outputs: {
|
|
123
|
+
internalType: string;
|
|
124
|
+
name: string;
|
|
125
|
+
type: string;
|
|
126
|
+
}[];
|
|
127
|
+
stateMutability: string;
|
|
128
|
+
type: string;
|
|
129
|
+
constant?: undefined;
|
|
130
|
+
payable?: undefined;
|
|
131
|
+
})[];
|
|
132
|
+
export declare const ERC1155ABI: {
|
|
133
|
+
inputs: {
|
|
134
|
+
internalType: string;
|
|
135
|
+
name: string;
|
|
136
|
+
type: string;
|
|
137
|
+
}[];
|
|
138
|
+
name: string;
|
|
139
|
+
outputs: {
|
|
140
|
+
internalType: string;
|
|
141
|
+
name: string;
|
|
142
|
+
type: string;
|
|
143
|
+
}[];
|
|
144
|
+
stateMutability: string;
|
|
145
|
+
type: string;
|
|
146
|
+
}[];
|
|
147
|
+
export declare const IMMUTABLE_ZKVEM_GAS_OVERRIDES: {
|
|
148
|
+
maxFeePerGas: bigint;
|
|
149
|
+
maxPriorityFeePerGas: bigint;
|
|
150
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing different types of errors that can occur during the checkout process.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum CheckoutErrorType {
|
|
5
|
+
MISSING_PARAMS = "MISSING_PARAMS",
|
|
6
|
+
WEB3_PROVIDER_ERROR = "WEB3_PROVIDER_ERROR",
|
|
7
|
+
PROVIDER_ERROR = "PROVIDER_ERROR",
|
|
8
|
+
DEFAULT_PROVIDER_ERROR = "DEFAULT_PROVIDER_ERROR",
|
|
9
|
+
CONNECT_PROVIDER_ERROR = "CONNECT_PROVIDER_ERROR",
|
|
10
|
+
GET_BALANCE_ERROR = "GET_BALANCE_ERROR",
|
|
11
|
+
GET_INDEXER_BALANCE_ERROR = "GET_INDEXER_BALANCE_ERROR",
|
|
12
|
+
GET_ERC20_INFO_ERROR = "GET_ERC20_INFO_ERROR",
|
|
13
|
+
GET_ERC20_BALANCE_ERROR = "GET_ERC20_BALANCE_ERROR",
|
|
14
|
+
GET_ERC721_BALANCE_ERROR = "GET_ERC721_BALANCE_ERROR",
|
|
15
|
+
GET_NETWORK_INFO_ERROR = "GET_NETWORK_INFO_ERROR",
|
|
16
|
+
METAMASK_PROVIDER_ERROR = "METAMASK_PROVIDER_ERROR",
|
|
17
|
+
CHAIN_NOT_SUPPORTED_ERROR = "CHAIN_NOT_SUPPORTED_ERROR",
|
|
18
|
+
PROVIDER_REQUEST_MISSING_ERROR = "PROVIDER_REQUEST_MISSING_ERROR",
|
|
19
|
+
PROVIDER_REQUEST_FAILED_ERROR = "PROVIDER_REQUEST_FAILED_ERROR",
|
|
20
|
+
USER_REJECTED_REQUEST_ERROR = "USER_REJECTED_REQUEST_ERROR",
|
|
21
|
+
TRANSACTION_FAILED = "TRANSACTION_FAILED",
|
|
22
|
+
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
|
|
23
|
+
UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT",
|
|
24
|
+
INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE",
|
|
25
|
+
UNSUPPORTED_TOKEN_TYPE_ERROR = "UNSUPPORTED_TOKEN_TYPE_ERROR",
|
|
26
|
+
UNSUPPORTED_BALANCE_REQUIREMENT_ERROR = "UNSUPPORTED_BALANCE_REQUIREMENT_ERROR",
|
|
27
|
+
GET_ORDER_LISTING_ERROR = "GET_ORDER_LISTING_ERROR",
|
|
28
|
+
CANCEL_ORDER_LISTING_ERROR = "CANCEL_ORDER_LISTING_ERROR",
|
|
29
|
+
PREPARE_ORDER_LISTING_ERROR = "PREPARE_ORDER_LISTING_ERROR",
|
|
30
|
+
CREATE_ORDER_LISTING_ERROR = "CREATE_ORDER_LISTING_ERROR",
|
|
31
|
+
FULFILL_ORDER_LISTING_ERROR = "FULFILL_ORDER_LISTING_ERROR",
|
|
32
|
+
SWITCH_NETWORK_UNSUPPORTED = "SWITCH_NETWORK_UNSUPPORTED",
|
|
33
|
+
GET_ERC20_ALLOWANCE_ERROR = "GET_ERC20_ALLOWANCE_ERROR",
|
|
34
|
+
GET_ERC721_ALLOWANCE_ERROR = "GET_ERC721_ALLOWANCE_ERROR",
|
|
35
|
+
GET_ERC1155_ALLOWANCE_ERROR = "GET_ERC1155_ALLOWANCE_ERROR",
|
|
36
|
+
EXECUTE_APPROVAL_TRANSACTION_ERROR = "EXECUTE_APPROVAL_TRANSACTION_ERROR",
|
|
37
|
+
EXECUTE_FULFILLMENT_TRANSACTION_ERROR = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR",
|
|
38
|
+
SIGN_MESSAGE_ERROR = "SIGN_MESSAGE_ERROR",
|
|
39
|
+
BRIDGE_GAS_ESTIMATE_ERROR = "BRIDGE_GAS_ESTIMATE_ERROR",
|
|
40
|
+
ORDER_FEE_ERROR = "ORDER_FEE_ERROR",
|
|
41
|
+
ITEM_REQUIREMENTS_ERROR = "ITEM_REQUIREMENTS_ERROR",
|
|
42
|
+
API_ERROR = "API_ERROR",
|
|
43
|
+
ORDER_EXPIRED_ERROR = "ORDER_EXPIRED_ERROR",
|
|
44
|
+
WIDGETS_SCRIPT_LOAD_ERROR = "WIDGETS_SCRIPT_LOAD_ERROR",
|
|
45
|
+
APPROVAL_TRANSACTION_FAILED = "APPROVAL_TRANSACTION_FAILED"
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Represents an error object with a specific type, optional message, and optional data.
|
|
49
|
+
* @property {CheckoutErrorType} type
|
|
50
|
+
* @property {string | undefined} [message]
|
|
51
|
+
* @property {Object.<string, string> | undefined} [data]
|
|
52
|
+
*/
|
|
53
|
+
export type ErrorType = {
|
|
54
|
+
/** The type of the error. */
|
|
55
|
+
type: CheckoutErrorType;
|
|
56
|
+
/** The error message. */
|
|
57
|
+
message?: string;
|
|
58
|
+
/** Additional data associated with the error. */
|
|
59
|
+
data?: {
|
|
60
|
+
[key: string]: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare class CheckoutError<T = CheckoutErrorType> extends Error {
|
|
64
|
+
message: string;
|
|
65
|
+
type: T;
|
|
66
|
+
data?: {
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
};
|
|
69
|
+
constructor(message: string, type: T, data?: {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export declare enum CheckoutInternalErrorType {
|
|
74
|
+
REJECTED_SWITCH_AFTER_ADDING_NETWORK = "REJECTED_SWITCH_AFTER_ADDING_NETWORK"
|
|
75
|
+
}
|
|
76
|
+
export declare class CheckoutInternalError extends Error {
|
|
77
|
+
type: CheckoutInternalErrorType;
|
|
78
|
+
constructor(type: CheckoutInternalErrorType);
|
|
79
|
+
}
|
|
80
|
+
export declare const withCheckoutError: <T>(fn: () => Promise<T>, customError: ErrorType) => Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkoutError';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ExchangeType } from '../types/fiatRamp';
|
|
2
|
+
import { OnRampProviderFees } from '../types';
|
|
3
|
+
import { CheckoutConfiguration } from '../config';
|
|
4
|
+
export interface FiatRampWidgetParams {
|
|
5
|
+
exchangeType: ExchangeType;
|
|
6
|
+
isPassport: boolean;
|
|
7
|
+
walletAddress?: string;
|
|
8
|
+
tokenAmount?: string;
|
|
9
|
+
tokenSymbol?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
allowedTokens?: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare class FiatRampService {
|
|
14
|
+
readonly config: CheckoutConfiguration;
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new instance of the FiatRampService class.
|
|
17
|
+
* @param {CheckoutConfiguration} config - The config required for the FiatRampService.
|
|
18
|
+
*/
|
|
19
|
+
constructor(config: CheckoutConfiguration);
|
|
20
|
+
feeEstimate(): Promise<OnRampProviderFees>;
|
|
21
|
+
createWidgetUrl(params: FiatRampWidgetParams): Promise<string>;
|
|
22
|
+
private getTransakWidgetUrl;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fiatRamp';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BridgeFeeResponse, TokenBridge } from '@imtbl/bridge-sdk';
|
|
2
|
+
import { CheckoutConfiguration } from '../config';
|
|
3
|
+
import { ChainId } from '../types';
|
|
4
|
+
export declare function getBridgeFeeEstimate(tokenBridge: TokenBridge, fromChainId: ChainId, toChainId: ChainId, config: CheckoutConfiguration): Promise<BridgeFeeResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
|
+
import { ChainId, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult } from '../types';
|
|
3
|
+
import { CheckoutConfiguration } from '../config';
|
|
4
|
+
export declare function gasEstimator(params: GasEstimateParams, readOnlyProviders: Map<ChainId, JsonRpcProvider>, config: CheckoutConfiguration): Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './widgets/definitions/global';
|
|
2
|
+
export * from './widgets/definitions/events';
|
|
3
|
+
export * from './widgets/definitions/types';
|
|
4
|
+
export * from './widgets/definitions/parameters';
|
|
5
|
+
export * from './widgets/definitions/configurations';
|
|
6
|
+
export { Checkout } from './sdk';
|
|
7
|
+
export { IMMUTABLE_API_BASE_URL } from './env';
|
|
8
|
+
export { passportProviderInfo, getPassportProviderDetail, metaMaskProviderInfo, getMetaMaskProviderDetail, validateProvider, getUnderlyingChainId, } from './provider';
|
|
9
|
+
export { getGasPriceInWei, } from './gasEstimate';
|
|
10
|
+
export { ChainId, ChainName, ChainSlug, CheckoutStatus, ExchangeType, FeeType, FundingStepType, GasEstimateType, GasTokenType, ItemType, WrappedBrowserProvider, NetworkFilterTypes, RoutingOutcomeType, TokenFilterTypes, TransactionOrGasType, WalletFilterTypes, WalletProviderName, WalletProviderRdns, } from './types';
|
|
11
|
+
export type { EIP1193Provider, EIP6963ProviderInfo, EIP6963ProviderDetail, AddTokensConfig, } from './types';
|
|
12
|
+
export type { AllowedNetworkConfig, AvailableRoutingOptions, BalanceDelta, BridgeFundingStep, BuyOrder, BuyParams, BuyOverrides, BuyResult, BuyResultFailed, BuyResultInsufficientFunds, BuyResultSuccess, BuyResultFulfillmentsUnsettled, BuyToken, CancelParams, CancelOverrides, CancelResult, CancelResultFailed, CancelResultGasless, CancelResultSuccess, CancelResultFulfillmentsUnsettled, CheckConnectionParams, CheckConnectionResult, CheckoutModuleConfiguration, CheckoutOnRampConfiguration, CheckoutBridgeConfiguration, CheckoutSwapConfiguration, ConnectParams, ConnectResult, CreateProviderParams, DexConfig, ERC20ItemRequirement, ERC721Balance, ERC721ItemRequirement, FailedGaslessCancellation, Fee, FeePercentage, FeeToken, FiatRampParams, FulfillmentTransaction, FundingItem, FundingRoute, FundingStep, GasAmount, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GasEstimateTokenConfig, GasToken, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenInfoParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, ItemBalance, NativeItemRequirement, NetworkFilter, NetworkInfo, NoRouteOptions, NoRoutesFound, OnRampFundingStep, OrderFee, OnRampProviderFees, PendingGaslessCancellation, RemoteConfiguration, RoutesFound, RoutingOutcome, SellOrder, SellParams, SellResult, SellResultFailed, SellResultInsufficientFunds, SellResultSuccess, SellToken, SendTransactionParams, SendTransactionResult, SmartCheckoutInsufficient, SmartCheckoutParams, SmartCheckoutResult, SmartCheckoutRouter, SmartCheckoutSufficient, SuccessfulGaslessCancellation, SwapFees, SwapFundingStep, SwitchNetworkParams, SwitchNetworkResult, TelemetryConfig, TokenAmountEstimate, TokenBalance, TokenFilter, TokenInfo, TransactionRequirement, WalletFilter, WalletInfo, SquidConfig, CheckoutWidgetsVersionConfig, } from './types';
|
|
13
|
+
export { fetchRiskAssessment, isAddressSanctioned } from './riskAssessment';
|
|
14
|
+
export type { AssessmentResult } from './riskAssessment';
|
|
15
|
+
export type { ErrorType } from './errors';
|
|
16
|
+
export { CheckoutErrorType, CheckoutError } from './errors';
|
|
17
|
+
export { CheckoutConfiguration } from './config';
|
|
18
|
+
export { BlockExplorerService } from './blockExplorer';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TokenBridge } from '@imtbl/bridge-sdk';
|
|
2
|
+
import { JsonRpcProvider } from 'ethers';
|
|
3
|
+
import { Exchange } from '@imtbl/dex-sdk';
|
|
4
|
+
import { Orderbook } from '@imtbl/orderbook';
|
|
5
|
+
import { BlockchainData } from '@imtbl/blockchain-data';
|
|
6
|
+
import { ChainId } from '../types';
|
|
7
|
+
import { CheckoutConfiguration } from '../config';
|
|
8
|
+
export declare function createBridgeInstance(fromChainId: ChainId, toChainId: ChainId, readOnlyProviders: Map<ChainId, JsonRpcProvider>, config: CheckoutConfiguration): TokenBridge;
|
|
9
|
+
export declare function createExchangeInstance(chainId: ChainId, config: CheckoutConfiguration): Promise<Exchange>;
|
|
10
|
+
export declare function createOrderbookInstance(config: CheckoutConfiguration): Orderbook;
|
|
11
|
+
export declare function createBlockchainDataInstance(config: CheckoutConfiguration): BlockchainData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CheckoutConfiguration } from '../config';
|
|
2
|
+
export declare const debugLogger: (config: CheckoutConfiguration, debugString: string, seconds: number) => void;
|
|
3
|
+
export declare const measureAsyncExecution: <T>(config: CheckoutConfiguration, debugString: string, promise: Promise<T>) => Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './network';
|