Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@solana/functional
Advanced tools
This package contains generalized functional helpers and functional helpers
specific to Solana application components. It can be used standalone, but it
is also exported as part of the Solana JavaScript SDK
@solana/web3.js@rc
.
pipe()
Until the pipe operator becomes part of JavaScript you can use this utility to create pipelines.
const add = (a, b) => a + b;
const add10 = x => add(x, 10);
const add100 = x => add(x, 100);
const sum = pipe(1, add10, add100);
sum === 111; // true
A pipeline is one solution to performing consecutive operations on a value using functions, such as you would when building a transaction.
const transferTransactionMessage = pipe(
// The result of the first expression...
createTransactionMessage({ version: 0 }),
// ...gets passed as the sole argument to the next function in the pipeline.
tx => setTransactionMessageFeePayer(myAddress, tx),
// The return value of that function gets passed to the next...
tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),
// ...and so on.
tx => appendTransactionMessageInstruction(createTransferInstruction(myAddress, toAddress, amountInLamports), tx),
);
FAQs
Functional JavaScript helpers
We found that @solana/functional demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.