Skip to content

Commit c86fb55

Browse files
authored
docs(app-data): updated readme (#725)
* chore(app-data): @cowprotocol/app-data -> @cowprotocol/sdk-app-data * chore(app-data): updated outdated link, added logo
1 parent 0cd79d1 commit c86fb55

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/app-data/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
# @cowprotocol/app-data
1+
<p align="center">
2+
<img width="400" src="https://github.com/cowprotocol/cow-sdk/raw/main/docs/images/CoW.png" />
3+
</p>
4+
5+
# Cow AppData SDK
26

37
AppData schema definitions
48

59
These schemas are used in the data encoded on `appData` field for CowProtocol orders.
610

7-
For more details, check [the docs](https://docs.cow.fi/cow-sdk/order-meta-data-appdata).
11+
For more details, check [the docs](https://docs.cow.fi/cow-protocol/reference/core/intents/app-data).
812

913
## Installation
1014

1115
```bash
12-
pnpm add @cowprotocol/app-data
16+
pnpm add @cowprotocol/sdk-app-data
1317
```
1418

1519
## Usage
1620

1721
```typescript
18-
import { MetadataApi } from '@cowprotocol/app-data'
22+
import { MetadataApi } from '@cowprotocol/sdk-app-data'
1923
import { EthersV6Adapter } from '@cowprotocol/sdk-ethers-v6-adapter'
2024
import { JsonRpcProvider, Wallet } from 'ethers'
2125

@@ -85,7 +89,7 @@ Schemas are exposed as json files, where the version is the file name:
8589
```js
8690
// Getting the version v0.4.0
8791
// If you use TypeScript, enable `resolveJsonModule` in tsconfig.
88-
const schema = require('@cowprotocol/app-data/schemas/v0.4.0.json')
92+
const schema = require('@cowprotocol/sdk-app-data/schemas/v0.4.0.json')
8993

9094
// Now you can for example run validation against a schema
9195
```
@@ -95,7 +99,7 @@ const schema = require('@cowprotocol/app-data/schemas/v0.4.0.json')
9599
There are also type definitions
96100

97101
```js
98-
import { v0_4_0 } from '@cowprotocol/app-data'
102+
import { v0_4_0 } from '@cowprotocol/sdk-app-data'
99103

100104
// Note: this example is
101105
function createAppDataV0_4_0(appCode: v0_4_0.AppCode, metadata: v0_4_0.Metadata): v0_4_0.AppDataRootSchema {
@@ -116,7 +120,7 @@ import {
116120
LATEST_APP_DATA_VERSION,
117121
LATEST_QUOTE_METADATA_VERSION,
118122
LATEST_REFERRER_METADATA_VERSION,
119-
} from '@cowprotocol/app-data'
123+
} from '@cowprotocol/sdk-app-data'
120124
```
121125

122126
### Utils
@@ -126,7 +130,7 @@ _Get appData schema_
126130
To get a schema definition by version
127131

128132
```js
129-
import { getAppDataSchema } from '@cowprotocol/app-data'
133+
import { getAppDataSchema } from '@cowprotocol/sdk-app-data'
130134

131135
const schema = getAppDataSchema('0.1.0')
132136
```
@@ -140,7 +144,7 @@ It'll return an object with a boolean indicating `success` and `errors`, if any.
140144
The version to validate against will be taken from the doc itself.
141145

142146
```js
143-
import { validateAppDataDoc } from '@cowprotocol/app-data'
147+
import { validateAppDataDoc } from '@cowprotocol/sdk-app-data'
144148

145149
let doc = { version: '0.4.0', metadata: {} }
146150

0 commit comments

Comments
 (0)