Recommended: JavaScript SDK for React Native
While this SDK is still supported, we recommend using newer JavaScript SDK, which is optimized for React Native, but also comes with a host of other benefits.
Checking if a Wallet is a Sui Wallet
import { createClient } from '@dynamic-labs/client'
import { SuiExtension } from '@dynamic-labs/sui-extension'
export const dynamicClient = createClient({
environmentId: 'YOUR-ENVIRONMENT-ID',
}).extend(SuiExtension())
import { isSuiWallet } from '@dynamic-labs/sui';
import { dynamicClient } from './dynamicClient';
const wallet = dynamicClient.wallets.primary
if (!wallet || !isSuiWallet(wallet)) {
throw new Error('This wallet is not a Sui wallet');
}
Fetch Client
import { createClient } from '@dynamic-labs/client'
import { SuiExtension } from '@dynamic-labs/sui-extension'
export const dynamicClient = createClient({
environmentId: 'YOUR-ENVIRONMENT-ID',
}).extend(SuiExtension())
import { dynamicClient } from './dynamicClient';
import { SuiClient } from '@mysten/sui.js/client'
const wallet = dynamicClient.wallets.primary
if (!wallet) {
throw new Error('This wallet is not found');
}
const networkUrl = await dynamicClient.sui.getNetworkUrl({ walletId: wallet.id })
const suiClient = new SuiClient({ url: networkUrl })
const signer = dynamicClient.sui.getSigner({ wallet })
Fetch Network
React Native
import { dynamicClient } from '<path to client file>';
import { SuiClient } from '@mysten/sui.js/client'
const wallet = dynamicClient.wallets.primary
if (!wallet) {
throw new Error('This wallet is not found');
}
const networkUrl = await dynamicClient.sui.getNetworkUrl({ walletId: wallet.id })
const networkName = await dynamicClient.sui.getNetworkName({ walletId: wallet.id })
## Resources
[SuiClient](https://sdk.mystenlabs.com/typedoc/classes/_mysten_sui.client.SuiClient.html)
[WalletAccount](https://docs.sui.io/standards/wallet-standard#managing-wallets)
## Examples
You can find examples of how to interact with Sui wallets in the examples section:
- [Send a Sui Transaction](/react-native/wallets/using-wallets/sui/send-sui-transaction)