Skip to content

Release/v6.4.0 - #709

Merged
unicornonea merged 31 commits into
masterfrom
release/v6.4.0
Jun 29, 2026
Merged

Release/v6.4.0#709
unicornonea merged 31 commits into
masterfrom
release/v6.4.0

Conversation

@unicornonea

Copy link
Copy Markdown
Collaborator

No description provided.

Stan202310 and others added 30 commits June 11, 2026 15:12
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop the disabled #testTronGrid suite, unused SUN_NETWORK/side-chain
settings, and hardcoded test API keys/JWT private key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add transactionBuilder.updateWitness(address, url, options) to build
WitnessUpdateContract transactions for updating an SR's witness url,
mirroring the existing applyForSR (WitnessCreateContract) pattern:

- add WitnessUpdateContract interface and include it in ContractParamter
- add local protobuf serialization (buildUpdateWitness, contract type 8)
- add deserialization support (DWitnessUpdateContract, type map entry)
- add tests for building, broadcasting and deserialization round-trip

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
assertThrow is async; without await the tests passed immediately and a
validation regression would surface as an unhandled rejection instead
of a test failure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tionData

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Port the read/write objects returned by the clients createContract
surface onto the Contract class as lazy getters, including the full
type-level mapping (ContractReadNamespace/ContractWriteNamespace,
ReadContractParameters/WriteContractParameters, IsConstAbi) and the
overload-aware helpers (buildFunctionSelector, overloadArities,
resolveFunctionFragment, isReadOnlyFunctionFragment). Existing
Contract/Method logic is untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Make invokeRead/invokeWrite fully async so argument-count and signer
validation reject the returned promise instead of throwing
synchronously, removing the mixed sync-throw/async-reject surface.
Tests now assert rejections via assertThrow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The token options were built once with saleStart = Date.now() + 100,
so by the second loop iteration the timestamp could already be in the
past and the node would reject the transaction. Reset it per iteration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ce getters

When the ABI defines a function named read or write, the namespace getter
now returns a cached Proxy over the legacy flat call: invoking it preserves
the contract.read(...).call()/send() surface while property access, the in
operator and enumeration are served by the typed namespace. The namespace
types gain the matching flat-call signature for any function named
read/write regardless of mutability, and compile-time assertions plus
runtime tests cover the reserved-name behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Encode UTF-8 with TextEncoder and decode with TextDecoder
- Use existing hex/byte utils (hexStr2byteArray, byteArray2hexStr, getBytes)
  for the hex/ascii/bytes cases that are not UTF-8, preserving exact output
- Remove the webpack Buffer ProvidePlugin (browser polyfill no longer needed)
- Drop the now-unused buffer devDependency

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- axios 1.15.0 -> 1.18.0
- nyc 17.1.0 -> 18.0.0 (dev)
- pin ws to 8.21.0 via overrides

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the Prettify helper from ABI.ts into UtilsTypes.ts so it can be
shared, and wrap ReadOptions/WriteOptions with it for cleaner resolved
type hints.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rework ContractRead/WriteNamespace typing to map ABI function fragments
instead of names, so same-name overloads resolve to TS overload sets
(via UnionToIntersection) rather than merged parameter unions. When a
fragment's inputs are empty, the generated signature drops the `args`
parameter entirely.

- ReadContractParameters/WriteContractParameters/ReadOptions/WriteOptions
  are now keyed by a single FunctionFragment
- wrap the fragment-signature aliases in a trivial conditional so editor
  hover expands them to the resolved call signature instead of the alias
- GetParamsType: empty input tuple resolves to [] instead of any[]
- hoist UnionToIntersection and IsNever into UtilsTypes

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Expose every read/write namespace method under its full function
selector (e.g. read['balanceOf(address)'],
write['transfer(address,uint256)']) in addition to the bare name, with
matching type definitions. The selector form forwards the full
signature to resolveFunctionFragment, pinning that exact fragment, so
same-arity overloads can be addressed unambiguously where the arg-based
path is ambiguous.

Selector keys are enumerable, so namespaces now list each method under
both its bare name and its selector (noted in the 6.4.0 changelog).

Add unit tests covering selector exposure, tuple-expanded selectors,
same-arity overload disambiguation, namespace isolation, and the new
enumerated keys.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
buildFullTypeDefinition now expands bare uint/int (and their array
forms) to uint256/int256, so buildFunctionSelector matches ethers'
format('sighash') and hashes to the same 4-byte on-chain selector. This
removes the divergence where contract.write.foo(...) (new namespace) and
the legacy contract.foo(...).send() targeted different selectors for a
non-canonical ABI. The type-level selector keys are kept in sync via a
mirrored CanonicalizeIntType.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror the reset of `methods` so reloading an ABI clears stale
method instances instead of retaining them across loadAbi calls.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the btoa-based implementation with the project's own Base64
class via encodeIgnoreUtf8, matching the existing idiom in bytes.ts
and removing the dependency on the btoa global.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Normalize the private key in setPrivateKey so a 0x-prefixed key is
stored consistently as a bare hex string.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d `from`

The read/write `account` option is now a private key: its derived address is the caller (read) and owns/signs the transaction (write), enabling a non-default signer and writes on instances with no default key. A non-private-key value is rejected.

Read options add `from`: an explicit caller address (validated as an address). `account` takes precedence when both are given.

Also: a write on an instance with a default address but no default key now fails with the friendly "requires a signer" error instead of a cryptic trx.sign error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Set babel sourceType to 'unambiguous' for the browser (UMD) build. With the
default 'module', babel parsed CommonJS deps such as semver's internal/re.js
as ES modules, so transform-runtime injected ESM helper imports. webpack then
treated those CJS files as harmony modules and wrapped them with the hmd
module decorator, whose module.exports setter throws at runtime, breaking the
UMD bundle on load. 'unambiguous' lets CJS deps stay CJS while ESM source is
still treated as modules.

Also tidy the 6.4.0 CHANGELOG note for address.fromPrivateKey.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ddress

Remove the `account` option from contract reads: the constant-call caller is now resolved from the `from` option or the instance default only. `account` remains a write-only signer private key.

resolveCallerAddress now requires at least one of `from`/default address and throws when neither is set, instead of silently issuing the call from a null (zero) address.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@unicornonea
unicornonea merged commit 3c23529 into master Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants