From 64163e2c5c765f37c7d1c17d93220d4e01200a34 Mon Sep 17 00:00:00 2001 From: Alexey Churkin Date: Wed, 10 Jul 2024 13:09:07 +0000 Subject: [PATCH] GITBOOK-339: Added API Authentication notice --- docs/SUMMARY.md | 1 + .../interacting-with-the-api/authentication.md | 9 +++++++++ .../interacting-with-the-api/cancelling-the-order.md | 2 +- .../interacting-with-the-api/getting-a-quote.md | 4 ++-- .../interacting-with-the-api/quick-start-guide.md | 4 +++- .../requesting-order-creation-transaction.md | 4 ++-- 6 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/authentication.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index c925a4b4..a99f5e87 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -54,6 +54,7 @@ * [Withdrawing Affiliate Fees](dln-the-debridge-liquidity-network-protocol/interacting-with-smart-contracts/withdrawing-affiliate-fees.md) * [Creating Calldata for Solana](dln-the-debridge-liquidity-network-protocol/interacting-with-smart-contracts/creating-calldata-for-solana.md) * [Interacting with the API](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/README.md) + * [Authentication](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/authentication.md) * [Quick Start Guide](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/quick-start-guide.md) * [Getting a Quote](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/getting-a-quote.md) * [Requesting Order Creation Transaction](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/requesting-order-creation-transaction.md) diff --git a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/authentication.md b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/authentication.md new file mode 100644 index 00000000..f4ee897d --- /dev/null +++ b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/authentication.md @@ -0,0 +1,9 @@ +# Authentication + +{% hint style="warning" %} +Currently, the DLN API is open to everyone and doesn't require authentication. However, to make sure we keep delivering a high-quality service, we're going to introduce a requirement for commercial integrations to authenticate requests with dedicated API keys later in Q4 2024. After a short grace period, we'll limit requests made without such keys. + +Please fill in the [Authentication Request form](https://forms.gle/doWLQpr8oemphoaf9) so we can provide you with a dedicated API key and assistance as soon as the authentication requirement would get shipped. + +[https://forms.gle/doWLQpr8oemphoaf9](https://forms.gle/doWLQpr8oemphoaf9) +{% endhint %} diff --git a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/cancelling-the-order.md b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/cancelling-the-order.md index 06a13c43..9b2a4f30 100644 --- a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/cancelling-the-order.md +++ b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/cancelling-the-order.md @@ -6,7 +6,7 @@ The only way to cancel the order is to initiate the cancellation procedure it wa The cancellation procedure can only be initiated by the `dstChainOrderAuthorityAddress` in a separate transaction on the destination chain. Such transaction can be requested by calling the `/v1.0/dln/order/:id/cancel-tx` endpoint: -> `https://api.dln.trade/v1.0/dln/order/0x9ee6c3d0aa68a7504e619b02df7c71539d0ce10e27f593bf8604b62e51955a01/cancel-tx` +> `https://dln.debridge.finance/v1.0/dln/order/0x9ee6c3d0aa68a7504e619b02df7c71539d0ce10e27f593bf8604b62e51955a01/cancel-tx` This gives the response with the transaction data ready to be signed and broadcasted to the destination chain: diff --git a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/getting-a-quote.md b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/getting-a-quote.md index 61ec15ee..246a1322 100644 --- a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/getting-a-quote.md +++ b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/getting-a-quote.md @@ -1,7 +1,7 @@ # Getting a Quote {% hint style="info" %} -The [/quote](https://api.dln.trade/v1.0/#/DLN/DlnOrderControllerV10\_estimateTakeAmountOrder) endpoint of DNL API should be used only to display outcomes of the trades when the address of the user is unknown (e.g. to let the user see prices of cross-chain trades before one connects the wallet to the dApp). +The [`/quote`](https://dln.debridge.finance/v1.0#/DLN/DlnOrderControllerV10\_estimateTakeAmountOrder) endpoint of DNL API should be used only to display outcomes of the trades when the address of the user is unknown (e.g. to let the user see prices of cross-chain trades before one connects the wallet to the dApp). Whenever an address is known, make sure to call `/create-tx` directly. {% endhint %} @@ -25,7 +25,7 @@ Let's get a quote for our use-case by calling the `/v1.0/dln/order/quote` endpoi Calling the endpoint: -> `https://api.dln.trade/v1.0/dln/order/quote?srcChainId=56&srcChainTokenIn=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&srcChainTokenInAmount=100000000000000000000&dstChainId=43114&dstChainTokenOut=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&prependOperatingExpenses=true&affiliateFeePercent=0.1` +> `https://dln.debridge.finance/v1.0/dln/order/quote?srcChainId=56&srcChainTokenIn=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&srcChainTokenInAmount=100000000000000000000&dstChainId=43114&dstChainTokenOut=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&prependOperatingExpenses=true&affiliateFeePercent=0.1` gives a response with the recommended amount of input token, and several details describing how it has been calculated. The recommended amount of the output token (USDT in our case) available in the `estimation.dstChainTokenOut.recommendedAmount` property — this is the amount that can be suggested to a user for explicit approval before placing an order. diff --git a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/quick-start-guide.md b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/quick-start-guide.md index 0e40df13..5a2eb55e 100644 --- a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/quick-start-guide.md +++ b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/quick-start-guide.md @@ -10,7 +10,9 @@ description: >- The DLN API provides developers an effortless way to interact with the DLN protocol and trade across chains in seconds with deep liquidity, limit orders, and protection against slippage and MEV. The API takes the burden off of building complex and sometimes painful interactions with blockchain RPCs and smart contracts by providing a complete set of RESTful endpoints, sufficient to quote, create, and manage trades during their whole lifecycle. {% hint style="info" %} -The **DLN API** with Swagger resides at [dln.debridge.finance](https://dln.debridge.finance) +The **DLN API** resides at the domain name `dln.debridge.finance` + +The DLN API Swagger could be found at [https://dln.debridge.finance/v1.0](https://dln.debridge.finance/v1.0) Additionally, a JSON representation of the API can be found here: [dln.debridge.finance/v1.0-json](https://dln.debridge.finance/v1.0-json) {% endhint %} diff --git a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/requesting-order-creation-transaction.md b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/requesting-order-creation-transaction.md index 0fde19e7..69f5d492 100644 --- a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/requesting-order-creation-transaction.md +++ b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/requesting-order-creation-transaction.md @@ -2,7 +2,7 @@ Placing a trade on the deBridge Liquidity Network (DLN) actually means submitting a data struct to the DLN smart contract on the source chain. The data struct must represent the order, including but not limited to: the give and take offers, recipient, order authorities, and other variables. -There is a [`/v1.0/dln/order/create-tx`](https://api.dln.trade/v1.0/#/DLN/DlnOrderControllerV10\_createOrder) endpoint for that, which takes all the parameters provided to the quote, the give and take parts of the quote, plus several more parameters describing the sender, recipient, and order authorities. +There is a [`/v1.0/dln/order/create-tx`](https://dln.debridge.finance/v1.0#/DLN/DlnOrderControllerV10\_createOrder) endpoint for that, which takes all the parameters provided to the quote, the give and take parts of the quote, plus several more parameters describing the sender, recipient, and order authorities. To form the trade and get tx data to be signed, prepare the following parameters: @@ -17,7 +17,7 @@ To form the trade and get tx data to be signed, prepare the following parameters Let's call the `/v1.0/dln/order/create-tx` endpoint with all these parameter values mentioned above: -> `https://api.dln.trade/v1.0/dln/order/create-tx?srcChainId=56&srcChainTokenIn=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&srcChainTokenInAmount=100722632000000000000&dstChainId=43114&dstChainTokenOut=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&dstChainTokenOutAmount=99623050&dstChainTokenOutRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&srcChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&dstChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&affiliateFeePercent=0.1&affiliateFeeRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045` +> `https://dln.debridge.finance/v1.0/dln/order/create-tx?srcChainId=56&srcChainTokenIn=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&srcChainTokenInAmount=100722632000000000000&dstChainId=43114&dstChainTokenOut=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&dstChainTokenOutAmount=99623050&dstChainTokenOutRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&srcChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&dstChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&affiliateFeePercent=0.1&affiliateFeeRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045` {% hint style="warning" %} Keep in mind to set`srcChainOrderAuthorityAddress` and `dstChainOrderAuthorityAddress`to the addresses, a user has access to. Otherwise, the order has the risk of being stuck forever or the funds being sent to the wrong address during the [canceling procedure](broken-reference) (if that happens).