From bdeb27d9b6f9449032f59f20f1bfff032e8a8ac9 Mon Sep 17 00:00:00 2001 From: Max Alekseenko Date: Fri, 4 Oct 2024 16:14:22 +0200 Subject: [PATCH] add new env to docs --- deploy/tools/envs-validator/schema.ts | 1 + deploy/tools/envs-validator/test/.env.base | 1 + docs/ENVS.md | 9 +++++++++ nextjs/csp/policies/app.ts | 1 + 4 files changed, 12 insertions(+) diff --git a/deploy/tools/envs-validator/schema.ts b/deploy/tools/envs-validator/schema.ts index 3a332fc0a0..263a733075 100644 --- a/deploy/tools/envs-validator/schema.ts +++ b/deploy/tools/envs-validator/schema.ts @@ -810,6 +810,7 @@ const schema = yup NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: yup.string(), NEXT_PUBLIC_MIXPANEL_PROJECT_TOKEN: yup.string(), NEXT_PUBLIC_GROWTH_BOOK_CLIENT_KEY: yup.string(), + NEXT_PUBLIC_REWARDS_SERVICE_API_HOST: yup.string().test(urlTest), // Misc NEXT_PUBLIC_USE_NEXT_JS_PROXY: yup.boolean(), diff --git a/deploy/tools/envs-validator/test/.env.base b/deploy/tools/envs-validator/test/.env.base index f5231bdb0e..a99525eec5 100644 --- a/deploy/tools/envs-validator/test/.env.base +++ b/deploy/tools/envs-validator/test/.env.base @@ -86,3 +86,4 @@ NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS=[{'text':'Swap','icon':'swap','dappId':'uniswap' NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG={'name': 'zerion', 'url_template': 'https://app.zerion.io/{address}/overview', 'logo': 'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-logos/zerion.svg'} NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG={'name': 'Need gas?', 'dapp_id': 'smol-refuel', 'url_template': 'https://smolrefuel.com/?outboundChain={chainId}&partner=blockscout&utm_source=blockscout&utm_medium=address&disableBridges=true', 'logo': 'https://blockscout-content.s3.amazonaws.com/smolrefuel-logo-action-button.png'} NEXT_PUBLIC_SAVE_ON_GAS_ENABLED=true +NEXT_PUBLIC_REWARDS_SERVICE_API_HOST=https://example.com diff --git a/docs/ENVS.md b/docs/ENVS.md index f9e34fa288..5d658c8cb1 100644 --- a/docs/ENVS.md +++ b/docs/ENVS.md @@ -63,6 +63,7 @@ Please be aware that all environment variables prefixed with `NEXT_PUBLIC_` will - [Multichain balance button](ENVS.md#multichain-balance-button) - [Get gas button](ENVS.md#get-gas-button) - [Save on gas with GasHawk](ENVS.md#save-on-gas-with-gashawk) + - [Rewards service API](ENVS.md#rewards-service-api) - [3rd party services configuration](ENVS.md#external-services-configuration)   @@ -767,6 +768,14 @@ The feature enables a "Save with GasHawk" button next to the "Gas used" value on   +### Rewards service API + +This feature enables Blockscout Merits program. + +| Variable | Type| Description | Compulsoriness | Default value | Example value | Version | +| --- | --- | --- | --- | --- | --- | --- | +| NEXT_PUBLIC_REWARDS_SERVICE_API_HOST | `string` | API url | - | - | `https://example.com` | v1.36.0+ | + ## External services configuration ### Google ReCaptcha diff --git a/nextjs/csp/policies/app.ts b/nextjs/csp/policies/app.ts index 1b7a495284..43b73147d0 100644 --- a/nextjs/csp/policies/app.ts +++ b/nextjs/csp/policies/app.ts @@ -67,6 +67,7 @@ export function app(): CspDev.DirectiveDescriptor { getFeaturePayload(config.features.addressVerification)?.api.endpoint, getFeaturePayload(config.features.nameService)?.api.endpoint, getFeaturePayload(config.features.addressMetadata)?.api.endpoint, + getFeaturePayload(config.features.rewards)?.api.endpoint, // chain RPC server config.chain.rpcUrl,