---
title: "cardano/transaction/script_purpose"
---

> Documentation Index
> Fetch the complete documentation index at: https://aiken-lang.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cardano/transaction/script_purpose

## Functions

### `compare` {#compare}

```aiken
compare(left: ScriptPurpose, right: ScriptPurpose) -> Ordering
```

Compare two script purposes, using the same ordering as the one used by
the ledger when constructing the
[redeemers](/stdlib/cardano/transaction/#Transaction) list:

[`Spend`](/stdlib/cardano/transaction/#ScriptPurpose) \< [`Mint`](/stdlib/cardano/transaction/#ScriptPurpose) \< [`Publish`](/stdlib/cardano/transaction/#ScriptPurpose) \< [`Withdraw`](/stdlib/cardano/transaction/#ScriptPurpose) \< [`Vote`](/stdlib/cardano/transaction/#ScriptPurpose) \< [`Propose`](/stdlib/cardano/transaction/#ScriptPurpose)

Note that this ordering follows the internal ledger types, and thus
differs from the constructor order of
[ScriptPurpose](/stdlib/cardano/transaction/#ScriptPurpose): `Spend` comes before
`Mint`, and `Publish` comes before `Withdraw`.

Source: https://aiken-lang.com/stdlib/cardano/transaction/script_purpose/index.mdx
