@manifoldxyz/marketplace-sdk 3.0.8 → 3.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -12
- package/.prettierrc.js +1 -0
- package/README.md +1 -1
- package/babel.config.js +1 -4
- package/dist/abi/IdentityVerifierABIv1.json +2 -1
- package/dist/abi/IdentityVerifierABIv2.json +2 -1
- package/dist/abi/IdentityVerifierViewABIv2.json +2 -1
- package/dist/abi/LazyDeliveryABI.json +4 -2
- package/dist/classes/Bid.d.ts +1 -1
- package/dist/classes/Listing.d.ts +3 -3
- package/dist/classes/Listing.js +4 -3
- package/dist/classes/Offer.d.ts +1 -1
- package/dist/classes/Purchase.d.ts +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +9 -9
- package/dist/lib/MarketplaceListing.d.ts +6 -6
- package/dist/lib/MarketplaceListing.js +402 -165
- package/dist/lib/Web3Protocol.d.ts +2 -2
- package/dist/lib/Web3Protocol.js +6 -6
- package/package.json +6 -4
- package/src/abi/IdentityVerifierABIv1.json +3 -3
- package/src/abi/IdentityVerifierABIv2.json +77 -77
- package/src/abi/IdentityVerifierViewABIv2.json +136 -135
- package/src/abi/LazyDeliveryABI.json +22 -20
- package/src/classes/Bid.ts +15 -23
- package/src/classes/Listing.ts +174 -68
- package/src/classes/ListingType.ts +2 -2
- package/src/classes/Offer.ts +13 -21
- package/src/classes/Purchase.ts +11 -13
- package/src/classes/Token.ts +14 -15
- package/src/index.ts +8 -8
- package/src/lib/MarketplaceListing.ts +1123 -533
- package/src/lib/Web3Protocol.ts +61 -48
- package/src/ts-shims/shims-manifold-window.d.ts +1 -1
- package/tests/MarketplaceListing.test.js +19 -29
- package/tsconfig.json +22 -20
package/.eslintrc.json
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"parser": "@typescript-eslint/parser",
|
|
3
3
|
"plugins": ["@typescript-eslint"],
|
|
4
|
-
"extends": [
|
|
5
|
-
"plugin:@typescript-eslint/recommended"
|
|
6
|
-
],
|
|
7
|
-
"rules": {
|
|
8
|
-
"@typescript-eslint/ban-ts-ignore": "off",
|
|
9
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
10
|
-
"explicit-module-boundary-types": "off",
|
|
11
|
-
"no-explicit-any": "off",
|
|
12
|
-
"no-unused-vars": "off",
|
|
13
|
-
"no-var-requires": "off",
|
|
14
|
-
"prefer-rest-params": "off"
|
|
15
|
-
}
|
|
4
|
+
"extends": ["@manifoldxyz/eslint-config"]
|
|
16
5
|
}
|
package/.prettierrc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@manifoldxyz/lint-configs/prettier');
|
package/README.md
CHANGED
|
@@ -4,4 +4,4 @@ This package contains the core library for interacting with the Manifold marketp
|
|
|
4
4
|
|
|
5
5
|
The marketplace-sdk relies on the Manifold's EthereumProvider (node connection management library)
|
|
6
6
|
|
|
7
|
-
Please see code-comments for a full description of methods.
|
|
7
|
+
Please see code-comments for a full description of methods.
|
package/babel.config.js
CHANGED
package/dist/classes/Bid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BigNumber } from
|
|
2
|
-
import ListingType from
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
+
import ListingType from './ListingType';
|
|
3
3
|
declare abstract class Listing {
|
|
4
4
|
id: number;
|
|
5
5
|
type: ListingType;
|
|
@@ -67,4 +67,4 @@ declare class LazyDynamicPriceListing extends LazyTokenListing {
|
|
|
67
67
|
constructor(id: string, type: ListingType, tokenAddress: string, tokenLazyAssetId: string, startTime: string | number, endTime: string | number, totalAvailable: number, totalSold: number, finalized: boolean, seller: string, erc20: string, identityVerifier: string, referrerBPS: number, receivers: [string, number][]);
|
|
68
68
|
remaining(): number;
|
|
69
69
|
}
|
|
70
|
-
export { Listing, AuctionListing, LazyAuctionListing, LazyOffersOnlyListing, FixedPriceListing, LazyFixedPriceListing, LazyDynamicPriceListing, TokenListing };
|
|
70
|
+
export { Listing, AuctionListing, LazyAuctionListing, LazyOffersOnlyListing, FixedPriceListing, LazyFixedPriceListing, LazyDynamicPriceListing, TokenListing, };
|
package/dist/classes/Listing.js
CHANGED
|
@@ -31,7 +31,8 @@ exports.Listing = Listing;
|
|
|
31
31
|
class TokenListing extends Listing {
|
|
32
32
|
constructor(id, type, tokenAddress, tokenSpec, tokenId, startTime, endTime, finalized, seller, erc20, identityVerifier, referrerBPS, receivers) {
|
|
33
33
|
super(id, type, tokenAddress, startTime, endTime, finalized, seller, erc20, identityVerifier, referrerBPS, receivers);
|
|
34
|
-
this.tokenSpec =
|
|
34
|
+
this.tokenSpec =
|
|
35
|
+
tokenSpec === 1 ? 'erc721' : tokenSpec === 2 ? 'erc1155' : tokenSpec.toString();
|
|
35
36
|
this.tokenId = tokenId ? bignumber_1.BigNumber.from(tokenId) : undefined;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -100,7 +101,7 @@ class LazyFixedPriceListing extends LazyTokenListing {
|
|
|
100
101
|
this.totalSold = totalSold;
|
|
101
102
|
}
|
|
102
103
|
remaining() {
|
|
103
|
-
return
|
|
104
|
+
return this.totalAvailable - this.totalSold;
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
exports.LazyFixedPriceListing = LazyFixedPriceListing;
|
|
@@ -111,7 +112,7 @@ class LazyDynamicPriceListing extends LazyTokenListing {
|
|
|
111
112
|
this.totalSold = totalSold;
|
|
112
113
|
}
|
|
113
114
|
remaining() {
|
|
114
|
-
return
|
|
115
|
+
return this.totalAvailable - this.totalSold;
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
exports.LazyDynamicPriceListing = LazyDynamicPriceListing;
|
package/dist/classes/Offer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BigNumber } from
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
2
|
interface IPurchase {
|
|
3
3
|
buyer: string;
|
|
4
4
|
referrer: string;
|
|
@@ -20,4 +20,4 @@ declare class Purchase implements IPurchase {
|
|
|
20
20
|
count: number;
|
|
21
21
|
constructor(buyer: string, buyerENS: string, referrer: string, referrerENS: string, amount: string, timestamp: string | number, transactionHash: string, count: number);
|
|
22
22
|
}
|
|
23
|
-
export { Purchase
|
|
23
|
+
export { Purchase };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MarketplaceListing, MarketplaceTopic } from './lib/MarketplaceListing';
|
|
2
|
-
import ListingType from './classes/ListingType';
|
|
3
|
-
import { Listing } from './classes/Listing';
|
|
4
|
-
import Token from './classes/Token';
|
|
5
1
|
import { Bid, BidHistory } from './classes/Bid';
|
|
2
|
+
import { Listing } from './classes/Listing';
|
|
3
|
+
import ListingType from './classes/ListingType';
|
|
6
4
|
import { Offer, OfferHistory } from './classes/Offer';
|
|
7
|
-
|
|
5
|
+
import Token from './classes/Token';
|
|
6
|
+
import { MarketplaceListing, MarketplaceTopic } from './lib/MarketplaceListing';
|
|
7
|
+
export { MarketplaceTopic, MarketplaceListing, Listing, ListingType, Token, Bid, BidHistory, Offer, OfferHistory, };
|
package/dist/index.js
CHANGED
|
@@ -4,18 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.OfferHistory = exports.Offer = exports.BidHistory = exports.Bid = exports.Token = exports.ListingType = exports.Listing = exports.MarketplaceListing = exports.MarketplaceTopic = void 0;
|
|
7
|
-
const MarketplaceListing_1 = require("./lib/MarketplaceListing");
|
|
8
|
-
Object.defineProperty(exports, "MarketplaceListing", { enumerable: true, get: function () { return MarketplaceListing_1.MarketplaceListing; } });
|
|
9
|
-
Object.defineProperty(exports, "MarketplaceTopic", { enumerable: true, get: function () { return MarketplaceListing_1.MarketplaceTopic; } });
|
|
10
|
-
const ListingType_1 = __importDefault(require("./classes/ListingType"));
|
|
11
|
-
exports.ListingType = ListingType_1.default;
|
|
12
|
-
const Listing_1 = require("./classes/Listing");
|
|
13
|
-
Object.defineProperty(exports, "Listing", { enumerable: true, get: function () { return Listing_1.Listing; } });
|
|
14
|
-
const Token_1 = __importDefault(require("./classes/Token"));
|
|
15
|
-
exports.Token = Token_1.default;
|
|
16
7
|
const Bid_1 = require("./classes/Bid");
|
|
17
8
|
Object.defineProperty(exports, "Bid", { enumerable: true, get: function () { return Bid_1.Bid; } });
|
|
18
9
|
Object.defineProperty(exports, "BidHistory", { enumerable: true, get: function () { return Bid_1.BidHistory; } });
|
|
10
|
+
const Listing_1 = require("./classes/Listing");
|
|
11
|
+
Object.defineProperty(exports, "Listing", { enumerable: true, get: function () { return Listing_1.Listing; } });
|
|
12
|
+
const ListingType_1 = __importDefault(require("./classes/ListingType"));
|
|
13
|
+
exports.ListingType = ListingType_1.default;
|
|
19
14
|
const Offer_1 = require("./classes/Offer");
|
|
20
15
|
Object.defineProperty(exports, "Offer", { enumerable: true, get: function () { return Offer_1.Offer; } });
|
|
21
16
|
Object.defineProperty(exports, "OfferHistory", { enumerable: true, get: function () { return Offer_1.OfferHistory; } });
|
|
17
|
+
const Token_1 = __importDefault(require("./classes/Token"));
|
|
18
|
+
exports.Token = Token_1.default;
|
|
19
|
+
const MarketplaceListing_1 = require("./lib/MarketplaceListing");
|
|
20
|
+
Object.defineProperty(exports, "MarketplaceListing", { enumerable: true, get: function () { return MarketplaceListing_1.MarketplaceListing; } });
|
|
21
|
+
Object.defineProperty(exports, "MarketplaceTopic", { enumerable: true, get: function () { return MarketplaceListing_1.MarketplaceTopic; } });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
2
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
3
|
+
import { Contract } from '@ethersproject/contracts';
|
|
4
|
+
import { MerkleTree } from 'merkletreejs';
|
|
3
5
|
import { Bid, BidHistory } from '../classes/Bid';
|
|
4
|
-
import {
|
|
6
|
+
import { Listing } from '../classes/Listing';
|
|
5
7
|
import { OfferHistory } from '../classes/Offer';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { BigNumber } from "@ethersproject/bignumber";
|
|
9
|
-
import { Contract } from "@ethersproject/contracts";
|
|
8
|
+
import { Purchase } from '../classes/Purchase';
|
|
9
|
+
import Token from '../classes/Token';
|
|
10
10
|
declare enum MarketplaceTopic {
|
|
11
11
|
PURCHASE_EVENT_V1 = "0xdc84c3c75a393011959e6391215e5b01982de6ad00f83b8b26ac7c52a5844b22",
|
|
12
12
|
BID_EVENT_V1 = "0x68debf84f0c6c4d7f73019f874d0f4f4b4c6d895ebce90dc010abac51d74d60a",
|