@imtbl/sdk 0.22.2 → 0.23.0-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
@@ -3598,7 +3598,7 @@ interface ApiRegisterPassportUserRequest {
3598
3598
  * @export
3599
3599
  * @interface Fee
3600
3600
  */
3601
- interface Fee$2 {
3601
+ interface Fee$3 {
3602
3602
  /**
3603
3603
  * Wallet address
3604
3604
  * @type {string}
@@ -3691,7 +3691,7 @@ interface Asset {
3691
3691
  * @type {Array<Fee>}
3692
3692
  * @memberof Asset
3693
3693
  */
3694
- 'fees'?: Array<Fee$2>;
3694
+ 'fees'?: Array<Fee$3>;
3695
3695
  /**
3696
3696
  * [DEPRECATED] Internal Immutable X Token ID
3697
3697
  * @type {string}
@@ -3801,7 +3801,7 @@ interface AssetWithOrders {
3801
3801
  * @type {Array<Fee>}
3802
3802
  * @memberof AssetWithOrders
3803
3803
  */
3804
- 'fees'?: Array<Fee$2>;
3804
+ 'fees'?: Array<Fee$3>;
3805
3805
  /**
3806
3806
  * [DEPRECATED] Internal Immutable X Token ID
3807
3807
  * @type {string}
@@ -7233,7 +7233,7 @@ interface Mint {
7233
7233
  * @type {Array<Fee>}
7234
7234
  * @memberof Mint
7235
7235
  */
7236
- 'fees'?: Array<Fee$2>;
7236
+ 'fees'?: Array<Fee$3>;
7237
7237
  /**
7238
7238
  * Status of this mint
7239
7239
  * @type {string}
@@ -13388,7 +13388,7 @@ declare abstract class BaseHttpRequest {
13388
13388
  */
13389
13389
  type ChainName$1 = string;
13390
13390
 
13391
- type Fee$1 = {
13391
+ type Fee$2 = {
13392
13392
  /**
13393
13393
  * Fee payable to recipient upon settlement
13394
13394
  */
@@ -13396,13 +13396,13 @@ type Fee$1 = {
13396
13396
  /**
13397
13397
  * Fee type
13398
13398
  */
13399
- fee_type: Fee$1.fee_type;
13399
+ fee_type: Fee$2.fee_type;
13400
13400
  /**
13401
13401
  * Wallet address of fee recipient
13402
13402
  */
13403
13403
  recipient: string;
13404
13404
  };
13405
- declare namespace Fee$1 {
13405
+ declare namespace Fee$2 {
13406
13406
  /**
13407
13407
  * Fee type
13408
13408
  */
@@ -13498,7 +13498,7 @@ type CreateListingRequestBody = {
13498
13498
  /**
13499
13499
  * 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.
13500
13500
  */
13501
- fees: Array<Fee$1>;
13501
+ fees: Array<Fee$2>;
13502
13502
  /**
13503
13503
  * Time after which the Order is considered expired
13504
13504
  */
@@ -13551,7 +13551,7 @@ declare enum OrderStatus {
13551
13551
  type Order$1 = {
13552
13552
  account_address: string;
13553
13553
  buy: Array<Item>;
13554
- fees: Array<Fee$1>;
13554
+ fees: Array<Fee$2>;
13555
13555
  chain: Chain;
13556
13556
  /**
13557
13557
  * Time the Order is created
@@ -13593,7 +13593,7 @@ type FulfillableOrder = {
13593
13593
 
13594
13594
  type FulfillmentDataRequest = {
13595
13595
  order_id: string;
13596
- fees: Array<Fee$1>;
13596
+ fees: Array<Fee$2>;
13597
13597
  };
13598
13598
 
13599
13599
  type ListingResult$1 = {
@@ -13644,7 +13644,7 @@ type TradeBlockchainMetadata = {
13644
13644
  type Trade$1 = {
13645
13645
  buy: Array<Item>;
13646
13646
  buyer_address: string;
13647
- buyer_fees: Array<Fee$1>;
13647
+ buyer_fees: Array<Fee$2>;
13648
13648
  chain: Chain;
13649
13649
  order_id: string;
13650
13650
  blockchain_metadata: TradeBlockchainMetadata;
@@ -13862,7 +13862,7 @@ interface FeeValue {
13862
13862
  recipient: string;
13863
13863
  amount: string;
13864
13864
  }
13865
- interface Fee extends FeeValue {
13865
+ interface Fee$1 extends FeeValue {
13866
13866
  type: FeeType;
13867
13867
  }
13868
13868
  declare enum TransactionPurpose {
@@ -13909,7 +13909,7 @@ interface Order {
13909
13909
  accountAddress: string;
13910
13910
  buy: (ERC20Item$1 | NativeItem$1)[];
13911
13911
  sell: ERC721Item$1[];
13912
- fees: Fee[];
13912
+ fees: Fee$1[];
13913
13913
  chain: {
13914
13914
  id: string;
13915
13915
  name: string;
@@ -13961,7 +13961,7 @@ interface Trade {
13961
13961
  };
13962
13962
  buy: (ERC20Item$1 | NativeItem$1)[];
13963
13963
  sell: ERC721Item$1[];
13964
- buyerFees: Fee[];
13964
+ buyerFees: Fee$1[];
13965
13965
  sellerAddress: string;
13966
13966
  buyerAddress: string;
13967
13967
  makerAddress: string;
@@ -14081,7 +14081,6 @@ type orderbook_d_ActionType = ActionType;
14081
14081
  declare const orderbook_d_ActionType: typeof ActionType;
14082
14082
  type orderbook_d_CancelOrderResponse = CancelOrderResponse;
14083
14083
  type orderbook_d_CreateListingParams = CreateListingParams;
14084
- type orderbook_d_Fee = Fee;
14085
14084
  type orderbook_d_FeeType = FeeType;
14086
14085
  declare const orderbook_d_FeeType: typeof FeeType;
14087
14086
  type orderbook_d_FeeValue = FeeValue;
@@ -14118,7 +14117,7 @@ declare namespace orderbook_d {
14118
14117
  orderbook_d_CreateListingParams as CreateListingParams,
14119
14118
  ERC20Item$1 as ERC20Item,
14120
14119
  ERC721Item$1 as ERC721Item,
14121
- orderbook_d_Fee as Fee,
14120
+ Fee$1 as Fee,
14122
14121
  orderbook_d_FeeType as FeeType,
14123
14122
  orderbook_d_FeeValue as FeeValue,
14124
14123
  orderbook_d_FulfillOrderResponse as FulfillOrderResponse,
@@ -14281,6 +14280,166 @@ interface GetAllBalancesParams {
14281
14280
  interface GetAllBalancesResult {
14282
14281
  balances: GetBalanceResult[];
14283
14282
  }
14283
+ interface OrderFee {
14284
+ amount: FeeToken | FeePercentage;
14285
+ recipient: string;
14286
+ }
14287
+ interface FeeToken {
14288
+ token: string;
14289
+ }
14290
+ interface FeePercentage {
14291
+ percentageDecimal: number;
14292
+ }
14293
+ type BuyResult = BuyResultSuccess | BuyResultFailed | BuyResultInsufficientFunds;
14294
+ /**
14295
+ * Represents the result of {@link Checkout.buy}
14296
+ * @property {CheckoutStatus.SUCCESS} status - The status to indicate success
14297
+ * @property {SmartCheckoutSufficient[]} smartCheckoutResult - The sufficient result of smart checkout
14298
+ */
14299
+ type BuyResultSuccess = {
14300
+ status: CheckoutStatus.SUCCESS;
14301
+ smartCheckoutResult: SmartCheckoutSufficient[];
14302
+ };
14303
+ /**
14304
+ * Represents the result of {@link Checkout.buy}
14305
+ * @property {CheckoutStatus.FAILED} status - The status to indicate failure
14306
+ * @property {string} transactionHash - The transaction hash of the failed transaction
14307
+ * @property {string} reason - The reason for the failure
14308
+ * @property {SmartCheckoutSufficient[]} smartCheckoutResult - The sufficient result of smart checkout
14309
+ */
14310
+ type BuyResultFailed = {
14311
+ status: CheckoutStatus.FAILED;
14312
+ transactionHash: string;
14313
+ reason: string;
14314
+ smartCheckoutResult: SmartCheckoutSufficient[];
14315
+ };
14316
+ /**
14317
+ * Represents the result of {@link Checkout.buy}
14318
+ * @property {CheckoutStatus.INSUFFICIENT_FUNDS} status - The status to indicate insufficient funds
14319
+ * @property {SmartCheckoutInsufficient[]} smartCheckoutResult - The insufficient result of smart checkout
14320
+ */
14321
+ type BuyResultInsufficientFunds = {
14322
+ status: CheckoutStatus.INSUFFICIENT_FUNDS;
14323
+ smartCheckoutResult: SmartCheckoutInsufficient[];
14324
+ };
14325
+ type SellResult = SellResultSuccess | SellResultFailed | SellResultInsufficientFunds;
14326
+ /**
14327
+ * Represents the result of {@link Checkout.sell}
14328
+ * @property {CheckoutStatus.SUCCESS} status - The status to indicate success
14329
+ * @property {SmartCheckoutSufficient[]} smartCheckoutResult - The sufficient result of smart checkout
14330
+ */
14331
+ type SellResultSuccess = {
14332
+ status: CheckoutStatus.SUCCESS;
14333
+ orderIds: string[];
14334
+ smartCheckoutResult: SmartCheckoutSufficient[];
14335
+ };
14336
+ /**
14337
+ * Represents the result of {@link Checkout.sell}
14338
+ * @property {CheckoutStatus.FAILED} status - The status to indicate failure
14339
+ * @property {string} transactionHash - The transaction hash of the failed transaction
14340
+ * @property {string} reason - The reason for the failure
14341
+ * @property {SmartCheckoutSufficient[]} smartCheckoutResult - The sufficient result of smart checkout
14342
+ */
14343
+ type SellResultFailed = {
14344
+ status: CheckoutStatus.FAILED;
14345
+ transactionHash: string;
14346
+ reason: string;
14347
+ smartCheckoutResult: SmartCheckoutSufficient[];
14348
+ };
14349
+ /**
14350
+ * Represents the result of {@link Checkout.sell}
14351
+ * @property {CheckoutStatus.INSUFFICIENT_FUNDS} status - The status to indicate insufficient funds
14352
+ * @property {SmartCheckoutInsufficient[]} smartCheckoutResult - The insufficient result of smart checkout
14353
+ */
14354
+ type SellResultInsufficientFunds = {
14355
+ status: CheckoutStatus.INSUFFICIENT_FUNDS;
14356
+ smartCheckoutResult: SmartCheckoutInsufficient[];
14357
+ };
14358
+ type CancelResult = CancelResultSuccess | CancelResultFailed;
14359
+ /**
14360
+ * Represents the result of {@link Checkout.cancel}
14361
+ * @property {CheckoutStatus.SUCCESS} status - The status to indicate success
14362
+ */
14363
+ type CancelResultSuccess = {
14364
+ status: CheckoutStatus.SUCCESS;
14365
+ };
14366
+ /**
14367
+ * Represents the result of {@link Checkout.cancel}
14368
+ * @property {CheckoutStatus.FAILED} status - The status to indicate failure
14369
+ * @property {string} transactionHash - The transaction hash of the failed transaction
14370
+ * @property {string} reason - The reason for the failure
14371
+ */
14372
+ type CancelResultFailed = {
14373
+ status: CheckoutStatus.FAILED;
14374
+ transactionHash: string;
14375
+ reason: string;
14376
+ };
14377
+ /**
14378
+ * An enum representing the checkout status types
14379
+ * @enum {string}
14380
+ * @property {string} SUCCESS - If checkout succeeded as the transactions were able to be processed
14381
+ * @property {string} FAILED - If checkout failed due to transactions not settling on chain
14382
+ * @property {string} INSUFFICIENT_FUNDS - If checkout failed due to insufficient funds
14383
+ */
14384
+ declare enum CheckoutStatus {
14385
+ SUCCESS = "SUCCESS",
14386
+ FAILED = "FAILED",
14387
+ INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS"
14388
+ }
14389
+ /**
14390
+ * The type representing the order to buy
14391
+ * @property {string} orderId - the id of the order to buy
14392
+ * @property {Array<OrderFee>} takerFees - array of order fees to apply to the order
14393
+ */
14394
+ type BuyOrder = {
14395
+ id: string;
14396
+ takerFees?: OrderFee[];
14397
+ };
14398
+ /**
14399
+ * The type representing the sell order to create a listing from
14400
+ * @property {SellToken} sellToken - the token to be listed for sale
14401
+ * @property {BuyToken} buyToken - the token info of the price of the item
14402
+ * @property {OrderFee[]} makerFees - option array of makerFees to be applied to the listing
14403
+ */
14404
+ type SellOrder = {
14405
+ sellToken: SellToken;
14406
+ buyToken: BuyToken;
14407
+ makerFees?: OrderFee[];
14408
+ };
14409
+ /**
14410
+ * Represents the token that the item can be bought with once listed for sale.
14411
+ * NativeBuyToken or ERC20BuyToken {@link Checkout.smartCheckout}.
14412
+ */
14413
+ type BuyToken = NativeBuyToken | ERC20BuyToken;
14414
+ /**
14415
+ * Represents a native buy token
14416
+ * @property {ItemType} type - The type indicate this is a native token.
14417
+ * @property {string} amount - The amount of native token.
14418
+ */
14419
+ type NativeBuyToken = {
14420
+ type: ItemType.NATIVE;
14421
+ amount: string;
14422
+ };
14423
+ /**
14424
+ * Represents a ERC20 buy token
14425
+ * @property {ItemType} type - The type indicate this is a ERC20 token.
14426
+ * @property {string} amount - The amount of native token.
14427
+ * @property {string} contractAddress - The contract address of the ERC20.
14428
+ */
14429
+ type ERC20BuyToken = {
14430
+ type: ItemType.ERC20;
14431
+ amount: string;
14432
+ contractAddress: string;
14433
+ };
14434
+ /**
14435
+ * Interface of the SellToken
14436
+ * @property {string} id - The ERC721 token id
14437
+ * @property {string} collectionAddress - The ERC721 collection address
14438
+ */
14439
+ type SellToken = {
14440
+ id: string;
14441
+ collectionAddress: string;
14442
+ };
14284
14443
  /**
14285
14444
  * Interface representing the parameters for {@link Checkout.smartCheckout}
14286
14445
  * @property {Web3Provider} provider - The provider to use for smart checkout.
@@ -14292,16 +14451,35 @@ interface SmartCheckoutParams {
14292
14451
  itemRequirements: (NativeItemRequirement | ERC20ItemRequirement | ERC721ItemRequirement)[];
14293
14452
  transactionOrGasAmount: FulfillmentTransaction | GasAmount;
14294
14453
  }
14454
+ /**
14455
+ * Represents a native item requirement for a transaction.
14456
+ * @property {ItemType.NATIVE} type - The type to indicate this is a native item requirement.
14457
+ * @property {string} amount - The amount of the item.
14458
+ */
14295
14459
  type NativeItemRequirement = {
14296
14460
  type: ItemType.NATIVE;
14297
14461
  amount: string;
14298
14462
  };
14463
+ /**
14464
+ * Represents an ERC20 item requirement for a transaction.
14465
+ * @property {ItemType.ERC20} type - The type to indicate this is a ERC20 item requirement.
14466
+ * @property {string} amount - The amount of the item.
14467
+ * @property {string} contractAddress - The contract address of the ERC20.
14468
+ * @property {string} spenderAddress - The contract address of the approver.
14469
+ */
14299
14470
  type ERC20ItemRequirement = {
14300
14471
  type: ItemType.ERC20;
14301
14472
  contractAddress: string;
14302
14473
  amount: string;
14303
14474
  spenderAddress: string;
14304
14475
  };
14476
+ /**
14477
+ * Represents an ERC721 item requirement for a transaction.
14478
+ * @property {ItemType.ERC721} type - The type to indicate this is a ERC721 item requirement.
14479
+ * @property {string} contractAddress - The contract address of the ERC721 collection.
14480
+ * @property {string} id - The ID of this ERC721 in the collection.
14481
+ * @property {string} spenderAddress - The contract address of the approver.
14482
+ */
14305
14483
  type ERC721ItemRequirement = {
14306
14484
  type: ItemType.ERC721;
14307
14485
  contractAddress: string;
@@ -14350,7 +14528,7 @@ type ERC20Item = {
14350
14528
  /**
14351
14529
  * Represents an ERC721 item.
14352
14530
  * @property {ItemType} type - The type to indicate this is an ERC721 item.
14353
- * @property {string} contractAddress - The contract address of the ERC721.
14531
+ * @property {string} contractAddress - The contract address of the ERC721 collection.
14354
14532
  * @property {string} id - The ID of this ERC721 in the collection.
14355
14533
  * @property {string} spenderAddress - The contract address of the approver.
14356
14534
  */
@@ -14423,14 +14601,217 @@ type ERC20Gas = {
14423
14601
  limit: BigNumber;
14424
14602
  };
14425
14603
  /**
14426
- * Represents the result of {@link Checkout.smartCheckout}.
14427
- * @property {boolean} sufficient - If the user address has sufficient funds to cover the transaction.
14428
- * @property {TransactionRequirement[]} transactionRequirements - The transaction requirements.
14604
+ * The type representing the result of {@link Checkout.smartCheckout}.
14429
14605
  */
14430
- interface SmartCheckoutResult {
14431
- sufficient: boolean;
14606
+ type SmartCheckoutResult = SmartCheckoutSufficient | SmartCheckoutInsufficient;
14607
+ /**
14608
+ * Represents the result of {@link Checkout.smartCheckout} when smart checkout is sufficient.
14609
+ * @property {boolean} sufficient - Indicates that smart checkout determined the user had sufficient funds.
14610
+ * @property {TransactionRequirement[]} transactionRequirements - The transaction requirements smart checkout
14611
+ * determined were required for the transaction.
14612
+ */
14613
+ type SmartCheckoutSufficient = {
14614
+ sufficient: true;
14432
14615
  transactionRequirements: TransactionRequirement[];
14616
+ };
14617
+ /**
14618
+ * Represents the result of {@link Checkout.smartCheckout} when smart checkout is insufficient.
14619
+ * @property {boolean} sufficient - Indicates that smart checkout determined the user has insufficient funds
14620
+ * @property {TransactionRequirement[]} transactionRequirements - The transaction requirements smart checkout
14621
+ * determined were required for the transaction.
14622
+ * @property {SmartCheckoutRouter} router - The type containing the funding routes the user can take to fulfill the transaction requirements
14623
+ */
14624
+ type SmartCheckoutInsufficient = {
14625
+ sufficient: false;
14626
+ transactionRequirements: TransactionRequirement[];
14627
+ router: SmartCheckoutRouter;
14628
+ };
14629
+ /**
14630
+ * Represents the routing outcome for a transaction.
14631
+ * @property {boolean} isPassport - Indicates if the provider used was a passport provider.
14632
+ * @property {AvailableRoutingOptions} availableRoutingOptions - The routing options available to the user
14633
+ * @property {RoutingOutcome} routingOutcome - The routing outcome for the transaction which
14634
+ * includes the funding routes if routes were found
14635
+ */
14636
+ type SmartCheckoutRouter = {
14637
+ isPassport: boolean;
14638
+ availableRoutingOptions: AvailableRoutingOptions;
14639
+ routingOutcome: RoutingOutcome;
14640
+ };
14641
+ /**
14642
+ * An enum representing the routing outcome types
14643
+ * @enum {string}
14644
+ * @property {string} ROUTES_FOUND - If funding routes were found for the transaction.
14645
+ * @property {string} NO_ROUTES_FOUND - If no funding routes were found for the transaction.
14646
+ * @property {string} NO_ROUTE_OPTIONS - If no routing options were available for the transaction.
14647
+ */
14648
+ declare enum RoutingOutcomeType {
14649
+ ROUTES_FOUND = "ROUTES_FOUND",
14650
+ NO_ROUTES_FOUND = "NO_ROUTES_FOUND",
14651
+ NO_ROUTE_OPTIONS = "NO_ROUTE_OPTIONS"
14652
+ }
14653
+ type RoutingOutcome = RoutesFound | NoRoutesFound | NoRouteOptions;
14654
+ /**
14655
+ * Represents a routing outcome where funding routes were found.
14656
+ * @property {RoutingOutcomeType.ROUTES_FOUND} type - Indicates that funding routes were found for the transaction.
14657
+ * @property {AvailableRoutingOptions} fundingRoutes - The funding routes found for the transaction.
14658
+ */
14659
+ type RoutesFound = {
14660
+ type: RoutingOutcomeType.ROUTES_FOUND;
14661
+ fundingRoutes: FundingRoute[];
14662
+ };
14663
+ /**
14664
+ * Represents a routing outcome where no funding routes were found.
14665
+ * @property {RoutingOutcomeType.NO_ROUTES_FOUND} type - Indicates that no funding routes were found for the transaction.
14666
+ * @property {string} message - The message indicating why no funding routes were found.
14667
+ */
14668
+ type NoRoutesFound = {
14669
+ type: RoutingOutcomeType.NO_ROUTES_FOUND;
14670
+ message: string;
14671
+ };
14672
+ /**
14673
+ * Represents a routing outcome where no routing options were available for the transaction.
14674
+ * @property {RoutingOutcomeType.NO_ROUTE_OPTIONS} type - Indicates that no routing options were available for the transaction.
14675
+ * @property {string} message - The message indicating why no routing options were available.
14676
+ */
14677
+ type NoRouteOptions = {
14678
+ type: RoutingOutcomeType.NO_ROUTE_OPTIONS;
14679
+ message: string;
14680
+ };
14681
+ /**
14682
+ * Represents a funding route
14683
+ * @property {number} priority - The priority of the route
14684
+ * @property {FundingStep[]} steps - The steps associated with this funding route
14685
+ * @property {TotalFees | undefined} totalFees - The total fees for this route
14686
+ */
14687
+ type FundingRoute = {
14688
+ priority: number;
14689
+ steps: FundingStep[];
14690
+ totalFees?: TotalFees;
14691
+ };
14692
+ /**
14693
+ * Represents the total fees for a route
14694
+ * @property {Fee} gas - The total gas fees for this funding step
14695
+ * @property {Fee} other - The total of all other fees associated with this funding step
14696
+ * @property {Fee} total - The total combined gas and other fees for this funding step
14697
+ */
14698
+ type TotalFees = {
14699
+ gas: Fee;
14700
+ other: Fee;
14701
+ total: Fee;
14702
+ };
14703
+ /**
14704
+ * Represents a fee
14705
+ * @property {BigNumber} amount - The amount of the fee
14706
+ * @property {string} formatted - The formatted amount of the fee
14707
+ */
14708
+ type Fee = {
14709
+ amount: BigNumber;
14710
+ formattedAmount: string;
14711
+ };
14712
+ type FundingStep = BridgeFundingStep | SwapFundingStep | OnRampFundingStep;
14713
+ /**
14714
+ * Represents a bridge funding route
14715
+ * @property {FundingStepType.BRIDGE} type - Indicates that this is a bridge funding step
14716
+ * @property {number} chainId - The chain id the bridge should be executed on
14717
+ * @property {FundingItem} fundingItem - The funding item for the bridge
14718
+ * @property {BridgeFees} fees - The fees for the bridge
14719
+ */
14720
+ type BridgeFundingStep = {
14721
+ type: FundingStepType.BRIDGE;
14722
+ chainId: number;
14723
+ fundingItem: FundingItem;
14724
+ fees: BridgeFees;
14725
+ };
14726
+ /**
14727
+ * Represents the fees for a bridge funding step
14728
+ * @property {Fee} approvalGasFees - The approval gas fees for the bridge
14729
+ * @property {Fee} bridgeGasFees - The bridge gas fees for the bridge
14730
+ * @property {Fee[]} bridgeFees - Additional bridge fees for the bridge
14731
+ */
14732
+ type BridgeFees = {
14733
+ approvalGasFees: Fee;
14734
+ bridgeGasFees: Fee;
14735
+ bridgeFees: Fee[];
14736
+ };
14737
+ /**
14738
+ * Represents a swap funding route
14739
+ * @property {FundingStepType.SWAP} type - Indicates that this is a swap funding step
14740
+ * @property {number} chainId - The chain id the swap should be executed on
14741
+ * @property {FundingItem} fundingItem - The funding item for the swap
14742
+ * @property {SwapFees} fees - The fees for the swap
14743
+ */
14744
+ type SwapFundingStep = {
14745
+ type: FundingStepType.SWAP;
14746
+ chainId: number;
14747
+ fundingItem: FundingItem;
14748
+ fees: SwapFees;
14749
+ };
14750
+ /**
14751
+ * Represents the fees for a swap funding step
14752
+ * @property {Fee} approvalGasFees - The approval gas fees for the swap
14753
+ * @property {Fee} swapGasFees - The swap gas fees for the swap
14754
+ * @property {Fee[]} swapFees - Additional swap fees for the swap
14755
+ */
14756
+ type SwapFees = {
14757
+ approvalGasFees: Fee;
14758
+ swapGasFees: Fee;
14759
+ swapFees: Fee[];
14760
+ };
14761
+ /**
14762
+ * Represents an onramp funding route
14763
+ * @property {FundingStepType.ONRAMP} type - Indicates that this is an onramp funding step
14764
+ * @property {number} chainId - The chain id the onramp should provide funds to
14765
+ * @property {FundingItem} fundingItem - The item to be onramped
14766
+ */
14767
+ type OnRampFundingStep = {
14768
+ type: FundingStepType.ONRAMP;
14769
+ chainId: number;
14770
+ fundingItem: FundingItem;
14771
+ };
14772
+ /**
14773
+ * An enum representing the funding step types
14774
+ * @enum {string}
14775
+ * @property {string} BRIDGE - If the funding step is a bridge.
14776
+ * @property {string} SWAP - If the funding step is a swap.
14777
+ * @property {string} ONRAMP - If the funding step is an onramp.
14778
+ */
14779
+ declare enum FundingStepType {
14780
+ BRIDGE = "BRIDGE",
14781
+ SWAP = "SWAP",
14782
+ ONRAMP = "ONRAMP"
14433
14783
  }
14784
+ /**
14785
+ * Represents a funding item
14786
+ * @property {ItemType.NATIVE | ItemType.ERC20} type - The type of the funding item
14787
+ * @property {FundsRequired} fundsRequired - The amount of funds required of this funding item
14788
+ * @property {UserBalance} userBalance - The current user balance of this funding item
14789
+ * @property {TokenInfo} token - The token info for the funding item
14790
+ */
14791
+ type FundingItem = {
14792
+ type: ItemType.NATIVE | ItemType.ERC20;
14793
+ fundsRequired: FundsRequired;
14794
+ userBalance: UserBalance;
14795
+ token: TokenInfo;
14796
+ };
14797
+ /**
14798
+ * Represents the funds required of a funding item
14799
+ * @property {BigNumber} amount - The amount of funds required
14800
+ * @property {string} formattedAmount - The formatted amount of funds required
14801
+ */
14802
+ type FundsRequired = {
14803
+ amount: BigNumber;
14804
+ formattedAmount: string;
14805
+ };
14806
+ /**
14807
+ * Represents the user balance of a funding item
14808
+ * @property {BigNumber} balance - The balance of the funding item
14809
+ * @property {string} formattedBalance - The formatted balance of the funding item
14810
+ */
14811
+ type UserBalance = {
14812
+ balance: BigNumber;
14813
+ formattedBalance: string;
14814
+ };
14434
14815
  /**
14435
14816
  * Represents the transaction requirement for a transaction.
14436
14817
  * @property {ItemType} type - The type of the transaction requirement.
@@ -14484,82 +14865,30 @@ type BalanceDelta = {
14484
14865
  balance: BigNumber;
14485
14866
  formattedBalance: string;
14486
14867
  };
14487
- interface OrderFee {
14488
- amount: FeeToken | FeePercentage;
14489
- recipient: string;
14490
- }
14491
- interface FeeToken {
14492
- token: string;
14493
- }
14494
- interface FeePercentage {
14495
- percentageDecimal: number;
14496
- }
14868
+ /**
14869
+ * A type representing the Smart Checkout routing options available for a user
14870
+ * if they are configured and enabled (not geo-blocked etc.)
14871
+ */
14872
+ type AvailableRoutingOptions = {
14873
+ onRamp?: boolean;
14874
+ swap?: boolean;
14875
+ bridge?: boolean;
14876
+ };
14497
14877
  /**
14498
14878
  * Interface representing the parameters for {@link Checkout.buy}
14499
14879
  * @property {Web3Provider} provider - The provider to use for the buy.
14500
14880
  * @property {Array<BuyOrder>} orders - The orders to buy
14881
+ * Currently only processes the first order in the array until batch processing is supported.
14501
14882
  */
14502
14883
  interface BuyParams {
14503
14884
  provider: Web3Provider;
14504
14885
  orders: Array<BuyOrder>;
14505
14886
  }
14506
- /**
14507
- * Interface representing the order to buy
14508
- * @property {string} orderId - the id of the order to buy
14509
- * @property {Array<OrderFee>} takerFees - array of order fees to apply to the order
14510
- */
14511
- interface BuyOrder {
14512
- id: string;
14513
- takerFees?: Array<OrderFee>;
14514
- }
14515
- /**
14516
- * Interface representing the result of the buy
14517
- * @property {SmartCheckoutResult} smartCheckoutResult - The result of smart checkout.
14518
- * @property {string} orderId - The order ID.
14519
- * @property {BuyStatus} status - The status of the buy, present when smart checkout balances are sufficient
14520
- * and the transactions were executed
14521
- */
14522
- type BuyResult = {
14523
- smartCheckoutResult: SmartCheckoutResult;
14524
- orderId: string;
14525
- status?: BuyStatus;
14526
- };
14527
- /**
14528
- * Represents the status of the transaction for the Buy
14529
- */
14530
- type BuyStatus = BuySuccessStatus | BuyFailedStatus;
14531
- /**
14532
- * Represents the status of a successful Buy
14533
- * @property {string} type - The success buy status type.
14534
- */
14535
- interface BuySuccessStatus {
14536
- type: BuyStatusType.SUCCESS;
14537
- }
14538
- /**
14539
- * Represents the status of a failed Buy
14540
- * @property {string} type - The failed buy status type.
14541
- * @property {string} transactionHash - The transaction hash of the failed transaction.
14542
- * @property {string} reason - The reason for the failed transaction.
14543
- */
14544
- interface BuyFailedStatus {
14545
- type: BuyStatusType.FAILED;
14546
- transactionHash: string;
14547
- reason: string;
14548
- }
14549
- /**
14550
- * A type representing the status of the transaction for the Buy
14551
- * @enum {string}
14552
- * @property {string} SUCCESS - All the transactions were successful.
14553
- * @property {string} FAILED - At least one of the transactions failed.
14554
- */
14555
- declare enum BuyStatusType {
14556
- SUCCESS = "SUCCESS",
14557
- FAILED = "FAILED"
14558
- }
14559
14887
  /**
14560
14888
  * Interface representing the parameters for {@link Checkout.cancel}
14561
14889
  * @property {Web3Provider} provider - The provider to use for the cancel.
14562
14890
  * @property {string[]} orderIds - The order IDs to cancel.
14891
+ * Currently only processes the first order in the array until batch processing is supported.
14563
14892
  */
14564
14893
  interface CancelParams {
14565
14894
  provider: Web3Provider;
@@ -14856,104 +15185,12 @@ interface NetworkFilter {
14856
15185
  * Interface representing the parameters for {@link Checkout.sell}
14857
15186
  * @property {Web3Provider} provider - The provider to use for the sell.
14858
15187
  * @property {Array<SellOrder>} orders - An array of sell orders to execute.
14859
- * Only currently actions the first order in the array until we support batch processing.
15188
+ * Currently only processes the first order in the array until batch processing is supported.
14860
15189
  */
14861
15190
  interface SellParams {
14862
15191
  provider: Web3Provider;
14863
15192
  orders: Array<SellOrder>;
14864
15193
  }
14865
- /**
14866
- * Interface of the SellOrder to create a listing from, includes makerFees
14867
- * @property {SellToken} sellToken - the token to be listed for sale
14868
- * @property {BuyToken} buyToken - the token info of the price of the item
14869
- * @property {OrderFee[]} makerFees - option array of makerFees to be applied to the listing
14870
- */
14871
- interface SellOrder {
14872
- sellToken: SellToken;
14873
- buyToken: BuyToken;
14874
- makerFees?: Array<OrderFee>;
14875
- }
14876
- /**
14877
- * Interface of the SellToken
14878
- * @property {string} id - The ERC721 token id
14879
- * @property {string} collectionAddress - The ERC721 contract address
14880
- */
14881
- interface SellToken {
14882
- id: string;
14883
- collectionAddress: string;
14884
- }
14885
- /**
14886
- * Interface representing the result of the sell
14887
- * @property {string} id - The ERC721 ID.
14888
- * @property {string} collectionAddress - The contract address of the ERC721s collection.
14889
- * @property {SmartCheckoutResult} smartCheckoutResult - The result of the smart checkout.
14890
- * @property {SellStatus} status - The status of the sell, present when smart checkout balances are sufficient
14891
- */
14892
- type SellResult = {
14893
- id: string;
14894
- collectionAddress: string;
14895
- smartCheckoutResult: SmartCheckoutResult;
14896
- status?: SellStatus;
14897
- };
14898
- /**
14899
- * Represents the status of the transaction for the Sell
14900
- */
14901
- type SellStatus = SellSuccessStatus | SellFailedStatus;
14902
- /**
14903
- * Represents the status of a successful Sell
14904
- * @property {string} type - The success sell status type.
14905
- * @property {string} orderId - The order ID of the listing.
14906
- */
14907
- interface SellSuccessStatus {
14908
- type: SellStatusType.SUCCESS;
14909
- orderId: string;
14910
- }
14911
- /**
14912
- * Represents the status of a failed Sell
14913
- * @property {string} type - The failed sell status type.
14914
- * @property {string} transactionHash - The transaction hash of the failed transaction.
14915
- * @property {string} reason - The reason for the failed transaction.
14916
- */
14917
- interface SellFailedStatus {
14918
- type: SellStatusType.FAILED;
14919
- transactionHash: string;
14920
- reason: string;
14921
- }
14922
- /**
14923
- * A type representing the status of the transaction for the Sell
14924
- * @enum {string}
14925
- * @property {string} SUCCESS - All the transactions were successful.
14926
- * @property {string} FAILED - At least one of the transactions failed.
14927
- */
14928
- declare enum SellStatusType {
14929
- SUCCESS = "SUCCESS",
14930
- FAILED = "FAILED"
14931
- }
14932
- /**
14933
- * Represents the token that the item can be bought with once listed for sale.
14934
- * NativeBuyToken or ERC20BuyToken {@link Checkout.smartCheckout}.
14935
- */
14936
- type BuyToken = NativeBuyToken | ERC20BuyToken;
14937
- /**
14938
- * Represents a native buy token
14939
- * @property {ItemType} type - The type indicate this is a native token.
14940
- * @property {string} amount - The amount of native token.
14941
- */
14942
- type NativeBuyToken = {
14943
- type: ItemType.NATIVE;
14944
- amount: string;
14945
- };
14946
- /**
14947
- * Represents a ERC20 buy token
14948
- * @property {ItemType} type - The type indicate this is a ERC20 token.
14949
- * @property {string} amount - The amount of native token.
14950
- * @property {string} contractAddress - The contract address of the ERC20.
14951
- */
14952
- type ERC20BuyToken = {
14953
- type: ItemType.ERC20;
14954
- amount: string;
14955
- contractAddress: string;
14956
- };
14957
15194
  /**
14958
15195
  * Interface representing the parameters for {@link Checkout.getTokenAllowList}.
14959
15196
  * @property {TokenFilterTypes} type - The type of token to retrieve.
@@ -15284,24 +15521,24 @@ declare class Checkout {
15284
15521
  * Determines the requirements for performing a buy.
15285
15522
  * @param {BuyParams} params - The parameters for the buy.
15286
15523
  */
15287
- buy(params: BuyParams): Promise<void>;
15524
+ buy(params: BuyParams): Promise<BuyResult>;
15288
15525
  /**
15289
15526
  * Determines the requirements for performing a sell.
15290
15527
  * @param {SellParams} params - The parameters for the sell.
15291
15528
  * Only currently actions the first order in the array until we support batch processing.
15292
15529
  * Only currently actions the first fee in the fees array of each order until we support multiple fees.
15293
15530
  */
15294
- sell(params: SellParams): Promise<void>;
15531
+ sell(params: SellParams): Promise<SellResult>;
15295
15532
  /**
15296
15533
  * Cancels a sell.
15297
15534
  * @param {CancelParams} params - The parameters for the cancel.
15298
15535
  */
15299
- cancel(params: CancelParams): Promise<void>;
15536
+ cancel(params: CancelParams): Promise<CancelResult>;
15300
15537
  /**
15301
15538
  * Determines the transaction requirements to complete a purchase.
15302
15539
  * @params {SmartCheckoutParams} params - The parameters for smart checkout.
15303
15540
  */
15304
- smartCheckout(params: SmartCheckoutParams): Promise<void>;
15541
+ smartCheckout(params: SmartCheckoutParams): Promise<SmartCheckoutResult>;
15305
15542
  /**
15306
15543
  * Checks if the given object is a Web3 provider.
15307
15544
  * @param {Web3Provider} web3Provider - The object to check.
@@ -15328,10 +15565,13 @@ declare class Checkout {
15328
15565
  }
15329
15566
 
15330
15567
  type checkout_sdk_d_AllowedNetworkConfig = AllowedNetworkConfig;
15568
+ type checkout_sdk_d_BuyOrder = BuyOrder;
15331
15569
  type checkout_sdk_d_BuyParams = BuyParams;
15332
15570
  type checkout_sdk_d_BuyResult = BuyResult;
15571
+ type checkout_sdk_d_BuyToken = BuyToken;
15333
15572
  declare const checkout_sdk_d_CHECKOUT_API_BASE_URL: typeof CHECKOUT_API_BASE_URL;
15334
15573
  type checkout_sdk_d_CancelParams = CancelParams;
15574
+ type checkout_sdk_d_CancelResult = CancelResult;
15335
15575
  type checkout_sdk_d_ChainId = ChainId;
15336
15576
  declare const checkout_sdk_d_ChainId: typeof ChainId;
15337
15577
  type checkout_sdk_d_ChainName = ChainName;
@@ -15343,6 +15583,8 @@ declare const checkout_sdk_d_Checkout: typeof Checkout;
15343
15583
  type checkout_sdk_d_CheckoutErrorType = CheckoutErrorType;
15344
15584
  declare const checkout_sdk_d_CheckoutErrorType: typeof CheckoutErrorType;
15345
15585
  type checkout_sdk_d_CheckoutModuleConfiguration = CheckoutModuleConfiguration;
15586
+ type checkout_sdk_d_CheckoutStatus = CheckoutStatus;
15587
+ declare const checkout_sdk_d_CheckoutStatus: typeof CheckoutStatus;
15346
15588
  type checkout_sdk_d_ConnectParams = ConnectParams;
15347
15589
  type checkout_sdk_d_ConnectResult = ConnectResult;
15348
15590
  type checkout_sdk_d_DexConfig = DexConfig;
@@ -15354,12 +15596,15 @@ declare const checkout_sdk_d_ExchangeType: typeof ExchangeType;
15354
15596
  type checkout_sdk_d_FeePercentage = FeePercentage;
15355
15597
  type checkout_sdk_d_FeeToken = FeeToken;
15356
15598
  type checkout_sdk_d_FiatRampParams = FiatRampParams;
15599
+ type checkout_sdk_d_FulfillmentTransaction = FulfillmentTransaction;
15600
+ type checkout_sdk_d_GasAmount = GasAmount;
15357
15601
  type checkout_sdk_d_GasEstimateBridgeToL2Result = GasEstimateBridgeToL2Result;
15358
15602
  type checkout_sdk_d_GasEstimateParams = GasEstimateParams;
15359
15603
  type checkout_sdk_d_GasEstimateSwapResult = GasEstimateSwapResult;
15360
15604
  type checkout_sdk_d_GasEstimateTokenConfig = GasEstimateTokenConfig;
15361
15605
  type checkout_sdk_d_GasEstimateType = GasEstimateType;
15362
15606
  declare const checkout_sdk_d_GasEstimateType: typeof GasEstimateType;
15607
+ type checkout_sdk_d_GasToken = GasToken;
15363
15608
  type checkout_sdk_d_GasTokenType = GasTokenType;
15364
15609
  declare const checkout_sdk_d_GasTokenType: typeof GasTokenType;
15365
15610
  type checkout_sdk_d_GetAllBalancesParams = GetAllBalancesParams;
@@ -15407,10 +15652,13 @@ declare const checkout_sdk_d_WalletProviderName: typeof WalletProviderName;
15407
15652
  declare namespace checkout_sdk_d {
15408
15653
  export {
15409
15654
  checkout_sdk_d_AllowedNetworkConfig as AllowedNetworkConfig,
15655
+ checkout_sdk_d_BuyOrder as BuyOrder,
15410
15656
  checkout_sdk_d_BuyParams as BuyParams,
15411
15657
  checkout_sdk_d_BuyResult as BuyResult,
15658
+ checkout_sdk_d_BuyToken as BuyToken,
15412
15659
  checkout_sdk_d_CHECKOUT_API_BASE_URL as CHECKOUT_API_BASE_URL,
15413
15660
  checkout_sdk_d_CancelParams as CancelParams,
15661
+ checkout_sdk_d_CancelResult as CancelResult,
15414
15662
  checkout_sdk_d_ChainId as ChainId,
15415
15663
  checkout_sdk_d_ChainName as ChainName,
15416
15664
  checkout_sdk_d_CheckConnectionParams as CheckConnectionParams,
@@ -15418,6 +15666,7 @@ declare namespace checkout_sdk_d {
15418
15666
  checkout_sdk_d_Checkout as Checkout,
15419
15667
  checkout_sdk_d_CheckoutErrorType as CheckoutErrorType,
15420
15668
  checkout_sdk_d_CheckoutModuleConfiguration as CheckoutModuleConfiguration,
15669
+ checkout_sdk_d_CheckoutStatus as CheckoutStatus,
15421
15670
  checkout_sdk_d_ConnectParams as ConnectParams,
15422
15671
  checkout_sdk_d_ConnectResult as ConnectResult,
15423
15672
  checkout_sdk_d_DexConfig as DexConfig,
@@ -15428,11 +15677,14 @@ declare namespace checkout_sdk_d {
15428
15677
  checkout_sdk_d_FeePercentage as FeePercentage,
15429
15678
  checkout_sdk_d_FeeToken as FeeToken,
15430
15679
  checkout_sdk_d_FiatRampParams as FiatRampParams,
15680
+ checkout_sdk_d_FulfillmentTransaction as FulfillmentTransaction,
15681
+ checkout_sdk_d_GasAmount as GasAmount,
15431
15682
  checkout_sdk_d_GasEstimateBridgeToL2Result as GasEstimateBridgeToL2Result,
15432
15683
  checkout_sdk_d_GasEstimateParams as GasEstimateParams,
15433
15684
  checkout_sdk_d_GasEstimateSwapResult as GasEstimateSwapResult,
15434
15685
  checkout_sdk_d_GasEstimateTokenConfig as GasEstimateTokenConfig,
15435
15686
  checkout_sdk_d_GasEstimateType as GasEstimateType,
15687
+ checkout_sdk_d_GasToken as GasToken,
15436
15688
  checkout_sdk_d_GasTokenType as GasTokenType,
15437
15689
  checkout_sdk_d_GetAllBalancesParams as GetAllBalancesParams,
15438
15690
  checkout_sdk_d_GetAllBalancesResult as GetAllBalancesResult,
@@ -29962,7 +30214,7 @@ declare function CheckoutWidgets(config?: CheckoutWidgetsConfig): void;
29962
30214
  /**
29963
30215
  * Updates the configuration for the checkout widgets by setting the global variable
29964
30216
  * `window.ImtblCheckoutWidgetConfig` to the JSON string representation of the given
29965
- * `config` object.
30217
+ * `config` object and update all the Checkout web components configuration.
29966
30218
  * @param {CheckoutWidgetsConfig} config - The new configuration object for the checkout widgets.
29967
30219
  * @returns None
29968
30220
  */