token-swap-widget
v1.0.0
Published
A JavaScript package for integrating a token swap widget into web applications.
Readme
Token Swap Widget
A JavaScript package for integrating a token swap widget into web applications.
Installation
npm install token-swap-widgetUsage
const TokenSwapWidget = require('token-swap-widget');
// Create a new instance of the Token Swap Widget
const tokenSwapWidget = new TokenSwapWidget();
// Render the widget within a specified container element
const containerId = 'token-swap-container';
tokenSwapWidget.render(containerId);API
render(containerId)
Renders the token swap widget within a specified HTML container element.
containerId: The id of the HTML container element where the widget will be rendered.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Token Swap Widget Example</title>
</head>
<body>
<div id="token-swap-container"></div>
<script src="bundle.js"></script>
<script>
const tokenSwapWidget = require('token-swap-widget');
tokenSwapWidget.render('token-swap-container');
</script>
</body>
</html>License
This project is licensed under the MIT License - see the LICENSE file for details.
