0.1.6 • Published 1 year ago

@antefinance/ante-widget v0.1.6

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Setup and build ante-widget frontend

Create an .env file under /frontend folder with:

REACT_APP_ANTE_BASE_URL="https://ante.finance"
REACT_APP_ANTE_TESTNET_BASE_URL="https://testnet.ante.finance"
REACT_APP_SERVER_BASE_URL="http://localhost:8080"

Replace the REACT_APP_SERVER_BASE_URL with the endpoint for accessing the ante-widget server Run

npm i
npm run build

This will generate the following files:

/frontend/dist/widget.js
/frontend/dist/widget.css

These files should be served by the partner's application. E.g.

<head>
    ...
    <link href="<path_to_widget_css>" rel="stylesheet" />
</head>  

<div class="ante-project-widget"></div>
<div class="ante-test-widget"></div>
<script src="<path_to_widget_js>"></script>
<script>
    AnteWidget.Project('.ante-project-widget',{
        name: 'ETH2',
        // testnet: true, // Default value is false
    });
    AnteWidget.Test('.ante-test-widget',{
        address: '0x806f60015F245F9F6442f9c81f915E45CCd76637',
        chain: '0x5' 
    });
</script>