@imtbl/sdk 0.6.0-alpha → 0.7.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -13170,12 +13170,7 @@ interface PrepareListingParams {
13170
13170
  orderExpiry?: Date;
13171
13171
  }
13172
13172
  interface PrepareListingResponse {
13173
- unsignedApprovalTransaction?: PopulatedTransaction;
13174
- typedOrderMessageForSigning: {
13175
- domain: TypedDataDomain;
13176
- types: Record<string, TypedDataField[]>;
13177
- value: Record<string, any>;
13178
- };
13173
+ actions: Action[];
13179
13174
  orderComponents: OrderComponents;
13180
13175
  orderHash: string;
13181
13176
  }
@@ -13185,16 +13180,43 @@ interface CreateListingParams {
13185
13180
  orderSignature: string;
13186
13181
  }
13187
13182
  type ListListingsParams = Omit<Parameters<typeof OrdersService.prototype.listListings>[0], 'chainName'>;
13183
+ declare enum TransactionPurpose {
13184
+ APPROVAL = "APPROVAL",
13185
+ FULFILL_ORDER = "FULFILL_ORDER"
13186
+ }
13187
+ declare enum SignablePurpose {
13188
+ CREATE_LISTING = "CREATE_LISTING"
13189
+ }
13190
+ declare enum ActionType {
13191
+ TRANSACTION = "TRANSACTION",
13192
+ SIGNABLE = "SIGNABLE"
13193
+ }
13194
+ type TransactionBuilder = () => Promise<PopulatedTransaction>;
13195
+ interface TransactionAction {
13196
+ type: ActionType.TRANSACTION;
13197
+ purpose: TransactionPurpose;
13198
+ buildTransaction: TransactionBuilder;
13199
+ }
13200
+ interface SignableAction {
13201
+ type: ActionType.SIGNABLE;
13202
+ purpose: SignablePurpose;
13203
+ message: {
13204
+ domain: TypedDataDomain;
13205
+ types: Record<string, TypedDataField[]>;
13206
+ value: Record<string, any>;
13207
+ };
13208
+ }
13209
+ type Action = TransactionAction | SignableAction;
13188
13210
  interface FulfillOrderResponse {
13189
- unsignedApprovalTransaction?: PopulatedTransaction;
13190
- unsignedFulfillmentTransaction: PopulatedTransaction;
13211
+ actions: Action[];
13191
13212
  }
13192
13213
  interface CancelOrderResponse {
13193
13214
  unsignedCancelOrderTransaction: PopulatedTransaction;
13194
13215
  }
13195
13216
 
13196
- declare const module = "orderbook";
13197
-
13217
+ type orderbook_d_Action = Action;
13218
+ type orderbook_d_ActionType = ActionType;
13219
+ declare const orderbook_d_ActionType: typeof ActionType;
13198
13220
  type orderbook_d_CancelOrderResponse = CancelOrderResponse;
13199
13221
  type orderbook_d_CreateListingParams = CreateListingParams;
13200
13222
  type orderbook_d_ERC20Item = ERC20Item;
@@ -13207,9 +13229,17 @@ declare const orderbook_d_Orderbook: typeof Orderbook;
13207
13229
  type orderbook_d_PrepareListingParams = PrepareListingParams;
13208
13230
  type orderbook_d_PrepareListingResponse = PrepareListingResponse;
13209
13231
  type orderbook_d_RoyaltyInfo = RoyaltyInfo;
