Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@mysten/dapp-kit
Advanced tools
A collection of React hooks and components for interacting with the Sui blockchain and wallets.
The Sui dApp Kit is a set of React components, hooks, and utilities that make it easy to build a dApp for the Sui ecosystem. It provides hooks and components for querying data from the Sui blockchain, and connecting to Sui wallets.
See https://sui-typescript-docs.vercel.app/typescript for full documentation
To use the Sui dApp Kit in your project, run the following command in your project root:
npm i --save @mysten/dapp-kit @mysten/sui.js @tanstack/react-query
To be able to use the hooks and components in the dApp Kit, you need to wrap your app with a couple providers. The props available on the providers are covered in more detail in their respective docs pages.
import { SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { type SuiClientOptions } from '@mysten/sui.js/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
// Config options for the networks you want to connect to
const networks = {
localnet: { url: getFullnodeUrl('localnet') },
mainnet: { url: getFullnodeUrl('mainnet') },
} satisfies Record<string, SuiClientOptions>;
const queryClient = new QueryClient();
function App() {
return (
<QueryClientProvider client={queryClient}>
<SuiClientProvider networks={networks} defaultNetwork="localnet">
<WalletProvider>
<YourApp />
</WalletProvider>
</SuiClientProvider>
</QueryClientProvider>
);
}
The dApp Kit provides a set of hooks for making rpc calls to the Sui blockchain. The hooks are thin
wrappers around useQuery
from @tanstack/react-query
. For more comprehensive documentation on how
these query hooks checkout the
react-query docs.
import { useSuiClientQuery } from '@mysten/dapp-kit';
function MyComponent() {
const { data, isLoading, error, refetch } = useSuiClientQuery('getOwnedObjects', {
owner: '0x123',
});
if (isLoading) {
return <div>Loading...</div>;
}
return <pre>{JSON.stringify(data, null, 2)}</pre>;
}
FAQs
A collection of React hooks and components for interacting with the Sui blockchain and wallets.
The npm package @mysten/dapp-kit receives a total of 3,641 weekly downloads. As such, @mysten/dapp-kit popularity was classified as popular.
We found that @mysten/dapp-kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.