<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <head> <title>Reference</title> <link rel="stylesheet" href="../ldoc.css" type="text/css" /> </head> <body> <div id="container"> <div id="product"> <div id="product_logo"></div> <div id="product_name"><big><b></b></big></div> <div id="product_description"></div> </div> <!-- id="product" --> <div id="main"> <!-- Menu --> <div id="navigation"> <br/> <h1>Modpol</h1> <ul> <li><a href="../index.html">Index</a></li> </ul> <h2>Contents</h2> <ul> <li><a href="#Functions">Functions</a></li> <li><a href="#Tables">Tables</a></li> </ul> <h2>Modules</h2> <ul class="nowrap"> <li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li> <li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li> <li><a href="../modules/change_modules.html">change_modules</a></li> <li><a href="../modules/change_modules.html">change_modules</a></li> <li><a href="../modules/consent.html">consent</a></li> <li><a href="../modules/create_token.html">create_token</a></li> <li><a href="../modules/defer_consent.html">defer_consent</a></li> <li><a href="../modules/display_processes.html">display_processes</a></li> <li><a href="../modules/join_org.html">join_org</a></li> <li><a href="../modules/join_org_consent.html">join_org_consent</a></li> <li><a href="../modules/leave_org.html">leave_org</a></li> <li><a href="../modules/message_org.html">message_org</a></li> <li><a href="../modules/randomizer.html">randomizer</a></li> <li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li> <li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li> <li><a href="../modules/remove_org.html">remove_org</a></li> <li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li> <li><a href="../modules/remove_process.html">remove_process</a></li> <li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li> <li><a href="../modules/send_token.html">send_token</a></li> <li><a href="../modules/module_template.html">module_template</a></li> <li><strong>tokenomics</strong></li> <li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li> <li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li> <li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li> <li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li> <li><a href="../modules/priv_to_org.html">priv_to_org</a></li> <li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li> </ul> </div> <div id="content"> <h1>Module <code>tokenomics</code></h1> <p>Tokenomics.</p> <p> Depends on consent</p> <h2><a href="#Functions">Functions</a></h2> <table class="function_list"> <tr> <td class="name" nowrap><a href="#initiate">initiate (result)</a></td> <td class="summary">Initiate function: creates a token in an org.</td> </tr> <tr> <td class="name" nowrap><a href="#create_token">create_token ()</a></td> <td class="summary">Create token</td> </tr> <tr> <td class="name" nowrap><a href="#balance">balance (org, token, user)</a></td> <td class="summary">Returns balance.</td> </tr> <tr> <td class="name" nowrap><a href="#change_balance">change_balance (org, token, user, amount)</a></td> <td class="summary">Change balance</td> </tr> <tr> <td class="name" nowrap><a href="#transfer">transfer (org, token, sender, recipient, amount)</a></td> <td class="summary">Transfer tokens from a sender to recipient</td> </tr> <tr> <td class="name" nowrap><a href="#treasury_transfer">treasury_transfer (org, token, recipient, amount)</a></td> <td class="summary">Transfer from treasury</td> </tr> <tr> <td class="name" nowrap><a href="#issue">issue (org, token, amount)</a></td> <td class="summary">Creates new tokens in the org treasury</td> </tr> </table> <h2><a href="#Tables">Tables</a></h2> <table class="function_list"> <tr> <td class="name" nowrap><a href="#config">config</a></td> <td class="summary">Config for module</td> </tr> </table> <br/> <br/> <h2 class="section-header "><a name="Functions"></a>Functions</h2> <dl class="function"> <dt> <a name = "initiate"></a> <strong>initiate (result)</strong> </dt> <dd> Initiate function: creates a token in an org. Set up the token data structure. Create an org treasury <h3>Parameters:</h3> <ul> <li><span class="parameter">result</span> (optional) Callback if this module is embedded in other modules </li> </ul> </dd> <dt> <a name = "create_token"></a> <strong>create_token ()</strong> </dt> <dd> Create token </dd> <dt> <a name = "balance"></a> <strong>balance (org, token, user)</strong> </dt> <dd> Returns balance. If no user, get treasury balance <h3>Parameters:</h3> <ul> <li><span class="parameter">org</span> Name (string) or id (num) </li> <li><span class="parameter">token</span> Slug (string) </li> <li><span class="parameter">user</span> Name (string) </li> </ul> </dd> <dt> <a name = "change_balance"></a> <strong>change_balance (org, token, user, amount)</strong> </dt> <dd> Change balance <h3>Parameters:</h3> <ul> <li><span class="parameter">org</span> Org name (string) or id (number) </li> <li><span class="parameter">token</span> Token slug (string) </li> <li><span class="parameter">user</span> </li> <li><span class="parameter">amount</span> </li> </ul> </dd> <dt> <a name = "transfer"></a> <strong>transfer (org, token, sender, recipient, amount)</strong> </dt> <dd> Transfer tokens from a sender to recipient <h3>Parameters:</h3> <ul> <li><span class="parameter">org</span> </li> <li><span class="parameter">token</span> </li> <li><span class="parameter">sender</span> </li> <li><span class="parameter">recipient</span> </li> <li><span class="parameter">amount</span> Positive number </li> </ul> </dd> <dt> <a name = "treasury_transfer"></a> <strong>treasury_transfer (org, token, recipient, amount)</strong> </dt> <dd> Transfer from treasury <h3>Parameters:</h3> <ul> <li><span class="parameter">org</span> </li> <li><span class="parameter">token</span> </li> <li><span class="parameter">recipient</span> </li> <li><span class="parameter">amount</span> Can be positive or negative, assumes flow from treasury to recipient </li> </ul> </dd> <dt> <a name = "issue"></a> <strong>issue (org, token, amount)</strong> </dt> <dd> Creates new tokens in the org treasury <h3>Parameters:</h3> <ul> <li><span class="parameter">org</span> </li> <li><span class="parameter">token</span> </li> <li><span class="parameter">amount</span> </li> </ul> </dd> </dl> <h2 class="section-header "><a name="Tables"></a>Tables</h2> <dl class="function"> <dt> <a name = "config"></a> <strong>config</strong> </dt> <dd> Config for module <h3>Fields:</h3> <ul> <li><span class="parameter">consent</span> Require consent to create? </li> <li><span class="parameter">token_variables</span> the data that goes into the token </li> <li><span class="parameter">token_slug</span> A no-spaces slug for the token </li> <li><span class="parameter">initial_treasury</span> Quantity in org treasury </li> <li><span class="parameter">negative_spend</span> Boolean: can users spend negative tokens? (for mutual credit) </li> <li><span class="parameter">balances</span> Table of user balances </li> </ul> </dd> </dl> </div> <!-- id="content" --> </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> <i style="float:right;">Last updated 2022-01-23 18:18:51 </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> </html>