Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@georgeroman/wyvern-v2-sdk

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@georgeroman/wyvern-v2-sdk

Wyvern V2 SDK

  • 0.0.32
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Reservoir Wyvern V2 SDK

This repository contains an SDK for interacting with instances of Wyvern V2 contracts (including OpenSea).

Build and test

This package doesn't have tests on its own, but it relies on the core package for testing (which makes intensive use of this SDK for easily interacting with Wyvern V2 instances during tests).

Usage

import { Builders, Helpers, Order } from "@georgeroman/wyvern-v2-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").toString(),
  fee: "250",
  feeRecipient: feeRecipient.address,
  listingTime: (Math.floor(Date.now() / 1000) - 300).toString(),
  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

FAQs

Package last updated on 23 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc