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

@initia/builder.js

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@initia/builder.js - npm Package Compare versions

Comparing version 0.1.6 to 0.1.8

LICENSE

72

package.json
{
"name": "@initia/builder.js",
"version": "0.1.6",
"version": "0.1.8",
"description": "The JavaScript Move Builder for Initia",
"license": "MIT",
"author": "InitiaLabs",
"author": "Initia Foundation",
"keywords": [

@@ -27,60 +27,42 @@ "cryptocurrency",

"engines": {
"node": ">=14"
"node": ">=18"
},
"scripts": {
"build": "tsc --module commonjs",
"create-hook": "husky add .husky/pre-commit",
"test": "jest",
"format": "prettier --check \"./src/**/*.ts\"",
"format:fix": "prettier --write \"./src/**/*.ts\"",
"lint": "eslint src --ext .js,.ts",
"lint:fix": "eslint src --ext .js,.ts --fix",
"doc": "typedoc",
"prepare": "husky install",
"prepublishOnly": "npm run build"
"lint": "npx eslint . --fix",
"build": "tsc --build",
"test": "jest --no-cache",
"prepare": "husky install"
},
"lint-staged": {
"./src/**/*.ts": [
"npm run lint:fix",
"npm run format:fix"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"post-checkout": "npm i"
}
},
"prettier": {
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "avoid"
},
"devDependencies": {
"@types/ffi-napi": "^4.0.7",
"@types/jest": "^29.0.3",
"@types/jest": "^29.5.12",
"@types/node": "^18.7.18",
"@types/ref-napi": "^3.0.7",
"@types/ref-struct-di": "^1.1.9",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"buffer": "^6.0.3",
"eslint": "^8.23.1",
"husky": "^6.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^8.0.0",
"jest": "^29.0.3",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"lint-staged": "^15.2.10",
"prettier": "^3.1.1",
"process": "^0.11.10",
"ts-jest": "^29.0.1",
"ts-jest": "^29.2.3",
"ts-loader": "^9.4.1",
"ts-node": "^10.9.1",
"typedoc": "^0.23.15",
"typescript": "^4.8.3"
"typedoc": "^0.26.7",
"typescript": "^5.5.3"
},
"dependencies": {
"ffi-napi": "^4.0.3",
"ref-napi": "^3.0.3",
"ref-struct-di": "^1.1.1"
"@eleccookie/ffi-napi": "^0.0.1",
"@eleccookie/ref-napi": "^0.0.2",
"@mysten/bcs": "^1.1.0",
"ref-struct-di": "^1.1.1",
"typescript-eslint": "^7.17.0"
},
"lint-staged": {
"src/**/*.ts": "npx eslint . --fix",
"*.toml": "skip"
}
}

@@ -21,3 +21,6 @@ # initia builder.js

// ex) path.resolve(__dirname, "../relative_path")
const builder = new MoveBuilder(/* path to move package */, {});
const builder = new MoveBuilder(
path.resolve(__dirname, 'moon_coin'), // move package path
{} // build options
);

@@ -28,7 +31,12 @@ // execute move compiler via ffi

// load compiled module bytes as `Buffer`
const compiledModuleBytes = await builder.get(/* module name */);
const compiledModuleBytes = await builder.get(
'moon_coin' // module name
);
console.info(compiledModuleBytes.toString('hex'));
// change module name to what you want
const nameConvertedModuleBytes = await MoveBuilder.convert_module_name(compiledModuleBytes, /* new module name */);
const nameConvertedModuleBytes = await MoveBuilder.convert_module_name(
compiledModuleBytes, // compiled module bytes
'sun_coin' // new module name
);
console.info(nameConvertedModuleBytes.toString('hex'));

@@ -45,8 +53,6 @@ }

async function createAndCleanExample() {
// recommend to use full package path, not relative path
// ex) path.resolve(__dirname, "../relative_path")
const builder = new MoveBuilder(/* path to move package */, {});
const builder = new MoveBuilder(path.resolve(__dirname, 'moon_coin'), {});
// create new move package
await builder.new(/* package name */);
await builder.new('new'/* package name */);

@@ -66,5 +72,5 @@ await builder.build();

async function readExample() {
const builder = new MoveBuilder(/* path to move package */, {});
const builder = new MoveBuilder(path.resolve(__dirname, 'moon_coin'), {});
const binary = await builder.get(/* module name */);
const binary = await builder.get('moon_coin');

@@ -71,0 +77,0 @@ // read module bytes

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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