This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { type ConnectParam, type EIP1193Provider } from '@particle-network/auth-core'; | |
import { ChainNotConfiguredError, createConnector, normalizeChainId } from '@wagmi/core'; | |
import { SmartAccount, AAWrapProvider, SendTransactionMode } from '@particle-network/aa'; | |
import { SwitchChainError, UserRejectedRequestError, getAddress, numberToHex, type ProviderRpcError } from 'viem'; | |
import { ethers } from 'ethers'; | |
particleWagmiWallet.type = 'particleWallet' as const; | |
export function particleWagmiWallet(param?: ConnectParam) { | |
type Provider = EIP1193Provider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 3, | |
"sources": ["../src/index.ts", "../src/chains.ts"], | |
"sourcesContent": ["import { type ChainInfo } from './types';\n\nexport * as chains from './chains';\nexport * from './types';\n\n// template code start\nexport const Ethereum: ChainInfo = {\n id: 1,\n name: 'Ethereum',\n chainType: 'evm',\n icon: 'https://static.particle.network/token-list/ethereum/native.png',\n nativeIcon: '',\n fullname: 'Ethereum Mainnet',\n network: 'Mainnet',\n website: 'https://ethereum.org',\n nativeCurrency: {\n name: 'Ether',\n symbol: 'ETH',\n decimals: 18,\n },\n rpcUrl: 'https://ethereum.publicnode.com',\n blockExplorerUrl: 'https://etherscan.io',\n features: [{ name: 'EIP1559' }],\n};\n\nexport const Optimism: ChainInfo = {\n id: 10,\n name: 'Optimism',\n chainType: 'evm',\n icon: 'https://static.particle.network/token-list/optimism/native.png',\n nativeIcon: '',\n fullname: 'Optimism Mainnet',\n network: 'Mainnet',\n webs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { type ChainInfo } from './types'; | |
export * as chains from './chains'; | |
export * from './types'; | |
export declare const Ethereum: ChainInfo; | |
export declare const Optimism: ChainInfo; | |
export declare const ThunderCoreTestnet: ChainInfo; | |
export declare const Cronos: ChainInfo; | |
export declare const BNBChain: ChainInfo; | |
export declare const OKTCTestnet: ChainInfo; | |
export declare const OKTC: ChainInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { XLayer, XLayerTestnet } from '@particle-network/chains'; | |
import { AAWrapProvider, SendTransactionMode, SmartAccount } from '@particle-network/aa'; | |
import { useEthereum, useConnect, useAuthCore } from '@particle-network/auth-core-modal'; | |
import { ethers } from 'ethers'; | |
import { notification } from 'antd'; | |
import './App.css'; | |
const App = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* src/styles/root.css */ | |
.particle-connect-ui-theme-ligth { | |
--bg-color: #FFFFFF; | |
--font-color1: #000000; | |
--font-color2: rgba(60, 66, 66, 0.6); | |
--font-color3: rgba(107, 113, 146, 1); | |
--scoll-bar-color: rgba(0, 0, 0, 0.3); | |
--hover-color: rgba(0, 0, 0, 0.3); | |
--hover-color2: rgba(81, 119, 249, 0.05); | |
--active-color: rgba(0, 0, 0, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import ReactDOM from 'react-dom/client'; | |
import { ethers } from 'ethers'; | |
import { notification } from 'antd'; | |
import { useEthereum, useConnect, useAuthCore, AuthCoreContextProvider } from '@particle-network/auth-core-modal'; | |
import { AAWrapProvider, SmartAccount, SendTransactionMode } from '@particle-network/aa'; | |
import { BerachainArtio } from '@particle-network/chains'; | |
import './App.css'; | |
const App = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { AuthType } from '@particle-network/auth'; | |
import type { ParticleProvider } from '@particle-network/provider'; | |
import type { Chain } from '@rainbow-me/rainbowkit'; | |
import { Address, Connector, ConnectorData } from 'wagmi'; | |
declare type ParticleAuth = ConstructorParameters<typeof ParticleProvider>[0]; | |
declare type ParticleOptions = { | |
auth?: ParticleAuth; | |
authType?: AuthType; | |
}; | |
export declare class ParticleConnector extends Connector<ParticleProvider, ParticleOptions> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { ParticleNetwork } from '@particle-network/auth'; | |
import { ParticleProvider } from '@particle-network/provider'; | |
import { Viction } from '@particle-network/chains'; | |
import { AAWrapProvider, SmartAccount } from '@particle-network/aa'; | |
import { ethers } from 'ethers'; | |
const config = { | |
projectId: process.env.REACT_APP_PROJECT_ID, | |
clientKey: process.env.REACT_APP_CLIENT_KEY, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { ParticleNetwork } from '@particle-network/auth'; | |
import { ParticleProvider } from '@particle-network/provider'; | |
import { EthereumGoerli } from '@particle-network/chains'; | |
import { AAWrapProvider, SmartAccount, SendTransactionMode } from '@particle-network/aa'; | |
import { ethers } from 'ethers'; | |
const config = { | |
projectId: process.env.REACT_APP_PROJECT_ID, | |
clientKey: process.env.REACT_APP_CLIENT_KEY, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { ParticleNetwork } from '@particle-network/auth'; | |
import { ParticleProvider } from '@particle-network/provider'; | |
import { Avalanche } from '@particle-network/chains'; | |
import { AAWrapProvider, SmartAccount, SendTransactionMode } from '@particle-network/aa'; | |
import { ethers } from 'ethers'; | |
const config = { | |
projectId: process.env.REACT_APP_PROJECT_ID, | |
clientKey: process.env.REACT_APP_CLIENT_KEY, |
NewerOlder