diff --git a/README.md b/README.md index 6acc083..640d643 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ When initializing the client, users must accept [terms and conditions](https://b { "apiGateway": "https://dapi.api.sui-prod.bluefin.io", "socketURL": "wss://dapi.api.sui-prod.bluefin.io", - "dmsURL": "https://dapi.api.sui-prod.bluefin.io", + "dmsURL": "https://api.sui-prod.bluefin.io/dead-man-switch", "webSocketURL": "wss://notifications.api.sui-prod.bluefin.io", - "onboardingUrl": "https://trade.bluefin.io" + "onboardingUrl": "https://trade-sui.bluefin.exchange" } ``` diff --git a/examples/18.dms_api.py b/examples/18.dms_api.py new file mode 100644 index 0000000..cac6217 --- /dev/null +++ b/examples/18.dms_api.py @@ -0,0 +1,50 @@ +import json + +import sys, os + +sys.path.append(os.getcwd() + "/src/") +from config import TEST_ACCT_KEY, TEST_SUB_ACCT_KEY, TEST_NETWORK +from bluefin_v2_client import ( + BluefinClient, + MARKET_SYMBOLS, + ORDER_SIDE, + ORDER_TYPE, + Networks, + OrderSignatureRequest, +) +import asyncio + +from bluefin_client_sui.interfaces import PostTimerAttributes + + +async def main(): + client = BluefinClient(True, Networks[TEST_NETWORK], TEST_ACCT_KEY) + await client.init(True) + + print("User: ", client.get_public_address()) + countDownsObject: PostTimerAttributes = dict() + countDowns = list() + countDowns.append({"symbol": MARKET_SYMBOLS.BTC.value, "countDown": 3 * 1000}) + + countDowns.append({"symbol": MARKET_SYMBOLS.ETH.value, "countDown": 3 * 1000}) + + countDownsObject["countDowns"] = countDowns + try: + # sending post request to reset user's count down timer with MARKET_SYMBOL for auto cancellation of order + postResponse = await client.reset_cancel_on_disconnect_timer(countDownsObject) + print(postResponse) + # get request to get user's count down timer for MARKET_SYMBOL + getResponse = await client.get_cancel_on_disconnect_timer( + {"symbol": MARKET_SYMBOLS.ETH} + ) + print(getResponse) + + except Exception as e: + print(e) + + await client.close_connections() + + +if __name__ == "__main__": + event_loop = asyncio.get_event_loop() + event_loop.run_until_complete(main()) diff --git a/pyproject.toml b/pyproject.toml index 285f5aa..e090ced 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bluefin_v2_client" -version = "2.0.1" +version = "2.0.2" description = "Library to interact with Bluefin exchange protocol including its off-chain api-gateway and on-chain contracts" readme = "README.md" requires-python = ">=3.8" diff --git a/src/bluefin_v2_client/constants.py b/src/bluefin_v2_client/constants.py index aef6c21..1f95172 100644 --- a/src/bluefin_v2_client/constants.py +++ b/src/bluefin_v2_client/constants.py @@ -3,7 +3,7 @@ "url": "https://fullnode.testnet.sui.io:443", "apiGateway": "https://dapi.api.sui-staging.bluefin.io", "socketURL": "wss://dapi.api.sui-staging.bluefin.io", - "dmsURL": "https://dapi.api.sui-staging.bluefin.io", + "dmsURL": "https://api.sui-staging.bluefin.io/dead-man-switch", "webSocketURL": "wss://notifications.api.sui-staging.bluefin.io", "onboardingUrl": "https://testnet.bluefin.io", }, @@ -11,7 +11,7 @@ "url": "https://fullnode.testnet.sui.io:443", "apiGateway": "https://dapi.api.sui-prod.bluefin.io", "socketURL": "wss://dapi.api.sui-prod.bluefin.io", - "dmsURL": "https://dapi.api.sui-prod.bluefin.io", + "dmsURL": "https://api.sui-prod.bluefin.io/dead-man-switch", "webSocketURL": "wss://notifications.api.sui-prod.bluefin.io", "onboardingUrl": "https://trade-sui.bluefin.exchange", },