@imtbl/sdk 0.28.7-alpha → 0.28.9-alpha

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