Skip to main content
Notice added Legacy IOTA protocol by mihi
Bumped by Community user
edited tags
Link
mihi
  • 7.3k
  • 2
  • 16
  • 34
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
formatting
Source Link
ben75
  • 5.3k
  • 12
  • 32

I'm always getting this error without understanding why.

TypeError: Cannot read property 'toTrytes' of undefined

TypeError: Cannot read property 'toTrytes' of undefined

Code: // Require the use of IOTA library const Iota = require('@iota/core')

// Create a new instance of the IOTA class object. // Use 'provider' variable to specify which Full Node to talk to const iota = Iota.composeAPI({ provider: 'https://nodes.devnet.iota.org:443' })

// Call the 'getNodeInfo call to check that the node is working iota.getNodeInfo() .then(info => console.log(info)) .catch(err => {})

//Actual Transaction const address = 'HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD' const seed = 'PUEOTSEITFEVEWCWBTSIZM9NKRGJEIMXTULBACGFRQK9IMGICLBKW9TTEVSDQMGWKBXPVCBMMCXWMNPDX' const message = iota.utils.toTrytes('Hello World!')

const transfers = [ { value: 0, address: address, message: message } ]

iota .prepareTransfers(seed, transfers) .then(trytes => iota.sendTrytes(trytes, 3, 9)) .then(bundle => { console.log(bundle) }) .catch(err => { // catch any errors })

// Require the use of IOTA library
const Iota = require('@iota/core')

// Create a new instance of the IOTA class object.
// Use 'provider' variable to specify which Full Node to talk to
const iota = Iota.composeAPI({
  provider: 'https://nodes.devnet.iota.org:443'
})

// Call the 'getNodeInfo call to check that the node is working
iota.getNodeInfo()
    .then(info => console.log(info))
    .catch(err => {})

//Actual Transaction
const address =
  'HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD'
const seed =
  'PUEOTSEITFEVEWCWBTSIZM9NKRGJEIMXTULBACGFRQK9IMGICLBKW9TTEVSDQMGWKBXPVCBMMCXWMNPDX'
const message = iota.utils.toTrytes('Hello World!')

const transfers = [
  {
    value: 0,
    address: address,
    message: message
  }
]

iota
  .prepareTransfers(seed, transfers)
  .then(trytes => iota.sendTrytes(trytes, 3, 9))
  .then(bundle => {
    console.log(bundle)
  })
  .catch(err => {
    // catch any errors
  })

I'm always getting this error without understanding why.

TypeError: Cannot read property 'toTrytes' of undefined

Code: // Require the use of IOTA library const Iota = require('@iota/core')

// Create a new instance of the IOTA class object. // Use 'provider' variable to specify which Full Node to talk to const iota = Iota.composeAPI({ provider: 'https://nodes.devnet.iota.org:443' })

// Call the 'getNodeInfo call to check that the node is working iota.getNodeInfo() .then(info => console.log(info)) .catch(err => {})

//Actual Transaction const address = 'HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD' const seed = 'PUEOTSEITFEVEWCWBTSIZM9NKRGJEIMXTULBACGFRQK9IMGICLBKW9TTEVSDQMGWKBXPVCBMMCXWMNPDX' const message = iota.utils.toTrytes('Hello World!')

const transfers = [ { value: 0, address: address, message: message } ]

iota .prepareTransfers(seed, transfers) .then(trytes => iota.sendTrytes(trytes, 3, 9)) .then(bundle => { console.log(bundle) }) .catch(err => { // catch any errors })

I'm always getting this error without understanding why.

TypeError: Cannot read property 'toTrytes' of undefined

Code:

// Require the use of IOTA library
const Iota = require('@iota/core')

// Create a new instance of the IOTA class object.
// Use 'provider' variable to specify which Full Node to talk to
const iota = Iota.composeAPI({
  provider: 'https://nodes.devnet.iota.org:443'
})

// Call the 'getNodeInfo call to check that the node is working
iota.getNodeInfo()
    .then(info => console.log(info))
    .catch(err => {})

//Actual Transaction
const address =
  'HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD'
const seed =
  'PUEOTSEITFEVEWCWBTSIZM9NKRGJEIMXTULBACGFRQK9IMGICLBKW9TTEVSDQMGWKBXPVCBMMCXWMNPDX'
const message = iota.utils.toTrytes('Hello World!')

const transfers = [
  {
    value: 0,
    address: address,
    message: message
  }
]

iota
  .prepareTransfers(seed, transfers)
  .then(trytes => iota.sendTrytes(trytes, 3, 9))
  .then(bundle => {
    console.log(bundle)
  })
  .catch(err => {
    // catch any errors
  })
Source Link

toTrytes() does not work

I'm always getting this error without understanding why.

TypeError: Cannot read property 'toTrytes' of undefined

Code: // Require the use of IOTA library const Iota = require('@iota/core')

// Create a new instance of the IOTA class object. // Use 'provider' variable to specify which Full Node to talk to const iota = Iota.composeAPI({ provider: 'https://nodes.devnet.iota.org:443' })

// Call the 'getNodeInfo call to check that the node is working iota.getNodeInfo() .then(info => console.log(info)) .catch(err => {})

//Actual Transaction const address = 'HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD' const seed = 'PUEOTSEITFEVEWCWBTSIZM9NKRGJEIMXTULBACGFRQK9IMGICLBKW9TTEVSDQMGWKBXPVCBMMCXWMNPDX' const message = iota.utils.toTrytes('Hello World!')

const transfers = [ { value: 0, address: address, message: message } ]

iota .prepareTransfers(seed, transfers) .then(trytes => iota.sendTrytes(trytes, 3, 9)) .then(bundle => { console.log(bundle) }) .catch(err => { // catch any errors })