Skip to main content

Schemas

The @erc725/erc725.js library contains a range of standard LSP ERC725 JSON schemas.

Schemas allow erc725.js to know how to decode and encode data written in an ERC725Y smart contract.

A quick reference for keys used in schema definitions can be seen below

Official Documentation.

  • name: An arbitrary name
  • key: The sha3 hash of the name
  • keyType: One of the supported erc725 keyTypes
  • valueType: The type of the content data in store for decoding
  • valueContent: The described content type for parsing

Standard LSP Schemas

The most common schemas of LUKSO Standard Proposals are available under the schemas/ folder.

Current provided LSPs are:

LSP1UniversalReceiverDelegate.json
LSP3ProfileMetadata.json
LSP4DigitalAssetLegacy.json
LSP4DigitalAsset.json
LSP5ReceivedAssets.json
LSP6KeyManager.json
LSP8IdentifiableDigitalAsset.json
LSP9Vault.json
LSP10ReceivedVaults.json
LSP12IssuedAssets.json
LSP17ContractExtension.json

You can import them from:

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

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

// You can retrieve the current loaded schema via
myErc725Contract.options.schemas;