CDS Buyer

Buyer

readUserTurnover

Read the turnover that the buyers have done

import { readUserTurnover } from "derivstudio/cds";
let queryTransaction = readUserTurnover(_eventId,_user);
let ret = sdk.query(queryTransaction);

** Request **

Params

Type

Description

_eventId

uint256

event id

_user

address

user address

**Response **

Params

Type

Description

turnover

uint256

The amount of turnover

readIsBuyer

Read if the user is a buyer

import { readIsBuyer } from "derivstudio/cds";
let queryTransaction = readIsBuyer(_eventId,user);
let ret = sdk.query(queryTransaction);

** Request **

Params

Type

Description

_eventId

uint256

event id

** Response **

Params

Type

Description

isBuyer

boolean

is buyer

userBuy

Users buy CDS

import { userBuy } from "derivstudio/cds";
let transaction = userBuy(_eventId,_amount);

Params

Type

Description

_eventId

uint256

cds event id

_amount

uint256

buy amount

buyerSettlement

Users settle CDS

import { buyerSettlement } from "derivstudio/cds";
let transaction = buyerSettlement(_eventId);

params

type

Description

_eventId

uint256

cds event id

Last updated