@refinableco/refinable-sdk
Advanced tools
Comparing version 4.2.18-next.0 to 4.2.19-next.0
@@ -246,3 +246,3 @@ "use strict"; | ||
for (const platform of platforms) { | ||
const instance = platformFactory.createPlatform(platform); | ||
const platformInstance = platformFactory.createPlatform(platform); | ||
// -- LOOKSRARE | ||
@@ -268,3 +268,3 @@ // EX. | ||
const now = Math.floor(Date.now() / 1000); | ||
yield instance.listForSale({ | ||
yield platformInstance.listForSale(this, { | ||
tokenId: this._item.tokenId, | ||
@@ -276,3 +276,2 @@ collection: this._item.contractAddress, | ||
isOrderAsk: true, | ||
nonce: "0", | ||
amount: "1", | ||
@@ -279,0 +278,0 @@ price: (0, utils_2.parseEther)(price.amount.toString()).toString(), |
@@ -12,3 +12,3 @@ import { LaunchpadDetailsInput, OfferType, Price, Platform } from "../../@types/graphql"; | ||
platform: Platform; | ||
data: any; | ||
data?: any; | ||
} | ||
@@ -30,3 +30,3 @@ export interface ListApproveStatus extends ListStatus { | ||
step: LIST_STATUS_STEP.CREATE; | ||
data: { | ||
data?: { | ||
chainId: number; | ||
@@ -33,0 +33,0 @@ tokenId: string; |
import { Types as LookrareTypes } from "@refinableco/reservoir-sdk/dist/looks-rare"; | ||
import { Types as X2Y2Types } from "@refinableco/reservoir-sdk/dist/x2y2"; | ||
import { Platform } from "../@types/graphql"; | ||
import { AbstractEvmNFT } from "../nft/AbstractEvmNFT"; | ||
import { ListStatus, LIST_STATUS_STEP } from "../nft/interfaces/SaleStatusStep"; | ||
@@ -12,3 +13,3 @@ import { PartialOffer } from "../offer/Offer"; | ||
abstract buy(offer: PartialOffer, contractAddress: string, tokenId: string): any; | ||
abstract listForSale(orderParams: LookrareTypes.MakerOrderParams | X2Y2Types.Order, options: { | ||
abstract listForSale(nft: AbstractEvmNFT, orderParams: Omit<LookrareTypes.MakerOrderParams, "nonce"> | X2Y2Types.Order, options: { | ||
onProgress?: <T extends ListStatus>(status: T) => void; | ||
@@ -15,0 +16,0 @@ onError?: ({ step, platform }: { |
import { PartialOffer } from "../offer/Offer"; | ||
import { AbstractPlatform } from "./AbstractPlatform"; | ||
import { LooksRare } from "@refinableco/reservoir-sdk"; | ||
import { Types } from "@refinableco/reservoir-sdk/dist/looks-rare"; | ||
@@ -11,3 +10,6 @@ import { ListStatus, LIST_STATUS_STEP } from "../nft/interfaces/SaleStatusStep"; | ||
buy(offer: PartialOffer, contractAddress: string, tokenId: string): import("@refinableco/reservoir-sdk/dist/utils").TxData; | ||
listForSale(orderParams: Types.MakerOrderParams, options: { | ||
/** | ||
* 1: stands for chain id (Ethereum) | ||
*/ | ||
listForSale(nft: any, orderParams: Types.MakerOrderParams, options: { | ||
onProgress?: <T extends ListStatus>(status: T) => void; | ||
@@ -18,4 +20,4 @@ onError?: ({ step, platform, }: { | ||
}, error: any) => void; | ||
}): Promise<LooksRare.Order>; | ||
}): Promise<string>; | ||
private getNonce; | ||
} |
@@ -11,2 +11,13 @@ "use strict"; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -39,3 +50,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
r, | ||
s, kind: "single-token", params: utils_2.BytesEmpty })); | ||
s, kind: "single-token", params: [] })); | ||
const unsignedTx = exchange.fillOrderTx(this.refinable.accountAddress, order, { | ||
@@ -51,3 +62,6 @@ isOrderAsk: false, | ||
} | ||
listForSale(orderParams, options) { | ||
/** | ||
* 1: stands for chain id (Ethereum) | ||
*/ | ||
listForSale(nft, orderParams, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -59,5 +73,7 @@ // approve | ||
data: { | ||
addressToApprove: "0x00000000000000000", | ||
addressToApprove: reservoir_sdk_1.LooksRare.Addresses.TransferManagerErc721[1], | ||
}, | ||
}); | ||
// Approve the transfer manager | ||
yield nft.approveIfNeeded(reservoir_sdk_1.LooksRare.Addresses.TransferManagerErc721[1]); | ||
// sign | ||
@@ -77,7 +93,13 @@ const nonce = yield this.getNonce(orderParams.signer); | ||
const signature = yield this.refinable.account.sign(order.getSignatureData()); | ||
const _a = order.params, { r, s, v, kind } = _a, strippedOrderParams = __rest(_a, ["r", "s", "v", "kind"]); | ||
// create | ||
const input = Object.assign(Object.assign({}, strippedOrderParams), { signature }); | ||
options.onProgress({ | ||
platform: graphql_1.Platform.Looksrare, | ||
step: SaleStatusStep_1.LIST_STATUS_STEP.CREATE, | ||
}); | ||
const response = yield this.refinable.graphqlClient.request(exports.LOOKSRARE_LIST_FOR_SALE, { | ||
input: Object.assign(Object.assign({}, order.params), { signature }), | ||
input, | ||
}); | ||
return order; | ||
return response; | ||
}); | ||
@@ -84,0 +106,0 @@ } |
@@ -7,2 +7,3 @@ import { AbstractPlatform } from "./AbstractPlatform"; | ||
import { Types } from "@refinableco/reservoir-sdk/dist/x2y2"; | ||
import { AbstractEvmNFT } from "../nft/AbstractEvmNFT"; | ||
export declare class X2Y2Platform extends AbstractPlatform { | ||
@@ -12,3 +13,3 @@ constructor(refinable: Refinable); | ||
buy(offer: PartialOffer, tokenId: string): Promise<any>; | ||
listForSale(orderParams: Types.Order, options: { | ||
listForSale(nft: AbstractEvmNFT, orderParams: Types.Order, options: { | ||
onProgress?: <T extends ListStatus>(status: T) => void; | ||
@@ -15,0 +16,0 @@ onError?: ({ step, platform }: { |
@@ -46,3 +46,3 @@ "use strict"; | ||
} | ||
listForSale(orderParams, options) { | ||
listForSale(nft, orderParams, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -49,0 +49,0 @@ throw new Error("Method not implemented."); |
{ | ||
"name": "@refinableco/refinable-sdk", | ||
"version": "4.2.18-next.0", | ||
"version": "4.2.19-next.0", | ||
"description": "The Refinable SDK allows you to easily interact with the Refinable Marketplace to mint, sell and buy NFTs", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
770777
14401