![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@mchappell/cip2
Advanced tools
TypeScript definitions for CIP2 (Coin Selection Algorithms for Cardano)
This package implements concepts from the draft specification being developed in CIP-0002.
Currently there is only 1 input selection algorithm: RoundRobinRandomImprove, which is a Random-Improve adaptation that handles asset selection.
import { roundRobinRandomImprove, defaultSelectionConstraints, InputSelector, SelectionResult, SelectionSkeleton } from '@cardano-sdk/cip2';
import { loadCardanoSerializationLib, CSL, CardanoSerializationLib, ProtocolParametersRequiredByWallet } from '@cardano-sdk/core';
const demo = async (protocolParameters: ProtocolParametersRequiredByWallet): Promise<SelectionResult> => {
const csl: CardanoSerializationLib = await loadCardanoSerializationLib();
const selector: InputSelector = roundRobinRandomImprove(coinsPerUtxoWord);
// It is important that you use the same instance of cardano-serialization-lib across your application.
// Bad: TransactionUnspentOutput.new(...)
// Good: CSL.TransactionUnspentOutput.new(...)
const utxo: CSL.TransactionUnspentOutput[] = [CSL.TransactionUnspentOutput.new(...), ...];
const outputs: CSL.TransactionOutput[] = [CSL.TransactionOutput.new(...), ...];
// Used to estimate min fee and validate transaction size
const buildTx = (inputSelection: SelectionSkeleton): Promise<CSL.Transaction> => {...};
const constraints = defaultSelectionConstraints({
protocolParameters, buildTx,
});
return selector.select({
utxo,
outputs,
constraints,
});
};
Input selection is tested with property-based tests using fast-check, as well as a few regular example-based tests.
Due to nature of property-based tests, code coverage report is slightly different on each build.
RoundRobinRandomImprove has 100% code coverage when using high numRuns
option (e.g. 100_000).
Note that to run it with high numRuns
you need to increase Jest and fast-check timeout.
See code coverage report.
FAQs
TypeScript definitions for CIP2 (Coin Selection Algorithms for Cardano)
The npm package @mchappell/cip2 receives a total of 1 weekly downloads. As such, @mchappell/cip2 popularity was classified as not popular.
We found that @mchappell/cip2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.