0.4.2-alpha.0 • Published 4 months ago

@kresuslabs/marketplace v0.4.2-alpha.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

Kresus Marketplace

Name

kresus-marketplace

Installation

install with npm:

npm install @kresuslabs/marketplace --save

install with yarn:

yarn add @kresuslabs/marketplace

Usage For Marketplace

import {NFTPartner} from '@kresuslabs/marketplace';
const config = {
  auctionAddress: "0x42219Ead844eda260F2c1Fe750e370537AEEB725",
  proxyAddress: "0xA0bcB37189Ad4232387f537a60073fBeb85B4dbD",
  provider: provider,
  erc20TransferProxy: "0x6a169F4d8Fb90CC2c777d0BA4723076C06A0d0CC",
  transferProxy: "0xD077e1ED9457D8bde1FFBAe253491C3c078c4F09", //optional
  nftAddress: "0x163a5DfF3480321D224b7f5Cdab6cFed743bF259", //optional
}
const nftPartner = new NFTPartner(config);

Usage For Factory

import {Factory} from '@kresuslabs/marketplace';

Create Store Front:

const newDefaultFeeReceiver = "0xa6D1741395Fe9378630931A2775F0Cea595F46E6";
const newProtocolFee = "250";
const minimalStepBasePoint = "50";
const defaultAdmin = "0xa6D1741395Fe9378630931A2775F0Cea595F46E6";
await Factory.createStoreFront(newDefaultFeeReceiver, newProtocolFee, minimalStepBasePoint, defaultAdmin, wallet); //wallet of super admin of Kresus

Transfer Ownerships:

const transferProxyAddress = "0xD077e1ED9457D8bde1FFBAe253491C3c078c4F09";
const erc20ProxyAddress = "0x6a169F4d8Fb90CC2c777d0BA4723076C06A0d0CC";
const auctionHouseAddress = "0x42219Ead844eda260F2c1Fe750e370537AEEB725";
const defaultAdmin = "0xa6D1741395Fe9378630931A2775F0Cea595F46E6";
await Factory.transferOwnerships(transferProxyAddress, erc20ProxyAddress, auctionHouseAddressHouse, defaultAdmin, wallet);//wallet of super admin of Kresus

Usage For Proxy

Bulk Mint:

const amounts = ["10", "30", "50"];
const data = "0x";
const assetIds = ["1", "2", "3"];
const tokenURIs = ["https://ipfs.io/ipfs/QmP9h59UNm6YiYEwkxzd5U9ChFiqciNnq7QPvK4a3KkHNk", "https://ipfs.io/ipfs/QmP9h59UNm6YiYEwkxzd5U9ChFiqciNnq7QPvK4a3KkHNk", "https://ipfs.io/ipfs/QmP9h59UNm6YiYEwkxzd5U9ChFiqciNnq7QPvK4a3KkHNk"];
await nftPartner.bulkMint(to, amounts, data, maxsupplies, assetIds, tokenURIs);

Burn Batch Token:

const from = "0xA0bcB37189Ad4232387f537a60073fBeb85B4dbD";
const ids = ["1", "2", "3"];
const amounts = ["10", "30", "50"];
await nftPartner.burnBatchToken(from, ids, amounts);

Burn Token:

const from = "0xA0bcB37189Ad4232387f537a60073fBeb85B4dbD";
const id = "1";
const amount = "10";

Finish Auction From Proxy:

const auctionId = "1";
await nftPartner.finishAuctionFromProxy(auctionId);

Get List of Minted Asset IDs:

await nftPartner.getMintedAssets();

Grant Sub Admin Role:

const newSubadmin = "0xA0bcB37189Ad4232387f537a60073fBeb85B4dbD";
await nftPartner.grantRole(newSubadmin);

Mint:

const amount = "10";
const data = "0x";
const tokenURI = "https://ipfs.io/ipfs/QmP9h59UNm6YiYEwkxzd5U9ChFiqciNnq7QPvK4a3KkHNk";
const assetId = "1";
await nftPartner.mint(amount, data, tokenURI, assetId);

Revoke Sub Admin Role:

const subadmin = "0xA0bcB37189Ad4232387f537a60073fBeb85B4dbD";
await nftPartner.revokeRole(newSubadmin);

Start Auction:

const sellToken = "0x274c4e305A5cFF337d6833aE51339bbf86FA60c8";
const sellTokenValue = "10";
const sellTokenId = "1";
const buyAsset = "0x0000000000000000000000000000000000000000";//if buy asset is ETH, else ERC20 address
const minimalPrice = "1000000000000000"; // (0.001ETH) in basic unit of the buying asset
const duration = "1000"; //in seconds
const buyOutPrice = "200000000000000000"; // (0.2ETH) in basic unit of the buying asset
await nftPartner.startAuction(sellToken, sellTokenValue, sellTokenId, buyAsset, minimalPrice, duration, buyOutPrice, provider)

