Skip to content

Repository files navigation

erc725.js · GitHub licensenpm version

@erc725/erc725.js

Allows for interfacing with ERC725Y compliant contracts on an EVM blockchain.

Tests PassingIssuesGitHub pull requests

For more information see Documentation.

Installation

⚠️This package is currently in early stages of development,
use for testing or experimentation purposes only.
npm install @erc725/erc725.js
import{ERC725}from'@erc725/erc725.js';// Or alternatively the default exportimportERC725from'@erc725/erc725.js';

Example Instantiation

hello

import{ERC725}from'@erc725/erc725.js';importWeb3from'web3';// Part of LSP3-UniversalProfile Schema// https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-3-UniversalProfile.mdconstschema=[{name: 'SupportedStandards:LSP3UniversalProfile',key: '0xeafec4d89fa9619884b6b89135626455000000000000000000000000abe425d6',keyType: 'Mapping',valueContent: '0xabe425d6',valueType: 'bytes',},{name: 'LSP3Profile',key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',keyType: 'Singleton',valueContent: 'JSONURL',valueType: 'bytes',},{name: 'LSP1UniversalReceiverDelegate',key: '0x0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b47',keyType: 'Singleton',valueContent: 'Address',valueType: 'address',},];constaddress='0x3000783905Cc7170cCCe49a4112Deda952DDBe24';constprovider=newWeb3.providers.HttpProvider('https://rpc.l14.lukso.network',);constconfig={ipfsGateway: 'https://ipfs.lukso.network/ipfs/',};consterc725=newERC725(schema,address,provider,config);

Usage

awaiterc725.getOwner();// > '0x28D25E70819140daF65b724158D00c373D1a18ee'awaiterc725.getData('SupportedStandards:LSP3UniversalProfile');/* > { 'SupportedStandards:LSP3UniversalProfile': '0xabe425d6'}*/awaiterc725.getData('LSP3Profile');/* > { LSP3Profile: { hashFunction: 'keccak256(utf8)', hash: '0xd96ff7776660095f661d16010c4349aa7478a9129ce0670f771596a6ff2d864a', url: 'ipfs://QmbTmcbp8ZW23vkQrqkasMFqNg2z1iP4e3BCUMz9PKDsSV' }}*/awaiterc725.fetchData('LSP3Profile');// downloads and verifies the linked JSON/* > { LSP3Profile: { // key of the schema LSP3Profile: { // content of the JSON structure as per https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-3-UniversalProfile.md name: '...', links: [Array], description: "...", profileImage: [Array], backgroundImage: [Array], tags: [Array] } }}*/

Contributing

Please check CONTRIBUTING.

License

erc725.js is Apache 2.0 licensed.

About

Package to interact with ERC725 smart contracts

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages