myethmeta
v2.0.0
Published
Simple, zero dependency library for accessing metadata that is attached to your Ethereum address. For more info, visit https://myethmeta.org/
Downloads
113
Readme
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