Releases: Concordium/concordium-node-sdk-js
Releases · Concordium/concordium-node-sdk-js
SDK Release 8.1.0
Summary
Support and fixes for ZK proofs related to the company IDs.
Changes
- Add
legalCountry
as an allowed attribute for set/not-set membership proofs. - Add attributes
lei
,legalName
,legalCountry
,businessNumber
, andregistrationAuth
toIDENTITY_SUBJECT_SCHEMA
.
ccd-js-gen v1.2.0
- Fix issue related to inferring module type names from the input file name, by removing characters, which are not valid in type names.
- Improve information when reporting progress during code-generation.
- Generate
create<ContractName>ParameterWebWallet
andcreate<EntrypointName>ParameterWebWallet
functions for constructing the smart contract parameters in the format used by the Concordium Web-Wallet. - Minor breaking change:
create<EntrypointName>Parameter
function for contract entries andcreate<ContractName>Parameter
function in module are no longer generated when parameter schema type isUnit
. These functions are mainly used internally, but are still exposed. - Fix bug for generating JSON for schema type
ULeb128
andILeb128
. - Add optional flag
--ts-nocheck
, enabling it will add// @ts-nocheck
in each generated file. - Add
--output-type <type>
flag to CLI allowing to specify whether to generate TypeScript or JavaScript directly. - Fix the executable version of the package on Windows.
web-sdk v7.1.0
Added
jsonUnwrapStringify
function, which can be used to unwrap concordium domain types to their inner values before serializing, to ease compatibility with dependants deserializing stringified JSON.
web-sdk v7.0.3
Fixed
- An issue with the serialization of init contract account transactions.
web-sdk v7.0.1
Added
- Support for using the SDK in a react native environment. Requires polyfilling functionality used within the SDK.
Please refer to the guide found at the react native compatibility guide
Fixed
- Export type
BlockItem
in the public API again, this was removed accidentally in v7.0.0.
ccd-js-gen v1.0.0
Initial release of the ccd-js-gen
package, providing JavaScript code generation for smart contract clients.
web-sdk v7.0.0
Breaking changes
- The package is published as an ES module, instead of commonJS. Migration steps can be seen in the upgrade guide
- The package has been split into several entrypoints that can be used to limit the scope of what is included from the SDK.
@concordium/common-sdk
exposes the full API of the SDK.@concordium/common-sdk/cis0
entrypoint exposes functionality for working with contracts adhering to the CIS-0 standard.@concordium/common-sdk/cis2
entrypoint exposes functionality for working with contracts adhering to the CIS-2 standard.@concordium/common-sdk/cis4
entrypoint exposes functionality for working with contracts adhering to the CIS-4 standard.@concordium/common-sdk/grpc
entrypoint exposes the grpc client for interacting with a nodes GRPCv2 interface.@concordium/common-sdk/id
entrypoint exposes functionality for working with ID proofs.@concordium/common-sdk/schema
entrypoint exposes functionality for working with smart contract schemas, i.e.(de)serializing types using a smart contract schema.- This uses the wasm entrypoint at
@concordium/rust-bindings/dapp
.
- This uses the wasm entrypoint at
@concordium/common-sdk/types
entrypoint exposes functionality for working with concordium domain types.@concordium/common-sdk/wasm
entrypoint exposes a variety of functionality for working with concordium domain types, which requires WASM.- This uses the wasm entrypoint at
@concorodium/rust-bindings/wallet
.
- This uses the wasm entrypoint at
@concordium/common-sdk/web3-id
entrypoint exposes functionality for working with web3-id proofs.- This change makes the library incompatible with node versions <16 and requires bundlers to respect the
exports
field ofpackage.json
. - For TypeScript projects the minimum required version of typescript is:
- NodeJS: 4.7,
"moduleResolution": "node16" // or "nodenext"
- Bundled applications (webpack, esbuild, rollup, etc...): 5.0,
"moduleResolution": "bundler"
- NodeJS: 4.7,
- The following functions now parse using
json-bigint
meaning that they return bigints instead of numbers for all numbers no matter sizedeserializeContractState
deserializeReceiveReturnValue
deserializeReceiveError
deserializeInitError
deserializeTypeValue
The API now uses dedicated types instead of language primitives:
- Use
AccountAddress
instead of a string with base58 encoding. UseAccountAddress.fromBase58('<base58>')
to construct it. - Use
BlockHash
instead of a string with hex encoding. UseBlockHash.fromHexString('<hex>')
to construct it. - Use
TranactionHash
instead of a string with hex encoding. UseTransactionHash.fromHexString('<hex>')
to construct it. - Use
Energy
instead of a bigint. UseEnergy.create(<integer>)
to construct it. - Use
ReceiveName
instead of a string. UseReceiveName.fromString('<contract>.<function>')
to construct it. - Use
InitName
instead of a string. UseInit.fromString('init_<contract>')
to construct it. - Use
ContractName
instead of a string. UseContractName.fromString('<contract>')
to construct it. - Use
EntrypointName
instead of a string. UseEntrypointName.fromString('<function>')
to construct it. - Use
Parameter
instead of a string with hex encoding. UseParameter.fromHexString('<hex>')
. - Use
SequenceNumber
(formerly called nonce) instead of a bigint. UseSequenceNumber.create(<integer>)
to construct it. - Use
Timestamp
instead of a bigint. Can be constructed usingTimestamp.fromMillis(<integer>)
. - Use
Duration
instead of a bigint. Can be constructed usingDuration.fromMillis(<integer>)
. - Use
ContractEvent
instead of a string with hex encoding. Can be constructed usingContractEvent.fromHexString('<hex>')
. - Use
CcdAmount
instead of a bigint. Can be constructed usingCcdAmount.fromMicroCcd(<integer>)
. - Use
TransactionExpiry
instead of a Date object. Can be constructed usingTransactionExpiry.fromDate(<date>)
. - Use
ModuleReference
instead of a string with hex encoding. Can be constructed usingModuleReference.fromHexString('<hex-string>')
.
Several types have been replaced with a module containing the type itself together with functions for constructing and converting the type:
AccountAddress
is now a module with functions related to account addresses:- To refer to
AccountAddress
as a type useAccountAddress.Type
. - Constructing
new AccountAddress("<address>")
is nowAccountAddress.fromBase58("<address>")
. isAlias
andgetAlias
are now accessable fromAccountAddress.isAlias
andAccountAddress.getAlias
.
- To refer to
ContractAddresss
is now a module with functions related to contract addresses:- To refer to
ContractAddress
as a type useContractAddress.Type
. - To construct the type use
ContractAddress.create(index, subindex)
.
- To refer to
CredentialRegistrationId
is now a module with functions related to credential registration IDs:- To refer to
CredentialRegistrationId
as a type useCredentialRegistrationId.Type
. - Constructing
new CredentialRegistrationId("<hex-string>")
is nowCredentialRegistrationId.fromHexString("<hex-string>")
.
- To refer to
CcdAmount
is now a module with functions related to amounts of CCDs:- To refer to
CcdAmount
as a type useCcdAmount.Type
. - Constructing
new CcdAmount(<integer>)
is nowCcdAmount.fromMicroCcd(<integer>)
. - The methods
toMicroCcd
andtoCcd
are now functions refered to asCcdAmount.toMicroCcd
andCcdAmount.toCcd
respectively.
- To refer to
TransactionExpiry
is now a module with functions related to amounts of expiry time of transactions:- To refer to
TransactionExpiry
as a type useTransactionExpiry.Type
. - Constructing
new TransactionExpiry(<expiry>, <allowExpired>)
is nowTransactionExpiry.fromDate(<expiry>)
, and the check of being a time in the future is removed and done when sending the transaction instead.
- To refer to
ModuleReference
is now a module with functions related to references to smart contract modules:- To refer to
ModuleReference
as a type useModuleReference.Type
. - Constructing
new ModuleReference("<hex-string>")
is nowModuleReference.fromHexString("<hex-string>")
. - The static method
ModuleReference.fromBytes
is nowModuleReference.fromBuffer
.
- To refer to
- Removed
JsonRpcClient
and types and functionality associated solely with this class. - Renamed
AccountSequenceNumber
module toSequenceNumber
. - Fix type for
TranferredEvent
fromContractTraceEvent
to only be from contract addresses to account addresses. - Added
effectiveTime
field toPendingUpdate
.
Added
- All JSON serialization in
serialization.ts
is now handled byjson-bigint
meaning that all functions now correctly handles bigint inputs Timestamp
is now a module with functions related to time.- To refer to
Timestamp
as a type useTimestamp.Type
.
- To refer to
Duration
is now a module with functions related to durations of time.EntrypointName
is now a module with functions related to entrypoint names of a smart contract.ReceiveName
is now a module with functions related to receive-function names of a smart contract.ReturnValue
is now a module with functions related to return values from invoking a smart contract.- Functions
jsonStringify
andjsonParse
, which acts as a regularJSON.stringify
andJSON.parse
correspondingly,
with the addition of stringifying concordium domain types in a wrapper object that can be parsed into the respective types. - Introduce function
versionedModuleSourceToBuffer
for serializing a versioned module to a buffer, which can be stored in a file.
Changes
- Added version discriminators to types versioned by the protocol version of Concordium nodes:
MintDistribution
GasRewards
RewardParameters
ChainParameters
Authorizations
RewardStatus
BlockInfo
ConsensusStatus
AccountBakerDetails
ElectionInfo
- Added type discriminator to different forms of
AccountInfo
.
web-sdk v6.5.0
Added
New consensus endpoints:
getBakerEarliestWinTime
getBlockCertificates
getBakersRewardPeriod
getWinningBakersEpoch
getFirstBlockEpoch
commissionRates
is now added to thegetPoolInfo
underbakerPoolStatus.PoolInfo
node-sdk v9.5.0
Added
New consensus endpoints:
getBakerEarliestWinTime
getBlockCertificates
getBakersRewardPeriod
getWinningBakersEpoch
getFirstBlockEpoch
commissionRates
is now added to thegetPoolInfo
underbakerPoolStatus.PoolInfo
web-sdk v6.4.0
Added
sendUpdateInstruction
to the gRPC Client.healthCheck
to the gRPC Client.- Functions
calculateModuleReference
for getting the module reference andparseModuleInterface
for getting the interface from the source of a smart contract module. - Smart contract related types
ContractName
,EntrypointName
and helper functionsisInitName
,isReceiveName
,getContractNameFromInit
andgetNamesFromReceive
.
Fixed
- Added missing fields to
getBlockChainParameters
response. (rootKeys, level1Keys, level2Keys) - Use of bigint exponentiation causing issues in web.