1.0.4 • Published 1 year ago
eb-market v1.0.4
Ebisu's Bay SDK
Installation
npm i --save eb-market
Usage
...
Import
import { EbisusBaySdk } from 'eb-market/lib';
Create Instance
const sdk = new EbisusBaySdk(); // Mainnet
// OR
const sdk = new EbisusBaySdk({ environment: 'testnet' });
Authentication
const walletAddress: string; // Current wallet address
const userProvider: Web3Provider; // Web3Provider of wallet connected
sdk.setProvider(walletAddress, userProvider);
Create Listing
const listings = [
{
tokenId: '1234',
collectionAddress: '0x0...',
price: "1", // CRO
expirationDate: 12345678 // Seconds
}
]
await sdk.createListings(listings);
Cancel Listing
const listingIds: string[] = [
'1234'
];
await sdk.cancelListing(listingIds);
Purchase Listings
const listingIds: string[] = ['1233', '2233']
const receipt = await sdk.purchaseListings(listingIds);