@refinableco/refinable-sdk
Advanced tools
Comparing version 5.0.0-next.5 to 5.0.0-next.6
@@ -294,3 +294,6 @@ "use strict"; | ||
type: graphql_1.OfferType.Auction, | ||
price, | ||
price: { | ||
payToken: price.address, | ||
amount: parseFloat(price.amount.toString()), | ||
}, | ||
supply: 1, | ||
@@ -297,0 +300,0 @@ offerContractAddress: this.auctionContract.address, |
@@ -1,2 +0,2 @@ | ||
import { LaunchpadDetailsInput, MarketConfig, Platform, SaleOffer as SaleOfferType } from "../@types/graphql"; | ||
import { LaunchpadDetailsInput, MarketConfig, Platform } from "../@types/graphql"; | ||
import { SaleOffer } from "../offer/SaleOffer"; | ||
@@ -7,3 +7,2 @@ import { Refinable } from "../refinable/Refinable"; | ||
import { PartialNFTItem } from "./AbstractNFT"; | ||
import { CancelSaleStatus, CANCEL_SALE_STATUS_STEP } from "./interfaces/CancelSaleStatusStep"; | ||
import { IPrice } from "./interfaces/Price"; | ||
@@ -49,16 +48,4 @@ import { ListStatus, LIST_STATUS_STEP } from "./interfaces/SaleStatusStep"; | ||
}): Promise<SaleOffer>; | ||
cancelSaleOffers({ offers, onInitialize, onProgress, onError, }: { | ||
offers?: SaleOfferType[]; | ||
onInitialize?: (steps: { | ||
step: CANCEL_SALE_STATUS_STEP; | ||
platform: Platform; | ||
}[]) => void; | ||
onProgress?: <T extends CancelSaleStatus>(status: T) => void; | ||
onError?: ({ step, platform }: { | ||
step: CANCEL_SALE_STATUS_STEP; | ||
platform: Platform; | ||
}, error: any) => void; | ||
}): Promise<void>; | ||
transfer(ownerEthAddress: string, recipientEthAddress: string): Promise<EvmTransaction>; | ||
burn(): Promise<EvmTransaction>; | ||
} |
@@ -22,3 +22,2 @@ "use strict"; | ||
const ERCSaleId_1 = require("./ERCSaleId"); | ||
const CancelSaleStatusStep_1 = require("./interfaces/CancelSaleStatusStep"); | ||
const SaleInfo_1 = require("./interfaces/SaleInfo"); | ||
@@ -250,61 +249,2 @@ const SaleStatusStep_1 = require("./interfaces/SaleStatusStep"); | ||
} | ||
cancelSaleOffers({ offers, onInitialize, onProgress, onError, }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const platformFactory = new platform_1.PlatformFactory(this.refinable); | ||
const steps = []; | ||
for (const offer of offers) { | ||
if (offer.platform === graphql_1.Platform.Refinable) { | ||
steps.push({ | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.SIGN, | ||
platform: graphql_1.Platform.Refinable, | ||
}, { | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.CANCELING, | ||
platform: graphql_1.Platform.Refinable, | ||
}, { | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.DONE, | ||
platform: graphql_1.Platform.Refinable, | ||
}); | ||
} | ||
else { | ||
steps.push({ | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.SIGN, | ||
platform: offer.platform, | ||
}, { | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.CANCELING, | ||
platform: offer.platform, | ||
}, { | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.DONE, | ||
platform: offer.platform, | ||
}); | ||
} | ||
} | ||
onInitialize(steps); | ||
this.verifyItem(); | ||
for (const offer of offers) { | ||
if (offer.platform === graphql_1.Platform.Refinable) { | ||
onProgress({ | ||
platform: graphql_1.Platform.Refinable, | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.SIGN, | ||
}); | ||
yield this.cancelSale(() => { | ||
onProgress({ | ||
platform: graphql_1.Platform.Refinable, | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.CANCELING, | ||
}); | ||
}); | ||
onProgress({ | ||
platform: graphql_1.Platform.Refinable, | ||
step: CancelSaleStatusStep_1.CANCEL_SALE_STATUS_STEP.DONE, | ||
}); | ||
} | ||
else { | ||
const externalPlatform = platformFactory.createPlatform(offer.platform); | ||
yield externalPlatform.cancelSale(offer.orderParams, { | ||
onProgress, | ||
onError, | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
transfer(ownerEthAddress, recipientEthAddress) { | ||
@@ -311,0 +251,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@refinableco/refinable-sdk", | ||
"version": "5.0.0-next.5", | ||
"version": "5.0.0-next.6", | ||
"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
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
835423
270
15524