- Add
legalCountry
as an allowed attribute for set/not-set membership proofs. - Add attributes
lei
,legalName
,legalCountry
,businessNumber
, andregistrationAuth
toIDENTITY_SUBJECT_SCHEMA
.
getEmbeddedModuleSchema
now uses the module version to determine in which custom wasm sections to look for the schema.ConcordiumGRPCClient.getEmbeddedSchema
now delegates togetEmbeddedModuleSchema
instead ofwasmToSchema
(which was removed as it was just a less capable version ofgetEmbeddedModuleSchema
). This means that it returns the completeRawModuleSchema
instead of only the schema bytes. It also means that it returnsnull
instead of an error when no embedded schema was found.- Update
AccountInfo
andBakerPoolStatus
according to the changes introduced in the GRPC types introduced with node version 7
- Update
@concordium/rust-bindings
to3.2.1
which fixes an issue causing runtime errorunreachable
for the internal WebAssembly module. - Update JSON serialization of
AccountTransactionPayload
throughAccountTransactionPayloadHandler
to correctly serializeCcdAmount
asstring
- Bumped @concordium/rust-bindings to 3.2.0: Support company related attributes:
lei
,legalName
,legalCountry
,businessNumber
andregistrationAuth
, allow for company account creation using the SDK.
toString
,toJSON
, andfromJSON
to most concordium domain types.- Deprecated types and functions related to typed JSON serialization and deserialization.
- Various types related to CIS-2, CIS-3, and CIS-4 events and errors in the
CIS2
,CIS3
, andCIS4
namespaces. deserializeCIS2Event
,deserializeCIS3Event
, anddeserializeCIS4Event
for deserializing a CIS event from aContractEvent
.deserializeCIS2Events
anddeserializeCIS2EventsFromSummary
for deserializing all CIS-2 events fromInvokeContractSuccessResult
s andBlockItemSummary
s, respectively, as well as similar functions for CIS-3 and CIS-4 events.parseCIS2RejectionError
for parsing a CIS-2 rejection error from aInvokeContractFailureResult
.CIS3Contract
class for interacting with contracts adhering to the CIS-3 standard.Parameter.parseWithSchemaTypeBase64
andParameter.parseWithSchemaType
to help parsing smart contract parameters into typed structures.- Documentation on when
TransactionExpiry.toJSON
throws an error. Timestamp.futureMinutes
for creating aTimestamp
a number of minutes in the future.verifyPresentation
function to@concordium/web-sdk/wasm
, which can be used to verify the credential proofs in the presentation object.getPublicData
function to@concordium/web-sdk/web3-id
, which is a helper function for accessing the public data of aVerifiablePresentation
from chain.verifyCredentialMetadata
function to@concordium/web-sdk/web3-id
, which is a helper function for fetching and verifying metadata associated with a credential proof.
- Serialization of nonces with
serializeCIS4RevocationDataHolder
to serialize as little endian.
- Export all types from
accountTransaction.ts
.
- Return type of
getAccountTransactionHandler
.
fromJSON
andtoJSON
methods to theAccountTransactionHandler
interface, and implementations for all transaction handlers.
ContractAddress.toString
function that converts the address to a string in the<index, subindex>
format.- Method (
createIdRequestWithKeysV1
) for creating an identity request by supplying the secret key material instead of the seed. - Method (
createIdentityRecoveryRequestWithKeys
) for creating an identity recovery request by supplying the secret key material instead of the seed.
- Error messages in
GenericContract
now display the data, e.g., the contract address, rather than[object Object]
. - Incorrect check in isRewardStatusV1.
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.
- An issue with the serialization of init contract account transactions.
- Missing files (react native build) in published version.
- 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
- Export type
BlockItem
in the public API again, this was removed accidentally in v7.0.0.
- 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
.
- 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.
- 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
.
- An issue where
BakerRewardPeriodInfo
incorrectly mappeddelegatedCapital
field
New consensus endpoints:
getBakerEarliestWinTime
getBlockCertificates
getBakersRewardPeriod
getWinningBakersEpoch
getFirstBlockEpoch
commissionRates
is now added to thegetPoolInfo
underbakerPoolStatus.PoolInfo
sendUpdateInstruction
to the gRPC Client.healthCheck
to the gRPC Client.- Function
calculateModuleReference
for getting the module reference. - Function
parseModuleInterface
for getting the interface from the source of a smart contract module. - Function
getEmbeddedModuleSchema
for getting the module schema embedded into a smart contract module source. - Smart contract related types
ContractName
,EntrypointName
and helper functionsisInitName
,isReceiveName
,getContractNameFromInit
andgetNamesFromReceive
. - Add
ModuleClient
module and type for interaction with a smart contract module deployed on chain. - Add
Energy
module with helpers for transaction energy. - Add
BlockHash
module with helpers for block hashes. - Add
TransactionHash
module with helpers for transaction hashes. - Add
InitName
module with helpers for smart contract init-function names. - Add
ContractName
module with helpers for smart contract names. - Add
Parameter
module with helpers for smart contract parameters. - Add
AccountSequenceNumber
module with helpers for account sequence numbers (formerly referred to as nonce). - Add methods
getInstanceInfo
andcheckOnChain
on the generic contract clientContract
.
- Added missing fields to
getBlockChainParameters
response. (rootKeys, level1Keys, level2Keys) - Use of bigint exponentiation causing issues in web.
sendRawAccountTransaction
to the gRPC Client.
- Stopped using
replaceDateWithTimeStampAttribute
andreviveDateFromTimeStampAttribute
for serializing and parsing verifiable presentation. - AttributeType no longer contains
Date
, but now instead hasTimestampAttribute
. The statement builders have their types extended to keep allowing for bothDate
andTimestampAttribute
.
- Missing buffer import causing issues in web.
sendCredentialDeploymentTransaction
method ofConcordiumGRPCClient
signature changed to take an already serialized payload.
CIS4Contract
class for seemlessly interacting with contracts adhering to the CIS4 standard.- Validation of type values when verifying statements.
- Exposed
replaceDateWithTimeStampAttribute
andreviveDateFromTimeStampAttribute
.
- Aligned credential schema types with the tested types in the browser wallet.
addMinimumAge
now creates the precise age statement instead of one day off.
verifyWeb3IdCredentialSignature
now supports dates/timestamp attributes.canProveAtomicStatement
now supports timestamp attributes, handles undefined attribute value correctly and handles strings correctly for range statements.
Added a functions that handle conversions between CCD and micro CCD. The CCD amounts are handled as Big
's:
toMicroCcd
returns the amount of micro CCD as aBig
.toCcd
: returns the amount of CCD as aBig
.fromCcd
: constructs aCcdAmount
from an amount of CCD passed as aBig
ccdToMicroCcd
: Converts CCD to micro CCD, both asBig
'smicroCcdToCcd
: Converts micro CCD to CCD, both asBig
's- The
CcdAmount
class constructor now also accepts aBigSource
letting users create them fromBig
's and strings
All function parameters now also accepts strings, these strings can use comma as a decimal seperator.
Web3StatementBuilder
function.getVerifiablePresentation
function.- Various helper methods for web3Id statements and verifiable presentations.
- The max smart contract parameter length was changed to 65535 bytes in protocol version 5 and onwards. Functions which checks the parameter length will now reflect that.
- Renamed
AccountTransactionType.TransferWithScheduleWithMemo
toAccountTransactionType.TransferWithScheduleAndMemo
.
- Bumped @concordium/rust-bindings to 1.1.0 (adds
display_type_schema_template
function)
getTransactionKindString
function.displayTypeSchemaTemplate
function.
- Bumped @concordium/rust-bindings to 1.0.0. (Throws proper
Error
s when execution fails for any WASM entrypoint, with improved error messages) - Updated
types.ts
to conform to updated GRPC API, which includes adding more variants to existing types (all new variants take effect from protocol version 6):ChainParametersV2
added toChainParameters
BlockInfo
changed toBlockInfoV0 | BlockInfoV1
ConsensusStatus
changed toConsensusStatusV0 | ConsensusStatusV1
ElectionInfo
changed toElectionInfoV0 | ElectionInfoV1
- Cost calculation for
deployModule
transaction. - Fixed a bug where protocol version was different (i.e. 1 less than what it should be) when using the gRPCv2 API (compared to what is returned by the gRPCv1 API).
- Function
uleb128Decode
now parses correctly and throws an error if the given input contains more than a single ULEB128 encoded number.
- A
parseWallet
function to parse wallet export files - Helper functions to determine version of versioned types mentioned in "Breaking Changes" have been added.
- Support for new chain update types.
- Function
uleb128DecodeWithIndex
that can also parse more than a single ULEB128 bigint - Added
tokenAddressFromBase58
andtokenAddressToBase58
to CIS2
- The following functions now all have an additional parameter controlling whether errors are in a verbose format or not:
deserializeContractState
deserializeReceiveReturnValue
deserializeReceiveError
deserializeInitError
deserializeTypeValue
serializeInitContractParameters
serializeUpdateContractParameters
serializeTypeValue
- Cost calculation for
deployModule
transaction.
- Updated
blockInfo
so that thebakerId
field is optional, since it will be undefined for genesis blocks. waitForTransactionFinalization
now returns aBlockItemSummaryInBlock
- Added missing version return type in
getModuleSchema
. It now returns an object containing the schema source and version.
- Helpers for calculating energy cost for a transaction and microCCD cost from energy cost:
getEnergyCost
getExchangeRate
convertEnergyToMicroCcd
- Utility functions for extracting information from
BlockItemSummary
:isInitContractSummary
isUpdateContractSummary
isTransferLikeSummary
isRejectTransaction
isSuccessTransaction
getTransactionRejectReason
getReceiverAccount
affectedContracts
affectedAccounts
- Utility functions for extracting information from
BlockSpecialEvent
:specialEventAffectedAccounts
- Helper methods on
GRPCClient
for chain traversal:getFinalizedBlocksFrom
findEarliestFinalized
findInstanceCreation
findFirstFinalizedBlockNoLaterThan
- Extended HdWallet with support for verifiable credential key deriviation.
- Bumped @concordium/rust-bindings to 0.12.0. (Adds key derivation for verifiable credentials)
- Utility functions
uleb128Decode
anduleb128Encode
functions for decoding and encoding as unsigned leb128 respectively. CIS2Contract
class for interacting with smart contracts adhering to the CIS-2 standard.cis0Supports
function for checking standard support in smart contracts.- Made the
streamToList
function public. - Made the
unwrap
function public. - Added
wasmToSchema
utility function. - Added
getEmbeddedSchema
to client. - Exposed
RpcError
type and created helperisRpcError
. - Build function
buildAccountSigner
for creatingAccountSigner
objects from genesis format, wallet export format, and a simple representation of credentials with keys.
- Fixed bug where
AccountCreationSummary
type did not have fields:index
,energyCost
,hash
generateBakerKeys
now also returns the private baker keys.
- Replace use of
setImmediate
withsetTimeout
since the former is not supported in browsers.
- General function for deserializing smart contract values
deserializeTypeValue
.
- Bumped @concordium/rust-bindings to 0.11.0. (Includes a fix to serialization of negative numbers for smart contract values)
signMessage
andverifyMessageSignature
can now handle the message being a buffer/Uint8Array instead of only a utf8 string.
serializeTypeValue
now reports an error when called with invalid data, such as a receive function with missing schema, or a schema that cannot be parsed.
-
Added a client for version 2 of the Concordium gRPC API to communicate with a Concordium node.
- including helper function
waitForTransactionFinalization
that returns a promise that resolves when the transaction finalizes.
- including helper function
-
Serialization:
serializeAccountTransactionPayload
serializeCredentialDeploymentPayload
-
Credential deployment helpers:
createCredentialTransaction
createCredentialTransactionNoSeed
signCredentialTransaction
-
Function to generate baker keys:
generateBakerKeys
.
getInitContractParameterSchema
,getUpdateContractParameterSchema
,serializeInitContractParameters
andserializeUpdateContractParameters
now report an error when called with invalid data, such as a receive function with missing schema, or a schema that cannot be parsed.
- The JSON-RPC client has been deprecated in favor of the new gRPC v2 client.
- Various types and helper functions used by the JSON-RPC client (and the v1 gRPC client) have also been deprecated.
serializeTypeValue
that allows smart contract types to be serialized using the specific schema, instead of only by providing the entire module's schema.getInitContractParameterSchema
Given a buffer containing the schema for a module, extract the schema for a given contract's init function's parameters.getReceiveContractParameterSchema
Given a buffer containing the schema for a module, extract the schema for a given contract's receive methods' parameters.
IdStatementBuilder
class to help build id statements.verifyIdStatement
function to verify that a statement is well-formed and complies with rules for id statements.getIdProof
function to prove a statement holds for the given identity/account.- Enums for sex and idDocType values.
- Change AccountTransactionType names/string values to align with those in Concordium base.
- Change some field names in UpdateConcractPayload, InitContractPayload and DeployModule to align with those in Concordium base.
- Rename GtuAmount class to CcdAmount. And change the microGtuAmount field to microCcdAmount.
- Add custom toJSON methods for the classes CcdAmount, AccountAddress, ModuleReference, CredentialRegistrationId, DataBlob and TransactionExpiry, in order to match the serialisation of their equivalents in Concordium base.
- The ability to deserialize error values of receive and init functions using
deserializeReceiveError()
anddeserializeInitError()
respectfully. - Refactored the
upserializeUpdateContractParameters()
andserializeInitContractParameters()
to call into rust functions.
- The ability to deserialize the return values of receive functions using
deserializeReceiveReturnValue()
.
- Additional arguments to the JSON-RPC HttpProvider, to enable is to receive and forward cookies.
- getAccountInfo no longer relies on instanceof to determine the type of input.
getCredentialId
to the HdWallet.
- Updated the signature of helper functions for accounts to sign messages. (and changed the prepend)
- ConcordiumHdWallet methods now take the identity provider index as arguments.
- Bumped @concordium/rust-bindings to 0.4.0.
- Added missing
accountAddress
field toAccountInfo
types.
- Support for new V2 schemas which can specify error types.
- SchemaVersion, Module, and schema types are now 0-indexed instead of 1-indexed. This means that the schemas used for V0 contracts are now version 0, and so is the associated types. And the first schema version for V1 contracts are now version 1.
deserializeTransaction
function to deserialize transaction created byserializeAccountTransactionForSubmission
andserializeCredentialDeploymentTransactionForSubmission
. (Currently SimpleTransfer, SimpleTransferWithMemo and RegisterData are the only supported account transactions kinds)createIdentityRequest
, to create identity requests.createCredentialV1
, to create credentials using a seedPhrase.createIdentityRecoveryRequest
, to create identity recovery requests.- Added
sendCredentialDeployment
to send credentials created fromcreateCredentialV1
to the chain. getSignedCredentialDeploymentTransactionHash
to get the transaction hash of credentials created fromcreateCredentialV1
.- Added
ConfigureBaker
toAccountTransactionType
enum. - Added
ConcordiumHdWallet
with functions to get keys and randomness from a seed phrase.
deserializeTransaction
no longer throws an error on expired transactions.deserializeTransaction
is now exported from index.
- Support deserializing new schema types: ULeb128, ILeb128, ByteArray and ByteList.
- Support deserializing schemas with versioning information.
- Add support for getAccountInfo, InvokeContract, getCryptographicParameters and getModuleSource with JSON-RPC
- Fixed contract schema serialization for ByteList
- The function for deserializing a module schema
deserialModuleFromBuffer
now have the schema version as an optional argument. The function will try to extract the version from the buffer. When a version is provided it falls back to this, otherwise it throws an error.
- @noble/ed25519 and cross-fetch moved from devDependencies to dependencies.
- Support deserializing version 2 schemas.
- Support serializing parameters for contracts using version 2 schemas.
- Support for deploying versioned smart contract modules, which is the format used in cargo-concordium v2+. (This is done by not supplying the version field in the payload)
serializeInitContractParameters
andserializeUpdateContractParameters
each have an additional parameter, which denotes the version of the schema provided. For existing users that are using V0 contracts, that parameter should beSchemaVersion.V1
.- Deserialization of schemas have been changed: types and functions have been renamed and
deserialModuleFromBuffer
have an additional parameter.
- Fixed JSON-RPC client crash on empty response when calling getInstanceInfo. (And update the format of the arguments for the server)
- Fixed issue by bumping rust bindings version
- Initial release