JustMoney
  • Introduction
  • Whitepaper
  • $JM Token
    • Utility
    • Holders
    • Providers
    • Where to Buy
    • Additional Info
    • Contract Address
  • Partnership
    • Overview
    • Products
    • Support
  • JustMoney Swap
    • Overview
    • Token Listing
      • Self-listing
        • Custom Token Import
        • Adding Liquidity
      • White label solution
      • Marketing
    • Discounted swap fees on TRON (5-19trx)
    • Earn JM every day by providing energy
    • Multi-DEX routing
    • Widgets
      • Widget Builder
      • Single Chain
        • Usage
        • Examples
      • Multi-chain
      • Cross-chain
      • Bridge Widget
        • Usage
        • Examples
    • Holder ranks
  • JustMoney Bridge
    • Overview
  • JUSTMONEY EXPLORER
    • Overview
    • Blockchain Explorer
    • Token (dex view)
    • dApp store
      • Submit a project
    • Other features
    • GraphQL Server and Indexer
  • JustMoney Spot
    • Overview
    • FAQ
    • TradingView
  • JustMoney Pay
    • Overview
    • E-commerce integration
      • Woocommerce Plugin
    • Mobile Payment terminal
    • Payment Links
    • Donations
      • Installation
      • Customizing
    • API documentation
      • Creating an Order
      • Get Order Details
      • Get Order Status
  • JustMoney Invoice
    • Overview
    • Cost of Use
    • Payment Processing
    • Features
    • How to Create Invoice
  • JustMoney Gift
    • Overview
    • How to Send
    • How to Claim
    • FAQ
  • Brand Kit
  • Contact Us
Powered by GitBook
On this page
  1. JustMoney Swap
  2. Widgets
  3. Single Chain

Examples

POLY, BSC, BTTC

<script src="https://just.money/assets/js/widgetLib-1.1.js"></script>
<script type="application/javascript">
    JmApi.swapWidget('jmSwapFrame', {
        network: 'BTTC',
        slippage: 0.05,
        liquidityTab: true,
        shadow: false,
        backgroundColor: '#F3F3F3',
        backgroundImage: 'url(/assets/img/swap-form-bg-lighter.svg);',
        textColor: '#000',
        buttonStyle: 'background:#000;color:#FFF;',
        maxButtonStyle: 'background:#FFF;color:#000;',
        headingStyle: 'color:#353840;text-shadow:none',
        lightBranding: false,
        tokens: ['TRX', 'BTT'],
        fromToken: "TRX",
        toToken: "BTT",
    });
</script>

<iframe id="jmSwapFrame" src="https://just.money/widget" style="width:500px;height:500px;margin:auto;display:block;" allowtransparency="true" frameborder="0" scrolling="no"></iframe>

Or create element automatically by

<script src="https://just.money/assets/js/widgetLib-1.1.js"></script>
<script type="application/javascript">
    JmApi.createSwapWidget('anyID', {
        type:'SINGLECHAIN',
        network: 'BTTC',
        slippage: 0.05,
        liquidityTab: true,
        shadow: false,
        backgroundColor: '#F3F3F3',
        backgroundImage: 'url(/assets/img/swap-form-bg-lighter.svg);',
        textColor: '#000',
        buttonStyle: 'background:#000;color:#FFF;',
        maxButtonStyle: 'background:#FFF;color:#000;',
        headingStyle: 'color:#353840;text-shadow:none',
        lightBranding: false,
        tokens: ['TRX', 'BTT'],
        fromToken: "TRX",
        toToken: "BTT",
    });
</script>

You can customize the options inside JMSwapOptions object e.g. change the background color, button colors or tokens that will be visible.

If you want to show all the tokens and not limit the tokens, use empty array (tokens: [])

If you do not wish to show liquidity tab and allow liquidity operations for users set liquidityTab property to false.

PreviousUsageNextMulti-chain

Last updated 1 year ago