Skip to content

Commit

Permalink
PKG -- [FCL] Send suggested features to Discovery (onflow#1775)
Browse files Browse the repository at this point in the history
* PKG -- [FCL] Send suggested features to Discovery

* Add changeset

---------

Co-authored-by: Chase Fleming <[email protected]>
  • Loading branch information
chasefleming and chasefleming authored Oct 3, 2023
1 parent 3d037e8 commit e0d0d14
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/six-cherries-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/fcl": minor
---

Send suggested features to discovery
3 changes: 2 additions & 1 deletion packages/fcl/src/current-user/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down
3 changes: 3 additions & 0 deletions packages/fcl/src/discovery/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions packages/fcl/src/discovery/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -32,5 +33,6 @@ export async function getDiscoveryService(service) {
endpoint,
method,
discoveryAuthnInclude,
discoveryFeaturesSuggested,
}
}

0 comments on commit e0d0d14

Please sign in to comment.