1.0.2 • Published 1 year ago
test_react_sdk v1.0.2
Use
import { CountryMap, useMarketplace } from 'test_react_sdk'
function tets_Sdk(){
const { sellParcel, auctionParcel, removeFromSell, removeAuction , buyParcel, bidParcel, finalizeAuction } = useMarketplace("Your Web3 Provider");
const parcelPutOnSale = () => {
const sellResponse = sellParcel("Enter Your Sell Price", 'BNB');
console.log("sellResponse",sellResponse)
}
const parcelPutOnAuction = () => {
const auctionResponse = auctionParcel("Enter Your Auction Price", 'BNB', "Auction Start Date", "Auction Ends Date");
console.log("auctionResponse",auctionResponse)
}
const parcelRemoveFromSale = () => {
const removeSellResponse = removeFromSell();
console.log("removeSellResponse",removeSellResponse)
}
const parcelRemoveFromAuction = () => {
const removeAuctionResponse = removeAuction();
console.log("removeAuctionResponse",removeAuctionResponse)
}
const parcelbuy = () => {
const buyparcelResopnse = buyParcel();
console.log("buyparcelResopnse",buyparcelResopnse)
}
const bidOnParcel = () => {
const parcelBidResponse = bidParcel("Enter your bidprice");
console.log("parcelBidResponse",parcelBidResponse)
}
const parcelAuctionFinalize = () => {
const auctionFinalizeResponse = finalizeAuction();
console.log("auctionFinalizeResponse",auctionFinalizeResponse)
}
return (
<>
<CountryMap countryId={"Country ID"} />
<div>
<button onClick={() => parcelPutOnSale() }>sell</button><br /><br />
<button onClick={() => parcelPutOnAuction()}>auction</button>
<button onClick={() => parcelRemoveFromSale()}>Remove from sell</button>
<button onClick={() => parcelRemoveFromAuction()}>Remove from auction</button>
<button onClick={() => parcelbuy()}>Buy Parcel</button>
<button onClick={() => bidOnParcel()}>Bid Parcel</button>
<button onClick={() => parcelAuctionFinalize()}>Finalize Auction</button>
</div>
</>
);
}