@imtbl/sdk 0.8.0-alpha → 0.11.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
@@ -1,7 +1,7 @@
1
1
  /// <reference path="global.d.ts" />
2
2
  /// <reference types="node" />
3
3
  import { BlockchainDataConfiguration, BlockchainDataModuleConfiguration as BlockchainDataModuleConfiguration$1, ProviderConfiguration as ProviderConfiguration$1, ExchangeContracts } from 'config';
4
- import { OrderbookOverrides } from 'config/config';
4
+ import { OrderbookOverrides, OrderbookModuleConfiguration } from 'config/config';
5
5
  import { ListingResult, ListListingsResult, OrdersService } from 'openapi/sdk';
6
6
  import { ListListingsParams as ListListingsParams$1, PrepareListingParams as PrepareListingParams$1, PrepareListingResponse as PrepareListingResponse$1, CreateListingParams as CreateListingParams$1, FulfillOrderResponse as FulfillOrderResponse$1, CancelOrderResponse as CancelOrderResponse$2 } from 'types';
7
7
 
@@ -13051,6 +13051,11 @@ declare class Orderbook {
13051
13051
  private seaport;
13052
13052
  private orderbookConfig;
13053
13053
  constructor(config: ModuleConfiguration<OrderbookOverrides>);
13054
+ /**
13055
+ * Return the configuration for the orderbook module.
13056
+ * @return {OrderbookModuleConfiguration} The configuration for the orderbook module.
13057
+ */
13058
+ config(): OrderbookModuleConfiguration;
13054
13059
  /**
13055
13060
  * Get an order by ID
13056
13061
  * @param {string} listingId - The listingId to find.
@@ -13098,13 +13103,17 @@ declare class Orderbook {
13098
13103
  cancelOrder(listingId: string, accountAddress: string): Promise<CancelOrderResponse$2>;
13099
13104
  }
13100
13105
 
13106
+ declare const constants: {
13107
+ estimatedFulfillmentGasGwei: number;
13108
+ };
13109
+
13101
13110
  declare enum OrderType {
13102
13111
  FULL_OPEN = 0,
13103
13112
  PARTIAL_OPEN = 1,
13104
13113
  FULL_RESTRICTED = 2,
13105
13114
  PARTIAL_RESTRICTED = 3
13106
13115
  }
13107
- declare enum ItemType {
13116
+ declare enum ItemType$1 {
13108
13117
  NATIVE = 0,
13109
13118
  ERC20 = 1,
13110
13119
  ERC721 = 2,
@@ -13114,14 +13123,14 @@ declare enum ItemType {
13114
13123
  }
13115
13124
 
13116
13125
  type OfferItem = {
13117
- itemType: ItemType;
13126
+ itemType: ItemType$1;
13118
13127
  token: string;
13119
13128
  identifierOrCriteria: string;
13120
13129
  startAmount: string;
13121
13130
  endAmount: string;
13122
13131
  };
13123
13132
  type ConsiderationItem = {
13124
- itemType: ItemType;
13133
+ itemType: ItemType$1;
13125
13134
  token: string;
13126
13135
  identifierOrCriteria: string;
13127
13136
  startAmount: string;
@@ -13145,17 +13154,17 @@ type OrderComponents = OrderParameters & {
13145
13154
  counter: BigNumberish;
13146
13155
  };
13147
13156
 
13148
- interface ERC721Item {
13157
+ interface ERC721Item$1 {
13149
13158
  type: 'ERC721';
13150
13159
  contractAddress: string;
13151
13160
  tokenId: string;
13152
13161
  }
13153
- interface ERC20Item {
13162
+ interface ERC20Item$1 {
13154
13163
  type: 'ERC20';
13155
13164
  contractAddress: string;
13156
13165
  amount: string;
13157
13166
  }
13158
- interface NativeItem {
13167
+ interface NativeItem$1 {
13159
13168
  type: 'NATIVE';
13160
13169
  amount: string;
13161
13170
  }
@@ -13165,8 +13174,8 @@ interface RoyaltyInfo {
13165
13174
  }
13166
13175
  interface PrepareListingParams {
13167
13176
  makerAddress: string;
13168
- sell: ERC721Item;
13169
- buy: ERC20Item | NativeItem;
13177
+ sell: ERC721Item$1;
13178
+ buy: ERC20Item$1 | NativeItem$1;
13170
13179
  orderExpiry?: Date;
13171
13180
  }
13172
13181
  interface PrepareListingResponse {
@@ -13219,11 +13228,8 @@ type orderbook_d_ActionType = ActionType;
13219
13228
  declare const orderbook_d_ActionType: typeof ActionType;
13220
13229
  type orderbook_d_CancelOrderResponse = CancelOrderResponse;
13221
13230
  type orderbook_d_CreateListingParams = CreateListingParams;
13222
- type orderbook_d_ERC20Item = ERC20Item;
13223
- type orderbook_d_ERC721Item = ERC721Item;
13224
13231
  type orderbook_d_FulfillOrderResponse = FulfillOrderResponse;
13225
13232
  type orderbook_d_ListListingsParams = ListListingsParams;
13226
- type orderbook_d_NativeItem = NativeItem;
13227
13233
  type orderbook_d_Orderbook = Orderbook;
13228
13234
  declare const orderbook_d_Orderbook: typeof Orderbook;
13229
13235
  type orderbook_d_PrepareListingParams = PrepareListingParams;
@@ -13236,17 +13242,18 @@ type orderbook_d_TransactionAction = TransactionAction;
13236
13242
  type orderbook_d_TransactionBuilder = TransactionBuilder;
13237
13243
  type orderbook_d_TransactionPurpose = TransactionPurpose;
13238
13244
  declare const orderbook_d_TransactionPurpose: typeof TransactionPurpose;
13245
+ declare const orderbook_d_constants: typeof constants;
13239
13246
  declare namespace orderbook_d {
13240
13247
  export {
13241
13248
  orderbook_d_Action as Action,
13242
13249
  orderbook_d_ActionType as ActionType,
13243
13250
  orderbook_d_CancelOrderResponse as CancelOrderResponse,
13244
13251
  orderbook_d_CreateListingParams as CreateListingParams,
13245
- orderbook_d_ERC20Item as ERC20Item,
13246
- orderbook_d_ERC721Item as ERC721Item,
13252
+ ERC20Item$1 as ERC20Item,
13253
+ ERC721Item$1 as ERC721Item,
13247
13254
  orderbook_d_FulfillOrderResponse as FulfillOrderResponse,
13248
13255
  orderbook_d_ListListingsParams as ListListingsParams,
13249
- orderbook_d_NativeItem as NativeItem,
13256
+ NativeItem$1 as NativeItem,
13250
13257
  orderbook_d_Orderbook as Orderbook,
13251
13258
  orderbook_d_PrepareListingParams as PrepareListingParams,
13252
13259
  orderbook_d_PrepareListingResponse as PrepareListingResponse,
@@ -13256,6 +13263,7 @@ declare namespace orderbook_d {
13256
13263
  orderbook_d_TransactionAction as TransactionAction,
13257
13264
  orderbook_d_TransactionBuilder as TransactionBuilder,
13258
13265
  orderbook_d_TransactionPurpose as TransactionPurpose,
13266
+ orderbook_d_constants as constants,
13259
13267
  };
13260
13268
  }
13261
13269
 
@@ -13394,6 +13402,131 @@ interface GetAllBalancesParams {
13394
13402
  interface GetAllBalancesResult {
13395
13403
  balances: GetBalanceResult[];
13396
13404
  }
13405
+ /**
13406
+ * Interface representing the parameters for {@link Checkout.smartCheckout}
13407
+ * @property {Web3Provider} provider - The provider to use for smart checkout.
13408
+ * @property {ItemRequirement[]} itemRequirements - The item requirements for the transaction.
13409
+ * @property {FulfilmentTransaction | GasAmount} transactionOrGasAmount - The transaction or gas amount.
13410
+ */
13411
+ interface SmartCheckoutParams {
13412
+ provider: Web3Provider;
13413
+ itemRequirements: ItemRequirement[];
13414
+ transactionOrGasAmount: FulfilmentTransaction | GasAmount;
13415
+ }
13416
+ /**
13417
+ * Represents the item requirements for a transaction.
13418
+ * NativeItem, ERC20Item or ERC721Item {@link Checkout.smartCheckout}.
13419
+ */
13420
+ type ItemRequirement = NativeItem | ERC20Item | ERC721Item;
13421
+ /**
13422
+ * An enum representing the item types
13423
+ * @enum {string}
13424
+ * @property {string} NATIVE - If the item is a native token.
13425
+ * @property {string} ERC20 - If the item is an ERC20 token.
13426
+ * @property {string} ERC721 - If the item is an ERC721 token.
13427
+ */
13428
+ declare enum ItemType {
13429
+ NATIVE = "NATIVE",
13430
+ ERC20 = "ERC20",
13431
+ ERC721 = "ERC721"
13432
+ }
13433
+ /**
13434
+ * Represents a native item.
13435
+ * @property {ItemType} type - The type indicate this is a native item.
13436
+ * @property {BigNumber} amount - The amount of the item.
13437
+ */
13438
+ type NativeItem = {
13439
+ type: ItemType.NATIVE;
13440
+ amount: BigNumber;
13441
+ };
13442
+ /**
13443
+ * Represents an ERC20 item.
13444
+ * @property {ItemType} type - The type to indicate this is an ERC20 item.
13445
+ * @property {string} contractAddress - The contract address of the ERC20.
13446
+ * @property {BigNumber} amount - The amount of the item.
13447
+ * @property {string} spenderAddress - The contract address of the approver.
13448
+ */
13449
+ type ERC20Item = {
13450
+ type: ItemType.ERC20;
13451
+ contractAddress: string;
13452
+ amount: BigNumber;
13453
+ spenderAddress: string;
13454
+ };
13455
+ /**
13456
+ * Represents an ERC721 item.
13457
+ * @property {ItemType} type - The type to indicate this is an ERC721 item.
13458
+ * @property {string} contractAddress - The contract address of the ERC721.
13459
+ * @property {string} id - The ID of this ERC721 in the collection.
13460
+ * @property {string} spenderAddress - The contract address of the approver.
13461
+ */
13462
+ type ERC721Item = {
13463
+ type: ItemType.ERC721;
13464
+ contractAddress: string;
13465
+ id: string;
13466
+ spenderAddress: string;
13467
+ };
13468
+ /**
13469
+ * An enum representing transaction or gas types
13470
+ * @enum {string}
13471
+ * @property {string} TRANSACTION - If the type is a transaction
13472
+ * @property {string} GAS - If the type is the gas amount
13473
+ */
13474
+ declare enum TransactionOrGasType {
13475
+ TRANSACTION = "TRANSACTION",
13476
+ GAS = "GAS"
13477
+ }
13478
+ /**
13479
+ * The fulfilment transaction which contains the transaction to send.
13480
+ * @property {TransactionOrGasType} type - The type to indicate this is a fulfilment transaction.
13481
+ * @property {TransactionRequest} transaction - The transaction to send.
13482
+ */
13483
+ type FulfilmentTransaction = {
13484
+ type: TransactionOrGasType.TRANSACTION;
13485
+ transaction: TransactionRequest;
13486
+ };
13487
+ /**
13488
+ * The gas amount which contains the gas token and the gas limit.
13489
+ * @property {TransactionOrGasType} type - The type to indicate this is a gas amount.
13490
+ * @property {GasToken} gasToken - The gas token.
13491
+ */
13492
+ type GasAmount = {
13493
+ type: TransactionOrGasType.GAS;
13494
+ gasToken: GasToken;
13495
+ };
13496
+ /**
13497
+ * Represents the gas token which is either a native token or an ERC20 token.
13498
+ */
13499
+ type GasToken = NativeGas | ERC20Gas;
13500
+ /**
13501
+ * An enum representing the gas token types
13502
+ * @enum {string}
13503
+ * @property {string} NATIVE - If the gas token is a native token.
13504
+ * @property {string} ERC20 - If the gas token is an ERC20 token.
13505
+ */
13506
+ declare enum GasTokenType {
13507
+ NATIVE = "NATIVE",
13508
+ ERC20 = "ERC20"
13509
+ }
13510
+ /**
13511
+ * Represents a native gas token.
13512
+ * @property {GasTokenType} type - The type to indicate this is a native gas token.
13513
+ * @property {BigNumber} limit - The gas limit.
13514
+ */
13515
+ type NativeGas = {
13516
+ type: GasTokenType.NATIVE;
13517
+ limit: BigNumber;
13518
+ };
13519
+ /**
13520
+ * Represents an ERC20 gas token.
13521
+ * @property {GasTokenType} type - The type to indicate this is an ERC20 gas token.
13522
+ * @property {string} contractAddress - The contract address of the ERC20.
13523
+ * @property {BigNumber} limit - The gas limit.
13524
+ */
13525
+ type ERC20Gas = {
13526
+ type: GasTokenType.ERC20;
13527
+ contractAddress: string;
13528
+ limit: BigNumber;
13529
+ };
13397
13530
  /**
13398
13531
  * Interface representing the parameters for {@link Checkout.buy}
13399
13532
  * @property {Web3Provider} provider - The provider to use for the buy.
@@ -13684,16 +13817,18 @@ interface SendTransactionResult {
13684
13817
  * Enum representing the names of different wallet providers.
13685
13818
  */
13686
13819
  declare enum WalletProviderName {
13687
- METAMASK = "metamask",
13688
- PASSPORT = "passport"
13820
+ PASSPORT = "passport",
13821
+ METAMASK = "metamask"
13689
13822
  }
13690
13823
  /**
13691
13824
  * Interface for the parameters required to create a wallet provider {@link Checkout.createProvider}.
13692
13825
  * @interface CreateProviderParams
13693
13826
  * @property {WalletProviderName} walletProvider - The name of the wallet provider.
13827
+ * @property {Passport} passport - The Passport instance to create a Web3Provider.
13694
13828
  */
13695
13829
  interface CreateProviderParams {
13696
13830
  walletProvider: WalletProviderName;
13831
+ passport?: Passport;
13697
13832
  }
13698
13833
  /**
13699
13834
  * Represents the result of creating a Web3 provider {@link Checkout.createProvider}.
@@ -13898,6 +14033,11 @@ declare class Checkout {
13898
14033
  * @param {BuyParams} params - The parameters for the buy.
13899
14034
  */
13900
14035
  buy(params: BuyParams): Promise<void>;
14036
+ /**
14037
+ * Determines the transaction requirements to complete a purchase.
14038
+ * @params {SmartCheckoutParams} params - The parameters for smart checkout.
14039
+ */
14040
+ smartCheckout(params: SmartCheckoutParams): Promise<void>;
13901
14041
  /**
13902
14042
  * Checks if the given object is a Web3 provider.
13903
14043
  * @param {Web3Provider} web3Provider - The object to check.
@@ -13954,6 +14094,7 @@ type checkout_sdk_d_NetworkInfo = NetworkInfo;
13954
14094
  type checkout_sdk_d_RemoteConfiguration = RemoteConfiguration;
13955
14095
  type checkout_sdk_d_SendTransactionParams = SendTransactionParams;
13956
14096
  type checkout_sdk_d_SendTransactionResult = SendTransactionResult;
14097
+ type checkout_sdk_d_SmartCheckoutParams = SmartCheckoutParams;
13957
14098
  type checkout_sdk_d_SwitchNetworkParams = SwitchNetworkParams;
13958
14099
  type checkout_sdk_d_SwitchNetworkResult = SwitchNetworkResult;
13959
14100
  type checkout_sdk_d_TokenFilter = TokenFilter;
@@ -14004,6 +14145,7 @@ declare namespace checkout_sdk_d {
14004
14145
  checkout_sdk_d_RemoteConfiguration as RemoteConfiguration,
14005
14146
  checkout_sdk_d_SendTransactionParams as SendTransactionParams,
14006
14147
  checkout_sdk_d_SendTransactionResult as SendTransactionResult,
14148
+ checkout_sdk_d_SmartCheckoutParams as SmartCheckoutParams,
14007
14149
  checkout_sdk_d_SwitchNetworkParams as SwitchNetworkParams,
14008
14150
  checkout_sdk_d_SwitchNetworkResult as SwitchNetworkResult,
14009
14151
  checkout_sdk_d_TokenFilter as TokenFilter,