Skip to content

Hugoo/lsp2-parse

Repository files navigation

lsp2-parse

Find LSP-2 ERC725YJSONSchema from key hash.

Example

import { lsp2Parse } from '.';

lsp2Parse('0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5');
/*
{
  name: 'LSP3Profile',
  key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
  keyType: 'Singleton',
  valueContent: 'JSONURL',
  valueType: 'bytes'
}
*/

lsp2Parse([
  '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
  '0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000001',
]);
/*
{
  '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5': {
    name: 'LSP3Profile',
    key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
    keyType: 'Singleton',
    valueContent: 'JSONURL',
    valueType: 'bytes'
  },
  '0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000001': {
    name: 'LSP3IssuedAssets[1]',
    key: '0x3a47ab5bd3a594c3a8995f8fa58d0876c96819ca4516bd76100c92462f2f9dc0',
    keyType: 'Singleton',
    valueContent: 'Address',
    valueType: 'address'
  }
}
*/

LSP-2 ERC725YJSONSchemas

Supported schemas

  • LSP3UniversalProfile (11-30-2021)
  • LSP4DigitalAsset (11-30-2021)
  • LSP5ReceivedAssets (11-30-2021)
  • LSP6KeyManager (11-30-2021)

Contribute

You can add your own schemas in the ./src/schemas/ folder and send a PR.

About

Parse LSP-2 ERC725YJSONSchema key hashes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published