Sales

The ultimate guide to integrate crypto token sales.

DePay Sales allows you easily sell tokens directly from your website or Dapp while accepting thousands of crypto assets as means of payment.


Preparation

In order to to sell tokens in a decentralized way on any blockchain you need to have a decentralized liquidity pool (dex pair) on any decentralized exchange:

How to list your token on UniSwap


Button

The DePay Sales button allows you to directly sell tokens from your website or Dapp without any further installation of javascript packages. Just use our button to open a widget that uses your configuration.

<div class="DePayButton" label="Buy" widget="Sale" arguments='{"amount": {"start": "10","min": "1","step": "1" }, "token": "0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb"}'></div>
<script src="https://depay.fi/integrate/buttons/v2.js"></script>
<noscript><a href="https://depay.fi">DePay</a> is currently not supported without JavaScript enabled.</noscript>
<script>DePayButtons.init({document: document});</script>

Use our configurator to make sure you pass the correct configuration.


Widget

If you want to open our widget directly from your application code, use our widget library.

Installation

You can either load the depay-widgets package via CDN:

<script src="https://depay.fi/integrate/widgets/v1.js"/>

or you install depay-widgets via the package manager of your choice and ship it as part of your application bundle:

yarn add depay-widgets
npm install depay-widgets --save

Load the DePayWidgets package wherever you need it and call th Sale method:

import DePayWidgets from 'depay-widgets';
DePayWidgets.Sale({
  amount: {
    start: "10",
    min: "1",
    step: "1"  
  },
  token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb'
});

Configuration

You need to pass a configuration object to DePayWidgets.Sale which needs to contain the fields:

amount

The amount object contains the amount of preselected tokens when the widget opens (start), the minimum amount of tokens the user can select in the widget (min) and by which number the amount increments/decrements when changed by the user (step). "20".

The BigNumber of that amount will be calculated internally including finding the right amount of decimals for the given token. So please just pass the amount in a human readable form: e.g. "20" for 20 USDT and not "2000000" (BigNumber).

token

The address of the token you want to receive.

callback

A function that will be called once the sale has been successfully confirmed by the network.

The widget will call the `callback` function passing a callback object as an argument:

{
  tx: 'the transaction hash of the confirmed transaction'
}


Configurator

Use our configurator in order to simplify the configuration:

Token
DEPAY
Amount

Place the following configured html code directly into your website:

<div class="DePayButton" label="Buy" widget="Sale" arguments='{"amount": {"start": "10","min": "1","step": "1" }, "token": "0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb"}'></div>
<script src="https://depay.fi/integrate/buttons/v2.js"></script>
<noscript><a href="https://depay.fi">DePay</a> is currently not supported without JavaScript enabled.</noscript>
<script>DePayButtons.init({document: document});</script>

or call the widget directly from your application code using the following configuration:

DePayWidgets.Sale({
  amount: {
    start: "10",
    min: "1",
    step: "1"  
  },
  token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb'
});

Support

Need additional help
?

Feel free to reach out in order to get additional help:

Ask the community
Open an issue
Start a conversation