{"_id":"@atomichub/vert","_rev":"2-b26ba1680c2d1f6110462f3d3b836717","name":"@atomichub/vert","dist-tags":{"latest":"2.3.0"},"versions":{"2.2.0":{"name":"@atomichub/vert","version":"2.2.0","author":{"name":"Jeeyong Um","email":"conr2d@gmail.com"},"license":"MIT","_id":"@atomichub/vert@2.2.0","maintainers":[{"name":"robrigo","email":"rob@atomichub.io"}],"homepage":"https://github.com/atomicassets/vert","bugs":{"url":"https://github.com/atomicassets/vert/issues"},"dist":{"shasum":"305ed15390af6cf5874dcf89687bd16451ccab87","tarball":"https://registry.npmjs.org/@atomichub/vert/-/vert-2.2.0.tgz","fileCount":123,"integrity":"sha512-OZ0ma2u97Vn6H5Vios5Uc16IFME0AHR0aedgru4c2LcBIsNKJIHL2DKLv5OSv09G6Zto+kZv7jjK7dVsc3yTeQ==","signatures":[{"sig":"MEUCIQCIpuPUHOY4HkY3C8h3RVwXRBOLdDrV4vdXbqLSldFdvwIgeCcjty6A4N+YErrFfqkZKWacwshE8BYzk1WfeJgAHXc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":569431},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=20"},"gitHead":"c358aa0e12f14f5db4d50182e3176fdd976723fa","scripts":{"test":"mocha src/**/*.spec.ts -r ts-node/register && yarn --cwd examples","build":"rm -rf dist && tsc","start":"node dist/index","prepack":"npm run build","build-web":"webpack","prepublishOnly":"npm run test"},"_npmUser":{"name":"robrigo","email":"rob@atomichub.io"},"repository":{"url":"git+https://github.com/atomicassets/vert.git","type":"git"},"_npmVersion":"11.16.0","description":"Testing library for Antelope smart contracts, with per-chain host function parity","directories":{},"_nodeVersion":"24.18.0","dependencies":{"chai":"^4.3.6","bn.js":"^5.2.0","colors":"^1.4.0","lodash":"^4.17.21","brorand":"^1.1.0","hash.js":"^1.1.7","js-sha3":"^0.8.0","elliptic":"^6.5.4","loglevel":"^1.8.0","node-rsa":"^1.1.1","json-diff":"^0.9.0","rustbn.js":"^0.2.0","cross-fetch":"^3.1.5","json-diff-ts":"^1.2.4","sorted-btree":"^1.6.0","@ethereumjs/util":"^8.0.0-beta.1","@wharfkit/antelope":"^1.1.1","loglevel-plugin-prefix":"^0.8.4"},"_hasShrinkwrap":false,"devDependencies":{"util":"^0.12.4","mocha":"^10.4.0","tslib":"^2.3.1","buffer":"^6.0.3","ts-node":"^10.5.0","webpack":"^5.69.1","ts-loader":"^9.2.6","typescript":"^4.5.5","@types/chai":"^4.3.11","@types/node":"^20.11.30","webpack-cli":"^4.9.2","@types/mocha":"^10.0.6","@types/elliptic":"^6.4.18","bigint-conversion":"^2.4.3","clean-webpack-plugin":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vert_2.2.0_1787086848566_0.6526399844727244","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@atomichub/vert","version":"2.3.0","homepage":"https://github.com/atomicassets/vert","description":"Testing library for Antelope smart contracts, with per-chain host function parity","keywords":["antelope","eosio","wax","smart-contracts","testing","wasm"],"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"build":"rm -rf dist && tsc","build-web":"webpack","start":"node dist/index","test":"mocha src/**/*.spec.ts -r ts-node/register && yarn --cwd examples install --frozen-lockfile","prepack":"npm run build","prepublishOnly":"npm run test"},"author":{"name":"AtomicHub","url":"https://atomichub.io"},"license":"MIT","publishConfig":{"access":"public","provenance":true},"devDependencies":{"@types/chai":"^4.3.11","@types/elliptic":"^6.4.18","@types/mocha":"^10.0.6","@types/node":"^20.11.30","bigint-conversion":"^2.4.3","buffer":"^6.0.3","clean-webpack-plugin":"^4.0.0","constants-browserify":"^1.0.0","create-hash":"^1.2.0","mocha":"^10.4.0","process":"^0.11.10","randombytes":"^2.1.0","stream-browserify":"^3.0.0","ts-loader":"^9.2.6","ts-node":"^10.5.0","tslib":"^2.3.1","typescript":"^4.5.5","util":"^0.12.4","webpack":"^5.69.1","webpack-cli":"^4.9.2"},"dependencies":{"@ethereumjs/util":"^8.0.0-beta.1","@wharfkit/antelope":"^1.1.1","bn.js":"^5.2.0","brorand":"^1.1.0","chai":"^4.3.6","colors":"^1.4.0","cross-fetch":"^3.1.5","elliptic":"^6.5.4","hash.js":"^1.1.7","js-sha3":"^0.8.0","json-diff":"^0.9.0","json-diff-ts":"^1.2.4","lodash":"^4.17.21","loglevel":"^1.8.0","loglevel-plugin-prefix":"^0.8.4","node-rsa":"^1.1.1","rustbn.js":"^0.2.0","sorted-btree":"^1.6.0"},"resolutions":{"serialize-javascript":"^7.1.0"},"repository":{"type":"git","url":"git+https://github.com/atomicassets/vert.git"},"bugs":{"url":"https://github.com/atomicassets/vert/issues"},"_id":"@atomichub/vert@2.3.0","_integrity":"sha512-qlwH6BjayrsgdsAwn/MIB0g2+kfFnlQ4St55wXfSNkuAciInIJ27+GzDhOGf0WsvvbQ2Y/90CrwPPZTERLeh+w==","_resolved":"/home/runner/work/vert/vert/atomichub-vert-2.3.0.tgz","_from":"file:atomichub-vert-2.3.0.tgz","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-qlwH6BjayrsgdsAwn/MIB0g2+kfFnlQ4St55wXfSNkuAciInIJ27+GzDhOGf0WsvvbQ2Y/90CrwPPZTERLeh+w==","shasum":"f2d569b870484934ae28df09ea89127f4df807e1","tarball":"https://registry.npmjs.org/@atomichub/vert/-/vert-2.3.0.tgz","fileCount":119,"unpackedSize":549820,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atomichub%2fvert@2.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnxOCbdQJgJnTGVEQ8GJYIIZfavKkC+rlpRaFe8vGViAIhALkKk4wiQqPDNUj8BOWSy27aNe0AaVPaoveh92JldDHV"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2678e3d8-ef9d-4476-be93-760993847b6e"}},"directories":{},"maintainers":[{"name":"robrigo","email":"rob@atomichub.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vert_2.3.0_1787336102785_0.8576976733167125"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-18T21:00:48.386Z","modified":"2026-08-21T18:15:03.305Z","2.2.0":"2026-08-18T21:00:48.738Z","2.3.0":"2026-08-21T18:15:02.940Z"},"bugs":{"url":"https://github.com/atomicassets/vert/issues"},"author":{"name":"AtomicHub","url":"https://atomichub.io"},"license":"MIT","homepage":"https://github.com/atomicassets/vert","repository":{"type":"git","url":"git+https://github.com/atomicassets/vert.git"},"description":"Testing library for Antelope smart contracts, with per-chain host function parity","maintainers":[{"name":"robrigo","email":"rob@atomichub.io"}],"readme":"# @atomichub/vert (VeRT)\n\n[![npm version](https://img.shields.io/npm/v/%40atomichub%2Fvert)](https://www.npmjs.com/package/@atomichub/vert) [![CI](https://github.com/atomicassets/vert/actions/workflows/ci.yml/badge.svg)](https://github.com/atomicassets/vert/actions/workflows/ci.yml) [![License](https://img.shields.io/npm/l/%40atomichub%2Fvert)](LICENSE)\n\n**VM emulation RunTime for WASM-based blockchain contracts**\n\n> `@atomichub/vert` is a maintained fork of [`@waxio/vert`](https://github.com/worldwide-asset-exchange/wax-vert), itself a fork of [`@vaulta/vert`](https://github.com/eosnetworkfoundation/vert), originally written by Jeeyong \"conr2d\" Um. It exists to keep the harness current for contracts that deploy across several Antelope chains, where host functions differ per chain. See [Chain compatibility](#chain-compatibility). MIT throughout, with the upstream copyright notices preserved.\n\nVeRT is a virtual machine emulator for Antelope blockchains.\nIt uses the built-in WebAssembly object in JavaScript, so can be executed on any modern browsers or runtime environments without additional dependencies.\nIt doesn't support the full specification of each blockchain state-machine, but can be used to run and test smart contracts before deployment.\nThe focus of VeRT is on the better compatibility than the performance, so it can be integrated with development pipelines.\n\n- Run and test smart contracts\n- Minimum dependencies (No native wrapper, docker or remote connection)\n- Volatile key-value store with state rollback \n\n## Installation\n\n```shell\nnpm install @atomichub/vert\n```\n\n## Requirement\n\n- WebAssembly binary with exported memory\n- Nodejs v20 or higher (JavaScript runtime with WebAssembly BigInt support)\n\n## Chain compatibility\n\nAntelope chains do not all expose the same host functions, and a harness that offers more than the\ntarget chain will link a contract that the chain rejects at `setcode`. To keep a passing suite\nmeaningful, chain-specific host functions are withheld unless the emulated chain provides them.\n\nA `Blockchain` emulates generic Antelope by default, which exposes no chain-specific host functions.\nName a chain to add the ones unique to it:\n\n```typescript\nconst bc = new Blockchain();                  // generic Antelope\nconst wax = new Blockchain({ chain: 'wax' });  // adds verify_rsa_sha256_sig\n```\n\n`verify_rsa_sha256_sig` exists on WAX and not on EOS, Jungle4, or Vaulta. A contract that imports it\ninstantiates under a `wax` blockchain and fails to instantiate under any other, which mirrors how\n`setcode` accepts it on WAX and rejects it elsewhere. Test WAX contracts that use RSA against a\n`wax` blockchain, and test everything else against the default.\n\nThe chain-specific host functions are declared in `CHAIN_SPECIFIC_HOST_FUNCTIONS`; add an entry\nthere to model a new one.\n\n## Example usage\n\n```typescript\nimport { Blockchain, nameToBigInt, expectToThrow } from \"@atomichub/vert\";\nimport { assert } from \"chai\";\n\n// instantiate the blockchain emulator\nconst blockchain = new Blockchain()\n\n// Load a contract\nconst contract = blockchain.createContract(\n    // The account to set the contract on\n    'accountname', \n    // The path to the contract's wasm/abi\n    // both wasm and abi files should be named yourcontract.wasm and yourcontract.abi\n    'build/yourcontract' \n)\n\n\n// You can clear the tables in the \n// contract before each test\nbeforeEach(async () => {\n    blockchain.resetTables()\n})\n\ndescribe('Testing Suite', () => {\n    it('should do X', async () => {\n        // Create some accounts to work with\n        const [alice, bob] = blockchain.createAccounts('alice', 'bob')\n        \n        // Will call a normal action. \n        // Returns an array of results if the action returns a value (array since inlines can also return values)\n        const result = await contract.actions.youraction([param1, param2]).send();\n        // You can also specify the authorization for the action\n        // .send('alice@active')\n        // default is the contract's account itself with 'active' permission\n        \n        // Will call a normal action, or a readonly action.\n        // Returns a return value from the action, or null (no array)\n        const readonlyResult = await contract.actions.youraction([param]).read();\n\n        // You can get table data from the contract, though readonly actions \n        // are the preferred way to get data from external sources (web apps, apis, etc)\n        const rows = contract.tables.yourtable(\n            nameToBigInt('scope')\n        ).getTableRow(\n            nameToBigInt('primary.key')\n        );\n\n        // if you called 'print' in your contract, you can access the console output\n        // after the action is executed\n        console.log(contract.bc.console);\n\n        // You can verify that an action throws an error\n        expectToThrow(\n            contract.actions.badaction([]).send(),\n            'This will be \"some error\" from inside check(false, \"some error\")'\n        )\n    });\n});\n```\n\n\n\n## Test\n\n```shell\nnpm run test\n```\n\n","readmeFilename":"README.md","keywords":["antelope","eosio","wax","smart-contracts","testing","wasm"]}