0.22.0 • Published 9 months ago

@kinobi-so/nodes-from-anchor v0.22.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Kinobi ➤ Nodes From Anchor

npm npm-downloads

This package converts Anchor IDLs from various versions into Kinobi IDLs.

Installation

pnpm install @kinobi-so/nodes-from-anchor

!NOTE This package is not included in the main kinobi package.

Functions

rootNodeFromAnchor(anchorIdl)

This function takes a valid Anchor IDL and returns a RootNode.

// node ./kinobi.mjs
import { rootNodeFromAnchor } from '@kinobi-so/nodes-from-anchor';
import { createFromRoot } from 'kinobi';
import { readFileSync } from 'node:fs';
import path from 'path';

// Read the content of your IDL file.
const anchorIdlPath = path.join(__dirname, 'target', 'idl', 'anchor_program.json');
const anchorIdl = JSON.parse(readFileSync(anchorIdlPath, 'utf-8'));

// Parse it into a Kinobi IDL.
const kinobi = createFromRoot(rootNodeFromAnchor(anchorIdl));
0.21.3

9 months ago

0.22.0

9 months ago

0.21.0

11 months ago

0.20.10

11 months ago

0.20.9

12 months ago

0.20.8

12 months ago

0.20.7

1 year ago

0.20.6

1 year ago

0.21.2

11 months ago

0.21.1

11 months ago

0.20.5

1 year ago

0.20.4

1 year ago

0.20.3

1 year ago

0.20.2

1 year ago

0.20.1

1 year ago

0.20.0

1 year ago