npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aptpp-js

v1.0.4

Published

AptosPassport js sdk

Downloads

12

Readme

SDK for Aptos Passport (APTPP)

Install

npm install aptpp-js 

or

yarn add aptpp-js

Usage

const { AptDomain } = require('aptpp-js');

// opts format:
//     network : string	             // [optional] Set network 'mainnet' / 'testnet' / 'devnet', default: 'mainnet' 
//     nodeUrl : string              // [optional] Node Url, for example 'https://fullnode.mainnet.aptoslabs.com'
//     contractAddress : string      // [optional] The Mainnet Contract address is '0x0000777821c78442e17d82c3d7a371f42de7189e4248e529fe6eee6bca40ddbb'
				     //            The Testnet or Devnet Contract address is '0x7ce77452da809fbc4ef32596cf2be18ec6f252e1884b4eefa4d4349c2941923e'
//     aptosClientConfig : object    // [optional] Aptos client config

let opts={network:"mainnet"};
let aptdomain=new AptDomain(opts);

Basic

You can using in Promise:

const test_domain = 'test007@apt';
const test_address = '0x5e0c91adbe365dca24d1565b434b04c79e17823a1c6db299ba291fc7e86325e6';	

let { address } = await aptdomain.lookup( test_domain);
console.log( `${test_domain} => ${address}` );

let { domain } = await aptdomain.reverse( test_address );
console.log( `${test_address} => ${domain}` );

let record = await aptdomain.getDomainRecord(test_domain);
console.log( `${test_domain} => ${JSON.stringify(record,null,'  ')}` );

Or you can using at Callback:

aptdomain.lookup(test_domain,(status,address)=>{
	console.log( `${test_domain} => ${address}` );
});

aptdomain.reverse(test_address,(status,domain)=>{
	console.log( `${test_address} => ${domain}` );
});

aptdomain.getDomainRecord(test_domain,(status,record)=>{
	console.log( `${test_domain} => ${JSON.stringify(record,null,'  ')}` );
});

Domain Object

Create a object of domain, get more formated data.

Here is the sample:

// request a domain object by addres or domain 
// if domain not exist , return null
let domainObj = await aptdomain.getDomainObj('test007@apt'); 

if( domainObj ){
	console.log("domainObj.address(): ",        domainObj.address());
	console.log("domainObj.avatar(): ",         domainObj.avatar());
	console.log("domainObj.url(): ",            domainObj.url());
	console.log("domainObj.email(): ",          domainObj.email());
		
	console.log("domainObj.discord(): ",        domainObj.discord());
	console.log("domainObj.github(): ",         domainObj.github());
	console.log("domainObj.reddit(): ",         domainObj.reddit());
	console.log("domainObj.twitter(): ",        domainObj.twitter());
	console.log("domainObj.telegram(): ",       domainObj.telegram());

	console.log("domainObj.record('APT'): ",    domainObj.record('APT'));
	console.log("domainObj.record('ETH'): ",    domainObj.record('ETH'));
	console.log("domainObj.record('BTC'): ",    domainObj.record('BTC'));
	console.log("domainObj.record('Solana'): ", domainObj.record('Solana'));
}

Also you can check the examples to quickstart.

Requirement

More infomation