@flooz/marketplace-sdk
v0.0.14
Published
Flooz Marketplace SDK
Downloads
18
Keywords
Readme
Flooz Marketplace SDK
Minimalist SDK to interact with the Flooz NFT Marketplace contracts.
Documentation
Getting Started
Prerequirement
Install the package using yarn
yarn add @flooz/marketplace-sdk
Import the SDK
const { Flooz } = require('@flooz/marketplace-sdk');
ES6 or TypeScript
import { Flooz } from '@flooz/marketplace-sdk';
Defining the Provider
- Import the package & define the provider
import { JsonRpcProvider } from '@ethersproject/providers';
cosnt provider: JsonRpcProvider = FloozProviders[ChainId.MATIC_MAINNET]
signer = provider.getSigner('0x...')
Initialize the SDK
const floozMarketplace = new Flooz(await provider.getNetwork());
Examples
Creating an order
const order: Order = {
seller: signer._address,
nftAddress: '0xee83b294ffd06917727334cae9512e0377a12bc7',
tokenId: 1,
price: parseEther('0.1'),
expiresAt: 1891294359,
paymentToken: WETH[ChainId.MATIC_MAINNET],
}
const unsignedTx = await floozMarketplace.createOrder(order, signer._address)
Canceling an order
const unsignedTx = await floozMarketplace.cancelOrder("0x....", signer._address)
Executing an order
const unsignedTx = await floozMarketplace.executeOrder("0x....", signer._address)