@net-protocol/bazaar 0.1.7 → 0.1.9

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.
@@ -336,6 +336,74 @@ interface WriteTransactionConfig {
336
336
  args: readonly unknown[];
337
337
  /** Contract ABI */
338
338
  abi: readonly unknown[];
339
+ /** Native currency value to send (in wei) */
340
+ value?: bigint;
341
+ }
342
+ /**
343
+ * Prepared fulfillment with optional approvals and the Seaport call
344
+ */
345
+ interface PreparedFulfillment {
346
+ /** ERC721/ERC20 approve txs (empty if not needed) */
347
+ approvals: WriteTransactionConfig[];
348
+ /** The Seaport fulfillOrder or fulfillAdvancedOrder call */
349
+ fulfillment: WriteTransactionConfig;
350
+ }
351
+ /**
352
+ * EIP-712 typed data for signing a Seaport order
353
+ */
354
+ interface EIP712OrderData {
355
+ domain: {
356
+ name: string;
357
+ version: string;
358
+ chainId: number;
359
+ verifyingContract: `0x${string}`;
360
+ };
361
+ types: Record<string, Array<{
362
+ name: string;
363
+ type: string;
364
+ }>>;
365
+ primaryType: string;
366
+ /** OrderComponents message (without totalOriginalConsiderationItems, with counter) */
367
+ message: Record<string, unknown>;
368
+ /** Full order parameters for step 2 submission */
369
+ orderParameters: SeaportOrderParameters;
370
+ /** The counter used in the order */
371
+ counter: bigint;
372
+ }
373
+ /**
374
+ * Prepared order with EIP-712 data for signing and maker approvals
375
+ */
376
+ interface PreparedOrder {
377
+ /** EIP-712 typed data for the caller to sign */
378
+ eip712: EIP712OrderData;
379
+ /** Maker approvals needed (e.g., NFT/ERC20/WETH approve for Seaport) */
380
+ approvals: WriteTransactionConfig[];
381
+ }
382
+ /**
383
+ * Parameters for creating an ERC20 offer (buying ERC20 tokens with WETH)
384
+ */
385
+ interface CreateErc20OfferParams {
386
+ /** ERC20 token address to buy */
387
+ tokenAddress: `0x${string}`;
388
+ /** Amount of tokens to buy */
389
+ tokenAmount: bigint;
390
+ /** Total price in wei (WETH) */
391
+ priceWei: bigint;
392
+ /** Expiration timestamp in seconds (defaults to 24h from now) */
393
+ expirationDate?: number;
394
+ }
395
+ /**
396
+ * Parameters for creating an ERC20 listing (selling ERC20 tokens for native currency)
397
+ */
398
+ interface CreateErc20ListingParams {
399
+ /** ERC20 token address to sell */
400
+ tokenAddress: `0x${string}`;
401
+ /** Amount of tokens to sell */
402
+ tokenAmount: bigint;
403
+ /** Total price in wei (native currency) */
404
+ priceWei: bigint;
405
+ /** Expiration timestamp in seconds (defaults to 24h from now) */
406
+ expirationDate?: number;
339
407
  }
340
408
 
