postchain-client
Advanced tools
Changelog
[1.21.0]
Buffer
or string
to BufferId
(Buffer | string
) for function parameters that expected transaction RIDs or blockchain RIDs. The following functions are affected:
getTransaction
parameter transactionRid
getTransactionStatus
parameter transactionRid
getTransactionInfo
parameter transactionRid
getTransactionConfirmationLevel
parameter transactionRid
getConfirmationProof
parameter txRID
getClusterAnchoringTransactionConfirmation
parameter transactionRid
getSystemAnchoringTransactionConfirmation
parameter anchoredTxRid
getGTXFromBufferOrTransactionOrOperation
parameter blockchainRid
ConfirmationProofException
constructor parameter transactionRid
createIccfProofTx
parameters txToProveRid
, sourceBlockchainRid
and targetBlockchainRid
getBlockAnchoringTransaction
parameter txRid
isBlockAnchored
parameter txRid
getAnchoringClient
parameter dappBlockchainRid
fetchAndVerifyTransaction
parameter txToProveRID
composeProofTransactionObject
parameter sourceBlockchainRid
client
function getClusterAnchoringTransactionConfirmation
now takes an additional input argument of anchoringClient
client
function getSystemAnchoringTransactionConfirmation
now takes two additional input arguments of anchoringClient
and systemAnchoringChainRid
getSystemAnchoringChain
to now return Buffer
instead of Buffer | null
. The function will instead
throw a SystemChainException
instead if null
is returned from the query, informing the user an invalid client was provided.client
function getClusterAnchoringTransactionConfirmation
now takes an additional input argument of anchoringClient
client
function getSystemAnchoringTransactionConfirmation
now takes two additional input arguments of anchoringClient
and systemAnchoringChainRid
getSystemAnchoringChain
to now return Buffer
instead of Buffer | null
. The function will instead
throw a SystemChainException
instead if null
is returned from the query, informing the user an invalid client was provided.ClientConfig
and NetworkSettings
to contain separate status polling configurations (interval and count),
allowing for different polling setups for dapp, cluster and system requestsgetBlockAnchoringTransaction
and awaitGetAnchoringTransactionForBlockRid
to receive the correct status polling propertiescheckDigestSignature
to expect a Buffer
signature instead of Buffer
or undefined
.ensureString
that receives a BufferId
and returns a hex string in upper caseTransactionReceipt
to contain the optional parameters clusterAnchoringClientBrid
and systemAnchoringClientBrid
that are populated
once a transaction is anchored in Cluster Anchoring Chain and System Anchoring ChaingetAnchoringClientAndSystemChainRid
that returns the type AnchoringClientAndSystemBrid
providing it with a dapp client
.
This utility function should be used to provide the correct inputs for the client functions clusterAnchoringClientBrid
and systemAnchoringClientBrid
AnchoringClientAndSystemBrid
that returns an anchoringClient
and the systemAnchoringChainBridString
TransactionsCount
and TransactionConfirmationProof
ResponseObject
and property rspBody
getSystemAnchoringTransaction
that returns a system anchored transaction or null if the cluster anchoring transaction is not anchored in the system anchoring chaingetAnchoringStatusForBlockRid
that returns BlockAnchoringState
BlockAnchoringState
to be used as return type for getAnchoringStatusForBlockRid
setStatusPolling
that can be used to initialize default status polling properties if not specifiedStatusPolling
to be used for the dapp, cluster and system polling config in the types ClientConfig
and NetworkSettings
TransactionEvent
with values ClusterAnchorConfirmed
, SystemAnchorConfirmed
, DappConfirmed
, DappReceived
, Signed
client
function getClusterAnchoringTransactionConfirmation
now takes an additional input argument of anchoringClient
client
function getSystemAnchoringTransactionConfirmation
now takes two additional input arguments of anchoringClient
and systemAnchoringChainRid
getSystemAnchoringChain
to now return Buffer
instead of Buffer | null
. The function will instead
throw a SystemChainException
instead if null
is returned from the query, informing the user an invalid client was provided.ResponseObject
to a strict type. The property rspBody
is of type unknown
and it is validated for each different case
using zod validation functions for the expected typecheckGTXSignatures
that will now return false
if the gtx.signatures
array is empty or not an arrayGetBlocksResponse
and GetBlockResponse
Changelog
[1.20.2]
Changelog
[1.20.1]
Changelog
[1.20.0]
getTransactionConfirmationLevel
in createClient
that expects a transactionRid
and returns a TransactionReceipt
that indicates the last successful confirmation of a transaction, as well as an anchoring transaction if the transaction is added in a block (Cluster Anchoring Confirmation).getClusterAnchoringTransactionConfirmation
in createClient
, that given a transactionRid
will return an anchoring transactionrollup-plugin-visualizer
to the Rollup configuration for bundle analysis.getSystemAnchoringTransactionConfirmation
that returns a system anchored transaction based on the provided anchored transaction ridgetSystemAnchoringChain
that queries the directory client and returns the system anchoring chain ridsendTransaction
, signAndSendUniqueTransaction
and getTransactionConfirmationLevel
to also include system anchoring cluster confirmationBufferId = string | Buffer
that also supports ensureBuffer
getAnchoringTransactionForBlockRid
that was not handling nullable response, given the query
get_anchoring_transaction_for_block_rid
can return nullsrc/blockchainClient/validation
to test/unit/validation
getAnchoringClient
that did not set the created client network settings to the one provided as input argument to the functioncreateClient
functions sendTransaction
and signAndSendUniqueTransaction
to accept a new input parameter confirmationLevel
that will resolve the promise based on the configurable confirmation selection and will emit a “sent” promiEvent with the confirmation status in each confirmation stepClientConfig
and NetworkSettings
to contain directoryChainRid
getBlockAnchoringTransaction
to retrieve an anchoring transaction with pollinggetTransactionStatus
to RestClientCallback<TransactionReceipt> | RestClientCallback<StatusObject>
getTransactionConfirmationLevel
to RestClientCallback<StatusObject | TransactionReceipt>
getClusterAnchoringTransactionConfirmation
to RestClientCallback<TransactionReceipt>
postTransaction
function, to support binary formatted transactionsChangelog
[1.19.1]
Changelog
[1.19.0]
Query Majority
. (See README for more information)getBlocks
method that has additional query params to search for blocksgetBlocksInfo
method in IClient
interface. Use getBlocks
instead.Changelog
[1.18.0]
useStickyNode
in the config of blockchainClient
and restClient
.Changelog
[1.17.0]
getAppStructure
method to IClient
interface that returns app structure in JSON formatsetLogLevel
Changelog
[1.16.1]
convertToRellOperation
is now part of pcl public APIChangelog
[1.16.0]
Separated non-backend dependent functions from interface IClient
. Functions getTransactionRid
, encodeTransaction
, and decodeTransactionToGtx
have been extracted and are now separate utility functions.
Renamed getTransactionRid
to calculateTransactionRid
for clarity. Its input type has been changed to RawGtxBody
. Conversion functions have been introduced to facilitate this transition.
Modified the input type of encodeTransaction
to GTX
.
Use PascalCase for types and class names:
getTransactionRidException
-> GetTransactionRidException
.transactionInfoInBlockResponse
-> TransactionInfoInBlockResponse
.transactionInfoInBlock
-> TransactionInfoInBlock
.change npm install
to npm ci
command
split unit tests for sendTransaction
to separate file. Replace Express mock server with MSW.
rework validation for client and server errors. Now it covers all 4xx and status codes.
Replace node server with MSW for unit tests in blockchainClient.test.ts.
IClient
interface and is called getLatestBlock
.CustomError
.- bug in retryRequest function which in some cases treated https errors as a successfull request.