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

Usage

Format: JmApi.swapWidget(elementId, options);

In this case iframe element must be created in HTML. You need to pass elementId to the function and it will attach to the correct element.

Format: JmApi.createSwapWidget(element, options);

This will create the iframe element. You need to pass "type" of the element in options object (see examples below). Type can be "SINGLECHAIN", "MULTICHAIN" or "CROSSCHAIN". If type is not passed "SINGLECHAIN" will be used as default.

Element can be ID of already existing element or an instance of an HTMLElement. It will be appended inside that element. If element does not exist it will be created with this given ID. If element is null, the element will be created with random ID.

Returns: ID of the iframe element.

Parameters:

  • type: type of the widget ("SINGLECHAIN", "MULTICHAIN" or "CROSSCHAIN")

  • network: the network that this widget is for. String if type is 'SINGLECHAIN', array if type is 'MULTICHAIN'

  • slippage: slippage setting for the swap

  • liquidityTab: can add or remove liquidity if set to true

  • shadow: draw shadow under the widget element

  • tokens: array of tokens to be visible on the swap widget UI. Empty array shows all tokens.

  • fromToken: default token selected for 'from' field

  • toToken: default token selected for 'to' field

  • backgroundColor: background color of the widget. Can also be set to 'transparent'

  • backgroundImage: background image of the widget

  • textColor: main text color

  • buttonStyle: large button style

  • maxButtonStyle: style of the "max" button which is shown after user has connected to the widget

  • inputContainerStyle: style of the input containers and dropdown elements

  • headingStyle: style of the main heading

  • lightBranding: JustMoney logo white when set to true, dark if set to false

PreviousSingle ChainNextExamples

Last updated 2 years ago