
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@zerodev/intent
Advanced tools
Chain Abstraction SDK for ZeroDev, built on top of @zerodev/sdk.
bun add @zerodev/intent
import { createIntentClient } from '@zerodev/intent'
import { mainnet, polygon, base, optimism } from 'viem/chains'
const client = createIntentClient({
chain: mainnet,
bundlerTransport: http(),
// Optional transports
intentTransport: http(),
relayerTransport: http(),
})
// Flow 1: Direct send
const result1 = await client.sendUserIntent({
calls: [{
to: '0x...',
value: 0n,
data: '0x...'
}],
inputTokens: [{
address: '0x...',
chainId: 1
}],
outputTokens: [{
address: '0x...',
amount: 900000n,
chainId: 10
}]
})
// Flow 2: Prepare then send
// First prepare the intent
const intent = await client.prepareUserIntent({
calls: [{
to: '0x...',
value: 0n,
data: '0x...'
}],
inputTokens: [{
address: '0x...',
chainId: 1
}],
outputTokens: [{
address: '0x...',
amount: 900000n,
chainId: 10
}]
})
// Then send the prepared intent
const result2 = await client.sendUserIntent({
intent
})
// Wait for the intent to be opened (works for both flows)
const openReceipt = await client.waitForUserIntentOpenReceipt({
uiHash: result1.uiHash, // or result2.uiHash
});
// Wait for the intent to be executed (works for both flows)
const executionReceipt = await client.waitForUserIntentExecutionReceipt({
uiHash: result1.uiHash, // or result2.uiHash
});
// Get consolidated account balances
// Using connected account
const balances1 = await client.getCAB({
networkType: "mainnet" // or "testnet"
})
// Using specific address with network filter
const balances2 = await client.getCAB({
accountAddress: "0x...",
tokenTickers: ["ETH", "USDC"],
networks: [mainnet.id, polygon.id] // Using viem chain IDs
})
// Example response structure
const balances = await client.getCAB({
networks: [base.id, optimism.id],
tokenTickers: ["USDC"]
})
// Response:
{
tokens: [{
ticker: "USDC",
amount: "0x1234...", // Normalized total amount across chains (using decimal field)
decimal: 6, // Lowest decimal among all chains (for normalization)
breakdown: [{
chainId: 8453, // base chain ID
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
amount: "0x0abc..." // Original amount with chain-specific decimals (6)
}, {
chainId: 10, // optimism chain ID
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
amount: "0x0def..." // Original amount with chain-specific decimals (6)
}]
}]
}
# Install dependencies
bun install
# Build
bun run build
# Test
bun test
# Lint
bun run lint
# Format
bun run format
MIT
FAQs
Chain Abstraction SDK for ZeroDev, built on top of @zerodev/sdk.
The npm package @zerodev/intent receives a total of 630 weekly downloads. As such, @zerodev/intent popularity was classified as not popular.
We found that @zerodev/intent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.