You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,45 @@
1
1
Change Log
2
2
=========
3
3
4
+
__6.4.0__
5
+
6
+
## New Features
7
+
8
+
- Typed `read` / `write` contract namespaces
9
+
10
+
Added contract.read and contract.write namespaces for type-safe, ergonomic access to contract methods. Functions are split by state mutability: view / pure (constant call) functions are exposed under contract.read, while state-changing functions are exposed under contract.write. When an ABI is declared as const, function names and argument types are checked at compile time.
- The write `account` option is a private key: its derived address owns and signs the transaction, so a write can be issued from a non-default signer — including on an instance with no default key. A value that is not a private key is rejected. Treat this value as secret. For reads, a `from` option sets the caller address directly (validated as an address).
14
+
- Validation errors (argument count, signer, call value, account) are surfaced as promise rejections.
15
+
- ABI functions literally named read or write remain callable via the legacy flat surface (handled through a proxy).
16
+
- Each function is additionally exposed under its full selector, e.g. contract.read['balanceOf(address)'] / contract.write['transfer(address,uint256)']. The selector form pins that exact overload, so same-arity overloads can be addressed unambiguously. Note: namespaces now enumerate each method under both its bare name and its selector, so Object.keys / for…in over contract.read / contract.write return two entries per function.
17
+
18
+
- Added `utils.abi.encodeFunctionData`
19
+
20
+
Added utils.abi.encodeFunctionData(funcABI, args) to build smart contract calldata (function selector + encoded parameters). Validates argument count and supports TRON-specific handling of trcToken (kept in the selector, encoded as `uint256`).
21
+
22
+
- Added `transactionBuilder.updateWitness`
23
+
24
+
Added transactionBuilder.updateWitness(address, url, options) to create a WitnessUpdateContract transaction that updates a witness node URL. Validates the address and the URL format / length (≤ 256).
25
+
26
+
## Improvements
27
+
28
+
- Dropped `Buffer` in favor of `TextEncoder` / `TextDecoder`
29
+
30
+
Replaced Buffer`-based encoding in `tronweb, utils/crypto, utils/abi and utils/ethersUtils with TextEncoder / TextDecoder for better cross-environment (browser) compatibility. The conversion is byte-for-byte equivalent to the previous behavior.
TronWeb.address.fromPrivateKey now strips a leading 0x from the private key before deriving the address, so a private key works whether or not it carries the 0x prefix.
35
+
36
+
## Changes
37
+
38
+
- Bump axios from 1.15.0 to 1.18.0.
39
+
- Bump dev dependency nyc to 18.
40
+
- Add overrides for ws (8.21.0) and serialize-javascript (7.0.5) to pin security-patched versions.
41
+
- build now runs the full build:all (esm, cjs, dist).
0 commit comments