Links

React Native

1.Add the Wallet Service SDK to Your React Native App

Run this command:
npm install react-native-particle-wallet
click here to get the demo source code

2.Configure Android project

3.Configure iOS project

is same with Connect Service

Initialize the SDK

Before using the SDK, you have to call init(Required)
const chainInfo = ChainInfo.EthereumGoerli;
const env = Env.Dev;
const metadata = { name: "Particle Connect", icon: "https://connect.particle.network/icons/512.png", url: "https://connect.particle.network" }
const rpcUrl = { evm_url: null, solana_url: null };
particleConnect.init(chainInfo, env, metadata, rpcUrl);
particleWallet.initWallet()
const display = WalletDisplay.Token;
particleWallet.navigatorWallet(display);
const tokenAddress = TestAccountSolana.tokenContractAddress;
particleWallet.navigatorTokenReceive(tokenAddress);
const tokenAddress = TestAccountSolana.tokenContractAddress;
const toAddress = TestAccountSolana.receiverAddress;
const amount = "1000000000";
particleWallet.navigatorTokenSend(tokenAddress, toAddress, amount);
const tokenAddress = TestAccountSolana.tokenContractAddress;
particleWallet.navigatorTokenTransactionRecords(tokenAddress);
const mint = TestAccountEVM.nftContractAddress;
const receiverAddress = TestAccountEVM.receiverAddress;
const tokenId = TestAccountEVM.nftTokenId;
particleWallet.navigatorNFTSend(receiverAddress, mint, tokenId);
const mint = TestAccountEVM.nftContractAddress;
const tokenId = TestAccountEVM.nftTokenId;
particleWallet.navigatorNFTDetails(mint, tokenId);

Enable pay

const isEnable = true;
particleWallet.enablePay(isEnable);

Get enable pay

const result = await particleWallet.getEnablePay();
console.log(result);

Enable swap

const isEnable = true;
particleWallet.enableSwap(isEnable);

Get enable swap

const result = await particleWallet.getEnableSwap();
console.log(result);
// support no parameters
particleWallet.navigatorBuyCrypto();
// also support pass public address, crypto symbol and so on.
const config = new BuyCryptoConfig("0xa0869E99886e1b6737A4364F2cf9Bb454FD637E4", "BNB", "USD", 1000, OpenBuyNetwork.BinanceSmartChain);
particleWallet.navigatorBuyCrypto(config);
const fromTokenAddress = "";
const toTokenAddress = "";
const amount = "";
particleWallet.navigatorSwap(fromTokenAddress, toTokenAddress, amount);
const result = await particleWallet.navigatorLoginList();
console.log(result)

Set Support chain

const chainInfos = [ChainInfo.EthereumMainnet, ChainInfo.BscMainnet, ChainInfo.PolygonMainnet];
particleWallet.supportChain(chainInfos);

Switch wallet

WalletType walletType = WalletType.particle;
String publicAddress = "";
String result = await ParticleWallet.switchWallet(walletType, publicAddress);
print("result:$result");

Show test network

const isShow = true;
particleWallet.showTestNetwork(isShow);

Show manage wallet

const isShow = true;
particleWallet.showManageWallet(isShow);

Set language

const language = Language.Zh_hans
particleWallet.setLanguage(language);

Set interface style

const userInterfaceStyle = UserInterfaceStyle.Light
particleWallet.setInterfaceStyle(userInterfaceStyle);