diff --git a/.changeset/six-cherries-clap.md b/.changeset/six-cherries-clap.md new file mode 100644 index 000000000..c8a13cf62 --- /dev/null +++ b/.changeset/six-cherries-clap.md @@ -0,0 +1,5 @@ +--- +"@onflow/fcl": minor +--- + +Send suggested features to discovery diff --git a/packages/fcl/src/current-user/index.js b/packages/fcl/src/current-user/index.js index a33dff0eb..6cc83b0dc 100644 --- a/packages/fcl/src/current-user/index.js +++ b/packages/fcl/src/current-user/index.js @@ -133,10 +133,11 @@ async function getAccountProofData() { return accountProofData } -const makeConfig = async ({discoveryAuthnInclude}) => { +const makeConfig = async ({discoveryAuthnInclude, discoveryFeaturesSuggested}) => { return { client: { discoveryAuthnInclude, + discoveryFeaturesSuggested, clientServices: await makeDiscoveryServices(), supportedStrategies: getServiceRegistry().getStrategies(), }, diff --git a/packages/fcl/src/discovery/services.js b/packages/fcl/src/discovery/services.js index 75b255a2e..8583444cd 100644 --- a/packages/fcl/src/discovery/services.js +++ b/packages/fcl/src/discovery/services.js @@ -25,6 +25,9 @@ export async function getServices({types}) { type: types, fclVersion: VERSION, include, + features: { + suggested: await config.get("discovery.features.suggested", []) + }, clientServices: await makeDiscoveryServices(), supportedStrategies: getServiceRegistry().getStrategies(), userAgent: window?.navigator?.userAgent, diff --git a/packages/fcl/src/discovery/utils.js b/packages/fcl/src/discovery/utils.js index 4d423d315..d64b0e6f7 100644 --- a/packages/fcl/src/discovery/utils.js +++ b/packages/fcl/src/discovery/utils.js @@ -9,6 +9,7 @@ export const makeDiscoveryServices = async () => { export async function getDiscoveryService(service) { const discoveryAuthnInclude = await config.get("discovery.authn.include", []) + const discoveryFeaturesSuggested = await config.get("discovery.features.suggested", []) const discoveryWalletMethod = await config.first([ "discovery.wallet.method", "discovery.wallet.method.default", @@ -32,5 +33,6 @@ export async function getDiscoveryService(service) { endpoint, method, discoveryAuthnInclude, + discoveryFeaturesSuggested, } }