
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@recallnet/sdk
Advanced tools
@recallnet/sdk
Official JavaScript/TypeScript SDK for the Recall Network.
This package is a JS/TS SDK for the Recall Network. It is built on top of viem interfaces with Recall subnets for various operations, including managing:
First, install the package:
# Note: this package is not published to NPM yet, so you need to install it from the source
pnpm add @recallnet/sdk
Create a wallet client from a private key:
import { createWalletClient } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { testnet } from "@recallnet/chains";
import { RecallClient } from "@recallnet/sdk/client";
// Create a wallet client from a private key
const privateKey =
"0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6";
const walletClient = createWalletClient({
account: privateKeyToAccount(privateKey),
chain: testnet,
transport: http(),
});
// Create a client from the wallet client
const recall = new RecallClient({ walletClient });
// Create a bucket
const bucketManager = client.bucketManager();
const {
result: { bucket },
} = await bucketManager.create();
console.log("Bucket created:", bucket); // 0xff00...9d
// List buckets
const { result: buckets } = await bucketManager.list();
console.log("Buckets:", buckets);
// Add an object to a bucket
const key = "hello/world";
const path = fs.readFileSync("path/to/file.txt");
const { meta } = await bucketManager.add(bucket, key, path);
console.log("Object added at:", meta?.tx?.transactionHash);
// Get an object from a bucket
const { result: object } = await bucketManager.get(bucket, key);
const contents = new TextDecoder().decode(object);
console.log("Object:", contents);
// Set up credit manager
const creditManager = client.creditManager();
// Buy credit
const { meta } = await creditManager.buy(parseEther("1"));
console.log("Credit bought:", meta?.tx?.transactionHash);
// Approve credit usage
const to = "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65";
const { meta: approveMeta } = await creditManager.approve(to);
console.log("Credit approved:", approveMeta?.tx?.transactionHash);
// Revoke credit approval
const { meta: revokeMeta } = await creditManager.revoke(to);
console.log("Credit revoked:", revokeMeta?.tx?.transactionHash);
// Set account sponsor
const sponsor = "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc";
const { meta: sponsorMeta } = await creditManager.setAccountSponsor(sponsor);
console.log("Account sponsor set:", sponsorMeta?.tx?.transactionHash);
// Get account details
const { result: account } = await creditManager.getAccount();
console.log("Account details:", account);
// Get credit approvals
const { result: approvals } = await creditManager.getCreditApprovals();
console.log("Credit approvals:", approvals);
// Get credit balance
const { result: balance } = await creditManager.getBalance();
console.log("Credit balance:", balance);
// Get credit stats
const { result: stats } = await creditManager.getCreditStats();
console.log("Credit stats:", stats);
// Set up account manager
const accountManager = client.accountManager();
// Get account balance for token amount
const { result: balance } = await accountManager.balance();
console.log("Account balance:", balance);
// Get account info
const { result: info } = await accountManager.info();
console.log("Account info:", info);
// Deposit funds
const { meta } = await accountManager.deposit(parseEther("1"));
console.log("Funds deposited:", meta?.tx?.transactionHash);
// Withdraw funds
const { meta: withdrawMeta } = await accountManager.withdraw(parseEther("1"));
console.log("Funds withdrawn:", withdrawMeta?.tx?.transactionHash);
// Set up blob manager
const blobManager = client.blobManager();
// Get storage stats
const { result: storageStats } = await blobManager.getStorageStats();
console.log("Storage stats:", storageStats);
// Get storage usage
const { result: storageUsage } = await blobManager.getStorageUsage();
console.log("Storage usage:", storageUsage);
// Get subnet stats
const { result: subnetStats } = await blobManager.getSubnetStats();
console.log("Subnet stats:", subnetStats);
// Get blob status
const subscriber = "0x90f79bf6eb2c4f870365e785982e1f101e93b906";
const blobHash = "rzghyg4z3p6vbz5jkgc75lk64fci7kieul65o6hk6xznx7lctkmq";
const subscriptionId = "foobar";
const { result: blobStatus } = await blobManager.getBlobStatus(
subscriber,
blobHash,
subscriptionId,
);
console.log("Blob status:", blobStatus);
Note: although there are other blob-specific operations (like adding or deleting blobs), they are experimental. The bucket manager is the best way to interact with blobs on the network.
Install dependencies:
pnpm install
Run the tests:
pnpm run test
Build the package:
pnpm run build
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
MIT OR Apache-2.0, © 2025 Recall Network Corporation
FAQs
Core SDK for building with Recall EVM contracts
The npm package @recallnet/sdk receives a total of 18 weekly downloads. As such, @recallnet/sdk popularity was classified as not popular.
We found that @recallnet/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.