2.0.0 • Published 6 months ago

myethmeta v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

JavaScript library for MyEthMeta

Simple, zero dependency library for accessing metadata that is attached to your Ethereum address. For more info, visit https://myethmeta.org/

Installation

Install this package by npm i myethmeta

Get user metadata

const client = new MyEthMetaClient()
const metadata = await client.getMetaData(eth_address)

image.src = metadata.thumbnailUrl // show profile picture

Generate EIP712 signature for metatransaction

const client = new MyEthMetaClient()
const { domain, types, message, metamask_request } = await client.generateDataForSigning(eth_address, metadata_uri)
       

// sign by MetaMask
const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });
let signature = await window.ethereum.request({
    "method": "eth_signTypedData_v4",
    "params": [
        addressMetamask.value,
        metamask_request
    ]
})

// Send the message and the signature to the server side  
// The server will call the contract, and pay the fee
1.0.1

6 months ago

1.0.0

6 months ago

2.0.0

6 months ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago