Pancakeswap router v2 swapExactTokensForETH function fails with Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' - pancakeswap

I'm trying swap B-Token for BNB using swapExactTokensForETH on Pancakeswap Router V2
I've also tried swapExactTokensForETHSupportingFeeOnTransferTokens without and success.
It fails with TransferHelper: TRANSFER_FROM_FAILED
When I use pancakeswap.fiance and metamask it works as in this transaction
https://bscscan.com/tx/0x76906d7733566ad9a020994dad44ac7cdddbf5c8d513c769488ae0d9ed96824a
However it fails when I call it from the nodejs script.
I'd really appreciate any help here.

Related

metamask internal json rpc error using ganache-cli

i have used ganache cli and connected to metamask. normally everything works fine but after i get an error on metamask internal json rpc error, i am not able to use the account . even if i am not interacting with the smart contract . just normal send in metamask does not work for that account and give internal json rpc error. i had to add another account and it works fine.
is account in ganache gets blocked.
or metamask does some kind of blacklisting.
i tried web3 js to interact with those account using their private key and it works perfectly.
please let me know what is the logic here how my ganache accounts are not working and anything that i am missing.
thank you
i tried to interact with smart contract and it didn’t work for some reason. after that for any transaction on metamask i am getting internal rpc error

'https://restcountries.eu/rest/v2/all' not working, How to get all countries now?

Before week ago, https://restcountries.eu/rest/v2/all was giving country code but now it is not working so how can someone use it to get all country code.
Code throws The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure from where the rest call made of 'https://restcountries.eu/rest/v2/all' this API.
Any alternate API to get all country code, name and flag. as we are using it at ASP.Net side, front-end side(Angular) Andriod, and iOS App. It would be better to have API.
The same issue on their git repo.
This is now available in v2 version and v3 version on restcountries.com.
Response takes some time and it has a lot of information.

Auth0 access token to API works in postman but not when calling from Vue

I have 2 items set up in Auth0:
Application - Single Page Application
API - Custom API, machine to machine
I've followed the instruction in the link below to call the custom API:
https://auth0.com/docs/quickstart/spa/vuejs/02-calling-an-api
I've downloaded the sample with settings configured for both items mentioned above. The Vue app are able to log in correctly, and are able to call the external API by using the downloaded example codes (the external API, "backend", in the example code was written in Node JS).
However, when I change the backend to my Laravel/Lumen app which already set up for item no.2 (custom API), the Vue app received 401 unauthorized error. So, I copied the access token retrieved through Vue:
const accessToken = await this.$auth.getTokenSilently();
console.log(accessToken);
And try to call the Lumen backend with this access token - and it works perfectly fine!
Is there a setting somewhere that I might've missed to enable Vue & Lumen to work with Auth0?
p/s: The custom Lumen API was made following the instruction from:
https://auth0.com/blog/developing-restful-apis-with-lumen/
Ok it turns out I made a mistake in the axios part of the sample code. The sample is using get, while my API is using post. So I ended up sending the header in the wrong axios parameter. Hope this helps someone that encountered the same problem.

API request fails on Travis-CI

I have a React App with multiple passing tests. When running them through Travis, I get the following error:
API request failed.
Message: The requested API endpoint was not found. Are you using the right HTTP verb (i.e.GETvs.POST), and did you specify your intended version with theAcceptheader?
I use the .env to set a variable to the heroku URL. Then i set the same variable in the Travis .env on their website. I suspect that the API fails for the action tests, but I can't seem to fix it.
Anyone had a similar experience and knows where to fix the issues? Will provide any additional code examples
Fixed it by doing this:
deploy:
provider: heroku
api_key:
secure: ENCRYPTED-PW
app: boiling-spring-21825 <------------
on:
repo: xyz/project-name
Before, I had the app name as https://boiling-spring-21825:21825, hence Travis was unable to fetch the project from heroku. I can imagine the API was looking for https://boiling-spring-21825:21825/https://boiling-spring-21825:21825 or something similar that didn't make sense.
Lesson here is to only write out the simple heroku app name as found in your heroku projects page.

Bigcommerce authentication get request only returns scope and code, context is missing

I am kicking off the Bigcommerce app installation process by following the instructions given in this official documentation page https://developer.bigcommerce.com/api/callback apparently I am following every thing. I have https Auth Callback url setup in the app configuration page
NOTE: I am using ngrok to tunnel my localhost to internet.
When Install my app I receive the code and scope objects in the Get Request but not the context object.
Please help me with what did I missed ? and how I can get the context object ?
UPDATE
I tested it without ngrok and its the same.