npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

showpay-nft-auction-js

v1.0.9

Published

Sensible Contract NFT Auction Javascript SDK

Downloads

15

Readme

sensible-nft 拍卖合约

需求:

​ 用于nftonshow上的nft拍卖,拍卖者设定一个时间,在此期间内可以竞拍,时间到了后结束拍卖,nft转移到竞拍者,bsv转移到拍卖者。

​ nft使用sensible协议,时间oracle使用aaron的witnessonchain。

简介:

​ 拍卖合约是基于sensible BCP-01( 94b4013)的拓展合约

​ 新增的合约:nftAuction.scrypt nftForAuction.scrypt nftAuctionProto.scrypt nftForAuctionProto.scrypt (**Proto.scrypt用于操作datapart部分)

datapart: (type specific data) + (proto header)

​ type specific data:

	<proto_version(4 bytes)> + <proto_type(4 bytes)> + <'sesible'(8 bytes)>

​ nftAuction type specific data:

	<sensibleId(36byte)> +
    <bidderAddress(20byte)> +
    <bidBsvPrice>(8byte) +
    <bidTimestamp>(8byte) +
    <sendderAddress(20byte)> +
    <startBsvPrice(8byte)> +
    <feeAddress>(20byte) +
    <feeRate>(1byte) +
    <nftCodeHash>(20byte) +
    <nftID>(20byte) + 
    <endTimeStamp>(8byte) +
    <timeRabinPubkeyHash>(20byte)
    <rabinPubKeyHashArrayHash>(20byte)

​ nftForAuction.scrypt type specific data:

	<nftCodeHash>(20 bytes) +
	<nftID>(20 bytes) +
    <auctionContractHash> (20 bytes)
拍卖上架:
1. 生成 NftAuction合约,datapart部分有bidPrice和bidderAddress,是个有状态合约
2. 生成 NftForAuction 合约,该合约datapart部分不作改变,是个无状态合约
3. 将拍卖的nft转移到第二步生成的合约地址

拍卖上架

拍卖竞价:

输入原NftAuction utxo,   改变  datapart 的 bidPrice 和 bidderAddress 生成新utxo

拍卖竞价

拍卖完成:
	输入 NftAuction、NftForAuction、nftUnlockingContractCheck,输出nft、p2pkh(bsv to sender)

拍卖完成
oracle:

​ 竞价和解锁引入了两种oracle,分别是satotxwitnessonchain。satotx用于做utxo的溯源,witnessonchain用于获取当前时间