JavaScript
Installation
npm install @web3shield/insurance-coreyarn add @web3shield/insurance-coreImplementation
import { W3SInsurance } from "@web3shield/insurance-core";
// Initialize W3SInsurance with your API key
const apiKey = "your-api-key";
const web3shield = new W3SInsurance(apiKey);
async example = () => {
const user = '0xuserAddress';
const amount = 100;
const source = 'source_chain_id';
const destination = 'destination_chain_id';
const sourceToken = '0xsourceTokenAddress';
const destinationToken = '0xdestinationTokenAddress';
const result = await web3shield.getInsurance(
user,
amount,
source,
destination,
sourceToken,
destinationToken
);
}Types
W3SInsurance
Constructor
Parameter
Type
Description
getInsurance()
Parameter
Type
Description
Return Value
Type
Description
Last updated