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

neox-connector

v1.0.1

Published

A library for integrating NeoX and Neo wallets with Ethereum-compatible wallets.

Downloads

20

Readme

neox-connector

neox-connector is a JavaScript library that simplifies the integration of NeoX and Neo wallets with Ethereum-compatible wallets (like MetaMask). It provides functions for connecting to wallets and transferring tokens between NeoX and Neo N3 networks.

Features

  • Connect to EVM wallets over the NeoX network via wallets like MetaMask. (working ✅)

  • Connect to Neo wallets via NeoLine. (working ✅)

  • Transfer tokens seamlessly between NeoX and Neo N3. ( Coming Soon.......to implement this function i could'nt find contract address of neox and neo n3)

Installation

You can install the package via npm:

npm install neox-connector

Usage

1. Connecting to Wallets

To connect to a wallet, use the neoxConnect function:

import { neoxConnect } from 'neox-connector';

async function connectWallet(chain) {
    try {
        const walletDetails = await neoxConnect(chain);
        console.log(walletDetails);
    } catch (error) {
        console.error(error);
    }
}

// Connect to NeoX wallet
connectWallet('neox');

// Connect to Neo wallet
connectWallet('neo');

2. Get Balance from Wallets

To fetch balance from wallet, use the getBalance function:

import { getBalance } from 'neox-connector';

async function checkBalance() {
    const chain = 'neox'; // or 'neo'
    const tokenAddress = '0xYourTokenAddress'; // Token contract address

    try {
        const balance = await getBalance(chain, tokenAddress);
        console.log(`Balance: ${balance}`);
    } catch (error) {
        console.error(error);
    }
}

// Check the balance
checkBalance();

3. Transferring Tokens

To transfer tokens between NeoX and Neo N3, use the neoxTransfer function:

import { neoxTransfer } from 'neox-connector';

async function transferTokens() {
    const fromChain = 'neox'; // or 'neo'
    const toChain = fromChain === 'neox' ? 'neo' : 'neox';
    const amount = '10'; // Amount of tokens to transfer
    const tokenAddress = '0xYourTokenAddress'; // Token contract address
    const recipientAddress = '0xRecipientAddress'; // Recipient address

    try {
        await neoxTransfer(fromChain, toChain, amount, tokenAddress, recipientAddress);
        console.log('Transfer successful!');
    } catch (error) {
        console.error(error);
    }
}

// Perform the transfer
transferTokens();

License

This project is licensed under the MIT License.