13210
- declare const orderbook_d_module: typeof module;
13232
+ type orderbook_d_SignableAction = SignableAction;
13233
+ type orderbook_d_SignablePurpose = SignablePurpose;
13234
+ declare const orderbook_d_SignablePurpose: typeof SignablePurpose;
13235
+ type orderbook_d_TransactionAction = TransactionAction;
13236
+ type orderbook_d_TransactionBuilder = TransactionBuilder;
13237
+ type orderbook_d_TransactionPurpose = TransactionPurpose;
13238
+ declare const orderbook_d_TransactionPurpose: typeof TransactionPurpose;
13211
13239
  declare namespace orderbook_d {
13212
13240
  export {
13241
+ orderbook_d_Action as Action,
13242
+ orderbook_d_ActionType as ActionType,
13213
13243
  orderbook_d_CancelOrderResponse as CancelOrderResponse,
13214
13244
  orderbook_d_CreateListingParams as CreateListingParams,
13215
13245
  orderbook_d_ERC20Item as ERC20Item,
@@ -13221,7 +13251,11 @@ declare namespace orderbook_d {
13221
13251
  orderbook_d_PrepareListingParams as PrepareListingParams,
13222
13252
  orderbook_d_PrepareListingResponse as PrepareListingResponse,
13223
13253
  orderbook_d_RoyaltyInfo as RoyaltyInfo,
13224
- orderbook_d_module as module,
13254
+ orderbook_d_SignableAction as SignableAction,
13255
+ orderbook_d_SignablePurpose as SignablePurpose,
13256
+ orderbook_d_TransactionAction as TransactionAction,
13257
+ orderbook_d_TransactionBuilder as TransactionBuilder,
13258
+ orderbook_d_TransactionPurpose as TransactionPurpose,
13225
13259
  };
13226
13260
  }
13227
13261
 
@@ -13360,6 +13394,15 @@ interface GetAllBalancesParams {
13360
13394
  interface GetAllBalancesResult {
13361
13395
  balances: GetBalanceResult[];
13362
13396
  }
13397
+ /**
13398
+ * Interface representing the parameters for {@link Checkout.buy}
13399
+ * @property {Web3Provider} provider - The provider to use for the buy.
13400
+ * @property {string} orderId - The order ID.
13401
+ */
13402
+ interface BuyParams {
13403
+ provider: Web3Provider;
13404
+ orderId: string;
13405
+ }
13363
13406
  interface CheckoutOverrides {
13364
13407
  }
13365
13408
  interface CheckoutModuleConfiguration extends ModuleConfiguration<CheckoutOverrides> {
@@ -13641,7 +13684,8 @@ interface SendTransactionResult {
13641
13684
  * Enum representing the names of different wallet providers.
13642
13685
  */
13643
13686
  declare enum WalletProviderName {
13644
- METAMASK = "metamask"
13687
+ METAMASK = "metamask",
13688
+ PASSPORT = "passport"
13645
13689
  }
13646
13690
  /**
13647
13691
  * Interface for the parameters required to create a wallet provider {@link Checkout.createProvider}.
@@ -13740,7 +13784,9 @@ declare enum CheckoutErrorType {
13740
13784
  TRANSACTION_FAILED = "TRANSACTION_FAILED",
13741
13785
  INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
13742
13786
  UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT",
13743
- INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE"
13787
+ INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE",
13788
+ UNSUPPORTED_TOKEN_TYPE_ERROR = "UNSUPPORTED_TOKEN_TYPE_ERROR",
13789
+ GET_ORDER_LISTING_ERROR = "GET_ORDER_LISTING_ERROR"
13744
13790
  }
13745
13791
  /**
13746
13792
  * Represents an error object with a specific type, optional message, and optional data.
@@ -13766,7 +13812,6 @@ declare class RemoteConfigFetcher {
13766
13812
  }
13767
13813
  declare class CheckoutConfiguration {
13768
13814
  readonly isDevelopment: boolean;
13769
- readonly isLocal: boolean;
13770
13815
  readonly isProduction: boolean;
13771
13816
  readonly remote: RemoteConfigFetcher;
13772
13817
  readonly environment: Environment;
@@ -13847,6 +13892,11 @@ declare class Checkout {
13847
13892
  * @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
13848
13893
  */
13849
13894
  getNetworkInfo(params: GetNetworkParams): Promise<NetworkInfo>;
13895
+ /**
13896
+ * Determines the requirements for performing a buy.
13897
+ * @param {BuyParams} params - The parameters for the buy.
13898
+ */
13899
+ buy(params: BuyParams): Promise<void>;
13850
13900
  /**
13851
13901
  * Checks if the given object is a Web3 provider.
13852
13902
  * @param {Web3Provider} web3Provider - The object to check.
@@ -13862,6 +13912,7 @@ declare class Checkout {
13862
13912
  }
13863
13913
 
13864
13914
  type checkout_sdk_d_AllowedNetworkConfig = AllowedNetworkConfig;
13915
+ type checkout_sdk_d_BuyParams = BuyParams;
13865
13916
  declare const checkout_sdk_d_CHECKOUT_API_BASE_URL: typeof CHECKOUT_API_BASE_URL;
13866
13917
  type checkout_sdk_d_ChainId = ChainId;
13867
13918
  declare const checkout_sdk_d_ChainId: typeof ChainId;
@@ -13917,6 +13968,7 @@ declare const checkout_sdk_d_WalletProviderName: typeof WalletProviderName;
13917
13968
  declare namespace checkout_sdk_d {
13918
13969
  export {
13919
13970
  checkout_sdk_d_AllowedNetworkConfig as AllowedNetworkConfig,
13971
+ checkout_sdk_d_BuyParams as BuyParams,
13920
13972
  checkout_sdk_d_CHECKOUT_API_BASE_URL as CHECKOUT_API_BASE_URL,
13921
13973
  checkout_sdk_d_ChainId as ChainId,
13922
13974
  checkout_sdk_d_ChainName as ChainName,
@@ -28660,6 +28712,7 @@ declare global {
28660
28712
  }
28661
28713
  interface ImmutableWebComponent {
28662
28714
  setProvider: Function;
28715
+ addPassportOption: Function;
28663
28716
  setAttribute: Function;
28664
28717
  }
28665
28718
  }
@@ -28730,6 +28783,7 @@ interface ImtblBridgeProps extends React.DetailedHTMLProps<React.HTMLAttributes<
28730
28783
  interface BridgeReactProps {
28731
28784
  walletProvider?: WalletProviderName;
28732
28785
  provider?: Web3Provider;
28786
+ passport?: Passport;
28733
28787
  fromContractAddress?: string;
28734
28788
  amount?: string;
28735
28789
  }
@@ -28743,7 +28797,10 @@ declare function BridgeReact(props: BridgeReactProps): JSX.Element;
28743
28797
  * A React functional component that renders the Checkout Connect Widget.
28744
28798
  * @returns {JSX.Element} - The rendered Connect Widget component.
28745
28799
  */
28746
- declare function ConnectReact(): JSX.Element;
28800
+ interface ConnectReactProps {
28801
+ passport?: Passport;
28802
+ }
28803
+ declare function ConnectReact({ passport }: ConnectReactProps): JSX.Element;
28747
28804
  /**
28748
28805
  * Interface representing the props for the Swap Widget component.
28749
28806
  * @interface SwapReactProps
@@ -28756,6 +28813,7 @@ declare function ConnectReact(): JSX.Element;
28756
28813
  interface SwapReactProps {
28757
28814
  walletProvider?: WalletProviderName;
28758
28815
  provider?: Web3Provider;
28816
+ passport?: Passport;
28759
28817
  fromContractAddress?: string;
28760
28818
  amount?: string;
28761
28819
  toContractAddress?: string;
@@ -28775,6 +28833,7 @@ declare function SwapReact(props: SwapReactProps): JSX.Element;
28775
28833
  interface WalletReactProps {
28776
28834
  walletProvider?: WalletProviderName;
28777
28835
  provider?: Web3Provider;
28836
+ passport?: Passport;
28778
28837
  }
28779
28838
  /**
28780
28839
  * A React functional component that renders the Checkout Wallet Widget.
@@ -28796,6 +28855,7 @@ type checkout_widgets_d_CheckoutWidgetsConfig = CheckoutWidgetsConfig;
28796
28855
  type checkout_widgets_d_ConnectEventType = ConnectEventType;
28797
28856
  declare const checkout_widgets_d_ConnectEventType: typeof ConnectEventType;
28798
28857
  declare const checkout_widgets_d_ConnectReact: typeof ConnectReact;
28858
+ type checkout_widgets_d_ConnectReactProps = ConnectReactProps;
28799
28859
  type checkout_widgets_d_ConnectionFailed = ConnectionFailed;
28800
28860
  type checkout_widgets_d_ConnectionSuccess = ConnectionSuccess;
28801
28861
  type checkout_widgets_d_IMTBLWidgetEvents = IMTBLWidgetEvents;
@@ -28841,6 +28901,7 @@ declare namespace checkout_widgets_d {
28841
28901
  checkout_widgets_d_CheckoutWidgetsConfig as CheckoutWidgetsConfig,
28842
28902
  checkout_widgets_d_ConnectEventType as ConnectEventType,
28843
28903
  checkout_widgets_d_ConnectReact as ConnectReact,
28904
+ checkout_widgets_d_ConnectReactProps as ConnectReactProps,
28844
28905
  checkout_widgets_d_ConnectionFailed as ConnectionFailed,
28845
28906
  checkout_widgets_d_ConnectionSuccess as ConnectionSuccess,
28846
28907
  checkout_widgets_d_IMTBLWidgetEvents as IMTBLWidgetEvents,