node-red-contrib-iota-chrysalis
Version:
Node Red integration whith IOTA for Chrysalis. A new Dawn.
105 lines (94 loc) • 4.05 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('iotaaddress',{
category: 'IOTA 1.5',
color: '#3FADB5',
defaults: {
iotaNode: {value: "", type:"iotaserver"},
iotaAddressFrom: {value: "atoi1qrtfsyxn6l3yt6hprxgwvkq9ph98x6ykk6xaaxyk5wwzpldxmkkac2s3rvy"},
iotaSelect: {value: "AddressInfo"},
name: {value:""}
},
inputs:1,
outputs:1,
icon: "iota15.png",
label: function() {
return this.name||"iotaaddress";
}
});
</script>
<script type="text/x-red" data-template-name="iotaaddress">
<div class="form-row">
<label for="node-function-iotaNode"><i class="fa fa-server"></i> IOTA node</label>
<input type="text" id="node-input-iotaNode" placeholder="node">
</div>
<div class="form-row">
<label for="node-function-iotaSelect"><i class="icon-tag"></i> Select Function</label>
<select id="node-input-iotaSelect">
<option value="AddressInfo">AddressInfo</option>
<option value="AddressOutput">AddressOutput</option>
<option value="OutputInfo">OutputInfo</option>
</select>
</div>
<div class="form-row">
<label for="node-function-iotaAddressFrom"><i class="icon-tasks"></i> Address or Output</label>
<input type="text" id="node-input-iotaAddressFrom" placeholder="Bech32 format address or output id">
</div>
<div class="form-row">
<label for="node-function-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" class="paletteLabel" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="iotaaddress">
<p>Connects to IOTA Tangle Chrysalis.</p>
<b>IOTAnode: </b> Setup IOTA Chrysalis node provider settings like host, port (14265 or 443 - are usual).<br><br>
<b>Select Function:</b> Enter yout type of function to run.<br><br>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type">string | json</span>
</dt>
<dd> the payload injected for address or output field:
</dd>
<dt class="optional">topic <span class="property-type">string</span></dt>
<dd> topic value not used.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Standard output
<dl class="message-properties">
<dt>payload <span class="property-type">string | object</span></dt>
<dd>the standard output of the command.</dd>
</dl>
</li>
<li>Standard error
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>the standard error of the command.</dd>
</dl>
</li>
</ol>
<h3>Details</h3>
<p><code>msg.payload</code> is used as the payload injected of the node.
If payload is string will be used as address field.
If it contains an JSON object are used as value fields.
<h3>AddressInfo</h3>
<p>Assume injected msg.payload as String is a <code>address</code> or you can inject Json format like this:</p>
<p><code>payload = {
<p> address : String or Hex}
</code></p>
<h3>AddressOutput</h3>
<p>Assume injected msg.payload as String is a <code>address</code> or you can inject Json format like this:</p>
<p><code>payload = {
<p> address : String or Hex}
</code></p>
<h3>OutputInfo</h3>
<p>Assume injected msg.payload as String is a <code>address</code> or you can inject Json format like this:</p>
<p><code>payload = {
<p> output : String or Hex}
</code></p>
<h3>References</h3>
<ul>
<li><a href = "https://github.com/iotaledger/iota.js/tree/main/docs"> GitHub</a>
<p>Read more about iota.js API.</p></li>
</ul>
</script>