1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

fix exchange id (#1137)

* fix exchange id

* fix

* fix dispenser
This commit is contained in:
mihaisc 2022-02-22 18:10:26 +02:00 committed by GitHub
parent db7ae82f4a
commit 6541068364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,7 @@ const TokensPriceQuery = gql`
}
fixedRateExchanges {
id
exchangeId
price
baseToken {
symbol
@ -104,6 +105,7 @@ const TokenPriceQuery = gql`
}
fixedRateExchanges {
id
exchangeId
price
baseToken {
symbol
@ -161,7 +163,7 @@ function getAccessDetailsFromTokenPrice(
if (tokenPrice.dispensers && tokenPrice.dispensers.length > 0) {
const dispenser = tokenPrice.dispensers[0]
accessDetails.type = 'free'
accessDetails.addressOrId = dispenser.id
accessDetails.addressOrId = dispenser.token.id
accessDetails.price = '0'
accessDetails.isPurchasable = dispenser.active
accessDetails.datatoken = {
@ -179,7 +181,7 @@ function getAccessDetailsFromTokenPrice(
) {
const fixed = tokenPrice.fixedRateExchanges[0]
accessDetails.type = 'fixed'
accessDetails.addressOrId = fixed.id
accessDetails.addressOrId = fixed.exchangeId
accessDetails.price = fixed.price
// in theory we should check dt balance here, we can skip this because in the market we always create fre with minting capabilities.
accessDetails.isPurchasable = fixed.active