New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

postchain-client

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postchain-client - npm Package Versions

23
7

1.21.0

Diff

Changelog

Source

[1.21.0]

Changed

  • Various input types of 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
  • The client function getClusterAnchoringTransactionConfirmation now takes an additional input argument of anchoringClient
  • The client function getSystemAnchoringTransactionConfirmation now takes two additional input arguments of anchoringClient and systemAnchoringChainRid
  • Changed the response type of the function 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.
  • The client function getClusterAnchoringTransactionConfirmation now takes an additional input argument of anchoringClient
  • The client function getSystemAnchoringTransactionConfirmation now takes two additional input arguments of anchoringClient and systemAnchoringChainRid
  • Changed the response type of the function 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.
  • Updated the types ClientConfig and NetworkSettings to contain separate status polling configurations (interval and count), allowing for different polling setups for dapp, cluster and system requests
  • Updated the polling functions getBlockAnchoringTransaction and awaitGetAnchoringTransactionForBlockRid to receive the correct status polling properties
  • The function checkDigestSignature to expect a Buffer signature instead of Buffer or undefined.

Added

  • The function ensureString that receives a BufferId and returns a hex string in upper case
  • Updated the interface TransactionReceipt to contain the optional parameters clusterAnchoringClientBrid and systemAnchoringClientBrid that are populated once a transaction is anchored in Cluster Anchoring Chain and System Anchoring Chain
  • The utility function getAnchoringClientAndSystemChainRid 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
  • The type AnchoringClientAndSystemBrid that returns an anchoringClient and the systemAnchoringChainBridString
  • The types TransactionsCount and TransactionConfirmationProof
  • Several zod validation functions, to be used for the api responses under the type ResponseObject and property rspBody
  • The function getSystemAnchoringTransaction that returns a system anchored transaction or null if the cluster anchoring transaction is not anchored in the system anchoring chain
  • The client function getAnchoringStatusForBlockRid that returns BlockAnchoringState
  • The type BlockAnchoringState to be used as return type for getAnchoringStatusForBlockRid
  • Created the utility function setStatusPolling that can be used to initialize default status polling properties if not specified
  • The type StatusPolling to be used for the dapp, cluster and system polling config in the types ClientConfig and NetworkSettings
  • Promi event enums TransactionEvent with values ClusterAnchorConfirmed, SystemAnchorConfirmed, DappConfirmed, DappReceived, Signed
  • Promi events are emitted in the order of the transaction lifecycle/confirmation steps

Fixed

  • The client function getClusterAnchoringTransactionConfirmation now takes an additional input argument of anchoringClient
  • The client function getSystemAnchoringTransactionConfirmation now takes two additional input arguments of anchoringClient and systemAnchoringChainRid
  • Changed the response type of the function 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.
  • Changed the generic 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 type
  • An issue in the function checkGTXSignatures that will now return false if the gtx.signatures array is empty or not an array

Removed

  • The types GetBlocksResponse and GetBlockResponse
  • The promi event "sent" is no longer emitted
franz_chromia
published 1.20.2 •

Changelog

Source

[1.20.2]

Fixed

  • Resolved an issue where retrieving an anchoring transaction and its ICCF proof could result in mismatch if the queries were made against unsynchronized nodes
mimmicromsjo
published 1.20.1 •

Changelog

Source

[1.20.1]

Fixed

  • An issue with the escaping of characters in the generated package.json content of the esm build
  • Added @types/bn.js as runtime dependencies to fix the missing decleration one gets after installing postchain-client and trying to transpile from typescript to javascript
mimmicromsjo
published 1.20.0 •

Changelog

Source

[1.20.0]

Added

  • The function nullable 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).
  • The function getClusterAnchoringTransactionConfirmation in createClient, that given a transactionRid will return an anchoring transaction
  • Added rollup-plugin-visualizer to the Rollup configuration for bundle analysis.
  • Added tests coverage scripts in package.json
  • Created the client function getSystemAnchoringTransactionConfirmation that returns a system anchored transaction based on the provided anchored transaction rid
  • Added the util function getSystemAnchoringChain that queries the directory client and returns the system anchoring chain rid
  • Extended the logic of the function sendTransaction, signAndSendUniqueTransaction and getTransactionConfirmationLevel to also include system anchoring cluster confirmation
  • Added the type BufferId = string | Buffer that also supports ensureBuffer

Fixed

  • A bug in the function getAnchoringTransactionForBlockRid that was not handling nullable response, given the query get_anchoring_transaction_for_block_rid can return null
  • Moved validation tests from the src/blockchainClient/validation to test/unit/validation
  • Fixed a bug in the function getAnchoringClient that did not set the created client network settings to the one provided as input argument to the function

Changed

  • Extended the createClient 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 step
  • Extended the parameters of the types ClientConfig and NetworkSettings to contain directoryChainRid
  • Extended the function getBlockAnchoringTransaction to retrieve an anchoring transaction with polling
  • Updated the callback type of getTransactionStatus to RestClientCallback<TransactionReceipt> | RestClientCallback<StatusObject>
  • Updated the callback type of getTransactionConfirmationLevel to RestClientCallback<StatusObject | TransactionReceipt>
  • Updated the callback type of getClusterAnchoringTransactionConfirmation to RestClientCallback<TransactionReceipt>
  • Updated the rest client postTransaction function, to support binary formatted transactions
mimmicromsjo
published 1.19.1 •

Changelog

Source

[1.19.1]

Fixed

  • bumped secp256k1 dependency to 4.0.4, to fix vulnerability
mimmicromsjo
published 1.19.0 •

Changelog

Source

[1.19.0]

Added

  • added new request strategy Query Majority. (See README for more information)
  • new getBlocks method that has additional query params to search for blocks

Fixed

  • bug in decodeTransactionToGtx that occurs when data has Bigint values

Deprecated

  • getBlocksInfo method in IClient interface. Use getBlocks instead.
mimmicromsjo
published 1.18.0 •

Changelog

Source

[1.18.0]

Changed

  • release pipeline
  • replace node.js server with MSW in iccf unit tests
  • replace node.js server with MSW in restClient unit tests
  • replace node.js server with MSW in blockChainClient utils' unit tests

Added

  • the possibliity to set useStickyNode in the config of blockchainClient and restClient.
  • release guideline
  • dumpGtx and dumpGtv util functions for debugging purposes. This functions transforms a GTX or GTV object into a human-readable string.
mimmicromsjo
published 1.17.0 •

Changelog

Source

[1.17.0]

Added

  • getAppStructure method to IClient interface that returns app structure in JSON format

Changed

  • Husky will no longer install in CI
  • Added deprecation annotation as a function signature overload for setLogLevel
  • pipelines for version release
  • rework ResponseObject and add generic types TData, TErorr to it
  • add RetryRequestProps type to RetryRequest and singleEndpoint methods

Fixed

  • typos across all app
  • Updates wrong types for nodeUrl and nodeUrlPool in MissingNodeUrlError
mimmicromsjo
published 1.16.1 •

Changelog

Source

[1.16.1]

Added

  • convertToRellOperation is now part of pcl public API
mimmicromsjo
published 1.16.0 •

Changelog

Source

[1.16.0]

Changed

  • 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.

Added

  • function for fetching information about the latest block for a chain. The funcition is added to the IClient interface and is called getLatestBlock.
  • verify if changelog changed in pipeline to prevent merging branch without updating it
  • create a custom error which include the http status code. Exported as CustomError.
  • automate integration tests to get BRID from running test node.
  • strictNullChecks in tsconfig.json to provide better type checking

Fixed

- bug in retryRequest function which in some cases treated https errors as a successfull request.
23
7
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc