JSPM

@metaplex-foundation/shank-js

0.1.7
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 819
  • Score
    100M100P100Q110843F
  • License MIT

Generate IDL files via Anchor or Shank

Package Exports

  • @metaplex-foundation/shank-js
  • @metaplex-foundation/shank-js/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@metaplex-foundation/shank-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

shank-js

Generate IDL files via Anchor or Shank.

Install

npm install @metaplex-foundation/shank-js -D

Usage

Configure your shank.js file.

const path = require("path");
const { generateIdl } = require("@metaplex-foundation/shank-js");

const idlDir = path.join(__dirname, "..", "idls");
const binaryInstallDir = path.join(__dirname, "..", ".crates");
const programDir = path.join(__dirname, "..", "programs");

// From a vanilla Solana program using Shank.
generateIdl({
  generator: "shank",
  programName: "mpl_token_metadata",
  programId: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s",
  idlDir,
  binaryInstallDir,
  programDir: path.join(programDir, "token-metadata"),
});

// From an Anchor program.
generateIdl({  
  generator: "anchor",
  programName: "candy_machine_core",
  programId: "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
  idlDir,
  binaryInstallDir,
  programDir: path.join(programDir, "candy-machine-core"),
});

Generate all IDL configured in the file.

node ./shank.js

See also