React
Note: The package has not been published, please contact us or fill out this form for access
Built upon our core JavaScript package, the React SDK is tailored for projects leveraging React's dynamic ecosystem. Featuring an intuitive hook, it simplifies integration into existing React applications, particularly within bridging components. This wrapper aims to streamline the inclusion of insurance functionalities, making it an effortless addition to your React-based projects.
Installation
Basic Implementation
Provider Setup
Hook Setup
Types
Web3ShieldProvider
apiKey
string
Web3Shield Project API Key
logs
boolean
Enable or disable logs, false
by default
environment
mainnet
| testnet
| local
Select which Web3Shield environment to operate in, local
by default
useInsurance()
user
string
Address of the user opting in for insurance
amount
string | number | BigNumber
Amount of sourceToken
being bridged
source
string
Chain ID of the source chain
destination
string
Chain ID of the destination chain
sourceToken
string
Address of the source token
destinationToken
string
Address of the destination token
message
string
Relevant success/error message
premium
float
Premium amount to be paid to cover amount
of sourceToken
premiumValue
float
Value of premium in USD
minimumPremium
float
Minimum premium amount to be paid (in USD)
timeLeft
number
Time left until insurance expires
refetch
function
Manually trigger the refetching of insurance data
Signing Implementation
Coming Soon
Last updated