deploy Pending Credential
Deploys a wallet from a previously created pending credential.
Use this method to retry a failed deployment or to submit a wallet that was created with createWallet using autoSubmit = false. The credential must exist in local storage with a valid publicKey and contractId.
This method sets the connected state on the kit (same as createWallet) so the kit is ready to use immediately after a successful deployment.
Flow:
Look up credential from storage (throws CredentialException if not found or invalid)
Set connected state and emit SmartAccountEvent.WalletConnected
Build and sign the deploy transaction
If autoSubmit: submit via relayer or RPC, poll for confirmation
If autoFund: fund wallet via native token contract
Delete credential from storage on successful deployment
Return DeployPendingResult with the contract address, signed XDR, and optional hash
Return
DeployPendingResult with contractId, signedTransactionXdr, and optional transactionHash
Parameters
The credential ID (Base64URL-encoded, no padding) to deploy
Whether to automatically submit the deploy transaction (default: true)
Whether to automatically fund the wallet after deployment (default: false)
Contract address for the native token (required if autoFund is true)
Optional override to force relayer or RPC submission (default: auto-detect)
See also
for initial wallet creation with deferred deployment
Throws
if the credential is not found or missing required fields
if autoFund is true but nativeTokenContract is null
if building, simulating, or submitting the deploy transaction fails
Example (retry a failed deployment with auto-submit):
val result = walletOps.deployPendingCredential(
credentialId = "abc123...",
autoSubmit = true
)
println("Deployed at tx: ${result.transactionHash}")Example (build the XDR without submitting, for external submission):
val result = walletOps.deployPendingCredential(
credentialId = "abc123...",
autoSubmit = false
)
println("Signed XDR: ${result.signedTransactionXdr}")
// Submit externally or store for later