Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
arweave-id
Advanced tools
This library serves an easy to use developer's interface to arweave-id. Arweave-id is an identity service for the permaweb a.k.a. Arweave open web. This library encapsulates, enforces, and abstracts away arweave-id rules, for example, to prevent name masq
This library serves an easy to use developer's interface to arweave-id. Arweave-id is an identity service for the permaweb a.k.a. Arweave open web. This library encapsulates, enforces, and abstracts away arweave-id rules, for example, to prevent name masquerading.
For an example of an app using this library, see the companion repo arweave-id-v2-ui
For more information about Arweave see https://arweave.org
Install using npm install arweave-id
then do
import Arweave from 'arweave'
import { get } from 'arweave-id'
const arweave = Arweave.init({})
const userAddress = 'aoaJNC8NcKVfgwaUj6kyJi2hKrVGUsRHCGf8RhKnsic'
// then inside an async function:
let arId = await get(userAddress, arweave)
console.log(arId.name) // 'Testy Mc Testface'
interface ArweaveId {
name: string // username
url?: string // an optional http link for the user
text?: string // optional freeform text
avatarDataUri?: string // optional data URI containing the user's avatar. Supports base64 'image/jpeg', 'image/png', and 'image/gif'
}
get(address: string, arweaveInstance: Arweave): Promise<ArweaveId>
Looks up the ArweaveID associated with a given Arweave address and returns all available data elements
Parameters
address
- string
: a string representing an Arweave addressarweaveInstance
- Arweave
: an arweave
object generated from the arweave
packageReturns
Promise
that resolves to an ArweaveId
interface object representing the ArweaveID attributes associated with the address
set(arweaveIdData: ArweaveId, jwk: JWKInterface, arweaveInstance: Arweave ): Promise<ISetReturn>
Creates, signs, and submits an arweave-id transaction claiming ownership of the ArweaveId provided.
arweaveIdData
- ArweaveId
: an ArweaveId
object to be written to the permaweb.jwk
- JWKInterface
: the user's arweave wallet JWKarweaveInstance
- Arweave
: an arweave
object generated from the arweave
packagePromise
that resolves to an ISetReturn
object
txid
- string
- The transaction ID generated for the transaction. Treat this txid like you would for any other arweave transaction. N.B. This will be a blank string if the data cannot be posted.statusCode
- number
- The HTTP status code received back from the Arweave node (e.g. 200 if transaction successfully posted)statusMessage
- string
- The status message associated with the HTTP status code response (e.g. 'OK' if transaction successfully posted)check(name: string, arweaveInstance: IArweave): Promise<string>
Look up an arweave-id name to see if it's available, returns an empty string ''
or the owners address.
name
- string
- The ArweaveID to be looked uparweaveInstance
- Arweave
: an arweave
object generated from the arweave
packagePromise
that resolves to a string
representing the address of the wallet that owns the ArweaveID name
or blank string if name is available
getIdenticon(name: string): string
This function is provided as a method of generating an avatar for the user. Example usage, when the optional avatar has not been set.
name
- a string to generate an identicon forA data URI containing the indenticon image. This can be directly set to an img
tag's src
property. For reference, the data URI format is a base64 encoded PNG, of dimensions 64x64 pixels.
FAQs
This library serves an easy to use developer's interface to arweave-id. Arweave-id is an identity service for the permaweb a.k.a. Arweave open web. This library encapsulates, enforces, and abstracts away arweave-id rules, for example, to prevent name masq
The npm package arweave-id receives a total of 0 weekly downloads. As such, arweave-id popularity was classified as not popular.
We found that arweave-id demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.