mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2026-01-29 02:14:23 +01:00
-) Use private host for auth-based requests
-) Updated examples
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
import os
|
||||
import sys
|
||||
import asyncio
|
||||
import time
|
||||
sys.path.append('../../../')
|
||||
|
||||
from bfxapi import Client
|
||||
from bfxapi import Client, WS_HOST, REST_HOST
|
||||
|
||||
API_KEY=os.getenv("BFX_KEY")
|
||||
API_SECRET=os.getenv("BFX_SECRET")
|
||||
|
||||
# Create funding requires private hosts
|
||||
bfx = Client(
|
||||
API_KEY=API_KEY,
|
||||
API_SECRET=API_SECRET,
|
||||
logLevel='DEBUG'
|
||||
logLevel='DEBUG',
|
||||
ws_host=WS_HOST,
|
||||
rest_host=REST_HOST
|
||||
)
|
||||
|
||||
async def create_funding():
|
||||
|
||||
@@ -3,16 +3,19 @@ import sys
|
||||
import asyncio
|
||||
import time
|
||||
sys.path.append('../../../')
|
||||
from bfxapi import Client
|
||||
from bfxapi import Client, WS_HOST, REST_HOST
|
||||
from bfxapi.models import OrderType
|
||||
|
||||
API_KEY=os.getenv("BFX_KEY")
|
||||
API_SECRET=os.getenv("BFX_SECRET")
|
||||
|
||||
# Create order requires private hosts
|
||||
bfx = Client(
|
||||
API_KEY=API_KEY,
|
||||
API_SECRET=API_SECRET,
|
||||
logLevel='DEBUG'
|
||||
logLevel='DEBUG',
|
||||
ws_host=WS_HOST,
|
||||
rest_host=REST_HOST
|
||||
)
|
||||
|
||||
async def create_order():
|
||||
|
||||
@@ -4,15 +4,18 @@ import asyncio
|
||||
import time
|
||||
sys.path.append('../../../')
|
||||
|
||||
from bfxapi import Client
|
||||
from bfxapi import Client, WS_HOST, REST_HOST
|
||||
|
||||
API_KEY=os.getenv("BFX_KEY")
|
||||
API_SECRET=os.getenv("BFX_SECRET")
|
||||
|
||||
# Retrieving authenticated data requires private hosts
|
||||
bfx = Client(
|
||||
API_KEY=API_KEY,
|
||||
API_SECRET=API_SECRET,
|
||||
logLevel='DEBUG'
|
||||
logLevel='DEBUG',
|
||||
ws_host=WS_HOST,
|
||||
rest_host=REST_HOST
|
||||
)
|
||||
|
||||
now = int(round(time.time() * 1000))
|
||||
|
||||
@@ -4,10 +4,13 @@ import asyncio
|
||||
import time
|
||||
sys.path.append('../../../')
|
||||
|
||||
from bfxapi import Client
|
||||
from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST
|
||||
|
||||
# Retrieving public data requires public hosts
|
||||
bfx = Client(
|
||||
logLevel='DEBUG',
|
||||
ws_host=PUB_WS_HOST,
|
||||
rest_host=PUB_REST_HOST
|
||||
)
|
||||
|
||||
now = int(round(time.time() * 1000))
|
||||
|
||||
@@ -3,10 +3,13 @@ import sys
|
||||
import asyncio
|
||||
sys.path.append('../../../')
|
||||
|
||||
from bfxapi import Client
|
||||
from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST
|
||||
|
||||
# Retrieving seed trades requires public hosts
|
||||
bfx = Client(
|
||||
logLevel='INFO'
|
||||
logLevel='INFO',
|
||||
ws_host=PUB_WS_HOST,
|
||||
rest_host=PUB_REST_HOST
|
||||
)
|
||||
|
||||
async def get_seeds():
|
||||
|
||||
@@ -2,15 +2,18 @@ import os
|
||||
import sys
|
||||
import asyncio
|
||||
sys.path.append('../../../')
|
||||
from bfxapi import Client
|
||||
from bfxapi import Client, WS_HOST, REST_HOST
|
||||
|
||||
API_KEY=os.getenv("BFX_KEY")
|
||||
API_SECRET=os.getenv("BFX_SECRET")
|
||||
|
||||
# Submitting invoices requires private hosts
|
||||
bfx = Client(
|
||||
API_KEY=API_KEY,
|
||||
API_SECRET=API_SECRET,
|
||||
logLevel='DEBUG'
|
||||
logLevel='DEBUG',
|
||||
ws_host=WS_HOST,
|
||||
rest_host=REST_HOST
|
||||
)
|
||||
|
||||
async def run():
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
import os
|
||||
import sys
|
||||
import asyncio
|
||||
import time
|
||||
sys.path.append('../../../')
|
||||
|
||||
from bfxapi import Client
|
||||
from bfxapi import Client, WS_HOST, REST_HOST
|
||||
|
||||
API_KEY=os.getenv("BFX_KEY")
|
||||
API_SECRET=os.getenv("BFX_SECRET")
|
||||
|
||||
# Transfer wallet requires private hosts
|
||||
bfx = Client(
|
||||
API_KEY=API_KEY,
|
||||
API_SECRET=API_SECRET,
|
||||
logLevel='DEBUG'
|
||||
logLevel='DEBUG',
|
||||
ws_host=WS_HOST,
|
||||
rest_host=REST_HOST
|
||||
)
|
||||
|
||||
async def transfer_wallet():
|
||||
|
||||
Reference in New Issue
Block a user