ERC725.js
This library allows for interfacing with ERC725Y compliant contract on an EVM using the ERC725YJSONSchema.
For more information see Documentation.
This package is currently in early stages of development, use only for testing or experimentation purposes
Installation
npm
$ npm install erc725.js
import ERC725 from "erc725.js";
import { ERC725 } from "erc725.js";
Example Instantiation
let myERC725Address = "0x0c03fba782b07bcf810deb3b7f0595024a444f4e";
let myProvider = new Web3.providers.HttpProvider("https://rpc.l14.lukso.network");
const mySchema = [
{
name: "SupportedStandards:ERC725Account",
key: "0xeafec4d89fa9619884b6b89135626455000000000000000000000000afdeb5d6",
keyType: "Mapping",
valueContent: "0xafdeb5d6",
valueType: "bytes",
},
{
name: "LSP3Profile",
key: "0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5",
keyType: "Singleton",
valueContent: "JSONURL",
valueType: "bytes",
},
{
name: "LSP1UniversalReceiverDelegate",
key: "0x0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b47",
keyType: "Singleton",
valueContent: "Address",
valueType: "address",
},
];
let myERC725 = new ERC725(schema[, address, provider, ipfsGateway])
Usage
await erc725.getOwner();
await erc725.getData("SupportedStandards:ERC725Account");
await erc725.getData("LSP3Profile");
await erc725.fetchData("LSP3Profile");
Bundling for typescript
$ npm run build
This will build the library into /lib
Testing
$ npm test
Publishing
$npm run build-publish
Will build and then publish the package to npm.