UNPKG

o3-dapi-ont

Version:
257 lines (204 loc) 9.38 kB
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta property="og:title" content="O3 dapi - Ontology OEP4"> <meta property="og:type" content="website"> <meta property="og:url" content="https://o3.network"> <meta property="og:image" content="https://cdn.o3.network/img/nep5icons/ONT.png"> <meta property="og:description" content="A testbed for the O3 dapi Ontology OEP4 Token Standard."> <title>O3 dapi - ONT OEP4</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <link rel="stylesheet" href="./styles.css"> <!-- <script type="text/javascript" src="../../../core/lib/o3-dapi-core.min.js"></script> <script type="text/javascript" src="../../lib/o3-dapi-ont.min.js"></script> --> <!-- <script type="text/javascript" src="../../../core/build/bundle.js"></script> <script type="text/javascript" src="../../build/bundle.js"></script> --> <script src="https://cdn.jsdelivr.net/npm/o3-dapi-core@0.2.0/lib/o3-dapi-core.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/o3-dapi-ont@0.2.3/lib/o3-dapi-ont.min.js"></script> </head> <body> <div class="nav"> <h4 class="title">O3 dapi - ONT OEP4</h4> <div class='account-container'> <div id="account" class="account"></div> <div id="disconnect" class="disconnect" onclick="disconnect()"></div> </div> <select id="networks" name="networks"></select> </div> <div class="contracthash-container"> <div>Contract hash:</div> <input id='contractHash' type="text" value="8cae506e0c37359626e341e44a2ab166055bec78"/> </div> <div class="content"> <div class="functions"> <h3>Available functions</h3> <div class="scroll-container"> <div class="function-container"> <h5 class="title">getTokenDetails</h5> <p class="text"> <p>Returns name, symbol, decimals, and total supply of a given token.</p> </p> <button type="button" class="btn btn-primary" onclick="getTokenDetails()">Submit</button> </div> <div class="function-container"> <h5 class="title">getName</h5> <p class="text"> <p>Returns the name of a given token.</p> </p> <button type="button" class="btn btn-primary" onclick="getName()">Submit</button> </div> <div class="function-container"> <h5 class="title">getSymbol</h5> <p class="text"> <p>Returns the symbol of a given token.</p> </p> <button type="button" class="btn btn-primary" onclick="getSymbol()">Submit</button> </div> <div class="function-container"> <h5 class="title">getDecimals</h5> <p class="text"> <p>Returns the number of decimals of a given token.</p> </p> <button type="button" class="btn btn-primary" onclick="getDecimals()">Submit</button> </div> <div class="function-container"> <h5 class="title">getTotalSupply</h5> <p class="text"> <p>Returns the total supply of a given token.</p> </p> <button type="button" class="btn btn-primary" onclick="getTotalSupply()">Submit</button> </div> <div class="function-container"> <h5 class="title">getBalanceOf</h5> <p class="text"> <p>Returns the balance of a given account.</p> </p> <br/> <p>Account address:</p> <input id='getBalanceOfAddressInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <button type="button" class="btn btn-primary" onclick="getBalanceOf()">Get balance</button> </div> <div class="function-container"> <h5 class="title">transfer</h5> <p class="text"> <p>Transfer tokens.</p> </p> <br/> <p>From address:</p> <input id='transferFromInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <br/> <p>To address:</p> <input id='transferToInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <br/> <p>Amount:</p> <input id='transferAmountInput' type="text" placeholder="0.001"/> <br/> <p>Gas price override (optional):</p> <input id='transferGasPriceInput' type="text" placeholder="500"/> <br/> <p>Gas limit override (optional):</p> <input id='transferGasLimitInput' type="text" placeholder="20000"/> <button type="button" class="btn btn-primary" onclick="transfer()">Submit</button> </div> <div class="function-container"> <h5 class="title">transferMulti</h5> <p class="text"> <p>Execute multiple transfers.</p> </p> <br/> <p>Outputs:</p> <textarea id='transferMultiOutputsInput'>[{"from":"AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ","to":"AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ","amount":"0.0001"}]</textarea> <br/> <p>Gas price override (optional):</p> <input id='transferMultiGasPriceInput' type="text" placeholder="500"/> <br/> <p>Gas limit override (optional):</p> <input id='transferMultiGasLimitInput' type="text" placeholder="20000"/> <button type="button" class="btn btn-primary" onclick="transferMulti()">Submit</button> </div> <div class="function-container"> <h5 class="title">getAllowance</h5> <p class="text"> <p>Returns the transfer allowance from one account to another.</p> </p> <br/> <p>Owner address:</p> <input id='getAllowanceOwnerInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <br/> <p>Spender address:</p> <input id='getAllowanceSpenderInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <button type="button" class="btn btn-primary" onclick="getAllowance()">Get allowance</button> </div> <div class="function-container"> <h5 class="title">approve</h5> <p class="text"> <p>Pre approve a transfer from one address to another.</p> </p> <br/> <p>Owner address:</p> <input id='approveOwnerInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <br/> <p>Spender address:</p> <input id='approveSpenderInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <br/> <p>Amount:</p> <input id='approveAmountInput' type="text" placeholder="0.001"/> <br/> <p>Gas price override (optional):</p> <input id='approveGasPriceInput' type="text" placeholder="500"/> <br/> <p>Gas limit override (optional):</p> <input id='approveGasLimitInput' type="text" placeholder="20000"/> <button type="button" class="btn btn-primary" onclick="approve()">Submit</button> </div> <div class="function-container"> <h5 class="title">transferFrom</h5> <p class="text"> <p>Transfer tokens from another address.</p> </p> <br/> <p>From address:</p> <input id='transferFromFromInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <br/> <p>To address:</p> <input id='transferFromToInput' type="text" placeholder="AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ"/> <br/> <p>Amount:</p> <input id='transferFromAmountInput' type="text" placeholder="0.001"/> <br/> <p>Gas price override (optional):</p> <input id='transferFromGasPriceInput' type="text" placeholder="500"/> <br/> <p>Gas limit override (optional):</p> <input id='transferFromGasLimitInput' type="text" placeholder="20000"/> <button type="button" class="btn btn-primary" onclick="transferFrom()">Submit</button> </div> <div class="function-container"> <h5 class="title">init</h5> <p class="text"> <p>Initialize the contract.</p> </p> <br/> <p>Gas price override (optional):</p> <input id='initGasPriceInput' type="text" placeholder="500"/> <br/> <p>Gas limit override (optional):</p> <input id='initGasLimitInput' type="text" placeholder="20000"/> <button type="button" class="btn btn-primary" onclick="init()">Init</button> </div> </div> </div> <div class="output"> <h3>Output</h3> <div class="scroll-container"> <div id="loading"><div style="width:100%;height:100%" class="lds-pacman"><div><div></div><div></div><div></div></div><div><div></div><div></div></div></div></div> <div id="result"></div> <div id="error"></div> </div> </div> </div> <script type="text/javascript" src="./main.js"></script> </body> </html>