Skip to content

dextools-io/chart-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 

Repository files navigation

DEXTools chart widget

(This is the public documentation repo of the DEXTools Chart Widget)

The Chart Widget allows websites to display an embedded trading chart for any pool supported by DEXTools.io app. Chart data is updated in real-time, including the current price in USD.

widget screenshot

Chart display is provided by TradingView

Get your pool/token iframe widget code

  1. First search your favorite token or pool by address, name... using the DEXTools search bar.

search screenshot

  1. Then click the share option of the DEXTools pair explorer, a pop-up will appear with the code to copy.

share panel screenshot

Quick Example

An iframe based integration example follows:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>DEXTools Pair Explorer Widget Template</title>
</head>

<body>

   <iframe id="dextools-widget"
    title="DEXTools Trading Chart"
    width="500"
    height="400" src="https://www.dextools.io/widget-chart/en/ether/pe-light/0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d?theme=light&chartType=2&chartResolution=30&drawingToolbars=false"></iframe>

</body>
</html>

Common issues and testing

You can test if the IFrame integration works properly with the https://iframetester.com/ tool.

In case of errors showing a Chart in your website, please check your CSP policy for IFrame content https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

Please be aware that USE OF CHART WIDGET IFRAME FROM localhost WON'T WORK, please use a real domain instead.

Customization options

The widget is configured adjusting following parts and query parameters of this URL:

https://www.dextools.io/widget-chart/en/<chainId>/pe-light/<pairAddress>?theme=<theme>&chartType=<chartType>&chartResolution=<chartResolution>&drawingToolbars=<drawingToolbars>&tvPlatformColor=<color>&tvPaneColor=<color>&headerColor=<color>&chartInUsd=<chartInUsd>
Parameter Values
chainId blockchain ID (see list below)
pairAddress address of the pool to display
theme dark or light
chartType 0 = Bar
1 = Candle
2 = Line
3 = Area
8 = Heikin Ashi
9 = hollow candle
10 = Baseline
chartResolution 1 (minute), 3, 5, 15, 30, 60, 120, 240, 720, 1D, 3D, 1W, 1M
drawingToolbars false or true
headerColor custom color for the widget header.
IMPORTANT: should be in hexadecimal format without the #
tvPlatformColor custom color for the chart background.
IMPORTANT: should be in hexadecimal format without the #
tvPaneColor custom color for the chart controls background.
IMPORTANT: should be in hexadecimal format without the #
chartInUsd false to show the "Token/<chain reference token>" chart, otherwise (also if this param is not passed) the chart is the "Token/USD" one by default

Supported blockchains

We add support for new blockchains frequently. This is the current list of available blockchains:

Blockchain ID
ETHEREUM ether
BNB bnb
POLYGON polygon
FANTOM fantom
CRONOS cronos
AVALANCHE avalanche
METIS metis
OPTIMISM optimism
ARBITRUM arbitrum
CELO celo
TELOS telos
FUSE fuse
OKTC (FORMER OEC) oktc
KAIA kaia
SEI sei
SOLANA solana
DOGE CHAIN dogechain
GNOSIS gnosis
FLARE flare
ARBITRUM NOVA arbitrumnova
CONFLUX conflux
ELASTOS elastos
KAVA kava
RONIN ronin
APTOS aptos
MULTIVERSX (FORMER ELROND) multiversx
PROOF OF MEMES pom
ENERGI energi
ZKSYNC zksync
POLYGON-ZKEVM polygonzkevm
PULSE pulse
LINEA linea
BASE base
MANTLE mantle
OPBNB opbnb
SHIBARIUM shib
SCROLL scroll
MANTA manta
KUJIRA kujira
BLAST blast
OSMOSIS osmosis
X LAYER xlayer
MODE mode
TON ton
HEDERA hedera
NEAR near
TRON tron
BITLAYER bitlayer
APE CHAIN apechain
ELYSIUM elysium
CRONOS-ZKEVM cronoszkevm
IOTA-EVM iotaevm
WORLD CHAIN worldchain
CHILIZ chiliz
ICP icp
XRPL xrpl
SONIC sonic
INK ink
XDC xdc
ABSTRACT abstract
PAW CHAIN pawchain
BERA CHAIN berachain
UNI CHAIN unichain
UNIT ZERO units
SONEIUM soneium
HYPER EVM hyperevm
SUI sui
VSC vsc
STORY story
ODYSSEY odyssey
GRAVITY ALPHA gravityalpha
SHIDO shido
SUPERSEED superseed
ETHERLINK etherlink
U2U utwou
NIBIRU nibiruevm
PLASMA plasma
QUBIC qubic

About

DEXTools chart widget docs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6