diff --git a/dev/apollo-federation/supergraph.graphql b/dev/apollo-federation/supergraph.graphql index 28ad62e5d..06ee976e4 100644 --- a/dev/apollo-federation/supergraph.graphql +++ b/dev/apollo-federation/supergraph.graphql @@ -792,6 +792,13 @@ type Globals """A list of countries and their supported auth channels""" supportedCountries: [Country!]! + + """ + Whether wallet top-up entry points (card webview and + bank-transfer-to-support) should be shown to the user. Controlled by the + instance-wide topup feature flag. + """ + topupEnabled: Boolean! } type GraphQLApplicationError implements Error diff --git a/dev/config/base-config.yaml b/dev/config/base-config.yaml index 1fbf900b6..e987a688d 100644 --- a/dev/config/base-config.yaml +++ b/dev/config/base-config.yaml @@ -87,6 +87,9 @@ cashout: from: "notifications@getflash.io" subject: "New Cashout" +topup: + enabled: false + frappe: url: http://flashapp.me.localhost:8000 sitename: flashapp.me.localhost # default sitename for frappe docker container diff --git a/src/config/schema.ts b/src/config/schema.ts index 3e248d207..ae2a44faa 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -719,6 +719,17 @@ export const configSchema = { required: ["enabled", "minimum", "maximum", "accountLevel"], default: { enabled: true }, }, + topup: { + type: "object", + properties: { + enabled: { type: "boolean" }, + }, + required: ["enabled"], + additionalProperties: false, + // Default OFF: top-up entry points (card webview, bank-transfer-to-support) + // stay hidden unless explicitly enabled per the v0.6.0 flag ramp. + default: { enabled: false }, + }, frappe: { type: "object", properties: { diff --git a/src/config/schema.types.d.ts b/src/config/schema.types.d.ts index c54865f22..eebc3b59f 100644 --- a/src/config/schema.types.d.ts +++ b/src/config/schema.types.d.ts @@ -229,6 +229,9 @@ type YamlSchema = { duration: number email: CashoutEmail } + topup: { + enabled: boolean + } sendgrid: SendGridConfig frappe: FrappeConfig fcmTopics: { diff --git a/src/config/yaml.ts b/src/config/yaml.ts index 4d0058c9c..79710de7d 100644 --- a/src/config/yaml.ts +++ b/src/config/yaml.ts @@ -388,6 +388,10 @@ export const Cashout = { }, } +export const Topup = { + Enabled: (yamlConfig.topup?.enabled ?? false) as boolean, +} + export const SendGridConfig = yamlConfig.sendgrid as SendGridConfig export const IbexConfig = yamlConfig.ibex as IbexConfig diff --git a/src/graphql/public/root/query/globals.ts b/src/graphql/public/root/query/globals.ts index dd7ddff15..0657b1474 100644 --- a/src/graphql/public/root/query/globals.ts +++ b/src/graphql/public/root/query/globals.ts @@ -1,5 +1,6 @@ import { NETWORK, + Topup, getFeesConfig, getGaloyBuildInformation, getLightningAddressDomain, @@ -33,6 +34,7 @@ const GlobalsQuery = GT.Field({ ratio: `${feesConfig.depositRatioAsBasisPoints}`, }, }, + topupEnabled: Topup.Enabled, } }, }) diff --git a/src/graphql/public/schema.graphql b/src/graphql/public/schema.graphql index 19d14781a..77adfc8ed 100644 --- a/src/graphql/public/schema.graphql +++ b/src/graphql/public/schema.graphql @@ -623,6 +623,13 @@ type Globals { """A list of countries and their supported auth channels""" supportedCountries: [Country!]! + + """ + Whether wallet top-up entry points (card webview and + bank-transfer-to-support) should be shown to the user. Controlled by the + instance-wide topup feature flag. + """ + topupEnabled: Boolean! } type GraphQLApplicationError implements Error { diff --git a/src/graphql/public/types/object/globals.ts b/src/graphql/public/types/object/globals.ts index 7bc43fccb..0f7969e3b 100644 --- a/src/graphql/public/types/object/globals.ts +++ b/src/graphql/public/types/object/globals.ts @@ -36,6 +36,12 @@ const Globals = GT.Object({ feesInformation: { type: GT.NonNull(FeesInformation), }, + topupEnabled: { + type: GT.NonNull(GT.Boolean), + description: dedent`Whether wallet top-up entry points (card webview and + bank-transfer-to-support) should be shown to the user. Controlled by the + instance-wide topup feature flag.`, + }, }), })