Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@clockwork-xyz/sdk
Advanced tools
Clockwork Typescript SDK
For a quickstart guide and in depth tutorials, see the Clockwork Docs. To jump straight to examples, go here. For the latest Rust API documentation, see Clockwork Rust SDK.
First, initialize a ClockworkProvider
const wallet = new NodeWallet(new Keypair());
const connection = new Connection(clusterApiUrl("devnet"));
const provider = new ClockworkProvider(wallet, connection);
Get Thread Address
let [pubkey, bump] = provider.getThreadPDA(
wallet.publicKey,
"ThreadProgramTest"
);
Initialize a Thread
let tx = await provider.threadCreate(
wallet.publicKey, // authority
"ThreadProgramTest", // id
[], // instructions to execute
{ now: {} }, // thread trigger
0.1 * LAMPORTS_PER_SOL // amount to send to the thread
);
Get Thread Data Deserialized
let threadAccount = await provider.getThreadAccount(threadPubkey);
Pause/Resume/Reset/Delete/ Thread
let tx = await provider.threadPause(wallet.publicKey, threadPubkey);
let tx = await provider.threadResume(wallet.publicKey, threadPubkey);
let tx = await provider.threadReset(wallet.publicKey, threadPubkey);
let tx = await provider.threadDelete(wallet.publicKey, threadPubkey);
Update a Thread
let tx = await provider.threadUpdate(wallet.publicKey, threadPubkey, {
name: "TestUpdateThread",
rateLimit: new BN(32),
trigger: { now: {} },
});
Withdraw from Thread
let tx = await provider.threadWithdraw(
wallet.publicKey,
threadPubkey,
0.01 * LAMPORTS_PER_SOL
);
Get Crate Info
let tx = await provider.getCrateInfo();
Get Worker Address
let [pubkey, bump] = provider.getWorkerPDA("8");
Get Worker Account
let workerAccount = await provider.getWorkerAccount(workerPubkey);
FAQs
Clockwork Typescript SDK
We found that @clockwork-xyz/sdk 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.