@cowprotocol/sdk-trading 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Special cases:
|
|
|
65
65
|
|
|
66
66
|
You need:
|
|
67
67
|
|
|
68
|
-
- `chainId` - Supported chain ID ([see list](https://docs.cow.
|
|
68
|
+
- `chainId` - Supported chain ID ([see list](https://docs.cow.finance/cow-protocol/reference/sdks/core-utilities/sdk-config)).
|
|
69
69
|
- `appCode` - Unique app identifier for tracking orders.
|
|
70
70
|
- `signer` - Private key, ethers signer, or `Eip1193` provider (optional - will use global adapter's signer if not provided).
|
|
71
71
|
|
|
@@ -159,9 +159,9 @@ The function returns `quoteResults` object with the following properties:
|
|
|
159
159
|
|
|
160
160
|
- `tradeParameters` - trade type, assets, amounts and other optional parameters
|
|
161
161
|
- `amountsAndCosts` - the order sell/buy amounts including network costs, fees and slippage
|
|
162
|
-
- `orderToSign` - order parameters to sign (see [order signing](https://docs.cow.
|
|
163
|
-
- `quoteResponse` - DTO from [quote API](https://api.cow.
|
|
164
|
-
- `appDataInfo` - [order's metadata](https://docs.cow.
|
|
162
|
+
- `orderToSign` - order parameters to sign (see [order signing](https://docs.cow.finance/cow-protocol/reference/sdks/cow-sdk/classes/OrderSigningUtils))
|
|
163
|
+
- `quoteResponse` - DTO from [quote API](https://api.cow.finance/docs/#/default/post_api_v1_quote)
|
|
164
|
+
- `appDataInfo` - [order's metadata](https://docs.cow.finance/cow-protocol/reference/sdks/app-data)
|
|
165
165
|
- `orderTypedData` - EIP-712 typed data for signing
|
|
166
166
|
|
|
167
167
|
Another parameter is returned by this function is `postSwapOrderFromQuote`.
|
|
@@ -536,7 +536,7 @@ See `TradeOptionalParameters` type for more details.
|
|
|
536
536
|
| `slippageBps` | `number` | 50 | Slippage tolerance applied to the order to get the limit price. Expressed in Basis Points (BPS). One basis point is equivalent to 0.01% (1/100th of a percent). |
|
|
537
537
|
| `receiver` | `string` | order creator | The address that will receive the order's tokens. |
|
|
538
538
|
| `validFor` | `number` | 30 mins | The order expiration time in seconds. |
|
|
539
|
-
| `partnerFee` | `PartnerFee` | - | Partners of the protocol can specify their fee for the order, including the fee in basis points (BPS) and the fee recipient address. [Read more](https://docs.cow.
|
|
539
|
+
| `partnerFee` | `PartnerFee` | - | Partners of the protocol can specify their fee for the order, including the fee in basis points (BPS) and the fee recipient address. [Read more](https://docs.cow.finance/governance/fees/partner-fee) |
|
|
540
540
|
|
|
541
541
|
##### Example
|
|
542
542
|
|
|
@@ -585,8 +585,8 @@ However, you can provide additional parameters to customize the order creation.
|
|
|
585
585
|
|
|
586
586
|
#### Swap
|
|
587
587
|
|
|
588
|
-
1. `quoteRequest` - the quote request object. It is used to get a quote from the quote API ([read more](https://docs.cow.
|
|
589
|
-
2. `appData` - the order's metadata ([read more](https://docs.cow.
|
|
588
|
+
1. `quoteRequest` - the quote request object. It is used to get a quote from the quote API ([read more](https://docs.cow.finance/cow-protocol/reference/sdks/cow-sdk/modules#orderquoterequest))
|
|
589
|
+
2. `appData` - the order's metadata ([read more](https://docs.cow.finance/cow-protocol/reference/sdks/app-data/modules#appdataparams))
|
|
590
590
|
|
|
591
591
|
##### Example
|
|
592
592
|
|
|
@@ -690,7 +690,7 @@ console.log('Buy amount:', order.buyAmount)
|
|
|
690
690
|
|
|
691
691
|
Cancels an order off-chain by sending a signed cancellation request to the order book API. This is a "soft cancel" that is faster and doesn't require gas, but requires order book support.
|
|
692
692
|
|
|
693
|
-
You always can cancel orders using [CoW Swap](https://swap.cow.
|
|
693
|
+
You always can cancel orders using [CoW Swap](https://swap.cow.finance), [see the tutorial for more details](https://docs.cow.finance/cow-protocol/tutorials/cow-swap/swap#cancel-your-order).
|
|
694
694
|
|
|
695
695
|
**Parameters:**
|
|
696
696
|
- `orderUid` - The unique identifier of the order to cancel
|
package/dist/index.js
CHANGED
|
@@ -491,7 +491,7 @@ var import_deepmerge = __toESM(require("deepmerge"));
|
|
|
491
491
|
// ../sdk/package.json
|
|
492
492
|
var package_default = {
|
|
493
493
|
name: "@cowprotocol/cow-sdk",
|
|
494
|
-
version: "8.0
|
|
494
|
+
version: "8.1.0",
|
|
495
495
|
license: "(MIT OR Apache-2.0)",
|
|
496
496
|
description: "CoW Protocol SDK - get quote, configure your order, and trade",
|
|
497
497
|
repository: {
|
package/dist/index.mjs
CHANGED
|
@@ -458,7 +458,7 @@ import deepmerge from "deepmerge";
|
|
|
458
458
|
// ../sdk/package.json
|
|
459
459
|
var package_default = {
|
|
460
460
|
name: "@cowprotocol/cow-sdk",
|
|
461
|
-
version: "8.0
|
|
461
|
+
version: "8.1.0",
|
|
462
462
|
license: "(MIT OR Apache-2.0)",
|
|
463
463
|
description: "CoW Protocol SDK - get quote, configure your order, and trade",
|
|
464
464
|
repository: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cowprotocol/sdk-trading",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "CowProtocol trading",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"ts-jest": "^29.0.0",
|
|
35
35
|
"tsx": "^4.19.4",
|
|
36
36
|
"@cow-sdk/typescript-config": "0.0.0-beta.0",
|
|
37
|
-
"@cowprotocol/sdk-ethers-
|
|
38
|
-
"@cowprotocol/sdk-ethers-
|
|
39
|
-
"@cowprotocol/sdk-viem-adapter": "0.3.
|
|
37
|
+
"@cowprotocol/sdk-ethers-v6-adapter": "0.4.3",
|
|
38
|
+
"@cowprotocol/sdk-ethers-v5-adapter": "0.4.3",
|
|
39
|
+
"@cowprotocol/sdk-viem-adapter": "0.3.17"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"deepmerge": "^4.3.1",
|
|
43
|
-
"@cowprotocol/sdk-
|
|
44
|
-
"@cowprotocol/sdk-
|
|
45
|
-
"@cowprotocol/sdk-app-data": "4.
|
|
46
|
-
"@cowprotocol/sdk-order-book": "2.0
|
|
47
|
-
"@cowprotocol/sdk-
|
|
48
|
-
"@cowprotocol/sdk-
|
|
43
|
+
"@cowprotocol/sdk-config": "1.2.0",
|
|
44
|
+
"@cowprotocol/sdk-common": "0.10.1",
|
|
45
|
+
"@cowprotocol/sdk-app-data": "4.7.0",
|
|
46
|
+
"@cowprotocol/sdk-order-book": "2.1.0",
|
|
47
|
+
"@cowprotocol/sdk-contracts-ts": "2.5.0",
|
|
48
|
+
"@cowprotocol/sdk-order-signing": "0.3.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|