Ticket Market

Ticket Market

readSaleInfo

Read information of sale

import { readSaleInfo } from "derivstudio/cds";
let queryTransaction = readSaleInfo(_owner,_token,_token_id);
let ret = sdk.query(queryTransaction);

** Request **

Params

Type

Description

_owner

address

owner

_token

address

nft contract address

_token_id

uint256

token id

** Response **

Params

Type

Description

payToken

address

base token

price

uint256

sale price

term

uint256

rent term (s)

amount

uint256

rent amount at the time of rental

rental

bool

true: rent ,false: sell

readFeeReceiver

Read the address for collecting service fee

import { readFeeReceiver } from "derivstudio/cds";
let queryTransaction = readFeeReceiver();
let ret = sdk.query(queryTransaction);

** Response **

Params

Type

Description

feeReceiver

address

fee receiver

readFeeRate

Read the fee rate

import { readFeeRate } from "derivstudio/cds";
let queryTransaction = readFeeRate();
let ret = sdk.query(queryTransaction);

** Response **

Params

Type

Description

feeRate

uint256

fee rate,decimals=4

readAllowToken

Read whether to pay tokens

import { readAllowToken } from "derivstudio/cds";
let queryTransaction = readAllowToken(_token);
let ret = sdk.query(queryTransaction);

** Request **

Params

Type

Description

_token

address

tolen address

** Response **

Params

Type

Description

isPayToken

boolean

is pay token

Make

Rent or sell the NFT

import { make } from "derivstudio/market";
let transaction = buy(_stageNum,_catId,_tokenIndex,_amount);

Params

Type

Description

_token

address

pending order adress of nft

_tokenId

uint256

nft tokenId

_payToken

address

pay token

_price

uint256

pay price

_amount

uint256

pending oder amount of nft,if it is erc721, show 1

_term

uint256

rent term (s),sell is 0

_rental

bool

true means rent,false means sell

Take

Rent or sell the NFT

import { take } from "derivstudio/market";
let transaction = take(_seller,_token,_tokenId);

Params

Type

Description

_seller

address

address of renter

_token

address

nft address

_tokenId

uint256

nft tokenId

Cancel

Cancel the rent or sale of the ticket

import { cancel } from "derivstudio/market";
let transaction = cancel(_seller,_token,_tokenId);

Params

Type

Description

_seller

address

renter address

_token

address

nft address

_tokenId

uint256

nft tokenId

Last updated