@synapsecns/widget
Version:
Widget library for interacting with the Synapse Protocol
164 lines (146 loc) • 4.79 kB
TypeScript
import { JsonRpcApiProvider, BrowserProvider } from 'ethers';
interface BridgeableToken {
addresses: {}
decimals: {}
symbol: string
name: string
swapableType: string
color: string
priorityRank: number
routeSymbol: string
imgUrl: string
}
interface BridgeSelections {
originChain: {
id: number | null
name: string | null
}
destinationChain: {
id: number | null
name: string | null
}
originToken: {
symbol: string | null
address: string | null
}
destinationToken: {
symbol: string | null
address: string | null
}
}
interface CustomThemeVariables {
bgColor?: string
'--synapse-text'?: string
'--synapse-secondary'?: string
'--synapse-select-bg'?: string
'--synapse-surface'?: string
'--synapse-root'?: string
'--synapse-border'?: string
'--synapse-focus'?: string
'--synapse-accent'?: string
}
type CustomRpcs = {
[chainId: number]: string
}
interface BridgeProps {
/** Consumer Web3 Provider */
web3Provider: JsonRpcApiProvider | BrowserProvider
/** Consumer selected RPCs */
customRpcs?: CustomRpcs
/** Apply Custom Themes */
customTheme?: CustomThemeVariables
/** Containerize Widget */
container?: Boolean
/** Target tokens supported for Consumer */
targetTokens?: BridgeableToken[]
/* Target chain ids of Consumer */
targetChainIds?: number[]
/* Custom name prop for consumer protocol */
protocolName?: string
/* Supress Consumer browser console errors */
hideConsoleErrors?: boolean
}
interface Chain {
id: number
name: string
rpcUrls: {
primary: string
fallback: string
}
explorerUrl: string
explorerName: string
blockTime: number
imgUrl: string
networkName: string
networkUrl: string
nativeCurrency: {
name: string
symbol: string
decimals: number
}
}
declare function Bridge(props: BridgeProps): JSX.Element
declare function useBridgeSelections(): BridgeSelections
declare const AGEUR: BridgeableToken
declare const AVAX: BridgeableToken
declare const BTCB: BridgeableToken
declare const BUSD: BridgeableToken
declare const CRVUSD: BridgeableToken
declare const DAI: BridgeableToken
declare const DAIe: BridgeableToken
declare const DOG: BridgeableToken
declare const ETH: BridgeableToken
declare const FRAX: BridgeableToken
declare const FTM: BridgeableToken
declare const GMX: BridgeableToken
declare const GOHM: BridgeableToken
declare const H2O: BridgeableToken
declare const HIGH: BridgeableToken
declare const JEWEL: BridgeableToken
declare const JUMP: BridgeableToken
declare const KLAY: BridgeableToken
declare const L2DAO: BridgeableToken
declare const LINK: BridgeableToken
declare const LUSD: BridgeableToken
declare const MATIC: BridgeableToken
declare const METISUSDC: BridgeableToken
declare const MOVR: BridgeableToken
declare const NETH: BridgeableToken
declare const NEWO: BridgeableToken
declare const NFD: BridgeableToken
declare const NOTE: BridgeableToken
declare const NUSD: BridgeableToken
declare const ONEDAI: BridgeableToken
declare const ONEETH: BridgeableToken
declare const ONEUSDC: BridgeableToken
declare const ONEUSDT: BridgeableToken
declare const PEPE: BridgeableToken
declare const PLS: BridgeableToken
declare const SDT: BridgeableToken
declare const SFI: BridgeableToken
declare const SOLAR: BridgeableToken
declare const SUSD: BridgeableToken
declare const SYN: BridgeableToken
declare const SYNFRAX: BridgeableToken
declare const SYNJEWEL: BridgeableToken
declare const SPECTRAL: BridgeableToken
declare const UNIDX: BridgeableToken
declare const USDB: BridgeableToken
declare const USDBC: BridgeableToken
declare const USDC: BridgeableToken
declare const USDCe: BridgeableToken
declare const USDT: BridgeableToken
declare const USDTe: BridgeableToken
declare const VSTA: BridgeableToken
declare const WAVAX: BridgeableToken
declare const WBTC: BridgeableToken
declare const WETH: BridgeableToken
declare const WETHE: BridgeableToken
declare const WFTM: BridgeableToken
declare const WJEWEL: BridgeableToken
declare const WKLAY: BridgeableToken
declare const WMATIC: BridgeableToken
declare const WMOVR: BridgeableToken
declare const WSOHM: BridgeableToken
declare const XJEWEL: BridgeableToken
export { AGEUR, AVAX, BTCB, BUSD, Bridge, type BridgeProps, type BridgeSelections, type BridgeableToken, CRVUSD, type Chain, type CustomRpcs, type CustomThemeVariables, DAI, DAIe, DOG, ETH, FRAX, FTM, GMX, GOHM, H2O, HIGH, JEWEL, JUMP, KLAY, L2DAO, LINK, LUSD, MATIC, METISUSDC, MOVR, NETH, NEWO, NFD, NOTE, NUSD, ONEDAI, ONEETH, ONEUSDC, ONEUSDT, PEPE, PLS, SDT, SFI, SOLAR, SPECTRAL, SUSD, SYN, SYNFRAX, SYNJEWEL, UNIDX, USDB, USDBC, USDC, USDCe, USDT, USDTe, VSTA, WAVAX, WBTC, WETH, WETHE, WFTM, WJEWEL, WKLAY, WMATIC, WMOVR, WSOHM, XJEWEL, useBridgeSelections };