Binance api endpoint for fiat deposits from bank card? - binance

I didn't find a history of fiat deposits(from bank card),
Only crypto deposits here: https://prnt.sc/ttdwc2=)
For example in my bank account interface I found deposit on 12th of may, but can't find it here...
Anyone know may be there is api endpoint to look for it?
Didn't find anything here https://github.com/binance-us/binance-official-api-docs/blob/master/rest-api.md
Once again: I didn't find anything about fiat deposits in api and website interface. It looks weird that there is no such way to see fiat history of deposits from credit cards.
May be I am missing something?

As far as i understand for today there is no such an endpoint for 02.28.2021
if anything changes it would be great
Or may be not great cause of taxes

This was annoying me for a while but it looks like Binance devs have added some functionality.
I have started to use the binance-connector python package. It just makes it easier to navigate the API (no need to hash your keys). You can find more info here:
https://github.com/binance/binance-connector-python
The code I used:
from binance.spot import Spot as Client
from datetime import datetime
# api_key and secret_key you get when you set up your API on Binance
spot_client = Client(api_key, secret_key)
currTime = round((time.time()*1000))
startTime = "01/01/2021"
beginTime = round(datetime.strptime(startTime, "%d/%m/%Y").timestamp()*1000)
params = {
"beginTime": beginTime,
"endTime": currTime
}
# 0 = deposit, 1 = withdrawals
# if no beginTime and endTime specified will give last 30 days
spot_client.fiat_order_history(0, **params)
More info here:
https://binance-docs.github.io/apidocs/spot/en/#fiat-endpoints

Related

3 websockets not working (shiba, shushi, luna2)

I would like to retrieve the current price for these 3 cryptos below:
1000Shiba
Shushi
Luna2
I retrieve data for btc or eth but not these cryptos below:
Maybe I made a mistake?
new WebSocket('wss://stream.binance.com:9443/ws/1000shibusdt#trade');
new WebSocket('wss://stream.binance.com:9443/ws/shushiusdt#trade');
new WebSocket('wss://stream.binance.com:9443/ws/luna2usdt#trade');
I use the binance platform
According to the exchangeInfo endpoint, these coins/tokens are currently not listed on Binance.
You'll need to retrieve them from other sources.

flight offer search not pulling all air fares

I would like to seek help on the codes below.
Apparently, the code works by pulling out air fares but it seems like it does not pull out all the available air fares that I can see directly from the airlines websites.
Could anyone please assist me to let me know what's happening? Thanks!
from amadeus import Client, ResponseError
Origin = "SIN"
Destination = "CDG"
amadeus = Client(hostname='production', client_id='HIDDEN', client_secret='HIDDEN')
try:
'''
Find the cheapest flights from Origin to Destination
'''
response = amadeus.shopping.flight_offers_search.get(
#originLocationCode=Origin, destinationLocationCode=Destination, departureDate='2023-04-04', adults=1)
originLocationCode=Origin, destinationLocationCode=Destination, departureDate='2023-03-03', returnDate='2023-04-04', travelClass='BUSINESS', includedAirlineCodes='SQ', currencyCode='SGD', adults=1)
print(response.data)
except ResponseError as error:
raise error
The Self-Service APIs only return public fares coming from the GDS. That means that you will find discrepancy for both the flights and the prices too comparing to some websites you might visit.
For more details check the section carriers and rates in the developer guides.

Zenpy incremental export gives tickets before start_date

I am trying to use zenpy to get information on tickets created or modified in the last week. This is the code I am using:
stream_status = False #Exit condition
while(stream_status==False):
print(start_date)
all_tickets = zendesk.tickets.incremental(start_time=start_date, include=['users','organizations'])
print(len(all_tickets))
print(all_tickets.end_time)
for ticket in all_tickets:
#grab ticket fields and store them in a Dataframe
df.loc[len(df)] = [ticket_id,created_at,requester,organization,product,subject,assignee,status,priority,opened_at,opened_by,solved_at,solved_by,closed_at,closed_by]
count +=1
print(count,ticket_id)
start_date = all_tickets.end_time
stream_status = all_tickets.end_of_stream
print(start_date,stream_status)
today = datetime.now().strftime("%Y%m%d%H%M")
df.to_excel('Ticket_report{0}.xlsx'.format(today))
Now there are several issues here. The date is calculated correctly and it's indeed 7 days ago. But the tickets I am getting are going back to at least April and they were definitely not been modified since. I stopped it at this point cause we have thousands of tickets.
Also, the incremental method returns a max of 1000 ticket objects, but even after 1000 the loop doesn't seem to restart (print statement at the end doesn't trigger). I am not sure I am using the stream_status flag correctly. Any advice is more than welcome. Thank you!
Zenpy documentation on incremental can be found here: http://docs.facetoe.com.au/zenpy.html#incremental-exports
It was an API issue after all.
For anyone facing similar issues, turns out that the start date is compared against the generated_timestamp instead of the updated_at or created_at fields. Updated_at holds the last action that generated a ticket event(e.g. change) but generated_timestamp is updated every time the ticket is affected even from the system. That leads to grabbing tickets updated or created before the input date. A solution for that is to filter out the results after the call:
all_tickets = zendesk_client.incremental(start_time=start_date)
accurate_tickets = [ticket for ticket in all tickets if parser.parse(ticket.updated_at) > start_date]
Not very sure why they designed the API like this, seems a bit wrong, but that's how it works unfortunately.
Source: https://developer.zendesk.com/documentation/ticketing/managing-tickets/using-the-incremental-export-api/#excluding-system-updated-tickets-time-based-exports

Wrong CPM and revenue value Google AdManager Report API

I am trying to pull report from google ad manager using API
report_job = {
'reportQuery': {
'dimensions': ['AD_EXCHANGE_DATE', 'AD_EXCHANGE_COUNTRY_NAME'],
'columns': ['AD_EXCHANGE_AD_REQUESTS', 'AD_EXCHANGE_IMPRESSIONS',
'AD_EXCHANGE_ESTIMATED_REVENUE','AD_EXCHANGE_AD_ECPM'],
'dateRangeType': 'LAST_WEEK',
'timeZoneType': 'AD_EXCHANGE', # Run in pacific time
'adxReportCurrency': 'USD'
}
}
I suspect the downloaded report has very wired ECPM and Revenue values. as below
Please help if i am doing something wrong, as the ECPM has to be very low and the revenue as well.
"Money values are always specified in terms of micros which are a millionth of the fundamental currency unit. For US dollars, $1 is 1,000,000 micros."
From the AdManager API official documentation here: https://developers.google.com/ad-manager/api/reference/v202008/LineItemService.Money#microAmount

Localizing Stripe Payment on Sylius

I have added Stripe Payment Gateway on sylius project. It is working well but there is just one problem. By default, USD currency is used so it multiplied to 100 (7$ * 100 = 700 cents) when sent to the Stripe server. But in my case, I am using JPY so I do not need to multiply to 100.
I have checked the resources and found this on ConvertPaymentAction.php
$this->gateway->execute($currency = new GetCurrency($payment->getCurrencyCode()));
$divisor = pow(10, $currency->exp);
$details = ArrayObject::ensureArrayObject($payment->getDetails());
$details['amount'] = $payment->getTotalAmount() / $divisor
Is there a good way to solve this problem? I am new to Sylius so I am not sure how should I handle this. Should I override the Conversion Method or just make a new whole Entity for Stripe method.

Resources