open-index/open-npm huggingface dataset:
npm package: @greymass/abi2core
Description: Library and command line tool to generate @wharfkit/antelope types from Antelope ABI definitions
Latest version: 2.0.1

# @greymass/abi2core

Library and command line tool to generate [@wharfkit/antelope](https://github.com/wharfkit/antelope) types from Antelope ABI definitions.

## Installation

The `@greymass/abi2core` package is distributed as a module on [npm](https://www.npmjs.com/package/@greymass/abi2core).

```
yarn global add @greymass/abi2core
# or
npm install --global @greymass/abi2core
```

## Usage

After installing the abi2core command should be available, it takes Antelope ABI JSON on stdin and outputs @wharfkit/antelope TypeScript Types on stdout.

Example:

```sh
$ cleos -u https://eos.greymass.com get abi eosio.token | abi2core
```

```ts
// generated by @greymass/abi2core

import {Asset, Name, Struct} from '@wharfkit/antelope'

@Struct.type('account')
export class Account extends Struct {
    @Struct.field(Asset) balance!: Asset
}

@Struct.type('close')
export class Close extends Struct {
    @Struct.field(Name) owner!: Name
    @Struct.field(Asset.Symbol) symbol!: Asset.Symbol
}

@Struct.type('create')
export class Create extends Struct {
    @Struct.field(Name) issuer!: Name
    @Struct.field(Asset) maximum_supply!: Asset
}

@Struct.type('currency_stats')
export class CurrencyStats extends Struct {
    @Struct.field(Asset) supply!: Asset
    @Struct.field(Asset) max_supply!: Asset
    @Struct.field(Name) issuer!: Name
}

@Struct.type('issue')
export class Issue extends Struct {
    @Struct.field(Name) to!: Name
    @Struct.field(Asset) quantity!: Asset
    @Struct.field('string') memo!: string
}

@Struct.type('open')
export class Open extends Struct {
    @Struct.field(Name) owner!: Name
    @Struct.field(Asset.Symbol) symbol!: Asset.Symbol
    @Struct.field(Name) ram_payer!: Name
}

@Struct.type('retire')
export class Retire extends Struct {
    @Struct.field(Asset) quantity!: Asset
    @Struct.field('string') memo!: string
}

@Struct.type('transfer')
export class Transfer extends Struct {
    @Struct.field(Name) from!: Name
    @Struct.field(Name) to!: Name
    @Struct.field(Asset) quantity!: Asset
    @Struct.field('string') memo!: string
}
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/antelope-key-encryption
Description: Antelope private key en/decryption library
Latest version: 1.3.0

EOSIO Key Encryption / EEP-8
============================

Specification and reference implementation of EOSIO Key Encryption (EEP-8).

## Installation

The `eosio-key-encryption` package is distributed as a module on [npm](https://www.npmjs.com/package/eosio-key-encryption).

```
yarn add eosio-key-encryption
# or
npm install --save eosio-key-encryption
```

## Usage

```ts
import {decrypt, encrypt} from 'eosio-key-encryption'

const wif = '5JiAW9u8f2bwV2KcQRRt7WYMQnEdXwSxSDX2hnM2EccuX8eAXcP'
const password = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100] // utf-8 "hello world"

encrypt(wif, password).then((encrypted) => {
    console.log(JSON.stringify(encrypted)) // "SEC_K1_8xacaDNEJyzqu1RG4dG7sBwo9QCA24EePExWLPPTBWVDiMo6BpAw7DHq"
})

decrypt('SEC_K1_8xacaDNEJyzqu1RG4dG7sBwo9QCA24EePExWLPPTBWVDiMo6BpAw7DHq', password).then((key) => {
    console.log(key.toWif()) // 5JiAW9u8f2bwV2KcQRRt7WYMQnEdXwSxSDX2hnM2EccuX8eAXcP
})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/buoy
Description: Client for buoy message forwarder
Latest version: 1.0.4

buoy-client
===========

Client for buoy message forwarder.

## Installation

The `@greymass/buoy` package is distributed as a module on [npm](https://www.npmjs.com/package/buoy-client).

```
yarn add @greymass/buoy
# or
npm install --save @greymass/buoy
```

## Usage

### Send a message.

```ts
import {send} from '@greymass/buoy'

await send('hello', {service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})
```

### Receive a message.

```ts
import {receive} from '@greymass/buoy'

const message = await receive({service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})
```

### Listen for a continuous stream of messages.

```ts
import {Listener} from '@greymass/buoy'

const listener = new Listener({service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})

listener.on('message', (message) => {
    console.log('message', message)
})

// make sure to subscribe to the error event or they will be thrown
listener.on('error', (error) => {
    console.warn('listener error', error)
})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/create-account
Description: An account creation library for Antelope chains that leverages Anchor.
Latest version: 1.1.0

Create Account Library
=======

This library allows you to prompt the user to create and initialize an account using Anchor.

## Installation

The `@greymass/create-account` package is distributed as a module on [npm](https://www.npmjs.com/package/@greymass/create-account).

```
yarn add @greymass/create-account
# or
npm install --save @greymass/create-account
```

## Usage

This function will automatically open a popup window prompting the user to buy an account. Once the payment is received,
the account will be redirected to Anchor with an account creation code. Anchor is then expected to send a confirmation or
error message back before sending the user back to the defined url.

```
import { AccountCreator } from '@greymass/create-account';

// Initialize the account creator object
const accountCreator = new AccountCreator({
  supportedChains: [], // List of supported chains.
  scope: 'wallet', // A string representing the scope of the account creation.
  returnUrl: 'http://wallet.greymass.com', // Url to return the user to once the account is created.
})

// Open a popup window prompting the user to create an account.
accountCreator.createAccount().then((creationResult) => {
  // Handle success, the creationResult will be an esr callback object.
}).catch((error) => {
  // Handle error
})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/eosio-key-encryption
Description: EOSIO private key en/decryption library
Latest version: 1.0.0

EOSIO Key Encryption / EEP-8
============================

Specification and reference implementation of EOSIO Key Encryption (EEP-8).

## Installation

The `eosio-key-encryption` package is distributed as a module on [npm](https://www.npmjs.com/package/eosio-key-encryption).

```
yarn add eosio-key-encryption
# or
npm install --save eosio-key-encryption
```

## Usage

```ts
import {decrypt, encrypt} from 'eosio-key-encryption'

const wif = '5JiAW9u8f2bwV2KcQRRt7WYMQnEdXwSxSDX2hnM2EccuX8eAXcP'
const password = [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100] // utf-8 "hello world"

encrypt(wif, password).then((encrypted) => {
    console.log(JSON.stringify(encrypted)) // "SEC_K1_8xacaDNEJyzqu1RG4dG7sBwo9QCA24EePExWLPPTBWVDiMo6BpAw7DHq"
})

decrypt('SEC_K1_8xacaDNEJyzqu1RG4dG7sBwo9QCA24EePExWLPPTBWVDiMo6BpAw7DHq', password).then((key) => {
    console.log(key.toWif()) // 5JiAW9u8f2bwV2KcQRRt7WYMQnEdXwSxSDX2hnM2EccuX8eAXcP
})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/eosio-resources
Description: Library to assist in EOSIO Resource calculations.
Latest version: 0.9.0

# eosio-resources

## Installation

The `@greymass/eosio-resources` package is distributed as a module on [npm](https://www.npmjs.com/package/eosio-resources).

```
yarn add @greymass/eosio-resources
# or
npm install --save @greymass/eosio-resources
```

## Usage

TODO

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/keycert
Description: Anchor key certificate encoding and decoding library
Latest version: 1.5.0

@greymass/keycert
=================

Anchor key certificate encoding and decoding library for JavaScript.

## Installation

The `@greymass/keycert` package is distributed as a module on [npm](https://www.npmjs.com/package/@greymass/keycert).

```
yarn add @greymass/keycert
# or
npm install --save @greymass/keycert
```

## Usage

```ts
import {generate, decrypt} from '@greymass/keycert'

generate({
    privateKey: '5KYnSy2U9y8Ua1AbWYDQxuEa6Smc9WPtBNsQ6TZRPsZBqFB3AqS',
    account: {actor: 'foobar', permission: 'owner'},
    chainId: '2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840',
}).then(({cert, encryptionWords}) => {
    console.log(String(cert)) // anchorcert:KgKgBT5ajPc6VroP2hHk2S4COKSiqnT8z0bVqRB0aEAAAAAAXHMoXQAAAACAqyanACTh3X6hzLZx-dGsO0swCpi2WDg_Xd8mSK-C2kY_gygHpHe8jNk
    console.log(encryptionWords) // [ 'number', 'arrow', 'twenty', 'permit', 'much', 'caution' ]
})

decrypt(
    'anchorcert:KgKgBT5ajPc6VroP2hHk2S4COKSiqnT8z0bVqRB0aEAAAAAAXHMoXQAAAACAqyanACTh3X6hzLZx-dGsO0swCpi2WDg_Xd8mSK-C2kY_gygHpHe8jNk',
    ['number', 'arrow', 'twenty', 'permit', 'much', 'caution']
).then(({chainId, account, privateKey}) => {
    console.log(String(chainId)) // 2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
    console.log(JSON.stringify(account)) // {"actor": "foobar", "permission": "owner"}
    console.log(privateKey.toWif()) // 5KYnSy2U9y8Ua1AbWYDQxuEa6Smc9WPtBNsQ6TZRPsZBqFB3AqS
})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/keycert-pdf
Description: Pure JS PDF generation for Anchor Owner Key Certificates
Latest version: 1.4.0

@greymass/keycert-pdf
=====================

Pure JS PDF generation for Anchor Owner Key Certificates 🚀

## Installation

The `@greymass/keycert-pdf` package is distributed as a module on [npm](https://www.npmjs.com/package/@greymass/keycert-pdf).

```
yarn add @greymass/keycert-pdf
# or
npm install --save @greymass/keycert-pdf
```

## Usage

```ts
import generate from '@greymass/keycert-pdf'
const cert = .. // KeyCertificate instance obtained from @greymass/keycert
const state = await client.chain.getInfo()
const pdfBytes = await generate({cert, state})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
npm package: @greymass/return-path
Description: A package that detects the proper return path string in a wide range of browsers.
Latest version: 0.0.2

@greymass/return-path
=======

Greymass TypeScript library template, intended for libraries that work in any JavaScript context (node.js, Browser, React native), `@types/node` are installed only for tests, don't rely on any node.js types or imports inside `src/` (no `buffer`, `crypto` imports etc, they can be filled for browser but will bloat the bundle 100x)

## Installation

The `@greymass/return-path` package is distributed as a module on [npm](https://www.npmjs.com/@greymass/return-path/@greymass/return-path).

```
yarn add @greymass/return-path
# or
npm install --save @greymass/return-path
```

## Usage

```
import { detectReturnPath } from '@greymass/return-path';

const returnPath = detectReturnPath();

console.log(returnPath);
// "googlechrome://"

```

```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).