postchain-client
Advanced tools
Changelog
[2.0.0]
sendTransaction
that did not consider status polling assignements through client.config
, but instead, did only considering assignements through config
X-Transaction-Timestamp
application/octet-stream
in GET
requeststransactionTimestamp
to the type ResponseObject
that is filled through response headersgetWaitingTransactions
that fetches a list of waiting transaction RIDs from a specified blockchaingetWaitingTransaction
that fetches a specific waiting transaction's binary data and the transaction's timestamp from the specified blockchaingetRejectedTransactions
that fetches a list of rejected transactions with their rejection reasons from a specified blockchainWaitingTransaction
, RejectedTransaction
and RejectedTransactionResponse
isRawGtx
that parses an unknown
value and returns value is RawGtx
validateStatusObject
that parses an unknown
input and returns StatusObject
or an errorPending
in the enum ResponseStatus
, that indicates a TransactionReceipt
has been created in its initial state, without receiving any confirmation yet from the Dapp
or System
clusters.isRawGtx
that parses an unknown
value and returns value is RawGtxGtvExtra
StatusObject
to TransactionStatusReponse
getTransactionStatus
from Promise<TransactionReceipt | StatusObject>
to Promise<StatusObject>
Web3EventMap
refactored to genericUnexpectedStatusError
constructor argument error
type from any
to string | undefined
getBlocks
argument callback
type changed from TransactionInfo[]
to BlockInfo[]
getBlocksInfo
argument callback
type changed from TransactionInfo[]
to BlockInfo[]
QueryObject
has now a default type of RawGtv
for TReturn
and a phantom _returnType
field to preserve the return type at compile time, without runtime impactresponse
of the type QueryCallback
changed from TReturn
to TReturn | null
callbackPromiseBuilder
to use generics <T, U = T>
for stronger type safety and replaced all any
type usages with typed parametersrspBody
of the function handlePostResponsePromisified
was changed from any
to RawGtv | null | undefined
handlePostResponse
generic by adding <T extends RawGtv>
and updated its callback type from ClientCallback<RawGtv>
to ClientCallback<T>
convertToPrintable
has now return type of string
. In addition, the input argument responseObject
type was changed from any
to unknown
value
type of the function checkGtvType
from any
to unknown
value
type of the function checkGtxType
from any
to unknown
obj
type of the function gtvHash
from any
to RawGtv
UnexpectedArgumentTypeError
constructor argument typedArg
type from any
to ASNValue
gtvExtra
type attribute from any
to GtvExtra
signRawTransaction
requestWithFailoverStrategy
from ./failoverStrategies
to ./requestWithFailoverStrategy
getTransactionRid
. The function calculateTransactionRid
that can be found in src/utils/calculateTransactionRid
should be used instead, to calculate the transaction ridgetBlocksInfo
. The client function getBlocks
should be used insteadencodeTransaction
. The function encodeTransaction
that can be found in src/utils/encodeTransaction.ts
should be used insteaddecodeTransactionToGtx
. The function decodeTransactionToGtx
that can be found in src/utils/encodeTransaction.ts
should be used insteadWeb3EventMap
that was used to handle the event types of Web3EventEmitter
Changelog
[1.22.0]
isTransactionInfo
and isTransactionInfoArray
afterTime
and signerPubKey
to the client function getTransactionsInfo
. These input arguments are used as query parameters for the GET api /transactions/{blockchainRid}/
/config/{blockchainRid}/features
is not availableChangelog
[1.21.1]
merkleHashVersion
gtvHash
as its second argumentnewSignatureProvider
as its first argumentsign
as its third argumentgetDigestToSign
as its second argumentgetSystemAnchoringTransaction
as its sixth argumentgetBlockchainRidFromIid
as its fourth argumentchromiaClientProvider
as its third argumentgetDigestToSignFromRawGtxBody
as its second argumentcreateClient
(gtx client) as its fourth argumentcalculateBlockRID
as its second argumentcalculateTransactionRid
as its second argumentcreateClient
functions sendTransaction
and signAndSendUniqueTransaction
that did performed a directory chain query to cm_get_blockchain_api_urls
and that was causing local integration tests to fail, as well as local development (when running local nodes)ClientConfig
to have a new parameter merkleHashVersion
that can be used to specify the merkle hash version to be used. If not provided, the function will try to get the merkle hash version from the dapp, by using the feature endpoint /config/{blockchainRid}/features
.NetworkSettings
was extended and now contains an optional additional attribute merkleHashVersion
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]