Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/quietgarden/elm-web3 is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 2.0.0 found (5 same-name repos checked); no cached copy. Use another version.
Transaction lifecycle state machine.
Every transaction goes through explicit states. Pattern matching forces you to
handle every case — no "transaction failed silently" bugs. The state machine
follows the TLA+ spec in proofs/tla/TransactionSpec.tla:
terminal states never transition out (except via TxReset),
and confirmation counts only increase.
case tx.status of
Idle ->
viewBuyButton
AwaitingSignature ->
viewSigningSpinner
Submitted hash ->
viewPendingWithHash hash
Confirming hash n ->
viewConfirming n
Confirmed receipt ->
viewSuccess receipt
Failed err ->
viewError err
Rejected ->
viewRejectedTo poll for a receipt after submission, encode a RequestReceipt command:
case tx.status of
Submitted hash ->
( model
, web3Cmd (Tx.encodeCmd (Tx.RequestReceipt hash "my-tx"))
)
_ ->
( model, Cmd.none )To reset a terminal transaction back to Idle:
Tx.update Tx.TxReset tx.statusRelated modules: Web3.Contract.Send to build and encode write calls;
Web3.Contract.Call to simulate writes before broadcasting.
Messages from the JS transaction port.
A confirmed transaction receipt, including emitted logs.
A single log entry emitted during a transaction.
Update transaction status from a port message.
Transitions are guarded to match the TLA+ GuardedNext specification:
Is this status terminal (no more updates expected)?
Number of confirmations for a confirmed transaction given the current block number.
Apply a list of event decoders to the logs in a receipt, collecting all successfully decoded events.
type MyEvent
= Transfer { from : Address, to : Address, amount : BigInt }
| Approval { owner : Address, spender : Address, amount : BigInt }
decodeTransfer : EventLog -> Maybe MyEvent
decodeTransfer log =
-- match topic[0] to Transfer signature, then decode
...
events : List MyEvent
events =
parseReceiptEvents [ decodeTransfer, decodeApproval ] receipt
Transaction lifecycle status. Cannot be in an invalid state.