@magicblock-labs/magicsvm
v0.2.1
Published
Node.js bindings for MagicSVM. Tests can target both a **base** ledger and an **ephemeral** ledger for [Ephemeral Rollup](https://docs.magicblock.gg/) flows.
Readme
MagicSVM (Node.js)
Node.js bindings for MagicSVM. Tests can target both a base ledger and an ephemeral ledger for Ephemeral Rollup flows.
Docs: docs/. Copyable projects: examples/.
Installation
yarn add @magicblock-labs/magicsvm @magicblock-labs/ephemeral-rollups-sdkimport {
Keypair,
MagicSVM,
Transaction,
toInstruction,
} from "@magicblock-labs/magicsvm";
const svm = new MagicSVM();
svm.sendTransaction(tx); // base
svm.sendTransaction(tx, { target: "ephemeral" });new MagicSVM() loads DLP on base, the Magic program on ephemeral, and ESPL
plus the permission program on both. Ephemeral writes must be delegated.
Ephemeral transactions are fee-free.
Pass SDK keys to Magicsvm as-is. Import Keypair / PublicKey /
Transaction from Magicsvm so they share Magicsvm's web3.js types. Use
toInstruction when adding SDK instructions to a transaction — see
examples/eata/node.
