0.2.0 • Published 2 years ago

bridgemutual v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

bridgemutual-sdk

  • async function
  • Get whitelisted policy list - async function
  • @param {Object} web3 - instance of web3
  • @param {Boolean} isTest - for use Rinkeby TestNet
  • @returns {Object} List of whitelisted polices

    _getWhitelistedContracts(web3, isTest);

  • async function

  • Get Approve - async function
  • @param {Number} id - Id of policy
  • @param {Object} web3 - instance of web3
  • @param {Number} weeks - period of policy
  • @param {Number} amount - amount of policy
  • @param {String} userAddress - user address (in ETH)
  • @returns contract

    getApprove(id, web3, weeks, amount, userAddress, isTest);

  • async function

  • Policy Purchase
  • @param {Object} contract - instance of contract after buyPolicy method
  • @param {String} userAddress - user address (in ETH)
  • @param {Number} weeks - period of policy
  • @param {Number} amount - amount of policy
  • @param {String} referralAddress - referral of Address
  • @returns policy purchase result

    policyPurchase (contract, userAddress, weeks, amount, referralAddress);

  • async function

  • Get Approve
  • @param {Number} id - Id of policy
  • @param {Object} web3 - instance of web3
  • @param {Number} amount - amount of coverage
  • @param {String} userAddress - user address (in ETH)
  • @param {Boolean} isTest - for use Rinkeby TestNet
  • @returns contract

    getCoverageApprove (id, web3, amount, userAddress, isTest);

  • async function

  • Policy Purchase
  • @param {Object} contract - instance of contract after buyPolicy method
  • @param {String} userAddress - user address (in ETH)
  • @param {Number} amount - amount of coverage
  • @returns policy purchase result

    provideCoverage (contract, userAddress, amount);

  • Get purchased insurance

  • @param {Object} web3 - instance of web3
  • @param {String} userAddress - user address (in ETH)
  • @param {Boolean} active - active/unactive policies
  • @param {Number} offset - offset
  • @param {Number} limit - limit
  • @param {Boolean} isTest - for use Rinkeby TestNet
  • @returns list purchased policies

    getPurchasedPolicies (web3, userAddress, active, offset, limit, isTest);

    Example

    import {buyPolicy, _getWhitelistedContracts} from 'bridgemutual';

    _getWhitelistedContracts(web3).then((policies) => { policies <== Policies List } )

    buyPolicy('0x84422411c84B5818Cf775AEB27B6554024B71A97', web3, 4, 10, 0x0000000000000000000000).then()

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.2

3 years ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago