Widget configuration and all about configuration for two connection methods
@swap-coffee/ui-sdk
and @tonconnect/ui
.
TonConnect
and the Swap Widget. This file will include the manifestUrl
for the TonConnect manifest and other configuration parameters.
Here’s an example configuration file named config.js
:
createSwapWidget
function accepts several configuration properties that allow you to customize the widget’s appearance, behavior, and connection settings.
string
):
Example: '#swap-widget-component'
object
):theme
(string
): Defines the visual theme of the widget.Options:'light'
,'dark'
,'coffee'
locale
(string
): Specifies the language and regional settings for the widget.Options:'zh'
,'ua'
,'ru'
,'en'
,'es'
,'fr'
,'fa'
tonConnectManifest
(object
): Configuration for the TonConnect manifest.
url
(string
): The URL pointing to the TonConnect manifest. This manifest contains details about the TonConnect application and its settings.tonConnectUi
(TonConnectUI instance
): An instance of TonConnectUI
for managing wallet connections and interactions.
injectionMode
(string
):
Example: 'tonConnect'
@swap-coffee/ui-sdk
with Payload Injection Mode.
config.js
:
Payload Injection Mode
for the Swap Widget. The injectionMode
parameter is set to 'payload'
, indicating that the widget will bypass TonConnect and use a custom method for handling wallet interactions.
Payload
Connection Configuration Structure for Swap Widget
Payload
connection for the swap.coffee widget
, you need to define the payload
object. This object contains all necessary parameters for establishing a manual wallet connection.
Here is an example configuration (payload.js
):
payload
injection mode)payload
injection mode, the createSwapWidget
function accepts several configuration properties that allow you to customize the widget’s appearance, behavior, and connection settings.
string
):
Example: '#swap-widget-component'
object
):theme
(string
): Defines the visual theme of the widget.Options:'light'
,'dark'
,'coffee'
locale
(string
): Specifies the language and regional settings for the widget.Options:'zh'
,'ua'
,'ru'
,'en'
,'es'
,'fr'
,'fa'
object
):payload
(object
): The main object for configuring the connection to injectionMode: 'payload'
the swap.coffee widget
, containing all the necessary parameters to establish the connection through the wallet.Example: for more information, please refer to section 2 (Payload
Connection Configuration Structure forSwap Widget
).
injectionMode
(string
):
Options: 'payload'