WaasClient class abstract
Embedded wallets (WaaS): MPC wallet creation and signing through the injected WaasEngine (hidden-webview reference implementation). Wallet enumeration: filter user.verifiedCredentials by walletProvider == embeddedWallet. Implemented by WaasClientImpl; hosts can substitute this interface in tests.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled → bool
-
True when the environment has embedded wallets v3 enabled (defaultWalletVersion == 'V3').
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings → EmbeddedWalletsSettings?
-
Embedded-wallets project settings captured at initialize(): WaaS is enabled when defaultWalletVersion == 'V3'; available chains are the enabled chainConfigurations. Null when the environment has no embedded wallets.
no setter
Methods
-
addBusinessAccountSigner(
String chain, String accountAddress, BusinessAccountTargetIdentity targetIdentity, [String? businessAccountId, String? walletId, String? signerType, String? password, String? targetSignerPassword, SignedBusinessAccountIntent? signedIntent]) → Future< WaasBusinessAccountSignerResponse> - Reshares an embedded wallet to a new end-user signer. Pending actions do not create shares.
- Backs up the client key share to Google Drive with a host-obtained OAuth token. Password is required only for password-protected wallets; native iCloud backup is not implemented.
-
createMissingWaasWallets(
) → Future< void> - Creates missing embedded wallets sequentially for enabled chains when auto-creation is on. Users with external credentials use automaticEmbeddedWalletCreationForExternal. Each failure emits walletCreationFailed without stopping later chains. Refreshes the user, restores a missing primary selection from lastSelectedAt or the configured primary chain, and persists that selection only for the user's first wallets.
- Mints a second, independent 2-of-2 offline-recovery share set for an embedded wallet: the client half uploads to the user's Google Drive, and the server half is delivered to the developer's configured webhook — Dynamic never retains its own half, so recovery works even if Dynamic is fully offline. cloudProviderAccessToken is an OAuth Drive-scope access token the HOST app obtains via its own Google Sign-In integration; omit it to use the stored OAuth token instead (same boundary as backupKeySharesToGoogleDrive). mfaToken proves a completed step-up when the environment requires one for this action. password is required only when the wallet is password-encrypted.
-
createWallet(
String chain) → Future< WaasCreatedWallet> - Creates an embedded (WaaS) wallet for the given chain via 2-of-2 MPC in the engine, then refreshes the user so the new credential is visible. Chain values: 'EVM', 'SOL', 'BTC', 'SUI', 'TON', 'TRON'.
-
createWalletForBusinessAccount(
String businessAccountId, String chain, [String? password, String? thresholdSignatureScheme]) → Future< WaasCreatedWallet> - Creates a business-account wallet and refreshes the session.
- Delegates an embedded wallet's signing authority to a new, server-managed share set, then refreshes the user so the new share-set metadata (walletProperties.otherShareSets) is visible. initialSignerRules optionally seeds the delegated signer's own policy layer at delegation time. password is required only when the wallet is password-encrypted — see getWalletRecoveryState.
-
getAvailableEvmGaslessRelayer(
int chainId) → Future< String> - Returns the configured gasless relayer for an EVM chain.
-
getEvmSponsoredTransactionStatus(
String requestId) → Future< EvmSponsoredTransactionStatusResponse> - Returns the current state of an EVM gasless relay request.
-
getSignerPolicyLayer(
String chain, String accountAddress) → Future< WaasPolicyLayerResponse> - Fetches a signer's active policy rules (the signer-Layer) for the CALLER's own active share set — see getWaasSignerSelfPolicyLayer's endpoint doc for the not-yet-modeled shareSetId query param. Pure REST — no MPC ceremony, no engine boot.
- An embedded wallet's own active share set (absent for a wallet that carries no share-set data) and every OTHER active share set on the same wallet (e.g. a delegated share set), for awareness. No network request; share-set ids rotate on refresh/reshare, so re-read rather than cache.
-
getWalletPolicyLayer(
String chain, String accountAddress) → Future< WaasPolicyLayerResponse> - Fetches an embedded wallet's active policy rules (the wallet-Layer). Pure REST — no MPC ceremony, no engine boot.
-
getWalletRecoveryState(
String chain, String accountAddress) → Future< WalletRecoveryState> - Reads embedded-wallet password protection and readiness before signing. See WaasEngine.getWalletRecoveryState for the session-readiness caveat.
-
hasDelegatedAccess(
String chain, String accountAddress) → bool - Whether an embedded wallet currently has ANY delegated share set — either one of its own PRIMARY share set's key shares is backed up as 'delegated', or another active share set on the same wallet is (walletProperties.otherShareSets). No network request; reads straight off the already-loaded VerifiedCredential (see WaasWalletProperties' doc for the narrow field subset this checks).
-
importPrivateKey(
String chain, String privateKey, bool? isRawScalarImport) → Future< WaasCreatedWallet> - Imports a private key through MPC, refreshes the user, and emits walletCreated. Supports EVM, SOL, BTC, SUI, TON, and TRON; no elevation is required. Set isRawScalarImport only for raw Ed25519 scalars on SOL/SUI/TON, not seeds; omit it for other chains.
-
lockWaasWallets(
) → Future< void> - Locks all embedded wallets by destroying their shared engine. Stored key shares remain intact. The next operation rebuilds the engine; each password-protected wallet must be unlocked again.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
- Reshares an embedded wallet's client key share in place (same threshold signature scheme, new share material) without changing the share set's identity or role. password is required only when the wallet is password-encrypted.
-
revokeWaasDelegation(
String chain, String accountAddress, String? password) → Future< void> - Revokes an embedded wallet's delegated share set, returning sole signing authority to the client, then refreshes the user so the change is visible. password is required only when the wallet is password-encrypted.
-
setWaasWalletAccountPassword(
String chain, String accountAddress, String newPassword) → Future< void> - Sets an initial password to encrypt the client key share. Use getWalletRecoveryState to inspect protection and unlockWallet to unlock it later.
-
signEvm7702Authorization(
String accountAddress, String authorizationHash, int chainId, int accountNonce, String contractAddress) → Future< Evm7702Authorization> - Signs an EIP-7702 authorization with the embedded EVM wallet.
-
signMessage(
String chain, String accountAddress, String message) → Future< String> - Signs a message with an embedded (WaaS) wallet via the MPC engine. accountAddress identifies the wallet (from the embeddedWallet verified credential).
-
signTransaction(
String chain, String accountAddress, String transaction, String? chainId, [List< int> ? signingIndexes, List<int> ? allowedSighash]) → Future<String> - Signs an unsigned chain transaction. EVM uses serialized hex and a numeric chainId string; Bitcoin uses a Base64 PSBT with optional signingIndexes and allowedSighash restrictions. Other chains leave those restrictions null. Chain extensions handle serialization and broadcast.
-
signTypedData(
String chain, String accountAddress, String typedData) → Future< String> - Signs EIP-712 data with an embedded wallet. typedData is the caller-serialized JSON object containing domain, types, message, and primaryType.
-
sponsorEvmTransaction(
SponsorEvmTransactionRequest request) → Future< String> - Submits a signed EVM gasless intent and returns its request ID.
-
sponsorSolanaTransaction(
String transaction) → Future< String> - Replaces the fee payer on a base64 Solana transaction.
-
toString(
) → String -
A string representation of this object.
inherited
-
unlockWallet(
String chain, String accountAddress, String password) → Future< WaasCreatedWallet> - Unlocks a password-protected embedded wallet for this session. Unprotected wallets need no unlock.
-
updateWaasPassword(
String chain, String accountAddress, String existingPassword, String newPassword) → Future< void> - Changes an existing password and re-encrypts the client key share. Use setWaasWalletAccountPassword for an unprotected wallet.
-
upsertSignerPolicyRule(
String chain, String accountAddress, WaasPolicyRule rule, ) → Future< WaasPolicyLayerResponse> - Creates or updates a single rule on a signer's policy layer. Omit shareSetId to target the caller's own active share set — only the wallet's own owner may target another. Pure REST — no MPC ceremony, no engine boot.
-
upsertWalletPolicyRule(
String chain, String accountAddress, WaasPolicyRule rule) → Future< WaasPolicyLayerResponse> - Creates or updates a single rule on an embedded wallet's policy layer (the wallet-Layer). Omit rule.ruleId to create a new rule (the enclave mints one); pass an existing id to update it in place. Pure REST — no MPC ceremony, no engine boot.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited