Categories
Cryptocurrency Ethereum Mastering Development

Perform an automated transaction using 1inch API

To perform an automated 1 inch transaction I use these two functions. It works well at first. Unfortunately, in the last few days I have always had the same errors: Fail with error ‘Return amount is not enough’ Warning! Error encountered during contract execution [Reverted] def get_api_call_data(_from_coin,_to_coin): global api_data try: call_data = requests.get( f’https://api.1inch.exchange/v1.1/swap?fromTokenSymbol={_from_coin}&toTokenSymbol={_to_coin}&amount={_amount_to_exchange}&fromAddress={base_account}&slippage={slippage}&disableEstimate=true’) api_data […]

Categories
Mastering Development

a datable using ajax json in PHP Codeigniter , my custom filter button is not working

viewImage this is the view of my table , there’s a product filter option on the top that i want to run as per this sql query SELECT * FROM warehouses_products WHERE expiry < SYSDATE() OR quantity < 15; now can u please tell me the code i have to code in view , model […]

Categories
CMS Mastering Development Wordpress

Ajax load more scroll to new(loaded) posts

On my recent website, i have tried to add ajax load more to load more news. Its working but when i click the load more button need to scroll up to see the loaded posts. Link: https://www.theoriatest.com/filomedica-facelift/news $(‘.misha_loadmore’).click(function (e) { var button = $(this), data = { ‘action’: ‘loadmore’, ‘query’: misha_loadmore_params.posts, ‘page’: misha_loadmore_params.current_page }; $.ajax({ […]

Categories
Mastering Development

Highcharts / Highstock: How to access values at the centers of dataGroups of another series

In Highstock, a series of densely sampled data points is plotted with arearange style and dataGrouping. Now, I need to get access to the values at each of the group centers to overplot it as a new series, which will be used to track the central values of the first one. So, in the plotOptions […]

Categories
Mastering Development

Redirect page after echo [duplicate]

I have checked How do I redirect to another webpage? and though they do successfully redirect, they remove the echo ‘OK’ function I have implemented. I have a form and would like to redirect back to the home page 5 seconds after the form has been submitted. However, there needs to be an echo first […]

Categories
CMS Drupal Mastering Development

Controller is loading twice after search form is submitted

I created a custom module that I consume an external api. I have also created a custom form (its action points to controller url) which filters the data. However, when I press the search button and the controller is loading, despite I get the right results immediately the controller is reloading and consequently I loose […]

Categories
Mastering Development Software

How do I use Rest Data Source API with access tokens?

I’m trying to get data back from an API without having to loop through an RDD, and I found the Rest Data Source Library on Git hub: https://github.com/sourav-mazumder/Data-Science-Extensions/tree/master/spark-datasource-rest The issue I’m running into is how to incorporate Access Tokens in with parameter mapping. When it comes to the supported options the descriptions has this for […]

Categories
CMS Mastering Development Wordpress

WooCommerce Load More Button functionality problem

I have a load more button (using this tutorial: https://rudrastyh.com/wordpress/load-more-posts-ajax.html) that I am using on a woocommerce product page. It all works great apart from when I click load more, it loads the products above and the button and then the user has to scroll up to see the new products. On clicking a second […]

Categories
Mastering Development

what is axios.delete correct syntax?

I am performing a delete request with axios but I do not understand why these 2 syntax work differently. After a big struggle i found this working solution by testing through postman deleteChart(id) { const data = JSON.stringify({ id: id }); const config = { method: ‘delete’, url: ‘http://localhost:3000/api/deleteChart’, headers: { ‘Content-Type’: ‘application/json’, }, data: […]

Categories
Mastering Development

Suspicious file operation : Cannot configure media root and base dir in my django Project folder

I am trying to save the project files to media then grap to show in url, so far i have followed some easy techniques to avoid the file operation and stored them in media my setting.py file-> STATIC_ROOT = os.path.join(BASE_DIR, ‘static’) STATIC_URL = ‘/static/’ MEDIA_ROOT = os.path.join(BASE_DIR, ‘media’) MEDIA_URL = ‘/media/’ my models.py files model […]