341
- export { type CollectionOffer as C, type Erc20Offer as E, type GetListingsOptions as G, ItemType as I, type Listing as L, OrderType as O, type Sale as S, type WriteTransactionConfig as W, type GetCollectionOffersOptions as a, type GetErc20OffersOptions as b, type GetErc20ListingsOptions as c, type Erc20Listing as d, type GetSalesOptions as e, type SeaportOrderComponents as f, type SeaportSubmission as g, type SeaportOrderParameters as h, type SeaportOrderStatusInfo as i, SeaportOrderStatus as j, type OfferItem as k, type ConsiderationItem as l, type CreateListingParams as m, type CreateCollectionOfferParams as n };
409
+ export { type CollectionOffer as C, type Erc20Offer as E, type GetListingsOptions as G, ItemType as I, type Listing as L, type OfferItem as O, type PreparedFulfillment as P, type Sale as S, type WriteTransactionConfig as W, type GetCollectionOffersOptions as a, type GetErc20OffersOptions as b, type GetErc20ListingsOptions as c, type Erc20Listing as d, type GetSalesOptions as e, type SeaportOrderComponents as f, type CreateListingParams as g, type PreparedOrder as h, type CreateCollectionOfferParams as i, type CreateErc20OfferParams as j, type CreateErc20ListingParams as k, type SeaportOrderParameters as l, type SeaportSubmission as m, type SeaportOrderStatusInfo as n, SeaportOrderStatus as o, type EIP712OrderData as p, type ConsiderationItem as q, OrderType as r };
@@ -336,6 +336,74 @@ interface WriteTransactionConfig {
336
336
  args: readonly unknown[];
337
337
  /** Contract ABI */
338
338
  abi: readonly unknown[];
339
+ /** Native currency value to send (in wei) */
340
+ value?: bigint;
341
+ }
342
+ /**
343
+ * Prepared fulfillment with optional approvals and the Seaport call
344
+ */
345
+ interface PreparedFulfillment {
346
+ /** ERC721/ERC20 approve txs (empty if not needed) */
347
+ approvals: WriteTransactionConfig[];
348
+ /** The Seaport fulfillOrder or fulfillAdvancedOrder call */
349
+ fulfillment: WriteTransactionConfig;
350
+ }
351
+ /**
352
+ * EIP-712 typed data for signing a Seaport order
353
+ */
354
+ interface EIP712OrderData {
355
+ domain: {
356
+ name: string;
357
+ version: string;
358
+ chainId: number;
359
+ verifyingContract: `0x${string}`;
360
+ };
361
+ types: Record<string, Array<{
362
+ name: string;
363
+ type: string;
364
+ }>>;
365
+ primaryType: string;
366
+ /** OrderComponents message (without totalOriginalConsiderationItems, with counter) */
367
+ message: Record<string, unknown>;
368
+ /** Full order parameters for step 2 submission */
369
+ orderParameters: SeaportOrderParameters;
370
+ /** The counter used in the order */
371
+ counter: bigint;
372
+ }
373
+ /**
374
+ * Prepared order with EIP-712 data for signing and maker approvals
375
+ */
376
+ interface PreparedOrder {
377
+ /** EIP-712 typed data for the caller to sign */
378
+ eip712: EIP712OrderData;
379
+ /** Maker approvals needed (e.g., NFT/ERC20/WETH approve for Seaport) */
380
+ approvals: WriteTransactionConfig[];
381
+ }
382
+ /**
383
+ * Parameters for creating an ERC20 offer (buying ERC20 tokens with WETH)
384
+ */
385
+ interface CreateErc20OfferParams {
386
+ /** ERC20 token address to buy */
387
+ tokenAddress: `0x${string}`;
388
+ /** Amount of tokens to buy */
389
+ tokenAmount: bigint;
390
+ /** Total price in wei (WETH) */
391
+ priceWei: bigint;
392
+ /** Expiration timestamp in seconds (defaults to 24h from now) */
393
+ expirationDate?: number;
394
+ }
395
+ /**
396
+ * Parameters for creating an ERC20 listing (selling ERC20 tokens for native currency)
397
+ */
398
+ interface CreateErc20ListingParams {
399
+ /** ERC20 token address to sell */
400
+ tokenAddress: `0x${string}`;
401
+ /** Amount of tokens to sell */
402
+ tokenAmount: bigint;
403
+ /** Total price in wei (native currency) */
404
+ priceWei: bigint;
405
+ /** Expiration timestamp in seconds (defaults to 24h from now) */
406
+ expirationDate?: number;
339
407
  }
340
408
 
341
- export { type CollectionOffer as C, type Erc20Offer as E, type GetListingsOptions as G, ItemType as I, type Listing as L, OrderType as O, type Sale as S, type WriteTransactionConfig as W, type GetCollectionOffersOptions as a, type GetErc20OffersOptions as b, type GetErc20ListingsOptions as c, type Erc20Listing as d, type GetSalesOptions as e, type SeaportOrderComponents as f, type SeaportSubmission as g, type SeaportOrderParameters as h, type SeaportOrderStatusInfo as i, SeaportOrderStatus as j, type OfferItem as k, type ConsiderationItem as l, type CreateListingParams as m, type CreateCollectionOfferParams as n };
409
+ export { type CollectionOffer as C, type Erc20Offer as E, type GetListingsOptions as G, ItemType as I, type Listing as L, type OfferItem as O, type PreparedFulfillment as P, type Sale as S, type WriteTransactionConfig as W, type GetCollectionOffersOptions as a, type GetErc20OffersOptions as b, type GetErc20ListingsOptions as c, type Erc20Listing as d, type GetSalesOptions as e, type SeaportOrderComponents as f, type CreateListingParams as g, type PreparedOrder as h, type CreateCollectionOfferParams as i, type CreateErc20OfferParams as j, type CreateErc20ListingParams as k, type SeaportOrderParameters as l, type SeaportSubmission as m, type SeaportOrderStatusInfo as n, SeaportOrderStatus as o, type EIP712OrderData as p, type ConsiderationItem as q, OrderType as r };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@net-protocol/bazaar",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "SDK for Net Bazaar - a decentralized bazaar storing all orders onchain via Seaport",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",