mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-23 08:44:25 +01:00
Rewrite all rest examples according to v3.0.0b3's changes.
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
|
||||
import os
|
||||
|
||||
from bfxapi import Client, REST_HOST
|
||||
|
||||
from bfxapi import Client
|
||||
from bfxapi.types import InvoiceSubmission
|
||||
|
||||
bfx = Client(
|
||||
rest_host=REST_HOST,
|
||||
api_key=os.getenv("BFX_API_KEY"),
|
||||
api_secret=os.getenv("BFX_API_SECRET")
|
||||
)
|
||||
@@ -20,7 +18,7 @@ customer_info = {
|
||||
"residStreet": "5-6 Leicester Square",
|
||||
"residBuildingNo": "23 A",
|
||||
"fullName": "John Doe",
|
||||
"email": "john@example.com"
|
||||
"email": "john@example.com",
|
||||
}
|
||||
|
||||
invoice: InvoiceSubmission = bfx.rest.merchant.submit_invoice(
|
||||
@@ -29,17 +27,19 @@ invoice: InvoiceSubmission = bfx.rest.merchant.submit_invoice(
|
||||
order_id="test",
|
||||
customer_info=customer_info,
|
||||
pay_currencies=["ETH"],
|
||||
duration=86400 * 10
|
||||
duration=86400,
|
||||
)
|
||||
|
||||
print("Invoice submission:", invoice)
|
||||
|
||||
print(bfx.rest.merchant.complete_invoice(
|
||||
id=invoice.id,
|
||||
pay_currency="ETH",
|
||||
deposit_id=1
|
||||
))
|
||||
print(
|
||||
bfx.rest.merchant.complete_invoice(id=invoice.id, pay_currency="ETH", deposit_id=1)
|
||||
)
|
||||
|
||||
print(bfx.rest.merchant.get_invoices(limit=25))
|
||||
|
||||
print(bfx.rest.merchant.get_invoices_paginated(page=1, page_size=60, sort="asc", sort_field="t"))
|
||||
print(
|
||||
bfx.rest.merchant.get_invoices_paginated(
|
||||
page=1, page_size=60, sort="asc", sort_field="t"
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user