@imtbl/sdk 0.28.9-alpha → 0.28.10-alpha.1
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/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +35 -0
- package/dist/browser/checkout/widgets.js +890 -0
- package/dist/checkout_sdk.d.ts +12720 -0
- package/dist/checkout_sdk.js +25866 -0
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +19 -10
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +20605 -47
- package/dist/index.d.ts +2484 -34
- package/dist/index.js +20615 -58
- package/dist/orderbook.js +10 -7
- package/dist/passport.js +2 -2
- package/package.json +21 -2
package/dist/index.d.ts
CHANGED
|
@@ -5268,7 +5268,7 @@ declare type FeeTokenData = FeeData;
|
|
|
5268
5268
|
* @export
|
|
5269
5269
|
* @interface FeeToken
|
|
5270
5270
|
*/
|
|
5271
|
-
interface FeeToken {
|
|
5271
|
+
interface FeeToken$1 {
|
|
5272
5272
|
/**
|
|
5273
5273
|
*
|
|
5274
5274
|
* @type {FeeTokenData}
|
|
@@ -5305,7 +5305,7 @@ declare type FeeTokenTypeEnum = typeof FeeTokenTypeEnum[keyof typeof FeeTokenTyp
|
|
|
5305
5305
|
* Details of the fee currency
|
|
5306
5306
|
* @export
|
|
5307
5307
|
*/
|
|
5308
|
-
declare type OrderFeeInfoToken = FeeToken;
|
|
5308
|
+
declare type OrderFeeInfoToken = FeeToken$1;
|
|
5309
5309
|
|
|
5310
5310
|
/**
|
|
5311
5311
|
* Immutable X API
|
|
@@ -5516,7 +5516,7 @@ declare type AssetOrders = OrderDetails;
|
|
|
5516
5516
|
* @export
|
|
5517
5517
|
* @interface Fee
|
|
5518
5518
|
*/
|
|
5519
|
-
interface Fee$
|
|
5519
|
+
interface Fee$3 {
|
|
5520
5520
|
/**
|
|
5521
5521
|
* Wallet address
|
|
5522
5522
|
* @type {string}
|
|
@@ -5578,7 +5578,7 @@ interface Asset {
|
|
|
5578
5578
|
* @type {Array<Fee>}
|
|
5579
5579
|
* @memberof Asset
|
|
5580
5580
|
*/
|
|
5581
|
-
'fees'?: Array<Fee$
|
|
5581
|
+
'fees'?: Array<Fee$3>;
|
|
5582
5582
|
/**
|
|
5583
5583
|
* [DEPRECATED] Internal Immutable X Token ID
|
|
5584
5584
|
* @type {string}
|
|
@@ -5726,7 +5726,7 @@ interface AssetWithOrders {
|
|
|
5726
5726
|
* @type {Array<Fee>}
|
|
5727
5727
|
* @memberof AssetWithOrders
|
|
5728
5728
|
*/
|
|
5729
|
-
'fees'?: Array<Fee$
|
|
5729
|
+
'fees'?: Array<Fee$3>;
|
|
5730
5730
|
/**
|
|
5731
5731
|
* [DEPRECATED] Internal Immutable X Token ID
|
|
5732
5732
|
* @type {string}
|
|
@@ -9224,7 +9224,7 @@ interface Mint {
|
|
|
9224
9224
|
* @type {Array<Fee>}
|
|
9225
9225
|
* @memberof Mint
|
|
9226
9226
|
*/
|
|
9227
|
-
'fees'?: Array<Fee$
|
|
9227
|
+
'fees'?: Array<Fee$3>;
|
|
9228
9228
|
/**
|
|
9229
9229
|
* Status of this mint
|
|
9230
9230
|
* @type {string}
|
|
@@ -14658,7 +14658,7 @@ type Provider = {
|
|
|
14658
14658
|
removeListener: (event: string, listener: (...args: any[]) => void) => void;
|
|
14659
14659
|
isPassport: boolean;
|
|
14660
14660
|
};
|
|
14661
|
-
declare enum ProviderEvent {
|
|
14661
|
+
declare enum ProviderEvent$1 {
|
|
14662
14662
|
ACCOUNTS_CHANGED = "accountsChanged"
|
|
14663
14663
|
}
|
|
14664
14664
|
type AccountsChangedEvent = Array<string>;
|
|
@@ -14734,8 +14734,6 @@ type passport_d_PassportOverrides = PassportOverrides;
|
|
|
14734
14734
|
type passport_d_Provider = Provider;
|
|
14735
14735
|
type passport_d_ProviderErrorCode = ProviderErrorCode;
|
|
14736
14736
|
declare const passport_d_ProviderErrorCode: typeof ProviderErrorCode;
|
|
14737
|
-
type passport_d_ProviderEvent = ProviderEvent;
|
|
14738
|
-
declare const passport_d_ProviderEvent: typeof ProviderEvent;
|
|
14739
14737
|
type passport_d_RequestArguments = RequestArguments;
|
|
14740
14738
|
type passport_d_RpcErrorCode = RpcErrorCode;
|
|
14741
14739
|
declare const passport_d_RpcErrorCode: typeof RpcErrorCode;
|
|
@@ -14757,7 +14755,7 @@ declare namespace passport_d {
|
|
|
14757
14755
|
passport_d_PassportOverrides as PassportOverrides,
|
|
14758
14756
|
passport_d_Provider as Provider,
|
|
14759
14757
|
passport_d_ProviderErrorCode as ProviderErrorCode,
|
|
14760
|
-
|
|
14758
|
+
ProviderEvent$1 as ProviderEvent,
|
|
14761
14759
|
passport_d_RequestArguments as RequestArguments,
|
|
14762
14760
|
passport_d_RpcErrorCode as RpcErrorCode,
|
|
14763
14761
|
passport_d_TypedDataPayload as TypedDataPayload,
|
|
@@ -14893,9 +14891,9 @@ type CancelOrdersResult = {
|
|
|
14893
14891
|
/**
|
|
14894
14892
|
* The name of chain
|
|
14895
14893
|
*/
|
|
14896
|
-
type ChainName = string;
|
|
14894
|
+
type ChainName$1 = string;
|
|
14897
14895
|
|
|
14898
|
-
type Fee$
|
|
14896
|
+
type Fee$2 = {
|
|
14899
14897
|
/**
|
|
14900
14898
|
* Fee payable to recipient upon settlement
|
|
14901
14899
|
*/
|
|
@@ -14903,13 +14901,13 @@ type Fee$1 = {
|
|
|
14903
14901
|
/**
|
|
14904
14902
|
* Fee type
|
|
14905
14903
|
*/
|
|
14906
|
-
fee_type: Fee$
|
|
14904
|
+
fee_type: Fee$2.fee_type;
|
|
14907
14905
|
/**
|
|
14908
14906
|
* Wallet address of fee recipient
|
|
14909
14907
|
*/
|
|
14910
14908
|
recipient: string;
|
|
14911
14909
|
};
|
|
14912
|
-
declare namespace Fee$
|
|
14910
|
+
declare namespace Fee$2 {
|
|
14913
14911
|
/**
|
|
14914
14912
|
* Fee type
|
|
14915
14913
|
*/
|
|
@@ -15005,7 +15003,7 @@ type CreateListingRequestBody = {
|
|
|
15005
15003
|
/**
|
|
15006
15004
|
* Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible.
|
|
15007
15005
|
*/
|
|
15008
|
-
fees: Array<Fee$
|
|
15006
|
+
fees: Array<Fee$2>;
|
|
15009
15007
|
/**
|
|
15010
15008
|
* Time after which the Order is considered expired
|
|
15011
15009
|
*/
|
|
@@ -15126,7 +15124,7 @@ type OrderStatus = (CancelledOrderStatus | PendingOrderStatus | ActiveOrderStatu
|
|
|
15126
15124
|
type Order$1 = {
|
|
15127
15125
|
account_address: string;
|
|
15128
15126
|
buy: Array<Item>;
|
|
15129
|
-
fees: Array<Fee$
|
|
15127
|
+
fees: Array<Fee$2>;
|
|
15130
15128
|
chain: Chain;
|
|
15131
15129
|
/**
|
|
15132
15130
|
* Time the Order is created
|
|
@@ -15168,7 +15166,7 @@ type FulfillableOrder = {
|
|
|
15168
15166
|
|
|
15169
15167
|
type FulfillmentDataRequest = {
|
|
15170
15168
|
order_id: string;
|
|
15171
|
-
fees: Array<Fee$
|
|
15169
|
+
fees: Array<Fee$2>;
|
|
15172
15170
|
};
|
|
15173
15171
|
|
|
15174
15172
|
type ListingResult$1 = {
|
|
@@ -15219,7 +15217,7 @@ type TradeBlockchainMetadata = {
|
|
|
15219
15217
|
type Trade$1 = {
|
|
15220
15218
|
buy: Array<Item>;
|
|
15221
15219
|
buyer_address: string;
|
|
15222
|
-
buyer_fees: Array<Fee$
|
|
15220
|
+
buyer_fees: Array<Fee$2>;
|
|
15223
15221
|
chain: Chain;
|
|
15224
15222
|
order_id: string;
|
|
15225
15223
|
blockchain_metadata: TradeBlockchainMetadata;
|
|
@@ -15289,7 +15287,7 @@ declare class OrdersService {
|
|
|
15289
15287
|
* @throws ApiError
|
|
15290
15288
|
*/
|
|
15291
15289
|
cancelOrders({ chainName, requestBody, }: {
|
|
15292
|
-
chainName: ChainName;
|
|
15290
|
+
chainName: ChainName$1;
|
|
15293
15291
|
requestBody: CancelOrdersRequestBody;
|
|
15294
15292
|
}): CancelablePromise<CancelOrdersResult>;
|
|
15295
15293
|
/**
|
|
@@ -15299,7 +15297,7 @@ declare class OrdersService {
|
|
|
15299
15297
|
* @throws ApiError
|
|
15300
15298
|
*/
|
|
15301
15299
|
listListings({ chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, fromUpdatedAt, pageSize, sortBy, sortDirection, pageCursor, }: {
|
|
15302
|
-
chainName: ChainName;
|
|
15300
|
+
chainName: ChainName$1;
|
|
15303
15301
|
/**
|
|
15304
15302
|
* Order status to filter by
|
|
15305
15303
|
*/
|
|
@@ -15344,7 +15342,7 @@ declare class OrdersService {
|
|
|
15344
15342
|
* @throws ApiError
|
|
15345
15343
|
*/
|
|
15346
15344
|
createListing({ chainName, requestBody, }: {
|
|
15347
|
-
chainName: ChainName;
|
|
15345
|
+
chainName: ChainName$1;
|
|
15348
15346
|
requestBody: CreateListingRequestBody;
|
|
15349
15347
|
}): CancelablePromise<ListingResult$1>;
|
|
15350
15348
|
/**
|
|
@@ -15354,7 +15352,7 @@ declare class OrdersService {
|
|
|
15354
15352
|
* @throws ApiError
|
|
15355
15353
|
*/
|
|
15356
15354
|
getListing({ chainName, listingId, }: {
|
|
15357
|
-
chainName: ChainName;
|
|
15355
|
+
chainName: ChainName$1;
|
|
15358
15356
|
/**
|
|
15359
15357
|
* Global Order identifier
|
|
15360
15358
|
*/
|
|
@@ -15367,7 +15365,7 @@ declare class OrdersService {
|
|
|
15367
15365
|
* @throws ApiError
|
|
15368
15366
|
*/
|
|
15369
15367
|
fulfillmentData({ chainName, requestBody, }: {
|
|
15370
|
-
chainName: ChainName;
|
|
15368
|
+
chainName: ChainName$1;
|
|
15371
15369
|
requestBody: Array<FulfillmentDataRequest>;
|
|
15372
15370
|
}): CancelablePromise<{
|
|
15373
15371
|
result: {
|
|
@@ -15382,7 +15380,7 @@ declare class OrdersService {
|
|
|
15382
15380
|
* @throws ApiError
|
|
15383
15381
|
*/
|
|
15384
15382
|
listTrades({ chainName, accountAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, }: {
|
|
15385
|
-
chainName: ChainName;
|
|
15383
|
+
chainName: ChainName$1;
|
|
15386
15384
|
accountAddress?: string;
|
|
15387
15385
|
/**
|
|
15388
15386
|
* From indexed at including given date
|
|
@@ -15412,7 +15410,7 @@ declare class OrdersService {
|
|
|
15412
15410
|
* @throws ApiError
|
|
15413
15411
|
*/
|
|
15414
15412
|
getTrade({ chainName, tradeId, }: {
|
|
15415
|
-
chainName: ChainName;
|
|
15413
|
+
chainName: ChainName$1;
|
|
15416
15414
|
/**
|
|
15417
15415
|
* Global Trade identifier
|
|
15418
15416
|
*/
|
|
@@ -15426,7 +15424,7 @@ declare enum OrderType {
|
|
|
15426
15424
|
FULL_RESTRICTED = 2,
|
|
15427
15425
|
PARTIAL_RESTRICTED = 3
|
|
15428
15426
|
}
|
|
15429
|
-
declare enum ItemType {
|
|
15427
|
+
declare enum ItemType$1 {
|
|
15430
15428
|
NATIVE = 0,
|
|
15431
15429
|
ERC20 = 1,
|
|
15432
15430
|
ERC721 = 2,
|
|
@@ -15436,14 +15434,14 @@ declare enum ItemType {
|
|
|
15436
15434
|
}
|
|
15437
15435
|
|
|
15438
15436
|
type OfferItem = {
|
|
15439
|
-
itemType: ItemType;
|
|
15437
|
+
itemType: ItemType$1;
|
|
15440
15438
|
token: string;
|
|
15441
15439
|
identifierOrCriteria: string;
|
|
15442
15440
|
startAmount: string;
|
|
15443
15441
|
endAmount: string;
|
|
15444
15442
|
};
|
|
15445
15443
|
type ConsiderationItem = {
|
|
15446
|
-
itemType: ItemType;
|
|
15444
|
+
itemType: ItemType$1;
|
|
15447
15445
|
token: string;
|
|
15448
15446
|
identifierOrCriteria: string;
|
|
15449
15447
|
startAmount: string;
|
|
@@ -15517,7 +15515,7 @@ interface FeeValue {
|
|
|
15517
15515
|
recipient: string;
|
|
15518
15516
|
amount: string;
|
|
15519
15517
|
}
|
|
15520
|
-
interface Fee extends FeeValue {
|
|
15518
|
+
interface Fee$1 extends FeeValue {
|
|
15521
15519
|
type: FeeType;
|
|
15522
15520
|
}
|
|
15523
15521
|
declare enum TransactionPurpose {
|
|
@@ -15587,7 +15585,7 @@ interface Order {
|
|
|
15587
15585
|
accountAddress: string;
|
|
15588
15586
|
buy: (ERC20Item | NativeItem)[];
|
|
15589
15587
|
sell: ERC721Item[];
|
|
15590
|
-
fees: Fee[];
|
|
15588
|
+
fees: Fee$1[];
|
|
15591
15589
|
chain: {
|
|
15592
15590
|
id: string;
|
|
15593
15591
|
name: string;
|
|
@@ -15639,7 +15637,7 @@ interface Trade {
|
|
|
15639
15637
|
};
|
|
15640
15638
|
buy: (ERC20Item | NativeItem)[];
|
|
15641
15639
|
sell: ERC721Item[];
|
|
15642
|
-
buyerFees: Fee[];
|
|
15640
|
+
buyerFees: Fee$1[];
|
|
15643
15641
|
sellerAddress: string;
|
|
15644
15642
|
buyerAddress: string;
|
|
15645
15643
|
makerAddress: string;
|
|
@@ -15785,7 +15783,6 @@ type orderbook_d_CancelOrdersOnChainResponse = CancelOrdersOnChainResponse;
|
|
|
15785
15783
|
type orderbook_d_CreateListingParams = CreateListingParams;
|
|
15786
15784
|
type orderbook_d_ERC20Item = ERC20Item;
|
|
15787
15785
|
type orderbook_d_ERC721Item = ERC721Item;
|
|
15788
|
-
type orderbook_d_Fee = Fee;
|
|
15789
15786
|
type orderbook_d_FeeType = FeeType;
|
|
15790
15787
|
declare const orderbook_d_FeeType: typeof FeeType;
|
|
15791
15788
|
type orderbook_d_FeeValue = FeeValue;
|
|
@@ -15829,7 +15826,7 @@ declare namespace orderbook_d {
|
|
|
15829
15826
|
orderbook_d_CreateListingParams as CreateListingParams,
|
|
15830
15827
|
orderbook_d_ERC20Item as ERC20Item,
|
|
15831
15828
|
orderbook_d_ERC721Item as ERC721Item,
|
|
15832
|
-
|
|
15829
|
+
Fee$1 as Fee,
|
|
15833
15830
|
orderbook_d_FeeType as FeeType,
|
|
15834
15831
|
orderbook_d_FeeValue as FeeValue,
|
|
15835
15832
|
orderbook_d_FulfillBulkOrdersInsufficientBalanceResponse as FulfillBulkOrdersInsufficientBalanceResponse,
|
|
@@ -15879,4 +15876,2457 @@ declare namespace provider_d {
|
|
|
15879
15876
|
};
|
|
15880
15877
|
}
|
|
15881
15878
|
|
|
15882
|
-
|
|
15879
|
+
/**
|
|
15880
|
+
* Enum representing different chain IDs.
|
|
15881
|
+
* @enum {number}
|
|
15882
|
+
* @property {number} IMTBL_ZKEVM_MAINNET - The chain ID for IMTBL ZKEVM Mainnet.
|
|
15883
|
+
* @property {number} IMTBL_ZKEVM_TESTNET - The chain ID for IMTBL ZKEVM Testnet.
|
|
15884
|
+
* @property {number} IMTBL_ZKEVM_DEVNET - The chain ID for IMTBL ZKEVM Devnet.
|
|
15885
|
+
* @property {number} ETHEREUM - The chain ID for Ethereum.
|
|
15886
|
+
* @property {number} SEPOLIA - The chain ID for Sepolia.
|
|
15887
|
+
*/
|
|
15888
|
+
declare enum ChainId {
|
|
15889
|
+
IMTBL_ZKEVM_MAINNET = 13371,
|
|
15890
|
+
IMTBL_ZKEVM_TESTNET = 13472,
|
|
15891
|
+
IMTBL_ZKEVM_DEVNET = 13433,
|
|
15892
|
+
ETHEREUM = 1,
|
|
15893
|
+
SEPOLIA = 11155111
|
|
15894
|
+
}
|
|
15895
|
+
/**
|
|
15896
|
+
* Enum representing different chain names.
|
|
15897
|
+
* @enum {number}
|
|
15898
|
+
* @property {number} IMTBL_ZKEVM_MAINNET - The chain name for IMTBL ZKEVM Mainnet.
|
|
15899
|
+
* @property {number} IMTBL_ZKEVM_TESTNET - The chain name for IMTBL ZKEVM Testnet.
|
|
15900
|
+
* @property {number} IMTBL_ZKEVM_DEVNET - The chain name for IMTBL ZKEVM Devnet.
|
|
15901
|
+
* @property {number} ETHEREUM - The chain name for Ethereum.
|
|
15902
|
+
* @property {number} SEPOLIA - The chain name for Sepolia.
|
|
15903
|
+
*/
|
|
15904
|
+
declare enum ChainName {
|
|
15905
|
+
ETHEREUM = "Ethereum",
|
|
15906
|
+
SEPOLIA = "Sepolia",
|
|
15907
|
+
IMTBL_ZKEVM_TESTNET = "Immutable zkEVM Test",
|
|
15908
|
+
IMTBL_ZKEVM_DEVNET = "Immutable zkEVM Dev",
|
|
15909
|
+
IMTBL_ZKEVM_MAINNET = "Immutable zkEVM"
|
|
15910
|
+
}
|
|
15911
|
+
|
|
15912
|
+
/**
|
|
15913
|
+
* Represents information about a token.
|
|
15914
|
+
* @interface TokenInfo
|
|
15915
|
+
* @property {string} name - The name of the token.
|
|
15916
|
+
* @property {string} symbol - The symbol of the token.
|
|
15917
|
+
* @property {number} decimals - The number of decimal places the token supports.
|
|
15918
|
+
* @property {string | undefined} [address] - The address of the token.
|
|
15919
|
+
* @property {string | undefined} [icon] - The URL of the token's icon.
|
|
15920
|
+
*/
|
|
15921
|
+
interface TokenInfo {
|
|
15922
|
+
name: string;
|
|
15923
|
+
symbol: string;
|
|
15924
|
+
decimals: number;
|
|
15925
|
+
address?: string;
|
|
15926
|
+
icon?: string;
|
|
15927
|
+
}
|
|
15928
|
+
|
|
15929
|
+
/**
|
|
15930
|
+
* Interface representing the parameters for {@link Checkout.getBalance}.
|
|
15931
|
+
* @property {Web3Provider} provider - The provider used to get the balance.
|
|
15932
|
+
* @property {string} walletAddress - The wallet address.
|
|
15933
|
+
* @property {string | undefined} contractAddress - The contract address of the token.
|
|
15934
|
+
*/
|
|
15935
|
+
interface GetBalanceParams {
|
|
15936
|
+
provider: Web3Provider;
|
|
15937
|
+
walletAddress: string;
|
|
15938
|
+
contractAddress?: string;
|
|
15939
|
+
}
|
|
15940
|
+
/**
|
|
15941
|
+
* Interface representing the result of {@link Checkout.getBalance}.
|
|
15942
|
+
* @property {BigNumber} balance - The balance of the wallet for the token.
|
|
15943
|
+
* @property {string} formattedBalance - The formatted balance of the wallet for the token.
|
|
15944
|
+
* @property {TokenInfo} token - The token information.
|
|
15945
|
+
*/
|
|
15946
|
+
interface GetBalanceResult {
|
|
15947
|
+
balance: BigNumber;
|
|
15948
|
+
formattedBalance: string;
|
|
15949
|
+
token: TokenInfo;
|
|
15950
|
+
}
|
|
15951
|
+
/**
|
|
15952
|
+
* Interface representing the parameters for {@link Checkout.getAllBalances}.
|
|
15953
|
+
* @property {Web3Provider} provider - The provider used to get the balances.
|
|
15954
|
+
* @property {string} walletAddress - The wallet address.
|
|
15955
|
+
* @property {ChainId} chainId - The ID of the network.
|
|
15956
|
+
*/
|
|
15957
|
+
interface GetAllBalancesParams {
|
|
15958
|
+
provider: Web3Provider;
|
|
15959
|
+
walletAddress: string;
|
|
15960
|
+
chainId: ChainId;
|
|
15961
|
+
}
|
|
15962
|
+
/**
|
|
15963
|
+
* Interface representing the result of {@link Checkout.getAllBalances}.
|
|
15964
|
+
* @property {GetBalanceResult[]} balances - The array of balances of the wallet for every token.
|
|
15965
|
+
*/
|
|
15966
|
+
interface GetAllBalancesResult {
|
|
15967
|
+
balances: GetBalanceResult[];
|
|
15968
|
+
}
|
|
15969
|
+
|
|
15970
|
+
interface OrderFee {
|
|
15971
|
+
amount: FeeToken | FeePercentage;
|
|
15972
|
+
recipient: string;
|
|
15973
|
+
}
|
|
15974
|
+
interface FeeToken {
|
|
15975
|
+
token: string;
|
|
15976
|
+
}
|
|
15977
|
+
interface FeePercentage {
|
|
15978
|
+
percentageDecimal: number;
|
|
15979
|
+
}
|
|
15980
|
+
|
|
15981
|
+
type BuyResult = BuyResultSuccess | BuyResultFailed | BuyResultInsufficientFunds;
|
|
15982
|
+
/**
|
|
15983
|
+
* Represents the result of {@link Checkout.buy}
|
|
15984
|
+
* @property {CheckoutStatus.SUCCESS} status - The status to indicate success
|
|
15985
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult - The sufficient result of smart checkout
|
|
15986
|
+
*/
|
|
15987
|
+
type BuyResultSuccess = {
|
|
15988
|
+
status: CheckoutStatus.SUCCESS;
|
|
15989
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
15990
|
+
};
|
|
15991
|
+
/**
|
|
15992
|
+
* Represents the result of {@link Checkout.buy}
|
|
15993
|
+
* @property {CheckoutStatus.FAILED} status - The status to indicate failure
|
|
15994
|
+
* @property {string} transactionHash - The transaction hash of the failed transaction
|
|
15995
|
+
* @property {string} reason - The reason for the failure
|
|
15996
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult - The sufficient result of smart checkout
|
|
15997
|
+
*/
|
|
15998
|
+
type BuyResultFailed = {
|
|
15999
|
+
status: CheckoutStatus.FAILED;
|
|
16000
|
+
transactionHash: string;
|
|
16001
|
+
reason: string;
|
|
16002
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
16003
|
+
};
|
|
16004
|
+
/**
|
|
16005
|
+
* Represents the result of {@link Checkout.buy}
|
|
16006
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status - The status to indicate insufficient funds
|
|
16007
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult - The insufficient result of smart checkout
|
|
16008
|
+
*/
|
|
16009
|
+
type BuyResultInsufficientFunds = {
|
|
16010
|
+
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
16011
|
+
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
16012
|
+
};
|
|
16013
|
+
type SellResult = SellResultSuccess | SellResultFailed | SellResultInsufficientFunds;
|
|
16014
|
+
/**
|
|
16015
|
+
* Represents the result of {@link Checkout.sell}
|
|
16016
|
+
* @property {CheckoutStatus.SUCCESS} status - The status to indicate success
|
|
16017
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult - The sufficient result of smart checkout
|
|
16018
|
+
*/
|
|
16019
|
+
type SellResultSuccess = {
|
|
16020
|
+
status: CheckoutStatus.SUCCESS;
|
|
16021
|
+
orderIds: string[];
|
|
16022
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
16023
|
+
};
|
|
16024
|
+
/**
|
|
16025
|
+
* Represents the result of {@link Checkout.sell}
|
|
16026
|
+
* @property {CheckoutStatus.FAILED} status - The status to indicate failure
|
|
16027
|
+
* @property {string} transactionHash - The transaction hash of the failed transaction
|
|
16028
|
+
* @property {string} reason - The reason for the failure
|
|
16029
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult - The sufficient result of smart checkout
|
|
16030
|
+
*/
|
|
16031
|
+
type SellResultFailed = {
|
|
16032
|
+
status: CheckoutStatus.FAILED;
|
|
16033
|
+
transactionHash: string;
|
|
16034
|
+
reason: string;
|
|
16035
|
+
smartCheckoutResult: SmartCheckoutSufficient;
|
|
16036
|
+
};
|
|
16037
|
+
/**
|
|
16038
|
+
* Represents the result of {@link Checkout.sell}
|
|
16039
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status - The status to indicate insufficient funds
|
|
16040
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult - The insufficient result of smart checkout
|
|
16041
|
+
*/
|
|
16042
|
+
type SellResultInsufficientFunds = {
|
|
16043
|
+
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
16044
|
+
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
16045
|
+
};
|
|
16046
|
+
type CancelResult = CancelResultSuccess | CancelResultFailed;
|
|
16047
|
+
/**
|
|
16048
|
+
* Represents the result of {@link Checkout.cancel}
|
|
16049
|
+
* @property {CheckoutStatus.SUCCESS} status - The status to indicate success
|
|
16050
|
+
*/
|
|
16051
|
+
type CancelResultSuccess = {
|
|
16052
|
+
status: CheckoutStatus.SUCCESS;
|
|
16053
|
+
};
|
|
16054
|
+
/**
|
|
16055
|
+
* Represents the result of {@link Checkout.cancel}
|
|
16056
|
+
* @property {CheckoutStatus.FAILED} status - The status to indicate failure
|
|
16057
|
+
* @property {string} transactionHash - The transaction hash of the failed transaction
|
|
16058
|
+
* @property {string} reason - The reason for the failure
|
|
16059
|
+
*/
|
|
16060
|
+
type CancelResultFailed = {
|
|
16061
|
+
status: CheckoutStatus.FAILED;
|
|
16062
|
+
transactionHash: string;
|
|
16063
|
+
reason: string;
|
|
16064
|
+
};
|
|
16065
|
+
/**
|
|
16066
|
+
* An enum representing the checkout status types
|
|
16067
|
+
* @enum {string}
|
|
16068
|
+
* @property {string} SUCCESS - If checkout succeeded as the transactions were able to be processed
|
|
16069
|
+
* @property {string} FAILED - If checkout failed due to transactions not settling on chain
|
|
16070
|
+
* @property {string} INSUFFICIENT_FUNDS - If checkout failed due to insufficient funds
|
|
16071
|
+
*/
|
|
16072
|
+
declare enum CheckoutStatus {
|
|
16073
|
+
SUCCESS = "SUCCESS",
|
|
16074
|
+
FAILED = "FAILED",
|
|
16075
|
+
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS"
|
|
16076
|
+
}
|
|
16077
|
+
/**
|
|
16078
|
+
* The type representing the order to buy
|
|
16079
|
+
* @property {string} orderId - the id of the order to buy
|
|
16080
|
+
* @property {Array<OrderFee>} takerFees - array of order fees to apply to the order
|
|
16081
|
+
*/
|
|
16082
|
+
type BuyOrder = {
|
|
16083
|
+
id: string;
|
|
16084
|
+
takerFees?: OrderFee[];
|
|
16085
|
+
};
|
|
16086
|
+
/**
|
|
16087
|
+
* The type representing the sell order to create a listing from
|
|
16088
|
+
* @property {SellToken} sellToken - the token to be listed for sale
|
|
16089
|
+
* @property {BuyToken} buyToken - the token info of the price of the item
|
|
16090
|
+
* @property {OrderFee[]} makerFees - option array of makerFees to be applied to the listing
|
|
16091
|
+
*/
|
|
16092
|
+
type SellOrder = {
|
|
16093
|
+
sellToken: SellToken;
|
|
16094
|
+
buyToken: BuyToken;
|
|
16095
|
+
makerFees?: OrderFee[];
|
|
16096
|
+
};
|
|
16097
|
+
/**
|
|
16098
|
+
* Represents the token that the item can be bought with once listed for sale.
|
|
16099
|
+
* NativeBuyToken or ERC20BuyToken {@link Checkout.smartCheckout}.
|
|
16100
|
+
*/
|
|
16101
|
+
type BuyToken = NativeBuyToken | ERC20BuyToken;
|
|
16102
|
+
/**
|
|
16103
|
+
* Represents a native buy token
|
|
16104
|
+
* @property {ItemType} type - The type indicate this is a native token.
|
|
16105
|
+
* @property {string} amount - The amount of native token.
|
|
16106
|
+
*/
|
|
16107
|
+
type NativeBuyToken = {
|
|
16108
|
+
type: ItemType.NATIVE;
|
|
16109
|
+
amount: string;
|
|
16110
|
+
};
|
|
16111
|
+
/**
|
|
16112
|
+
* Represents a ERC20 buy token
|
|
16113
|
+
* @property {ItemType} type - The type indicate this is a ERC20 token.
|
|
16114
|
+
* @property {string} amount - The amount of native token.
|
|
16115
|
+
* @property {string} contractAddress - The contract address of the ERC20.
|
|
16116
|
+
*/
|
|
16117
|
+
type ERC20BuyToken = {
|
|
16118
|
+
type: ItemType.ERC20;
|
|
16119
|
+
amount: string;
|
|
16120
|
+
contractAddress: string;
|
|
16121
|
+
};
|
|
16122
|
+
/**
|
|
16123
|
+
* The SellToken type
|
|
16124
|
+
* @property {string} id - The ERC721 token id
|
|
16125
|
+
* @property {string} collectionAddress - The ERC721 collection address
|
|
16126
|
+
*/
|
|
16127
|
+
type SellToken = {
|
|
16128
|
+
id: string;
|
|
16129
|
+
collectionAddress: string;
|
|
16130
|
+
};
|
|
16131
|
+
/**
|
|
16132
|
+
* Interface representing the parameters for {@link Checkout.smartCheckout}
|
|
16133
|
+
* @property {Web3Provider} provider - The provider to use for smart checkout.
|
|
16134
|
+
* @property {ItemRequirement[]} itemRequirements - The item requirements for the transaction.
|
|
16135
|
+
* @property {FulfillmentTransaction | GasAmount} transactionOrGasAmount - The transaction or gas amount.
|
|
16136
|
+
*/
|
|
16137
|
+
interface SmartCheckoutParams {
|
|
16138
|
+
provider: Web3Provider;
|
|
16139
|
+
itemRequirements: (NativeItemRequirement | ERC20ItemRequirement | ERC721ItemRequirement)[];
|
|
16140
|
+
transactionOrGasAmount: FulfillmentTransaction | GasAmount;
|
|
16141
|
+
}
|
|
16142
|
+
/**
|
|
16143
|
+
* Represents a native item requirement for a transaction.
|
|
16144
|
+
* @property {ItemType.NATIVE} type - The type to indicate this is a native item requirement.
|
|
16145
|
+
* @property {string} amount - The amount of the item.
|
|
16146
|
+
*/
|
|
16147
|
+
type NativeItemRequirement = {
|
|
16148
|
+
type: ItemType.NATIVE;
|
|
16149
|
+
amount: string;
|
|
16150
|
+
};
|
|
16151
|
+
/**
|
|
16152
|
+
* Represents an ERC20 item requirement for a transaction.
|
|
16153
|
+
* @property {ItemType.ERC20} type - The type to indicate this is a ERC20 item requirement.
|
|
16154
|
+
* @property {string} amount - The amount of the item.
|
|
16155
|
+
* @property {string} contractAddress - The contract address of the ERC20.
|
|
16156
|
+
* @property {string} spenderAddress - The contract address of the approver.
|
|
16157
|
+
*/
|
|
16158
|
+
type ERC20ItemRequirement = {
|
|
16159
|
+
type: ItemType.ERC20;
|
|
16160
|
+
contractAddress: string;
|
|
16161
|
+
amount: string;
|
|
16162
|
+
spenderAddress: string;
|
|
16163
|
+
};
|
|
16164
|
+
/**
|
|
16165
|
+
* Represents an ERC721 item requirement for a transaction.
|
|
16166
|
+
* @property {ItemType.ERC721} type - The type to indicate this is a ERC721 item requirement.
|
|
16167
|
+
* @property {string} contractAddress - The contract address of the ERC721 collection.
|
|
16168
|
+
* @property {string} id - The ID of this ERC721 in the collection.
|
|
16169
|
+
* @property {string} spenderAddress - The contract address of the approver.
|
|
16170
|
+
*/
|
|
16171
|
+
type ERC721ItemRequirement = {
|
|
16172
|
+
type: ItemType.ERC721;
|
|
16173
|
+
contractAddress: string;
|
|
16174
|
+
id: string;
|
|
16175
|
+
spenderAddress: string;
|
|
16176
|
+
};
|
|
16177
|
+
/**
|
|
16178
|
+
* An enum representing the item types
|
|
16179
|
+
* @enum {string}
|
|
16180
|
+
* @property {string} NATIVE - If the item is a native token.
|
|
16181
|
+
* @property {string} ERC20 - If the item is an ERC20 token.
|
|
16182
|
+
* @property {string} ERC721 - If the item is an ERC721 token.
|
|
16183
|
+
*/
|
|
16184
|
+
declare enum ItemType {
|
|
16185
|
+
NATIVE = "NATIVE",
|
|
16186
|
+
ERC20 = "ERC20",
|
|
16187
|
+
ERC721 = "ERC721"
|
|
16188
|
+
}
|
|
16189
|
+
/**
|
|
16190
|
+
* An enum representing transaction or gas types
|
|
16191
|
+
* @enum {string}
|
|
16192
|
+
* @property {string} TRANSACTION - If the type is a transaction
|
|
16193
|
+
* @property {string} GAS - If the type is the gas amount
|
|
16194
|
+
*/
|
|
16195
|
+
declare enum TransactionOrGasType {
|
|
16196
|
+
TRANSACTION = "TRANSACTION",
|
|
16197
|
+
GAS = "GAS"
|
|
16198
|
+
}
|
|
16199
|
+
/**
|
|
16200
|
+
* The fulfillment transaction which contains the transaction to send.
|
|
16201
|
+
* @property {TransactionOrGasType} type - The type to indicate this is a fulfillment transaction.
|
|
16202
|
+
* @property {TransactionRequest} transaction - The transaction to send.
|
|
16203
|
+
*/
|
|
16204
|
+
type FulfillmentTransaction = {
|
|
16205
|
+
type: TransactionOrGasType.TRANSACTION;
|
|
16206
|
+
transaction: TransactionRequest;
|
|
16207
|
+
};
|
|
16208
|
+
/**
|
|
16209
|
+
* The gas amount which contains the gas token and the gas limit.
|
|
16210
|
+
* @property {TransactionOrGasType} type - The type to indicate this is a gas amount.
|
|
16211
|
+
* @property {GasToken} gasToken - The gas token.
|
|
16212
|
+
*/
|
|
16213
|
+
type GasAmount = {
|
|
16214
|
+
type: TransactionOrGasType.GAS;
|
|
16215
|
+
gasToken: GasToken;
|
|
16216
|
+
};
|
|
16217
|
+
/**
|
|
16218
|
+
* Represents the gas token which is either a native token or an ERC20 token.
|
|
16219
|
+
*/
|
|
16220
|
+
type GasToken = NativeGas | ERC20Gas;
|
|
16221
|
+
/**
|
|
16222
|
+
* An enum representing the gas token types
|
|
16223
|
+
* @enum {string}
|
|
16224
|
+
* @property {string} NATIVE - If the gas token is a native token.
|
|
16225
|
+
* @property {string} ERC20 - If the gas token is an ERC20 token.
|
|
16226
|
+
*/
|
|
16227
|
+
declare enum GasTokenType {
|
|
16228
|
+
NATIVE = "NATIVE",
|
|
16229
|
+
ERC20 = "ERC20"
|
|
16230
|
+
}
|
|
16231
|
+
/**
|
|
16232
|
+
* Represents a native gas token.
|
|
16233
|
+
* @property {GasTokenType} type - The type to indicate this is a native gas token.
|
|
16234
|
+
* @property {BigNumber} limit - The gas limit.
|
|
16235
|
+
*/
|
|
16236
|
+
type NativeGas = {
|
|
16237
|
+
type: GasTokenType.NATIVE;
|
|
16238
|
+
limit: BigNumber;
|
|
16239
|
+
};
|
|
16240
|
+
/**
|
|
16241
|
+
* Represents an ERC20 gas token.
|
|
16242
|
+
* @property {GasTokenType} type - The type to indicate this is an ERC20 gas token.
|
|
16243
|
+
* @property {string} contractAddress - The contract address of the ERC20.
|
|
16244
|
+
* @property {BigNumber} limit - The gas limit.
|
|
16245
|
+
*/
|
|
16246
|
+
type ERC20Gas = {
|
|
16247
|
+
type: GasTokenType.ERC20;
|
|
16248
|
+
contractAddress: string;
|
|
16249
|
+
limit: BigNumber;
|
|
16250
|
+
};
|
|
16251
|
+
/**
|
|
16252
|
+
* The type representing the result of {@link Checkout.smartCheckout}.
|
|
16253
|
+
*/
|
|
16254
|
+
type SmartCheckoutResult = SmartCheckoutSufficient | SmartCheckoutInsufficient;
|
|
16255
|
+
/**
|
|
16256
|
+
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is sufficient.
|
|
16257
|
+
* @property {boolean} sufficient - Indicates that smart checkout determined the user had sufficient funds.
|
|
16258
|
+
* @property {TransactionRequirement[]} transactionRequirements - The transaction requirements smart checkout
|
|
16259
|
+
* determined were required for the transaction.
|
|
16260
|
+
*/
|
|
16261
|
+
type SmartCheckoutSufficient = {
|
|
16262
|
+
sufficient: true;
|
|
16263
|
+
transactionRequirements: TransactionRequirement[];
|
|
16264
|
+
};
|
|
16265
|
+
/**
|
|
16266
|
+
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is insufficient.
|
|
16267
|
+
* @property {boolean} sufficient - Indicates that smart checkout determined the user has insufficient funds
|
|
16268
|
+
* @property {TransactionRequirement[]} transactionRequirements - The transaction requirements smart checkout
|
|
16269
|
+
* determined were required for the transaction.
|
|
16270
|
+
* @property {SmartCheckoutRouter} router - The type containing the funding routes the user can take to fulfill the transaction requirements
|
|
16271
|
+
*/
|
|
16272
|
+
type SmartCheckoutInsufficient = {
|
|
16273
|
+
sufficient: false;
|
|
16274
|
+
transactionRequirements: TransactionRequirement[];
|
|
16275
|
+
router: SmartCheckoutRouter;
|
|
16276
|
+
};
|
|
16277
|
+
/**
|
|
16278
|
+
* Represents the routing outcome for a transaction.
|
|
16279
|
+
* @property {AvailableRoutingOptions} availableRoutingOptions - The routing options available to the user
|
|
16280
|
+
* @property {RoutingOutcome} routingOutcome - The routing outcome for the transaction which
|
|
16281
|
+
* includes the funding routes if routes were found
|
|
16282
|
+
*/
|
|
16283
|
+
type SmartCheckoutRouter = {
|
|
16284
|
+
availableRoutingOptions: AvailableRoutingOptions;
|
|
16285
|
+
routingOutcome: RoutingOutcome;
|
|
16286
|
+
};
|
|
16287
|
+
/**
|
|
16288
|
+
* An enum representing the routing outcome types
|
|
16289
|
+
* @enum {string}
|
|
16290
|
+
* @property {string} ROUTES_FOUND - If funding routes were found for the transaction.
|
|
16291
|
+
* @property {string} NO_ROUTES_FOUND - If no funding routes were found for the transaction.
|
|
16292
|
+
* @property {string} NO_ROUTE_OPTIONS - If no routing options were available for the transaction.
|
|
16293
|
+
*/
|
|
16294
|
+
declare enum RoutingOutcomeType {
|
|
16295
|
+
ROUTES_FOUND = "ROUTES_FOUND",
|
|
16296
|
+
NO_ROUTES_FOUND = "NO_ROUTES_FOUND",
|
|
16297
|
+
NO_ROUTE_OPTIONS = "NO_ROUTE_OPTIONS"
|
|
16298
|
+
}
|
|
16299
|
+
type RoutingOutcome = RoutesFound | NoRoutesFound | NoRouteOptions;
|
|
16300
|
+
/**
|
|
16301
|
+
* Represents a routing outcome where funding routes were found.
|
|
16302
|
+
* @property {RoutingOutcomeType.ROUTES_FOUND} type - Indicates that funding routes were found for the transaction.
|
|
16303
|
+
* @property {AvailableRoutingOptions} fundingRoutes - The funding routes found for the transaction.
|
|
16304
|
+
*/
|
|
16305
|
+
type RoutesFound = {
|
|
16306
|
+
type: RoutingOutcomeType.ROUTES_FOUND;
|
|
16307
|
+
fundingRoutes: FundingRoute[];
|
|
16308
|
+
};
|
|
16309
|
+
/**
|
|
16310
|
+
* Represents a routing outcome where no funding routes were found.
|
|
16311
|
+
* @property {RoutingOutcomeType.NO_ROUTES_FOUND} type - Indicates that no funding routes were found for the transaction.
|
|
16312
|
+
* @property {string} message - The message indicating why no funding routes were found.
|
|
16313
|
+
*/
|
|
16314
|
+
type NoRoutesFound = {
|
|
16315
|
+
type: RoutingOutcomeType.NO_ROUTES_FOUND;
|
|
16316
|
+
message: string;
|
|
16317
|
+
};
|
|
16318
|
+
/**
|
|
16319
|
+
* Represents a routing outcome where no routing options were available for the transaction.
|
|
16320
|
+
* @property {RoutingOutcomeType.NO_ROUTE_OPTIONS} type - Indicates that no routing options were available for the transaction.
|
|
16321
|
+
* @property {string} message - The message indicating why no routing options were available.
|
|
16322
|
+
*/
|
|
16323
|
+
type NoRouteOptions = {
|
|
16324
|
+
type: RoutingOutcomeType.NO_ROUTE_OPTIONS;
|
|
16325
|
+
message: string;
|
|
16326
|
+
};
|
|
16327
|
+
/**
|
|
16328
|
+
* Represents a funding route
|
|
16329
|
+
* @property {number} priority - The priority of the route
|
|
16330
|
+
* @property {FundingStep[]} steps - The steps associated with this funding route
|
|
16331
|
+
*/
|
|
16332
|
+
type FundingRoute = {
|
|
16333
|
+
priority: number;
|
|
16334
|
+
steps: FundingStep[];
|
|
16335
|
+
};
|
|
16336
|
+
/**
|
|
16337
|
+
* Represents a fee
|
|
16338
|
+
* @property {BigNumber} amount - The amount of the fee
|
|
16339
|
+
* @property {string} formatted - The formatted amount of the fee
|
|
16340
|
+
* @property {TokenInfo | undefined} token - The token info for the fee
|
|
16341
|
+
*/
|
|
16342
|
+
type Fee = {
|
|
16343
|
+
amount: BigNumber;
|
|
16344
|
+
formattedAmount: string;
|
|
16345
|
+
token?: TokenInfo;
|
|
16346
|
+
};
|
|
16347
|
+
type FundingStep = BridgeFundingStep | SwapFundingStep | OnRampFundingStep;
|
|
16348
|
+
/**
|
|
16349
|
+
* Represents a bridge funding route
|
|
16350
|
+
* @property {FundingStepType.BRIDGE} type - Indicates that this is a bridge funding step
|
|
16351
|
+
* @property {number} chainId - The chain id the bridge should be executed on
|
|
16352
|
+
* @property {FundingItem} fundingItem - The funding item for the bridge
|
|
16353
|
+
* @property {BridgeFees} fees - The fees for the bridge
|
|
16354
|
+
*/
|
|
16355
|
+
type BridgeFundingStep = {
|
|
16356
|
+
type: FundingStepType.BRIDGE;
|
|
16357
|
+
chainId: number;
|
|
16358
|
+
fundingItem: FundingItem;
|
|
16359
|
+
fees: BridgeFees;
|
|
16360
|
+
};
|
|
16361
|
+
/**
|
|
16362
|
+
* Represents the fees for a bridge funding step
|
|
16363
|
+
* @property {Fee} approvalGasFees - The approval gas fees for the bridge
|
|
16364
|
+
* @property {Fee} bridgeGasFees - The bridge gas fees for the bridge
|
|
16365
|
+
* @property {Fee[]} bridgeFees - Additional bridge fees for the bridge
|
|
16366
|
+
*/
|
|
16367
|
+
type BridgeFees = {
|
|
16368
|
+
approvalGasFees: Fee;
|
|
16369
|
+
bridgeGasFees: Fee;
|
|
16370
|
+
bridgeFees: Fee[];
|
|
16371
|
+
};
|
|
16372
|
+
/**
|
|
16373
|
+
* Represents a swap funding route
|
|
16374
|
+
* @property {FundingStepType.SWAP} type - Indicates that this is a swap funding step
|
|
16375
|
+
* @property {number} chainId - The chain id the swap should be executed on
|
|
16376
|
+
* @property {FundingItem} fundingItem - The funding item for the swap
|
|
16377
|
+
* @property {SwapFees} fees - The fees for the swap
|
|
16378
|
+
*/
|
|
16379
|
+
type SwapFundingStep = {
|
|
16380
|
+
type: FundingStepType.SWAP;
|
|
16381
|
+
chainId: number;
|
|
16382
|
+
fundingItem: FundingItem;
|
|
16383
|
+
fees: SwapFees;
|
|
16384
|
+
};
|
|
16385
|
+
/**
|
|
16386
|
+
* Represents the fees for a swap funding step
|
|
16387
|
+
* @property {Fee} approvalGasFees - The approval gas fees for the swap
|
|
16388
|
+
* @property {Fee} swapGasFees - The swap gas fees for the swap
|
|
16389
|
+
* @property {Fee[]} swapFees - Additional swap fees for the swap
|
|
16390
|
+
*/
|
|
16391
|
+
type SwapFees = {
|
|
16392
|
+
approvalGasFees: Fee;
|
|
16393
|
+
swapGasFees: Fee;
|
|
16394
|
+
swapFees: Fee[];
|
|
16395
|
+
};
|
|
16396
|
+
/**
|
|
16397
|
+
* Represents an onramp funding route
|
|
16398
|
+
* @property {FundingStepType.ONRAMP} type - Indicates that this is an onramp funding step
|
|
16399
|
+
* @property {number} chainId - The chain id the onramp should provide funds to
|
|
16400
|
+
* @property {FundingItem} fundingItem - The item to be onramped
|
|
16401
|
+
*/
|
|
16402
|
+
type OnRampFundingStep = {
|
|
16403
|
+
type: FundingStepType.ONRAMP;
|
|
16404
|
+
chainId: number;
|
|
16405
|
+
fundingItem: FundingItem;
|
|
16406
|
+
};
|
|
16407
|
+
/**
|
|
16408
|
+
* An enum representing the funding step types
|
|
16409
|
+
* @enum {string}
|
|
16410
|
+
* @property {string} BRIDGE - If the funding step is a bridge.
|
|
16411
|
+
* @property {string} SWAP - If the funding step is a swap.
|
|
16412
|
+
* @property {string} ONRAMP - If the funding step is an onramp.
|
|
16413
|
+
*/
|
|
16414
|
+
declare enum FundingStepType {
|
|
16415
|
+
BRIDGE = "BRIDGE",
|
|
16416
|
+
SWAP = "SWAP",
|
|
16417
|
+
ONRAMP = "ONRAMP"
|
|
16418
|
+
}
|
|
16419
|
+
/**
|
|
16420
|
+
* Represents a funding item
|
|
16421
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type - The type of the funding item
|
|
16422
|
+
* @property {FundsRequired} fundsRequired - The amount of funds required of this funding item
|
|
16423
|
+
* @property {UserBalance} userBalance - The current user balance of this funding item
|
|
16424
|
+
* @property {TokenInfo} token - The token info for the funding item
|
|
16425
|
+
*/
|
|
16426
|
+
type FundingItem = {
|
|
16427
|
+
type: ItemType.NATIVE | ItemType.ERC20;
|
|
16428
|
+
fundsRequired: FundsRequired;
|
|
16429
|
+
userBalance: UserBalance;
|
|
16430
|
+
token: TokenInfo;
|
|
16431
|
+
};
|
|
16432
|
+
/**
|
|
16433
|
+
* Represents the funds required of a funding item
|
|
16434
|
+
* @property {BigNumber} amount - The amount of funds required
|
|
16435
|
+
* @property {string} formattedAmount - The formatted amount of funds required
|
|
16436
|
+
*/
|
|
16437
|
+
type FundsRequired = {
|
|
16438
|
+
amount: BigNumber;
|
|
16439
|
+
formattedAmount: string;
|
|
16440
|
+
};
|
|
16441
|
+
/**
|
|
16442
|
+
* Represents the user balance of a funding item
|
|
16443
|
+
* @property {BigNumber} balance - The balance of the funding item
|
|
16444
|
+
* @property {string} formattedBalance - The formatted balance of the funding item
|
|
16445
|
+
*/
|
|
16446
|
+
type UserBalance = {
|
|
16447
|
+
balance: BigNumber;
|
|
16448
|
+
formattedBalance: string;
|
|
16449
|
+
};
|
|
16450
|
+
/**
|
|
16451
|
+
* Represents the transaction requirement for a transaction.
|
|
16452
|
+
* @property {ItemType} type - The type of the transaction requirement.
|
|
16453
|
+
* @property {boolean} sufficient - If the user address has sufficient funds to cover the transaction.
|
|
16454
|
+
* @property {ItemBalance} required - The required item balance.
|
|
16455
|
+
* @property {ItemBalance} current - The current item balance.
|
|
16456
|
+
* @property {BalanceDelta} delta - The delta between the required and current balances.
|
|
16457
|
+
*/
|
|
16458
|
+
type TransactionRequirement = {
|
|
16459
|
+
type: ItemType;
|
|
16460
|
+
sufficient: boolean;
|
|
16461
|
+
required: ItemBalance;
|
|
16462
|
+
current: ItemBalance;
|
|
16463
|
+
delta: BalanceDelta;
|
|
16464
|
+
};
|
|
16465
|
+
/**
|
|
16466
|
+
* Represents the balance for either a native or ERC20 token.
|
|
16467
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type - Type to indicate this is a native or ERC20 token.
|
|
16468
|
+
* @property {BigNumber} balance - The balance of the item.
|
|
16469
|
+
* @property {string} formattedBalance - The formatted balance of the item.
|
|
16470
|
+
* @property {TokenInfo} token - The token info of the item.
|
|
16471
|
+
*/
|
|
16472
|
+
type TokenBalance = {
|
|
16473
|
+
type: ItemType.NATIVE | ItemType.ERC20;
|
|
16474
|
+
balance: BigNumber;
|
|
16475
|
+
formattedBalance: string;
|
|
16476
|
+
token: TokenInfo;
|
|
16477
|
+
};
|
|
16478
|
+
/**
|
|
16479
|
+
* Represents the balance for an ERC721.
|
|
16480
|
+
* @property {ItemType.ERC721} type - Type to indicate this is an ERC721 token.
|
|
16481
|
+
* @property {BigNumber} balance - The balance of the item.
|
|
16482
|
+
* @property {string} formattedBalance - The formatted balance of the item.
|
|
16483
|
+
* @property {string} contractAddress - The contract address of the ERC721 collection.
|
|
16484
|
+
* @property {string} id - The ID of the ERC721 in the collection.
|
|
16485
|
+
*/
|
|
16486
|
+
type ERC721Balance = {
|
|
16487
|
+
type: ItemType.ERC721;
|
|
16488
|
+
balance: BigNumber;
|
|
16489
|
+
formattedBalance: string;
|
|
16490
|
+
contractAddress: string;
|
|
16491
|
+
id: string;
|
|
16492
|
+
};
|
|
16493
|
+
/**
|
|
16494
|
+
* Type representing the balance of an item.
|
|
16495
|
+
*/
|
|
16496
|
+
type ItemBalance = ERC721Balance | TokenBalance;
|
|
16497
|
+
/**
|
|
16498
|
+
* Represents the delta between two balances.
|
|
16499
|
+
* @property {BigNumber} balance - The delta of the balance.
|
|
16500
|
+
* @property {string} formattedBalance - The formatted balance of the delta.
|
|
16501
|
+
*/
|
|
16502
|
+
type BalanceDelta = {
|
|
16503
|
+
balance: BigNumber;
|
|
16504
|
+
formattedBalance: string;
|
|
16505
|
+
};
|
|
16506
|
+
/**
|
|
16507
|
+
* A type representing the Smart Checkout routing options available for a user
|
|
16508
|
+
* if they are configured and enabled (not geo-blocked etc.)
|
|
16509
|
+
* @property {boolean | undefined} onRamp - If the user can use onramp
|
|
16510
|
+
* @property {boolean | undefined} swap - If the user can use swap
|
|
16511
|
+
* @property {boolean | undefined} bridge - If the user can use bridge
|
|
16512
|
+
*/
|
|
16513
|
+
type AvailableRoutingOptions = {
|
|
16514
|
+
onRamp?: boolean;
|
|
16515
|
+
swap?: boolean;
|
|
16516
|
+
bridge?: boolean;
|
|
16517
|
+
};
|
|
16518
|
+
|
|
16519
|
+
/**
|
|
16520
|
+
* Interface representing the parameters for {@link Checkout.buy}
|
|
16521
|
+
* @property {Web3Provider} provider - The provider to use for the buy.
|
|
16522
|
+
* @property {Array<BuyOrder>} orders - The orders to buy
|
|
16523
|
+
* Currently only processes the first order in the array until batch processing is supported.
|
|
16524
|
+
*/
|
|
16525
|
+
interface BuyParams {
|
|
16526
|
+
provider: Web3Provider;
|
|
16527
|
+
orders: Array<BuyOrder>;
|
|
16528
|
+
}
|
|
16529
|
+
|
|
16530
|
+
/**
|
|
16531
|
+
* Interface representing the parameters for {@link Checkout.cancel}
|
|
16532
|
+
* @property {Web3Provider} provider - The provider to use for the cancel.
|
|
16533
|
+
* @property {string[]} orderIds - The order IDs to cancel.
|
|
16534
|
+
* Currently only processes the first order in the array until batch processing is supported.
|
|
16535
|
+
*/
|
|
16536
|
+
interface CancelParams {
|
|
16537
|
+
provider: Web3Provider;
|
|
16538
|
+
orderIds: string[];
|
|
16539
|
+
}
|
|
16540
|
+
|
|
16541
|
+
type ExchangeContracts = {
|
|
16542
|
+
multicall: string;
|
|
16543
|
+
coreFactory: string;
|
|
16544
|
+
quoterV2: string;
|
|
16545
|
+
peripheryRouter: string;
|
|
16546
|
+
secondaryFee: string;
|
|
16547
|
+
};
|
|
16548
|
+
/**
|
|
16549
|
+
* Type representing an ERC20 token
|
|
16550
|
+
* @property {string} type - The token type, used to discriminate between {@link ERC20} and {@link Native}
|
|
16551
|
+
* @property {number} chainId - The chain ID
|
|
16552
|
+
* @property {string} address - The token address
|
|
16553
|
+
* @property {number} decimals - The token decimals
|
|
16554
|
+
* @property {string | undefined} symbol - The token symbol or undefined if it is not available
|
|
16555
|
+
* @property {string | undefined} name - The token name or undefined if it is not available
|
|
16556
|
+
*/
|
|
16557
|
+
type ERC20 = {
|
|
16558
|
+
type: 'erc20';
|
|
16559
|
+
chainId: number;
|
|
16560
|
+
address: string;
|
|
16561
|
+
decimals: number;
|
|
16562
|
+
symbol?: string;
|
|
16563
|
+
name?: string;
|
|
16564
|
+
};
|
|
16565
|
+
/**
|
|
16566
|
+
* Type representing a native token
|
|
16567
|
+
* @property {string} type - The token type, used to discriminate between {@link ERC20} and {@link Native}
|
|
16568
|
+
* @property {number} chainId - The chain ID
|
|
16569
|
+
* @property {number} decimals - The token decimals
|
|
16570
|
+
* @property {string | undefined} symbol - The token symbol or undefined if it is not available
|
|
16571
|
+
* @property {string | undefined} name - The token name or undefined if it is not available
|
|
16572
|
+
*/
|
|
16573
|
+
type Native = {
|
|
16574
|
+
type: 'native';
|
|
16575
|
+
chainId: number;
|
|
16576
|
+
decimals: number;
|
|
16577
|
+
symbol?: string;
|
|
16578
|
+
name?: string;
|
|
16579
|
+
};
|
|
16580
|
+
/**
|
|
16581
|
+
* Type representing a token, either an {@link ERC20} or {@link Native}
|
|
16582
|
+
*/
|
|
16583
|
+
type Coin = ERC20 | Native;
|
|
16584
|
+
/**
|
|
16585
|
+
* Type representing the overrides for the {@link Exchange} module
|
|
16586
|
+
* @property {string} rpcURL - The RPC URL for the chain
|
|
16587
|
+
* @property {ExchangeContracts} exchangeContracts - The DEX contract addresses
|
|
16588
|
+
* @property {ERC20[]} commonRoutingTokens - The tokens used to find available pools for a swap
|
|
16589
|
+
* @property {Coin} nativeToken - The native token of the chain
|
|
16590
|
+
* @property {ERC20} wrappedNativeToken - The wrapped native token of the chain
|
|
16591
|
+
*/
|
|
16592
|
+
type ExchangeOverrides = {
|
|
16593
|
+
rpcURL: string;
|
|
16594
|
+
exchangeContracts: ExchangeContracts;
|
|
16595
|
+
commonRoutingTokens: ERC20[];
|
|
16596
|
+
nativeToken: Coin;
|
|
16597
|
+
wrappedNativeToken: ERC20;
|
|
16598
|
+
};
|
|
16599
|
+
|
|
16600
|
+
interface CheckoutOverrides {
|
|
16601
|
+
}
|
|
16602
|
+
/**
|
|
16603
|
+
* A type representing checkout SDK configurations.
|
|
16604
|
+
* @property {boolean} isOnRampEnabled - To enable on-ramp feature in Checkout sdk.
|
|
16605
|
+
* @property {boolean} isSwapEnabled - To enable swap feature in Checkout sdk.
|
|
16606
|
+
* @property {boolean} isBridgeEnabled - To enable bridge feature in Checkout sdk.
|
|
16607
|
+
* @property {Passport} passport - To enable passport wallet with Checkout sdk.
|
|
16608
|
+
*/
|
|
16609
|
+
interface CheckoutModuleConfiguration extends ModuleConfiguration<CheckoutOverrides> {
|
|
16610
|
+
isOnRampEnabled?: boolean;
|
|
16611
|
+
isSwapEnabled?: boolean;
|
|
16612
|
+
isBridgeEnabled?: boolean;
|
|
16613
|
+
passport?: Passport;
|
|
16614
|
+
}
|
|
16615
|
+
/**
|
|
16616
|
+
* A type representing various remotely defined configurations which are
|
|
16617
|
+
* accessible via the Checkout config and configured based on the Environment.
|
|
16618
|
+
* @property {DexConfig} dex - The config used for the DEX.
|
|
16619
|
+
* @property {OnRampConfig} onramp - The config used for the OnRamp
|
|
16620
|
+
* @property {AllowedNetworkConfig[]} allowedNetworks - An array representing the allowed networks.
|
|
16621
|
+
* @property {GasEstimateTokenConfig | undefined} gasEstimateTokens - The config for the tokens used to estimate gas.
|
|
16622
|
+
*/
|
|
16623
|
+
type RemoteConfiguration = {
|
|
16624
|
+
dex: DexConfig;
|
|
16625
|
+
onramp: OnRampConfig;
|
|
16626
|
+
bridge: BridgeConfig;
|
|
16627
|
+
allowedNetworks: AllowedNetworkConfig[];
|
|
16628
|
+
gasEstimateTokens?: GasEstimateTokenConfig;
|
|
16629
|
+
imxAddressMapping?: ImxAddressConfig;
|
|
16630
|
+
};
|
|
16631
|
+
/**
|
|
16632
|
+
* A type representing the fee structure for an OnRamp provider
|
|
16633
|
+
* @property {string | undefined} minPercentage - minimum percentage fee shown if a fee range is provided
|
|
16634
|
+
* @property {string | undefined} maxPercentage - maximum percentage fee shown if a fee range is provided
|
|
16635
|
+
* @property {string | undefined} feePercentage - specific fee percentage shown if there is no range provided
|
|
16636
|
+
*/
|
|
16637
|
+
type OnRampProviderFees = {
|
|
16638
|
+
minPercentage?: string;
|
|
16639
|
+
maxPercentage?: string;
|
|
16640
|
+
feePercentage?: string;
|
|
16641
|
+
};
|
|
16642
|
+
/**
|
|
16643
|
+
* A type representing the configuration for the OnRamp for a specific provider.
|
|
16644
|
+
* @property {string} publishableApiKey - on ramp provider publishable api-key
|
|
16645
|
+
* @property {TokenInfo[]} tokens - allowed tokens for the OnRamp provider
|
|
16646
|
+
* @property {OnRampProviderFees} fees - on ramp provider transaction fees
|
|
16647
|
+
*/
|
|
16648
|
+
type OnRampProviderConfig = {
|
|
16649
|
+
publishableApiKey: string;
|
|
16650
|
+
tokens: TokenInfo[];
|
|
16651
|
+
fees: OnRampProviderFees;
|
|
16652
|
+
};
|
|
16653
|
+
/**
|
|
16654
|
+
* A type representing the configuration for the OnRamp.
|
|
16655
|
+
* @property {OnRampProviderConfig} transak - OnRamp config for Transak provider
|
|
16656
|
+
*/
|
|
16657
|
+
type OnRampConfig = {
|
|
16658
|
+
[key: string]: OnRampProviderConfig;
|
|
16659
|
+
};
|
|
16660
|
+
/**
|
|
16661
|
+
* A type representing the configuration for the DEX.
|
|
16662
|
+
* @property {ExchangeOverrides | undefined} overrides - The DEX overrides.
|
|
16663
|
+
* @property {TokenInfo[] | undefined} tokens - An array of tokens compatible with the DEX.
|
|
16664
|
+
*/
|
|
16665
|
+
type DexConfig = {
|
|
16666
|
+
overrides?: ExchangeOverrides;
|
|
16667
|
+
tokens?: TokenInfo[];
|
|
16668
|
+
};
|
|
16669
|
+
/**
|
|
16670
|
+
* A type representing the configuration for the Bridge.
|
|
16671
|
+
* @property {TokenInfo[] | undefined} tokens - An array of tokens compatible with the Bridge.
|
|
16672
|
+
*/
|
|
16673
|
+
type BridgeConfig = {
|
|
16674
|
+
tokens?: TokenInfo[];
|
|
16675
|
+
};
|
|
16676
|
+
/**
|
|
16677
|
+
* A type representing an allowed network.
|
|
16678
|
+
* @property {number} chainId - The network chain id.
|
|
16679
|
+
*/
|
|
16680
|
+
type AllowedNetworkConfig = {
|
|
16681
|
+
chainId: number;
|
|
16682
|
+
};
|
|
16683
|
+
/**
|
|
16684
|
+
* A type representing the IMX address mappings across available networks.
|
|
16685
|
+
* @type {{ [chainId: string]: string }}
|
|
16686
|
+
*/
|
|
16687
|
+
type ImxAddressConfig = {
|
|
16688
|
+
[chainId: string]: string;
|
|
16689
|
+
};
|
|
16690
|
+
/**
|
|
16691
|
+
* A type representing the required information to estimate gas for a transaction.
|
|
16692
|
+
* @type {{ [key: string]: { bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig, swapAddresses?: GasEstimateSwapTokenConfig } }}
|
|
16693
|
+
* - A map of addresses for estimating gas keyed by the network chain id.
|
|
16694
|
+
* @property {GasEstimateBridgeToL2TokenConfig | undefined} bridgeToL2Addresses
|
|
16695
|
+
* - The type representing the addresses for a bridge to layer 2 gas estimate.
|
|
16696
|
+
* @property {GasEstimateSwapTokenConfig | undefined} swapAddresses - The type representing the addresses for a swap gas estimate
|
|
16697
|
+
*/
|
|
16698
|
+
type GasEstimateTokenConfig = {
|
|
16699
|
+
[key: string]: {
|
|
16700
|
+
bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig;
|
|
16701
|
+
swapAddresses?: GasEstimateSwapTokenConfig;
|
|
16702
|
+
};
|
|
16703
|
+
};
|
|
16704
|
+
/**
|
|
16705
|
+
* A type representing the config for a bridge to layer 2 gas estimate.
|
|
16706
|
+
* @property {string | 'NATIVE'} gasTokenAddress - The address of the gas token.
|
|
16707
|
+
* @property {string} fromAddress - The address of the token being bridged.
|
|
16708
|
+
*/
|
|
16709
|
+
type GasEstimateBridgeToL2TokenConfig = {
|
|
16710
|
+
gasTokenAddress: string | 'NATIVE';
|
|
16711
|
+
fromAddress: string;
|
|
16712
|
+
};
|
|
16713
|
+
/**
|
|
16714
|
+
* A type representing the config for a swap gas estimate.
|
|
16715
|
+
* @property {string} inAddress - The in token address.
|
|
16716
|
+
* @property {string} outAddress - The out token address.
|
|
16717
|
+
*/
|
|
16718
|
+
type GasEstimateSwapTokenConfig = {
|
|
16719
|
+
inAddress: string;
|
|
16720
|
+
outAddress: string;
|
|
16721
|
+
};
|
|
16722
|
+
/**
|
|
16723
|
+
* A type representing all the feature flags available.
|
|
16724
|
+
* @property {TokenInfo[] | undefined} allowed - List of allowed tokens for a given chain.
|
|
16725
|
+
* @property {boolean | undefined} blockscout - Feature flag to enable/disable blockscout integration.
|
|
16726
|
+
*/
|
|
16727
|
+
type ChainTokensConfig = {
|
|
16728
|
+
allowed?: TokenInfo[];
|
|
16729
|
+
blockscout?: boolean;
|
|
16730
|
+
};
|
|
16731
|
+
|
|
16732
|
+
/**
|
|
16733
|
+
* Interface representing the params of {@link Checkout.connect}.
|
|
16734
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
16735
|
+
*/
|
|
16736
|
+
interface ConnectParams {
|
|
16737
|
+
provider: Web3Provider;
|
|
16738
|
+
}
|
|
16739
|
+
/**
|
|
16740
|
+
* Interface representing the result of {@link Checkout.connect}.
|
|
16741
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
16742
|
+
*/
|
|
16743
|
+
interface ConnectResult {
|
|
16744
|
+
provider: Web3Provider;
|
|
16745
|
+
}
|
|
16746
|
+
/**
|
|
16747
|
+
* Interface representing the params of {@link Checkout.checkIsWalletConnected}.
|
|
16748
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
16749
|
+
*/
|
|
16750
|
+
interface CheckConnectionParams {
|
|
16751
|
+
provider: Web3Provider;
|
|
16752
|
+
}
|
|
16753
|
+
/**
|
|
16754
|
+
* Interface representing the result of {@link Checkout.checkIsWalletConnected}.
|
|
16755
|
+
* @property {boolean} isConnected - A boolean indicating the connection status of th Web3 provider.
|
|
16756
|
+
* @property {string} walletAddress - The wallet address used to check the connection.
|
|
16757
|
+
*/
|
|
16758
|
+
interface CheckConnectionResult {
|
|
16759
|
+
isConnected: boolean;
|
|
16760
|
+
walletAddress: string;
|
|
16761
|
+
}
|
|
16762
|
+
|
|
16763
|
+
/**
|
|
16764
|
+
* @typedef {string} Address - Represents an Ethereum address.
|
|
16765
|
+
*/
|
|
16766
|
+
type Address = string;
|
|
16767
|
+
/**
|
|
16768
|
+
* @typedef {Address | 'NATIVE'} FungibleToken - Represents a fungible token, either an ERC20 token address or the native token.
|
|
16769
|
+
*/
|
|
16770
|
+
type FungibleToken = Address | 'NATIVE';
|
|
16771
|
+
|
|
16772
|
+
/**
|
|
16773
|
+
* An enum representing the type of gas estimate.
|
|
16774
|
+
* @enum {string}
|
|
16775
|
+
* @property {string} BRIDGE_TO_L2 - The gas estimate type for a bridge to L2 transaction.
|
|
16776
|
+
* @property {string} SWAP - The gas estimate type for a swap transaction.
|
|
16777
|
+
*/
|
|
16778
|
+
declare enum GasEstimateType {
|
|
16779
|
+
BRIDGE_TO_L2 = "BRIDGE_TO_L2",
|
|
16780
|
+
SWAP = "SWAP"
|
|
16781
|
+
}
|
|
16782
|
+
/**
|
|
16783
|
+
* Represents the parameters for estimating gas usage, which can be either
|
|
16784
|
+
* GasEstimateBridgeToL2Params or GasEstimateSwapParams {@link Checkout.gasEstimate}.
|
|
16785
|
+
* @typedef {GasEstimateBridgeToL2Params | GasEstimateSwapParams} GasEstimateParams
|
|
16786
|
+
*/
|
|
16787
|
+
type GasEstimateParams = GasEstimateBridgeToL2Params | GasEstimateSwapParams;
|
|
16788
|
+
/**
|
|
16789
|
+
* An interface representing the parameters for estimating gas for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
16790
|
+
* @param {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
16791
|
+
* @param {boolean} isSpendingCapApprovalRequired - Whether or not spending cap approval is required.
|
|
16792
|
+
* @param {FungibleToken | undefined} tokenAddress - The address of the fungible token to use in the transaction.
|
|
16793
|
+
*/
|
|
16794
|
+
interface GasEstimateBridgeToL2Params {
|
|
16795
|
+
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
16796
|
+
isSpendingCapApprovalRequired: boolean;
|
|
16797
|
+
tokenAddress?: FungibleToken;
|
|
16798
|
+
}
|
|
16799
|
+
/**
|
|
16800
|
+
* An interface representing the parameters for a gas estimate swap {@link Checkout.gasEstimate}.
|
|
16801
|
+
* @interface
|
|
16802
|
+
* @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "swap".
|
|
16803
|
+
*/
|
|
16804
|
+
interface GasEstimateSwapParams {
|
|
16805
|
+
gasEstimateType: GasEstimateType.SWAP;
|
|
16806
|
+
}
|
|
16807
|
+
/**
|
|
16808
|
+
* An interface representing the result of a gas estimate for a swap transaction {@link Checkout.gasEstimate}.
|
|
16809
|
+
* @interface GasEstimateSwapResult
|
|
16810
|
+
* @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "SWAP".
|
|
16811
|
+
* @property {TokenAmountEstimate} gasFee - The estimated gas fee for the swap transaction.
|
|
16812
|
+
*/
|
|
16813
|
+
interface GasEstimateSwapResult {
|
|
16814
|
+
gasEstimateType: GasEstimateType.SWAP;
|
|
16815
|
+
gasFee: TokenAmountEstimate;
|
|
16816
|
+
}
|
|
16817
|
+
/**
|
|
16818
|
+
* An interface representing the result of a gas estimate for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
16819
|
+
* @interface GasEstimateBridgeToL2Result
|
|
16820
|
+
* @property {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
16821
|
+
* @property {TokenAmountEstimate} gasFee - The estimated gas fee for the transaction.
|
|
16822
|
+
* @property {TokenAmountEstimate} bridgeFee - The estimated bridge fee for the transaction.
|
|
16823
|
+
* @property {boolean} bridgeable - A boolean indicating whether the transaction is bridgeable.
|
|
16824
|
+
*/
|
|
16825
|
+
interface GasEstimateBridgeToL2Result {
|
|
16826
|
+
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
16827
|
+
gasFee: TokenAmountEstimate;
|
|
16828
|
+
bridgeFee: TokenAmountEstimate;
|
|
16829
|
+
bridgeable: boolean;
|
|
16830
|
+
}
|
|
16831
|
+
interface TokenAmountEstimate {
|
|
16832
|
+
estimatedAmount?: BigNumber;
|
|
16833
|
+
token?: TokenInfo;
|
|
16834
|
+
}
|
|
16835
|
+
|
|
16836
|
+
/**
|
|
16837
|
+
* Represents information about a network.
|
|
16838
|
+
* @interface NetworkInfo
|
|
16839
|
+
* @property {string} name - The name of the network.
|
|
16840
|
+
* @property {number} chainId - The chain ID of the network.
|
|
16841
|
+
* @property {TokenInfo} nativeCurrency - Information about the native currency of the network.
|
|
16842
|
+
* @property {boolean} isSupported - Indicates whether the network is supported.
|
|
16843
|
+
*/
|
|
16844
|
+
interface NetworkInfo {
|
|
16845
|
+
name: string;
|
|
16846
|
+
chainId: number;
|
|
16847
|
+
nativeCurrency: TokenInfo;
|
|
16848
|
+
isSupported: boolean;
|
|
16849
|
+
}
|
|
16850
|
+
|
|
16851
|
+
/**
|
|
16852
|
+
* Interface representing the parameters for {@link Checkout.switchNetwork}.
|
|
16853
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
16854
|
+
* @property {ChainId} chainId - The ID of the network to switch to.
|
|
16855
|
+
*/
|
|
16856
|
+
interface SwitchNetworkParams {
|
|
16857
|
+
provider: Web3Provider;
|
|
16858
|
+
chainId: ChainId;
|
|
16859
|
+
}
|
|
16860
|
+
/**
|
|
16861
|
+
* Represents the result of switching the network in a Web3 application {@link Checkout.switchNetwork}.
|
|
16862
|
+
* @interface SwitchNetworkResult
|
|
16863
|
+
* @property {NetworkInfo} network - The information about the switched network.
|
|
16864
|
+
* @property {Web3Provider} provider - The Web3 provider for the switched network.
|
|
16865
|
+
*/
|
|
16866
|
+
interface SwitchNetworkResult {
|
|
16867
|
+
network: NetworkInfo;
|
|
16868
|
+
provider: Web3Provider;
|
|
16869
|
+
}
|
|
16870
|
+
/**
|
|
16871
|
+
* * Interface representing the parameters for {@link Checkout.getNetworkInfo}.
|
|
16872
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
16873
|
+
*/
|
|
16874
|
+
interface GetNetworkParams {
|
|
16875
|
+
provider: Web3Provider;
|
|
16876
|
+
}
|
|
16877
|
+
/**
|
|
16878
|
+
* * Interface representing the parameters for {@link Checkout.getNetworkAllowList}.
|
|
16879
|
+
* @property {NetworkFilterTypes} type - The type of allow list filter to apply.
|
|
16880
|
+
* @property {NetworkFilter[]} [exclude] - The list of networks to exclude from the allow list.
|
|
16881
|
+
*/
|
|
16882
|
+
interface GetNetworkAllowListParams {
|
|
16883
|
+
type: NetworkFilterTypes;
|
|
16884
|
+
exclude?: NetworkFilter[];
|
|
16885
|
+
}
|
|
16886
|
+
/**
|
|
16887
|
+
* Interface representing the result of {@link Checkout.getNetworkAllowList}.
|
|
16888
|
+
* @property {NetworkInfo[]} networks - The list of allowed networks.
|
|
16889
|
+
*/
|
|
16890
|
+
interface GetNetworkAllowListResult {
|
|
16891
|
+
networks: NetworkInfo[];
|
|
16892
|
+
}
|
|
16893
|
+
/**
|
|
16894
|
+
* Enum representing the types of filters that can be applied to get the allow list of networks.
|
|
16895
|
+
*/
|
|
16896
|
+
declare enum NetworkFilterTypes {
|
|
16897
|
+
ALL = "all"
|
|
16898
|
+
}
|
|
16899
|
+
/**
|
|
16900
|
+
* Interface representing a filter for filtering a specific network.
|
|
16901
|
+
* @property {ChainId} chainId - The ID of the network to allow or disallow.
|
|
16902
|
+
*/
|
|
16903
|
+
interface NetworkFilter {
|
|
16904
|
+
chainId: ChainId;
|
|
16905
|
+
}
|
|
16906
|
+
|
|
16907
|
+
/**
|
|
16908
|
+
* Interface representing the parameters for {@link Checkout.sell}
|
|
16909
|
+
* @property {Web3Provider} provider - The provider to use for the sell.
|
|
16910
|
+
* @property {Array<SellOrder>} orders - An array of sell orders to execute.
|
|
16911
|
+
* Currently only processes the first order in the array until batch processing is supported.
|
|
16912
|
+
*/
|
|
16913
|
+
interface SellParams {
|
|
16914
|
+
provider: Web3Provider;
|
|
16915
|
+
orders: Array<SellOrder>;
|
|
16916
|
+
}
|
|
16917
|
+
|
|
16918
|
+
/**
|
|
16919
|
+
* Interface representing the parameters for {@link Checkout.getTokenAllowList}.
|
|
16920
|
+
* @property {TokenFilterTypes} type - The type of token to retrieve.
|
|
16921
|
+
* @property {ChainId} chainId - The ID of the blockchain network.
|
|
16922
|
+
* @property {TokenFilter[]} [exclude] - The tokens to exclude from the list.
|
|
16923
|
+
*/
|
|
16924
|
+
interface GetTokenAllowListParams {
|
|
16925
|
+
type: TokenFilterTypes;
|
|
16926
|
+
chainId: ChainId;
|
|
16927
|
+
exclude?: TokenFilter[];
|
|
16928
|
+
}
|
|
16929
|
+
/**
|
|
16930
|
+
* Interface representing the result of {@link Checkout.getTokenAllowList}.
|
|
16931
|
+
* @property {TokenInfo[]} tokens - The list of tokens allowed for the specified params.
|
|
16932
|
+
*/
|
|
16933
|
+
interface GetTokenAllowListResult {
|
|
16934
|
+
tokens: TokenInfo[];
|
|
16935
|
+
}
|
|
16936
|
+
/**
|
|
16937
|
+
* Enum representing the types of token filters available.
|
|
16938
|
+
*/
|
|
16939
|
+
declare enum TokenFilterTypes {
|
|
16940
|
+
ALL = "all",
|
|
16941
|
+
SWAP = "swap",
|
|
16942
|
+
BRIDGE = "bridge",
|
|
16943
|
+
ONRAMP = "onramp"
|
|
16944
|
+
}
|
|
16945
|
+
/**
|
|
16946
|
+
* Interface representing a token filter that can be used to exclude certain tokens.
|
|
16947
|
+
* @property {string} address - The token contract address.
|
|
16948
|
+
*/
|
|
16949
|
+
interface TokenFilter {
|
|
16950
|
+
address: string;
|
|
16951
|
+
}
|
|
16952
|
+
|
|
16953
|
+
/**
|
|
16954
|
+
* Interface representing the parameters for {@link Checkout.sendTransaction}.
|
|
16955
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
16956
|
+
* @property {TransactionRequest} transaction - The transaction to send.
|
|
16957
|
+
*/
|
|
16958
|
+
interface SendTransactionParams {
|
|
16959
|
+
provider: Web3Provider;
|
|
16960
|
+
transaction: TransactionRequest;
|
|
16961
|
+
}
|
|
16962
|
+
/**
|
|
16963
|
+
* Interface representing the result of {@link Checkout.sendTransaction}.
|
|
16964
|
+
* @property {TransactionResponse} transactionResponse - The response of the transaction.
|
|
16965
|
+
*/
|
|
16966
|
+
interface SendTransactionResult {
|
|
16967
|
+
transactionResponse: TransactionResponse;
|
|
16968
|
+
}
|
|
16969
|
+
|
|
16970
|
+
/**
|
|
16971
|
+
* Enum representing the names of different wallet providers.
|
|
16972
|
+
*/
|
|
16973
|
+
declare enum WalletProviderName {
|
|
16974
|
+
PASSPORT = "passport",
|
|
16975
|
+
METAMASK = "metamask"
|
|
16976
|
+
}
|
|
16977
|
+
/**
|
|
16978
|
+
* Interface for the parameters required to create a wallet provider {@link Checkout.createProvider}.
|
|
16979
|
+
* @interface CreateProviderParams
|
|
16980
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name to create a provider for.
|
|
16981
|
+
*/
|
|
16982
|
+
interface CreateProviderParams {
|
|
16983
|
+
walletProviderName: WalletProviderName;
|
|
16984
|
+
}
|
|
16985
|
+
/**
|
|
16986
|
+
* Represents the result of creating a Web3 provider {@link Checkout.createProvider}.
|
|
16987
|
+
* @property {Web3Provider} provider - The created Web3 provider.
|
|
16988
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name of the provider that was created.
|
|
16989
|
+
*/
|
|
16990
|
+
type CreateProviderResult = {
|
|
16991
|
+
provider: Web3Provider;
|
|
16992
|
+
walletProviderName: WalletProviderName;
|
|
16993
|
+
};
|
|
16994
|
+
|
|
16995
|
+
/**
|
|
16996
|
+
* Interface representing a wallet filter to be used in {@link GetWalletAllowListParams}.
|
|
16997
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name to filter wallets by.
|
|
16998
|
+
*/
|
|
16999
|
+
interface WalletFilter {
|
|
17000
|
+
walletProviderName: WalletProviderName;
|
|
17001
|
+
}
|
|
17002
|
+
/**
|
|
17003
|
+
* Interface representing the parameters for {@link Checkout.getWalletAllowList}.
|
|
17004
|
+
* @property {WalletFilterTypes} type - The type of wallets to filter by.
|
|
17005
|
+
* @property {WalletFilter[]} [exclude] - An optional list of wallet filters to exclude from the allowed wallets list.
|
|
17006
|
+
*/
|
|
17007
|
+
interface GetWalletAllowListParams {
|
|
17008
|
+
type: WalletFilterTypes;
|
|
17009
|
+
exclude?: WalletFilter[];
|
|
17010
|
+
}
|
|
17011
|
+
/**
|
|
17012
|
+
* Interface representing information about a wallet used in {@link GetWalletAllowListResult}.
|
|
17013
|
+
* @property {WalletProviderName} walletProviderName - The wallet provider name for the wallet.
|
|
17014
|
+
* @property {string | undefined} description - A description of the wallet.
|
|
17015
|
+
* @property {string | undefined} icon - The URL/data:image of an icon for the wallet.
|
|
17016
|
+
*/
|
|
17017
|
+
interface WalletInfo {
|
|
17018
|
+
walletProviderName: WalletProviderName;
|
|
17019
|
+
description?: string;
|
|
17020
|
+
icon?: string;
|
|
17021
|
+
}
|
|
17022
|
+
/**
|
|
17023
|
+
* Interface representing the result of {@link Checkout.getWalletAllowList}.
|
|
17024
|
+
* @property {WalletInfo[]} wallets - A list of {@link WalletInfo} objects representing the allowed wallets.
|
|
17025
|
+
*/
|
|
17026
|
+
interface GetWalletAllowListResult {
|
|
17027
|
+
wallets: WalletInfo[];
|
|
17028
|
+
}
|
|
17029
|
+
/**
|
|
17030
|
+
* Enum representing the platform filters used in {@link GetWalletAllowListParams}.
|
|
17031
|
+
*/
|
|
17032
|
+
declare enum WalletFilterTypes {
|
|
17033
|
+
ALL = "all"
|
|
17034
|
+
}
|
|
17035
|
+
|
|
17036
|
+
/**
|
|
17037
|
+
* Base URL for the checkout API based on the environment.
|
|
17038
|
+
* @property {string} DEVELOPMENT - The base URL for the development environment.
|
|
17039
|
+
* @property {string} SANDBOX - The base URL for the sandbox environment.
|
|
17040
|
+
* @property {string} PRODUCTION - The base URL for the production environment.
|
|
17041
|
+
*/
|
|
17042
|
+
declare const CHECKOUT_API_BASE_URL: {
|
|
17043
|
+
[x: string]: string;
|
|
17044
|
+
sandbox: string;
|
|
17045
|
+
production: string;
|
|
17046
|
+
};
|
|
17047
|
+
type NetworkDetails = {
|
|
17048
|
+
chainIdHex: string;
|
|
17049
|
+
chainName: string;
|
|
17050
|
+
rpcUrls: string[];
|
|
17051
|
+
nativeCurrency: TokenInfo;
|
|
17052
|
+
blockExplorerUrls?: string[];
|
|
17053
|
+
};
|
|
17054
|
+
type NetworkMap = Map<ChainId, NetworkDetails>;
|
|
17055
|
+
|
|
17056
|
+
/**
|
|
17057
|
+
* An enum representing the type of exchange.
|
|
17058
|
+
* @enum {string}
|
|
17059
|
+
* @property {string} ONRAMP - The exchange type for transacting.
|
|
17060
|
+
*/
|
|
17061
|
+
declare enum ExchangeType {
|
|
17062
|
+
ONRAMP = "onramp"
|
|
17063
|
+
}
|
|
17064
|
+
/**
|
|
17065
|
+
* Interface representing the result of {@link Checkout.createFiatRampUrl}.
|
|
17066
|
+
* @property {ExchangeType} exchangeType - The ExchangeType specified.
|
|
17067
|
+
* @property {Web3Provider} web3Provider - The Web3Provider used to exchange.
|
|
17068
|
+
* @property {string | undefined} tokenAmount - The token amount specified as input.
|
|
17069
|
+
* @property {string | undefined} tokenAddress - The token address specified as input.
|
|
17070
|
+
* @property {Passport | undefined} passport - The Passport instance specified as input.
|
|
17071
|
+
*/
|
|
17072
|
+
interface FiatRampParams {
|
|
17073
|
+
exchangeType: ExchangeType;
|
|
17074
|
+
web3Provider: Web3Provider;
|
|
17075
|
+
tokenAmount?: string;
|
|
17076
|
+
tokenAddress?: string;
|
|
17077
|
+
passport?: any;
|
|
17078
|
+
}
|
|
17079
|
+
|
|
17080
|
+
type RemoteConfigParams = {
|
|
17081
|
+
isDevelopment: boolean;
|
|
17082
|
+
isProduction: boolean;
|
|
17083
|
+
};
|
|
17084
|
+
declare class RemoteConfigFetcher {
|
|
17085
|
+
private isDevelopment;
|
|
17086
|
+
private isProduction;
|
|
17087
|
+
private configCache;
|
|
17088
|
+
private tokensCache;
|
|
17089
|
+
constructor(params: RemoteConfigParams);
|
|
17090
|
+
private static makeHttpRequest;
|
|
17091
|
+
private getEndpoint;
|
|
17092
|
+
private loadConfig;
|
|
17093
|
+
private loadConfigTokens;
|
|
17094
|
+
getConfig(key?: keyof RemoteConfiguration): Promise<RemoteConfiguration | RemoteConfiguration[keyof RemoteConfiguration] | undefined>;
|
|
17095
|
+
getTokensConfig(chainId: ChainId): Promise<ChainTokensConfig>;
|
|
17096
|
+
}
|
|
17097
|
+
|
|
17098
|
+
declare class CheckoutConfiguration {
|
|
17099
|
+
readonly isDevelopment: boolean;
|
|
17100
|
+
readonly isProduction: boolean;
|
|
17101
|
+
readonly isOnRampEnabled: boolean;
|
|
17102
|
+
readonly isSwapEnabled: boolean;
|
|
17103
|
+
readonly isBridgeEnabled: boolean;
|
|
17104
|
+
readonly remote: RemoteConfigFetcher;
|
|
17105
|
+
readonly environment: Environment;
|
|
17106
|
+
readonly networkMap: NetworkMap;
|
|
17107
|
+
constructor(config: CheckoutModuleConfiguration);
|
|
17108
|
+
}
|
|
17109
|
+
|
|
17110
|
+
interface FiatRampWidgetParams {
|
|
17111
|
+
exchangeType: ExchangeType;
|
|
17112
|
+
isPassport: boolean;
|
|
17113
|
+
walletAddress?: string;
|
|
17114
|
+
tokenAmount?: string;
|
|
17115
|
+
tokenSymbol?: string;
|
|
17116
|
+
email?: string;
|
|
17117
|
+
}
|
|
17118
|
+
declare class FiatRampService {
|
|
17119
|
+
readonly config: CheckoutConfiguration;
|
|
17120
|
+
/**
|
|
17121
|
+
* Constructs a new instance of the FiatRampService class.
|
|
17122
|
+
* @param {CheckoutConfiguration} config - The config required for the FiatRampService.
|
|
17123
|
+
*/
|
|
17124
|
+
constructor(config: CheckoutConfiguration);
|
|
17125
|
+
feeEstimate(): Promise<OnRampProviderFees>;
|
|
17126
|
+
createWidgetUrl(params: FiatRampWidgetParams): Promise<string>;
|
|
17127
|
+
private getTransakWidgetUrl;
|
|
17128
|
+
}
|
|
17129
|
+
|
|
17130
|
+
type AvailabilityService = {
|
|
17131
|
+
checkDexAvailability: () => Promise<boolean>;
|
|
17132
|
+
};
|
|
17133
|
+
|
|
17134
|
+
/**
|
|
17135
|
+
* Enum representing the themes for the widgets.
|
|
17136
|
+
*/
|
|
17137
|
+
declare enum WidgetTheme {
|
|
17138
|
+
LIGHT = "light",
|
|
17139
|
+
DARK = "dark"
|
|
17140
|
+
}
|
|
17141
|
+
|
|
17142
|
+
/**
|
|
17143
|
+
* Represents the local configuration options for the Checkout Widgets.
|
|
17144
|
+
* @property {WidgetTheme | undefined} theme - The theme of the Checkout Widget (default: "DARK")
|
|
17145
|
+
*/
|
|
17146
|
+
type WidgetConfiguration = {
|
|
17147
|
+
theme?: WidgetTheme;
|
|
17148
|
+
};
|
|
17149
|
+
|
|
17150
|
+
/**
|
|
17151
|
+
* Enum representing the events emitted by the widgets.
|
|
17152
|
+
*/
|
|
17153
|
+
declare enum IMTBLWidgetEvents {
|
|
17154
|
+
IMTBL_WIDGETS_PROVIDER = "imtbl-widgets-provider",
|
|
17155
|
+
IMTBL_CONNECT_WIDGET_EVENT = "imtbl-connect-widget",
|
|
17156
|
+
IMTBL_WALLET_WIDGET_EVENT = "imtbl-wallet-widget",
|
|
17157
|
+
IMTBL_SWAP_WIDGET_EVENT = "imtbl-swap-widget",
|
|
17158
|
+
IMTBL_BRIDGE_WIDGET_EVENT = "imtbl-bridge-widget",
|
|
17159
|
+
IMTBL_ONRAMP_WIDGET_EVENT = "imtbl-onramp-widget",
|
|
17160
|
+
IMTBL_SALE_WIDGET_EVENT = "imtbl-sale-widget"
|
|
17161
|
+
}
|
|
17162
|
+
/**
|
|
17163
|
+
* Enum for events raised for about provider objects
|
|
17164
|
+
*/
|
|
17165
|
+
declare enum ProviderEventType {
|
|
17166
|
+
PROVIDER_UPDATED = "PROVIDER_UPDATED"
|
|
17167
|
+
}
|
|
17168
|
+
/**
|
|
17169
|
+
* Payload type for the PROVIDER_UPDATED event
|
|
17170
|
+
*/
|
|
17171
|
+
type ProviderUpdated = {
|
|
17172
|
+
provider: Web3Provider;
|
|
17173
|
+
};
|
|
17174
|
+
|
|
17175
|
+
/**
|
|
17176
|
+
* Enum representing possible Connect Widget event types.
|
|
17177
|
+
*/
|
|
17178
|
+
declare enum ConnectEventType {
|
|
17179
|
+
CLOSE_WIDGET = "close-widget",
|
|
17180
|
+
SUCCESS = "success",
|
|
17181
|
+
FAILURE = "failure"
|
|
17182
|
+
}
|
|
17183
|
+
/**
|
|
17184
|
+
* Represents a successful connection.
|
|
17185
|
+
* @property {Web3Provider} provider - The connected provider.
|
|
17186
|
+
* @property {WalletProviderName | undefined} walletProviderName - The wallet provider name of the connected provider.
|
|
17187
|
+
*/
|
|
17188
|
+
type ConnectionSuccess = {
|
|
17189
|
+
provider: Web3Provider;
|
|
17190
|
+
walletProviderName: WalletProviderName | undefined;
|
|
17191
|
+
};
|
|
17192
|
+
/**
|
|
17193
|
+
* Represents a connection failure with a reason.
|
|
17194
|
+
* @property {string} reason - The reason for the failed connection.
|
|
17195
|
+
*/
|
|
17196
|
+
type ConnectionFailed = {
|
|
17197
|
+
reason: string;
|
|
17198
|
+
};
|
|
17199
|
+
|
|
17200
|
+
/**
|
|
17201
|
+
* Enum representing possible Wallet Widget event types.
|
|
17202
|
+
*/
|
|
17203
|
+
declare enum WalletEventType {
|
|
17204
|
+
CLOSE_WIDGET = "close-widget",
|
|
17205
|
+
NETWORK_SWITCH = "network-switch",
|
|
17206
|
+
DISCONNECT_WALLET = "disconnect-wallet"
|
|
17207
|
+
}
|
|
17208
|
+
/**
|
|
17209
|
+
* Represents an event that is triggered when the user switches the network in their wallet.
|
|
17210
|
+
* @property {string} network - The name of the network that the user switched to.
|
|
17211
|
+
* @property {number} chainId - The chain ID of the network that the user switched to.
|
|
17212
|
+
* @property {Web3Provider} provider - The Web3 provider object for the switched network.
|
|
17213
|
+
*/
|
|
17214
|
+
type WalletNetworkSwitch = {
|
|
17215
|
+
network: string;
|
|
17216
|
+
chainId: number;
|
|
17217
|
+
provider: Web3Provider;
|
|
17218
|
+
};
|
|
17219
|
+
/**
|
|
17220
|
+
* Represents an event that is triggered when a wallet is disconnected.
|
|
17221
|
+
*/
|
|
17222
|
+
type WalletDisconnect = {};
|
|
17223
|
+
|
|
17224
|
+
/**
|
|
17225
|
+
* Enum representing possible Swap Widget event types.
|
|
17226
|
+
*/
|
|
17227
|
+
declare enum SwapEventType {
|
|
17228
|
+
CLOSE_WIDGET = "close-widget",
|
|
17229
|
+
SUCCESS = "success",
|
|
17230
|
+
FAILURE = "failure",
|
|
17231
|
+
REJECTED = "rejected"
|
|
17232
|
+
}
|
|
17233
|
+
/**
|
|
17234
|
+
* Represents a successful swap transaction.
|
|
17235
|
+
* @property {string} transactionHash - The hash of the successful transaction.
|
|
17236
|
+
*/
|
|
17237
|
+
type SwapSuccess = {
|
|
17238
|
+
transactionHash: string;
|
|
17239
|
+
};
|
|
17240
|
+
/**
|
|
17241
|
+
* Type representing a Swap Widget with type FAILURE.
|
|
17242
|
+
* @property {string} reason - The reason why the swap failed.
|
|
17243
|
+
* @property {number} timestamp - The timestamp of the failed swap.
|
|
17244
|
+
*/
|
|
17245
|
+
type SwapFailed = {
|
|
17246
|
+
reason: string;
|
|
17247
|
+
timestamp: number;
|
|
17248
|
+
};
|
|
17249
|
+
/**
|
|
17250
|
+
* Type representing a Swap Widget with type REJECTED.
|
|
17251
|
+
* @property {string} reason - The reason why the swap failed.
|
|
17252
|
+
* @property {number} timestamp - The timestamp of the failed swap.
|
|
17253
|
+
*/
|
|
17254
|
+
type SwapRejected = {
|
|
17255
|
+
reason: string;
|
|
17256
|
+
timestamp: number;
|
|
17257
|
+
};
|
|
17258
|
+
|
|
17259
|
+
/**
|
|
17260
|
+
* Enum representing possible Sale Widget event types.
|
|
17261
|
+
*/
|
|
17262
|
+
declare enum SaleEventType {
|
|
17263
|
+
CLOSE_WIDGET = "close-widget",
|
|
17264
|
+
SUCCESS = "success",
|
|
17265
|
+
FAILURE = "failure",
|
|
17266
|
+
REJECTED = "rejected",
|
|
17267
|
+
TRANSACTION_SUCCESS = "transaction-success"
|
|
17268
|
+
}
|
|
17269
|
+
/**
|
|
17270
|
+
* Represents a successful Sale transaction.
|
|
17271
|
+
* @property {Array} transactions - The executed transactions
|
|
17272
|
+
*/
|
|
17273
|
+
type SaleSuccess = {
|
|
17274
|
+
transactions: {
|
|
17275
|
+
method: string;
|
|
17276
|
+
hash: string | undefined;
|
|
17277
|
+
}[];
|
|
17278
|
+
[key: string]: unknown;
|
|
17279
|
+
};
|
|
17280
|
+
/**
|
|
17281
|
+
* Type representing a Sale Widget with type FAILURE.
|
|
17282
|
+
* @property {string} reason - The reason why the swap failed.
|
|
17283
|
+
* @property {number} timestamp - The timestamp of the failed swap.
|
|
17284
|
+
* @property {Array} transactions - The executed transactions
|
|
17285
|
+
*/
|
|
17286
|
+
type SaleFailed = {
|
|
17287
|
+
reason: string;
|
|
17288
|
+
timestamp: number;
|
|
17289
|
+
transactions: {
|
|
17290
|
+
method: string;
|
|
17291
|
+
hash: string | undefined;
|
|
17292
|
+
}[];
|
|
17293
|
+
};
|
|
17294
|
+
/**
|
|
17295
|
+
* Type representing a Sale Widget with type TRANSACTION_SUCCESS.
|
|
17296
|
+
* @property {Object} transactions - The executed transactions
|
|
17297
|
+
*/
|
|
17298
|
+
type SaleTransactionSuccess = {
|
|
17299
|
+
transactions: {
|
|
17300
|
+
method: string;
|
|
17301
|
+
hash: string | undefined;
|
|
17302
|
+
}[];
|
|
17303
|
+
};
|
|
17304
|
+
|
|
17305
|
+
/**
|
|
17306
|
+
* Enum of possible Bridge Widget event types.
|
|
17307
|
+
*/
|
|
17308
|
+
declare enum BridgeEventType {
|
|
17309
|
+
CLOSE_WIDGET = "close-widget",
|
|
17310
|
+
SUCCESS = "success",
|
|
17311
|
+
FAILURE = "failure"
|
|
17312
|
+
}
|
|
17313
|
+
/**
|
|
17314
|
+
* Represents a successful bridge transaction.
|
|
17315
|
+
* @property {string} transactionHash - The hash of the successful transaction.
|
|
17316
|
+
*/
|
|
17317
|
+
type BridgeSuccess = {
|
|
17318
|
+
transactionHash: string;
|
|
17319
|
+
};
|
|
17320
|
+
/**
|
|
17321
|
+
* Represents a failed bridge transaction.
|
|
17322
|
+
* @property {string} reason - The reason for the failed transaction.
|
|
17323
|
+
* @property {number} timestamp - The timestamp of the failed transaction.
|
|
17324
|
+
*/
|
|
17325
|
+
type BridgeFailed = {
|
|
17326
|
+
reason: string;
|
|
17327
|
+
timestamp: number;
|
|
17328
|
+
};
|
|
17329
|
+
|
|
17330
|
+
/**
|
|
17331
|
+
* Enum representing different types of orchestration events.
|
|
17332
|
+
*/
|
|
17333
|
+
declare enum OrchestrationEventType {
|
|
17334
|
+
REQUEST_CONNECT = "request-connect",
|
|
17335
|
+
REQUEST_WALLET = "request-wallet",
|
|
17336
|
+
REQUEST_SWAP = "request-swap",
|
|
17337
|
+
REQUEST_BRIDGE = "request-bridge",
|
|
17338
|
+
REQUEST_ONRAMP = "request-onramp"
|
|
17339
|
+
}
|
|
17340
|
+
/**
|
|
17341
|
+
* Represents the connect event object when the connect widget is requested.
|
|
17342
|
+
* @property {string} walletProviderName - The wallet provider name.
|
|
17343
|
+
*/
|
|
17344
|
+
type RequestConnectEvent = {
|
|
17345
|
+
walletProviderName: string;
|
|
17346
|
+
};
|
|
17347
|
+
/**
|
|
17348
|
+
* Represents the wallet event object when the wallet widget is requested.
|
|
17349
|
+
* @property {string} walletProviderName - The wallet provider name.
|
|
17350
|
+
*/
|
|
17351
|
+
type RequestWalletEvent = {
|
|
17352
|
+
walletProviderName: string;
|
|
17353
|
+
};
|
|
17354
|
+
/**
|
|
17355
|
+
* Represents the swap event object when the swap widget is requested.
|
|
17356
|
+
* @property {string} fromTokenAddress - The address of the token to swap from.
|
|
17357
|
+
* @property {string} toTokenAddress - The address of the token to swap to.
|
|
17358
|
+
* @property {string} amount - The amount of from tokens to swap.
|
|
17359
|
+
*/
|
|
17360
|
+
type RequestSwapEvent = {
|
|
17361
|
+
fromTokenAddress: string;
|
|
17362
|
+
toTokenAddress: string;
|
|
17363
|
+
amount: string;
|
|
17364
|
+
};
|
|
17365
|
+
/**
|
|
17366
|
+
* Represents the bridge event object when the bridge widget is requested.
|
|
17367
|
+
* @property {string} tokenAddress - The address of the token to bridge.
|
|
17368
|
+
* @property {string} amount - The amount of tokens to bridge.
|
|
17369
|
+
*/
|
|
17370
|
+
type RequestBridgeEvent = {
|
|
17371
|
+
tokenAddress: string;
|
|
17372
|
+
amount: string;
|
|
17373
|
+
};
|
|
17374
|
+
/**
|
|
17375
|
+
* Represents the onramp event object when the onramp widget is requested.
|
|
17376
|
+
* @property {string} tokenAddress - The address of the token to be used for onramp.
|
|
17377
|
+
* @property {string} amount - The amount of tokens to onramp.
|
|
17378
|
+
*/
|
|
17379
|
+
type RequestOnrampEvent = {
|
|
17380
|
+
tokenAddress: string;
|
|
17381
|
+
amount: string;
|
|
17382
|
+
};
|
|
17383
|
+
type OrchestrationEventData = RequestConnectEvent | RequestWalletEvent | RequestSwapEvent | RequestBridgeEvent | RequestOnrampEvent;
|
|
17384
|
+
|
|
17385
|
+
/**
|
|
17386
|
+
* Enum of possible OnRamp Widget event types.
|
|
17387
|
+
*/
|
|
17388
|
+
declare enum OnRampEventType {
|
|
17389
|
+
CLOSE_WIDGET = "close-widget",
|
|
17390
|
+
SUCCESS = "success",
|
|
17391
|
+
FAILURE = "failure"
|
|
17392
|
+
}
|
|
17393
|
+
/**
|
|
17394
|
+
* Represents a successful on-ramp transaction.
|
|
17395
|
+
* @property {string} transactionHash - The transaction hash of the successful transaction.
|
|
17396
|
+
*/
|
|
17397
|
+
type OnRampSuccess = {
|
|
17398
|
+
transactionHash: string;
|
|
17399
|
+
};
|
|
17400
|
+
/**
|
|
17401
|
+
* Type representing a On-ramp Widget with type FAILURE.
|
|
17402
|
+
* @property {string} reason - The reason why the on-ramp failed.
|
|
17403
|
+
* @property {number} timestamp - The timestamp of the failed transaction.
|
|
17404
|
+
*/
|
|
17405
|
+
type OnRampFailed = {
|
|
17406
|
+
reason: string;
|
|
17407
|
+
timestamp: number;
|
|
17408
|
+
};
|
|
17409
|
+
|
|
17410
|
+
declare enum ConnectTargetLayer {
|
|
17411
|
+
LAYER1 = "LAYER1",
|
|
17412
|
+
LAYER2 = "LAYER2"
|
|
17413
|
+
}
|
|
17414
|
+
type ConnectWidgetParams = {};
|
|
17415
|
+
|
|
17416
|
+
/**
|
|
17417
|
+
* Bridge Widget parameters
|
|
17418
|
+
* @property {string | undefined} fromContractAddress - The contract address of the token to bridge from, used to populate the bridge form token field
|
|
17419
|
+
* @property {string | undefined} amount - The formatted amount to bridge, used to populate the bridge form amount field
|
|
17420
|
+
* @property {WalletProviderName | undefined} walletProviderName - The wallet provider name to use for the bridge widget
|
|
17421
|
+
*/
|
|
17422
|
+
type BridgeWidgetParams = {
|
|
17423
|
+
fromContractAddress?: string;
|
|
17424
|
+
amount?: string;
|
|
17425
|
+
walletProviderName?: WalletProviderName;
|
|
17426
|
+
};
|
|
17427
|
+
|
|
17428
|
+
/**
|
|
17429
|
+
* Wallet Widget parameters
|
|
17430
|
+
* @property {WalletProviderName | undefined} walletProviderName - The wallet provider name to use for the wallet widget
|
|
17431
|
+
* @property {Web3Provider | undefined} web3Provider - The ethers Web3Provider
|
|
17432
|
+
*/
|
|
17433
|
+
type WalletWidgetParams = {
|
|
17434
|
+
walletProviderName?: WalletProviderName;
|
|
17435
|
+
};
|
|
17436
|
+
|
|
17437
|
+
/**
|
|
17438
|
+
* Swap Widget parameters
|
|
17439
|
+
* @property {string | undefined} amount - The formatted amount to swap, used to populate the swap from amount field
|
|
17440
|
+
* @property {string | undefined} fromContractAddress - The contract address of the token to swap from
|
|
17441
|
+
* @property {string | undefined} toContractAddress - The contract address of the token to swap to
|
|
17442
|
+
* @property {WalletProviderName | undefined} walletProviderName - The wallet provider name to use for the swap widget
|
|
17443
|
+
*/
|
|
17444
|
+
interface SwapWidgetParams {
|
|
17445
|
+
amount?: string;
|
|
17446
|
+
fromContractAddress?: string;
|
|
17447
|
+
toContractAddress?: string;
|
|
17448
|
+
walletProviderName?: WalletProviderName;
|
|
17449
|
+
}
|
|
17450
|
+
|
|
17451
|
+
/**
|
|
17452
|
+
* OnRamp Widget parameters
|
|
17453
|
+
* @property {string | undefined} contractAddress - The contract address of the token to onramp
|
|
17454
|
+
* @property {string | undefined} amount - The formatted amount to onramp, used to populate the onramp form amount field
|
|
17455
|
+
* @property {WalletProviderName | undefined} walletProviderName - The wallet provider name to use for the onramp widget
|
|
17456
|
+
*/
|
|
17457
|
+
type OnRampWidgetParams = {
|
|
17458
|
+
contractAddress?: string;
|
|
17459
|
+
amount?: string;
|
|
17460
|
+
walletProviderName?: WalletProviderName;
|
|
17461
|
+
};
|
|
17462
|
+
|
|
17463
|
+
/**
|
|
17464
|
+
* Sale Widget parameters
|
|
17465
|
+
* @property {string} amount - The total price to pay for the items in the sale
|
|
17466
|
+
* @property {SaleItem[]} items - The list of products to be purchased
|
|
17467
|
+
* @property {WalletProviderName | undefined} walletProviderName - The wallet provider name to default to if no web3Provider is passed
|
|
17468
|
+
*/
|
|
17469
|
+
type SaleWidgetParams = {
|
|
17470
|
+
amount?: string;
|
|
17471
|
+
environmentId?: string;
|
|
17472
|
+
fromContractAddress?: string;
|
|
17473
|
+
items?: SaleItem[];
|
|
17474
|
+
walletProviderName?: WalletProviderName;
|
|
17475
|
+
};
|
|
17476
|
+
type SaleItem = {
|
|
17477
|
+
productId: string;
|
|
17478
|
+
qty: number;
|
|
17479
|
+
name: string;
|
|
17480
|
+
image: string;
|
|
17481
|
+
description: string;
|
|
17482
|
+
};
|
|
17483
|
+
|
|
17484
|
+
type ConnectWidgetConfiguration = {} & WidgetConfiguration;
|
|
17485
|
+
|
|
17486
|
+
type BridgeWidgetConfiguration = {} & WidgetConfiguration;
|
|
17487
|
+
|
|
17488
|
+
type WalletWidgetConfiguration = {} & WidgetConfiguration;
|
|
17489
|
+
|
|
17490
|
+
type SwapWidgetConfiguration = {} & WidgetConfiguration;
|
|
17491
|
+
|
|
17492
|
+
type OnrampWidgetConfiguration = {} & WidgetConfiguration;
|
|
17493
|
+
|
|
17494
|
+
type SaleWidgetConfiguration = {} & WidgetConfiguration;
|
|
17495
|
+
|
|
17496
|
+
/**
|
|
17497
|
+
* Enum representing the list of widget types.
|
|
17498
|
+
*/
|
|
17499
|
+
declare enum WidgetType {
|
|
17500
|
+
CONNECT = "connect",
|
|
17501
|
+
WALLET = "wallet",
|
|
17502
|
+
SWAP = "swap",
|
|
17503
|
+
BRIDGE = "bridge",
|
|
17504
|
+
ONRAMP = "onramp",
|
|
17505
|
+
SALE = "sale"
|
|
17506
|
+
}
|
|
17507
|
+
/**
|
|
17508
|
+
* Widget properties definition for each widget. Used for creating and updating widgets
|
|
17509
|
+
*/
|
|
17510
|
+
type WidgetProperties<T extends WidgetType> = {
|
|
17511
|
+
config?: WidgetConfigurations[T];
|
|
17512
|
+
provider?: Web3Provider;
|
|
17513
|
+
};
|
|
17514
|
+
type WidgetConfigurations = {
|
|
17515
|
+
[WidgetType.CONNECT]: ConnectWidgetConfiguration;
|
|
17516
|
+
[WidgetType.WALLET]: WalletWidgetConfiguration;
|
|
17517
|
+
[WidgetType.SWAP]: SwapWidgetConfiguration;
|
|
17518
|
+
[WidgetType.BRIDGE]: BridgeWidgetConfiguration;
|
|
17519
|
+
[WidgetType.ONRAMP]: OnrampWidgetConfiguration;
|
|
17520
|
+
[WidgetType.SALE]: SaleWidgetConfiguration;
|
|
17521
|
+
};
|
|
17522
|
+
type WidgetParameters = {
|
|
17523
|
+
[WidgetType.CONNECT]: ConnectWidgetParams;
|
|
17524
|
+
[WidgetType.WALLET]: WalletWidgetParams;
|
|
17525
|
+
[WidgetType.SWAP]: SwapWidgetParams;
|
|
17526
|
+
[WidgetType.BRIDGE]: BridgeWidgetParams;
|
|
17527
|
+
[WidgetType.ONRAMP]: OnRampWidgetParams;
|
|
17528
|
+
[WidgetType.SALE]: SaleWidgetParams;
|
|
17529
|
+
};
|
|
17530
|
+
/**
|
|
17531
|
+
* Represents all the possible event types that are emitted by the widgets.
|
|
17532
|
+
*/
|
|
17533
|
+
type WidgetEventTypes = {
|
|
17534
|
+
[WidgetType.CONNECT]: ConnectEventType | OrchestrationEventType;
|
|
17535
|
+
[WidgetType.WALLET]: WalletEventType | OrchestrationEventType;
|
|
17536
|
+
[WidgetType.SWAP]: SwapEventType | OrchestrationEventType;
|
|
17537
|
+
[WidgetType.BRIDGE]: BridgeEventType | OrchestrationEventType;
|
|
17538
|
+
[WidgetType.ONRAMP]: OnRampEventType | OrchestrationEventType;
|
|
17539
|
+
[WidgetType.SALE]: SaleEventType | OrchestrationEventType;
|
|
17540
|
+
};
|
|
17541
|
+
type OrchestrationMapping = {
|
|
17542
|
+
[OrchestrationEventType.REQUEST_CONNECT]: RequestConnectEvent;
|
|
17543
|
+
[OrchestrationEventType.REQUEST_WALLET]: RequestWalletEvent;
|
|
17544
|
+
[OrchestrationEventType.REQUEST_SWAP]: RequestSwapEvent;
|
|
17545
|
+
[OrchestrationEventType.REQUEST_BRIDGE]: RequestBridgeEvent;
|
|
17546
|
+
[OrchestrationEventType.REQUEST_ONRAMP]: RequestOnrampEvent;
|
|
17547
|
+
};
|
|
17548
|
+
type ProviderEventMapping = {
|
|
17549
|
+
[ProviderEventType.PROVIDER_UPDATED]: ProviderUpdated;
|
|
17550
|
+
};
|
|
17551
|
+
/**
|
|
17552
|
+
* Mapping of widget type, to each of it's events and then each event's payload
|
|
17553
|
+
* Update this whenever a new event is created and used by a widget
|
|
17554
|
+
* Each widget also has all of the orchestration events
|
|
17555
|
+
*/
|
|
17556
|
+
type WidgetEventData = {
|
|
17557
|
+
[WidgetType.CONNECT]: {
|
|
17558
|
+
[ConnectEventType.SUCCESS]: ConnectionSuccess;
|
|
17559
|
+
[ConnectEventType.FAILURE]: ConnectionFailed;
|
|
17560
|
+
[ConnectEventType.CLOSE_WIDGET]: {};
|
|
17561
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
17562
|
+
[WidgetType.WALLET]: {
|
|
17563
|
+
[WalletEventType.NETWORK_SWITCH]: WalletNetworkSwitch;
|
|
17564
|
+
[WalletEventType.DISCONNECT_WALLET]: WalletDisconnect;
|
|
17565
|
+
[WalletEventType.CLOSE_WIDGET]: {};
|
|
17566
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
17567
|
+
[WidgetType.SWAP]: {
|
|
17568
|
+
[SwapEventType.SUCCESS]: SwapSuccess;
|
|
17569
|
+
[SwapEventType.FAILURE]: SwapFailed;
|
|
17570
|
+
[SwapEventType.REJECTED]: SwapRejected;
|
|
17571
|
+
[SwapEventType.CLOSE_WIDGET]: {};
|
|
17572
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
17573
|
+
[WidgetType.BRIDGE]: {
|
|
17574
|
+
[BridgeEventType.SUCCESS]: BridgeSuccess;
|
|
17575
|
+
[BridgeEventType.FAILURE]: BridgeFailed;
|
|
17576
|
+
[BridgeEventType.CLOSE_WIDGET]: {};
|
|
17577
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
17578
|
+
[WidgetType.ONRAMP]: {
|
|
17579
|
+
[OnRampEventType.SUCCESS]: OnRampSuccess;
|
|
17580
|
+
[OnRampEventType.FAILURE]: OnRampFailed;
|
|
17581
|
+
[OnRampEventType.CLOSE_WIDGET]: {};
|
|
17582
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
17583
|
+
[WidgetType.SALE]: {
|
|
17584
|
+
[SaleEventType.SUCCESS]: SaleSuccess;
|
|
17585
|
+
[SaleEventType.FAILURE]: SaleFailed;
|
|
17586
|
+
[SaleEventType.REJECTED]: any;
|
|
17587
|
+
[SaleEventType.CLOSE_WIDGET]: {};
|
|
17588
|
+
[SaleEventType.TRANSACTION_SUCCESS]: SaleTransactionSuccess;
|
|
17589
|
+
} & OrchestrationMapping & ProviderEventMapping;
|
|
17590
|
+
};
|
|
17591
|
+
/**
|
|
17592
|
+
* Represents an event emitted by a widget. The event type should match the event data
|
|
17593
|
+
*/
|
|
17594
|
+
/**
|
|
17595
|
+
* Represents an event emitted by a widget.
|
|
17596
|
+
* @template T - The widget type
|
|
17597
|
+
* @template KEventName - The widget event name.
|
|
17598
|
+
* @property {KEventName} type - The type of the event.
|
|
17599
|
+
* @property {WidgetEventData[T][KEventName]} data - The data associated with the widget event.
|
|
17600
|
+
*/
|
|
17601
|
+
type WidgetEvent<T extends WidgetType, KEventName extends keyof WidgetEventData[T]> = {
|
|
17602
|
+
type: KEventName;
|
|
17603
|
+
data: WidgetEventData[T][KEventName];
|
|
17604
|
+
};
|
|
17605
|
+
/**
|
|
17606
|
+
* Represents an event emitted by a widget.
|
|
17607
|
+
* @template KEventName - The orchestration event name.
|
|
17608
|
+
* @property {KEventName} type - The type of the event.
|
|
17609
|
+
* @property {OrchestrationMapping[KEventName]} data - The data associated with the event.
|
|
17610
|
+
*/
|
|
17611
|
+
type OrchestrationEvent<KEventName extends keyof OrchestrationMapping> = {
|
|
17612
|
+
type: KEventName;
|
|
17613
|
+
data: OrchestrationMapping[KEventName];
|
|
17614
|
+
};
|
|
17615
|
+
/**
|
|
17616
|
+
* Represents an event emitted by a widget.
|
|
17617
|
+
* @template KEventName - The provider event name.
|
|
17618
|
+
* @property {KEventName} type - The type of the event.
|
|
17619
|
+
* @property {ProviderEventMapping[KEventName]} data - The data associated with the event.
|
|
17620
|
+
*/
|
|
17621
|
+
type ProviderEvent<KEventName extends keyof ProviderEventMapping> = {
|
|
17622
|
+
type: KEventName;
|
|
17623
|
+
data: ProviderEventMapping[KEventName];
|
|
17624
|
+
};
|
|
17625
|
+
interface IWidgetsFactory {
|
|
17626
|
+
/**
|
|
17627
|
+
* Create a new widget instance.
|
|
17628
|
+
* @param type widget type to instantiate.
|
|
17629
|
+
* @param props widget configurations and provider.
|
|
17630
|
+
*/
|
|
17631
|
+
create<T extends WidgetType>(type: T, props?: WidgetProperties<T>): Widget<T>;
|
|
17632
|
+
/**
|
|
17633
|
+
* Update the widgets provider instance.
|
|
17634
|
+
* @param provider provider instantiate.
|
|
17635
|
+
*/
|
|
17636
|
+
updateProvider(provider: Web3Provider): void;
|
|
17637
|
+
}
|
|
17638
|
+
/**
|
|
17639
|
+
* Widget interface. Every widget implements this interface.
|
|
17640
|
+
*/
|
|
17641
|
+
interface Widget<T extends WidgetType> {
|
|
17642
|
+
/**
|
|
17643
|
+
* Mount a widget to a DOM ref element.
|
|
17644
|
+
* @param id ID of the DOM element where the widget will be mounted.
|
|
17645
|
+
* @param params widget parameters.
|
|
17646
|
+
*/
|
|
17647
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
17648
|
+
/**
|
|
17649
|
+
* Unmount a widget and reset parameters
|
|
17650
|
+
*/
|
|
17651
|
+
unmount(): void;
|
|
17652
|
+
/**
|
|
17653
|
+
* Update the widget properties
|
|
17654
|
+
* @param props Widget specific properties including configuration
|
|
17655
|
+
*/
|
|
17656
|
+
update(props: WidgetProperties<T>): void;
|
|
17657
|
+
/**
|
|
17658
|
+
* Add a listener for a widget event.
|
|
17659
|
+
* @param event Widget specific event name.
|
|
17660
|
+
* @param callback function to execute when the event is received.
|
|
17661
|
+
*/
|
|
17662
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
17663
|
+
/**
|
|
17664
|
+
* Removes an event listener for a widget event.
|
|
17665
|
+
* @param type Widget specific event name.
|
|
17666
|
+
*/
|
|
17667
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
17668
|
+
}
|
|
17669
|
+
/**
|
|
17670
|
+
* Represents the version of the Checkout Widgets to use defaults to (0.1.9-alpha)
|
|
17671
|
+
* @property {number} major - The major version of the widgets, must specify a major version even if it is 0.
|
|
17672
|
+
* @property {number | undefined} minor - The minor version of the widgets, leaving this blank will use the latest minor based on major
|
|
17673
|
+
* @property {number | undefined} patch - The patch version of the widgets, leaving this blank will use the latest minor based on minor
|
|
17674
|
+
* @property {'alpha' | undefined} prerelease - The prerelease version of the widgets, can only be 'alpha'. Do not use in production.
|
|
17675
|
+
* @property {number | undefined} build - The build version of the widgets. Do not use in production.
|
|
17676
|
+
*
|
|
17677
|
+
* @example
|
|
17678
|
+
* { major: 0 } - use default version 0.1.9-alpha
|
|
17679
|
+
* { major: 1 } - use version 1.x.x, pickup all new minor and patch versions released
|
|
17680
|
+
* { major: 1, minor: 1 } - use version 1.1.x, pickup all new patch versions released
|
|
17681
|
+
* { major: 1, minor: 2, patch: 3 } - use version 1.2.3 specifically
|
|
17682
|
+
*/
|
|
17683
|
+
type SemanticVersion = {
|
|
17684
|
+
major: number;
|
|
17685
|
+
minor?: number;
|
|
17686
|
+
patch?: number;
|
|
17687
|
+
prerelease?: 'alpha';
|
|
17688
|
+
build?: number;
|
|
17689
|
+
};
|
|
17690
|
+
/**
|
|
17691
|
+
* Represents the global configuration options for the Checkout Widgets.
|
|
17692
|
+
* @property {WidgetTheme | undefined} theme - The theme of the Checkout Widget (default: "DARK")
|
|
17693
|
+
* @property {Environment | undefined} environment - The environment configuration (default: "SANDBOX")
|
|
17694
|
+
* @property {SemanticVersion | undefined} version - The version of the checkout widgets js file to use (default: "0.1.x")
|
|
17695
|
+
* @property {boolean | undefined} isOnRampEnabled - Enable on-ramp top-up method (default: "true")
|
|
17696
|
+
* @property {boolean | undefined} isSwapEnabled - Enable swap top-up method (default: "true")
|
|
17697
|
+
* @property {boolean | undefined} isBridgeEnabled - Enable bridge top-up method (default: "true")
|
|
17698
|
+
*/
|
|
17699
|
+
type CheckoutWidgetsConfig = {
|
|
17700
|
+
theme?: WidgetTheme;
|
|
17701
|
+
environment?: Environment;
|
|
17702
|
+
version?: SemanticVersion;
|
|
17703
|
+
isOnRampEnabled?: boolean;
|
|
17704
|
+
isSwapEnabled?: boolean;
|
|
17705
|
+
isBridgeEnabled?: boolean;
|
|
17706
|
+
};
|
|
17707
|
+
|
|
17708
|
+
/**
|
|
17709
|
+
* Represents the configuration options for instantiating the Checkout Widgets factory.
|
|
17710
|
+
* @property {WidgetConfiguration} config - global configuration options for the widgets.
|
|
17711
|
+
* @property {SemanticVersion | undefined} version - version of the Checkout widgets bundle (default latest version will be used).
|
|
17712
|
+
*/
|
|
17713
|
+
type WidgetsInit = {
|
|
17714
|
+
config: WidgetConfiguration;
|
|
17715
|
+
version?: SemanticVersion;
|
|
17716
|
+
};
|
|
17717
|
+
|
|
17718
|
+
declare class Checkout {
|
|
17719
|
+
private readOnlyProviders;
|
|
17720
|
+
readonly config: CheckoutConfiguration;
|
|
17721
|
+
readonly fiatRampService: FiatRampService;
|
|
17722
|
+
readonly availability: AvailabilityService;
|
|
17723
|
+
readonly passport?: Passport;
|
|
17724
|
+
/**
|
|
17725
|
+
* Constructs a new instance of the CheckoutModule class.
|
|
17726
|
+
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
17727
|
+
*/
|
|
17728
|
+
constructor(config?: CheckoutModuleConfiguration);
|
|
17729
|
+
/**
|
|
17730
|
+
* Loads the widgets bundle and initiate the widgets factory.
|
|
17731
|
+
* @param {WidgetsInit} init - The initialisation parameters for loading the widgets bundle and applying configuration
|
|
17732
|
+
*/
|
|
17733
|
+
widgets(init: WidgetsInit): Promise<ImmutableCheckoutWidgets.WidgetsFactory>;
|
|
17734
|
+
/**
|
|
17735
|
+
* Creates a provider using the given parameters.
|
|
17736
|
+
* @param {CreateProviderParams} params - The parameters for creating the provider.
|
|
17737
|
+
* @returns {Promise<CreateProviderResult>} A promise that resolves to the created provider.
|
|
17738
|
+
*/
|
|
17739
|
+
createProvider(params: CreateProviderParams): Promise<CreateProviderResult>;
|
|
17740
|
+
/**
|
|
17741
|
+
* Checks if a wallet is connected to the specified provider.
|
|
17742
|
+
* @param {CheckConnectionParams} params - The parameters for checking the wallet connection.
|
|
17743
|
+
* @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
|
|
17744
|
+
*/
|
|
17745
|
+
checkIsWalletConnected(params: CheckConnectionParams): Promise<CheckConnectionResult>;
|
|
17746
|
+
/**
|
|
17747
|
+
* Connects to a blockchain network using the specified provider.
|
|
17748
|
+
* @param {ConnectParams} params - The parameters for connecting to the network.
|
|
17749
|
+
* @returns {Promise<ConnectResult>} A promise that resolves to an object containing the provider and network information.
|
|
17750
|
+
* @throws {Error} If the provider is not valid or if there is an error connecting to the network.
|
|
17751
|
+
*/
|
|
17752
|
+
connect(params: ConnectParams): Promise<ConnectResult>;
|
|
17753
|
+
/**
|
|
17754
|
+
* Switches the network for the current wallet provider.
|
|
17755
|
+
* @param {SwitchNetworkParams} params - The parameters for switching the network.
|
|
17756
|
+
* @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
|
|
17757
|
+
*/
|
|
17758
|
+
switchNetwork(params: SwitchNetworkParams): Promise<SwitchNetworkResult>;
|
|
17759
|
+
/**
|
|
17760
|
+
* Retrieves the balance of a wallet address.
|
|
17761
|
+
* @param {GetBalanceParams} params - The parameters for retrieving the balance.
|
|
17762
|
+
* @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
|
|
17763
|
+
*/
|
|
17764
|
+
getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
|
|
17765
|
+
/**
|
|
17766
|
+
* Retrieves the balances of all tokens for a given wallet address on a specific chain.
|
|
17767
|
+
* @param {GetAllBalancesParams} params - The parameters for retrieving the balances.
|
|
17768
|
+
* @returns {Promise<GetAllBalancesResult>} - A promise that resolves to the result of retrieving the balances.
|
|
17769
|
+
*/
|
|
17770
|
+
getAllBalances(params: GetAllBalancesParams): Promise<GetAllBalancesResult>;
|
|
17771
|
+
/**
|
|
17772
|
+
* Retrieves the supported networks based on the provided parameters.
|
|
17773
|
+
* @param {GetNetworkAllowListParams} params - The parameters for retrieving the network allow list.
|
|
17774
|
+
* @returns {Promise<GetNetworkAllowListResult>} - A promise that resolves to the network allow list result.
|
|
17775
|
+
*/
|
|
17776
|
+
getNetworkAllowList(params: GetNetworkAllowListParams): Promise<GetNetworkAllowListResult>;
|
|
17777
|
+
/**
|
|
17778
|
+
* Retrieves the supported tokens based on the provided parameters.
|
|
17779
|
+
* @param {GetTokenAllowListParams} params - The parameters for retrieving the token allow list.
|
|
17780
|
+
* @returns {Promise<GetTokenAllowListResult>} - A promise that resolves to the token allow list result.
|
|
17781
|
+
*/
|
|
17782
|
+
getTokenAllowList(params: GetTokenAllowListParams): Promise<GetTokenAllowListResult>;
|
|
17783
|
+
/**
|
|
17784
|
+
* Retrieves the default supported wallets based on the provided parameters.
|
|
17785
|
+
* @param {GetWalletAllowListParams} params - The parameters for retrieving the wallet allow list.
|
|
17786
|
+
* @returns {Promise<GetWalletAllowListResult>} - A promise that resolves to the wallet allow list result.
|
|
17787
|
+
*/
|
|
17788
|
+
getWalletAllowList(params: GetWalletAllowListParams): Promise<GetWalletAllowListResult>;
|
|
17789
|
+
/**
|
|
17790
|
+
* Sends a transaction using the specified provider and transaction parameters.
|
|
17791
|
+
* @param {SendTransactionParams} params - The parameters for sending the transaction.
|
|
17792
|
+
* @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
|
|
17793
|
+
*/
|
|
17794
|
+
sendTransaction(params: SendTransactionParams): Promise<SendTransactionResult>;
|
|
17795
|
+
/**
|
|
17796
|
+
* Retrieves network information using the specified provider.
|
|
17797
|
+
* @param {GetNetworkParams} params - The parameters for retrieving network information.
|
|
17798
|
+
* @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
|
|
17799
|
+
*/
|
|
17800
|
+
getNetworkInfo(params: GetNetworkParams): Promise<NetworkInfo>;
|
|
17801
|
+
/**
|
|
17802
|
+
* Determines the requirements for performing a buy.
|
|
17803
|
+
* @param {BuyParams} params - The parameters for the buy.
|
|
17804
|
+
*/
|
|
17805
|
+
buy(params: BuyParams): Promise<BuyResult>;
|
|
17806
|
+
/**
|
|
17807
|
+
* Determines the requirements for performing a sell.
|
|
17808
|
+
* @param {SellParams} params - The parameters for the sell.
|
|
17809
|
+
* Only currently actions the first order in the array until we support batch processing.
|
|
17810
|
+
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
17811
|
+
*/
|
|
17812
|
+
sell(params: SellParams): Promise<SellResult>;
|
|
17813
|
+
/**
|
|
17814
|
+
* Cancels a sell.
|
|
17815
|
+
* @param {CancelParams} params - The parameters for the cancel.
|
|
17816
|
+
*/
|
|
17817
|
+
cancel(params: CancelParams): Promise<CancelResult>;
|
|
17818
|
+
/**
|
|
17819
|
+
* Determines the transaction requirements to complete a purchase.
|
|
17820
|
+
* @params {SmartCheckoutParams} params - The parameters for smart checkout.
|
|
17821
|
+
*/
|
|
17822
|
+
smartCheckout(params: SmartCheckoutParams): Promise<SmartCheckoutResult>;
|
|
17823
|
+
/**
|
|
17824
|
+
* Checks if the given object is a Web3 provider.
|
|
17825
|
+
* @param {Web3Provider} web3Provider - The object to check.
|
|
17826
|
+
* @returns {boolean} - True if the object is a Web3 provider, false otherwise.
|
|
17827
|
+
*/
|
|
17828
|
+
static isWeb3Provider(web3Provider: Web3Provider): boolean;
|
|
17829
|
+
/**
|
|
17830
|
+
* Estimates the gas required for a swap or bridge transaction.
|
|
17831
|
+
* @param {GasEstimateParams} params - The parameters for the gas estimation.
|
|
17832
|
+
* @returns {Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>} - A promise that resolves to the gas estimation result.
|
|
17833
|
+
*/
|
|
17834
|
+
gasEstimate(params: GasEstimateParams): Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>;
|
|
17835
|
+
/**
|
|
17836
|
+
* Creates and returns a URL for the fiat ramp widget.
|
|
17837
|
+
* @param {FiatRampParams} params - The parameters for creating the url.
|
|
17838
|
+
* @returns {Promise<string>} - A promise that resolves to a string url.
|
|
17839
|
+
*/
|
|
17840
|
+
createFiatRampUrl(params: FiatRampParams): Promise<string>;
|
|
17841
|
+
/**
|
|
17842
|
+
* Fetches fiat ramp fee estimations.
|
|
17843
|
+
* @returns {Promise<OnRampProviderFees>} - A promise that resolves to OnRampProviderFees.
|
|
17844
|
+
*/
|
|
17845
|
+
getExchangeFeeEstimate(): Promise<OnRampProviderFees>;
|
|
17846
|
+
/**
|
|
17847
|
+
* Fetches Swap widget availability.
|
|
17848
|
+
* @returns {Promise<boolean>} - A promise that resolves to a boolean.
|
|
17849
|
+
*/
|
|
17850
|
+
isSwapAvailable(): Promise<boolean>;
|
|
17851
|
+
}
|
|
17852
|
+
|
|
17853
|
+
/**
|
|
17854
|
+
* Declares global interfaces and namespaces for the application.
|
|
17855
|
+
* @global
|
|
17856
|
+
* @namespace ImmutableCheckoutWidgets
|
|
17857
|
+
* */
|
|
17858
|
+
declare global {
|
|
17859
|
+
namespace ImmutableCheckoutWidgets {
|
|
17860
|
+
class WidgetsFactory implements IWidgetsFactory {
|
|
17861
|
+
constructor(sdk: Checkout, config: CheckoutWidgetsConfig);
|
|
17862
|
+
create<T extends WidgetType>(type: T, props?: WidgetProperties<T>): Widget<T>;
|
|
17863
|
+
updateProvider(provider: Web3Provider): void;
|
|
17864
|
+
}
|
|
17865
|
+
class Connect<T extends WidgetType> implements Widget<T> {
|
|
17866
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
17867
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
17868
|
+
unmount(): void;
|
|
17869
|
+
update(props: WidgetProperties<T>): void;
|
|
17870
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
17871
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
17872
|
+
}
|
|
17873
|
+
class Bridge<T extends WidgetType> implements Widget<T> {
|
|
17874
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
17875
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
17876
|
+
unmount(): void;
|
|
17877
|
+
update(props: WidgetProperties<T>): void;
|
|
17878
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
17879
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
17880
|
+
}
|
|
17881
|
+
class Wallet<T extends WidgetType> implements Widget<T> {
|
|
17882
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
17883
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
17884
|
+
unmount(): void;
|
|
17885
|
+
update(props: WidgetProperties<T>): void;
|
|
17886
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
17887
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
17888
|
+
}
|
|
17889
|
+
class Swap<T extends WidgetType> implements Widget<T> {
|
|
17890
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
17891
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
17892
|
+
unmount(): void;
|
|
17893
|
+
update(props: WidgetProperties<T>): void;
|
|
17894
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
17895
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
17896
|
+
}
|
|
17897
|
+
class OnRamp<T extends WidgetType> implements Widget<T> {
|
|
17898
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
17899
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
17900
|
+
unmount(): void;
|
|
17901
|
+
update(props: WidgetProperties<T>): void;
|
|
17902
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
17903
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
17904
|
+
}
|
|
17905
|
+
class Sale<T extends WidgetType> implements Widget<T> {
|
|
17906
|
+
constructor(sdk: Checkout, props: WidgetProperties<T>);
|
|
17907
|
+
mount(id: string, params?: WidgetParameters[T]): void;
|
|
17908
|
+
unmount(): void;
|
|
17909
|
+
update(props: WidgetProperties<T>): void;
|
|
17910
|
+
addListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void;
|
|
17911
|
+
removeListener<KEventName extends keyof WidgetEventData[T]>(type: KEventName): void;
|
|
17912
|
+
}
|
|
17913
|
+
}
|
|
17914
|
+
}
|
|
17915
|
+
|
|
17916
|
+
/**
|
|
17917
|
+
* Enum representing different types of errors that can occur during the checkout process.
|
|
17918
|
+
*/
|
|
17919
|
+
declare enum CheckoutErrorType {
|
|
17920
|
+
WEB3_PROVIDER_ERROR = "WEB3_PROVIDER_ERROR",
|
|
17921
|
+
PROVIDER_ERROR = "PROVIDER_ERROR",
|
|
17922
|
+
DEFAULT_PROVIDER_ERROR = "DEFAULT_PROVIDER_ERROR",
|
|
17923
|
+
CONNECT_PROVIDER_ERROR = "CONNECT_PROVIDER_ERROR",
|
|
17924
|
+
GET_BALANCE_ERROR = "GET_BALANCE_ERROR",
|
|
17925
|
+
GET_INDEXER_BALANCE_ERROR = "GET_INDEXER_BALANCE_ERROR",
|
|
17926
|
+
GET_ERC20_BALANCE_ERROR = "GET_ERC20_BALANCE_ERROR",
|
|
17927
|
+
GET_ERC721_BALANCE_ERROR = "GET_ERC721_BALANCE_ERROR",
|
|
17928
|
+
GET_NETWORK_INFO_ERROR = "GET_NETWORK_INFO_ERROR",
|
|
17929
|
+
METAMASK_PROVIDER_ERROR = "METAMASK_PROVIDER_ERROR",
|
|
17930
|
+
CHAIN_NOT_SUPPORTED_ERROR = "CHAIN_NOT_SUPPORTED_ERROR",
|
|
17931
|
+
PROVIDER_REQUEST_MISSING_ERROR = "PROVIDER_REQUEST_MISSING_ERROR",
|
|
17932
|
+
PROVIDER_REQUEST_FAILED_ERROR = "PROVIDER_REQUEST_FAILED_ERROR",
|
|
17933
|
+
USER_REJECTED_REQUEST_ERROR = "USER_REJECTED_REQUEST_ERROR",
|
|
17934
|
+
TRANSACTION_FAILED = "TRANSACTION_FAILED",
|
|
17935
|
+
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
|
|
17936
|
+
UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT",
|
|
17937
|
+
INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE",
|
|
17938
|
+
UNSUPPORTED_TOKEN_TYPE_ERROR = "UNSUPPORTED_TOKEN_TYPE_ERROR",
|
|
17939
|
+
UNSUPPORTED_BALANCE_REQUIREMENT_ERROR = "UNSUPPORTED_BALANCE_REQUIREMENT_ERROR",
|
|
17940
|
+
GET_ORDER_LISTING_ERROR = "GET_ORDER_LISTING_ERROR",
|
|
17941
|
+
CANCEL_ORDER_LISTING_ERROR = "CANCEL_ORDER_LISTING_ERROR",
|
|
17942
|
+
PREPARE_ORDER_LISTING_ERROR = "PREPARE_ORDER_LISTING_ERROR",
|
|
17943
|
+
CREATE_ORDER_LISTING_ERROR = "CREATE_ORDER_LISTING_ERROR",
|
|
17944
|
+
FULFILL_ORDER_LISTING_ERROR = "FULFILL_ORDER_LISTING_ERROR",
|
|
17945
|
+
SWITCH_NETWORK_UNSUPPORTED = "SWITCH_NETWORK_UNSUPPORTED",
|
|
17946
|
+
GET_ERC20_ALLOWANCE_ERROR = "GET_ERC20_ALLOWANCE_ERROR",
|
|
17947
|
+
GET_ERC721_ALLOWANCE_ERROR = "GET_ERC721_ALLOWANCE_ERROR",
|
|
17948
|
+
EXECUTE_APPROVAL_TRANSACTION_ERROR = "EXECUTE_APPROVAL_TRANSACTION_ERROR",
|
|
17949
|
+
EXECUTE_FULFILLMENT_TRANSACTION_ERROR = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR",
|
|
17950
|
+
SIGN_MESSAGE_ERROR = "SIGN_MESSAGE_ERROR",
|
|
17951
|
+
BRIDGE_GAS_ESTIMATE_ERROR = "BRIDGE_GAS_ESTIMATE_ERROR",
|
|
17952
|
+
ORDER_FEE_ERROR = "ORDER_FEE_ERROR",
|
|
17953
|
+
ITEM_REQUIREMENTS_ERROR = "ITEM_REQUIREMENTS_ERROR",
|
|
17954
|
+
API_ERROR = "API_ERROR",
|
|
17955
|
+
ORDER_EXPIRED_ERROR = "ORDER_EXPIRED_ERROR",
|
|
17956
|
+
WIDGETS_SCRIPT_LOAD_ERROR = "WIDGETS_SCRIPT_LOAD_ERROR"
|
|
17957
|
+
}
|
|
17958
|
+
/**
|
|
17959
|
+
* Represents an error object with a specific type, optional message, and optional data.
|
|
17960
|
+
* @property {CheckoutErrorType} type - The type of the error.
|
|
17961
|
+
* @property {string | undefined} [message] - The error message.
|
|
17962
|
+
* @property {Object.<string, string> | undefined} [data] - Additional data associated with the error.
|
|
17963
|
+
*/
|
|
17964
|
+
type ErrorType = {
|
|
17965
|
+
type: CheckoutErrorType;
|
|
17966
|
+
message?: string;
|
|
17967
|
+
data?: {
|
|
17968
|
+
[key: string]: string;
|
|
17969
|
+
};
|
|
17970
|
+
};
|
|
17971
|
+
|
|
17972
|
+
type checkout_sdk_d_AllowedNetworkConfig = AllowedNetworkConfig;
|
|
17973
|
+
type checkout_sdk_d_AvailableRoutingOptions = AvailableRoutingOptions;
|
|
17974
|
+
type checkout_sdk_d_BalanceDelta = BalanceDelta;
|
|
17975
|
+
type checkout_sdk_d_BridgeEventType = BridgeEventType;
|
|
17976
|
+
declare const checkout_sdk_d_BridgeEventType: typeof BridgeEventType;
|
|
17977
|
+
type checkout_sdk_d_BridgeFailed = BridgeFailed;
|
|
17978
|
+
type checkout_sdk_d_BridgeFundingStep = BridgeFundingStep;
|
|
17979
|
+
type checkout_sdk_d_BridgeSuccess = BridgeSuccess;
|
|
17980
|
+
type checkout_sdk_d_BridgeWidgetConfiguration = BridgeWidgetConfiguration;
|
|
17981
|
+
type checkout_sdk_d_BridgeWidgetParams = BridgeWidgetParams;
|
|
17982
|
+
type checkout_sdk_d_BuyOrder = BuyOrder;
|
|
17983
|
+
type checkout_sdk_d_BuyParams = BuyParams;
|
|
17984
|
+
type checkout_sdk_d_BuyResult = BuyResult;
|
|
17985
|
+
type checkout_sdk_d_BuyResultFailed = BuyResultFailed;
|
|
17986
|
+
type checkout_sdk_d_BuyResultInsufficientFunds = BuyResultInsufficientFunds;
|
|
17987
|
+
type checkout_sdk_d_BuyResultSuccess = BuyResultSuccess;
|
|
17988
|
+
type checkout_sdk_d_BuyToken = BuyToken;
|
|
17989
|
+
declare const checkout_sdk_d_CHECKOUT_API_BASE_URL: typeof CHECKOUT_API_BASE_URL;
|
|
17990
|
+
type checkout_sdk_d_CancelParams = CancelParams;
|
|
17991
|
+
type checkout_sdk_d_CancelResult = CancelResult;
|
|
17992
|
+
type checkout_sdk_d_CancelResultFailed = CancelResultFailed;
|
|
17993
|
+
type checkout_sdk_d_CancelResultSuccess = CancelResultSuccess;
|
|
17994
|
+
type checkout_sdk_d_ChainId = ChainId;
|
|
17995
|
+
declare const checkout_sdk_d_ChainId: typeof ChainId;
|
|
17996
|
+
type checkout_sdk_d_ChainName = ChainName;
|
|
17997
|
+
declare const checkout_sdk_d_ChainName: typeof ChainName;
|
|
17998
|
+
type checkout_sdk_d_CheckConnectionParams = CheckConnectionParams;
|
|
17999
|
+
type checkout_sdk_d_CheckConnectionResult = CheckConnectionResult;
|
|
18000
|
+
type checkout_sdk_d_Checkout = Checkout;
|
|
18001
|
+
declare const checkout_sdk_d_Checkout: typeof Checkout;
|
|
18002
|
+
type checkout_sdk_d_CheckoutConfiguration = CheckoutConfiguration;
|
|
18003
|
+
declare const checkout_sdk_d_CheckoutConfiguration: typeof CheckoutConfiguration;
|
|
18004
|
+
type checkout_sdk_d_CheckoutErrorType = CheckoutErrorType;
|
|
18005
|
+
declare const checkout_sdk_d_CheckoutErrorType: typeof CheckoutErrorType;
|
|
18006
|
+
type checkout_sdk_d_CheckoutModuleConfiguration = CheckoutModuleConfiguration;
|
|
18007
|
+
type checkout_sdk_d_CheckoutStatus = CheckoutStatus;
|
|
18008
|
+
declare const checkout_sdk_d_CheckoutStatus: typeof CheckoutStatus;
|
|
18009
|
+
type checkout_sdk_d_CheckoutWidgetsConfig = CheckoutWidgetsConfig;
|
|
18010
|
+
type checkout_sdk_d_ConnectEventType = ConnectEventType;
|
|
18011
|
+
declare const checkout_sdk_d_ConnectEventType: typeof ConnectEventType;
|
|
18012
|
+
type checkout_sdk_d_ConnectParams = ConnectParams;
|
|
18013
|
+
type checkout_sdk_d_ConnectResult = ConnectResult;
|
|
18014
|
+
type checkout_sdk_d_ConnectTargetLayer = ConnectTargetLayer;
|
|
18015
|
+
declare const checkout_sdk_d_ConnectTargetLayer: typeof ConnectTargetLayer;
|
|
18016
|
+
type checkout_sdk_d_ConnectWidgetConfiguration = ConnectWidgetConfiguration;
|
|
18017
|
+
type checkout_sdk_d_ConnectWidgetParams = ConnectWidgetParams;
|
|
18018
|
+
type checkout_sdk_d_ConnectionFailed = ConnectionFailed;
|
|
18019
|
+
type checkout_sdk_d_ConnectionSuccess = ConnectionSuccess;
|
|
18020
|
+
type checkout_sdk_d_DexConfig = DexConfig;
|
|
18021
|
+
type checkout_sdk_d_ERC20ItemRequirement = ERC20ItemRequirement;
|
|
18022
|
+
type checkout_sdk_d_ERC721Balance = ERC721Balance;
|
|
18023
|
+
type checkout_sdk_d_ERC721ItemRequirement = ERC721ItemRequirement;
|
|
18024
|
+
type checkout_sdk_d_ErrorType = ErrorType;
|
|
18025
|
+
type checkout_sdk_d_ExchangeType = ExchangeType;
|
|
18026
|
+
declare const checkout_sdk_d_ExchangeType: typeof ExchangeType;
|
|
18027
|
+
type checkout_sdk_d_Fee = Fee;
|
|
18028
|
+
type checkout_sdk_d_FeePercentage = FeePercentage;
|
|
18029
|
+
type checkout_sdk_d_FeeToken = FeeToken;
|
|
18030
|
+
type checkout_sdk_d_FiatRampParams = FiatRampParams;
|
|
18031
|
+
type checkout_sdk_d_FulfillmentTransaction = FulfillmentTransaction;
|
|
18032
|
+
type checkout_sdk_d_FundingItem = FundingItem;
|
|
18033
|
+
type checkout_sdk_d_FundingRoute = FundingRoute;
|
|
18034
|
+
type checkout_sdk_d_FundingStep = FundingStep;
|
|
18035
|
+
type checkout_sdk_d_FundingStepType = FundingStepType;
|
|
18036
|
+
declare const checkout_sdk_d_FundingStepType: typeof FundingStepType;
|
|
18037
|
+
type checkout_sdk_d_GasAmount = GasAmount;
|
|
18038
|
+
type checkout_sdk_d_GasEstimateBridgeToL2Result = GasEstimateBridgeToL2Result;
|
|
18039
|
+
type checkout_sdk_d_GasEstimateParams = GasEstimateParams;
|
|
18040
|
+
type checkout_sdk_d_GasEstimateSwapResult = GasEstimateSwapResult;
|
|
18041
|
+
type checkout_sdk_d_GasEstimateTokenConfig = GasEstimateTokenConfig;
|
|
18042
|
+
type checkout_sdk_d_GasEstimateType = GasEstimateType;
|
|
18043
|
+
declare const checkout_sdk_d_GasEstimateType: typeof GasEstimateType;
|
|
18044
|
+
type checkout_sdk_d_GasToken = GasToken;
|
|
18045
|
+
type checkout_sdk_d_GasTokenType = GasTokenType;
|
|
18046
|
+
declare const checkout_sdk_d_GasTokenType: typeof GasTokenType;
|
|
18047
|
+
type checkout_sdk_d_GetAllBalancesParams = GetAllBalancesParams;
|
|
18048
|
+
type checkout_sdk_d_GetAllBalancesResult = GetAllBalancesResult;
|
|
18049
|
+
type checkout_sdk_d_GetBalanceParams = GetBalanceParams;
|
|
18050
|
+
type checkout_sdk_d_GetBalanceResult = GetBalanceResult;
|
|
18051
|
+
type checkout_sdk_d_GetNetworkAllowListParams = GetNetworkAllowListParams;
|
|
18052
|
+
type checkout_sdk_d_GetNetworkAllowListResult = GetNetworkAllowListResult;
|
|
18053
|
+
type checkout_sdk_d_GetNetworkParams = GetNetworkParams;
|
|
18054
|
+
type checkout_sdk_d_GetTokenAllowListParams = GetTokenAllowListParams;
|
|
18055
|
+
type checkout_sdk_d_GetTokenAllowListResult = GetTokenAllowListResult;
|
|
18056
|
+
type checkout_sdk_d_GetWalletAllowListParams = GetWalletAllowListParams;
|
|
18057
|
+
type checkout_sdk_d_GetWalletAllowListResult = GetWalletAllowListResult;
|
|
18058
|
+
type checkout_sdk_d_IMTBLWidgetEvents = IMTBLWidgetEvents;
|
|
18059
|
+
declare const checkout_sdk_d_IMTBLWidgetEvents: typeof IMTBLWidgetEvents;
|
|
18060
|
+
type checkout_sdk_d_IWidgetsFactory = IWidgetsFactory;
|
|
18061
|
+
type checkout_sdk_d_ItemBalance = ItemBalance;
|
|
18062
|
+
type checkout_sdk_d_ItemType = ItemType;
|
|
18063
|
+
declare const checkout_sdk_d_ItemType: typeof ItemType;
|
|
18064
|
+
type checkout_sdk_d_NativeItemRequirement = NativeItemRequirement;
|
|
18065
|
+
type checkout_sdk_d_NetworkFilter = NetworkFilter;
|
|
18066
|
+
type checkout_sdk_d_NetworkFilterTypes = NetworkFilterTypes;
|
|
18067
|
+
declare const checkout_sdk_d_NetworkFilterTypes: typeof NetworkFilterTypes;
|
|
18068
|
+
type checkout_sdk_d_NetworkInfo = NetworkInfo;
|
|
18069
|
+
type checkout_sdk_d_NoRouteOptions = NoRouteOptions;
|
|
18070
|
+
type checkout_sdk_d_NoRoutesFound = NoRoutesFound;
|
|
18071
|
+
type checkout_sdk_d_OnRampEventType = OnRampEventType;
|
|
18072
|
+
declare const checkout_sdk_d_OnRampEventType: typeof OnRampEventType;
|
|
18073
|
+
type checkout_sdk_d_OnRampFailed = OnRampFailed;
|
|
18074
|
+
type checkout_sdk_d_OnRampFundingStep = OnRampFundingStep;
|
|
18075
|
+
type checkout_sdk_d_OnRampProviderFees = OnRampProviderFees;
|
|
18076
|
+
type checkout_sdk_d_OnRampSuccess = OnRampSuccess;
|
|
18077
|
+
type checkout_sdk_d_OnRampWidgetParams = OnRampWidgetParams;
|
|
18078
|
+
type checkout_sdk_d_OnrampWidgetConfiguration = OnrampWidgetConfiguration;
|
|
18079
|
+
type checkout_sdk_d_OrchestrationEvent<KEventName extends keyof OrchestrationMapping> = OrchestrationEvent<KEventName>;
|
|
18080
|
+
type checkout_sdk_d_OrchestrationEventData = OrchestrationEventData;
|
|
18081
|
+
type checkout_sdk_d_OrchestrationEventType = OrchestrationEventType;
|
|
18082
|
+
declare const checkout_sdk_d_OrchestrationEventType: typeof OrchestrationEventType;
|
|
18083
|
+
type checkout_sdk_d_OrderFee = OrderFee;
|
|
18084
|
+
type checkout_sdk_d_ProviderEvent<KEventName extends keyof ProviderEventMapping> = ProviderEvent<KEventName>;
|
|
18085
|
+
type checkout_sdk_d_ProviderEventType = ProviderEventType;
|
|
18086
|
+
declare const checkout_sdk_d_ProviderEventType: typeof ProviderEventType;
|
|
18087
|
+
type checkout_sdk_d_ProviderUpdated = ProviderUpdated;
|
|
18088
|
+
type checkout_sdk_d_RemoteConfiguration = RemoteConfiguration;
|
|
18089
|
+
type checkout_sdk_d_RequestBridgeEvent = RequestBridgeEvent;
|
|
18090
|
+
type checkout_sdk_d_RequestConnectEvent = RequestConnectEvent;
|
|
18091
|
+
type checkout_sdk_d_RequestOnrampEvent = RequestOnrampEvent;
|
|
18092
|
+
type checkout_sdk_d_RequestSwapEvent = RequestSwapEvent;
|
|
18093
|
+
type checkout_sdk_d_RequestWalletEvent = RequestWalletEvent;
|
|
18094
|
+
type checkout_sdk_d_RoutesFound = RoutesFound;
|
|
18095
|
+
type checkout_sdk_d_RoutingOutcome = RoutingOutcome;
|
|
18096
|
+
type checkout_sdk_d_RoutingOutcomeType = RoutingOutcomeType;
|
|
18097
|
+
declare const checkout_sdk_d_RoutingOutcomeType: typeof RoutingOutcomeType;
|
|
18098
|
+
type checkout_sdk_d_SaleEventType = SaleEventType;
|
|
18099
|
+
declare const checkout_sdk_d_SaleEventType: typeof SaleEventType;
|
|
18100
|
+
type checkout_sdk_d_SaleFailed = SaleFailed;
|
|
18101
|
+
type checkout_sdk_d_SaleItem = SaleItem;
|
|
18102
|
+
type checkout_sdk_d_SaleSuccess = SaleSuccess;
|
|
18103
|
+
type checkout_sdk_d_SaleTransactionSuccess = SaleTransactionSuccess;
|
|
18104
|
+
type checkout_sdk_d_SaleWidgetConfiguration = SaleWidgetConfiguration;
|
|
18105
|
+
type checkout_sdk_d_SaleWidgetParams = SaleWidgetParams;
|
|
18106
|
+
type checkout_sdk_d_SellOrder = SellOrder;
|
|
18107
|
+
type checkout_sdk_d_SellParams = SellParams;
|
|
18108
|
+
type checkout_sdk_d_SellResult = SellResult;
|
|
18109
|
+
type checkout_sdk_d_SellResultFailed = SellResultFailed;
|
|
18110
|
+
type checkout_sdk_d_SellResultInsufficientFunds = SellResultInsufficientFunds;
|
|
18111
|
+
type checkout_sdk_d_SellResultSuccess = SellResultSuccess;
|
|
18112
|
+
type checkout_sdk_d_SellToken = SellToken;
|
|
18113
|
+
type checkout_sdk_d_SemanticVersion = SemanticVersion;
|
|
18114
|
+
type checkout_sdk_d_SendTransactionParams = SendTransactionParams;
|
|
18115
|
+
type checkout_sdk_d_SendTransactionResult = SendTransactionResult;
|
|
18116
|
+
type checkout_sdk_d_SmartCheckoutInsufficient = SmartCheckoutInsufficient;
|
|
18117
|
+
type checkout_sdk_d_SmartCheckoutParams = SmartCheckoutParams;
|
|
18118
|
+
type checkout_sdk_d_SmartCheckoutResult = SmartCheckoutResult;
|
|
18119
|
+
type checkout_sdk_d_SmartCheckoutRouter = SmartCheckoutRouter;
|
|
18120
|
+
type checkout_sdk_d_SmartCheckoutSufficient = SmartCheckoutSufficient;
|
|
18121
|
+
type checkout_sdk_d_SwapEventType = SwapEventType;
|
|
18122
|
+
declare const checkout_sdk_d_SwapEventType: typeof SwapEventType;
|
|
18123
|
+
type checkout_sdk_d_SwapFailed = SwapFailed;
|
|
18124
|
+
type checkout_sdk_d_SwapFundingStep = SwapFundingStep;
|
|
18125
|
+
type checkout_sdk_d_SwapRejected = SwapRejected;
|
|
18126
|
+
type checkout_sdk_d_SwapSuccess = SwapSuccess;
|
|
18127
|
+
type checkout_sdk_d_SwapWidgetConfiguration = SwapWidgetConfiguration;
|
|
18128
|
+
type checkout_sdk_d_SwapWidgetParams = SwapWidgetParams;
|
|
18129
|
+
type checkout_sdk_d_SwitchNetworkParams = SwitchNetworkParams;
|
|
18130
|
+
type checkout_sdk_d_SwitchNetworkResult = SwitchNetworkResult;
|
|
18131
|
+
type checkout_sdk_d_TokenAmountEstimate = TokenAmountEstimate;
|
|
18132
|
+
type checkout_sdk_d_TokenBalance = TokenBalance;
|
|
18133
|
+
type checkout_sdk_d_TokenFilter = TokenFilter;
|
|
18134
|
+
type checkout_sdk_d_TokenFilterTypes = TokenFilterTypes;
|
|
18135
|
+
declare const checkout_sdk_d_TokenFilterTypes: typeof TokenFilterTypes;
|
|
18136
|
+
type checkout_sdk_d_TokenInfo = TokenInfo;
|
|
18137
|
+
type checkout_sdk_d_TransactionOrGasType = TransactionOrGasType;
|
|
18138
|
+
declare const checkout_sdk_d_TransactionOrGasType: typeof TransactionOrGasType;
|
|
18139
|
+
type checkout_sdk_d_TransactionRequirement = TransactionRequirement;
|
|
18140
|
+
type checkout_sdk_d_WalletDisconnect = WalletDisconnect;
|
|
18141
|
+
type checkout_sdk_d_WalletEventType = WalletEventType;
|
|
18142
|
+
declare const checkout_sdk_d_WalletEventType: typeof WalletEventType;
|
|
18143
|
+
type checkout_sdk_d_WalletFilter = WalletFilter;
|
|
18144
|
+
type checkout_sdk_d_WalletFilterTypes = WalletFilterTypes;
|
|
18145
|
+
declare const checkout_sdk_d_WalletFilterTypes: typeof WalletFilterTypes;
|
|
18146
|
+
type checkout_sdk_d_WalletInfo = WalletInfo;
|
|
18147
|
+
type checkout_sdk_d_WalletNetworkSwitch = WalletNetworkSwitch;
|
|
18148
|
+
type checkout_sdk_d_WalletProviderName = WalletProviderName;
|
|
18149
|
+
declare const checkout_sdk_d_WalletProviderName: typeof WalletProviderName;
|
|
18150
|
+
type checkout_sdk_d_WalletWidgetConfiguration = WalletWidgetConfiguration;
|
|
18151
|
+
type checkout_sdk_d_WalletWidgetParams = WalletWidgetParams;
|
|
18152
|
+
type checkout_sdk_d_Widget<T extends WidgetType> = Widget<T>;
|
|
18153
|
+
type checkout_sdk_d_WidgetConfiguration = WidgetConfiguration;
|
|
18154
|
+
type checkout_sdk_d_WidgetConfigurations = WidgetConfigurations;
|
|
18155
|
+
type checkout_sdk_d_WidgetEvent<T extends WidgetType, KEventName extends keyof WidgetEventData[T]> = WidgetEvent<T, KEventName>;
|
|
18156
|
+
type checkout_sdk_d_WidgetEventData = WidgetEventData;
|
|
18157
|
+
type checkout_sdk_d_WidgetEventTypes = WidgetEventTypes;
|
|
18158
|
+
type checkout_sdk_d_WidgetParameters = WidgetParameters;
|
|
18159
|
+
type checkout_sdk_d_WidgetProperties<T extends WidgetType> = WidgetProperties<T>;
|
|
18160
|
+
type checkout_sdk_d_WidgetTheme = WidgetTheme;
|
|
18161
|
+
declare const checkout_sdk_d_WidgetTheme: typeof WidgetTheme;
|
|
18162
|
+
type checkout_sdk_d_WidgetType = WidgetType;
|
|
18163
|
+
declare const checkout_sdk_d_WidgetType: typeof WidgetType;
|
|
18164
|
+
declare namespace checkout_sdk_d {
|
|
18165
|
+
export {
|
|
18166
|
+
checkout_sdk_d_AllowedNetworkConfig as AllowedNetworkConfig,
|
|
18167
|
+
checkout_sdk_d_AvailableRoutingOptions as AvailableRoutingOptions,
|
|
18168
|
+
checkout_sdk_d_BalanceDelta as BalanceDelta,
|
|
18169
|
+
checkout_sdk_d_BridgeEventType as BridgeEventType,
|
|
18170
|
+
checkout_sdk_d_BridgeFailed as BridgeFailed,
|
|
18171
|
+
checkout_sdk_d_BridgeFundingStep as BridgeFundingStep,
|
|
18172
|
+
checkout_sdk_d_BridgeSuccess as BridgeSuccess,
|
|
18173
|
+
checkout_sdk_d_BridgeWidgetConfiguration as BridgeWidgetConfiguration,
|
|
18174
|
+
checkout_sdk_d_BridgeWidgetParams as BridgeWidgetParams,
|
|
18175
|
+
checkout_sdk_d_BuyOrder as BuyOrder,
|
|
18176
|
+
checkout_sdk_d_BuyParams as BuyParams,
|
|
18177
|
+
checkout_sdk_d_BuyResult as BuyResult,
|
|
18178
|
+
checkout_sdk_d_BuyResultFailed as BuyResultFailed,
|
|
18179
|
+
checkout_sdk_d_BuyResultInsufficientFunds as BuyResultInsufficientFunds,
|
|
18180
|
+
checkout_sdk_d_BuyResultSuccess as BuyResultSuccess,
|
|
18181
|
+
checkout_sdk_d_BuyToken as BuyToken,
|
|
18182
|
+
checkout_sdk_d_CHECKOUT_API_BASE_URL as CHECKOUT_API_BASE_URL,
|
|
18183
|
+
checkout_sdk_d_CancelParams as CancelParams,
|
|
18184
|
+
checkout_sdk_d_CancelResult as CancelResult,
|
|
18185
|
+
checkout_sdk_d_CancelResultFailed as CancelResultFailed,
|
|
18186
|
+
checkout_sdk_d_CancelResultSuccess as CancelResultSuccess,
|
|
18187
|
+
checkout_sdk_d_ChainId as ChainId,
|
|
18188
|
+
checkout_sdk_d_ChainName as ChainName,
|
|
18189
|
+
checkout_sdk_d_CheckConnectionParams as CheckConnectionParams,
|
|
18190
|
+
checkout_sdk_d_CheckConnectionResult as CheckConnectionResult,
|
|
18191
|
+
checkout_sdk_d_Checkout as Checkout,
|
|
18192
|
+
checkout_sdk_d_CheckoutConfiguration as CheckoutConfiguration,
|
|
18193
|
+
checkout_sdk_d_CheckoutErrorType as CheckoutErrorType,
|
|
18194
|
+
checkout_sdk_d_CheckoutModuleConfiguration as CheckoutModuleConfiguration,
|
|
18195
|
+
checkout_sdk_d_CheckoutStatus as CheckoutStatus,
|
|
18196
|
+
checkout_sdk_d_CheckoutWidgetsConfig as CheckoutWidgetsConfig,
|
|
18197
|
+
checkout_sdk_d_ConnectEventType as ConnectEventType,
|
|
18198
|
+
checkout_sdk_d_ConnectParams as ConnectParams,
|
|
18199
|
+
checkout_sdk_d_ConnectResult as ConnectResult,
|
|
18200
|
+
checkout_sdk_d_ConnectTargetLayer as ConnectTargetLayer,
|
|
18201
|
+
checkout_sdk_d_ConnectWidgetConfiguration as ConnectWidgetConfiguration,
|
|
18202
|
+
checkout_sdk_d_ConnectWidgetParams as ConnectWidgetParams,
|
|
18203
|
+
checkout_sdk_d_ConnectionFailed as ConnectionFailed,
|
|
18204
|
+
checkout_sdk_d_ConnectionSuccess as ConnectionSuccess,
|
|
18205
|
+
checkout_sdk_d_DexConfig as DexConfig,
|
|
18206
|
+
checkout_sdk_d_ERC20ItemRequirement as ERC20ItemRequirement,
|
|
18207
|
+
checkout_sdk_d_ERC721Balance as ERC721Balance,
|
|
18208
|
+
checkout_sdk_d_ERC721ItemRequirement as ERC721ItemRequirement,
|
|
18209
|
+
checkout_sdk_d_ErrorType as ErrorType,
|
|
18210
|
+
checkout_sdk_d_ExchangeType as ExchangeType,
|
|
18211
|
+
checkout_sdk_d_Fee as Fee,
|
|
18212
|
+
checkout_sdk_d_FeePercentage as FeePercentage,
|
|
18213
|
+
checkout_sdk_d_FeeToken as FeeToken,
|
|
18214
|
+
checkout_sdk_d_FiatRampParams as FiatRampParams,
|
|
18215
|
+
checkout_sdk_d_FulfillmentTransaction as FulfillmentTransaction,
|
|
18216
|
+
checkout_sdk_d_FundingItem as FundingItem,
|
|
18217
|
+
checkout_sdk_d_FundingRoute as FundingRoute,
|
|
18218
|
+
checkout_sdk_d_FundingStep as FundingStep,
|
|
18219
|
+
checkout_sdk_d_FundingStepType as FundingStepType,
|
|
18220
|
+
checkout_sdk_d_GasAmount as GasAmount,
|
|
18221
|
+
checkout_sdk_d_GasEstimateBridgeToL2Result as GasEstimateBridgeToL2Result,
|
|
18222
|
+
checkout_sdk_d_GasEstimateParams as GasEstimateParams,
|
|
18223
|
+
checkout_sdk_d_GasEstimateSwapResult as GasEstimateSwapResult,
|
|
18224
|
+
checkout_sdk_d_GasEstimateTokenConfig as GasEstimateTokenConfig,
|
|
18225
|
+
checkout_sdk_d_GasEstimateType as GasEstimateType,
|
|
18226
|
+
checkout_sdk_d_GasToken as GasToken,
|
|
18227
|
+
checkout_sdk_d_GasTokenType as GasTokenType,
|
|
18228
|
+
checkout_sdk_d_GetAllBalancesParams as GetAllBalancesParams,
|
|
18229
|
+
checkout_sdk_d_GetAllBalancesResult as GetAllBalancesResult,
|
|
18230
|
+
checkout_sdk_d_GetBalanceParams as GetBalanceParams,
|
|
18231
|
+
checkout_sdk_d_GetBalanceResult as GetBalanceResult,
|
|
18232
|
+
checkout_sdk_d_GetNetworkAllowListParams as GetNetworkAllowListParams,
|
|
18233
|
+
checkout_sdk_d_GetNetworkAllowListResult as GetNetworkAllowListResult,
|
|
18234
|
+
checkout_sdk_d_GetNetworkParams as GetNetworkParams,
|
|
18235
|
+
checkout_sdk_d_GetTokenAllowListParams as GetTokenAllowListParams,
|
|
18236
|
+
checkout_sdk_d_GetTokenAllowListResult as GetTokenAllowListResult,
|
|
18237
|
+
checkout_sdk_d_GetWalletAllowListParams as GetWalletAllowListParams,
|
|
18238
|
+
checkout_sdk_d_GetWalletAllowListResult as GetWalletAllowListResult,
|
|
18239
|
+
checkout_sdk_d_IMTBLWidgetEvents as IMTBLWidgetEvents,
|
|
18240
|
+
checkout_sdk_d_IWidgetsFactory as IWidgetsFactory,
|
|
18241
|
+
checkout_sdk_d_ItemBalance as ItemBalance,
|
|
18242
|
+
checkout_sdk_d_ItemType as ItemType,
|
|
18243
|
+
checkout_sdk_d_NativeItemRequirement as NativeItemRequirement,
|
|
18244
|
+
checkout_sdk_d_NetworkFilter as NetworkFilter,
|
|
18245
|
+
checkout_sdk_d_NetworkFilterTypes as NetworkFilterTypes,
|
|
18246
|
+
checkout_sdk_d_NetworkInfo as NetworkInfo,
|
|
18247
|
+
checkout_sdk_d_NoRouteOptions as NoRouteOptions,
|
|
18248
|
+
checkout_sdk_d_NoRoutesFound as NoRoutesFound,
|
|
18249
|
+
checkout_sdk_d_OnRampEventType as OnRampEventType,
|
|
18250
|
+
checkout_sdk_d_OnRampFailed as OnRampFailed,
|
|
18251
|
+
checkout_sdk_d_OnRampFundingStep as OnRampFundingStep,
|
|
18252
|
+
checkout_sdk_d_OnRampProviderFees as OnRampProviderFees,
|
|
18253
|
+
checkout_sdk_d_OnRampSuccess as OnRampSuccess,
|
|
18254
|
+
checkout_sdk_d_OnRampWidgetParams as OnRampWidgetParams,
|
|
18255
|
+
checkout_sdk_d_OnrampWidgetConfiguration as OnrampWidgetConfiguration,
|
|
18256
|
+
checkout_sdk_d_OrchestrationEvent as OrchestrationEvent,
|
|
18257
|
+
checkout_sdk_d_OrchestrationEventData as OrchestrationEventData,
|
|
18258
|
+
checkout_sdk_d_OrchestrationEventType as OrchestrationEventType,
|
|
18259
|
+
checkout_sdk_d_OrderFee as OrderFee,
|
|
18260
|
+
checkout_sdk_d_ProviderEvent as ProviderEvent,
|
|
18261
|
+
checkout_sdk_d_ProviderEventType as ProviderEventType,
|
|
18262
|
+
checkout_sdk_d_ProviderUpdated as ProviderUpdated,
|
|
18263
|
+
checkout_sdk_d_RemoteConfiguration as RemoteConfiguration,
|
|
18264
|
+
checkout_sdk_d_RequestBridgeEvent as RequestBridgeEvent,
|
|
18265
|
+
checkout_sdk_d_RequestConnectEvent as RequestConnectEvent,
|
|
18266
|
+
checkout_sdk_d_RequestOnrampEvent as RequestOnrampEvent,
|
|
18267
|
+
checkout_sdk_d_RequestSwapEvent as RequestSwapEvent,
|
|
18268
|
+
checkout_sdk_d_RequestWalletEvent as RequestWalletEvent,
|
|
18269
|
+
checkout_sdk_d_RoutesFound as RoutesFound,
|
|
18270
|
+
checkout_sdk_d_RoutingOutcome as RoutingOutcome,
|
|
18271
|
+
checkout_sdk_d_RoutingOutcomeType as RoutingOutcomeType,
|
|
18272
|
+
checkout_sdk_d_SaleEventType as SaleEventType,
|
|
18273
|
+
checkout_sdk_d_SaleFailed as SaleFailed,
|
|
18274
|
+
checkout_sdk_d_SaleItem as SaleItem,
|
|
18275
|
+
checkout_sdk_d_SaleSuccess as SaleSuccess,
|
|
18276
|
+
checkout_sdk_d_SaleTransactionSuccess as SaleTransactionSuccess,
|
|
18277
|
+
checkout_sdk_d_SaleWidgetConfiguration as SaleWidgetConfiguration,
|
|
18278
|
+
checkout_sdk_d_SaleWidgetParams as SaleWidgetParams,
|
|
18279
|
+
checkout_sdk_d_SellOrder as SellOrder,
|
|
18280
|
+
checkout_sdk_d_SellParams as SellParams,
|
|
18281
|
+
checkout_sdk_d_SellResult as SellResult,
|
|
18282
|
+
checkout_sdk_d_SellResultFailed as SellResultFailed,
|
|
18283
|
+
checkout_sdk_d_SellResultInsufficientFunds as SellResultInsufficientFunds,
|
|
18284
|
+
checkout_sdk_d_SellResultSuccess as SellResultSuccess,
|
|
18285
|
+
checkout_sdk_d_SellToken as SellToken,
|
|
18286
|
+
checkout_sdk_d_SemanticVersion as SemanticVersion,
|
|
18287
|
+
checkout_sdk_d_SendTransactionParams as SendTransactionParams,
|
|
18288
|
+
checkout_sdk_d_SendTransactionResult as SendTransactionResult,
|
|
18289
|
+
checkout_sdk_d_SmartCheckoutInsufficient as SmartCheckoutInsufficient,
|
|
18290
|
+
checkout_sdk_d_SmartCheckoutParams as SmartCheckoutParams,
|
|
18291
|
+
checkout_sdk_d_SmartCheckoutResult as SmartCheckoutResult,
|
|
18292
|
+
checkout_sdk_d_SmartCheckoutRouter as SmartCheckoutRouter,
|
|
18293
|
+
checkout_sdk_d_SmartCheckoutSufficient as SmartCheckoutSufficient,
|
|
18294
|
+
checkout_sdk_d_SwapEventType as SwapEventType,
|
|
18295
|
+
checkout_sdk_d_SwapFailed as SwapFailed,
|
|
18296
|
+
checkout_sdk_d_SwapFundingStep as SwapFundingStep,
|
|
18297
|
+
checkout_sdk_d_SwapRejected as SwapRejected,
|
|
18298
|
+
checkout_sdk_d_SwapSuccess as SwapSuccess,
|
|
18299
|
+
checkout_sdk_d_SwapWidgetConfiguration as SwapWidgetConfiguration,
|
|
18300
|
+
checkout_sdk_d_SwapWidgetParams as SwapWidgetParams,
|
|
18301
|
+
checkout_sdk_d_SwitchNetworkParams as SwitchNetworkParams,
|
|
18302
|
+
checkout_sdk_d_SwitchNetworkResult as SwitchNetworkResult,
|
|
18303
|
+
checkout_sdk_d_TokenAmountEstimate as TokenAmountEstimate,
|
|
18304
|
+
checkout_sdk_d_TokenBalance as TokenBalance,
|
|
18305
|
+
checkout_sdk_d_TokenFilter as TokenFilter,
|
|
18306
|
+
checkout_sdk_d_TokenFilterTypes as TokenFilterTypes,
|
|
18307
|
+
checkout_sdk_d_TokenInfo as TokenInfo,
|
|
18308
|
+
checkout_sdk_d_TransactionOrGasType as TransactionOrGasType,
|
|
18309
|
+
checkout_sdk_d_TransactionRequirement as TransactionRequirement,
|
|
18310
|
+
checkout_sdk_d_WalletDisconnect as WalletDisconnect,
|
|
18311
|
+
checkout_sdk_d_WalletEventType as WalletEventType,
|
|
18312
|
+
checkout_sdk_d_WalletFilter as WalletFilter,
|
|
18313
|
+
checkout_sdk_d_WalletFilterTypes as WalletFilterTypes,
|
|
18314
|
+
checkout_sdk_d_WalletInfo as WalletInfo,
|
|
18315
|
+
checkout_sdk_d_WalletNetworkSwitch as WalletNetworkSwitch,
|
|
18316
|
+
checkout_sdk_d_WalletProviderName as WalletProviderName,
|
|
18317
|
+
checkout_sdk_d_WalletWidgetConfiguration as WalletWidgetConfiguration,
|
|
18318
|
+
checkout_sdk_d_WalletWidgetParams as WalletWidgetParams,
|
|
18319
|
+
checkout_sdk_d_Widget as Widget,
|
|
18320
|
+
checkout_sdk_d_WidgetConfiguration as WidgetConfiguration,
|
|
18321
|
+
checkout_sdk_d_WidgetConfigurations as WidgetConfigurations,
|
|
18322
|
+
checkout_sdk_d_WidgetEvent as WidgetEvent,
|
|
18323
|
+
checkout_sdk_d_WidgetEventData as WidgetEventData,
|
|
18324
|
+
checkout_sdk_d_WidgetEventTypes as WidgetEventTypes,
|
|
18325
|
+
checkout_sdk_d_WidgetParameters as WidgetParameters,
|
|
18326
|
+
checkout_sdk_d_WidgetProperties as WidgetProperties,
|
|
18327
|
+
checkout_sdk_d_WidgetTheme as WidgetTheme,
|
|
18328
|
+
checkout_sdk_d_WidgetType as WidgetType,
|
|
18329
|
+
};
|
|
18330
|
+
}
|
|
18331
|
+
|
|
18332
|
+
export { blockchain_data_d as blockchainData, checkout_sdk_d as checkoutSdk, config_d as config, immutablex_client_d as immutablexClient, orderbook_d as orderbook, passport_d as passport, provider_d as provider };
|