WaasClientImpl class

Embedded wallets (WaaS): MPC wallet creation and signing through the injected WaasEngine (hidden-webview reference implementation). Wallet enumeration: filter user.verifiedCredentials by walletProvider == embeddedWallet. Instances share the root client's state. NOTE: not yet thread-safe.

Implemented types

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 setteroverride
name → String
no setteroverride
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 setteroverride

Methods

addBusinessAccountSigner(String chain, String accountAddress, BusinessAccountTargetIdentity targetIdentity, [String? businessAccountId, String? walletId, String? signerType, String? password, String? targetSignerPassword, SignedBusinessAccountIntent? signedIntent, List<WaasPolicyRule>? initialSignerRules]) → Future<WaasBusinessAccountSignerResponse>
Reshares an embedded wallet to a new end-user signer. Pending actions do not create shares.
override
backupKeySharesToGoogleDrive(String chain, String accountAddress, String googleDriveAccessToken, String? password) → Future<void>
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.
override
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.
override
createWaasOfflineRecoveryShares(String chain, String accountAddress, String? cloudProviderAccessToken, String? mfaToken, String? password) → Future<void>
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.
override
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'.
override
createWalletForBusinessAccount(String businessAccountId, String chain, [String? password, String? thresholdSignatureScheme]) → Future<WaasCreatedWallet>
Creates a business-account wallet and refreshes the session.
override
delegateWaasKeyShares(String chain, String accountAddress, List<WaasPolicyRule>? initialSignerRules, String? password) → Future<void>
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.
override
getAvailableEvmGaslessRelayer(int chainId) → Future<String>
Returns the configured gasless relayer for an EVM chain.
override
getBusinessAccountSigningIntent(BusinessAccountProposal proposal) → BusinessAccountSigningIntentResult
Gets the original signing intent when a proposal contains a valid signing operation.
override
getEvmSponsoredTransactionStatus(String requestId) → Future<EvmSponsoredTransactionStatusResponse>
Returns the current state of an EVM gasless relay request.
override
getWalletAccountShareSets(String chain, String accountAddress) → WaasWalletAccountShareSets
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.
override
getWalletRecoveryState(String chain, String accountAddress) → Future<WalletRecoveryState>
Reads embedded-wallet password protection and readiness before signing. See WaasEngine.getWalletRecoveryState for the session-readiness caveat.
override
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).
override
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.
override
install(DynamicClient client) → void
override
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.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshWaasWalletAccountShares(String chain, String accountAddress, String? password) → Future<void>
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.
override
resume7702AuthorizationProposal(BusinessAccountProposal proposal, String accountAddress, [String? password]) → Future<Evm7702Authorization>
Resumes an approved EIP-7702 authorization proposal and returns the signed authorization, after checking that the signature recovers to the wallet. Needs useEvm for the signature check.
override
resumeSigningProposal(BusinessAccountProposal proposal, String chain, String accountAddress, [String? password]) → Future<String>
Resumes the exact operation stored in an approved signing proposal.
override
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.
override
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.
override
signEvm7702Authorization(String accountAddress, String authorizationHash, int chainId, int accountNonce, String contractAddress) → Future<Evm7702Authorization>
Signs an EIP-7702 authorization with the embedded EVM wallet.
override
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).
override
signRawMessage(String chain, String accountAddress, String message, BusinessAccountSigningIntentRawSign? rawSign, String? password) → Future<String>
Signs a raw 32-byte digest with an embedded (WaaS) wallet, as dynamic-js-sdk signRawMessage does. message is the digest as 64 hex characters without 0x; it is signed as is, with no hashing or prefix. accountAddress identifies the wallet (from the embeddedWallet verified credential). rawSign is the preimage the digest commits to. password is required only when the wallet is password-encrypted; see getWalletRecoveryState.
override
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. SVM accepts hex with or without 0x. Other chains leave those restrictions null. Chain extensions handle serialization and broadcast.
override
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.
override
sponsorEvmTransaction(SponsorEvmTransactionRequest request) → Future<String>
Submits a signed EVM gasless intent and returns its request ID.
override
sponsorSolanaTransaction(String transaction) → Future<String>
Replaces the fee payer on a base64 Solana transaction.
override
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.
override
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.
override

Operators

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