增加market和商城相关方法

This commit is contained in:
CounterFire2023 2023-06-15 19:00:07 +08:00
parent 36adefd2a3
commit f0630a33d9
2 changed files with 102 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@ -384,3 +384,92 @@ function formatPrice(funId, value, decimal, fixed) {
return JSON.stringify({ errcode: 1, errmsg: err.message || err });
}
}
// begin of market
// begin sell nft with market
function marketSellNFT(
funId,
nftToken,
currency,
tokenId,
price,
amount,
estimate
) {
promiseCb(
funId,
jc.wallet.jcStandard.marketSellNFT({
nftToken,
currency,
tokenId,
price,
amount,
estimate,
}),
(v) => JSON.stringify(v)
);
}
// update price of order
function marketUpdatePrice(funId, orderId, price, estimate) {
promiseCb(
funId,
jc.wallet.jcStandard.marketUpdatePrice({
orderId,
price,
estimate,
}),
(v) => JSON.stringify(v)
);
}
// cancel order
function marketCancelOrder(funId, orderId, estimate) {
promiseCb(
funId,
jc.wallet.jcStandard.marketCancelOrder({
orderId,
estimate,
}),
(v) => JSON.stringify(v)
);
}
// buy order
function marketBuy(funId, orderId, estimate) {
promiseCb(
funId,
jc.wallet.jcStandard.marketBuy({
orderId,
estimate,
}),
(v) => JSON.stringify(v)
);
}
// end of market
// begin of mall
// buy item of game from mall
function gameMallBuy(
funId,
orderId,
currency,
price,
startTime,
saltNonce,
signature,
estimate
) {
promiseCb(
funId,
jc.wallet.jcStandard.gameMallBuy({
orderId,
currency,
price,
startTime,
saltNonce,
signature,
estimate,
}),
(v) => JSON.stringify(v)
);
}
// end of mall