
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.
@cometh/crosschain-sdk
Advanced tools
The Crosschain SDK is designed to facilitate cross-chain operations and interactions within dApps.
bun add @cometh/crosschain-sdk
import { MOCK_ATTESTER_ADDRESS } from "@rhinestone/module-sdk";
import { createPublicClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { createPimlicoClient } from "permissionless/clients/pimlico";
import {
createPaymasterClient,
entryPoint07Address,
} from "viem/account-abstraction";
import { createSmartAccountClient } from "permissionless";
import { toSafeSmartAccount } from "permissionless/accounts";
import { erc7579Actions } from "permissionless/actions/erc7579";
const bundlerUrl = process.env.NEXT_PUBLIC_4337_BUNDLER_URL!;
const paymasterUrl = process.env.NEXT_PUBLIC_4337_PAYMASTER_URL!;
const ownerPK = process.env.NEXT_PUBLIC_PRIVATE_KEY!;
const rpc = process.env.NEXT_PUBLIC_RPC_URL!;
const masterOwner = privateKeyToAccount(ownerPK);
const publicClient = createPublicClient({
transport: http(rpc),
chain: baseSepolia,
});
const pimlicoClient = createPimlicoClient({
transport: http(bundlerUrl),
entryPoint: {
address: entryPoint07Address,
version: "0.7",
},
});
const paymasterClient = createPaymasterClient({
transport: http(paymasterUrl),
});
const safeAccount = await toSafeSmartAccount({
client: publicClient,
owners: [owner],
version: "1.4.1",
entryPoint: {
address: entryPoint07Address,
version: "0.7",
},
safe4337ModuleAddress: "0x7579EE8307284F293B1927136486880611F20002",
erc7579LaunchpadAddress: "0x7579011aB74c46090561ea277Ba79D510c6C00ff",
attesters: [
MOCK_ATTESTER_ADDRESS, // Mock Attester - do not use in production
],
attestersThreshold: 1,
});
const smartAccountClient = createSmartAccountClient({
account: safeAccount,
chain: publicClient.chain,
bundlerTransport: http(bundlerUrl),
paymaster: paymasterClient,
userOperation: {
estimateFeesPerGas: async () => {
return (await pimlicoClient.getUserOperationGasPrice()).fast;
},
},
}).extend(erc7579Actions());
import {
getOwners,
registerOwnerOnKeystore,
deleteOwnerOnKeystore,
} from "@cometh/crosschain-sdk";
import { privateKeyToAccount } from "viem/accounts";
const ownerPK = privateKeyToAccount(PK as Hex);
const txHash = await registerOwnerOnKeystore({
smartAccountClient,
owner: masterOwner,
});
const owners = await getOwners({
smartAccountClient,
publicClient,
});
const txHash = await deleteOwnerOnKeystore({
smartAccountClient,
owner: masterOwner,
});
import { getCrosschainValidator } from "@cometh/crosschain-sdk";
const crossChainValidator = getCrosschainValidator();
const opHash = await smartAccountClient.installModule(crossChainValidator);
await pimlicoClient.waitForUserOperationReceipt({
hash: opHash,
});
const userOpHash = await sendCrossChainTransaction({
smartAccountClient,
masterOwner,
contractAddress,
callData,
});
const receipt = await pimlicoClient.waitForUserOperationReceipt({
hash: userOpHash,
});
import { sendCrossChainCalls } from "@cometh/crosschain-sdk";
const userOpHash = await sendCrossChainCalls({
smartAccountClient,
masterOwner,
calls: [
{
to: contractAddress,
data: callData1,
value: 0n,
},
{
to: contractAddress,
data: callData2,
value: 0n,
},
],
});
const receipt = await pimlicoClient.waitForUserOperationReceipt({
hash: userOpHash,
});
import { prepareCrossChainUserOperation } from "@cometh/crosschain-sdk";
const userOperation = await prepareCrossChainUserOperation({
smartAccountClient,
masterOwner,
calls,
});
FAQs
SDK Cometh Crosschain
We found that @cometh/crosschain-sdk 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.
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.