From 696243157da5a5a3668fd09a7b1bddf003d5313a Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 9 Jan 2024 14:18:15 +0000 Subject: [PATCH] chore: prod docs --- .../01-order/01-approve-sell-token-order/README.md | 6 +++--- .../01-simple-orders/01-order/02-quote-order/README.md | 6 +++--- .../01-simple-orders/01-order/03-sign-order/README.md | 2 +- .../01-simple-orders/01-order/04-submit-order/README.md | 2 +- .../01-order/07-cancel-on-chain-order/README.md | 6 +++--- .../02-app-data/01-simple-app-data/README.md | 2 +- .../01-eth-flow/01-create-eth-flow/README.md | 6 +++--- .../01-eth-flow/02-view-eth-flow/README.md | 4 ++-- .../01-eth-flow/03-cancel-eth-flow/README.md | 2 +- .../01-create-pre-signed-order/README.md | 8 ++++---- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/content/tutorial/01-simple-orders/01-order/01-approve-sell-token-order/README.md b/content/tutorial/01-simple-orders/01-order/01-approve-sell-token-order/README.md index 8027688..c3fbd17 100644 --- a/content/tutorial/01-simple-orders/01-order/01-approve-sell-token-order/README.md +++ b/content/tutorial/01-simple-orders/01-order/01-approve-sell-token-order/README.md @@ -2,9 +2,9 @@ title: Approving sell token --- -For an order to be tradeable on CoW Protocol, the owner needs to approve the [GPv2VaultRelayer](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/vault-relayer) to spend the token they want to trade. +For an order to be tradeable on CoW Protocol, the owner needs to approve the [GPv2VaultRelayer](https://docs.cow.fi/cow-protocol/reference/contracts/core/vault-relayer) to spend the token they want to trade. -> A list of the core deployed contracts can be found [here](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core). +> A list of the core deployed contracts can be found [here](https://docs.cow.fi/cow-protocol/reference/contracts/core). ## Contract (token) interaction @@ -21,7 +21,7 @@ Additionally, if we want to **make a transaction**, we must have a _signer_ (e.g The contract to be interacted with is the token we want to trade. In this tutorial, we use the [wxDAI](https://gnosisscan.io/token/0xe91d153e0b41518a2ce8dd3d7944fa863463a97d) token, and assign it's address `0xe91d153e0b41518a2ce8dd3d7944fa863463a97d` to a `const`. -At the same time, we assign the address of the [GPv2VaultRelayer](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/vault-relayer) to a `const`: +At the same time, we assign the address of the [GPv2VaultRelayer](https://docs.cow.fi/cow-protocol/reference/contracts/core/vault-relayer) to a `const`: ```typescript /// file: run.ts diff --git a/content/tutorial/01-simple-orders/01-order/02-quote-order/README.md b/content/tutorial/01-simple-orders/01-order/02-quote-order/README.md index f35f3c2..f42289e 100644 --- a/content/tutorial/01-simple-orders/01-order/02-quote-order/README.md +++ b/content/tutorial/01-simple-orders/01-order/02-quote-order/README.md @@ -2,11 +2,11 @@ title: Quoting --- -OK, so you're wanting to trade some tokens on CoW Protocol. Great! But before we do that, let's get a quote first so we know what we're getting into. We get quotes using the [Order book API](https://beta.docs.cow.fi/cow-protocol/tutorials/arbitrate/orderbook). +OK, so you're wanting to trade some tokens on CoW Protocol. Great! But before we do that, let's get a quote first so we know what we're getting into. We get quotes using the [Order book API](https://docs.cow.fi/cow-protocol/tutorials/arbitrate/orderbook). ## API -The CoW Protocol API is [documented in swagger](https://beta.docs.cow.fi/cow-protocol/reference/apis/orderbook). Using API endpoints can be a bit tricky, so we've exposed all the settings that you need (including things like rate limiters so you don't get blocked) in a simple to use library: `@cowprotocol/cow-sdk`. +The CoW Protocol API is [documented in swagger](https://docs.cow.fi/cow-protocol/reference/apis/orderbook). Using API endpoints can be a bit tricky, so we've exposed all the settings that you need (including things like rate limiters so you don't get blocked) in a simple to use library: `@cowprotocol/cow-sdk`. To install it, run: `npm install @cowprotocol/cow-sdk` @@ -157,4 +157,4 @@ In the above case, we can see that: - the `feeAmount` is `1881812051493698` atomic units of `wxDAI` (which is `0.001881812051493698` `wxDAI`) - the `kind` is `sell` -The above `OrderQuoteResponse` object actually maps to the [`GPv2Order.Data`](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/settlement#gpv2orderdata-struct) struct for the smart contract, so this is what we will sign in the [next tutorial](/tutorial/sign-order) for our swap. \ No newline at end of file +The above `OrderQuoteResponse` object actually maps to the [`GPv2Order.Data`](https://docs.cow.fi/cow-protocol/reference/contracts/core/settlement#gpv2orderdata-struct) struct for the smart contract, so this is what we will sign in the [next tutorial](/tutorial/sign-order) for our swap. \ No newline at end of file diff --git a/content/tutorial/01-simple-orders/01-order/03-sign-order/README.md b/content/tutorial/01-simple-orders/01-order/03-sign-order/README.md index 5938bfb..c18681d 100644 --- a/content/tutorial/01-simple-orders/01-order/03-sign-order/README.md +++ b/content/tutorial/01-simple-orders/01-order/03-sign-order/README.md @@ -6,7 +6,7 @@ Here we will build on the previous tutorial and sign the quote we got from the [ ## Intents and signatures -CoW Protocol uses [intents](https://beta.docs.cow.fi/cow-protocol/reference/core/intents) to represent orders. An intent is a [signed message](https://beta.docs.cow.fi/cow-protocol/reference/core/signing-schemes). Most intents are signed using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) signing scheme, and this is what we will use in this tutorial. +CoW Protocol uses [intents](https://docs.cow.fi/cow-protocol/reference/core/intents) to represent orders. An intent is a [signed message](https://docs.cow.fi/cow-protocol/reference/core/signing-schemes). Most intents are signed using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) signing scheme, and this is what we will use in this tutorial. ## Signing an order diff --git a/content/tutorial/01-simple-orders/01-order/04-submit-order/README.md b/content/tutorial/01-simple-orders/01-order/04-submit-order/README.md index 5ebe782..73a25b2 100644 --- a/content/tutorial/01-simple-orders/01-order/04-submit-order/README.md +++ b/content/tutorial/01-simple-orders/01-order/04-submit-order/README.md @@ -51,7 +51,7 @@ An example `orderId` should look like: } ``` -> The [`orderId`](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/settlement#orderuid) is the unique identifier for the order we have just submitted. We can use this `orderId` (also known as `orderUid`) to check the status of the order on [CoW Explorer](https://beta.docs.cow.fi/cow-protocol/tutorials/cow-explorer/order). Keep this handy, as we will practice some more with this `orderId` in the next tutorial! +> The [`orderId`](https://docs.cow.fi/cow-protocol/reference/contracts/core/settlement#orderuid) is the unique identifier for the order we have just submitted. We can use this `orderId` (also known as `orderUid`) to check the status of the order on [CoW Explorer](https://docs.cow.fi/cow-protocol/tutorials/cow-explorer/order). Keep this handy, as we will practice some more with this `orderId` in the next tutorial! ### Errors diff --git a/content/tutorial/01-simple-orders/01-order/07-cancel-on-chain-order/README.md b/content/tutorial/01-simple-orders/01-order/07-cancel-on-chain-order/README.md index aa7ecd8..9f3c7e6 100644 --- a/content/tutorial/01-simple-orders/01-order/07-cancel-on-chain-order/README.md +++ b/content/tutorial/01-simple-orders/01-order/07-cancel-on-chain-order/README.md @@ -4,9 +4,9 @@ title: Cancelling on-chain The preferred way to cancel an order is off-chain, notably because it is free. However, this places trust in the API to cancel the order. If you want to enforce the cancellation of an order, you can do so on-chain. This will cost gas, but will ensure that the order is cancelled. -To cancel, we will send an `invalidateOrder` transaction to the [`GPv2Settlement`](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/settlement) contract. +To cancel, we will send an `invalidateOrder` transaction to the [`GPv2Settlement`](https://docs.cow.fi/cow-protocol/reference/contracts/core/settlement) contract. -> A list of the core deployed contracts can be found [here](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core). +> A list of the core deployed contracts can be found [here](https://docs.cow.fi/cow-protocol/reference/contracts/core). ## Contract (`GPv2Settlement`) interaction @@ -21,7 +21,7 @@ Additionally, if we want to **make a transaction**, we must have a _signer_ (e.g ### Contract address and `orderUid` -The contract to be interacted with is the [`GPv2Settlement`](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/settlement) contract. We assign it's address `0x9008D19f58AAbD9eD0D60971565AA8510560ab41` to a `const`. +The contract to be interacted with is the [`GPv2Settlement`](https://docs.cow.fi/cow-protocol/reference/contracts/core/settlement) contract. We assign it's address `0x9008D19f58AAbD9eD0D60971565AA8510560ab41` to a `const`. At the same time, we assign the `orderUid` of the order we want to cancel to a `const`. diff --git a/content/tutorial/01-simple-orders/02-app-data/01-simple-app-data/README.md b/content/tutorial/01-simple-orders/02-app-data/01-simple-app-data/README.md index 03ffa87..c2346fb 100644 --- a/content/tutorial/01-simple-orders/02-app-data/01-simple-app-data/README.md +++ b/content/tutorial/01-simple-orders/02-app-data/01-simple-app-data/README.md @@ -6,7 +6,7 @@ So, we have created a simple order in the previous section, but what if you're a ## `app-data` SDK -The `app-data` is documented in [JSON Schema](https://beta.docs.cow.fi/cow-protocol/reference/core/intents/app-data#schema). Writing to a schema is not very convenient, so we have a special SDK for that. It's called the `app-data` SDK. +The `app-data` is documented in [JSON Schema](https://docs.cow.fi/cow-protocol/reference/core/intents/app-data#schema). Writing to a schema is not very convenient, so we have a special SDK for that. It's called the `app-data` SDK. To install it, run: `npm install @cowprotocol/app-data` diff --git a/content/tutorial/02-advanced-orders/01-eth-flow/01-create-eth-flow/README.md b/content/tutorial/02-advanced-orders/01-eth-flow/01-create-eth-flow/README.md index 60dd4da..64de108 100644 --- a/content/tutorial/02-advanced-orders/01-eth-flow/01-create-eth-flow/README.md +++ b/content/tutorial/02-advanced-orders/01-eth-flow/01-create-eth-flow/README.md @@ -2,7 +2,7 @@ title: Creating order --- -[Eth-flow](https://beta.docs.cow.fi/cow-protocol/reference/contracts/periphery/eth-flow) allows users to create orders selling `ETH` without wrapping it to `WETH` first. +[Eth-flow](https://docs.cow.fi/cow-protocol/reference/contracts/periphery/eth-flow) allows users to create orders selling `ETH` without wrapping it to `WETH` first. To create an `Eth-flow` order we will need to interact with the `Eth-Flow` contract. @@ -19,7 +19,7 @@ Additionally, as we want to **make a transaction**, we must have a _signer_ (e.g ### Contract address -`EthFlow` is a periphery contract, and it's deployed on each supported network. As `EthFlow` orders are natively indexed by the [autopilot](https://beta.docs.cow.fi/cow-protocol/tutorials/arbitrate/autopilot), there also exists a `production` and `staging` version of the contract on each network. +`EthFlow` is a periphery contract, and it's deployed on each supported network. As `EthFlow` orders are natively indexed by the [autopilot](https://docs.cow.fi/cow-protocol/tutorials/arbitrate/autopilot), there also exists a `production` and `staging` version of the contract on each network. For this tutorial, we will use the [`production` version of the contract](https://gnosisscan.io/address/0x40A50cf069e992AA4536211B23F286eF88752187) on Gnosis chain. Let's assign it's address to a constant: @@ -136,7 +136,7 @@ In addition to the `OrderQuoteRequest` fields we've used in the previous tutoria ### `EthFlowOrder.Data` struct -Now that we have a quote, we can go about creating an `EthFlow` order. Unfortunately no `EthFlowOrder` type exists in the SDK, so we will need to create one ourselves. Simply we create a type that extends the `UnsignedOrder` type (removing the fields that are not required for [`EthFlow` orders](https://beta.docs.cow.fi/cow-protocol/reference/contracts/periphery/eth-flow#ethfloworderdata)) and add a `quoteId` field: +Now that we have a quote, we can go about creating an `EthFlow` order. Unfortunately no `EthFlowOrder` type exists in the SDK, so we will need to create one ourselves. Simply we create a type that extends the `UnsignedOrder` type (removing the fields that are not required for [`EthFlow` orders](https://docs.cow.fi/cow-protocol/reference/contracts/periphery/eth-flow#ethfloworderdata)) and add a `quoteId` field: ```typescript /// file: run.ts diff --git a/content/tutorial/02-advanced-orders/01-eth-flow/02-view-eth-flow/README.md b/content/tutorial/02-advanced-orders/01-eth-flow/02-view-eth-flow/README.md index 084268c..04ebe74 100644 --- a/content/tutorial/02-advanced-orders/01-eth-flow/02-view-eth-flow/README.md +++ b/content/tutorial/02-advanced-orders/01-eth-flow/02-view-eth-flow/README.md @@ -2,13 +2,13 @@ title: Viewing status --- -One of the more difficult things to do with `Eth-flow` orders is to determine their status, as to do so we need to know the [`orderUid`](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/settlement#orderuid) of the order. +One of the more difficult things to do with `Eth-flow` orders is to determine their status, as to do so we need to know the [`orderUid`](https://docs.cow.fi/cow-protocol/reference/contracts/core/settlement#orderuid) of the order. In this tutorial, we will learn how to determine the `orderUid` of an `Eth-flow` order, and how to use it to determine the order's status. ## Determining the `orderUid` -Upon consulting the documentation's Technical reference on [`orderUid`](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/settlement#orderuid), we can see that the `orderUid` is composed of the following fields: +Upon consulting the documentation's Technical reference on [`orderUid`](https://docs.cow.fi/cow-protocol/reference/contracts/core/settlement#orderuid), we can see that the `orderUid` is composed of the following fields: - `digest`: The EIP-712 digest of the `GPv2Order.Data` struct - `owner`: The address of the order's owner diff --git a/content/tutorial/02-advanced-orders/01-eth-flow/03-cancel-eth-flow/README.md b/content/tutorial/02-advanced-orders/01-eth-flow/03-cancel-eth-flow/README.md index 787be63..ecc427d 100644 --- a/content/tutorial/02-advanced-orders/01-eth-flow/03-cancel-eth-flow/README.md +++ b/content/tutorial/02-advanced-orders/01-eth-flow/03-cancel-eth-flow/README.md @@ -13,7 +13,7 @@ We will use the second method in this tutorial. ## Reconstructing the `EthFlowOrder.Data` struct -From the [`EthFlowOrder.Data` struct](https://beta.docs.cow.fi/cow-protocol/reference/contracts/periphery/eth-flow#ethfloworderdata) technical reference, we can see that the struct's fields are a subset of the [`GPv2Order.Data` struct](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core/settlement#gpv2orderdata-struct) and an additional `int64` field called `quoteId`. +From the [`EthFlowOrder.Data` struct](https://docs.cow.fi/cow-protocol/reference/contracts/periphery/eth-flow#ethfloworderdata) technical reference, we can see that the struct's fields are a subset of the [`GPv2Order.Data` struct](https://docs.cow.fi/cow-protocol/reference/contracts/core/settlement#gpv2orderdata-struct) and an additional `int64` field called `quoteId`. Fortunately, in the `OrderPlacement` event log, we can see that the `order` field is the `GPv2Order.Data` struct, and the `data` field is a solidity-packed tuple containing the `quoteId` field and the `validTo` field. This means that we can reconstruct the `EthFlowOrder.Data` struct from the `OrderPlacement` event log! diff --git a/content/tutorial/02-advanced-orders/03-pre-signed-orders/01-create-pre-signed-order/README.md b/content/tutorial/02-advanced-orders/03-pre-signed-orders/01-create-pre-signed-order/README.md index d80ddbb..1bed0bb 100644 --- a/content/tutorial/02-advanced-orders/03-pre-signed-orders/01-create-pre-signed-order/README.md +++ b/content/tutorial/02-advanced-orders/03-pre-signed-orders/01-create-pre-signed-order/README.md @@ -6,9 +6,9 @@ There are two types of wallets: - EOA (externally owned account) wallets, which are controlled by a private key - Smart contract wallets, which are controlled by a smart contract -Since smart contract wallets, such as [`Safe`](https://safe.global) are controlled by a smart contract, they can't sign transactions using [`EIP-712`](https://beta.docs.cow.fi/cow-protocol/reference/core/signing-schemes#eip-712). However, CoW Protocol supports smart contract wallets by allowing them to sign using: -- [`EIP-1271`](https://beta.docs.cow.fi/cow-protocol/reference/core/signing-schemes#eip-1271) -- [`PRESIGN`](https://beta.docs.cow.fi/cow-protocol/reference/core/signing-schemes#presign) +Since smart contract wallets, such as [`Safe`](https://safe.global) are controlled by a smart contract, they can't sign transactions using [`EIP-712`](https://docs.cow.fi/cow-protocol/reference/core/signing-schemes#eip-712). However, CoW Protocol supports smart contract wallets by allowing them to sign using: +- [`EIP-1271`](https://docs.cow.fi/cow-protocol/reference/core/signing-schemes#eip-1271) +- [`PRESIGN`](https://docs.cow.fi/cow-protocol/reference/core/signing-schemes#presign) This tutorial will show you how to create an order using `PreSign` signing scheme, using a `Safe` wallet. It is assumed that you have a `Safe` wallet with at least one owner, and that the `owner` is the account you're using to run the tutorial. @@ -35,7 +35,7 @@ To interact with a contract, we need to know: ### Contract address -`GPv2Settlement` is a core contract and it's deployed on each supported network. Core contracts deployment addresses can be found in the [CoW Protocol docs](https://beta.docs.cow.fi/cow-protocol/reference/contracts/core). +`GPv2Settlement` is a core contract and it's deployed on each supported network. Core contracts deployment addresses can be found in the [CoW Protocol docs](https://docs.cow.fi/cow-protocol/reference/contracts/core). This is such a common use case that the SDK provides an export for the `GPv2Settlement` contract address: