I am setting up an Ethereum environment in macOS following this link https://medium.com/coinmonks/setting-up-ethereum-development-environment-on-macos-22c96a136ac4 .
while checking the balance of the account by,
truffle(develop)> web3.fromWei(web3.eth.getBalance('0x0ac4d68c2c34a3f1324439bff3c119f4ef675a72'),'ether').toNumber()
I get the following errors;
Thrown:
evalmachine.<anonymous>:0
web3.fromWei(web3.eth.getBalance('0x0ac4d68c2c34a3f1324439bff3c119f4ef675a72'),'ether').toNumber()
^
TypeError: web3.fromWei is not a function
at evalmachine.<anonymous>:0:6
at sigintHandlersWrap (vm.js:279:15)
at Script.runInContext (vm.js:134:14)
at runScript (/Users/jigmewangmo/Documents/MSIT/BlockChain/EthereumWorkspace/node_modules/truffle/build/webpack:/packages/core/lib/console.js:251:1)
at Console.interpret (/Users/jigmewangmo/Documents/MSIT/BlockChain/EthereumWorkspace/node_modules/truffle/build/webpack:/packages/core/lib/console.js:266:1)
at bound (domain.js:420:14)
at REPLServer.runBound [as eval] (domain.js:433:12)
at REPLServer.onLine (repl.js:700:10)
at REPLServer.emit (events.js:209:13)
at REPLServer.EventEmitter.emit (domain.js:476:20)
Any idea why? I looked for resources online but confused as a suggested solution still gives error.
The provided source is probably outdated. Check the web3 version used and look up corresponding docs for fromWei.
For web3 version 1.2.0 use:
web3.utils.fromWei(web3.eth.getBalance('0x0ac4d68c2c34a3f1324439bff3c119f4ef675a72'),'ether').toNumber()
Related
I am trying to use drop-in Checkout using the guide here:
https://docs.adyen.com/developers/checkout/web-sdk
I can successfully see the payment screen but I get warnings in the console:
WARNING: securedFields:: the encryption algorithm is not present. It will not be possible to encrypt input fields
and as soon as I enter the credit card details I get an error:
Uncaught TypeError: adyen.createEncryption is not a function
at Object.a._createEncryption (securedFields.1.3.0.min.js:79)
at Object.a._getEncryptedData (securedFields.1.3.0.min.js:81)
at n (securedFields.1.3.0.min.js:326)
at A (securedFields.1.3.0.min.js:313)
at o.processValidationsObj (securedFields.1.3.0.min.js:320)
at HTMLInputElement.n (securedFields.1.3.0.min.js:209)
In the browser console "adyen" is not defined.
Any suggestion?
Eventually this was resolved by Adyen support.
It was due to the merchant account being setup as Point of Sale (POS).
Creating new "eCommerce" account solved the issue.
I have created a project using Ionic and deployed it as a PWA to firebase. I have got around CORS utilising a proxy to call google maps api sevices. This works locally however once deployed this is no longer the case.
The response I am getting on the server is:
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at XMLHttpRequest.l (https://atomic-affinity-127705.firebaseapp.com/build/vendor.js:1:312114)
at t.invokeTask (https://atomic-affinity-127705.firebaseapp.com/build/polyfills.js:3:15660)
at Object.onInvokeTask (https://atomic-affinity-127705.firebaseapp.com/build/vendor.js:1:26996)
at t.invokeTask (https://atomic-affinity-127705.firebaseapp.com/build/polyfills.js:3:15581)
at r.runTask (https://atomic-affinity-127705.firebaseapp.com/build/polyfills.js:3:10834)
at e.invokeTask [as invoke] (https://atomic-affinity-127705.firebaseapp.com/build/polyfills.js:3:16794)
at p (https://atomic-affinity-127705.firebaseapp.com/build/polyfills.js:2:27648)
at XMLHttpRequest.v (https://atomic-affinity-127705.firebaseapp.com/build/polyfills.js:2:27893)
"Http failure during parsing"
When looking at the text field I get the contents of my index.html page being parsed. Starting with the Doctype explaining why the error fails on <.
Ionic.config.json has the following:
"proxies": [{
"path": "/api",
"proxyUrl": "https://maps.googleapis.com/"
}]
and is called as such:
/api/maps/api/place/nearbysearch/ ....etc
Any help would be greatly appreciated.
For those that are interested in this solution, I ended up utilising the js libraries provided by Google. The alternative to get around this is create a functions set on firebase and run express to do the calls for with the appropriate CORS headers however I didn't want to add extra calls in.
This morning I started getting this error when I try to display the model in my viewer, the code was working fine till last night. Upon looking into details, I see this error:
Uncaught TypeError: P.addInstancingSupport is not a function
at Aa (viewer3D.min.js:14)
at a.initialize (viewer3D.min.js:14)
at a.e.initialize (viewer3D.min.js:19)
at a.initialize (viewer3D.min.js:21)
at a.e.start (viewer3D.min.js:19)
at d.selectItem (viewer3D.min.js:21)
at onDocumentLoadSuccess (ForgeViewer.js:45)
at viewer3D.min.js:21
at j (viewer3D.min.js:20)
at XMLHttpRequest.p (viewer3D.min.js:4)
The error seems to be stemming from 'viewer3D.min.js'. I am fairly new to coding.
What version of the Viewer are you using? You can run LMV_VIEWER_VERSION from your console in Chrome Dev Tools. If the version is "1.X" you might want to check this https://forge.autodesk.com/blog/view-and-data-api-will-be-switched-next-week?linkId=40492041
Probably I will need to check more code in order to determine what could be going wrong, but I have a feeling you might be using an older version that just got deprecated.
Thanks! it worked.
I had to change the references from V1 to V2 for viewer scripts.
I am creating an application that until yesterday seemed to work, but this morning, performing a function as I always do, it turns out this message:
"Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. Thrown in ../base_facebook.php on line 1254"
Where am I doing wrong?
you Try to clean the cookies and cache from your firefox browser and try to execute your application once again...and check if you are app works in firefox this time...
I tried to get the Google Quickstart project to work on Android.
https://developers.google.com/drive/quickstart-android. I notice there are lots of similar questions on this- and wondered if there was a sample project anywhere that does work?
I followed the instructions but I get an error when it starts up:
06-10 00:15:04.904: E/AndroidRuntime(16613): FATAL EXCEPTION: main
06-10 00:15:04.904: E/AndroidRuntime(16613): java.lang.NoClassDefFoundError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
Which refers to this line:
credential = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE);
startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER);
You should target an API level with Google APIs and make sure that Google APIs client library jars are on your build path.