Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codama/nodes-from-anchor

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codama/nodes-from-anchor

Node specifications and helpers for the Codama standard

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
547
increased by162.98%
Maintainers
0
Weekly downloads
 
Created
Source

Codama ➤ Nodes From Anchor

npm npm-downloads

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

Installation

pnpm install @codama/nodes-from-anchor

[!NOTE] This package is not included in the main codama package.

Functions

rootNodeFromAnchor(anchorIdl)

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

// node ./codama.mjs
import { rootNodeFromAnchor } from '@codama/nodes-from-anchor';
import { createFromRoot } from 'codama';
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 Codama IDL.
const codama = createFromRoot(rootNodeFromAnchor(anchorIdl));

Keywords

FAQs

Package last updated on 29 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc