New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aptos-pfp

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aptos-pfp

## Description

  • 0.0.11
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

aptos-pfp

Description

The Aptos Profile Picture Protocol allows Aptos users to set a single Token-standard NFT as a universal PFP for the Aptos blockchain.

Individual Aptos protocols can use the documentation below both to show PFPs in their FE, and to provide functionality within their own FE to allow users to set a new PFP.

Example

import { AptosClient } from 'aptos';
import { getProfilePicture } from 'aptos-pfp';

const client = new AptosClient('https://fullnode.devnet.aptoslabs.com');
const walletAddress = '0xe4f6a3e6d9735d2c561949090df0a332b648462017d88835e60afed507412e51';

const { isAvailable, url } = await getProfilePicture(client, walletAddress);

API

Get the wallet's profile picture

function getProfilePicture (client: AptosClient, address: string, config: ProfilePictureConfig): Promise<ProfilePicture>
Params
  • client - Aptos client object
  • address - The address of the wallet
  • config (optional)
    • fallback - Boolean, use a fallback generated image (default true)
    • resize - Object with Cloudflare image resize params (default { width: 100 })
Return value

Object with the following fields:

  • isAvailable - Boolean, true if there is a profile picture for the given wallet
  • url - The URL of the profile image, always populated (either a fallback image or an empty-image icon), you can choose to ignore it if isAvailable is false
  • name - NFT name (only if isAvailable: true)
  • address - Owner address
  • tokenId - The NFT token identifier (only if isAvailable: true)

Transaction for setting an NFT for the profile picture

function createSetProfilePicturePayload (tokenId: TokenId): Promise<TransactionPayloadEntryFunction>
Params
  • tokenId - The NFT token identifier
Return value

A entry function transaction payload object

Transaction for unsetting the profile picture

function createUnsetProfilePicturePayload (): Promise<TransactionPayloadEntryFunction>
Return value

A entry function transaction payload object

FAQs

Package last updated on 28 Feb 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc