@carbonx3/cx3.js 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -179,7 +179,7 @@ Token symbols are capital letters `A-Z` and digits `0-9` only. The SDK checks th
179
179
 
180
180
  A private token is sent, received and seen only by its owner and its authorized wallets. The token contract enforces this on the chain, and the SDK follows the same rules:
181
181
 
182
- - **Lists:** `getTokens` shows a private token only to its owner, its authorized wallets and its holders; `listContracts()` shows it only when the application's wallet is its owner or an authorized wallet. Its holders and raw state answer `403 PRIVATE_TOKEN` to every application except the owner's.
182
+ - **Lists:** `getTokens` shows a private token only to its owner, its authorized wallets and its holders, and only with that wallet's own signed proof (header `X-CX3-Wallet-Proof`, since 2026-10-19; CX3Wallet sends it for its own lists), so an application gets the public tokens; `listContracts()` shows it only when the application's wallet is its owner or an authorized wallet. Its holders and raw state answer `403 PRIVATE_TOKEN` to every application except the owner's.
183
183
  - **Sends:** before a `transfer`, `transferFrom` or `mint` of a private token, the wallet asks the token whether both ends are authorized. If one is not, it throws `PRIVATE_TOKEN_SENDER` or `PRIVATE_TOKEN_RECIPIENT` instead of signing a send the block would refuse. `{ privateCheck: false }` skips the check.
184
184
  - **Checks:** `provider.isPrivateToken(token)` and `provider.isTokenAuthorized(token, wallet)`, which returns `true` for the owner or a listed wallet, `false` otherwise and `null` when the node does not answer.
185
185
 
@@ -242,7 +242,7 @@ try {
242
242
 
243
243
  ## Browser applications
244
244
 
245
- This package is for Node.js servers. Web pages use the **CX3 IIFE** (`window.cx3`) together with the CX3Wallet extension: [`@carbonx3/cx3-iife`](https://www.npmjs.com/package/@carbonx3/cx3-iife) on npm and jsDelivr, or [download it](https://cx3script.com/download/cx3-0.2.0.min.js); see the [CX3 IIFE guide](https://cx3script.com/docs?doc=cx3iife). Keep the application's credentials on your server behind a same-origin proxy, and never put a client secret, an API key or a private key in browser JavaScript.
245
+ This package is for Node.js servers. Web pages use the **CX3 IIFE** (`window.cx3`) together with the CX3Wallet extension: [`@carbonx3/cx3-iife`](https://www.npmjs.com/package/@carbonx3/cx3-iife) on npm and jsDelivr, or [download it](https://cx3script.com/download/cx3-0.2.7.min.js); see the [CX3 IIFE guide](https://cx3script.com/docs?doc=cx3iife). Keep the application's credentials on your server behind a same-origin proxy, and never put a client secret, an API key or a private key in browser JavaScript.
246
246
 
247
247
  ## Environment variables
248
248
 
@@ -258,7 +258,7 @@ Type declarations (`index.d.ts`) ship with the package.
258
258
 
259
259
  ## Upgrading from 0.2.x
260
260
 
261
- Version 0.3.0 signs native transfers for the network's new signing format (0.3.1 and 0.3.2 change only this README and the file headers, not the code):
261
+ Version 0.3.0 signs native transfers for the network's new signing format (0.3.1 to 0.3.4 change only this README, the file headers and comments, not the code):
262
262
 
263
263
  - **The genesis hash is signed.** `transferNative` asks the network for its chain id and genesis hash (`provider.getChainIdentity()`) unless both are given as `opts.chainId` and `opts.genesisHash`. 0.2.x transfers no longer verify on the chain.
264
264
  - **No fallback chain id.** `buildTransferPayload` throws `NO_CHAIN_IDENTITY` without `chainId` and `genesisHash`; the `CX3_CHAIN_ID` variable and the `chainIdBind` option are gone.
@@ -285,4 +285,4 @@ CX3js is in beta (0.x), so a minor version may contain breaking changes. Version
285
285
 
286
286
  ## License
287
287
 
288
- `UNLICENSED`: proprietary software of Mersolution Technology Ltd. Use is subject to the [CX3Script Terms of Use](https://cx3script.com/terms).
288
+ `UNLICENSED`: proprietary software of Mersolution Technology Ltd. Use is subject to the [CX3Script Terms of Use](https://cx3script.com/terms) (item 03): you may install it and ship it unmodified with applications, including commercial ones, that connect to CarbonX3 Green Chain; you may not modify it, sell or republish it on its own, or use it with other networks.
package/index.js CHANGED
@@ -33,7 +33,7 @@ const {
33
33
  } = require("./src/crypto");
34
34
  const { normalizeAbi, argsToParams } = require("./src/abi");
35
35
 
36
- const VERSION = "0.3.2";
36
+ const VERSION = "0.3.4";
37
37
 
38
38
  /**
39
39
  * Convenience: provider from `options.url` or env `CX3_NODE_URL` — the CX3Api gateway
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbonx3/cx3.js",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Official Node.js SDK (CX3js) for CarbonX3 Green Chain: OAuth2 app access, local secp256k1 signing, ABI-bound contracts and token deploys over REST + JSON",
5
5
  "homepage": "https://cx3script.com",
6
6
  "publishConfig": {
package/src/utils.js CHANGED
@@ -71,7 +71,7 @@ function toJsonSafe(value) {
71
71
  }
72
72
 
73
73
  /**
74
- * Same rules as AppSmokeTest `cx3_dapp_key_mode`:
74
+ * Same rules as DappsExamples/CX3AssetDashboard `cx3_dapp_key_mode`:
75
75
  * empty → public (any wallet); valid cx3wk_ → private (that wallet); else invalid.
76
76
  */
77
77
  function walletApiKeyMode(key) {