Connect to Blocto Wallet
Connecting to wallet is being called authentication or authn in FCL
Make sure you have set the configuration in Getting Started first.
There are two different ways to connect wallet:
Normal log in and retrieve user's flow account address.
Log in with account proof data to retrieve user's flow account address along with account proof.
If dApp chooses to ask user for user's authentication in this way, and the user approves the signing of message data, it will return user's flow account address with accountProofData
that can be used to prove a user controls an on-chain account.
fcl.authanticate
is also called behide fcl.login()
with accountProofData
set to nil.
Both methods above store address under fcl.currentUser
, to get user address just simply call as below.
To get user address or account proof after user authenticated, just simply call as below.
Verify account proof
Cadence has a built-in function called verify that will verify a signature against a Flow account given the account address.
FCL-Swift includes a utility function in AppUtilities
, verifyAccountProof
, for verifying one or more account proof signatures against an account's public key on the Flow blockchain.
BLOCTO_FCLCRYPTO_CONTRACT_ADDRESS can be found here
input parameter appIdentifier
should be exactly same with FCLAccountProofData
's appId above. They should all be a human readable string.
Last updated