@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,7 @@
|
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
|
+
import { ChainId, GetNetworkAllowListParams, GetNetworkAllowListResult, NetworkInfo, SwitchNetworkResult, NetworkMap, WrappedBrowserProvider } from '../types';
|
|
3
|
+
import { CheckoutConfiguration } from '../config';
|
|
4
|
+
export declare function addNetworkToWallet(networkMap: NetworkMap, browserProvider: WrappedBrowserProvider, chainId: ChainId): Promise<any>;
|
|
5
|
+
export declare function getNetworkAllowList(config: CheckoutConfiguration, { type, exclude }: GetNetworkAllowListParams): Promise<GetNetworkAllowListResult>;
|
|
6
|
+
export declare function getNetworkInfo(config: CheckoutConfiguration, provider: JsonRpcProvider | WrappedBrowserProvider): Promise<NetworkInfo>;
|
|
7
|
+
export declare function switchWalletNetwork(config: CheckoutConfiguration, provider: JsonRpcProvider | WrappedBrowserProvider, chainId: ChainId): Promise<SwitchNetworkResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
|
+
import { WrappedBrowserProvider } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get the underlying chain id from the provider
|
|
5
|
+
* @param provider
|
|
6
|
+
* @returns chainId number
|
|
7
|
+
*/
|
|
8
|
+
export declare function getUnderlyingChainId(provider: JsonRpcProvider | WrappedBrowserProvider): Promise<bigint>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { DefaultRegister, Rdns, Register, ResolvedRegister, } from './register';
|
|
2
|
+
export { createStore, type Listener, type Store, } from './store';
|
|
3
|
+
export { type AnnounceProviderParameters, type AnnounceProviderReturnType, announceProvider, type RequestProvidersParameters, type RequestProvidersReturnType, requestProviders, } from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EIP1193Provider } from '../../types/eip1193';
|
|
2
|
+
export interface Register {
|
|
3
|
+
}
|
|
4
|
+
export type DefaultRegister = {
|
|
5
|
+
/** The EIP-1193 Provider. */
|
|
6
|
+
provider: EIP1193Provider;
|
|
7
|
+
/** Reverse Domain Name Notation (rDNS) of the Wallet Provider. */
|
|
8
|
+
rdns: 'com.coinbase' | 'com.enkrypt' | 'io.metamask' | 'io.zerion';
|
|
9
|
+
};
|
|
10
|
+
export type ResolvedRegister = {
|
|
11
|
+
/** The EIP-1193 Provider. */
|
|
12
|
+
provider: Register extends {
|
|
13
|
+
provider: infer provider extends DefaultRegister['provider'];
|
|
14
|
+
} ? provider : DefaultRegister['provider'];
|
|
15
|
+
/** Reverse Domain Name Notation (rDNS) of the Wallet Provider. */
|
|
16
|
+
rdns: Register extends {
|
|
17
|
+
rdns: infer rdns extends string;
|
|
18
|
+
} ? rdns : DefaultRegister['rdns'] | (string & {});
|
|
19
|
+
};
|
|
20
|
+
export type Rdns = ResolvedRegister['rdns'];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Rdns } from './register';
|
|
2
|
+
import type { EIP6963ProviderDetail } from '../../types/eip6963';
|
|
3
|
+
export type Listener = (providerDetails: readonly EIP6963ProviderDetail[], meta?: {
|
|
4
|
+
added?: readonly EIP6963ProviderDetail[] | undefined;
|
|
5
|
+
removed?: readonly EIP6963ProviderDetail[] | undefined;
|
|
6
|
+
} | undefined) => void;
|
|
7
|
+
export type Store = {
|
|
8
|
+
/**
|
|
9
|
+
* Clears the store, including all provider details.
|
|
10
|
+
*/
|
|
11
|
+
clear(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Destroys the store, including all provider details and listeners.
|
|
14
|
+
*/
|
|
15
|
+
destroy(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Finds a provider detail by its RDNS (Reverse Domain Name Identifier).
|
|
18
|
+
*/
|
|
19
|
+
findProvider(args: {
|
|
20
|
+
rdns: Rdns;
|
|
21
|
+
}): EIP6963ProviderDetail | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Returns all provider details that have been emitted.
|
|
24
|
+
*/
|
|
25
|
+
getProviders(): readonly EIP6963ProviderDetail[];
|
|
26
|
+
/**
|
|
27
|
+
* Resets the store, and emits an event to request provider details.
|
|
28
|
+
*/
|
|
29
|
+
reset(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Subscribes to emitted provider details.
|
|
32
|
+
*/
|
|
33
|
+
subscribe(listener: Listener, args?: {
|
|
34
|
+
emitImmediately?: boolean | undefined;
|
|
35
|
+
} | undefined): () => void;
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
* Current state of listening listeners.
|
|
39
|
+
*/
|
|
40
|
+
_listeners(): Set<Listener>;
|
|
41
|
+
};
|
|
42
|
+
export declare function createStore(): Store;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EIP6963ProviderDetail } from '../../types/eip6963';
|
|
2
|
+
export type AnnounceProviderParameters = EIP6963ProviderDetail;
|
|
3
|
+
export type AnnounceProviderReturnType = () => void;
|
|
4
|
+
/**
|
|
5
|
+
* Announce
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Announces an EIP-1193 Provider.
|
|
9
|
+
*/
|
|
10
|
+
export declare function announceProvider(detail: AnnounceProviderParameters): AnnounceProviderReturnType;
|
|
11
|
+
/**
|
|
12
|
+
* Request
|
|
13
|
+
*/
|
|
14
|
+
export type RequestProvidersParameters = (providerDetail: EIP6963ProviderDetail) => void;
|
|
15
|
+
export type RequestProvidersReturnType = (() => void) | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Watches for EIP-1193 Providers to be announced.
|
|
18
|
+
*/
|
|
19
|
+
export declare function requestProviders(listener: RequestProvidersParameters): RequestProvidersReturnType;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EIP6963AnnounceProviderEvent, EIP6963RequestProviderEvent } from '../../types/eip6963';
|
|
2
|
+
export {};
|
|
3
|
+
declare global {
|
|
4
|
+
interface WindowEventMap {
|
|
5
|
+
'eip6963:announceProvider': EIP6963AnnounceProviderEvent;
|
|
6
|
+
'eip6963:requestProvider': EIP6963RequestProviderEvent;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EIP6963ProviderDetail } from '../types';
|
|
2
|
+
export declare class InjectedProvidersManager {
|
|
3
|
+
private static instance;
|
|
4
|
+
private store;
|
|
5
|
+
private resetTimeout;
|
|
6
|
+
private isInit;
|
|
7
|
+
private constructor();
|
|
8
|
+
static getInstance(): InjectedProvidersManager;
|
|
9
|
+
findProvider(args: {
|
|
10
|
+
rdns: string;
|
|
11
|
+
}): EIP6963ProviderDetail | undefined;
|
|
12
|
+
getProviders(): readonly EIP6963ProviderDetail[];
|
|
13
|
+
subscribe(callback: any): () => void;
|
|
14
|
+
clear(): void;
|
|
15
|
+
reset(): void;
|
|
16
|
+
initialise(): void;
|
|
17
|
+
requestProviders(): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EIP6963ProviderDetail, EIP6963ProviderInfo, EIP1193Provider } from '../types';
|
|
2
|
+
export declare const metaMaskProviderInfo: EIP6963ProviderInfo;
|
|
3
|
+
export declare const passportProviderInfo: EIP6963ProviderInfo;
|
|
4
|
+
export declare const getPassportProviderDetail: (provider: EIP1193Provider) => EIP6963ProviderDetail;
|
|
5
|
+
export declare const getMetaMaskProviderDetail: (provider: EIP1193Provider) => EIP6963ProviderDetail;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Eip1193Provider } from 'ethers';
|
|
2
|
+
import { CheckoutConfiguration } from '../config';
|
|
3
|
+
import { WrappedBrowserProvider, ValidateProviderOptions } from '../types';
|
|
4
|
+
export declare function isWrappedBrowserProvider(browserProvider: WrappedBrowserProvider | Eip1193Provider): boolean;
|
|
5
|
+
export declare function validateProvider(config: CheckoutConfiguration, browserProvider: WrappedBrowserProvider | Eip1193Provider, validateProviderOptions?: ValidateProviderOptions): Promise<WrappedBrowserProvider>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JsonRpcProvider } from 'ethers';
|
|
2
|
+
import { ChainId } from '../types';
|
|
3
|
+
import { CheckoutConfiguration } from '../config';
|
|
4
|
+
export declare function createReadOnlyProviders(config: CheckoutConfiguration, existingReadOnlyProviders?: Map<ChainId, JsonRpcProvider>): Promise<Map<ChainId, JsonRpcProvider>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './riskAssessment';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CheckoutConfiguration } from '../config';
|
|
2
|
+
export declare enum RiskAssessmentLevel {
|
|
3
|
+
LOW = "Low",
|
|
4
|
+
MEDIUM = "Medium",
|
|
5
|
+
HIGH = "High",
|
|
6
|
+
SEVERE = "Severe"
|
|
7
|
+
}
|
|
8
|
+
export type AssessmentResult = {
|
|
9
|
+
[address: string]: {
|
|
10
|
+
sanctioned: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const fetchRiskAssessment: (addresses: string[], config: CheckoutConfiguration) => Promise<AssessmentResult>;
|
|
14
|
+
export declare const isAddressSanctioned: (riskAssessment: AssessmentResult, address?: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { Passport } from '@imtbl/passport';
|
|
2
|
+
import { Eip1193Provider } from 'ethers';
|
|
3
|
+
import { AvailabilityService } from './availability';
|
|
4
|
+
import { CheckoutConfiguration } from './config';
|
|
5
|
+
import { FiatRampService } from './fiatRamp';
|
|
6
|
+
import { AddNetworkParams, BuyParams, BuyResult, CancelResult, CheckConnectionParams, CheckConnectionResult, CheckoutModuleConfiguration, ConnectParams, ConnectResult, CreateProviderParams, EIP6963ProviderDetail, FiatRampParams, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetTokenInfoParams, GetWalletAllowListParams, GetWalletAllowListResult, WrappedBrowserProvider, NetworkInfo, OnRampProviderFees, SellResult, SendTransactionParams, SendTransactionResult, SmartCheckoutParams, SmartCheckoutResult, SwitchNetworkParams, SwitchNetworkResult, TokenInfo, CreateProviderResult } from './types';
|
|
7
|
+
import { CancelParams } from './types/cancel';
|
|
8
|
+
import { SellParams } from './types/sell';
|
|
9
|
+
import { SwapParams, SwapQuoteResult, SwapResult } from './types/swap';
|
|
10
|
+
import { WidgetsInit } from './types/widgets';
|
|
11
|
+
import { AssessmentResult } from './riskAssessment';
|
|
12
|
+
export declare class Checkout {
|
|
13
|
+
private readOnlyProviders;
|
|
14
|
+
private httpClient;
|
|
15
|
+
readonly config: CheckoutConfiguration;
|
|
16
|
+
readonly fiatRampService: FiatRampService;
|
|
17
|
+
readonly availability: AvailabilityService;
|
|
18
|
+
readonly passport?: Passport;
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a new instance of the CheckoutModule class.
|
|
21
|
+
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
22
|
+
*/
|
|
23
|
+
constructor(config?: CheckoutModuleConfiguration);
|
|
24
|
+
/**
|
|
25
|
+
* Loads the widgets bundle and initiate the widgets factory.
|
|
26
|
+
* @param {WidgetsInit} init - The initialisation parameters for loading the widgets bundle and applying configuration
|
|
27
|
+
*/
|
|
28
|
+
widgets(init: WidgetsInit): Promise<ImmutableCheckoutWidgets.WidgetsFactory>;
|
|
29
|
+
private loadUmdBundle;
|
|
30
|
+
private loadEsModules;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a provider using the given parameters.
|
|
33
|
+
* @param {CreateProviderParams} params - The parameters for creating the provider.
|
|
34
|
+
* @returns {Promise<CreateProviderResult>} A promise that resolves to the created provider.
|
|
35
|
+
*/
|
|
36
|
+
createProvider(params: CreateProviderParams): Promise<CreateProviderResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Returns a list of EIP-6963 injected providers and their metadata.
|
|
39
|
+
*/
|
|
40
|
+
getInjectedProviders(): readonly EIP6963ProviderDetail[];
|
|
41
|
+
/**
|
|
42
|
+
* Finds an injected provider by its RDNS.
|
|
43
|
+
* @param {rdns: string} args - The parameters for finding the injected provider.
|
|
44
|
+
* @returns {EIP6963ProviderDetail | undefined} - The found provider and metadata or undefined.
|
|
45
|
+
*/
|
|
46
|
+
findInjectedProvider(args: {
|
|
47
|
+
rdns: string;
|
|
48
|
+
}): EIP6963ProviderDetail | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Subscribes to changes in the injected providers.
|
|
51
|
+
* @param listener - The listener to be called when the injected providers change.
|
|
52
|
+
*/
|
|
53
|
+
onInjectedProvidersChange(listener: (providers: EIP6963ProviderDetail[]) => void): () => void;
|
|
54
|
+
clearInjectedProviders(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if a wallet is connected to the specified provider.
|
|
57
|
+
* @param {CheckConnectionParams} params - The parameters for checking the wallet connection.
|
|
58
|
+
* @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
|
|
59
|
+
*/
|
|
60
|
+
checkIsWalletConnected(params: CheckConnectionParams): Promise<CheckConnectionResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Fetches the risk assessment for the given addresses.
|
|
63
|
+
* @param {string[]} addresses - The addresses to assess.
|
|
64
|
+
* @returns {Promise<AssessmentResult>} - A promise that resolves to the risk assessment result.
|
|
65
|
+
*/
|
|
66
|
+
getRiskAssessment(addresses: string[]): Promise<AssessmentResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Helper method that checks if given risk assessment results contain sanctioned addresses.
|
|
69
|
+
* @param {AssessmentResult} assessment - Risk assessment to analyse.
|
|
70
|
+
* @param {string | undefined} address - If defined, only sanctions for the given address will be checked.
|
|
71
|
+
* @returns {boolean} - Result of the check.
|
|
72
|
+
*/
|
|
73
|
+
checkIsAddressSanctioned(assessment: AssessmentResult, address?: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Connects to a blockchain network using the specified provider.
|
|
76
|
+
* @param {ConnectParams} params - The parameters for connecting to the network.
|
|
77
|
+
* @returns {Promise<ConnectResult>} A promise that resolves to an object containing the provider and network information.
|
|
78
|
+
* @throws {Error} If the provider is not valid or if there is an error connecting to the network.
|
|
79
|
+
*/
|
|
80
|
+
connect(params: ConnectParams): Promise<ConnectResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Adds the network for the current wallet provider.
|
|
83
|
+
* @param {AddNetworkParams} params - The parameters for adding the network.
|
|
84
|
+
* @returns {Promise<any>} - A promise that resolves to the result of adding the network.
|
|
85
|
+
*/
|
|
86
|
+
addNetwork(params: AddNetworkParams): Promise<any>;
|
|
87
|
+
/**
|
|
88
|
+
* Switches the network for the current wallet provider.
|
|
89
|
+
* @param {SwitchNetworkParams} params - The parameters for switching the network.
|
|
90
|
+
* @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
|
|
91
|
+
*/
|
|
92
|
+
switchNetwork(params: SwitchNetworkParams): Promise<SwitchNetworkResult>;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves the token information given the token address. This function makes RPC calls to
|
|
95
|
+
* ERC20 contracts to fetch the main contract information (e.g. symbol).
|
|
96
|
+
* @param {GetTokenInfoParams} params - The parameters for retrieving the token information.
|
|
97
|
+
* @returns {Promise<TokenInfo>} - A promise that resolves to the token info request.
|
|
98
|
+
*/
|
|
99
|
+
getTokenInfo(params: GetTokenInfoParams): Promise<TokenInfo>;
|
|
100
|
+
/**
|
|
101
|
+
* Retrieves the balance of a wallet address.
|
|
102
|
+
* @param {GetBalanceParams} params - The parameters for retrieving the balance.
|
|
103
|
+
* @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
|
|
104
|
+
*/
|
|
105
|
+
getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
|
|
106
|
+
/**
|
|
107
|
+
* Retrieves the balances of all tokens for a given wallet address on a specific chain.
|
|
108
|
+
* @param {GetAllBalancesParams} params - The parameters for retrieving the balances.
|
|
109
|
+
* @returns {Promise<GetAllBalancesResult>} - A promise that resolves to the result of retrieving the balances.
|
|
110
|
+
*/
|
|
111
|
+
getAllBalances(params: GetAllBalancesParams): Promise<GetAllBalancesResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Retrieves the supported networks based on the provided parameters.
|
|
114
|
+
* @param {GetNetworkAllowListParams} params - The parameters for retrieving the network allow list.
|
|
115
|
+
* @returns {Promise<GetNetworkAllowListResult>} - A promise that resolves to the network allow list result.
|
|
116
|
+
*/
|
|
117
|
+
getNetworkAllowList(params: GetNetworkAllowListParams): Promise<GetNetworkAllowListResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieves the supported tokens based on the provided parameters.
|
|
120
|
+
* @param {GetTokenAllowListParams} params - The parameters for retrieving the token allow list.
|
|
121
|
+
* @returns {Promise<GetTokenAllowListResult>} - A promise that resolves to the token allow list result.
|
|
122
|
+
*/
|
|
123
|
+
getTokenAllowList(params: GetTokenAllowListParams): Promise<GetTokenAllowListResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Retrieves the default supported wallets based on the provided parameters.
|
|
126
|
+
* @param {GetWalletAllowListParams} params - The parameters for retrieving the wallet allow list.
|
|
127
|
+
* @returns {Promise<GetWalletAllowListResult>} - A promise that resolves to the wallet allow list result.
|
|
128
|
+
*/
|
|
129
|
+
getWalletAllowList(params: GetWalletAllowListParams): Promise<GetWalletAllowListResult>;
|
|
130
|
+
/**
|
|
131
|
+
* Sends a transaction using the specified provider and transaction parameters.
|
|
132
|
+
* @param {SendTransactionParams} params - The parameters for sending the transaction.
|
|
133
|
+
* @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
|
|
134
|
+
*/
|
|
135
|
+
sendTransaction(params: SendTransactionParams): Promise<SendTransactionResult>;
|
|
136
|
+
/**
|
|
137
|
+
* Wraps a WrappedBrowserProvider call to validate the provider and handle errors.
|
|
138
|
+
* @param {BrowserProvider} browserProvider - The provider to connect to the network.
|
|
139
|
+
* @param {(browserProvider: WrappedBrowserProvider) => Promise<T>)} block - The block executing the provider call.
|
|
140
|
+
* @returns {Promise<T>} Returns the result of the provided block param.
|
|
141
|
+
*/
|
|
142
|
+
providerCall<T>(browserProvider: WrappedBrowserProvider | Eip1193Provider, block: (browserProvider: WrappedBrowserProvider) => Promise<T>): Promise<T>;
|
|
143
|
+
/**
|
|
144
|
+
* Retrieves network information using the specified provider.
|
|
145
|
+
* @param {GetNetworkParams} params - The parameters for retrieving network information.
|
|
146
|
+
* @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
|
|
147
|
+
*/
|
|
148
|
+
getNetworkInfo(params: GetNetworkParams): Promise<NetworkInfo>;
|
|
149
|
+
/**
|
|
150
|
+
* Determines the requirements for performing a buy.
|
|
151
|
+
* @param {BuyParams} params - The parameters for the buy.
|
|
152
|
+
* @deprecated Please use orderbook.fulfillOrder or orderbook.fulfillBulkOrders instead. The smartCheckout
|
|
153
|
+
* method can still be used to ensure the transaction requirements are met before preparing the order fulfillment
|
|
154
|
+
*/
|
|
155
|
+
buy(params: BuyParams): Promise<BuyResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Determines the requirements for performing a sell.
|
|
158
|
+
* @param {SellParams} params - The parameters for the sell.
|
|
159
|
+
* Only currently actions the first order in the array until we support batch processing.
|
|
160
|
+
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
161
|
+
* @deprecated Please use orderbook.prepareListing or orderbook.prepareBulkListing instead. The smartCheckout
|
|
162
|
+
* method can still be used to ensure the transaction requirements are met before preparing the listing
|
|
163
|
+
*/
|
|
164
|
+
sell(params: SellParams): Promise<SellResult>;
|
|
165
|
+
/**
|
|
166
|
+
* Cancels a sell.
|
|
167
|
+
* @param {CancelParams} params - The parameters for the cancel.
|
|
168
|
+
* @deprecated Please use orderbook.prepareOrderCancellations instead.
|
|
169
|
+
*/
|
|
170
|
+
cancel(params: CancelParams): Promise<CancelResult>;
|
|
171
|
+
/**
|
|
172
|
+
* Determines the transaction requirements to complete a purchase.
|
|
173
|
+
* @params {SmartCheckoutParams} params - The parameters for smart checkout.
|
|
174
|
+
*/
|
|
175
|
+
smartCheckout(params: SmartCheckoutParams): Promise<SmartCheckoutResult>;
|
|
176
|
+
/**
|
|
177
|
+
* Checks if the given object is a Web3 provider.
|
|
178
|
+
* @param {BrowserProvider} browserProvider - The object to check.
|
|
179
|
+
* @returns {boolean} - True if the object is a Web3 provider, false otherwise.
|
|
180
|
+
*/
|
|
181
|
+
static isBrowserProvider(browserProvider: WrappedBrowserProvider): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Estimates the gas required for a swap or bridge transaction.
|
|
184
|
+
* @param {GasEstimateParams} params - The parameters for the gas estimation.
|
|
185
|
+
* @returns {Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>} - A promise that resolves to the gas estimation result.
|
|
186
|
+
*/
|
|
187
|
+
gasEstimate(params: GasEstimateParams): Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>;
|
|
188
|
+
/**
|
|
189
|
+
* Creates and returns a URL for the fiat ramp widget.
|
|
190
|
+
* @param {FiatRampParams} params - The parameters for creating the url.
|
|
191
|
+
* @returns {Promise<string>} - A promise that resolves to a string url.
|
|
192
|
+
*/
|
|
193
|
+
createFiatRampUrl(params: FiatRampParams): Promise<string>;
|
|
194
|
+
/**
|
|
195
|
+
* Fetches fiat ramp fee estimations.
|
|
196
|
+
* @returns {Promise<OnRampProviderFees>} - A promise that resolves to OnRampProviderFees.
|
|
197
|
+
*/
|
|
198
|
+
getExchangeFeeEstimate(): Promise<OnRampProviderFees>;
|
|
199
|
+
/**
|
|
200
|
+
* Fetches Swap widget availability.
|
|
201
|
+
* @returns {Promise<boolean>} - A promise that resolves to a boolean.
|
|
202
|
+
*/
|
|
203
|
+
isSwapAvailable(): Promise<boolean>;
|
|
204
|
+
/**
|
|
205
|
+
* Fetches a quote and then performs the approval and swap transaction.
|
|
206
|
+
* @param {SwapParams} params - The parameters for the swap.
|
|
207
|
+
* @returns {Promise<SwapResult>} - A promise that resolves to the swap result (swap tx, swap tx receipt, quote used in the swap).
|
|
208
|
+
*/
|
|
209
|
+
swap(params: SwapParams): Promise<SwapResult>;
|
|
210
|
+
/**
|
|
211
|
+
* Fetches a quote for the swap.
|
|
212
|
+
* @param {SwapParams} params - The parameters for the swap.
|
|
213
|
+
* @returns {Promise<SwapQuoteResult>} - A promise that resolves to the swap quote result.
|
|
214
|
+
*/
|
|
215
|
+
swapQuote(params: SwapParams): Promise<SwapQuoteResult>;
|
|
216
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Action } from '@imtbl/orderbook';
|
|
2
|
+
import { TransactionRequest } from 'ethers';
|
|
3
|
+
import { UnsignedMessage, UnsignedTransactions } from './types';
|
|
4
|
+
export declare const getUnsignedSellTransactions: (actions: Action[]) => Promise<UnsignedTransactions>;
|
|
5
|
+
export declare const getUnsignedERC20ApprovalTransactions: (actions: Action[]) => Promise<TransactionRequest[]>;
|
|
6
|
+
export declare const getUnsignedFulfillmentTransactions: (actions: Action[]) => Promise<TransactionRequest[]>;
|
|
7
|
+
export declare const getUnsignedMessage: (orderHash: string, orderComponents: any, actions: Action[]) => UnsignedMessage | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TransactionRequest } from 'ethers';
|
|
2
|
+
import { SignTransactionResult, SignedMessage, UnsignedMessage } from './types';
|
|
3
|
+
import { WrappedBrowserProvider } from '../../types';
|
|
4
|
+
export declare const signApprovalTransactions: (provider: WrappedBrowserProvider, approvalTransactions: TransactionRequest[]) => Promise<SignTransactionResult>;
|
|
5
|
+
export declare const signFulfillmentTransactions: (provider: WrappedBrowserProvider, fulfillmentTransactions: TransactionRequest[]) => Promise<SignTransactionResult>;
|
|
6
|
+
export declare const signMessage: (provider: WrappedBrowserProvider, unsignedMessage: UnsignedMessage) => Promise<SignedMessage>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TransactionRequest, TypedDataDomain, TypedDataField } from 'ethers';
|
|
2
|
+
export type UnsignedTransactions = {
|
|
3
|
+
approvalTransactions: TransactionRequest[];
|
|
4
|
+
fulfillmentTransactions: TransactionRequest[];
|
|
5
|
+
};
|
|
6
|
+
export type UnsignedMessage = {
|
|
7
|
+
orderHash: string;
|
|
8
|
+
orderComponents: any;
|
|
9
|
+
unsignedMessage: {
|
|
10
|
+
domain: TypedDataDomain;
|
|
11
|
+
types: Record<string, TypedDataField[]>;
|
|
12
|
+
value: Record<string, any>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type SignedMessage = {
|
|
16
|
+
orderHash: string;
|
|
17
|
+
orderComponents: any;
|
|
18
|
+
signedMessage: string;
|
|
19
|
+
};
|
|
20
|
+
export type SignTransactionResult = SignTransactionSuccessStatus | SignTransactionFailedStatus;
|
|
21
|
+
export interface SignTransactionSuccessStatus {
|
|
22
|
+
type: SignTransactionStatusType.SUCCESS;
|
|
23
|
+
}
|
|
24
|
+
export interface SignTransactionFailedStatus {
|
|
25
|
+
type: SignTransactionStatusType.FAILED;
|
|
26
|
+
transactionHash: string;
|
|
27
|
+
reason: string;
|
|
28
|
+
}
|
|
29
|
+
export declare enum SignTransactionStatusType {
|
|
30
|
+
SUCCESS = "SUCCESS",
|
|
31
|
+
FAILED = "FAILED"
|
|
32
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { InsufficientERC1155, InsufficientERC20, InsufficientERC721, ItemAllowance } from '../allowance/types';
|
|
2
|
+
export declare const allowanceAggregator: (erc20allowances: ItemAllowance, erc721allowances: ItemAllowance, erc1155allowances: ItemAllowance) => (InsufficientERC20 | InsufficientERC721 | InsufficientERC1155)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ItemRequirement } from '../../types';
|
|
2
|
+
export declare const nativeBalanceAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
3
|
+
export declare const erc20BalanceAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
4
|
+
export declare const erc721BalanceAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
5
|
+
export declare const balanceAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ItemRequirement } from '../../types';
|
|
2
|
+
export declare const nativeAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
3
|
+
export declare const erc20ItemAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
4
|
+
export declare const erc721ItemAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
5
|
+
export declare const erc1155ItemAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
6
|
+
export declare const itemAggregator: (itemRequirements: ItemRequirement[]) => ItemRequirement[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CheckoutConfiguration } from '../../config';
|
|
2
|
+
import { AvailableRoutingOptions, TokenInfo } from '../../types';
|
|
3
|
+
import { TokenBalances } from '../routing/types';
|
|
4
|
+
import { RoutingTokensAllowList } from './types';
|
|
5
|
+
export declare const allowListCheckForOnRamp: (config: CheckoutConfiguration, availableRoutingOptions: AvailableRoutingOptions) => Promise<TokenInfo[]>;
|
|
6
|
+
export declare const allowListCheckForBridge: (config: CheckoutConfiguration, tokenBalances: TokenBalances, availableRoutingOptions: AvailableRoutingOptions) => Promise<TokenInfo[]>;
|
|
7
|
+
export declare const allowListCheckForSwap: (config: CheckoutConfiguration, tokenBalances: TokenBalances, availableRoutingOptions: AvailableRoutingOptions) => Promise<TokenInfo[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Checks the user balances against the route option allowlists.
|
|
10
|
+
*/
|
|
11
|
+
export declare const allowListCheck: (config: CheckoutConfiguration, tokenBalances: TokenBalances, availableRoutingOptions: AvailableRoutingOptions) => Promise<RoutingTokensAllowList>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './allowListCheck';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TransactionRequest } from 'ethers';
|
|
2
|
+
import { ItemRequirement, WrappedBrowserProvider } from '../../types';
|
|
3
|
+
import { Allowance } from './types';
|
|
4
|
+
export declare const isERC1155ApprovedForAll: (provider: WrappedBrowserProvider, ownerAddress: string, contractAddress: string, spenderAddress: string) => Promise<boolean>;
|
|
5
|
+
export declare const getSetERC1155ApprovalForAllTransaction: (provider: WrappedBrowserProvider, ownerAddress: string, contractAddress: string, spenderAddress: string) => Promise<TransactionRequest | undefined>;
|
|
6
|
+
export declare const hasERC1155Allowances: (provider: WrappedBrowserProvider, ownerAddress: string, itemRequirements: ItemRequirement[]) => Promise<{
|
|
7
|
+
sufficient: boolean;
|
|
8
|
+
allowances: Allowance[];
|
|
9
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TransactionRequest } from 'ethers';
|
|
2
|
+
import { ItemRequirement, WrappedBrowserProvider } from '../../types';
|
|
3
|
+
import { Allowance } from './types';
|
|
4
|
+
export declare const getERC20Allowance: (provider: WrappedBrowserProvider, ownerAddress: string, contractAddress: string, spenderAddress: string) => Promise<bigint>;
|
|
5
|
+
export declare const getERC20ApprovalTransaction: (provider: WrappedBrowserProvider, ownerAddress: string, contractAddress: string, spenderAddress: string, amount: bigint) => Promise<TransactionRequest | undefined>;
|
|
6
|
+
export declare const hasERC20Allowances: (provider: WrappedBrowserProvider, ownerAddress: string, itemRequirements: ItemRequirement[]) => Promise<{
|
|
7
|
+
sufficient: boolean;
|
|
8
|
+
allowances: Allowance[];
|
|
9
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TransactionRequest } from 'ethers';
|
|
2
|
+
import { ItemRequirement, WrappedBrowserProvider } from '../../types';
|
|
3
|
+
import { Allowance } from './types';
|
|
4
|
+
export declare const getERC721ApprovedForAll: (provider: WrappedBrowserProvider, ownerAddress: string, contractAddress: string, spenderAddress: string) => Promise<boolean>;
|
|
5
|
+
export declare const getApproveTransaction: (provider: WrappedBrowserProvider, ownerAddress: string, contractAddress: string, spenderAddress: string, id: bigint) => Promise<TransactionRequest | undefined>;
|
|
6
|
+
export declare const getERC721ApprovedAddress: (provider: WrappedBrowserProvider, contractAddress: string, id: bigint) => Promise<string>;
|
|
7
|
+
export declare const convertIdToNumber: (id: string, contractAddress: string) => bigint;
|
|
8
|
+
export declare const getApprovedCollections: (provider: WrappedBrowserProvider, itemRequirements: ItemRequirement[], owner: string) => Promise<Map<string, boolean>>;
|
|
9
|
+
export declare const hasERC721Allowances: (provider: WrappedBrowserProvider, ownerAddress: string, itemRequirements: ItemRequirement[]) => Promise<{
|
|
10
|
+
sufficient: boolean;
|
|
11
|
+
allowances: Allowance[];
|
|
12
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|