From 127e4bc3f0d4250f67468d8f5df1656708e032ea Mon Sep 17 00:00:00 2001 From: gregsantos Date: Mon, 14 Nov 2022 16:09:14 -0800 Subject: [PATCH 1/3] feat: add pre authz method to req namespaces --- packages/fcl-wc/src/constants.js | 1 + packages/fcl-wc/src/service.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/fcl-wc/src/constants.js b/packages/fcl-wc/src/constants.js index 626c2e06a..a4bc71343 100644 --- a/packages/fcl-wc/src/constants.js +++ b/packages/fcl-wc/src/constants.js @@ -1,5 +1,6 @@ export const FLOW_METHODS = { FLOW_AUTHN: "flow_authn", + FLOW_PRE_AUTHZ: "flow_pre_authz", FLOW_AUTHZ: "flow_authz", FLOW_USER_SIGN: "flow_user_sign", } diff --git a/packages/fcl-wc/src/service.js b/packages/fcl-wc/src/service.js index c05e2c131..3ad226ece 100644 --- a/packages/fcl-wc/src/service.js +++ b/packages/fcl-wc/src/service.js @@ -200,6 +200,7 @@ async function connectWc({ flow: { methods: [ FLOW_METHODS.FLOW_AUTHN, + FLOW_METHODS.FLOW_PRE_AUTHZ, FLOW_METHODS.FLOW_AUTHZ, FLOW_METHODS.FLOW_USER_SIGN, ], From 09fb9aae37dbe9a2d8b73c3c0c87b3ebfaaf1304 Mon Sep 17 00:00:00 2001 From: gregsantos Date: Fri, 18 Nov 2022 10:48:41 -0800 Subject: [PATCH 2/3] PKG -- [fcl-wc] remove test/mainnet invariant --- packages/fcl-wc/src/fcl-wc.js | 4 ++-- packages/fcl-wc/src/service.js | 2 +- packages/fcl-wc/src/utils.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/fcl-wc/src/fcl-wc.js b/packages/fcl-wc/src/fcl-wc.js index f68d948f4..1e4e6d857 100644 --- a/packages/fcl-wc/src/fcl-wc.js +++ b/packages/fcl-wc/src/fcl-wc.js @@ -34,8 +34,8 @@ const initClient = async ({projectId, metadata}) => { } export const init = async ({ - projectId, - metadata, + projectId = null, + metadata = {}, includeBaseWC = false, wcRequestHook = null, pairingModalOverride = null, diff --git a/packages/fcl-wc/src/service.js b/packages/fcl-wc/src/service.js index 3ad226ece..bb851e4b7 100644 --- a/packages/fcl-wc/src/service.js +++ b/packages/fcl-wc/src/service.js @@ -293,6 +293,6 @@ const makeBaseWalletConnectService = includeBaseWC => { async function makeWcServices({projectId, includeBaseWC, wallets}) { const wcBaseService = makeBaseWalletConnectService(includeBaseWC) const flowWcWalletServices = (await fetchFlowWallets(projectId)) ?? [] - const injectedWalletServices = CONFIGURED_NETWORK === "testnet" ? wallets : [] + const injectedWalletServices = CONFIGURED_NETWORK !== "mainnet" ? wallets : [] return [wcBaseService, ...flowWcWalletServices, ...injectedWalletServices] } diff --git a/packages/fcl-wc/src/utils.js b/packages/fcl-wc/src/utils.js index 25d8078ab..6a886d119 100644 --- a/packages/fcl-wc/src/utils.js +++ b/packages/fcl-wc/src/utils.js @@ -7,8 +7,8 @@ export let CONFIGURED_NETWORK = null export const setConfiguredNetwork = async () => { CONFIGURED_NETWORK = await config.get("flow.network") invariant( - CONFIGURED_NETWORK === "mainnet" || CONFIGURED_NETWORK === "testnet", - "FCL Configuration value for 'flow.network' is required (testnet || mainnet)" + CONFIGURED_NETWORK, + "FCL Configuration value for 'flow.network' is required" ) } From b6fc3c44c08f90174c5ee088ca6d3b8b52ab268c Mon Sep 17 00:00:00 2001 From: gregsantos Date: Fri, 18 Nov 2022 11:13:31 -0800 Subject: [PATCH 3/3] PKG -- [fcl-wc] add changeset --- .changeset/tiny-lies-cheer.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tiny-lies-cheer.md diff --git a/.changeset/tiny-lies-cheer.md b/.changeset/tiny-lies-cheer.md new file mode 100644 index 000000000..66dc98a0e --- /dev/null +++ b/.changeset/tiny-lies-cheer.md @@ -0,0 +1,5 @@ +--- +"@onflow/fcl-wc": minor +--- + +Add support for pre-authz method