Stellar Lumens StellarRed SDK Horizon

Connects with Stellar Horizon API to interact with the blockchain

Currently on Testnet

This flow builds a UI that can:

Generate keypairs

Check Balances

Notify after receiving a payment (some bugs still)

Send XLM or tokens

Make a trade offer

Add trustline

Generate a new token

Check Kraken Prices

  • UPDATED 4-28-21 -

Create NFTs

If you are already familiar with NodeRed all you need to do to make this flow work is add the following two lines to the functionGlobalContext of your settings.js file, typically located in /home/pi/.node-red

stellarsdk:require(“stellar-sdk”),

nodefetch:require(“node-fetch”)

https://blockshangerous.com/2021/03/23/getting-started-with-stellarred/

[{"id":"e1a3be1e.3571d","type":"tab","label":"Testnet","disabled":false,"info":""},{"id":"85337a8b.77ec28","type":"tab","label":"Monitor Testnet","disabled":false,"info":""},{"id":"873223c7.be785","type":"tab","label":"Prices","disabled":false,"info":""},{"id":"984ac0e8.61d6f","type":"tab","label":"Trade Bot","disabled":false,"info":""},{"id":"18789f31.847b91","type":"tab","label":"NFT","disabled":false,"info":""},{"id":"421cf1f0.a26fc","type":"tab","label":"Alternate Horizon","disabled":false,"info":""},{"id":"e6a7d07c.2f3da","type":"tab","label":"Create Token (batched)","disabled":false,"info":""},{"id":"62be80ab.53a19","type":"tab","label":"Create NFT (batched)","disabled":false,"info":""},{"id":"9ae7d6dd.0d8cc8","type":"tab","label":"NFT Multimaker","disabled":false,"info":""},{"id":"e777ddcb.05936","type":"group","z":"873223c7.be785","name":"Gui","style":{"fill":"#e3f3d3","label":true},"nodes":["6f17882e.936e18","94ffa29c.f4091"],"x":54,"y":179,"w":732,"h":82},{"id":"2bbf2098.ca1de","type":"group","z":"873223c7.be785","name":"Gui","style":{"fill":"#e3f3d3","label":true},"nodes":["c107c751.7d7688"],"x":654,"y":599,"w":152,"h":82},{"id":"cb0b3d69.08383","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Stellar UI","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":2}}},{"id":"41307496.abefbc","type":"ui_spacer","name":"spacer","group":"1460580e.155d28","order":6,"width":"12","height":"1"},{"id":"66a650e7.5a2fa","type":"ui_spacer","name":"spacer","group":"1460580e.155d28","order":4,"width":"12","height":"2"},{"id":"f6710e9b.c6e37","type":"ui_spacer","name":"spacer","group":"","order":4,"width":"6","height":1},{"id":"9d5dbfe4.946ec","type":"ui_spacer","name":"spacer","group":"","order":7,"width":"12","height":"1"},{"id":"eaad2b20.f0cd48","type":"ui_tab","name":"Account Generator","icon":"dashboard","order":2,"disabled":false,"hidden":false},{"id":"ddc63819.638318","type":"ui_tab","name":"Testnet","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"ecb2b774.b03fe8","type":"ui_tab","name":"Monitor","icon":"dashboard","order":3,"disabled":false,"hidden":false},{"id":"9ed4e3c0.ac177","type":"ui_tab","name":"Prices","icon":"dashboard","order":4,"disabled":false,"hidden":false},{"id":"db86bec0.04bbb","type":"ui_tab","name":"Token Generator","icon":"dashboard","order":5,"disabled":false,"hidden":false},{"id":"a947341d.96f6c8","type":"ui_group","name":"Generate New Keypair","tab":"eaad2b20.f0cd48","order":1,"disp":true,"width":"12","collapse":false},{"id":"1f563092.450a6f","type":"ui_group","name":"Check Balances","tab":"ddc63819.638318","order":1,"disp":true,"width":"6","collapse":false},{"id":"c3c52113.338a9","type":"ui_group","name":"Send Transaction","tab":"ddc63819.638318","order":2,"disp":true,"width":"12","collapse":false},{"id":"ad15b2e3.60848","type":"ui_group","name":"Make Offer","tab":"ddc63819.638318","order":3,"disp":true,"width":"6","collapse":false},{"id":"62ad21f6.478228","type":"ui_group","name":"Kraken Prices","tab":"9ed4e3c0.ac177","order":1,"disp":true,"width":"6","collapse":false},{"id":"1460580e.155d28","type":"ui_group","name":"Check Balances","tab":"","order":2,"disp":true,"width":"12","collapse":false},{"id":"9fc23374.89621","type":"ui_group","name":"Create Token","tab":"db86bec0.04bbb","order":1,"disp":true,"width":"6","collapse":false},{"id":"c6ceac59.4d376","type":"ui_tab","name":"NFT Generator","icon":"dashboard","order":6,"disabled":false,"hidden":false},{"id":"b348d20e.8f775","type":"ui_group","name":"NFT","tab":"c6ceac59.4d376","order":1,"disp":true,"width":"6","collapse":false},{"id":"a0f9fea5.8bcf","type":"ui_tab","name":"Trade Bot","icon":"dashboard","order":8,"disabled":false,"hidden":false},{"id":"202717cb.ef6a48","type":"ui_group","name":"Range Trader","tab":"a0f9fea5.8bcf","order":1,"disp":true,"width":"6","collapse":false},{"id":"2d6d4b89.c6d744","type":"ui_tab","name":"NFT2","icon":"dashboard","order":7,"disabled":false,"hidden":false},{"id":"b6477852.bf6508","type":"ui_group","name":"Group 1","tab":"2d6d4b89.c6d744","order":1,"disp":true,"width":6},{"id":"a42d0f0e.3a4d6","type":"ui_tab","name":"Coinqvest Horizon","icon":"dashboard","order":9,"disabled":false,"hidden":false},{"id":"d19bed92.49b26","type":"ui_group","name":"Coinqvest Mainnet Horizon","tab":"a42d0f0e.3a4d6","order":1,"disp":true,"width":"6","collapse":false},{"id":"4250a982.6c5378","type":"ui_tab","name":"Token Creator (Single Tx)","icon":"dashboard","order":14,"disabled":false,"hidden":false},{"id":"72af97e1.b08c68","type":"ui_group","name":"Create Token (Single Tx)","tab":"4250a982.6c5378","order":1,"disp":true,"width":"6","collapse":false},{"id":"8e658883.529268","type":"ui_group","name":"Create NFT (Single Tx)","tab":"4250a982.6c5378","order":2,"disp":true,"width":"6","collapse":false},{"id":"8ce4258d.827e18","type":"ui_group","name":"Create NFTs Multimaker","tab":"4250a982.6c5378","order":3,"disp":true,"width":"6","collapse":false},{"id":"b89318e8.fe7498","type":"function","z":"e1a3be1e.3571d","name":"Check Balances Example","func":"const fetch = global.get(\"nodefetch\");\n\nvar StellarSdk = global.get(\"stellarsdk\");\n// create a completely new and unique pair of keys\n// see more about KeyPair objects: https://stellar.github.io/js-stellar-sdk/Keypair.html\nconst pair = StellarSdk.Keypair.random();\n\n//console.log(pair.secret());\nmsg.payload = \"Pair secret: \" + pair.secret()\nnode.send(msg)\n// SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7\n//console.log(pair.publicKey());\nmsg.payload = \"Pair publickey: \" + pair.publicKey()\nnode.send(msg)\n// GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB\nasync function main() {\n  try {\n    const response = await fetch(\n      `https://friendbot.stellar.org?addr=${encodeURIComponent(\n        pair.publicKey(),\n      )}`,\n    );\n    const responseJSON = await response.json();\n    console.log(\"SUCCESS! You have a new account :)\\n\", responseJSON);\n  } catch (e) {\n    console.log(\"ERROR!\", e);\n  }\n\nconst server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\n// the JS SDK uses promises for most actions, such as retrieving an account\nconst account = await server.loadAccount(pair.publicKey());\n//console.log(\"Balances for account: \" + pair.publicKey());\nmsg.payload = \"Balances for account: \" + pair.publicKey()\nnode.send(msg)\naccount.balances.forEach(function (balance) {\n  //console.log(\"Type:\", balance.asset_type, \", Balance:\", balance.balance);\n  msg.payload = \"Type:\"+ balance.asset_type+\", Balance:\"+balance.balance\n  node.send(msg)\n});\n\n}\nmain()","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":200,"wires":[["af22515e.f86d9","da4a3f54.f4e15"]]},{"id":"b8e28e57.e51c9","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":200,"wires":[["b89318e8.fe7498"]]},{"id":"af22515e.f86d9","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":760,"y":204,"wires":[]},{"id":"3a89629.ccdd39e","type":"comment","z":"e1a3be1e.3571d","name":"Getting Acount data","info":"we are getting below data in this node\n1. Pair secret\n2. Pair publickey\n3. Acount ID\n4. Type and Balance\n","x":450,"y":160,"wires":[]},{"id":"a3c0ca1e.f0f588","type":"function","z":"e1a3be1e.3571d","name":"Submit Transaction Example","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar sourceKeys = StellarSdk.Keypair.fromSecret(\n  msg.payload.sourceKeys,\n);\nvar destinationId = msg.payload.destinationId;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          asset: StellarSdk.Asset.native(),\n          amount: \"10\",\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(\"Test Transaction\"))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    //console.log(\"Success! Results:\", result);\n    msg.payload=result;\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":640,"wires":[["22e0c241.59bd6e"]]},{"id":"a11e4603.4b7608","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"sourceKeys\":\"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX\",\"destinationId\":\"GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ\"}","payloadType":"json","x":290,"y":640,"wires":[["a3c0ca1e.f0f588"]]},{"id":"22e0c241.59bd6e","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":640,"wires":[]},{"id":"4dadf59d.58b25c","type":"comment","z":"e1a3be1e.3571d","name":"Transactions","info":"","x":490,"y":600,"wires":[]},{"id":"bd5ddba4.6459b8","type":"function","z":"e1a3be1e.3571d","name":"Create Sell Offer Example","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(\n  msg.payload.secretKey,\n);\nvar destinationId = msg.payload.sourceAccount;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.manageSellOffer({\n            selling: new StellarSdk.Asset(msg.payload.assetToBuy, 'GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ'),\n            buying: new StellarSdk.Asset(msg.payload.assetToSell, 'GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ'),\n            amount: msg.payload.amount,\n            price: msg.payload.price\n     }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(\"Test Transaction\"))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    //console.log(\"Success! Results:\", result);\n    msg.payload = result;\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":1040,"wires":[["97321eb4.c24ae"]]},{"id":"70431d01.f653b4","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload","v":"{\"secretKey\":\"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX\",\"sourceAccount\":\"GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ\",\"assetToSell\":\"XLM\",\"assetToBuy\":\"XCN\",\"amount\":\"0.1\",\"price\":\"2.5\"}","vt":"json"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"secretKey\":\"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX\",\"sourceAccount\":\"GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ\",\"assetToSell\":\"XLM\",\"assetToBuy\":\"XCN\",\"amount\":\"0.1\",\"price\":\"2.5\"}","payloadType":"json","x":240,"y":1040,"wires":[["bd5ddba4.6459b8"]]},{"id":"97321eb4.c24ae","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":690,"y":1040,"wires":[]},{"id":"e71f8c00.f6d8c","type":"comment","z":"e1a3be1e.3571d","name":"Create offer","info":"","x":420,"y":1000,"wires":[]},{"id":"da4a3f54.f4e15","type":"ui_text","z":"e1a3be1e.3571d","group":"1f563092.450a6f","order":4,"width":0,"height":0,"name":"balances result","label":"","format":"{{msg.payload}}","layout":"row-spread","x":910,"y":364,"wires":[]},{"id":"d502f1d0.d9b54","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Public Key","label":"Public Key","tooltip":"","group":"1f563092.450a6f","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"0","topic":"","x":240,"y":324,"wires":[["db84dba9.bca098"]]},{"id":"db84dba9.bca098","type":"function","z":"e1a3be1e.3571d","name":"Check Balances","func":"const fetch = global.get(\"nodefetch\");\n\nvar StellarSdk = global.get(\"stellarsdk\");\n// create a completely new and unique pair of keys\n// see more about KeyPair objects: https://stellar.github.io/js-stellar-sdk/Keypair.html\nconst key = msg.payload;\n\n\nconst server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\n// the JS SDK uses promises for most actions, such as retrieving an account\nconst account = await server.loadAccount(key);\n//console.log(\"Balances for account: \" + pair.publicKey());\nmsg.topic = \"Balances for account: \" + key\n\nvar bals = \"\";\n\naccount.balances.forEach(function (balance) {\n  console.log(\"Type:\", balance.asset_type, \", Balance:\", balance.balance);\n  msg.payload = \"Type:\"+ balance.asset_code+\", Balance:\"+balance.balance\n  //node.send(msg)\n  bals = bals +\" \"+ msg.payload\n});\n\nmsg.payload = bals\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":324,"wires":[["af22515e.f86d9","f8487bed.a46548","da4a3f54.f4e15"]]},{"id":"f8487bed.a46548","type":"ui_text","z":"e1a3be1e.3571d","group":"1f563092.450a6f","order":3,"width":0,"height":0,"name":"Balances header","label":"","format":"{{msg.topic}}","layout":"row-spread","x":920,"y":324,"wires":[]},{"id":"f4395daf.f79f","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Secret Key","label":"Secret Key","tooltip":"","group":"c3c52113.338a9","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1170,"y":660,"wires":[["8f06f558.bec918"]]},{"id":"612720db.4ada1","type":"ui_text","z":"e1a3be1e.3571d","group":"c3c52113.338a9","order":11,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":960,"y":760,"wires":[]},{"id":"7c7247d3.5c6e18","type":"ui_text","z":"e1a3be1e.3571d","group":"c3c52113.338a9","order":10,"width":0,"height":0,"name":"Submitting text display","label":"","format":"{{msg.topic}}","layout":"row-spread","x":960,"y":700,"wires":[]},{"id":"53c77e9d.d066c","type":"function","z":"e1a3be1e.3571d","name":"Submit XLM Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secret',secret);\nvar dest = flow.get('dest',dest);\nvar quantxlm = flow.get('quantxlm',quantxlm);\nvar asset = flow.get('asset',asset);\nvar assetiss = flow.get('assetiss',assetiss);\nvar memo = flow.get('memo',memo);\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          asset: StellarSdk.Asset.native(),\n          //asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quantxlm,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":530,"y":760,"wires":[["612720db.4ada1","3d4c67b3.a92678","22e0c241.59bd6e"]]},{"id":"3dfa8625.6156ba","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Destination","label":"Destination","tooltip":"","group":"c3c52113.338a9","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1170,"y":700,"wires":[["92407a93.e8b6d8"]]},{"id":"1eda8ae2.afb005","type":"ui_button","z":"e1a3be1e.3571d","name":"SendXLM","group":"c3c52113.338a9","order":5,"width":"12","height":"1","passthru":false,"label":"Send XLM","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":260,"y":720,"wires":[["53c77e9d.d066c","556ecdd.dc6c434","e169c03a.d0b74"]]},{"id":"8f06f558.bec918","type":"function","z":"e1a3be1e.3571d","name":"secret","func":"var secret = msg.payload\nflow.set('secret',secret);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1410,"y":660,"wires":[[]]},{"id":"54fb998a.fa6258","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Amount","label":"Amount","tooltip":"","group":"c3c52113.338a9","order":8,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1160,"y":820,"wires":[["f966427f.c21df"]]},{"id":"92407a93.e8b6d8","type":"function","z":"e1a3be1e.3571d","name":"dest","func":"var dest = msg.payload\nflow.set('dest',dest);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1410,"y":700,"wires":[[]]},{"id":"f966427f.c21df","type":"function","z":"e1a3be1e.3571d","name":"quant","func":"var quant = msg.payload\nflow.set('quant',quant);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1410,"y":820,"wires":[[]]},{"id":"556ecdd.dc6c434","type":"change","z":"e1a3be1e.3571d","name":"Status Update","rules":[{"t":"set","p":"topic","pt":"msg","to":"Sending Transaction To Stellar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":680,"wires":[["7c7247d3.5c6e18"]]},{"id":"e169c03a.d0b74","type":"change","z":"e1a3be1e.3571d","name":"Reset Field","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":720,"wires":[["612720db.4ada1"]]},{"id":"3d4c67b3.a92678","type":"change","z":"e1a3be1e.3571d","name":"Reset Field","rules":[{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":700,"wires":[["7c7247d3.5c6e18"]]},{"id":"2840c9e9.a1c026","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Secret Key","label":"Secret Key","tooltip":"","group":"ad15b2e3.60848","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1110,"y":1080,"wires":[["3898033b.99490c"]]},{"id":"aa46f17e.ea646","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Asset to sell - Name","label":"Asset to sell - Name","tooltip":"","group":"ad15b2e3.60848","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1140,"y":1120,"wires":[["927ca549.c33d18"]]},{"id":"5e865db9.a1c1a4","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Amount","label":"Amount","tooltip":"","group":"ad15b2e3.60848","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1100,"y":1200,"wires":[["f43002bd.b5b33"]]},{"id":"abbec0bf.506d5","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Price","label":"Price","tooltip":"","group":"ad15b2e3.60848","order":7,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1090,"y":1320,"wires":[["ffc80450.9992e8"]]},{"id":"e4e61f7.debe1e","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Asset to buy - Name","label":"Asset to buy - Name","tooltip":"","group":"ad15b2e3.60848","order":5,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1140,"y":1240,"wires":[["51ad1713.cc50f8"]]},{"id":"3898033b.99490c","type":"function","z":"e1a3be1e.3571d","name":"secret2","func":"var secret2 = msg.payload\nflow.set('secret2',secret2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1320,"y":1080,"wires":[[]]},{"id":"927ca549.c33d18","type":"function","z":"e1a3be1e.3571d","name":"sell","func":"var sell = msg.payload\nflow.set('sell',sell);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1310,"y":1120,"wires":[[]]},{"id":"f43002bd.b5b33","type":"function","z":"e1a3be1e.3571d","name":"quant2","func":"var quant2 = msg.payload\nflow.set('quant2',quant2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1310,"y":1200,"wires":[[]]},{"id":"7152c22e.cb5abc","type":"ui_text","z":"e1a3be1e.3571d","group":"ad15b2e3.60848","order":10,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":880,"y":1200,"wires":[]},{"id":"c47bf282.6e658","type":"ui_text","z":"e1a3be1e.3571d","group":"ad15b2e3.60848","order":9,"width":0,"height":0,"name":"Submitting text display","label":"","format":"{{msg.topic}}","layout":"row-spread","x":880,"y":1120,"wires":[]},{"id":"93f4704e.26401","type":"ui_button","z":"e1a3be1e.3571d","name":"Send","group":"ad15b2e3.60848","order":8,"width":0,"height":0,"passthru":false,"label":"Send","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":230,"y":1160,"wires":[["2d7986f6.bee62a","5e0a51c1.b1e61","2d7d4507.02854a"]]},{"id":"2d7986f6.bee62a","type":"change","z":"e1a3be1e.3571d","name":"Status Update","rules":[{"t":"set","p":"topic","pt":"msg","to":"Sending Transaction To Stellar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":1120,"wires":[["c47bf282.6e658"]]},{"id":"5e0a51c1.b1e61","type":"change","z":"e1a3be1e.3571d","name":"Reset Field","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":1160,"wires":[["7152c22e.cb5abc"]]},{"id":"8629d5eb.2e4d08","type":"change","z":"e1a3be1e.3571d","name":"Reset Field","rules":[{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":1140,"wires":[["c47bf282.6e658"]]},{"id":"51ad1713.cc50f8","type":"function","z":"e1a3be1e.3571d","name":"buy","func":"var buy = msg.payload\nflow.set('buy',buy);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1310,"y":1240,"wires":[[]]},{"id":"ffc80450.9992e8","type":"function","z":"e1a3be1e.3571d","name":"price2","func":"var price2 = msg.payload\nflow.set('price2',price2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1310,"y":1320,"wires":[[]]},{"id":"2d7d4507.02854a","type":"function","z":"e1a3be1e.3571d","name":"Create Sell Offer","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\n\nvar secret2 = flow.get('secret2',secret2);\nvar sell = flow.get('sell',sell);\nvar selliss = flow.get('selliss',selliss);\nvar quant2 = flow.get('quant2',quant2);\nvar buy = flow.get('buy',buy);\nvar buyiss = flow.get('buyiss',buyiss);\nvar price2 = flow.get('price2',price2);\nvar memo = flow.get('memo',memo)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(\n  secret2,\n);\n//var destinationId = msg.payload.sourceAccount;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  //.loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  //.catch(function (error) {\n   // if (error instanceof StellarSdk.NotFoundError) {\n  //    throw new Error(\"The destination account does not exist!\");\n  //  } else return error;\n // })\n  // If there was no error, load up-to-date information on your account.\n  .loadAccount(sourceKeys.publicKey())\n  \n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.manageSellOffer({\n            selling: new StellarSdk.Asset(sell,selliss),\n            buying: new StellarSdk.Asset(buy,buyiss),\n            amount: quant2,\n            price: price2\n     }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    //console.log(\"Success! Results:\", result);\n    msg.payload = \"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":1200,"wires":[["8629d5eb.2e4d08","7152c22e.cb5abc","97321eb4.c24ae"]]},{"id":"76d3ad49.5636e4","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Asset to sell - Issuer","label":"Asset to sell - Issuer","tooltip":"","group":"ad15b2e3.60848","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1140,"y":1160,"wires":[["cbf65520.e52ae8"]]},{"id":"cbf65520.e52ae8","type":"function","z":"e1a3be1e.3571d","name":"selliss","func":"var selliss = msg.payload\nflow.set('selliss',selliss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1310,"y":1160,"wires":[[]]},{"id":"74c60b94.5294a4","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Asset to buy - Issuer","label":"Asset to buy - Issuer","tooltip":"","group":"ad15b2e3.60848","order":6,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1140,"y":1280,"wires":[["aa44702b.3e9dc"]]},{"id":"aa44702b.3e9dc","type":"function","z":"e1a3be1e.3571d","name":"buyiss","func":"var buyiss = msg.payload\nflow.set('buyiss',buyiss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1310,"y":1280,"wires":[[]]},{"id":"c072723e.205b6","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Asset","label":"Asset","tooltip":"","group":"c3c52113.338a9","order":6,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1150,"y":740,"wires":[["9c0857b6.dbadb8"]]},{"id":"aff7e18b.d3b58","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Issuer","label":"Issuer","tooltip":"","group":"c3c52113.338a9","order":7,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1150,"y":780,"wires":[["cf2df40c.68c5e8"]]},{"id":"9c0857b6.dbadb8","type":"function","z":"e1a3be1e.3571d","name":"asset","func":"var asset = msg.payload\nflow.set('asset',asset);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1410,"y":740,"wires":[[]]},{"id":"cf2df40c.68c5e8","type":"function","z":"e1a3be1e.3571d","name":"assetiss","func":"var assetiss = msg.payload\nflow.set('assetiss',assetiss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1420,"y":780,"wires":[[]]},{"id":"934d0b5.19807f8","type":"ui_text_input","z":"e1a3be1e.3571d","name":"AmountXLM","label":"AmountXLM","tooltip":"","group":"c3c52113.338a9","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1170,"y":860,"wires":[["66fb5342.5d2e8c"]]},{"id":"66fb5342.5d2e8c","type":"function","z":"e1a3be1e.3571d","name":"quantxlm","func":"var quantxlm = msg.payload\nflow.set('quantxlm',quantxlm);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1420,"y":860,"wires":[[]]},{"id":"272d2dc.785acd2","type":"function","z":"e1a3be1e.3571d","name":"Submit Token Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secret',secret);\nvar dest = flow.get('dest',dest);\nvar quant = flow.get('quant',quant);\nvar asset = flow.get('asset',asset);\nvar assetiss = flow.get('assetiss',assetiss);\nvar memo = flow.get('memo',memo);\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quant,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":530,"y":820,"wires":[["612720db.4ada1","3d4c67b3.a92678","22e0c241.59bd6e"]]},{"id":"6ad7ac1d.5167d4","type":"ui_button","z":"e1a3be1e.3571d","name":"Send Token","group":"c3c52113.338a9","order":9,"width":"12","height":"1","passthru":false,"label":"Send Token","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":270,"y":820,"wires":[["272d2dc.785acd2","556ecdd.dc6c434","e169c03a.d0b74"]]},{"id":"9d11e5eb.cc4cd8","type":"comment","z":"e1a3be1e.3571d","name":"Stellar Testnet Nodes UI","info":"","x":710,"y":40,"wires":[]},{"id":"92c8f2ca.8ab9","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":1420,"wires":[]},{"id":"b0981b7e.d17f08","type":"function","z":"e1a3be1e.3571d","name":"return keypair","func":"const fetch = global.get(\"nodefetch\");\n\nvar StellarSdk = global.get(\"stellarsdk\");\n// create a completely new and unique pair of keys\n// see more about KeyPair objects: https://stellar.github.io/js-stellar-sdk/Keypair.html\nconst pair = StellarSdk.Keypair.random();\n\n//console.log(pair.secret());\nmsg.payload = \"Pair secret: \" + pair.secret()\nnode.send(msg)\n// SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7\n//console.log(pair.publicKey());\nmsg.payload = \"Pair publickey: \" + pair.publicKey()\nnode.send(msg)\n// GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB\nasync function main() {\n  try {\n    const response = await fetch(\n      `https://friendbot.stellar.org?addr=${encodeURIComponent(\n        pair.publicKey(),\n      )}`,\n    );\n    const responseJSON = await response.json();\n    console.log(\"SUCCESS! You have a new account :)\\n\", responseJSON);\n  } catch (e) {\n    console.log(\"ERROR!\", e);\n  }\n\n\n}\nmain()\n\nmsg.payload=pair.secret();\n\nmsg.topic=pair.publicKey();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":1440,"wires":[["92c8f2ca.8ab9","34ac11cd.c3526e","ecfb7374.44af1","1ad19401.84821c","83bb5b0f.152ab8"]]},{"id":"624f9c80.dc78c4","type":"ui_button","z":"e1a3be1e.3571d","name":"","group":"a947341d.96f6c8","order":3,"width":0,"height":0,"passthru":false,"label":"generate keypair","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":220,"y":1440,"wires":[["b0981b7e.d17f08"]]},{"id":"34ac11cd.c3526e","type":"ui_text","z":"e1a3be1e.3571d","group":"a947341d.96f6c8","order":1,"width":0,"height":0,"name":"Public","label":"Public","format":"{{msg.topic}}","layout":"col-center","x":710,"y":1460,"wires":[]},{"id":"ecfb7374.44af1","type":"ui_text","z":"e1a3be1e.3571d","group":"a947341d.96f6c8","order":2,"width":0,"height":0,"name":"Secret","label":"Secret","format":"{{msg.payload}}","layout":"col-center","x":710,"y":1500,"wires":[]},{"id":"b647e0dc.6b95","type":"comment","z":"e1a3be1e.3571d","name":"Generate Keypair","info":"","x":400,"y":1380,"wires":[]},{"id":"d962cf07.e380e","type":"comment","z":"e1a3be1e.3571d","name":"Store Variables from Dashboard UI","info":"","x":1300,"y":620,"wires":[]},{"id":"9dd241e6.50e0f","type":"comment","z":"e1a3be1e.3571d","name":"Store Variables from Dashboard UI","info":"","x":1200,"y":1040,"wires":[]},{"id":"99256bbb.9268d8","type":"ui_text","z":"e1a3be1e.3571d","group":"a947341d.96f6c8","order":4,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":760,"y":1540,"wires":[]},{"id":"83bb5b0f.152ab8","type":"change","z":"e1a3be1e.3571d","name":"Status Update","rules":[{"t":"set","p":"payload","pt":"msg","to":"Success! Account funded by friendbot (can take up to 30s to show up)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1540,"wires":[["99256bbb.9268d8"]]},{"id":"1ad19401.84821c","type":"function","z":"e1a3be1e.3571d","name":"Show link","func":"msg.payload=\"https://stellar.expert/explorer/testnet/account/\"+msg.topic;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":1580,"wires":[["d275c496.6c1888"]]},{"id":"d275c496.6c1888","type":"ui_text","z":"e1a3be1e.3571d","group":"a947341d.96f6c8","order":5,"width":0,"height":0,"name":"Link text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":740,"y":1580,"wires":[]},{"id":"85865e9a.bf4e7","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Memo","label":"Memo","tooltip":"","group":"c3c52113.338a9","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1150,"y":900,"wires":[["6c85e277.80215c"]]},{"id":"6c85e277.80215c","type":"function","z":"e1a3be1e.3571d","name":"memo","func":"var memo = msg.payload\nflow.set('memo',memo);\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is deployed.\nvar memo = \"Via BlockShangerous NodeRed\"\nflow.set('memo',memo);","finalize":"","x":1410,"y":900,"wires":[[]]},{"id":"dcdb506b.d454e","type":"function","z":"85337a8b.77ec28","name":"Monitor Account Example","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar accountId = msg.payload.accountId;\n\n// Create an API call to query payments involving the account.\nvar payments = server.payments().forAccount(accountId);\n\n// If some payments have already been handled, start the results from the\n// last seen payment. (See below in `handlePayment` where it gets saved.)\nvar lastToken = loadLastPagingToken();\nif (lastToken) {\n  payments.cursor(lastToken);\n}\n\n// `stream` will send each recorded payment, one by one, then keep the\n// connection open and continue to send you new payments as they occur.\npayments.stream({\n  onmessage: function (payment) {\n    // Record the paging token so we can start from here next time.\n    savePagingToken(payment.paging_token);\n\n    // The payments stream includes both sent and received payments. We only\n    // want to process received payments here.\n    if (payment.to !== accountId) {\n      return;\n    }\n\n    // In Stellar’s API, Lumens are referred to as the “native” type. Other\n    // asset types have more detailed information.\n    var asset;\n    if (payment.asset_type === \"native\") {\n      asset = \"lumens\";\n    } else {\n      asset = payment.asset_code + \":\" + payment.asset_issuer;\n    }\n    //console.log(payment.amount + \" \" + asset + \" from \" + payment.from);\n    msg.payload={\"amount\":payment.amount,\"asset\":asset,\"payment.from\":payment.from}\n    node.send(msg)\n  },\n\n  onerror: function (error) {\n    console.error(\"Error in payment stream\");\n  },\n});\n\nfunction savePagingToken(token) {\n  // In most cases, you should save this to a local database or file so that\n  // you can load it next time you stream new payments.\n}\n\nfunction loadLastPagingToken() {\n  // Get the last paging token from a local database or file\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":200,"wires":[[]]},{"id":"c85b0af0.4366d8","type":"inject","z":"85337a8b.77ec28","name":"","props":[{"p":"payload","v":"{\"accountId\":\"GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ\"}","vt":"json"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"accountId\":\"GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ\"}","payloadType":"json","x":180,"y":200,"wires":[["dcdb506b.d454e"]]},{"id":"8baef33e.d198b","type":"comment","z":"85337a8b.77ec28","name":"Received payment","info":"","x":380,"y":160,"wires":[]},{"id":"2078c0c7.f9b8e","type":"ui_text","z":"85337a8b.77ec28","group":"1f563092.450a6f","order":5,"width":0,"height":0,"name":"Payment Received","label":"Payment Received","format":"{{msg.payload}}","layout":"row-spread","x":670,"y":240,"wires":[]},{"id":"6492839f.25387c","type":"function","z":"85337a8b.77ec28","name":"Monitor Account","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar accountId = msg.payload;\nflow.set('accountId',accountId);\n\n\n// Create an API call to query payments involving the account.\nvar payments = server.payments().forAccount(accountId);\n\n// If some payments have already been handled, start the results from the\n// last seen payment. (See below in `handlePayment` where it gets saved.)\nvar lastToken = loadLastPagingToken();\nif (lastToken) {\n  payments.cursor(lastToken);\n}\n\n// `stream` will send each recorded payment, one by one, then keep the\n// connection open and continue to send you new payments as they occur.\npayments.stream({\n  onmessage: function (payment) {\n    // Record the paging token so we can start from here next time.\n    savePagingToken(payment.paging_token);\n\n    // The payments stream includes both sent and received payments. We only\n    // want to process received payments here.\n    if (payment.to !== accountId) {\n      return;\n    }\n\n    // In Stellar’s API, Lumens are referred to as the “native” type. Other\n    // asset types have more detailed information.\n    var asset;\n    if (payment.asset_type === \"native\") {\n      asset = \"lumens\";\n    } else {\n      asset = payment.asset_code;\n    }\n    console.log(payment.amount + \" \" + asset + \" from \" + payment.from);\n    msg.payload=\"amount: \"+payment.amount+\" asset: \"+asset+\" payment from: \"+payment.from\n    node.send(msg)\n  },\n\n  onerror: function (error) {\n    console.error(\"Error in payment stream\");\n  },\n});\n\nfunction savePagingToken(token) {\n  // In most cases, you should save this to a local database or file so that\n  // you can load it next time you stream new payments.\n}\n\nfunction loadLastPagingToken() {\n  // Get the last paging token from a local database or file\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":240,"wires":[["2078c0c7.f9b8e"]]},{"id":"fded4172.10534","type":"ui_text_input","z":"85337a8b.77ec28","name":"Public Key","label":"Public Key to Monitor","tooltip":"","group":"1f563092.450a6f","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"0","topic":"","x":170,"y":240,"wires":[["6492839f.25387c","de8a3890.0ce388"]]},{"id":"de8a3890.0ce388","type":"function","z":"85337a8b.77ec28","name":"Monitor Account","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar accountId = msg.payload;\nflow.set('accountId',accountId);\nvar sender = 0;\nvar type = 0;\nvar amount_rec = 0;\n\n    \n// Create an API call to query payments involving the account.\nvar payments = server.payments().forAccount(accountId);\n\n// If some payments have already been handled, start the results from the\n// last seen payment. (See below in `handlePayment` where it gets saved.)\nvar lastToken = loadLastPagingToken();\nif (lastToken) {\n  payments.cursor(lastToken);\n}\n\n// `stream` will send each recorded payment, one by one, then keep the\n// connection open and continue to send you new payments as they occur.\npayments.stream({\n  onmessage: function (payment) {\n    // Record the paging token so we can start from here next time.\n    savePagingToken(payment.paging_token);\n\n    // The payments stream includes both sent and received payments. We only\n    // want to process received payments here.\n    if (payment.to !== accountId) {\n      return;\n    }\n\n    // In Stellar’s API, Lumens are referred to as the “native” type. Other\n    // asset types have more detailed information.\n    var asset;\n    if (payment.asset_type === \"native\") {\n      asset = \"lumens\";\n    } else {\n      asset = payment.asset_code;\n    }\n    //console.log(payment.amount + \" \" + asset + \" from \" + payment.from);\n    msg.payload=\"amount: \"+payment.amount+\" asset: \"+asset+\" payment from: \"+payment.from\n    sender = payment.from;\n    type = asset;\n    amount_rec = payment.amount;\n    flow.set('sender',sender);\n    flow.set('type',type);\n    flow.set('amount_rec',amount_rec);\n    node.send(msg)\n    //node.send(msg.payload)\n  },\n\n\n\n  onerror: function (error) {\n    console.error(\"Error in payment stream\");\n  },\n});\n\nfunction savePagingToken(token) {\n  // In most cases, you should save this to a local database or file so that\n  // you can load it next time you stream new payments.\n}\n\nfunction loadLastPagingToken() {\n  // Get the last paging token from a local database or file\n}\n\n//return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":444,"wires":[["40262ecb.e69ff"]]},{"id":"fb3f67b0.b4e028","type":"ui_toast","z":"85337a8b.77ec28","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1070,"y":500,"wires":[]},{"id":"40262ecb.e69ff","type":"switch","z":"85337a8b.77ec28","name":"","property":"type","propertyType":"flow","rules":[{"t":"eq","v":"TRRT","vt":"str"},{"t":"eq","v":"lumens","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":610,"y":460,"wires":[["aa2e4422.c47338","82cfc6e0.b58de8"],["5cda4d0e.738d14","f26b1e9a.f2607","9fac8537.31f928"]]},{"id":"aa2e4422.c47338","type":"debug","z":"85337a8b.77ec28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":380,"wires":[]},{"id":"58fdd566.92976c","type":"comment","z":"85337a8b.77ec28","name":"Received payment response","info":"","x":660,"y":380,"wires":[]},{"id":"82cfc6e0.b58de8","type":"function","z":"85337a8b.77ec28","name":"","func":"var amount_rec = flow.get('amount_rec',amount_rec);\n\nmsg.payload = \"Thanks for the \"+amount_rec+\" TRRT!\"\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":460,"wires":[["fb3f67b0.b4e028"]]},{"id":"5cda4d0e.738d14","type":"debug","z":"85337a8b.77ec28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1090,"y":560,"wires":[]},{"id":"c7b80c33.94197","type":"function","z":"85337a8b.77ec28","name":"","func":"var amount_rec = flow.get('amount_rec',amount_rec);\n\nmsg.payload = \"Returning your \"+amount_rec+\" XLM\"\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":780,"y":720,"wires":[["5cda4d0e.738d14","fb3f67b0.b4e028"]]},{"id":"2acbba72.0ed566","type":"inject","z":"85337a8b.77ec28","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"sourceKeys\":\"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX\",\"destinationId\":\"GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ\"}","payloadType":"json","x":490,"y":760,"wires":[["f6af4b2b.aeaf28"]]},{"id":"49b66fc9.50b7c","type":"debug","z":"85337a8b.77ec28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1070,"y":760,"wires":[]},{"id":"f6af4b2b.aeaf28","type":"function","z":"85337a8b.77ec28","name":"Submit XLM Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = \"SATY6XOPDHWSMPTYICPDKQEEHNRSDFLM472AKDYYIBJVZFLSYHKHSY7F\";\nvar sender=flow.get('sender',sender);\nvar dest = sender;\nvar amount_rec=flow.get('amount_rec',amount_rec);\nvar quantxlm = amount_rec;\n//var quantxlm = \"69\";\n//var asset = flow.get('asset',asset);\n//var assetiss = flow.get('assetiss',assetiss);\nvar memo = \"Autoreply from TRRTbot\";\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          asset: StellarSdk.Asset.native(),\n          //asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quantxlm,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":730,"y":760,"wires":[["49b66fc9.50b7c"]]},{"id":"f26b1e9a.f2607","type":"function","z":"85337a8b.77ec28","name":"Submit Token Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = \"SATY6XOPDHWSMPTYICPDKQEEHNRSDFLM472AKDYYIBJVZFLSYHKHSY7F\";\nvar sender=flow.get('sender',sender);\nvar dest = sender;\nvar amount_rec=flow.get('amount_rec',amount_rec);\nvar quant = amount_rec;\nvar memo = \"Autoreply from TRRTbot\";\nvar asset = \"TRRT\";\nvar assetiss = \"GD5AC55INRNAEJQ5WNDTEJBEAYJWE36WNDRDFGVZ4JUIO3I2U5BK3PZQ\";\n\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quant,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":770,"y":640,"wires":[["fb3f67b0.b4e028","5cda4d0e.738d14"]]},{"id":"9fac8537.31f928","type":"function","z":"85337a8b.77ec28","name":"","func":"var amount_rec = flow.get('amount_rec',amount_rec);\n\nmsg.payload = \"Sending your \"+amount_rec+\" TRRT\"\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":600,"wires":[["fb3f67b0.b4e028"]]},{"id":"347d0dd.fdb38f2","type":"inject","z":"85337a8b.77ec28","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":510,"y":640,"wires":[["f26b1e9a.f2607"]]},{"id":"39c5a94b.239ff6","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":2060,"wires":[]},{"id":"7117e897.ba00a8","type":"function","z":"e1a3be1e.3571d","name":"add trust","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secret',secret);\nvar asset = flow.get('asset',asset);\nvar assetiss = flow.get('assetiss',assetiss);\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\n//var destinationId = recipient;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.changeTrust({\n          //destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          //amount: amount,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('Trust in StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":2060,"wires":[["39c5a94b.239ff6","9628b69f.1117b8"]]},{"id":"5878cc21.fcda44","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SDVO2J7XOJYWWYC3XCTKW26S7XVO5BMYKRQSOV43USOKM33TWG4ATAOP","payloadType":"str","x":220,"y":2060,"wires":[["7117e897.ba00a8"]]},{"id":"fcb8c9ab.b33aa8","type":"comment","z":"e1a3be1e.3571d","name":"Add Trustline","info":"","x":370,"y":2000,"wires":[]},{"id":"71ebebaa.e58d04","type":"inject","z":"873223c7.be785","name":"Abfrage jede Stunde","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":100,"wires":[["a14b10f.8596bf"]]},{"id":"a14b10f.8596bf","type":"http request","z":"873223c7.be785","name":"Bitcoin","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.kraken.com/0/public/Ticker?pair=BTCUSD","tls":"","persist":false,"proxy":"","authType":"","x":340,"y":100,"wires":[["ff9ea3b2.f342"]]},{"id":"18a10ec7.a43221","type":"debug","z":"873223c7.be785","name":"Konsole","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":100,"wires":[]},{"id":"3e46ce5a.a8aac2","type":"comment","z":"873223c7.be785","name":"Info zu JSON ","info":"JSON:\n      // Last ask price\n      ask: ticker.a[0],\n      // Last bid price\n      bid: ticker.b[0],\n      // Last trade closed\n      lastTrade: ticker.c[0],\n      // Volume traded in the last 24 houurs\n      volume: ticker.v[1],\n      // 24 hour low\n      low: ticker.l[1],\n      // 24 hour high\n      high: ticker.h[1],\n      // Open price\n      open: ticker.o","x":890,"y":240,"wires":[]},{"id":"ff9ea3b2.f342","type":"function","z":"873223c7.be785","name":"JSON to BTC in Euro","func":"msg.payload = msg.payload.result.XXBTZUSD.a[0]\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":100,"wires":[["18a10ec7.a43221","94ffa29c.f4091"]]},{"id":"36521fef.ddd38","type":"comment","z":"873223c7.be785","name":"(c) 2021 Thomas Wenzlaff   www.wenzlaff.info","info":"","x":630,"y":40,"wires":[]},{"id":"ece9544a.5e3098","type":"comment","z":"873223c7.be785","name":"Bitcoin Kurs Ticker","info":"","x":120,"y":40,"wires":[]},{"id":"94ffa29c.f4091","type":"ui_gauge","z":"873223c7.be785","g":"e777ddcb.05936","name":"Gauge","group":"62ad21f6.478228","order":0,"width":0,"height":0,"gtype":"gage","title":"Bitcoin Price USD","label":"USD","format":"{{value}}","min":"40000","max":"100000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":710,"y":220,"wires":[]},{"id":"6f17882e.936e18","type":"ui_button","z":"873223c7.be785","g":"e777ddcb.05936","name":"","group":"62ad21f6.478228","order":3,"width":0,"height":0,"passthru":false,"label":"Update","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":140,"y":220,"wires":[["a14b10f.8596bf","843545aa.216f98"]]},{"id":"3ff03788.f0d168","type":"inject","z":"873223c7.be785","name":"Abfrage jede Stunde","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":520,"wires":[["843545aa.216f98"]]},{"id":"843545aa.216f98","type":"http request","z":"873223c7.be785","name":"XLM","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.kraken.com/0/public/Ticker?pair=XLMUSD","tls":"","persist":false,"proxy":"","authType":"","x":360,"y":520,"wires":[["6b4241db.f052a"]]},{"id":"2da8d73.3c6a928","type":"debug","z":"873223c7.be785","name":"Konsole","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":760,"y":520,"wires":[]},{"id":"6b4241db.f052a","type":"function","z":"873223c7.be785","name":"JSON to BTC in Euro","func":"msg.payload = msg.payload.result.XXLMZUSD.a[0]\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":560,"y":520,"wires":[["2da8d73.3c6a928","c107c751.7d7688"]]},{"id":"c107c751.7d7688","type":"ui_gauge","z":"873223c7.be785","g":"2bbf2098.ca1de","name":"Gauge","group":"62ad21f6.478228","order":0,"width":0,"height":0,"gtype":"gage","title":"XLM Price USD","label":"USD","format":"{{value}}","min":".3","max":"1","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":730,"y":640,"wires":[]},{"id":"a6283819.35aec8","type":"ui_button","z":"873223c7.be785","name":"","group":"62ad21f6.478228","order":3,"width":0,"height":0,"passthru":false,"label":"Start","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":110,"y":320,"wires":[["7d3bf461.d15f0c","a14b10f.8596bf","843545aa.216f98"]]},{"id":"d792b5ca.faeda8","type":"ui_button","z":"873223c7.be785","name":"","group":"62ad21f6.478228","order":3,"width":0,"height":0,"passthru":false,"label":"Stop","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":110,"y":360,"wires":[["1c687fb8.b4edf"]]},{"id":"f727dc32.c7a5d","type":"switch","z":"873223c7.be785","name":"","property":"SS","propertyType":"flow","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":670,"y":340,"wires":[["7053cc22.909ae4"]]},{"id":"babb4334.61ba1","type":"function","z":"873223c7.be785","name":"","func":"var SS=msg.payload\nflow.set('SS',SS)\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is deployed.\nvar SS =0\nflow.set('SS',SS)","finalize":"","x":520,"y":340,"wires":[["f727dc32.c7a5d"]]},{"id":"7d3bf461.d15f0c","type":"change","z":"873223c7.be785","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":320,"wires":[["babb4334.61ba1"]]},{"id":"1c687fb8.b4edf","type":"change","z":"873223c7.be785","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":360,"wires":[["babb4334.61ba1"]]},{"id":"7053cc22.909ae4","type":"delay","z":"873223c7.be785","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":340,"wires":[["a14b10f.8596bf","843545aa.216f98","f727dc32.c7a5d"]]},{"id":"d7178576.80ea38","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":2340,"wires":[]},{"id":"3fe7ed32.0807f2","type":"function","z":"e1a3be1e.3571d","name":"return public from secret","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = msg.payload;\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nmsg.payload=sourceKeys.publicKey()\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":2340,"wires":[["d7178576.80ea38","483638e4.a24a98"]]},{"id":"b6d5dabc.94b738","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SATY6XOPDHWSMPTYICPDKQEEHNRSDFLM472AKDYYIBJVZFLSYHKHSY7F","payloadType":"str","x":200,"y":2340,"wires":[["3fe7ed32.0807f2"]]},{"id":"311db771.2e6ad8","type":"comment","z":"e1a3be1e.3571d","name":"Get Public","info":"","x":340,"y":2280,"wires":[]},{"id":"8ded31f.251b9d","type":"ui_button","z":"e1a3be1e.3571d","name":"Get Public","group":"c3c52113.338a9","order":13,"width":"12","height":"1","passthru":false,"label":"Get Public","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":210,"y":2400,"wires":[["dcdb9738.89dda8"]]},{"id":"483638e4.a24a98","type":"ui_text","z":"e1a3be1e.3571d","group":"c3c52113.338a9","order":15,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":700,"y":2400,"wires":[]},{"id":"dcdb9738.89dda8","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Secret Key","label":"Secret Key","tooltip":"","group":"c3c52113.338a9","order":12,"width":"0","height":"0","passthru":false,"mode":"text","delay":"300","topic":"","x":370,"y":2460,"wires":[["3fe7ed32.0807f2"]]},{"id":"5a0ed23.947082c","type":"ui_button","z":"e1a3be1e.3571d","name":"Add Trust","group":"c3c52113.338a9","order":14,"width":"12","height":"1","passthru":false,"label":"Add Trust","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":200,"y":2120,"wires":[["7117e897.ba00a8","afd70817.be9848"]]},{"id":"9628b69f.1117b8","type":"ui_text","z":"e1a3be1e.3571d","group":"c3c52113.338a9","order":16,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":700,"y":2120,"wires":[]},{"id":"23427b62.718ff4","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":590,"y":2720,"wires":[]},{"id":"757b0180.adb28","type":"function","z":"e1a3be1e.3571d","name":"add trust","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secretdist',secret);\nvar asset = flow.get('assetname',asset);\nvar secretiss = flow.get('secretiss',secretiss);\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar issKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar assetiss = issKeys.publicKey();\n//var destinationId = recipient;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.changeTrust({\n          //destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          //amount: amount,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('Trust in StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":2720,"wires":[["23427b62.718ff4","5f34d3a6.7bb57c"]]},{"id":"4972f63f.4ddcb8","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SDVO2J7XOJYWWYC3XCTKW26S7XVO5BMYKRQSOV43USOKM33TWG4ATAOP","payloadType":"str","x":200,"y":2720,"wires":[["757b0180.adb28"]]},{"id":"6416c75.8aca438","type":"comment","z":"e1a3be1e.3571d","name":"Create Token","info":"","x":350,"y":2660,"wires":[]},{"id":"296dc6cd.93886a","type":"ui_button","z":"e1a3be1e.3571d","name":"Create Token","group":"9fc23374.89621","order":5,"width":"6","height":"1","passthru":false,"label":"Create Token","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Sending to Stellar","payloadType":"str","topic":"","x":190,"y":2780,"wires":[["757b0180.adb28","35cc3236.8b51ee"]]},{"id":"35cc3236.8b51ee","type":"ui_text","z":"e1a3be1e.3571d","group":"9fc23374.89621","order":6,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":720,"y":2760,"wires":[]},{"id":"f47c61d1.c6ba8","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Secret Key Issuer","label":"Secret Key Issuer","tooltip":"","group":"9fc23374.89621","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":970,"y":2700,"wires":[["ae45ff16.bb242"]]},{"id":"41d32b01.845cd4","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Asset - Name","label":"Asset - Name","tooltip":"","group":"9fc23374.89621","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":960,"y":2740,"wires":[["1f9f7bab.d18504"]]},{"id":"64a273a2.b624ec","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Amount","label":"Amount","tooltip":"","group":"9fc23374.89621","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":940,"y":2820,"wires":[["4ba5c1f5.b2958"]]},{"id":"ae45ff16.bb242","type":"function","z":"e1a3be1e.3571d","name":"secretiss","func":"var secretiss = msg.payload\nflow.set('secretiss',secretiss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":2700,"wires":[[]]},{"id":"1f9f7bab.d18504","type":"function","z":"e1a3be1e.3571d","name":"assetname","func":"var assetname = msg.payload\nflow.set('assetname',assetname);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1190,"y":2740,"wires":[[]]},{"id":"4ba5c1f5.b2958","type":"function","z":"e1a3be1e.3571d","name":"quant3","func":"var quant3 = msg.payload\nflow.set('quant3',quant3);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1170,"y":2820,"wires":[[]]},{"id":"a46ef3e1.04587","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Secret Key - Distributor","label":"Secret Key - Distributor","tooltip":"","group":"9fc23374.89621","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":990,"y":2780,"wires":[["29b7138d.cef58c"]]},{"id":"29b7138d.cef58c","type":"function","z":"e1a3be1e.3571d","name":"secretdist","func":"var secretdist = msg.payload\nflow.set('secretdist',secretdist);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":2780,"wires":[[]]},{"id":"5f34d3a6.7bb57c","type":"function","z":"e1a3be1e.3571d","name":"Submit Token Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secretiss = flow.get('secretiss',secretiss);\nvar secretdist = flow.get('secretdist',secretdist);\nvar distKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar dest = distKeys.publicKey();\nvar quant3 = flow.get('quant3',quant3);\nvar assetname = flow.get('assetname',assetname);\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar assetiss = sourceKeys.publicKey();\nvar memo = flow.get('memo',memo);\n\n\n\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\ncontext.set('destinationId',destinationId)\nvar iss = sourceKeys.publicKey()\ncontext.set('iss',iss)\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(assetname,assetiss),\n          amount: quant3,\n        }),\n      )\n      \n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('Created by StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":2860,"wires":[["35cc3236.8b51ee","23427b62.718ff4"]]},{"id":"ac9f1db4.8d2e7","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":2900,"wires":[["5f34d3a6.7bb57c"]]},{"id":"7dd3ce04.eb69e","type":"debug","z":"e1a3be1e.3571d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":610,"y":3200,"wires":[]},{"id":"1557e58b.31e2aa","type":"function","z":"e1a3be1e.3571d","name":"add trust","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secretor',secret);\nvar asset = flow.get('assetname',asset);\nvar secretiss = msg.secret\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar issKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar assetiss = issKeys.publicKey();\n//var destinationId = recipient;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.changeTrust({\n          //destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          //amount: amount,\n        }),\n      )\n      \n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('Trust in StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":3240,"wires":[["7dd3ce04.eb69e","b7867db1.420c6"]]},{"id":"31ef52b3.a4ab9e","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SDVO2J7XOJYWWYC3XCTKW26S7XVO5BMYKRQSOV43USOKM33TWG4ATAOP","payloadType":"str","x":160,"y":3220,"wires":[["54791662.4b05b8"]]},{"id":"b65ec526.1661c8","type":"comment","z":"e1a3be1e.3571d","name":"Create NFT","info":"","x":310,"y":3160,"wires":[]},{"id":"334ef96a.cb0b16","type":"ui_button","z":"e1a3be1e.3571d","name":"Create Token","group":"b348d20e.8f775","order":5,"width":"6","height":"1","passthru":false,"label":"Create Token","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Sending to Stellar","payloadType":"str","topic":"","x":150,"y":3280,"wires":[["cf5e5e94.cce25","54791662.4b05b8"]]},{"id":"cf5e5e94.cce25","type":"ui_text","z":"e1a3be1e.3571d","group":"b348d20e.8f775","order":6,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":740,"y":3380,"wires":[]},{"id":"86f5aef6.43f8b","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Secret Key Origin","label":"Secret Key Origin","tooltip":"","group":"b348d20e.8f775","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":930,"y":3200,"wires":[["f276bbeb.ae0e08"]]},{"id":"fbee9364.8ea15","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Asset - Name","label":"Asset - Name","tooltip":"","group":"b348d20e.8f775","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":920,"y":3240,"wires":[["de6c0635.6d8c88"]]},{"id":"fc486902.aa8bd8","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Amount","label":"Amount","tooltip":"","group":"b348d20e.8f775","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":900,"y":3320,"wires":[["6345bdf.46dcf44"]]},{"id":"f276bbeb.ae0e08","type":"function","z":"e1a3be1e.3571d","name":"secretor","func":"var secretor = msg.payload\nflow.set('secretor',secretor);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1140,"y":3200,"wires":[[]]},{"id":"de6c0635.6d8c88","type":"function","z":"e1a3be1e.3571d","name":"assetname","func":"var assetname = msg.payload\nflow.set('assetname',assetname);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1150,"y":3240,"wires":[[]]},{"id":"6345bdf.46dcf44","type":"function","z":"e1a3be1e.3571d","name":"quant4","func":"//var quant4 = msg.payload*.0000001\nvar quant4 = msg.payload\n//quant4 = quant4.toString()\n//var quant5 = String(quant4)\nflow.set('quant4',quant4);\n//flow.set('quant5',quant5);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":3320,"wires":[[]]},{"id":"256f7ffb.492cf","type":"ui_text_input","z":"e1a3be1e.3571d","name":"Data","label":"Data (IPFS CID)","tooltip":"","group":"b348d20e.8f775","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":890,"y":3280,"wires":[["4a95fcd4.52fca4"]]},{"id":"4a95fcd4.52fca4","type":"function","z":"e1a3be1e.3571d","name":"data","func":"var data = msg.payload\nflow.set('data',data);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":3280,"wires":[[]]},{"id":"b7867db1.420c6","type":"function","z":"e1a3be1e.3571d","name":"Submit Token Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secretiss = msg.secret\nvar secretdist = flow.get('secretor',secretdist);\nvar distKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar dest = distKeys.publicKey();\nvar quant4 = flow.get('quant4',quant4);\n//context.set('quant4',quant4)\n//quant4 = quant4.toString();\nvar assetname = flow.get('assetname',assetname);\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar assetiss = sourceKeys.publicKey();\nvar memo = flow.get('memo',memo);\n\n\n\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\ncontext.set('destinationId',destinationId)\nvar iss = sourceKeys.publicKey()\ncontext.set('iss',iss)\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(assetname,assetiss),\n          amount: quant4,\n        }),\n      )\n      \n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('NFT by StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":510,"y":3300,"wires":[["cf5e5e94.cce25","7dd3ce04.eb69e"]]},{"id":"382b818b.38d10e","type":"inject","z":"e1a3be1e.3571d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":3400,"wires":[["b7867db1.420c6"]]},{"id":"beed924a.fdbd8","type":"inject","z":"984ac0e8.61d6f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":200,"wires":[["392451ab.5b8aae"]]},{"id":"8524b2a5.81eec","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":800,"y":200,"wires":[]},{"id":"392451ab.5b8aae","type":"function","z":"984ac0e8.61d6f","name":"","func":"msg.payload.quant=\"5\"\nmsg.payload.secret=\"asdf\"\nmsg.recipient=\"lkjh\"\nmsg.type=\"xlm\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":200,"wires":[["8524b2a5.81eec","46b37585.74370c"]]},{"id":"2fa3d090.3fd1d","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":820,"y":300,"wires":[]},{"id":"46b37585.74370c","type":"function","z":"984ac0e8.61d6f","name":"","func":"var abc = msg.payload.quant\nvar abcd = msg.payload.secret\nvar abcde = msg.recipient\nvar abcdef = msg.type\n\nflow.set('abc',abc)\nflow.set('abcd',abcd)\nflow.set('abcde',abcde)\nflow.set('abcdef',abcdef)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":650,"y":260,"wires":[["2fa3d090.3fd1d"]]},{"id":"afd70817.be9848","type":"change","z":"e1a3be1e.3571d","name":"Status Update","rules":[{"t":"set","p":"payload","pt":"msg","to":"Sending Transaction To Stellar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":2120,"wires":[["9628b69f.1117b8"]]},{"id":"e9f27b1a.78bd28","type":"comment","z":"984ac0e8.61d6f","name":"Counter trade received","info":"","x":350,"y":400,"wires":[]},{"id":"affc30b.95a5dd","type":"ui_text","z":"984ac0e8.61d6f","group":"202717cb.ef6a48","order":9,"width":0,"height":0,"name":"Counter Offer Received","label":"Counter Offer Received","format":"{{msg.payload}}","layout":"row-spread","x":650,"y":480,"wires":[]},{"id":"62c776c1.c582e8","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Public Key","label":"Public Key to Monitor","tooltip":"","group":"202717cb.ef6a48","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"0","topic":"","x":130,"y":480,"wires":[["c7ee8f5b.42cc3","9f6bc3a9.20729"]]},{"id":"c7ee8f5b.42cc3","type":"function","z":"984ac0e8.61d6f","name":"Monitor Account","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar accountId = msg.payload;\n\n    \n// Create an API call to query payments involving the account.\nvar trades = server.trades().forAccount(accountId);\n\n// If some payments have already been handled, start the results from the\n// last seen payment. (See below in `handlePayment` where it gets saved.)\nvar lastToken = loadLastPagingToken();\nif (lastToken) {\n  trades.cursor(lastToken);\n}\n\n// `stream` will send each recorded payment, one by one, then keep the\n// connection open and continue to send you new payments as they occur.\ntrades.stream({\n  onmessage: function (trade) {\n    // Record the paging token so we can start from here next time.\n    savePagingToken(trade.paging_token);\n\n    /*\n    if (trade.to !== accountId) {\n      return;\n    }\n\n    // In Stellar’s API, Lumens are referred to as the “native” type. Other\n    // asset types have more detailed information.\n    var asset;\n    if (payment.asset_type === \"native\") {\n      asset = \"lumens\";\n    } else {\n      asset = payment.asset_code;\n    }\n    */\n    //console.log(payment.amount + \" \" + asset + \" from \" + payment.from);\n    //msg.payload=\"amount: \"+payment.amount+\" asset: \"+asset+\" payment from: \"+payment.from\n    msg.payload=\"amount: \"+trade.counter_amount+\" type: \"+trade.base_asset_code\n    msg.amount=trade.counter_amount\n    msg.code=trade.base_asset_code\n    msg.iss=trade.base_asset_issuer\n    msg.originalcode=trade.counter_asset_code\n    msg.originaliss=trade.counter_asset_issuer\n\n    //sender = payment.from;\n    //type = asset;\n    //amount_rec = payment.amount;\n    node.send(msg)\n    //node.send(msg.payload)\n  },\n\n\n\n  onerror: function (error) {\n    console.error(\"Error in payment stream\");\n  },\n});\n\nfunction savePagingToken(token) {\n  // In most cases, you should save this to a local database or file so that\n  // you can load it next time you stream new payments.\n}\n\nfunction loadLastPagingToken() {\n  // Get the last paging token from a local database or file\n}\n\n//return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":480,"wires":[["2da59c90.3f4d64","affc30b.95a5dd","d18ec012.5cafb"]]},{"id":"53ecd41.298e22c","type":"ui_toast","z":"984ac0e8.61d6f","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1060,"y":760,"wires":[]},{"id":"2da59c90.3f4d64","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":520,"wires":[]},{"id":"65ddf24f.44c7ac","type":"comment","z":"984ac0e8.61d6f","name":"Trade again","info":"","x":690,"y":700,"wires":[]},{"id":"412a9003.8c9ee","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1050,"y":800,"wires":[]},{"id":"f7f5fb26.a60968","type":"function","z":"984ac0e8.61d6f","name":"","func":"var amount_rec = flow.get('amount_rec',amount_rec);\n\nmsg.payload = \"Returning your \"+amount_rec+\" XLM\"\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":960,"wires":[["412a9003.8c9ee","53ecd41.298e22c"]]},{"id":"7c52c995.9fa0f8","type":"inject","z":"984ac0e8.61d6f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"sourceKeys\":\"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX\",\"destinationId\":\"GD5LYKVQZYHDNJ3QTEDX3EBF5XK3W5NADGTBT5KLD276OPP7YKDIQIBZ\"}","payloadType":"json","x":450,"y":1000,"wires":[["e97f47e5.7db8c8"]]},{"id":"60f0b7d7.4e9098","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1030,"y":1000,"wires":[]},{"id":"e97f47e5.7db8c8","type":"function","z":"984ac0e8.61d6f","name":"Submit XLM Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = \"SATY6XOPDHWSMPTYICPDKQEEHNRSDFLM472AKDYYIBJVZFLSYHKHSY7F\";\nvar sender=flow.get('sender',sender);\nvar dest = sender;\nvar amount_rec=flow.get('amount_rec',amount_rec);\nvar quantxlm = amount_rec;\n//var quantxlm = \"69\";\n//var asset = flow.get('asset',asset);\n//var assetiss = flow.get('assetiss',assetiss);\nvar memo = \"Autoreply from TRRTbot\";\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          asset: StellarSdk.Asset.native(),\n          //asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quantxlm,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1000,"wires":[["60f0b7d7.4e9098"]]},{"id":"f071198.2592de8","type":"inject","z":"984ac0e8.61d6f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":470,"y":880,"wires":[["d18ec012.5cafb"]]},{"id":"9f6bc3a9.20729","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":360,"y":560,"wires":[]},{"id":"d18ec012.5cafb","type":"function","z":"984ac0e8.61d6f","name":"Create Sell Offer","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secret',secret);\nvar sell = msg.code\nvar selliss = msg.iss\nvar quant = msg.amount\nvar buy = msg.originalcode\nvar buyiss = msg.originaliss\nvar buyprice = flow.get('buyprice',buyprice);\n//var memo = flow.get('memo',memo)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(\n  secret,\n);\n//var destinationId = msg.payload.sourceAccount;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  //.loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  //.catch(function (error) {\n   // if (error instanceof StellarSdk.NotFoundError) {\n  //    throw new Error(\"The destination account does not exist!\");\n  //  } else return error;\n // })\n  // If there was no error, load up-to-date information on your account.\n  .loadAccount(sourceKeys.publicKey())\n  \n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.manageSellOffer({\n            selling: new StellarSdk.Asset(sell,selliss),\n            buying: new StellarSdk.Asset(buy,buyiss),\n            amount: quant,\n            price: buyprice\n     }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(\"NodeRedBot BLSH\"))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    msg.xdr=transaction.toEnvelope().toXDR('base64')\n   // msg.xdr=transaction.envelope_xdr\n   // node.send(msg);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    //console.log(\"Success! Results:\", result);\n    msg.payload = \"Buying \"+quant+\" \"+buy+\" at \"+buyprice+\" \"+buy+\"/\"+sell;\n    node.send(msg);\n  })\n  .catch(function (error) {\n    //console.error(\"Something went wrong!\", error);\n   /* var err = error\n    flow.set('err',err)\n    msg.error=error.extras.result_codes.operations\n     node.send(msg.error)\n   */ // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":730,"y":820,"wires":[["412a9003.8c9ee","53ecd41.298e22c","af93bbac.6662d8"]]},{"id":"78d4f824.297b78","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Secret Key","label":"Secret Key","tooltip":"","group":"202717cb.ef6a48","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"0","topic":"","topicType":"str","x":170,"y":820,"wires":[["2b69e5.850b961c"]]},{"id":"2b69e5.850b961c","type":"function","z":"984ac0e8.61d6f","name":"secret","func":"var secret = msg.payload\nflow.set('secret',secret);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":330,"y":820,"wires":[[]]},{"id":"69e21da4.7d71f4","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Buy Price","label":"Buy Price","tooltip":"","group":"202717cb.ef6a48","order":7,"width":"0","height":"0","passthru":true,"mode":"text","delay":"0","topic":"","topicType":"str","x":160,"y":860,"wires":[["7d6071fa.1c413"]]},{"id":"7d6071fa.1c413","type":"function","z":"984ac0e8.61d6f","name":"buy price","func":"var buyprice = msg.payload\nflow.set('buyprice',buyprice);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":860,"wires":[[]]},{"id":"571df4dd.d1bd0c","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Sell Price","label":"Sell Price","tooltip":"","group":"202717cb.ef6a48","order":8,"width":"0","height":"0","passthru":true,"mode":"text","delay":"0","topic":"","topicType":"str","x":160,"y":900,"wires":[["2c3337b5.445038"]]},{"id":"2c3337b5.445038","type":"function","z":"984ac0e8.61d6f","name":"sell price","func":"var sellprice = msg.payload\nflow.set('sellprice',sellprice);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":900,"wires":[[]]},{"id":"af93bbac.6662d8","type":"ui_text","z":"984ac0e8.61d6f","group":"202717cb.ef6a48","order":10,"width":0,"height":0,"name":"Bot Response","label":"Bot Response","format":"{{msg.payload}}","layout":"row-spread","x":1000,"y":900,"wires":[]},{"id":"dbc23f7.60b90c","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"xdr","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":720,"wires":[]},{"id":"3d5fb2fc.b12a8e","type":"debug","z":"984ac0e8.61d6f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"error","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":680,"wires":[]},{"id":"3bdd267d.584a0a","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Asset to sell - Name","label":"Asset to sell - Name","tooltip":"","group":"202717cb.ef6a48","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":140,"y":940,"wires":[["a89f9f19.da659"]]},{"id":"a89f9f19.da659","type":"function","z":"984ac0e8.61d6f","name":"sell","func":"var sell = msg.payload\nflow.set('sell',sell);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":940,"wires":[[]]},{"id":"5e57e99a.cbdaf8","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Asset to sell - Issuer","label":"Asset to sell - Issuer","tooltip":"","group":"202717cb.ef6a48","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":140,"y":980,"wires":[["642cd726.6588c8"]]},{"id":"642cd726.6588c8","type":"function","z":"984ac0e8.61d6f","name":"selliss","func":"var selliss = msg.payload\nflow.set('selliss',selliss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":980,"wires":[[]]},{"id":"34f6e0ba.bd5bc","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Asset to buy - Name","label":"Asset to buy - Name","tooltip":"","group":"202717cb.ef6a48","order":5,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":140,"y":1020,"wires":[["6728eca0.361874"]]},{"id":"6728eca0.361874","type":"function","z":"984ac0e8.61d6f","name":"buy","func":"var buy = msg.payload\nflow.set('buy',buy);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":1020,"wires":[[]]},{"id":"97ea8588.d15628","type":"ui_text_input","z":"984ac0e8.61d6f","name":"Asset to buy - Issuer","label":"Asset to buy - Issuer","tooltip":"","group":"202717cb.ef6a48","order":6,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":140,"y":1060,"wires":[["14de55c9.23aada"]]},{"id":"14de55c9.23aada","type":"function","z":"984ac0e8.61d6f","name":"buyiss","func":"var buyiss = msg.payload\nflow.set('buyiss',buyiss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":1060,"wires":[[]]},{"id":"54791662.4b05b8","type":"function","z":"e1a3be1e.3571d","name":"return keypair","func":"const fetch = global.get(\"nodefetch\");\n\nvar StellarSdk = global.get(\"stellarsdk\");\n// create a completely new and unique pair of keys\n// see more about KeyPair objects: https://stellar.github.io/js-stellar-sdk/Keypair.html\nconst pair = StellarSdk.Keypair.random();\n\n//msg.payload = \"Pair secret: \" + pair.secret()\n//node.send(msg)\n//msg.payload = \"Pair publickey: \" + pair.publicKey()\n//node.send(msg)\nasync function main() {\n  try {\n    const response = await fetch(\n      `https://friendbot.stellar.org?addr=${encodeURIComponent(\n        pair.publicKey(),\n      )}`,\n    );\n    const responseJSON = await response.json();\n    console.log(\"SUCCESS! You have a new account :)\\n\", responseJSON);\n  } catch (e) {\n    console.log(\"ERROR!\", e);\n  }\n\n\n}\nmain()\n\nmsg.secret=pair.secret();\n\nmsg.public=pair.publicKey();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":3200,"wires":[["7dd3ce04.eb69e","625613d9.aa1acc"]]},{"id":"625613d9.aa1acc","type":"delay","z":"e1a3be1e.3571d","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":3240,"wires":[["1557e58b.31e2aa"]]},{"id":"2cae21b6.5ed80e","type":"debug","z":"18789f31.847b91","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":140,"wires":[]},{"id":"720aa08e.45fe3","type":"function","z":"18789f31.847b91","name":"add trust","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secretor',secret);\nvar asset = flow.get('assetname',asset);\nvar secretiss = msg.secret\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar issKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar assetiss = issKeys.publicKey();\n//var destinationId = recipient;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.changeTrust({\n          //destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          //amount: amount,\n        }),\n      )\n     \n      \n      \n      \n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      //.addMemo(StellarSdk.Memo.text('Trust in StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n       msg.transaction=transaction\n      msg.xdr=transaction.toEnvelope().toXDR('base64')\n      node.send(msg)\n    // Sign the transaction to prove you are actually the person sending it.\n   // transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    //return server.submitTransaction(transaction);\n  })\n /* .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n   // node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });\n  */","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":220,"wires":[["28c10da9.24e922","cfe7a551.b98838"]]},{"id":"ad720a9.dc468f8","type":"inject","z":"18789f31.847b91","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SDVO2J7XOJYWWYC3XCTKW26S7XVO5BMYKRQSOV43USOKM33TWG4ATAOP","payloadType":"str","x":160,"y":200,"wires":[["aa357be5.92c888"]]},{"id":"2b3d40a8.96bc9","type":"comment","z":"18789f31.847b91","name":"Create NFT","info":"","x":310,"y":140,"wires":[]},{"id":"51bd16e1.5d0f08","type":"ui_button","z":"18789f31.847b91","name":"Create Token","group":"b6477852.bf6508","order":5,"width":"6","height":"1","passthru":false,"label":"Create Token","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Sending to Stellar","payloadType":"str","topic":"","x":150,"y":260,"wires":[["84ea57fd.4f8f78","aa357be5.92c888"]]},{"id":"84ea57fd.4f8f78","type":"ui_text","z":"18789f31.847b91","group":"b6477852.bf6508","order":6,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":740,"y":360,"wires":[]},{"id":"c4829e23.e6e8c","type":"ui_text_input","z":"18789f31.847b91","name":"Secret Key Origin","label":"Secret Key Origin","tooltip":"","group":"b6477852.bf6508","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":930,"y":180,"wires":[["d444402a.0ea31"]]},{"id":"a76345ce.6ff4d8","type":"ui_text_input","z":"18789f31.847b91","name":"Asset - Name","label":"Asset - Name","tooltip":"","group":"b6477852.bf6508","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":920,"y":220,"wires":[["24b9ff2f.3327e"]]},{"id":"67d61609.082258","type":"ui_text_input","z":"18789f31.847b91","name":"Amount","label":"Amount","tooltip":"","group":"b6477852.bf6508","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":900,"y":300,"wires":[["1aa1e7d5.9d9f58"]]},{"id":"d444402a.0ea31","type":"function","z":"18789f31.847b91","name":"secretor","func":"var secretor = msg.payload\nflow.set('secretor',secretor);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1140,"y":180,"wires":[[]]},{"id":"24b9ff2f.3327e","type":"function","z":"18789f31.847b91","name":"assetname","func":"var assetname = msg.payload\nflow.set('assetname',assetname);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1150,"y":220,"wires":[[]]},{"id":"1aa1e7d5.9d9f58","type":"function","z":"18789f31.847b91","name":"quant4","func":"//var quant4 = msg.payload*.0000001\nvar quant4 = msg.payload\n//quant4 = quant4.toString()\n//var quant5 = String(quant4)\nflow.set('quant4',quant4);\n//flow.set('quant5',quant5);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":300,"wires":[[]]},{"id":"9873d74d.3f2d98","type":"ui_text_input","z":"18789f31.847b91","name":"Data","label":"Data (IPFS CID)","tooltip":"","group":"b6477852.bf6508","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":890,"y":260,"wires":[["f8ec8ef4.8511b"]]},{"id":"f8ec8ef4.8511b","type":"function","z":"18789f31.847b91","name":"data","func":"var data = msg.payload\nflow.set('data',data);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":260,"wires":[[]]},{"id":"aa357be5.92c888","type":"function","z":"18789f31.847b91","name":"fund random keypair msg.secret msg.public","func":"const fetch = global.get(\"nodefetch\");\n\nvar StellarSdk = global.get(\"stellarsdk\");\n// create a completely new and unique pair of keys\n// see more about KeyPair objects: https://stellar.github.io/js-stellar-sdk/Keypair.html\nconst pair = StellarSdk.Keypair.random();\n\n//msg.payload = \"Pair secret: \" + pair.secret()\n//node.send(msg)\n//msg.payload = \"Pair publickey: \" + pair.publicKey()\n//node.send(msg)\nasync function main() {\n  try {\n    const response = await fetch(\n      `https://friendbot.stellar.org?addr=${encodeURIComponent(\n        pair.publicKey(),\n      )}`,\n    );\n    const responseJSON = await response.json();\n    console.log(\"SUCCESS! You have a new account :)\\n\", responseJSON);\n  } catch (e) {\n    console.log(\"ERROR!\", e);\n  }\n\n\n}\nmain()\n\nmsg.secret=pair.secret();\n\nmsg.public=pair.publicKey();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":180,"wires":[["2cae21b6.5ed80e","b1d939ef.12d2b8"]]},{"id":"28c10da9.24e922","type":"debug","z":"18789f31.847b91","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":200,"wires":[]},{"id":"cdf1427f.8fca","type":"debug","z":"18789f31.847b91","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":710,"y":260,"wires":[]},{"id":"64d3b09c.9e48","type":"debug","z":"421cf1f0.a26fc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":750,"y":280,"wires":[]},{"id":"7712449b.e5cc8c","type":"comment","z":"421cf1f0.a26fc","name":"Coinqvest Horizon Mainnet Instance","info":"","x":400,"y":260,"wires":[]},{"id":"b3d16940.6d5808","type":"ui_text_input","z":"421cf1f0.a26fc","name":"Secret Key","label":"Secret Key","tooltip":"","group":"d19bed92.49b26","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1050,"y":300,"wires":[["a5a499a5.e0f3c8"]]},{"id":"b62a3ce6.1cbca","type":"ui_text","z":"421cf1f0.a26fc","group":"d19bed92.49b26","order":11,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":840,"y":400,"wires":[]},{"id":"2fcc6a55.3eadd6","type":"ui_text","z":"421cf1f0.a26fc","group":"d19bed92.49b26","order":10,"width":0,"height":0,"name":"Submitting text display","label":"","format":"{{msg.topic}}","layout":"row-spread","x":840,"y":340,"wires":[]},{"id":"1975cb02.0e2cc5","type":"function","z":"421cf1f0.a26fc","name":"Submit XLM Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon.stellar.coinqvest.com/\");\nvar secret = flow.get('secret',secret);\nvar dest = flow.get('dest',dest);\nvar quantxlm = flow.get('quantxlm',quantxlm);\nvar asset = flow.get('asset',asset);\nvar assetiss = flow.get('assetiss',assetiss);\nvar memo = flow.get('memo',memo);\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.PUBLIC,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          asset: StellarSdk.Asset.native(),\n          //asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quantxlm,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":400,"wires":[["b62a3ce6.1cbca","d7982d52.7bb3e","64d3b09c.9e48"]]},{"id":"4c966cf5.131784","type":"ui_text_input","z":"421cf1f0.a26fc","name":"Destination","label":"Destination","tooltip":"","group":"d19bed92.49b26","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1050,"y":340,"wires":[["699bde89.ccfb6"]]},{"id":"3bf182dc.e82e0e","type":"ui_button","z":"421cf1f0.a26fc","name":"SendXLM","group":"d19bed92.49b26","order":6,"width":"6","height":"1","passthru":false,"label":"Send XLM","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":140,"y":360,"wires":[["1975cb02.0e2cc5","1b9b3379.9dddbd","652a8762.768eb8"]]},{"id":"a5a499a5.e0f3c8","type":"function","z":"421cf1f0.a26fc","name":"secret","func":"var secret = msg.payload\nflow.set('secret',secret);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1290,"y":300,"wires":[[]]},{"id":"88a41a2e.59f888","type":"ui_text_input","z":"421cf1f0.a26fc","name":"Amount","label":"Amount","tooltip":"","group":"d19bed92.49b26","order":7,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1040,"y":460,"wires":[["ce5c025e.f910f"]]},{"id":"699bde89.ccfb6","type":"function","z":"421cf1f0.a26fc","name":"dest","func":"var dest = msg.payload\nflow.set('dest',dest);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1290,"y":340,"wires":[[]]},{"id":"ce5c025e.f910f","type":"function","z":"421cf1f0.a26fc","name":"quant","func":"var quant = msg.payload\nflow.set('quant',quant);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1290,"y":460,"wires":[[]]},{"id":"1b9b3379.9dddbd","type":"change","z":"421cf1f0.a26fc","name":"Status Update","rules":[{"t":"set","p":"topic","pt":"msg","to":"Sending Transaction To Stellar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":320,"wires":[["2fcc6a55.3eadd6"]]},{"id":"652a8762.768eb8","type":"change","z":"421cf1f0.a26fc","name":"Reset Field","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":360,"wires":[["b62a3ce6.1cbca"]]},{"id":"d7982d52.7bb3e","type":"change","z":"421cf1f0.a26fc","name":"Reset Field","rules":[{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":340,"wires":[["2fcc6a55.3eadd6"]]},{"id":"7ede5b99.5a7324","type":"ui_text_input","z":"421cf1f0.a26fc","name":"Asset","label":"Asset","tooltip":"","group":"d19bed92.49b26","order":5,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1030,"y":380,"wires":[["b4812685.a4f7a8"]]},{"id":"88f3ba43.e23ca8","type":"ui_text_input","z":"421cf1f0.a26fc","name":"Issuer","label":"Issuer","tooltip":"","group":"d19bed92.49b26","order":8,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1030,"y":420,"wires":[["58cd36ca.269af8"]]},{"id":"b4812685.a4f7a8","type":"function","z":"421cf1f0.a26fc","name":"asset","func":"var asset = msg.payload\nflow.set('asset',asset);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1290,"y":380,"wires":[[]]},{"id":"58cd36ca.269af8","type":"function","z":"421cf1f0.a26fc","name":"assetiss","func":"var assetiss = msg.payload\nflow.set('assetiss',assetiss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1300,"y":420,"wires":[[]]},{"id":"29f97de.a543a82","type":"ui_text_input","z":"421cf1f0.a26fc","name":"AmountXLM","label":"AmountXLM","tooltip":"","group":"d19bed92.49b26","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1050,"y":500,"wires":[["436cb433.39035c"]]},{"id":"436cb433.39035c","type":"function","z":"421cf1f0.a26fc","name":"quantxlm","func":"var quantxlm = msg.payload\nflow.set('quantxlm',quantxlm);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1300,"y":500,"wires":[[]]},{"id":"86d19d8e.be6b7","type":"function","z":"421cf1f0.a26fc","name":"Submit Token Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = flow.get('secret',secret);\nvar dest = flow.get('dest',dest);\nvar quant = flow.get('quant',quant);\nvar asset = flow.get('asset',asset);\nvar assetiss = flow.get('assetiss',assetiss);\nvar memo = flow.get('memo',memo);\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\nvar destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction;\n\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(destinationId)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quant,\n        }),\n      )\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":460,"wires":[["b62a3ce6.1cbca","d7982d52.7bb3e","64d3b09c.9e48"]]},{"id":"9a1c8ebf.a96f6","type":"ui_button","z":"421cf1f0.a26fc","name":"Send Token","group":"d19bed92.49b26","order":9,"width":"6","height":"1","passthru":false,"label":"Send Token","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":150,"y":460,"wires":[["86d19d8e.be6b7","1b9b3379.9dddbd","652a8762.768eb8"]]},{"id":"d40c8b91.af2138","type":"comment","z":"421cf1f0.a26fc","name":"Store Variables from Dashboard UI","info":"","x":1180,"y":260,"wires":[]},{"id":"ac3648a.9bc9cb8","type":"ui_text_input","z":"421cf1f0.a26fc","name":"Memo","label":"Memo","tooltip":"","group":"d19bed92.49b26","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","x":1030,"y":540,"wires":[["3f2ba3c4.891bcc"]]},{"id":"3f2ba3c4.891bcc","type":"function","z":"421cf1f0.a26fc","name":"memo","func":"var memo = msg.payload\nflow.set('memo',memo);\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is deployed.\nvar memo = \"Via BlockShangerous NodeRed\"\nflow.set('memo',memo);","finalize":"","x":1290,"y":540,"wires":[[]]},{"id":"b1d939ef.12d2b8","type":"delay","z":"18789f31.847b91","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":220,"wires":[["720aa08e.45fe3"]]},{"id":"cfe7a551.b98838","type":"function","z":"18789f31.847b91","name":"Submit XLM Transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secret = msg.secret;\n//var sender=flow.get('sender',sender);\n//var dest = sender;\n//var amount_rec=flow.get('amount_rec',amount_rec);\n//var quantxlm = amount_rec;\n//var quantxlm = \"69\";\n//var asset = flow.get('asset',asset);\n//var assetiss = flow.get('assetiss',assetiss);\nvar memo = \"StellarRed Tx Build\";\n\nmsg.unXDR=JSON.stringify(StellarSdk.xdr.TransactionEnvelope.fromXDR(msg.xdr, 'base64'))\nnode.send(msg)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secret);\n//var destinationId = dest;\n// Transaction will hold a built transaction we can resubmit if the result is unknown.\nvar transaction=msg.xdr;\nmsg.transaction=fromXDR(transaction, \"StellarSdk.Networks.TESTNET\")\nnode.send(msg)\n// First, check to make sure that the destination account exists.\n// You could skip this, but if the account does not exist, you will be charged\n// the transaction fee when the transaction fails.\nserver\n  .loadAccount(msg.public)\n  // If the account is not found, surface a nicer error message for logging.\n  .catch(function (error) {\n    if (error instanceof StellarSdk.NotFoundError) {\n      throw new Error(\"The destination account does not exist!\");\n    } else return error;\n  })\n  // If there was no error, load up-to-date information on your account.\n  .then(function () {\n    return server.loadAccount(sourceKeys.publicKey());\n  })\n    .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = StellarSdk.TransactionBuilder(msg.transaction)\n//  .then(function (sourceAccount) {\n    // Start building the transaction.\n  //  transaction = msg.transaction\n    \n /*     .addOperation(\n        StellarSdk.Operation.payment({\n          destination: destinationId,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          asset: StellarSdk.Asset.native(),\n          //asset: new StellarSdk.Asset(asset,assetiss),\n          amount: quantxlm,\n        }),\n      )\n      */\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text(memo))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    msg.xdr=transaction.toEnvelope().toXDR('base64')\n      node.send(msg);\n    // And finally, send it off to Stellar!\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    console.error(\"Something went wrong!\", error);\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":280,"wires":[["84ea57fd.4f8f78","cdf1427f.8fca"]]},{"id":"204498cb.d78108","type":"debug","z":"e6a7d07c.2f3da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":220,"wires":[]},{"id":"75eb5b66.9af5f4","type":"function","z":"e6a7d07c.2f3da","name":"Setup StellarSDK flow.transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secretiss = flow.get('secretiss',secretiss);\nvar asset = flow.get('asset',asset)\n\n//var op = msg.op\nflow.set('StellarSdk',StellarSdk);\nflow.set('server',server);\n//node.send(msg)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar assetiss = sourceKeys.publicKey()\nflow.set('assetiss',assetiss)\n\nvar transaction;\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      flow.set('transaction',transaction);\n      node.send(msg)\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":260,"wires":[["204498cb.d78108","2e1d96ac.4c8d5a"]]},{"id":"a1eac9e8.e85648","type":"inject","z":"e6a7d07c.2f3da","name":"","props":[{"p":"secret","v":"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX","vt":"str"},{"p":"name","v":"COOL","vt":"str"},{"p":"iss","v":"GBN5VTPXODILAQTMMB23ML5B7RKF657YXXALLWFKGZPSW53QGR6OUG4L","vt":"str"},{"p":"secretdist","v":"SABNLC3PJUYUV7WNC5V4YC253GHGH4NIZHN7EAUY6FLXRIVHTGU65TGN","vt":"str"},{"p":"dest","v":"GAC4LTCWBQAVRNXP67QMT55KZ3BIYPVMLIC46FYSO6HN2ZFZLFKW5WJX","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":240,"y":240,"wires":[["75eb5b66.9af5f4","1c81da0e.bf9896"]]},{"id":"c9c5d83b.be7b58","type":"comment","z":"e6a7d07c.2f3da","name":"Create Token","info":"","x":390,"y":180,"wires":[]},{"id":"c56d635a.bf1ff","type":"ui_button","z":"e6a7d07c.2f3da","name":"Create Token","group":"72af97e1.b08c68","order":5,"width":"6","height":"1","passthru":false,"label":"Create Token","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":130,"y":380,"wires":[["75eb5b66.9af5f4","fa34583b.14c978"]]},{"id":"22de365d.ca387a","type":"ui_text","z":"e6a7d07c.2f3da","group":"72af97e1.b08c68","order":16,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":900,"y":500,"wires":[]},{"id":"fa34583b.14c978","type":"change","z":"e6a7d07c.2f3da","name":"Status Update","rules":[{"t":"set","p":"payload","pt":"msg","to":"Sending Transaction To Stellar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":500,"wires":[["22de365d.ca387a"]]},{"id":"1c81da0e.bf9896","type":"debug","z":"e6a7d07c.2f3da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":610,"y":200,"wires":[]},{"id":"2e1d96ac.4c8d5a","type":"function","z":"e6a7d07c.2f3da","name":"add trust","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretdist = flow.get('secretdist',secretdist);\nvar asset = flow.get('asset',asset)\nvar assetiss = flow.get('assetiss',assetiss)\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar transaction;\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n      .addOperation(\n        StellarSdk.Operation.changeTrust({\n          asset: new StellarSdk.Asset(asset,assetiss),\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n     flow.set('transaction',transaction);\n      node.send(msg)\n   // return server.submitTransaction(transaction);\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":300,"wires":[["6285861b.4ff458","886a7325.935ab"]]},{"id":"6285861b.4ff458","type":"debug","z":"e6a7d07c.2f3da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":830,"y":260,"wires":[]},{"id":"6e91b204.d3f57c","type":"function","z":"e6a7d07c.2f3da","name":"sign and submit","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretdist = flow.get('secretdist',secretdist);\nvar asset = flow.get('asset',asset)\nvar assetiss = flow.get('assetiss',assetiss)\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\nvar secretiss = flow.get('secretiss',secretiss);\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar sourceKeys2 = StellarSdk.Keypair.fromSecret(secretdist);\nvar transaction;\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n    \n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('Trust in StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    transaction.sign(sourceKeys2);\n    // And finally, send it off to Stellar!\n    msg.xdr=transaction.toEnvelope().toXDR('base64')\n    //node.send(msg)\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    msg.error=\"Something went wrong! \"+ error;\n    msg.send(msg)\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":400,"wires":[["cad8a472.500fa8","58701b24.785984","22de365d.ca387a"]]},{"id":"cad8a472.500fa8","type":"debug","z":"e6a7d07c.2f3da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1250,"y":360,"wires":[]},{"id":"58701b24.785984","type":"debug","z":"e6a7d07c.2f3da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1270,"y":420,"wires":[]},{"id":"886a7325.935ab","type":"function","z":"e6a7d07c.2f3da","name":"send token","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretiss = flow.get('secretiss',secretiss);\nvar asset = flow.get('asset',asset)\nvar assetiss = flow.get('assetiss',assetiss)\nvar amount = flow.get('amount',amount)\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\n\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar transaction;\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: sourceKeys.publicKey(),\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset,assetiss),\n          amount: amount,\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n     flow.set('transaction',transaction);\n      node.send(msg)\n   // return server.submitTransaction(transaction);\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":750,"y":340,"wires":[["6e91b204.d3f57c","3fb338eb.065d88"]]},{"id":"10b3e5e3.3b28fa","type":"ui_text_input","z":"e6a7d07c.2f3da","name":"Asset - Name","label":"Asset - Name","tooltip":"","group":"72af97e1.b08c68","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1160,"y":840,"wires":[["d7d940f.7271ec"]]},{"id":"a3f37bb9.582458","type":"ui_text_input","z":"e6a7d07c.2f3da","name":"Amount","label":"Amount","tooltip":"","group":"72af97e1.b08c68","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1140,"y":880,"wires":[["eafd4bec.183ed8"]]},{"id":"6a72b9b2.fa8a08","type":"ui_text_input","z":"e6a7d07c.2f3da","name":"Secret Key - Distributor","label":"Secret Key - Distributor","tooltip":"","group":"72af97e1.b08c68","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1190,"y":800,"wires":[["aeb26a92.b6daa8"]]},{"id":"3fcfa89d.e7f668","type":"ui_text_input","z":"e6a7d07c.2f3da","name":"Secret Key Issuer","label":"Secret Key Issuer","tooltip":"","group":"72af97e1.b08c68","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1170,"y":760,"wires":[["1a8ef1a9.7b9d6e"]]},{"id":"f3ba7148.5fb2","type":"inject","z":"62be80ab.53a19","name":"","props":[{"p":"secret","v":"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX","vt":"str"},{"p":"name","v":"COOL","vt":"str"},{"p":"iss","v":"GBN5VTPXODILAQTMMB23ML5B7RKF657YXXALLWFKGZPSW53QGR6OUG4L","vt":"str"},{"p":"op","v":"changeTrust","vt":"str"},{"p":"dest","v":"GAC4LTCWBQAVRNXP67QMT55KZ3BIYPVMLIC46FYSO6HN2ZFZLFKW5WJX","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":220,"y":220,"wires":[["19cfd77d.479799"]]},{"id":"aacf328a.6732f","type":"comment","z":"62be80ab.53a19","name":"Create Testnet NFTs","info":"","x":390,"y":160,"wires":[]},{"id":"538aab9.9653254","type":"ui_button","z":"62be80ab.53a19","name":"Create Token","group":"8e658883.529268","order":5,"width":"6","height":"1","passthru":false,"label":"Create Token","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":150,"y":360,"wires":[["95c82711.922ac8","18ce53b8.16de5c"]]},{"id":"e50df93c.ba1b18","type":"ui_text_input","z":"62be80ab.53a19","name":"Asset - Name","label":"Asset - Name","tooltip":"","group":"8e658883.529268","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1040,"y":640,"wires":[["e3e074bd.3cd888"]]},{"id":"3ca3f03f.9969d","type":"ui_text_input","z":"62be80ab.53a19","name":"Amount","label":"Amount","tooltip":"","group":"8e658883.529268","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1020,"y":720,"wires":[["e7875606.5d1748"]]},{"id":"49043f22.0bb1b","type":"ui_text_input","z":"62be80ab.53a19","name":"Secret Key - Origin","label":"Secret Key - Origin","tooltip":"","group":"8e658883.529268","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1050,"y":600,"wires":[["7451fc0.3083c04"]]},{"id":"1a8ef1a9.7b9d6e","type":"function","z":"e6a7d07c.2f3da","name":"secretiss","func":"var secretiss = msg.payload\nflow.set('secretiss',secretiss);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1400,"y":760,"wires":[[]]},{"id":"d7d940f.7271ec","type":"function","z":"e6a7d07c.2f3da","name":"asset","func":"var asset = msg.payload\nflow.set('asset',asset);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1390,"y":840,"wires":[[]]},{"id":"eafd4bec.183ed8","type":"function","z":"e6a7d07c.2f3da","name":"amount","func":"var amount = msg.payload\nflow.set('amount',amount);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1400,"y":880,"wires":[[]]},{"id":"aeb26a92.b6daa8","type":"function","z":"e6a7d07c.2f3da","name":"secretdist","func":"var secretdist = msg.payload\nflow.set('secretdist',secretdist);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1400,"y":800,"wires":[[]]},{"id":"3fb338eb.065d88","type":"debug","z":"e6a7d07c.2f3da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":320,"wires":[]},{"id":"778e4e0.fa958b","type":"ui_text_input","z":"62be80ab.53a19","name":"Data","label":"Data (IPFS CID)","tooltip":"","group":"8e658883.529268","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":1010,"y":680,"wires":[["21165c3d.cc5214"]]},{"id":"21165c3d.cc5214","type":"function","z":"62be80ab.53a19","name":"data","func":"var data = msg.payload\nflow.set('data',data);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1250,"y":680,"wires":[[]]},{"id":"e3e074bd.3cd888","type":"function","z":"62be80ab.53a19","name":"asset","func":"var asset = msg.payload\nflow.set('asset',asset);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1250,"y":640,"wires":[[]]},{"id":"7451fc0.3083c04","type":"function","z":"62be80ab.53a19","name":"secretdist","func":"var secretdist = msg.payload\nflow.set('secretdist',secretdist);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":600,"wires":[[]]},{"id":"e7875606.5d1748","type":"function","z":"62be80ab.53a19","name":"count","func":"var count = msg.payload\nflow.set('count',count);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1250,"y":720,"wires":[[]]},{"id":"19cfd77d.479799","type":"function","z":"62be80ab.53a19","name":"Setup StellarSDK flow.transaction","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\nvar secretiss = msg.secret;\nvar asset = flow.get('asset',asset)\n\n//var op = msg.op\nflow.set('StellarSdk',StellarSdk);\nflow.set('server',server);\n//node.send(msg)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar assetiss = sourceKeys.publicKey()\nflow.set('assetiss',assetiss)\n\nvar transaction;\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      flow.set('transaction',transaction);\n      node.send(msg)\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":220,"wires":[["44084955.cf43c8","eaa4d40.dd9fe3"]]},{"id":"49407bb.4f8d084","type":"ui_text","z":"62be80ab.53a19","group":"72af97e1.b08c68","order":16,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1000,"y":420,"wires":[]},{"id":"95c82711.922ac8","type":"change","z":"62be80ab.53a19","name":"Status Update","rules":[{"t":"set","p":"payload","pt":"msg","to":"Sending Transaction To Stellar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":420,"wires":[["49407bb.4f8d084"]]},{"id":"eaa4d40.dd9fe3","type":"function","z":"62be80ab.53a19","name":"add trust","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretdist = flow.get('secretdist',secretdist);\nvar asset = flow.get('asset',asset)\nvar assetiss = msg.public\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\nvar count = flow.get('count',count)\nif (count<10){\n    count=\"0\"+count\n}\nif (count<100){\n    count=\"0\"+count\n}\nflow.set('count',count)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar transaction;\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n      .addOperation(\n        StellarSdk.Operation.changeTrust({\n          asset: new StellarSdk.Asset(asset+count,assetiss),\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n     flow.set('transaction',transaction);\n      node.send(msg)\n   // return server.submitTransaction(transaction);\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":200,"wires":[["3af99543.fc6c1a","bcf802b7.0633b"]]},{"id":"3af99543.fc6c1a","type":"debug","z":"62be80ab.53a19","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":930,"y":180,"wires":[]},{"id":"dd6071d2.8a06a","type":"function","z":"62be80ab.53a19","name":"sign and submit","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretdist = flow.get('secretdist',secretdist);\nvar asset = flow.get('asset',asset)\nvar assetiss = flow.get('assetiss',assetiss)\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\nvar secretiss = msg.secret\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar sourceKeys2 = StellarSdk.Keypair.fromSecret(secretdist);\nvar transaction;\n\nvar data = flow.get('data',data)\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n       .addOperation(\n        StellarSdk.Operation.manageData({\n          name: \"ipfs CID (base64)\",\n          value: data,\n          source: sourceKeys.publicKey()\n        }),\n      )\n    \n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('NFT by StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    transaction.sign(sourceKeys2);\n    // And finally, send it off to Stellar!\n    msg.xdr=transaction.toEnvelope().toXDR('base64')\n    //node.send(msg)\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    msg.error=\"Something went wrong! \"+ error;\n    msg.send(msg)\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":360,"wires":[["49407bb.4f8d084","c90243f9.d2b11"]]},{"id":"bcf802b7.0633b","type":"function","z":"62be80ab.53a19","name":"send token","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretiss = msg.secret;\nvar asset = flow.get('asset',asset)\nvar assetiss = msg.public\n//var amount = flow.get('amount',amount)\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\nvar count = flow.get('count',count)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar transaction;\n\nvar secretdist = flow.get('secretdist',secretdist)\nvar distKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar dist = distKeys.publicKey()\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: dist,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset+count,assetiss),\n          amount: \".0000001\",\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n     flow.set('transaction',transaction);\n      node.send(msg)\n   // return server.submitTransaction(transaction);\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":910,"y":240,"wires":[["54a9846b.0ee64c","90a259f.256f2a8"]]},{"id":"54a9846b.0ee64c","type":"debug","z":"62be80ab.53a19","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1090,"y":240,"wires":[]},{"id":"18ce53b8.16de5c","type":"function","z":"62be80ab.53a19","name":"fund random keypair \\n msg.secret msg.public \\n fund with friendbot","func":"const fetch = global.get(\"nodefetch\");\n\nvar StellarSdk = global.get(\"stellarsdk\");\n// create a completely new and unique pair of keys\n// see more about KeyPair objects: https://stellar.github.io/js-stellar-sdk/Keypair.html\nconst pair = StellarSdk.Keypair.random();\n\n//msg.payload = \"Pair secret: \" + pair.secret()\n//node.send(msg)\n//msg.payload = \"Pair publickey: \" + pair.publicKey()\n//node.send(msg)\nasync function main() {\n  try {\n    const response = await fetch(\n      `https://friendbot.stellar.org?addr=${encodeURIComponent(\n        pair.publicKey(),\n      )}`,\n    );\n    const responseJSON = await response.json();\n    console.log(\"SUCCESS! You have a new account :)\\n\", responseJSON);\n  } catch (e) {\n    console.log(\"ERROR!\", e);\n  }\n\n\n}\nmain()\n\nmsg.secret=pair.secret();\n\nmsg.public=pair.publicKey();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":340,"wires":[["731ae5da.319d0c","f68740d6.f025"]]},{"id":"90a259f.256f2a8","type":"switch","z":"62be80ab.53a19","name":"count","property":"count","propertyType":"flow","rules":[{"t":"neq","v":"000","vt":"str"},{"t":"eq","v":"000","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":830,"y":340,"wires":[["9e4fdd.d634002"],["dd6071d2.8a06a"]]},{"id":"9e4fdd.d634002","type":"function","z":"62be80ab.53a19","name":"count-1","func":"var count=flow.get('count',count)\ncount= count-1\n\nflow.set('count',count)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":320,"wires":[["eaa4d40.dd9fe3","fabfbfe3.87897"]]},{"id":"fabfbfe3.87897","type":"debug","z":"62be80ab.53a19","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1210,"y":300,"wires":[]},{"id":"c90243f9.d2b11","type":"debug","z":"62be80ab.53a19","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1210,"y":360,"wires":[]},{"id":"44084955.cf43c8","type":"debug","z":"62be80ab.53a19","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":160,"wires":[]},{"id":"731ae5da.319d0c","type":"debug","z":"62be80ab.53a19","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":360,"wires":[]},{"id":"f68740d6.f025","type":"delay","z":"62be80ab.53a19","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":540,"y":300,"wires":[["19cfd77d.479799"]]},{"id":"7cc68034.80b66","type":"inject","z":"9ae7d6dd.0d8cc8","name":"","props":[{"p":"secret","v":"SBSZQMYX2EAT6MGDOAJ3OONFHT6TVVWLLAZEESRIQ7G3CYLHTCWTC3UX","vt":"str"},{"p":"name","v":"COOL","vt":"str"},{"p":"iss","v":"GBN5VTPXODILAQTMMB23ML5B7RKF657YXXALLWFKGZPSW53QGR6OUG4L","vt":"str"},{"p":"op","v":"changeTrust","vt":"str"},{"p":"dest","v":"GAC4LTCWBQAVRNXP67QMT55KZ3BIYPVMLIC46FYSO6HN2ZFZLFKW5WJX","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":170,"y":200,"wires":[["c05795f7.439c38"]]},{"id":"494b6d9d.a6c134","type":"comment","z":"9ae7d6dd.0d8cc8","name":"Create Multiple NFTs","info":"","x":350,"y":140,"wires":[]},{"id":"36b57c07.3a6174","type":"ui_button","z":"9ae7d6dd.0d8cc8","name":"Create NFTs","group":"8ce4258d.827e18","order":5,"width":"6","height":"1","passthru":false,"label":"Create NFTs","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":100,"y":340,"wires":[["8fabd323.bbf3c","c05795f7.439c38","ddd12a21.a77748"]]},{"id":"1b8d56c9.cb63e9","type":"ui_text_input","z":"9ae7d6dd.0d8cc8","name":"Asset - Name","label":"Asset - Name","tooltip":"","group":"8ce4258d.827e18","order":2,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":980,"y":620,"wires":[["d96eafa2.323e"]]},{"id":"854704b.d043bf8","type":"ui_text_input","z":"9ae7d6dd.0d8cc8","name":"Amount","label":"Amount","tooltip":"","group":"8ce4258d.827e18","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":960,"y":740,"wires":[["8b18bc6.68a524"]]},{"id":"69854ef5.4f3de","type":"ui_text_input","z":"9ae7d6dd.0d8cc8","name":"Secret Key - Origin","label":"Secret Key - Origin","tooltip":"","group":"8ce4258d.827e18","order":1,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":990,"y":580,"wires":[["3367fa33.176086"]]},{"id":"fb475935.316798","type":"ui_text_input","z":"9ae7d6dd.0d8cc8","name":"Data","label":"Data (IPFS CID)","tooltip":"","group":"8ce4258d.827e18","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":950,"y":660,"wires":[["f32c24c3.e9c888"]]},{"id":"f32c24c3.e9c888","type":"function","z":"9ae7d6dd.0d8cc8","name":"data","func":"var data = msg.payload\nflow.set('data',data);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1190,"y":660,"wires":[[]]},{"id":"d96eafa2.323e","type":"function","z":"9ae7d6dd.0d8cc8","name":"asset","func":"var asset = msg.payload\nflow.set('asset',asset);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1190,"y":620,"wires":[[]]},{"id":"3367fa33.176086","type":"function","z":"9ae7d6dd.0d8cc8","name":"secretdist","func":"var secretdist = msg.payload\nflow.set('secretdist',secretdist);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":580,"wires":[[]]},{"id":"8b18bc6.68a524","type":"function","z":"9ae7d6dd.0d8cc8","name":"count","func":"var count = msg.payload\nflow.set('count',count);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1190,"y":740,"wires":[[]]},{"id":"c05795f7.439c38","type":"function","z":"9ae7d6dd.0d8cc8","name":"Setup StellarSDK flow.transaction \\n fund new keypair","func":"var StellarSdk = global.get(\"stellarsdk\");\nvar server = new StellarSdk.Server(\"https://horizon-testnet.stellar.org\");\n\nvar asset = flow.get('asset',asset)\n\n//var op = msg.op\nflow.set('StellarSdk',StellarSdk);\nflow.set('server',server);\n//node.send(msg)\n\nconst pair = StellarSdk.Keypair.random();\nmsg.secret=pair.secret();\nmsg.public=pair.publicKey();\n\nvar secretiss = msg.secret;\nvar assetiss = msg.public\nflow.set('assetiss',assetiss)\n\nvar secretdist = flow.get('secretdist',secretdist);\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretdist);\n\n\nvar transaction;\n\n//node.send(msg)\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = new StellarSdk.TransactionBuilder(sourceAccount, {\n      fee: StellarSdk.BASE_FEE,\n      networkPassphrase: StellarSdk.Networks.TESTNET,\n    })\n      .addOperation(\n        StellarSdk.Operation.createAccount({\n          destination: msg.public,\n          startingBalance: \"2\",\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n      flow.set('transaction',transaction);\n      node.send(msg)\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":200,"wires":[["98dd730c.71b66","df7cc11d.3dfcd"]]},{"id":"de59862d.a19f28","type":"ui_text","z":"9ae7d6dd.0d8cc8","group":"8ce4258d.827e18","order":6,"width":0,"height":0,"name":"Success text display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1220,"y":440,"wires":[]},{"id":"8fabd323.bbf3c","type":"change","z":"9ae7d6dd.0d8cc8","name":"Status Update","rules":[{"t":"set","p":"payload","pt":"msg","to":"Sending Transaction To Stellar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":340,"wires":[["de59862d.a19f28"]]},{"id":"df7cc11d.3dfcd","type":"function","z":"9ae7d6dd.0d8cc8","name":"add trust","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretdist = flow.get('secretdist',secretdist);\nvar asset = flow.get('asset',asset)\nvar assetiss = msg.public\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\nvar count = flow.get('count',count)\nif (count<10){\n    count=\"0\"+count\n}\nif (count<100){\n    count=\"0\"+count\n}\nflow.set('count',count)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar transaction;\n\nserver\n  .loadAccount(sourceKeys.publicKey())\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n      .addOperation(\n        StellarSdk.Operation.changeTrust({\n          asset: new StellarSdk.Asset(asset+count,assetiss),\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n     flow.set('transaction',transaction);\n      node.send(msg)\n   // return server.submitTransaction(transaction);\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":200,"wires":[["b2b909c5.29ae38","518c7eba.793c"]]},{"id":"b2b909c5.29ae38","type":"debug","z":"9ae7d6dd.0d8cc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":140,"wires":[]},{"id":"bfd015a4.6c0748","type":"function","z":"9ae7d6dd.0d8cc8","name":"sign and submit \\n add data+domain \\n lock account","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretdist = flow.get('secretdist',secretdist);\nvar asset = flow.get('asset',asset)\nvar assetiss = flow.get('assetiss',assetiss)\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\nvar secretiss = msg.secret\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar distKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar dist = distKeys.publicKey()\nvar transaction;\n\nvar data = flow.get('data',data)\nvar domain = flow.get('domain',domain)\n\nserver\n  .loadAccount(dist)\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n       .addOperation(\n        StellarSdk.Operation.manageData({\n          name: \"ipfs CID (base64)\",\n          value: data,\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n      .addOperation(\n        StellarSdk.Operation.setOptions({\n          masterWeight: \"0\",\n          homeDomain: domain,\n          setFlags: 0x4,\n          //setFlags: 0x4|\"1\",\n          //setFlags: AuthImmutableFlag\n          //setFlags: StellarSdk.AuthImmutableFlag\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n    //node.send(msg)\n      // A memo allows you to add your own metadata to a transaction. It's\n      // optional and does not affect how Stellar treats the transaction.\n      .addMemo(StellarSdk.Memo.text('NFT by StellarRed'))\n      // Wait a maximum of three minutes for the transaction\n      .setTimeout(180)\n      .build();\n     // msg.xdr=transaction.toEnvelope().toXDR('base64')\n    //node.send(msg)\n    // Sign the transaction to prove you are actually the person sending it.\n    transaction.sign(sourceKeys);\n    transaction.sign(distKeys);\n    // And finally, send it off to Stellar!\n    msg.xdr=transaction.toEnvelope().toXDR('base64')\n    node.send(msg)\n    return server.submitTransaction(transaction);\n  })\n  .then(function (result) {\n    console.log(\"Success! Results:\", result);\n    msg.payload=\"Success\"+\" https://stellar.expert/explorer/testnet/account/\"+sourceKeys.publicKey();\n    node.send(msg);\n  })\n  .catch(function (error) {\n    msg.error=\"Something went wrong! \"+ error;\n    msg.send(msg)\n    // If the result is unknown (no response body, timeout etc.) we simply resubmit\n    // already built transaction:\n    // server.submitTransaction(transaction);\n  });","outputs":1,"noerr":0,"initialize":"","finalize":"","x":990,"y":360,"wires":[["de59862d.a19f28","55ce9bb8.d03be4"]]},{"id":"518c7eba.793c","type":"function","z":"9ae7d6dd.0d8cc8","name":"send token","func":"var StellarSdk = flow.get(\"StellarSdk\");\nvar server = flow.get('server',server);\nvar secretiss = msg.secret;\nvar asset = flow.get('asset',asset)\nvar assetiss = msg.public\n//var amount = flow.get('amount',amount)\n//var op = msg.op\n//flow.set('StellarSDK',StellarSDK);\n//flow.set('server',server);\nvar count = flow.get('count',count)\n\nvar sourceKeys = StellarSdk.Keypair.fromSecret(secretiss);\nvar transaction;\n\nvar secretdist = flow.get('secretdist',secretdist)\nvar distKeys = StellarSdk.Keypair.fromSecret(secretdist);\nvar dist = distKeys.publicKey()\n\nserver\n  .loadAccount(dist)\n\n  .then(function (sourceAccount) {\n    // Start building the transaction.\n    transaction = flow.get('transaction',transaction)\n    \n      .addOperation(\n        StellarSdk.Operation.payment({\n          destination: dist,\n          // Because Stellar allows transaction in many currencies, you must\n          // specify the asset type. The special \"native\" asset represents Lumens.\n          //asset: StellarSdk.Asset.native(),\n          asset: new StellarSdk.Asset(asset+count,assetiss),\n          amount: \".0000001\",\n          source: sourceKeys.publicKey()\n        }),\n      )\n      \n     flow.set('transaction',transaction);\n      node.send(msg)\n   // return server.submitTransaction(transaction);\n  })\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":850,"y":200,"wires":[["1f7b15e3.2e986a","18aae072.6534"]]},{"id":"1f7b15e3.2e986a","type":"debug","z":"9ae7d6dd.0d8cc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":220,"wires":[]},{"id":"18aae072.6534","type":"switch","z":"9ae7d6dd.0d8cc8","name":"count","property":"count","propertyType":"flow","rules":[{"t":"neq","v":"000","vt":"str"},{"t":"eq","v":"000","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":810,"y":280,"wires":[["907c516f.e2d3e"],["bfd015a4.6c0748","bba347fe.0a00b8"]]},{"id":"907c516f.e2d3e","type":"function","z":"9ae7d6dd.0d8cc8","name":"count-1","func":"var count=flow.get('count',count)\ncount= count-1\n\nflow.set('count',count)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":980,"y":280,"wires":[["df7cc11d.3dfcd","4b16ae23.0cb78"]]},{"id":"4b16ae23.0cb78","type":"debug","z":"9ae7d6dd.0d8cc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":260,"wires":[]},{"id":"55ce9bb8.d03be4","type":"debug","z":"9ae7d6dd.0d8cc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":340,"wires":[]},{"id":"98dd730c.71b66","type":"debug","z":"9ae7d6dd.0d8cc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":140,"wires":[]},{"id":"ddd12a21.a77748","type":"debug","z":"9ae7d6dd.0d8cc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":230,"y":420,"wires":[]},{"id":"bba347fe.0a00b8","type":"debug","z":"9ae7d6dd.0d8cc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":300,"wires":[]},{"id":"3d056305.445dbc","type":"ui_text_input","z":"9ae7d6dd.0d8cc8","name":"Sell Price","label":"Sell Price /XLM","tooltip":"","group":"8ce4258d.827e18","order":4,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":960,"y":780,"wires":[["5dc2677.609d298"]]},{"id":"5dc2677.609d298","type":"function","z":"9ae7d6dd.0d8cc8","name":"price","func":"var price = msg.payload\nflow.set('price',price);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1190,"y":780,"wires":[[]]},{"id":"7d6437f8.ee3fd8","type":"ui_text_input","z":"9ae7d6dd.0d8cc8","name":"domain","label":"Home domain (no https://www.)","tooltip":"","group":"8ce4258d.827e18","order":3,"width":"0","height":"0","passthru":true,"mode":"text","delay":"300","topic":"","topicType":"str","x":960,"y":700,"wires":[["a1e53bae.c49498"]]},{"id":"a1e53bae.c49498","type":"function","z":"9ae7d6dd.0d8cc8","name":"domain","func":"var domain = msg.payload\nflow.set('domain',domain);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":700,"wires":[[]]}]

Flow Info

Created 9 months, 3 weeks ago
Updated 7 months, 2 weeks ago
Rating: not yet rated

Actions

Rate:

Node Types

Core
  • change (x16)
  • comment (x24)
  • debug (x44)
  • delay (x4)
  • function (x107)
  • http request (x2)
  • inject (x21)
  • switch (x4)
  • tab (x9)
Other
  • group (x2)
  • ui_base (x1)
  • ui_button (x17)
  • ui_gauge (x2)
  • ui_group (x14)
  • ui_spacer (x4)
  • ui_tab (x10)
  • ui_text (x23)
  • ui_text_input (x58)
  • ui_toast (x2)

Tags

  • Stellar
  • Lumens
  • XLM
  • Horizon
  • SDK
  • blockchain
  • DLT
  • crypto
  • cryptocurrency
  • SDEx
  • decentralized
  • dex
  • stellarred
  • redhorizon
  • blockshangerous
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option