diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 421b88e..d4bbaeb 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -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 diff --git a/src/mastodon_api/instance/types.rs b/src/mastodon_api/instance/types.rs index 0fe30dd..3965102 100644 --- a/src/mastodon_api/instance/types.rs +++ b/src/mastodon_api/instance/types.rs @@ -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, };