SmartAccountBuilders

Builder utilities for Smart Account Kit.

Type-safe constructors for creating signers, context rule types, and policy parameters. These helpers ensure correct data structures are created for smart account operations.

Includes:

  • Signer builder functions for delegated, external, WebAuthn, and Ed25519 signers

  • Policy parameter data classes

  • Signer parsing (address string to signer)

  • Signer inspection (type checks, type description, credential/address extraction)

  • Signer matching (by credential ID, by address, equality)

  • Signer deduplication

Functions

Link copied to clipboard

Collects unique signers from a list, removing duplicates.

Link copied to clipboard

Creates a delegated signer (native Stellar account).

Link copied to clipboard
fun createEd25519Signer(ed25519VerifierAddress: String, publicKey: ByteArray): ExternalSigner

Creates an Ed25519 signer (with external verifier).

Link copied to clipboard
fun createExternalSigner(verifierAddress: String, keyData: ByteArray): ExternalSigner

Creates an external signer (custom verifier contract).

Link copied to clipboard
fun createSpendingLimitParams(spendingLimit: String, periodLedgers: Int): SpendingLimitParams

Creates spending limit policy parameters.

Link copied to clipboard

Creates simple threshold policy parameters.

Link copied to clipboard
fun createWebAuthnSigner(webauthnVerifierAddress: String, publicKey: ByteArray, credentialId: ByteArray): ExternalSigner

Creates a WebAuthn passkey signer.

Link copied to clipboard

Creates weighted threshold policy parameters.

Link copied to clipboard

Returns a human-readable description of a signer type.

Link copied to clipboard

Extracts the credential ID from a WebAuthn signer's key data.

Link copied to clipboard

Extracts the credential ID from a WebAuthn signer's key data as a Base64URL-encoded string.

Link copied to clipboard

Returns a unique string key for a signer, suitable for Map/Set operations.

Link copied to clipboard

Checks if a signer is a delegated signer (native Stellar account).

Link copied to clipboard

Checks if a signer is an external signer (verifier contract).

Link copied to clipboard

Checks if a signer matches a given Stellar address.

Link copied to clipboard

Checks if a signer matches a given credential ID.

Link copied to clipboard

Checks if a signer matches a given credential ID string.

Link copied to clipboard

Checks if two signers are equal.