helium / maker-starter-app

Apache License 2.0
36 stars 39 forks source link

TypeErrors & Unhandled Promises, when registering a transaction | (evaluating '_ref3.success') & (evaluating 'createTxns.data') #66

Open TaffyJSA opened 1 year ago

TaffyJSA commented 1 year ago

Hello,

I would like to ask for guidance on how can I solve the problems mentioned below.

Setup:

  1. I have set up a Solana RPC endpoint and I am on cluster devnet, tried on testnet as well.
  2. I use the onboarding maker address provided in the migration guide.
  3. Dependencies
    "@helium/address": "^4.8.1",
    "@helium/crypto-react-native": "^4.8.1",
    "@helium/currency": "^4.10.0",
    "@helium/currency-utils": "^0.0.49",
    "@helium/http": "^4.10.0",
    "@helium/onboarding": "^4.10.0",
    "@helium/proto-ble": "^4.8.1",
    "@helium/react-native-sdk": "^2.0.18",
    "@helium/transactions": "^4.8.1",
    "@helium/wallet-link": "^4.10.0",

Problems:

  1. When I scan the QR code of my hotspot or set up the location I get this error:

[TypeError: undefined is not an object (evaluating '_ref3.success')]

  1. When I click Register Hotspot

Possible Unhandled Promise Rejection (id: 0): TypeError: undefined is not an object (evaluating 'createTxns.data')

And the hotspot is not registered, it doesn't even redirect me to the wallet as it did. Also, I don't know where to look for the failed pending transactions. Before it was this place: Failed Pending Transactions But now where I can look for them? Additionally, I can see some failed pending transactions on this old place.

Thank you for your time!

Kind regards!

matthewcarlreetz commented 1 year ago

@TaffyJSA

Problem 1 - I'm not sure what the issue is without having more context. What line of code is actually throwing the error? If I had to guess this sounds like an issue with the configuration of your QR scanner?

Problem 2 - I'm guessing the txn you're using for createHotspot is empty or undefined. Can you confirm?

TaffyJSA commented 1 year ago

@matthewcarlreetz

Problem 1 - I will solve it and it makes sense that the config is wrong.

Problem 2 - Caught the error in try - catch and this is the log: LOG Error creating hotspot: TypeError: undefined is not an object (evaluating 'createTxns.data')

I have a txn which is not empty or undefined:

CrwBCiEBL6P0TZ3x0E9eovtBSc2F+agIOUDPhe9WZu64ZhwYlUwSIQCvOCMz7y0VubLMJm+GxLOf2cAzF2VuggnZ4oCDr26rtSJIMEYCIQC1zClIaLJJuhvrQ1NTYCCAH5MTojZx8DRJ+YMnprBJXAIhAPTCMjsZkCr2QcbHxenKGDlJjajtQQ/z0L3a/UfmVK3tKiEB8ruYwDgG7SYzp783zVZ41tMQV2DKjgDmDkyCw9CMxrM4gJL0AUDo+wM=

What could be the problem?

Thank you for throwing insight into the first problem!

TaffyJSA commented 1 year ago

Also, I got this error in some lines below

Error getting onboarding transactions: TypeError: undefined is not an object (evaluating 'or.errorMessage')

At this part:

`

try{

const { solanaTransactions, addGatewayTxn, assertLocationTxn } =

  await getOnboardTransactions({

    txn: params.addGatewayTxn,
    hotspotAddress: '14neTgRNZui1hSiHgE3LXjSfwkPU8BEB192MLXXDFnSY2xKjH51',
    hotspotTypes,
    lat: last(params.coords),
    lng: first(params.coords),
    elevation: params.elevation,
    decimalGain: params.gain,

  })

console.log('Solana transactions: ' + solanaTransactions)

navToHeliumAppForSigning({

  onboardTransactions: solanaTransactions,
  addGatewayTxn,
  assertLocationTxn,

})

}catch (e) {

console.log('Error getting onboarding transactions: ' + e)
}

`

Also for the hotspot address, should I use this one (the current in the code above) or the old one - (138LbePH4r7hWPuTnK6HXVJ8ATM2QU71iVHzLTup1UbnPDvbxmr)?