This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#07CFD43B146C | |
# Requirement: PyOTA library (!pip install pyota) | |
import iota | |
from datetime import datetime | |
from pprint import pprint | |
MySeed = b"HGW9HB9LJPYUGVHNGCPLFKKPNZAIIFHZBDHKSGMQKFMANUBASSMSV9TAJSSMPRZZU9SFZULXKJ9YLAIUA" | |
TargetAddress1 = b"CXDUYK9XGHC9DTSPDMKGGGXAIARSRVAFGHJOCDDHWADLVBBOEHLICHTMGKVDOGRU9TBESJNHAXYPVJ9R9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#3BB8C879CCAE | |
// Requirement: A converter module of IOTA Javascript Library (!npm install @iota/converter) | |
var Converter = require('@iota/converter') //loading helping converter module of iota.js library. More info: https://github.com/iotaledger/iota.js/tree/next/packages/converter#module_converter.trits | |
var Trytes = "YZJEATEQ9JKLZ" //some data encoded in Trytes | |
console.log(Trytes) | |
console.log("Number of Trytes: %s" , Trytes.length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#696A395DC61B | |
// Requirement: A core module of IOTA Javascript Library (!npm install @iota/core) | |
var iotalib = require('@iota/core'); // loading iota.js core module. More info: https://github.com/iotaledger/iota.js/tree/next/packages/core | |
// composerAPI initialization of the iota.js library | |
var iota = iotalib.composeAPI({ | |
'provider': 'https://nodes.thetangle.org:443' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#67D98D069B61 | |
//based on https://gist.github.com/SteveFromTheOffice/c8448a09352337386f135a16bbb20d93 | |
//modified by Petr Zizka | |
var GenerateSeed = function () { | |
const length = 81; // The length of the seed and int array. | |
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ9"; // The allowed characters in the seed. | |
var result = new Array(length); // An empty array to store the seed characters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#0FF479CB6C0A | |
// Requirement: A core module of IOTA Javascript Library (!npm install @iota/core) | |
var iotalib = require('@iota/core'); | |
var NodeURL = "https://nodes.thetangle.org:443"; | |
var MySeed = "WKQDUZTGFKSSLACUCHHLZRKZBHSDSCEBHKUPDLKFBQALEBKDMFRPUQGZRXAADPG9TSRTZGGBZOFRJCFMM"; | |
var iota = iotalib.composeAPI({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#2508A6FF9241 | |
// Requirement: A core module of IOTA Javascript Library (!npm install @iota/core) | |
var iotalib = require('@iota/core'); | |
var MySeed = "WKQDUZTGFKSSLACUCHHLZRKZBHSDSCEBHKUPDLKFBQALEBKDMFRPUQGZRXAADPG9TSRTZGGBZOFRJCFMM"; | |
//Please note, it is a sync function call | |
//Please also note that generating addresses can take quite long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#39B011574CF0 | |
// Requirement: A checksum module of IOTA Javascript Library (!npm install @iota/checksum) | |
var iotalib = require('@iota/checksum'); //this package is also useful when validating an address | |
//some IOTA address | |
var Adr = "CYJV9DRIE9NCQJYLOYOJOGKQGOOELTWXVWUYGQSWCNODHJAHACADUAAHQ9ODUICCESOIVZABA9LTMM9RW"; | |
console.log("Original input excl. checksum address:"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#C65223B0864A | |
// Requirement: A checksum module of IOTA Javascript Library (!npm install @iota/checksum) | |
// Requirement: A validators module of IOTA Javascript Library (!npm install @iota/validators) | |
var iotalib = require('@iota/checksum'); | |
var iotaValidators = require('@iota/validators'); | |
//address including checksum | |
var InputAddr = "CYJV9DRIE9NCQJYLOYOJOGKQGOOELTWXVWUYGQSWCNODHJAHACADUAAHQ9ODUICCESOIVZABA9LTMM9RWTHBIRSXTA"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#445C2B9485C6 | |
// Requirement: A converter module of IOTA Javascript Library (!npm install @iota/converter) | |
// Requirement: A core module of IOTA Javascript Library (!npm install @iota/core) | |
var iotalib = require('@iota/core'); | |
var Converter = require('@iota/converter') | |
var NodeURL = "https://nodes.thetangle.org:443"; | |
var iota = iotalib.composeAPI({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#00663E550ADF | |
// Requirement: A converter module of IOTA Javascript Library (!npm install @iota/converter) | |
// Requirement: A core module of IOTA Javascript Library (!npm install @iota/core) | |
// Requirement: A transaction-converter module of IOTA Javascript Library (!npm install @iota/transaction-converter) | |
var iotalib = require('@iota/core'); | |
var Converter = require('@iota/converter') | |
var TransactionConverter = require('@iota/transaction-converter') |