Add token gate feature flag to instance info

This commit is contained in:
silverpill 2022-11-16 15:11:25 +00:00
parent 57c5ab3c4e
commit 6765674118
2 changed files with 8 additions and 0 deletions

View file

@ -1242,6 +1242,10 @@ components:
description: Blockchain features.
type: object
properties:
gate:
description: Token gate feature flag.
type: boolean
example: true
minter:
description: Minter feature flag.
type: boolean

View file

@ -14,6 +14,7 @@ struct InstanceStats {
#[derive(Serialize)]
struct BlockchainFeatures {
gate: bool,
minter: bool,
subscriptions: bool,
}
@ -63,11 +64,13 @@ impl InstanceInfo {
Some(BlockchainConfig::Ethereum(ethereum_config)) => {
let features = if let Some(contract_set) = maybe_blockchain {
BlockchainFeatures {
gate: contract_set.gate.is_some(),
minter: contract_set.collectible.is_some(),
subscriptions: contract_set.subscription.is_some(),
}
} else {
BlockchainFeatures {
gate: false,
minter: false,
subscriptions: false,
}
@ -85,6 +88,7 @@ impl InstanceInfo {
},
Some(BlockchainConfig::Monero(monero_config)) => {
let features = BlockchainFeatures {
gate: false,
minter: false,
subscriptions: true,
};