All notable changes to casper-js-sdk.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Backfilled missing variants of
TransformValue
type (AddInt32|AddUInt64|AddUInt128|AddUInt256|WriteEraInfo|WriteBid|WriteWithdraw|Failure|WriteUnbonding) - Backfilled
operations
field inEffect
type - Exported all types in
services/types
module so that they can be used by end users
- invalid seed usage in the HDKey (#410)
newTransferWithOptionalTransferId
now usesPublicKey
as a target instead ofAccountHash
.- Fixed implementation of
EventStream
. Previous one had problems when there was two events emmited at the same time - Fixed imports problem in modern TS environment
2.15.3 - 2023-10-16
- Replace legacy
sendAsync
withrequest
(#373)
- Reintroduced
getStateRootHash
fix as its not specific forcasper-node 1.5
(#339)
- Reverted broken 1.4.x compatibility. The version compatible with protocol version 1.5.x will be released as a separate one. (#351)
checkApproval
optional parameter (false
by default) to thedeploy
method ofCasperServiceByJsonRPC
class. (#348)
waitForDeploy
method ofCasperServiceByJsonRPC
class now supports deploy hash in string
2.14.0 - 2023-7-11
StoredValue
TypedJSON serialization issue. (#312)
-
Added
BaseSigner
class for further wallet & signer integrations, supportCasperWallet
. (#300) -
Support node URL without
/rpc
likecasper-client
does. (#298) -
Added
to
field to theTransferJson
. (#312)
- Fixed to support 64 bytes Ed25519 private key generated using v2.10
- Fix for wrong signatures being generated for SECP256K1 keys - it was missing
der: false
setting in a function call
- New method
makeDeployWithAutoTimestamp
that fetches timestamp and then uses it to create deploy header. Recommended to use it in browsers env.
- Added
getEraSummary
- Added
getEraSummaryByBlockHeight
- Added Ed25519 HD Wallet support
- Added
timeout
param to all CasperServiceByJsonRPC methods - Deterministic Asymmetric keys can be generated by using HD Wallet following BIP-0032
- Switched from
tweetnacl-ts
andeccrypto
tonoble
libraries
- Fix in CI job that broke README.md attached to NPM Package and tgz archive to the release
- Fix links to the examples in docs
- HTTPS Event stream without breaking browsers support
- New docs generator
- Add missing types for
ExecutionResult
- Added missing CLType
Any
- Added tests in browser env
- Added source maps to build version
- Move generated docs to github pages
- Support for HTTPS/HTTP2 EventStream - as it caused problems in browser environment
- Support for checksumed mixed-case publickeys
- Support for HTTPS EventStream
- Extended test cases for
CasperServiceByJsonRPC
CLPublicKey.toHex()
now by default returns checksummed value. You can use it in legacy mode by calling itCLPublicKey.toHex(false)
that wayCLPublicKey.fromHex()
now can get two arguments. The first one is string containing hex encoded public key, and the second one is a boolean value that indicates if you want to run checksum validation. Whentrue
is passed it will throw an error. Otherwise it will log warn to the console. We added this because we want to support users who store the non-checksumed publickeys and need time to adaptAccountHash
now can be serialized to bytes (it's an alias)- Some internal optimalization (in
matchByteParserByCLType
)
- Issues with parsing broken deploys
- Updated ts-results dependency of our own fork to fix some compiling issues
- Updated exports so more conversion fuctions are now public
- Added typings to
JsonExecutableDeployItem
- Fixed how the
EventStream
URL is build - Replaced
ts-results
dependency for our own fork because of the conflicting config
- Added signatures verification in
validateDeploy
method. - Added
queryBalance
(will be supported in casper-node 1.5 - RPC namequery_balance
) method inCasperServiceByJsonRPC
. - Added
speculativeDeploy
(will be supported in casper-node 1.5 - RPC namespeculative_exec
) method inCasperServiceByJsonRPC
. - Better documented RPC methods .
- Added
csprToMotes
- motes/cspr converter inConversions
. - Extended PublicKey class API with two new methods, allowing to get publicKey tag type or its corresponding signature algo type.
getStateRootHash
(RPC namechain_get_state_root_hash
) can now correctly supportblock_hash
argument.
- Got rid of unnecessary instanceof.
- Reverted StoredValue and added
{ rawData: boolean }
togetDictionaryItemByName
andgetDictionaryItemByURef
.
- Now all stored value contains raw JSON from RPC under
raw
key. - New method
getValidatorsInfoByBlockHeight
added.
targetPublicKeyHex
is now optional inSigner
class.
- Added support to
CLPublicKey
passed as argument toCLKey
(it gets serialized toaccount-hash
when serializing). - New
Contracts
class that basically acts as contract client (possible to install WASM, call an entrypoint, query state or dictionary). - Added
getDictionaryItemByName
that usesstate_get_dictionary_item
withdictionary_name
anddictionary_item_key
- Added
sign
andsend
method onDeploy
class.
- Fixed problems with CLResult when it got created using different version of ts-results.
- Fixed problems with deserialization Tuples containing CLType which includes length parameter (eg. CLByteArray).
- Version 2.0 is now @latest.
- README updated.
- Fixes wrong logic in newTransferWithOptionalTransferId() method.
- Fixes problems with Lists containing multiple Keys containing Hash or ByteArray.
- Fixes problem with ByteArray with size different than 32 bytes.
- Fixes problems with
getBlockInfo
and mixed case block hashes.
- Added types missing in OpenRPC library
- Fix for bundling all of the existing types defined in the library.
- Added support for mixed case hex representation of public keys introduced in
casper-node
1.4.2
.
- Now
target
in transfer is represented byPublicKey
instead ofaccount-hash
.
- Now minimal bundle without any polyfills included is a part of distribution package.
- Added workaround for historical deploys with invalid serialized
0
.
- Added
CasperProvider
- Problem when serializing U128, U256 ad U512
toBytes
.
- Added stronger validation to
PublicKey.fromHex
method - Fix for deploy's
execution_result
type signatures - Fix instanceof problem in
CLValueParser
which caused problems when two different versions of SDK was used in one project - Signer methods fixes
signMessage
- added method to sign arbitrary string messageverifyMessageSignature
- added method to verify signature of arbitrary string message
EventStream
- fixed problems with multiple data chunks parsing
DeployWatcher
added
state_get_dictionary_item
with URef support ingetDictionaryItemByURef
implemented
StoredValue
parsing access param hotfixed
CLMap
fix for empty maps from bytesCLMap
replaced problematic Map implementation
EventStream
now properly handle invalid JSONs
EventStream
added
state-get-item
due to RPC changesCLList
as empty list initialization from JSON
getBlockTransfers
,getEraInfoBySwitchBlock
,getEraInfoBySwitchBlockHeight
methods toCasperServiceByJsonRPC
DeployUtil.deployFromJson
returns nowResult<Deploy, Error>
instead ofDeploy | undefined
.Error
has amessage
inside.
- Caution! This release contains rewritten CLValue from scratch, there are some breaking changes so consider it before upgrading.
- Removed
CLTypedAndToBytesHelper
to have consistent way of creating new CLValues by usingnew CLBool(true)
orCLValueBuilder.bool(true)
- Removed
CLTypeHelper
have consistent way of creating new CLValues by usingnew CLBoolType()
orCLTypeBuilder.bool()
CLValue
static methods now are moved toCLValueBuilder
eg.CLValueBuilder.u512
- Every class inheriting from
CLValue
is now named withCL
prefix, bigger naming changes:StringValue
->CLString
KeyValue
->CLKey
MapValue
->CLMap
Option
->CLOption
- There are API changes in
CLResult
const myTypesComplex = {
ok: new CLListType(new CLListType(new CLU8Type())),
err: new CLOptionType(new CLListType(new CLListType(new CLU8Type())))
};
const myOkComplexRes = new CLResult( Ok(new CLList([new CLList([new CLU8(5), new CLU8(10), new CLU8(15)])])), myTypesComplex );
- There are API changes in
CLOption
- now it requiresSome
orNone
wrappers as argument (fromts-result
library). - Now all the serialization methods are not connected to
CLValue
anymore -toJSON
,fromJSON
,toBytes
,fromBytes
needs to be called withCLValueParsers
eg.CLValueParser.toJSON(CLValueBuilder.string("ABC"))
- Renamed methods in
CLPublicKey
:toAccountHex
->toHex
- old name led to misunderstandings as in fact this is hex representation ofpublic-key
prefixed with key-type.- added method
toAccountHashStr
- this methods returns string containing account hash in hex form prefixed withaccount-hash-
.
- Experimental release with
@next
tag.
- Changed repo name and npm package name from
casper-client-sdk
tocasper-js-sdk
.
newTransferWithoutObligatoryId
renamed tonewTransferWithOptionalTransferId
newTransferWithoutObligatoryId
restores the function that gives abilitity to send transfer without providing id.
Signer.sign
now requires deploy in JSON format,public-key hex
of a sender andpublic-key hex
of a target.
Signer.getVersion
returns running version of Signer.
Keys.SECP256K1.new()
and other SECP256K1 releated methods now can work in a browser environment.
DeployUtil.deployToBytes(deploy)
returns anUint8Array
, which is a byte representation of a deploy.
- Added
newTransferToUniqAddress
andUniqAddress
. - Fix in
newTransfer
-id
now can be0
- Removed EventStore from codebase.
CasperClient.getDeployByHashFromRPC
is nowCasperClient.getDeploy
.- Fixed problems with
deployFromJson
caused by missing support for deserialization TTL values other thanms
.
- BIP-44 Index changed from
748
to506
. It follows https://github.com/satoshilabs/slips/blob/master/slip-0044.md. All secret and public keys dervied usingCasperHDKey
class will change.
transfer-id
is required parameter inDeployUtils.newTransfer
.
- Support
disconnectFromSite
method from the Signer.
- Missign interface for
getActivePublicKey
method from the Signer.
- Support
getActivePublicKey
method from the Signer.
DeployUtils.deployFromJson
verifiesDeploy
'shash
andbodyHash
. If not matching returnundefined
, so the interface doesn't change.
- New url for docs.
- Reverted usage of
TextEncoder
to support Node.js versions < 11.
- Problem with U32 deserialization (and all values that uses Buffer polyfill).
- Changed the default
Deploy
's ttl from 1h to 30min.
- Fixed Delegator interface shape
- Validate the size of the
Deploy
. NowCasperServiceByJsonRPC.deploy
throws an error if the size of the deploy is larger then 1 megabyte.`
- Problems with Buffer polyfill not working in browser
CasperServiceByJsonRPC.getBlockInfoByHeight(height)
CasperServiceByJsonRPC.getBlockInfo(hash)
to return requested block, not the last one.
- Added UMD bundle into npm package.
- Adds
protocol_version
to theJsonHeader
.
- Fixes
ValidatorInfoResult
for casper-node ^0.9.0 (createsAuctionState
interface).
- Removes use of
Buffer
inparseKeyPair()
and instead creates newUint8Array
concatenating public and private keys for use as secret key in Ed25519 key pair.
- Parsing
ExecutableDeployItem
'sStoredContractByHash
from JSON to theExecutableDeployItem
object.
CasperClient.getDeployByHashFromRPC
allows for gettingDeploy
instance from the Node's RPC.
- Secp keys generator returns
Uint8Array
instead ofBuffer
.
CLValue.publicKey
acceptsPublicKey
object.
- Deserialize
Deploy.hash
toUint8Array
instead ofBuffer
.
CLValue.isList
andCLValue.asList
.
- BytesArrayValue's fromBytes.
- Partial support for the Contract object under StoredValue.
- Deploy's body hash derivation.
- Added
DeployUtils.addArgToDeploy(deploy: Deploy, name: string, value: CLValue)
to be able to modify Deploy's session arguments. It creates a new deploy instance. Can not be used on signed deploys.
- Default
gasPrice
changed from10
to1
. - Casper balances checks return
BigNumber
now.
- Started using CHANGELOG.md.
- Changed CLValue's
value
tovalue()
andremainder
toremainder()
.