JavaScript

Note: The package has not been published, please contact us or fill out this form for access

Our foundational package, crafted to interface directly with your backend, retrieves essential insurance information tailored for your project. Flexible in its application, it's designed to function smoothly whether integrated into your project's frontend or backend, ensuring a seamless connection to Web3Shield's insurance services.

Installation

npm install @web3shield/insurance-core

Implementation

In your main.js setup the following

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

getInsurance()

Last updated