Catenis Flow Guide

List Asset Migration Node

The List Asset Migrations node retrieves a list of Catenis Smart Assets previously migrated (units of the asset transferred) that satisfies the specific search criteria you provide. This node displays the status and all pertinent information about the units that were migrated.

Image of the List Asset Migration Node

Node Properties Panel Field Description

Node property configuration slide-out panel (this panel is accessed by double-clicking on the node).

6. List Asset migrate Node Properties image
Properties Configuration Panel of the List Asset Migration Node

Node-RED Specific Fields

  1. Name Field:  Add a descriptive name that will help differentiate this node from others of the same type on the Node-RED workspace (not required).
  2. Connection Field: This drop-down selection is required. Set a previously configured Catenis connection (virtual device). If you need to configure a new virtual device, click the pencil button to the right of the field and follow the directions on setting up a new virtual device that you can find here.

Catenis Flow Setting Fields

  1. Asset ID: Enter the ID of an asset you have previously migrated.
  2. Foreign Blockchain: Select the foreign blockchain you are searching for in Exported Assets. The blockchains currently supported are, Ethereum • Binance Smart Chain • Polygon PoS Chain.
  3. Migration Direction: You can migrate units of a Catenis Smart Asset to a foreign blockchain (outward). If you wish, you can convert these units back into Catenis Smart Assets (inward) from the foreign blockchain you had previously exported to. Select the direction of migrated assets you want to find.
  4. Status: Enter a single status or a comma-separated list of statuses to include, such as pending, success, error, etc.
  5. Negate Status: This indicates whether the statuses should be excluded or not.
  6. Start Date: Enter a date that specifies the start of the period you wish to see the history, enter a start date.
  7. End Date: Enter a date that specifies the end of the period you wish to view the history, enter an end date.
  8. Limit: Enter a number to specify the maximum amount of issuances you wish to be returned. (Optional)
  9. Skip: Enter a number to skip a set amount of issuances (starting from the first issue). (Optional)

Note: This node can be used in two modes: “Interactive” and “Run-Time.”

How to Use in Run-Time Mode

  1. Drag-and-drop the List Asset Migrations Node from the Catenis Flow pallet area on the left-hand side of the interface to the Node-RED workspace. Double-click on the node to display the properties slide-out panel.
  2. On the “Device” drop-down field of the properties slide-out panel, choose the Catenis Virtual Device you previously configured. The virtual device is a configuration node containing the Catenis Virtual Device information (The device ID and API Secret key). If you do not have a virtual device already configured, please refer to our documentation titled: “Configure your First Virtual Device on Node-RED” here:
  3. Add the node’s configuration information to each field of the properties slide-out panel.  Please refer to the description of each field under the section named “Node Properties Panel Field Description” for proper usage.
  4. Then, wire this node to a debug node. 
  5. Next, drag-and-drop an “inject” node to the Node-RED workspace.
  6. Wire the “inject” node to the “List Asset Migration” node, and double click the inject node to open its properties slide-out panel. 
  7. Alter the information in the inject node’s properties slide-out panel by selecting the drop-down “Payload” field and choosing the “JSON” Type. An Ellipse button “…” will appear to the right of the field. Click this ellipse button to display a JSON edit box. 
  8. Enter the JSON information you wish to pass as input to the Catenis Node (an example JSON input is below). After entering your JSON text entry, click the red “Done” button. Click the Done button again to exit the properties dialogue box.
  9. Click the red “Deploy” button on the upper right-hand side of the Node-RED dashboard to deploy this flow.
  10. Now, let’s test the flow: Click the button on the left attached to the inject node to send the input from the inject node to the flow.
  11. The debug sidebar should display the returned JSON object containing the API call results to the right side of the workspace.

