Capsule class

Flutter implementation of Capsule API

Constructors

Capsule({required Environment environment, required String apiKey})
Constructs a Capsule.

Properties

apiKey String
API key to use to configure the Capsule SDK.
final
environment Environment
The environment to use to configure the Capsule SDK.
final
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

check2FAStatus() Future<bool>
Checks if 2FA is enabled for the user.
checkIfUserExists(String email) Future<bool>
Determines if a user exists with the given email address.
clearStorage(bool keepSecretKey) Future<void>
Clears storage.
createUser(String email) Future<void>
Creates a new user with the given email address.
createWallet({required bool skipDistribute}) Future<CreateWalletResult>
Creates a Wallet for the user.
dispose() → void
Instructs the SDK to dispose of any resources that require explicit disposal.
distributeNewWalletShare({required String walletId, required String userShare}) Future<String>
Distributes a new wallet share, returning the recovery share.
enable2FA(String verificationCode) Future<void>
Turns on 2FA for the user.
fetchWallets() Future<List>
Fetches wallets for the currently logged in user.
generatePaillierKey() Future<void>
Generates a new Paillier key pair and stores it.
getEmail() Future<String?>
Gets the email of the currently logged in user, if one exists.
getPortalURL(String partnerId) Future<String>
Gets the portal URL for the given partner ID.
getSetUpBiometricsURL(bool isForNewDevice) Future<String>
Gets the URL that should be used for setting up biometrics.
getTransmissionKeyShares(bool isForNewDevice) Future<String>
Gets the key shares for transmission.
getWallets() Future<Map<String, Wallet>>
Gets the wallets of the currently logged in user, if one exists.
getWebAuthURLForLogin({required String sessionId, required String loginEncryptionPublicKey, String? partnerId, String? newDeviceSessionId, String? newDeviceEncryptionKey}) Future<String>
Gets the URL that should be used for web authentication.
init() → void
Call this method immediately after constructing an instance.
initiateUserLogin({required String email, bool? useShortURL}) Future<String>
Starts the login process.
isFullyLoggedIn() Future<bool>
Returns true if the user is fully logged in.
isSessionActive() Future<bool>
Checks if an authenticated session exists.
loginEncryptionKeyPair() Future<KeyPair?>
Gets the login encryption KeyPair.
logout() Future<void>
Logs the user out.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
portalBackgroundColor() Future<String?>
Gets the portal background color.
portalPrimaryButtonColor() Future<String?>
Gets the portal primary button color.
portalTextColor() Future<String?>
Gets the portal text color.
refreshSession(bool shouldOpenPopup) Future<String>
resendVerificationCode() Future<void>
Sends another verification code.
sendTransaction({required String walletId, required String rlpEncodedTxBase64, required String chainId}) Future<FullSignatureResult>
Sends a transaction.
setEmail(String email) Future<void>
Sets the email of the currently logged in user.
setLoginEncryptionKeyPair(KeyPair keyPair) Future<void>
Sets the keypair to use for login encryption.
setup2FA() Future<String>
Sets up 2FA for the user.
setupAfterLogin(List<String> temporaryShares) Future<void>
Call this method after login to set up the user.
setWallets(Map<String, Wallet> wallets) Future<void>
Sets wallets for the logged in user.
Shortens the given login link.
signMessage({required String walletId, required String messageBase64}) Future<FullSignatureResult>
Signs a message.
signTransaction({required String walletId, required String rlpEncodedTxBase64, required String chainId}) Future<FullSignatureResult>
Signs a transaction.
toString() String
A string representation of this object.
inherited
userSetupAfterLogin() Future<void>
verifyEmail(String verificationCode) Future<String>
Supplies email verification code obtained from prompting the user.
waitForAccountCreation() Future<void>
waitForLoginAndSetup() Future<Map<String, dynamic>>

Operators

operator ==(Object other) bool
The equality operator.
inherited