
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
cosmwasm-vm
Advanced tools
THIS IS STILL UNDER DEVELOPMENT! Contributions are welcome.
NOTE: This was built for Terra-specific applications and thus is only supported for CosmWasm v0.16. However, this implementation probably can be easily adapted to support CosmWasm v1.0+.
This package implements a pure JavaScript (no Rust bindings / WASM needed) VM capable of executing compiled CosmWasm .wasm binaries in environments such as Node.js and compatible web browsers.
Add the cosmwasm-vm
package as a dependency in your package.json
.
npm install -S cosmwasm-vm
or
yarn add cosmwasm-vm
Please refer to the test in this repository for an example. I include a test contract based on cosmwasm/cw-template
that has been augmented with additional ExecuteMsg
variants for testing the various WASM imports.
yarn
yarn test
import { CosmWasmVM } from '../src';
import { readFileSync } from 'fs';
const wasm_byte_code = readFileSync('./cosmwasm_vm_test.wasm');
const vm = new CosmWasmVM(wasm_byte_code);
const mock_env = {
block: {
height: 1,
time: '2000000000',
chain_id: 'columbus-5',
},
contract: {
address: 'contract',
},
};
const mock_info = {
sender: 'sender',
funds: [],
};
describe('CosmWasmVM', () => {
it('instantiates', () => {
let res = vm.instantiate(mock_env, mock_info, { count: 20 });
console.log(res.json);
console.log(vm.store);
});
it('execute', () => {
let res = vm.instantiate(mock_env, mock_info, { count: 20 });
res = vm.execute(mock_env, mock_info, { increment: {} });
console.log(res.json);
console.log(vm.store);
});
});
FAQs
**THIS IS STILL UNDER DEVELOPMENT! Contributions are welcome.**
The npm package cosmwasm-vm receives a total of 3 weekly downloads. As such, cosmwasm-vm popularity was classified as not popular.
We found that cosmwasm-vm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.