
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@sophon-labs/account-react
Advanced tools
React hooks and utilities for integrating Sophon swap functionality into React applications. This package provides a comprehensive set of hooks for managing token swaps, ERC-20 approvals, and gas estimation within the Sophon ecosystem.
npm install @sophon-labs/account-react
# or
yarn add @sophon-labs/account-react
useGetSwapTransactionPrepare a swap transaction by calling the /swap/transaction endpoint.
import { useGetSwapTransaction } from '@sophon-labs/account-react';
const { data, isLoading, error } = useGetSwapTransaction(
{
config: {
fromToken: '0x...',
toToken: '0x...',
amount: '1000000000000000000',
slippage: 0.005
},
enabled: true
},
{
baseUrl: 'https://api.sophon.xyz',
partnerId: 'your-partner-id'
}
);
useGetSwapStatusTrack the status of a swap transaction.
import { useGetSwapStatus } from '@sophon-labs/account-react';
const { data, isLoading, error } = useGetSwapStatus(
{
txHash: '0x...',
enabled: true
},
{
baseUrl: 'https://api.sophon.xyz',
partnerId: 'your-partner-id'
}
);
useERC20ApprovalManage ERC-20 token approvals for swap contracts.
import { useERC20Approval } from '@sophon-labs/account-react';
const { approve, allowance, isLoading, error } = useERC20Approval({
tokenAddress: '0x...',
spenderAddress: '0x...',
account: '0x...'
});
useGasEstimationEstimate gas costs for transactions.
import { useGasEstimation } from '@sophon-labs/account-react';
const { gasEstimate, isLoading, error } = useGasEstimation({
transaction: {
to: '0x...',
data: '0x...',
value: '0'
}
});
The package includes utilities for making API calls to Sophon services:
import { createApiClient, serializeSwapConfig } from '@sophon-labs/account-react';
const apiClient = createApiClient({
baseUrl: 'https://api.sophon.xyz',
partnerId: 'your-partner-id'
});
All hooks and utilities are fully typed. Import types for better development experience:
import type {
SwapApiConfig,
UnifiedTransactionResponse,
SwapStatus
} from '@sophon-labs/account-react';
# Install dependencies
npm install
# Build the package
npm run build
# Run tests
npm run test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:ci
FAQs
React components for Sophon Account
The npm package @sophon-labs/account-react receives a total of 4 weekly downloads. As such, @sophon-labs/account-react popularity was classified as not popular.
We found that @sophon-labs/account-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.