{"_id":"@carbonx3/cx3.js","_rev":"2-ed50507954d9470abed3ab807a789880","name":"@carbonx3/cx3.js","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@carbonx3/cx3.js","version":"0.1.0","keywords":["carbonx3","cx3","green-chain","cx3js","cx3wasm","sdk"],"author":{"name":"Mersolution Technology Ltd."},"license":"UNLICENSED","_id":"@carbonx3/cx3.js@0.1.0","maintainers":[{"name":"delphio","email":"erspehlivan@hotmail.com"}],"dist":{"shasum":"097bc0fb1b5e98bee441009266b6a6361235e36c","tarball":"https://registry.npmjs.org/@carbonx3/cx3.js/-/cx3.js-0.1.0.tgz","fileCount":14,"integrity":"sha512-oPJKJ/Zhr0cHfkAlQuPitsStGQo0dXovH2drzu21oa+fxgevx3RL01ujqYQKrR2e47BLJ6YUYkcNrmqnp95A0Q==","signatures":[{"sig":"MEYCIQC60St8VR0NIVO7zwQrQKAMpWGfkIKHKKvVpQw3EB/YpgIhAIzdOYDAoV4w6hULi1e+ICa5uaNMM2oknJzoKmqJqqh+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55410},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.js"}},"scripts":{"test":"node test/unit.test.js","test:live":"node test/live.smoke.js"},"_npmUser":{"name":"delphio","email":"erspehlivan@hotmail.com"},"_npmVersion":"11.4.1","description":"CarbonX3 Green Chain JavaScript SDK (CX3js) - Provider / Wallet / Contract over REST + JSON","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@noble/secp256k1":"^1.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cx3.js_0.1.0_1788700843920_0.570326572579589","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@carbonx3/cx3.js@0.1.1","dist":{"shasum":"7abad5af00e06010f935eb1f10c273a8792683cf","tarball":"https://registry.npmjs.org/@carbonx3/cx3.js/-/cx3.js-0.1.1.tgz","fileCount":14,"integrity":"sha512-uw6xx7gD6AxegBXHV3pYkdWfqq5Fh/wC8LL8h7DhIanSkswF5sw0GpUsH6poGjyIBvA0iEJYdSRbl7aP0UUOIA==","signatures":[{"sig":"MEYCIQC5SN/0xQt7gyB6YL6ISH8iPy7emndwPEsTT0v/g9kmowIhAKXcXJ+qQ7EH3eKyVYl5w4J1MN0LG8Bea0GFgtZMbaq8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFkUUpQvo9DD962ctAQ1voBw7+PZQLaeO+HNHHGROBjVAiEA+dYpvujg14IsGB8II2ZCDqopPhFSBDuh8XGJrtl1qAg="}],"unpackedSize":54742},"main":"index.js","name":"@carbonx3/cx3.js","type":"commonjs","types":"index.d.ts","author":{"name":"Mersolution Technology Ltd."},"engines":{"node":">=18"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.js"}},"license":"UNLICENSED","scripts":{"test":"node test/unit.test.js","test:live":"node test/live.smoke.js"},"version":"0.1.1","_npmUser":{"name":"delphio","email":"erspehlivan@hotmail.com"},"homepage":"https://cx3script.com/docs?doc=cx3js-sdk","keywords":["carbonx3","cx3","green-chain","cx3js","cx3wasm","sdk"],"_npmVersion":"11.4.1","description":"CarbonX3 Green Chain JavaScript SDK (CX3js) - Provider / Wallet / Contract over REST + JSON","directories":{},"maintainers":[{"name":"delphio","email":"erspehlivan@hotmail.com"}],"_nodeVersion":"22.23.2","dependencies":{"@noble/secp256k1":"^1.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cx3.js_0.1.1_1788703019062_0.879291092340287"}}},"time":{"created":"2026-09-06T13:20:43.749Z","modified":"2026-09-06T13:56:59.328Z","0.1.0":"2026-09-06T13:20:44.053Z","0.1.1":"2026-09-06T13:56:59.143Z"},"author":{"name":"Mersolution Technology Ltd."},"license":"UNLICENSED","keywords":["carbonx3","cx3","green-chain","cx3js","cx3wasm","sdk"],"description":"CarbonX3 Green Chain JavaScript SDK (CX3js) - Provider / Wallet / Contract over REST + JSON","maintainers":[{"name":"delphio","email":"erspehlivan@hotmail.com"}],"readme":"# @carbonx3/cx3.js\n\nOfficial **Node.js** client (**CX3js**) for [CarbonX3 Green Chain](https://carbonx3.com/).\n\nTalks to the node over **REST + JSON** (`/api/v1/...`) with named method params.\n\nThe **browser** client is the **CX3 IIFE**: `<script src=\"cx3.min.js\"></script>` (`window.cx3`). Do not `require` this package in a page.\n\n| Export | Role |\n|--------|------|\n| `Cx3Provider` | HTTP client (`{node}/api/v1`) |\n| `Cx3Wallet` | secp256k1 signing (deploy / send / native CX3) |\n| `Contract` / `provider.getContract` | ABI-bound calls |\n| `Cx3TokenFactory` | Standard deploys (CX30–CX3192, CX337–CX341) |\n\n## Install\n\n```bash\nnpm install @carbonx3/cx3.js\n```\n\nNode.js **18+** (native `fetch`).\n\n## Quick start\n\n```javascript\nconst { Cx3Provider, Cx3Wallet, Cx3TokenFactory } = require(\"@carbonx3/cx3.js\");\n\nconst provider = new Cx3Provider(\"https://your-green-chain-node\");\nconst wallet = new Cx3Wallet(process.env.CX3_PRIVATE_KEY, provider);\n\nconst token = await provider.getContract(process.env.CONTRACT_ADDRESS, null, wallet);\nconst balance = await token.balanceOf(wallet.address);\n\nconst tx = await token.transfer(\"0xRecipient…\", \"1000000000000000000\");\nawait tx.wait();\n\nconst factory = new Cx3TokenFactory(wallet);\nconst deployed = await factory.deployCX30({\n  name: \"My Token\",\n  symbol: \"MTK\",\n  initialSupply: \"0\",\n  target: \"CX3WASM\"\n});\nconsole.log(deployed.contractAddress);\n```\n\n## Connect\n\n**1. Green Chain node (usual case)** — pass the node URL only. No username, password, or API key.\n\n```javascript\nconst provider = new Cx3Provider(\"https://your-green-chain-node\");\n```\n\n**2. Your own node** — add HTTP Basic **only if that node requires it**. If it does not, skip this and keep option 1.\n\n```javascript\nconst provider = new Cx3Provider(\"https://your-node\", {\n  auth: {\n    user: process.env.CX3_INTERNAL_AUTH_USER,\n    pass: process.env.CX3_INTERNAL_AUTH_PASS\n  }\n});\n```\n\n### Optional wallet API key\n\nLeave unset for **public** access (any wallet). Set a `cx3wk_…` key only to lock this client to that wallet. Never put an API key in browser JavaScript.\n\n## Signing\n\nDigests are **UTF-8 strings**, then `sha256` + **secp256k1**:\n\n- Deploy: `deploy|{owner}|{standard}|{name}|{symbol}|{decimals}|{initialSupply}|{timestamp}`\n- Send: `{contractAddress}|{method}|{JSON.stringify(params)}|{fromAddress}`\n- Owner: `{action}|{address}|{owner}|{timestamp}`\n- Native CX3: `wallet.transferNative(to, amount)`\n\nAddress = `0x` + last 20 bytes of `sha256(uncompressedPublicKey)`.\n\n## ABI-bound methods\n\n1. Standard interface JSON (`methods.balanceOf.type = \"view\"`)\n2. Compiler flat ABI (`[{ type: \"function\", name, inputs, stateMutability }]`)\n\n```javascript\nawait token.balanceOf(owner);\nawait token.transfer(to, amount);\nawait token.call(\"balanceOf\", { account: owner });\n```\n\n## Docs\n\n- [CX3js SDK](https://cx3script.com/docs?doc=cx3js-sdk)\n- [CarbonX3 Green Chain](https://carbonx3.com/)\n\n## License\n\nUNLICENSED — Mersolution Technology Ltd.\n","readmeFilename":"README.md","homepage":"https://cx3script.com/docs?doc=cx3js-sdk"}