From e0d0d1449524f4c65e3f7a263b5c0a3ab5ac4a89 Mon Sep 17 00:00:00 2001 From: Chase Fleming Date: Tue, 3 Oct 2023 12:19:42 -0700 Subject: [PATCH] PKG -- [FCL] Send suggested features to Discovery (#1775) * PKG -- [FCL] Send suggested features to Discovery * Add changeset --------- Co-authored-by: Chase Fleming <1666730+chasefleming@users.noreply.github.com> --- .changeset/six-cherries-clap.md | 5 +++++ packages/fcl/src/current-user/index.js | 3 ++- packages/fcl/src/discovery/services.js | 3 +++ packages/fcl/src/discovery/utils.js | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/six-cherries-clap.md 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, } }