Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.slice.so/llms.txt

Use this file to discover all available pages before exploring further.

Usage

import { getDisplayedPrices } from "@slicekit/core"

const { displayedPrice, displayedFullPrice, isDiscounted, discountPercentage } =
  await getDisplayedPrices({
    product,
    ethUsd
  })

Parameters

product
ProductCart
required
Product to display the price of.
ethUsd
bigint
required
Current ETH to USD rate, with 6 decimal places.

Return Type

displayedPrice
string
Produce price the buyer has to pay.
displayedFullPrice
string
Produce price the buyer has to pay, excluding discounts.
isDiscounted
boolean
Boolean indicating if the product is discounted.
discountPercentage
number
Percentage of discount applied to the product.