Skip to content

Commit

Permalink
docs: update schemas page (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugoo authored Apr 6, 2022
1 parent 6d77f67 commit 139d0ac
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions docs/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ sidebar_position: 1.2

# Schemas

The `@erc725/erc725.js` library supports a range of ERC725 specification schemas.
The `@erc725/erc725.js` library contains a range standard [LSP ERC725 JSON schemas](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md).

The below are the schema element definitions supported by and tested
with `@erc725/erc725.js`. There are certainly more possibilities, and even several
nonsensical or redundant possibilities which will not or may not be
supported.
Schemas allow erc725.js to know how to decode and encode data written in an [ERC725Y](https://eips.ethereum.org/EIPS/eip-725) smart contract.

_Quick reference for keys used in schema definitions below see_
[official
Expand All @@ -21,14 +18,28 @@ documentation](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC7
- `valueContent`: The described content type for parsing
- `valueType`: The type of the content data in store for decoding

## LSP Schemas
## Standard LSP Schemas

The most common schemas from LUKSO [LSPs](https://github.com/lukso-network/LIPs/tree/main/LSPs) are available in the [`schemas/`](https://github.com/ERC725Alliance/erc725.js/tree/develop/schemas) folder.
The most common schemas of [LUKSO Standard Proposals](https://github.com/lukso-network/LIPs/tree/main/LSPs) are available under the [`schemas/`](https://github.com/ERC725Alliance/erc725.js/tree/develop/schemas) folder.

Current provided LSPs are:

```
LSP1UniversalReceiverDelegate.json
LSP3UniversalProfileMetadata.json
LSP4DigitalAsset.json
LSP4DigitalAssetLegacy.json
LSP5ReceivedAssets.json
LSP6KeyManager.json
```

You can import them from:

```js
import LSP3 from '@erc725/erc725.js/schemas/LSP3UniversalProfile.json';
import LSP5 from '@erc725/erc725.js/schemas/LSP5ReceivedAssets.json';
// ...

// Later use them on instantiation
const myErc725Contract = new ERC725js(LSP3, address, web3.currentProvider);
```

0 comments on commit 139d0ac

Please sign in to comment.