This package has been deprecated

Author message:

This repository has been moved to @CityOfZion/neon-dappkit. Which has the same classes and methods, making migration very easy.

@cityofzion/neon-invoker
TypeScript icon, indicating that this package has built-in type declarations

1.7.0 • Public • Published

Neon-Invoker - A Neo3-Invoker implementation using Neon-JS
Made with by COZ.IO

Neon-Invoker

Install

npm i @cityofzion/neon-invoker

Initialize NeonInvoker

To use NeonInvoker as a Neo3Invoker you can simply call NeonInvoker.init and pass the NeonInvoker instance to the SDK that requires a Neo3Invoker.

To sign the transactions you should pass an account to the NeonInvoker.init method. You can use the Account class from @cityofzion/neon-core to create an account.

import { NeonInvoker } from '@cityofzion/neon-invoker'
import { default as Neon } from '@cityofzion/neon-js'

const account = Neon.create.account('NKuyBkoGdZZSLyPbJEetheRhMjeznFZszf')

const neonInvoker: Neo3Invoker = await NeonInvoker.init({
  rpcAddress: NeonInvoker.MAINNET,
  account,
})

You can also pass an signingCallback to the NeonInvoker.init method. It should return a Promise of signature string. See here an example implementation of ledger signature.

If you don't want to sign, simply don't pass an account.

import { NeonInvoker } from '@cityofzion/neon-invoker'

const neonInvoker: Neo3Invoker = await NeonInvoker.init({
  rpcAddress: NeonInvoker.MAINNET,
})

You can also pass a custom RPC endpoint to the NeonInvoker.init method.

Another example of initialization is:

const neonInvoker: Neo3Invoker = await NeonInvoker.init({
  rpcAddress: 'http://127.0.0.1:5001',
  account,
})

Usage

The usage of NeonInvoker is documented in the Neo3-Invoker Docs.

Readme

Keywords

none

Package Sidebar

Install

npm i @cityofzion/neon-invoker

Weekly Downloads

24

Version

1.7.0

License

MIT

Unpacked Size

37.6 kB

Total Files

8

Last publish

Collaborators

  • ethanfast
  • hal0x2328
  • lllwvlvwlll
  • melanke
  • rockacola
  • snowypowers