Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

6551.js

NFT Bound account JS toolkit

6551erc6551jsnft
Published5 May 2023
Direct dependencies2
Transitive dependenciesNot calculated

README

Current package documentation

6551.js

6551.js is a tiny library to help working with Non-fungible Token Bound Accounts. You can read more about them here:

Installation

You'll need to install the 6551.js package and have an instance of ethers.

npm install 6551.js --save

Then import in your project:

const { ethers } = require("ethers");

const ERC6551Registry = require("6551.js");

const provider = new ethers.JsonRpcProvider("https://rpc.ankr.com/eth_goerli");
const Registry = new ERC6551Registry(provider);

Usage

Create an account

This will generate the transaction data needed to deploy an account for a specifi NFT.

const NFT_CONTRACT = "0x5af0d9827e0c53e4799bb226655a1de152a425a5";
const NFT_ID = 1;

let unsignedTX = await Registry.prepareCreateAccount(NFT_CONTRACT, NFT_ID, Registry.DEFAULT_IMPLEMENTATION); // Implementation address and Salt are optional
let pendingTX = await signer.sendTransaction(unsignedTX)

Compute the address of an account

let expectedAddress = await Registry.getAccountAddress(NFT_CONTRACT, NFT_ID); // Implementation address and Salt are optional

Instantiate an account

There is two way to get an instance of an Account. The Account is then used to make calls/get informations.

// From parameters
let Account = await Registry.getAccount(NFT_CONTRACT, NFT_ID);  // Implementation address and Salt are optional

// From a known address
let Account2 = await Registry.getAccountFromAddress("0x324..4323434");

Make a call to an account

You can make a call to an account using prepareExecuteCall. This will generate an unsigned transaction:

// target contract, data, value in wei
let unsignedTX = await Account.prepareExecuteCall("0x324..4323434", "0x", 0); 
let pendingTX = await signer.sendTransaction(unsignedTX)

Getters on account:

let nonce = await Account.owner();
let nonce = await Account.nonce();
let nonce = await Account.isCreated(); // returns if the given account is properly deployed at the address

License and contribution

MIT License, feel free to PR or open new issues.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^16.0.3runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^6.3.0runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-HhFDqTJldYYojodDsbrMqobzmuYpfjzQYfoz6UmMXSF3kthxVYPYCGH9dhatraUZ+077/sRXu95/VAzdr0q2UA==",
  "shasum": "1e98bdca68b52b0d5cf1b8940f2b45dc9108877c",
  "tarball": "https://registry.npmjs.org/6551.js/-/6551.js-1.0.0.tgz",
  "fileCount": 11,
  "unpackedSize": 14536,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIFk9ZcT1eEqXkjYO/OWudQEsgew5EES18vL9tNZVbbbjAiB7leL6deFWpj25o35TQa7COFVutNqUM7vVawjZ6KjoMg=="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkVG74ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNDhAAhUmLcOCd/IZ4ipbTCCNKNdpHysg8zb9TBQv373grqY7cYn5z\r\nCeeyzuYKISKXAUIqF2KKLZj0wT3KSuwTDU4ZtpOMGqqsCEqN5A/2Pbb0ZOXl\r\nDl7TyHOiG812l4NTgmwx9Z4ReuhLwEGPaESnC+Msd83yTYT/fRJaqCOVHVf+\r\npnO06eVvfdHS2A99RLzOLlQJX17EKMP8rHovoDw0glB8sQf54CrU9a/Kvbeo\r\nnTyQlftaPX55l2o7791WxNcZpDbJiFtQ2awjUECgwlG83lEz/wfDtCjKy0kC\r\nL9K/Li4E61rLQ/8mIfE1/jaZ/B3uG3mqtXeRHEdaTsL2zKlcTEzS//5jLdMv\r\ntrdVAPEfekTtnX9gM/jvoRT98BEBbIlT3+ov+q1F9y87BAMZ53ZALGC/BD6Z\r\ncDHT3RdmQfn+x1MwqwzacLk/745HL7RukMO1T6e5ZamDmJqsPNYd0Xgsn6Xw\r\nL+p4lSUjRmiC0Ip+64/FtPjUZyBJvPcgd4rLfNoIrFxr5cyOZine9PZok0jK\r\nQl7Gm6s/BdIwt2AEtJPPWYBw0qiIIp7Y//8WsURMzyzCPP8J5ipANIbhFKGF\r\n/Ar85OgO74u5X8bcCiiMXFOCYDKbGXwWDvOMCBrm0WepCqchJgF3qw43Dwh6\r\nulADSl+vyLxKa5wCdM7WuCdLQaPiX0olrrQ=\r\n=hxCW\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

PENDING
verynifty/6551.js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:47 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:bd007d99554f54dfc4f34a4421838f7ba2340889192dc2dab2b3cf4f672e2a8f

Other collected versions

1.0.26 May1.0.15 MayView all collected versions →