Socket
Book a DemoInstallSign in
Socket

@lootexchange/sdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lootexchange/sdk

Loot Exchange SDK

0.0.8
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Loot Exchange SDK

This repository contains an SDK for interacting with instances of Wyvern V2 contracts.

Usage

import { Builders, Helpers, Order } from "@lootexchange/sdk";

// Create an unsigned sell order
let sellOrder: Order = Builders.Erc721.SingleItem.sell({
  exchange: exchange.address,
  maker: seller.address,
  target: erc721.address,
  tokenId: 0,
  paymentToken: AddressZero,
  basePrice: parseEther("1"),
  fee: 250,
  feeRecipient: feeRecipient.address,
  listingTime: Math.floor(Date.now() / 1000) - 300,
  expirationTime: 0,
  salt: 0,
});
// Sign the sell order
sellOrder = await Helpers.Order.sign(seller, sellOrder);

// Create a matching buy order for the sell order
const buyOrder: Order = Builders.Erc721.SingleItem.matchingBuy(
  buyer.address,
  sellOrder
);

// Trigger settlement
await Helpers.Wyvern.match(buyer, buyOrder, sellOrder);

Keywords

ethereum

FAQs

Package last updated on 15 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.