Withdraw ERC20 From Proxy:

const tokenAddress = "0x274c4e305A5cFF337d6833aE51339bbf86FA60c8";
const transferTo = "0xa6D1741395Fe9378630931A2775F0Cea595F46E6";
const amount = "1000000000000000";
await nftPartner.withdrawERC20(tokenAddress, transferTo, amount);

Withdraw Matic From Proxy:

const transferTo = "0xa6D1741395Fe9378630931A2775F0Cea595F46E6";
const amount = "1000000000000000";
await nftPartner.withdrawETH(transferTo, amount);

Usage For Auction

Cancel Auction:

const auctionId = "1";
await nftPartner.cancel(auctionId);

Buyout Auction using ERC20:

const auctionId = "1";
const bidAmount = "200000000000000000"; // (0.2 for ERC20 Token with 18 decimals) in basic unit of the buying asset
await auction.buyOut(auctionId, bidAmount);

Bid on an Auction Item using ERC20:

const auctionId = "1";
const bidAmount = "1000000000000000"; // (0.001 for ERC20 Token with 18 decimals) in basic unit of the buying asset
await auction.bid(auctionId, bidAmount);

Buyout Auction using ETH:

const auctionId = "1";
const bidAmount = "200000000000000000"; // 0.2ETH in Wei
await auction.buyOutWithETH(auctionId, bidAmount);

Bid on an Auction Item using ETH:

const auctionId = "1";
const bidAmount = "1000000000000000"; // 0.001ETH in Wei
await auction.bidWithEth(auctionId, bidAmount);

Finish an auction:

const auctionId = "1";
await auction.finishAuction(auctionId);

Get Next Minimal Bid for an Auction:

const auctionId = "1";
await auction.getMinimalNextBid(auctionId);

Get Auction by Id:

const auctionId = "1";
await auction.getAuctionById(auctionId);

Check Auction Existence:

const auctionId = "1";
await auction.checkAuctionExistence(auctionId);

Check Auction Range Time:

const auctionId = "1";
await auction.checkAuctionRangeTime(auctionId);

Get Protocol Fee:

await auction.getProtocolFee();

Get current buyer:

const auctionId = "1";
await auction.getCurrentBuyer(auctionId);

Get Minimal Duration:

await nftPartner.getMinimalDuration();

Get Active Marketplace Items:

await nftPartner.getMarketplaceItemList();

Get current Auction Id:

await nftPartner.getCurrentAuctionId();

License

MIT

0.4.3-alpha.0

4 months ago

0.4.3-alpha.1

4 months ago

0.1.0-beta.2

1 year ago

0.4.0-alpha.2

10 months ago

0.4.0-alpha.1

10 months ago

0.1.0-beta.4

1 year ago

0.4.0-alpha.0

10 months ago

0.1.0-beta.1

1 year ago

0.1.0-beta.0

1 year ago

0.4.2-alpha.2

10 months ago

0.4.2-alpha.1

10 months ago

0.1.0-dev.0

1 year ago

0.4.2-alpha.0

10 months ago

0.4.2-alpha.7

6 months ago

0.4.2-alpha.6

9 months ago

0.4.2-alpha.5

9 months ago

0.4.2-alpha.4

9 months ago

0.4.2-alpha.3

10 months ago

0.0.4-alpha.0

1 year ago

0.2.1-alpha.0

11 months ago

0.3.0-alpha.0

11 months ago

0.3.0-alpha.1

11 months ago

0.0.1-aplha.2

1 year ago

0.0.1-aplha.1

1 year ago

0.0.1-aplha.0

1 year ago

0.0.4-rc.0

1 year ago

0.2.0-alpha.0

1 year ago

0.0.4-rc2.0

1 year ago

0.2.0-alpha.2

1 year ago

0.2.0-alpha.1

1 year ago

0.2.0-alpha.3

11 months ago

0.1.0-alpha.4

1 year ago

0.1.0-alpha.1

1 year ago

0.1.0-alpha.0

1 year ago

0.1.0-alpha.3

1 year ago

0.1.0-dev.1

1 year ago

0.1.0-alpha.2

1 year ago

0.0.3-beta.5

2 years ago

0.0.3-alpha.3

2 years ago

0.0.3-alpha.2

2 years ago

0.0.3-alpha.5

2 years ago

0.0.3-alpha.4

2 years ago

0.0.3-beta.1

2 years ago

0.0.3-alpha.1

2 years ago

0.0.3-rc.0

2 years ago

0.0.3-beta.0

2 years ago

0.0.3-alpha.0

2 years ago

0.0.3

2 years ago

0.0.1-alpha

2 years ago

0.0.3-alpha

2 years ago

0.0.2-alpha.2

2 years ago

0.0.2-alpha

2 years ago

0.0.2-alpha.1

2 years ago

0.0.2-alpha.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.0

2 years ago