@refinableco/refinable-sdk
Advanced tools
Comparing version 1.3.3-next.2 to 1.3.3-next.3
@@ -14,3 +14,3 @@ "use strict"; | ||
_a); | ||
var v4ContractChains = [Network_1.ChainType.POLYGON, Network_1.ChainType.BSC]; | ||
var v4ContractChains = [Network_1.ChainType.POLYGON]; | ||
var getContractsTags = function (environment, chainId) { | ||
@@ -21,3 +21,3 @@ var chain = (0, utils_1.selectChainType)(chainId); | ||
return [ | ||
graphql_1.ContractTag.SaleV3_0_1, | ||
graphql_1.ContractTag.SaleV3_1_0, | ||
graphql_1.ContractTag.AuctionV3_1_1, | ||
@@ -30,5 +30,6 @@ graphql_1.ContractTag.SaleNonceHolderV1_0_0, | ||
return [ | ||
// We're mainly testing Diamond on Polygon right now, so for the other chains we'll use the contracts with whitelist sale logic | ||
v4ContractChains.includes(chain) | ||
? graphql_1.ContractTag.SaleV4_0_0 | ||
: graphql_1.ContractTag.SaleV3_0_0, | ||
: graphql_1.ContractTag.SaleV3_1_0, | ||
chain === Network_1.ChainType.POLYGON | ||
@@ -35,0 +36,0 @@ ? graphql_1.ContractTag.AuctionV4_0_0 |
@@ -138,4 +138,4 @@ "use strict"; | ||
type = isERC1155 | ||
? [graphql_1.ContractTypes.Erc1155Token] | ||
: [graphql_1.ContractTypes.Erc721Token]; | ||
? [graphql_1.ContractTypes.Erc1155Token, graphql_1.ContractTypes.Erc1155WhitelistedToken] | ||
: [graphql_1.ContractTypes.Erc721Token, graphql_1.ContractTypes.Erc721WhitelistedToken]; | ||
return [4 /*yield*/, this.refinable.contracts.getRefinableContract(this.item.chainId, this.item.contractAddress, type)]; | ||
@@ -142,0 +142,0 @@ case 1: |
@@ -69,3 +69,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var saleInfoResponse, responses, rejectedResponses; | ||
var saleInfoResponse, addressForApproval, responses, rejectedResponses; | ||
var _this = this; | ||
@@ -93,37 +93,38 @@ return __generator(this, function (_a) { | ||
_a.label = 3; | ||
case 3: return [4 /*yield*/, Promise.allSettled(this.items.map(function (item) { return __awaiter(_this, void 0, void 0, function () { | ||
var addressForApproval, saleParamsHash, signedHash, result; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
item.verifyItem(); | ||
addressForApproval = item.transferProxyContract.address; | ||
return [4 /*yield*/, item.approveIfNeeded(addressForApproval)]; | ||
case 1: | ||
_a.sent(); | ||
return [4 /*yield*/, item.getSaleParamsHash(price, this.refinable.accountAddress)]; | ||
case 2: | ||
saleParamsHash = _a.sent(); | ||
return [4 /*yield*/, this.refinable.personalSign(saleParamsHash)]; | ||
case 3: | ||
signedHash = _a.sent(); | ||
return [4 /*yield*/, this.refinable.apiClient.request(sale_1.CREATE_OFFER, { | ||
input: __assign({ tokenId: item.getItem().tokenId, signature: signedHash, type: __1.OfferType.Sale, contractAddress: item.getItem().contractAddress, price: { | ||
currency: price.currency, | ||
amount: parseFloat(price.amount.toString()), | ||
}, supply: 1 }, (launchpadDetails && { | ||
launchpadDetails: { | ||
vipStartDate: launchpadDetails.vipStartDate, | ||
privateStartDate: launchpadDetails.privateStartDate, | ||
publicStartDate: launchpadDetails.publicStartDate, | ||
}, | ||
})), | ||
})]; | ||
case 4: | ||
result = _a.sent(); | ||
return [2 /*return*/, this.refinable.createOffer(__assign(__assign({}, result.createOfferForItems), { type: __1.OfferType.Sale }), item)]; | ||
} | ||
}); | ||
}); }))]; | ||
case 3: | ||
addressForApproval = this.items[0].transferProxyContract.address; | ||
return [4 /*yield*/, this.items[0].approveIfNeeded(addressForApproval)]; | ||
case 4: | ||
_a.sent(); | ||
return [4 /*yield*/, Promise.allSettled(this.items.map(function (item) { return __awaiter(_this, void 0, void 0, function () { | ||
var saleParamsHash, signedHash, result; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
item.verifyItem(); | ||
return [4 /*yield*/, item.getSaleParamsHash(price, this.refinable.accountAddress)]; | ||
case 1: | ||
saleParamsHash = _a.sent(); | ||
return [4 /*yield*/, this.refinable.personalSign(saleParamsHash)]; | ||
case 2: | ||
signedHash = _a.sent(); | ||
return [4 /*yield*/, this.refinable.apiClient.request(sale_1.CREATE_OFFER, { | ||
input: __assign({ tokenId: item.getItem().tokenId, signature: signedHash, type: __1.OfferType.Sale, contractAddress: item.getItem().contractAddress, price: { | ||
currency: price.currency, | ||
amount: parseFloat(price.amount.toString()), | ||
}, supply: 1 }, (launchpadDetails && { | ||
launchpadDetails: { | ||
vipStartDate: launchpadDetails.vipStartDate, | ||
privateStartDate: launchpadDetails.privateStartDate, | ||
publicStartDate: launchpadDetails.publicStartDate, | ||
}, | ||
})), | ||
})]; | ||
case 3: | ||
result = _a.sent(); | ||
return [2 /*return*/, this.refinable.createOffer(__assign(__assign({}, result.createOfferForItems), { type: __1.OfferType.Sale }), item)]; | ||
} | ||
}); | ||
}); }))]; | ||
case 5: | ||
responses = _a.sent(); | ||
@@ -130,0 +131,0 @@ rejectedResponses = responses.filter(function (response) { return response.status === "rejected"; }); |
{ | ||
"name": "@refinableco/refinable-sdk", | ||
"version": "1.3.3-next.2", | ||
"version": "1.3.3-next.3", | ||
"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
749142
16116