
From 35dd72e0931ec1930cf700307e092a1fd0878ea2 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:16:42 +0800 Subject: [PATCH] add method for begin buy and cancel order --- src/components/chain/Market.js | 7 +++--- src/views/DetailView.vue | 41 +++++++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/components/chain/Market.js b/src/components/chain/Market.js index 8d46bf7..65c6c3c 100644 --- a/src/components/chain/Market.js +++ b/src/components/chain/Market.js @@ -33,7 +33,7 @@ export class ImtblMarket { * 准备一个ERC721的挂单 * @returns */ - async _prepareERC721Listing({ contractAddress, tokenId, type = 'ERC721', currencyAddress, currencyAmount}){ + async _prepareERC721Listing({ contractAddress, tokenId, type = 'ERC721', currencyAddress, currencyAmount, orderExpiry}){ const offerer = await this.signer.getAddress(); const buyData = { amount: currencyAmount, @@ -52,6 +52,7 @@ export class ImtblMarket { tokenId, type, }, + orderExpiry }); let orderSignature = '' @@ -112,9 +113,9 @@ export class ImtblMarket { * @param {string} currencyAddress NATIVE 或者 ERC20的合约地址 * @param {string} currencyAmount 出售价格, 单位 wei */ - async beginSellERC721({contractAddress, tokenId, currencyAddress, currencyAmount}) { + async beginSellERC721({contractAddress, tokenId, currencyAddress, currencyAmount, orderExpiry}) { const { preparedListing, orderSignature } = - await this._prepareERC721Listing({contractAddress, tokenId, currencyAddress, currencyAmount}); + await this._prepareERC721Listing({contractAddress, tokenId, currencyAddress, currencyAmount, orderExpiry}); const order = await this._createListing(preparedListing, orderSignature, currencyAmount); return order } diff --git a/src/views/DetailView.vue b/src/views/DetailView.vue index 2571264..1dc6cac 100644 --- a/src/views/DetailView.vue +++ b/src/views/DetailView.vue @@ -5,7 +5,7 @@