@medialane/sdk 0.55.0 → 0.56.0

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.
@@ -1925,8 +1925,9 @@ declare class MedialaneClient {
1925
1925
  interface ResolvedOrder {
1926
1926
  /** ERC-20 consideration token address. */
1927
1927
  paymentToken: string;
1928
- /** Total price in raw token units, as a decimal string. */
1929
- totalPrice: string;
1928
+ /** Per-unit price in raw token units, as a decimal string. The total paid is
1929
+ * `unitPrice × quantity` (quantity is 1 for ERC-721). */
1930
+ unitPrice: string;
1930
1931
  /** Which venue the order lives on. */
1931
1932
  standard: "ERC721" | "ERC1155";
1932
1933
  }
@@ -1925,8 +1925,9 @@ declare class MedialaneClient {
1925
1925
  interface ResolvedOrder {
1926
1926
  /** ERC-20 consideration token address. */
1927
1927
  paymentToken: string;
1928
- /** Total price in raw token units, as a decimal string. */
1929
- totalPrice: string;
1928
+ /** Per-unit price in raw token units, as a decimal string. The total paid is
1929
+ * `unitPrice × quantity` (quantity is 1 for ERC-721). */
1930
+ unitPrice: string;
1930
1931
  /** Which venue the order lives on. */
1931
1932
  standard: "ERC721" | "ERC1155";
1932
1933
  }
package/dist/index.cjs CHANGED
@@ -11180,18 +11180,20 @@ var StarknetVenue = class {
11180
11180
  }
11181
11181
  async fulfillOrder(signer, orderRef, opts) {
11182
11182
  const o = await this.deps.resolveOrder(orderRef);
11183
+ const quantity = opts?.quantity ?? "1";
11184
+ const totalPrice = (BigInt(o.unitPrice) * BigInt(quantity)).toString();
11183
11185
  if (o.standard === "ERC1155") {
11184
11186
  return this.m1155.fulfillOrder(signer, {
11185
11187
  orderHash: orderRef,
11186
11188
  paymentToken: o.paymentToken,
11187
- totalPrice: o.totalPrice,
11188
- quantity: opts?.quantity ?? "1"
11189
+ totalPrice,
11190
+ quantity
11189
11191
  });
11190
11192
  }
11191
11193
  return this.m721.fulfillOrder(signer, {
11192
11194
  orderHash: orderRef,
11193
11195
  paymentToken: o.paymentToken,
11194
- totalPrice: o.totalPrice
11196
+ totalPrice
11195
11197
  });
11196
11198
  }
11197
11199
  async cancelOrder(signer, orderRef) {