tap

suspend fun tap(amountUsd: BigDecimal, commandId: String? = null): String

Taps the faucet (/v0/wallet/tap): mints Amulet to the authenticated user's wallet party. Test networks only — DevNet and LocalNet validators expose the tap; on MainNet it fails.

The amount is denominated in USD, matching the validator wallet's tap: the minted Amulet quantity is amountUsd / amuletPrice at the latest open mining round's price (rounded up). On LocalNet the price is 0.005 USD/CC, so a 5 USD tap mints 1000 CC.

Right after network bootstrap the tap fails until the first mining round opens (400/404, also 429/503 under load — retry those; see ValidatorException).

Return

the contract id of the minted Amulet holding — watch for it in TokenStandardClient.listHoldings.

Parameters

amountUsd

the USD value to mint as Amulet, a positive Daml Decimal (at most 10 decimal places).

commandId

optional command id for deduplication; the validator generates a random one when absent.