How to Use Interactively

  1. In Interactive Mode: The end-user clicks on the action button (on the left) attached to the node. Then the Catenis API method is called, using the default settings (as specified in the node’s properties slide-out panel configuration).
  2. Follow steps 1 through 4 under “How to use in Run-Time Mode” in the section above.
  3. Click the red “Deploy” button on the upper right-hand side of the Node-RED dashboard to deploy this flow.
  4. Now, let’s test the flow: Click the button on the left attached to this node to send the default property panel setting to the Catenis APIs and through the flow. 
  5. The debug sidebar should display the returned JSON object containing the results to the right side of the workspace

Example JSON Object that can be passed to the Catenis Flow node


{
    "selector": {
        "assetId": " Insert_Your_Asset_ID_Here ",
        "foreignBlockchain": "ethereum",
        "direction": "outward",
        "status": "pending,interrupted,success,error",
        "negateStatus": false
    },
    "limit": 3,
    "skip": "null"
}

Note: Inputs injected into this node via a JSON object containing alternate node properties will override the properties set on this node's slide-out properties panel.

Example Flow - Import into Node-Red to Get Started


[{"id":"e60b6515.0abe78","type":"list asset migrations","z":"3dbf2c28.70dd6c","name":"","connection":"28d3e626.bfe6b2","assetId":"abjd8ZWx7CSTm7LSgoBz","foreignBlockchain":"ethereum","direction":"outward","status":"","negateStatus":false,"startDate":"","endDate":"","limit":"","skip":"","x":400,"y":520,"wires":[["8c3e8c9b.81c2e8"]]},{"id":"aec42e38.ad1e48","type":"inject","z":"3dbf2c28.70dd6c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"selector\":{\"assetId\":\"ENTER_YOUR_ASSET_ID\",\"foreignBlockchain\":\"ethereum\",\"direction\":\"outward\",\"status\":\"pending,interrupted,success,error\",\"negateStatus\":false},\"limit\":3,\"skip\":\"null\"}","payloadType":"json","x":150,"y":520,"wires":[["e60b6515.0abe78"]]},{"id":"8c3e8c9b.81c2e8","type":"debug","z":"3dbf2c28.70dd6c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":520,"wires":[]},{"id":"32daad09.df69e2","type":"comment","z":"3dbf2c28.70dd6c","name":"Set virtual device for this Catenis node - Click for instructions","info":"All Catenis nodes require that you set the proper virtual device on its slideout property panel on the device field. A Catenis Virtual Device is the equivalent of an API Account credential. If you are not familiar with a Catneis Virtual device, please read \"The Catenis Virtual Device\" in the Users guide.\n\n\nNot setting the virtual device properly will result in a \"TypeError: Cannot read property 'ctnApiClient' of null.\" ","x":420,"y":480,"wires":[]},{"id":"89e506a4.c0f73","type":"comment","z":"3dbf2c28.70dd6c","name":"Click for instructions","info":"Please use an asset ID of an Catenis asset you have previously migrated. Note: should be set to null to force the search criteria not to include this parameter\n\nSTEPS:\n1) Double-click the \"inject\" node to alter the information in the inject node. Select the drop-down payload field and choose the \"JSON\" Type.\n\n2)Click the ellipses \"...\" to the right of the JSON field. This will open up a slide-out box where you can edit the JSON File.\n\n3)Modify the Asset ID information by using an asset ID you have previously issued.\n\n4)Modify the other search perameters based on the results you wish to see. ","x":150,"y":560,"wires":[]},{"id":"28d3e626.bfe6b2","type":"catenis api connection","name":"Bitcoin API Connection","deviceId":"dL8zaQDcyNvxRW3FqsJd","apiAccessSecret":"2e080fe06bd9d6403639d8e7c8d4b518949fdbf1e76a651e29706135a98c73dc815ee7647f7cb9b5ae19b04010b32718f1b85aacdd281677aca7499eeb3275f7","host":"","environment":"sandbox","secure":true,"version":"","useCompression":true,"compressThreshold":""}]

Related Articles