From 139d0ac54481c550383659e1031c59814217f8a7 Mon Sep 17 00:00:00 2001 From: Hugo Masclet Date: Wed, 6 Apr 2022 11:18:21 +0200 Subject: [PATCH] docs: update schemas page (#129) --- docs/schemas.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/schemas.md b/docs/schemas.md index 776455f8..31951e31 100644 --- a/docs/schemas.md +++ b/docs/schemas.md @@ -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 @@ -21,9 +18,20 @@ 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: @@ -31,4 +39,7 @@ You can import them from: 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); ```