Module opshin.ledger.api_v3
The PlutusV3 ledger API. All classes involved in defining the ScriptContext passed by the node.
Expand source code
"""
The PlutusV3 ledger API.
All classes involved in defining the ScriptContext passed by the node.
"""
from dataclasses import dataclass
from typing import Dict, List, Union
from pycardano import Datum as Anything, PlutusData
from opshin.std.fractions import *
@dataclass(unsafe_hash=True)
class NoScriptHash(PlutusData):
"""
Indicates that there is no script associated with an output
"""
CONSTR_ID = 1
# A transaction id, a 64 bytes long hash of the transaction body (also called transaction hash).
#
# Example value: bytes.fromhex("842a4d37b036da6ab3c04331240e67d81746beb44f23ad79703e026705361956")
TxId = bytes
@dataclass(unsafe_hash=True)
class TrueData(PlutusData):
"""
A Datum that represents True in Haskell implementations.
It is thus used as an encoding for True in the ScriptContext.
Example value: TrueData()
"""
CONSTR_ID = 1
@dataclass(unsafe_hash=True)
class FalseData(PlutusData):
"""
A Datum that represents False in Haskell implementations.
It is thus used as an encoding for False in the ScriptContext.
Example value: FalseData()
"""
CONSTR_ID = 0
# A Datum that represents a boolean value in Haskell implementations.
# It is thus used as an encoding for booleans in the ScriptContext.
#
# Example value: TrueData()
BoolData = Union[TrueData, FalseData]
@dataclass(unsafe_hash=True)
class BoxedInt(PlutusData):
"""
A boxed integer, used to represent an optional integer value
"""
CONSTR_ID = 0
value: int
@dataclass(unsafe_hash=True)
class NoValue(PlutusData):
"""
An empty value (None case of Optional / Maybe)
"""
CONSTR_ID = 1
Lovelace = int
OptionalInt = Union[BoxedInt, NoValue]
OptionalLovelace = OptionalInt
@dataclass(unsafe_hash=True)
class TxOutRef(PlutusData):
"""
A reference to a transaction output (hash/id + index)
"""
CONSTR_ID = 0
id: TxId
idx: int
# A public key hash, used to identify signatures provided by a wallet
# in aiken, this is called VerificationKeyHash
PubKeyHash = bytes
@dataclass(unsafe_hash=True)
class PubKeyCredential(PlutusData):
"""
Part of an address that is authenticated by a public key hash
Example value: PubKeyCredential(bytes.fromhex("c06ddaad12fc4ded18e56feac72957c1aa75fce6096b40e63ec88274"))
"""
CONSTR_ID = 0
credential_hash: PubKeyHash
# A validator hash, used to identify signatures provided by a smart contract
ValidatorHash = bytes
@dataclass(unsafe_hash=True)
class ScriptCredential(PlutusData):
"""
Part of an address that is authenticated by a smart cotnract
Example value: ScriptCredential(bytes.fromhex("c06ddaad12fc4ded18e56feac72957c1aa75fce6096b40e63ec88274"))
"""
CONSTR_ID = 1
credential_hash: ValidatorHash
# A credential, either smart contract or public key hash
Credential = Union[PubKeyCredential, ScriptCredential]
@dataclass(unsafe_hash=True)
class StakingHash(PlutusData):
"""
Indicates that the stake of this address is controlled by the associated credential
"""
CONSTR_ID = 0
value: Credential
@dataclass(unsafe_hash=True)
class StakingPtr(PlutusData):
"""
Indicates that the stake of this address is controlled by the associated pointer.
In an address, a chain pointer refers to a point of the chain containing a stake key registration certificate.
A point is identified by the 3 coordinates in this object.
"""
CONSTR_ID = 1
# an absolute slot number
slot_no: int
# a transaction index (within that slot)
tx_index: int
# a (delegation) certificate index (within that transaction)
cert_index: int
# Part of an address that controls who can delegate the stake associated with an address
StakingCredential = Union[StakingHash, StakingPtr]
@dataclass(unsafe_hash=True)
class NoStakingCredential(PlutusData):
"""
Indicates that this address has no staking credentials.
Its funds can not be delegated.
"""
CONSTR_ID = 1
@dataclass(unsafe_hash=True)
class SomeStakingCredential(PlutusData):
"""
Indicates that this address has staking credentials.
Its funds can be delegated by the credentialed user.
"""
CONSTR_ID = 0
staking_credential: StakingCredential
@dataclass(unsafe_hash=True)
class Address(PlutusData):
"""
A Shelley address, consisting of a payment and staking credential
"""
CONSTR_ID = 0
payment_credential: Credential
staking_credential: Union[NoStakingCredential, SomeStakingCredential]
# The policy Id of a token
PolicyId = bytes
# The name of a token in bytes (not textual representation!)
TokenName = bytes
# The Plutus representation of amounts of tokens being spent, sent or minted
# It is a two-layered dictionary that stores for each policy id and token name
# the amount of the token that is being sent/minted/burned etc
#
# Lovelace is represented with policy id b"" and token name b""
Value = Dict[PolicyId, Dict[TokenName, int]]
# A hash of a Datum
DatumHash = bytes
@dataclass(unsafe_hash=True)
class SomeDatumHash(PlutusData):
"""
Indicates that there is a datum associated with this output, which has the given hash.
"""
CONSTR_ID = 1
datum_hash: DatumHash
ScriptHash = bytes
@dataclass(unsafe_hash=True)
class SomeScriptHash(PlutusData):
"""
Indicates that there is a script associated with this output, which has the given hash.
"""
CONSTR_ID = 0
script_hash: ScriptHash
MaybeScriptHash = Union[SomeScriptHash, NoScriptHash]
# The abstract super type of any object in opshin.
# Use if you don't know what kind of object is being passed or if it doesn't matter.
BuiltinData = Anything
# An abstract type annotation that something is supposed to be used as a redeemer.
Redeemer = BuiltinData
# An abstract type annotation that something is supposed to be used as a datum.
Datum = BuiltinData
@dataclass(unsafe_hash=True)
class NoOutputDatum(PlutusData):
"""
Indicates that there is no datum associated with an output
"""
CONSTR_ID = 0
@dataclass(unsafe_hash=True)
class SomeOutputDatumHash(PlutusData):
"""
Indicates that there is an datum associated with an output, which has the attached hash
"""
CONSTR_ID = 1
datum_hash: DatumHash
@dataclass(unsafe_hash=True)
class SomeOutputDatum(PlutusData):
"""
Indicates that there is an datum associated with an output, which is inlined and equal to the attached datum
"""
CONSTR_ID = 2
datum: Datum
# Possible cases of datum association with an output
OutputDatum = Union[NoOutputDatum, SomeOutputDatumHash, SomeOutputDatum]
@dataclass(unsafe_hash=True)
class NoScriptHash(PlutusData):
"""
Indicates that there is no script associated with an output
"""
CONSTR_ID = 1
@dataclass(unsafe_hash=True)
class TxOut(PlutusData):
"""
The plutus representation of an transaction output, consisting of
- address: address owning this output
- value: tokens associated with this output
- datum: datum associated with this output
- reference_script: reference script associated with this output
"""
CONSTR_ID = 0
address: Address
value: Value
datum: OutputDatum
reference_script: Union[NoScriptHash, SomeScriptHash]
@dataclass(unsafe_hash=True)
class TxInInfo(PlutusData):
"""
The plutus representation of an transaction output, that is consumed by the transaction.
"""
CONSTR_ID = 0
out_ref: TxOutRef
resolved: TxOut
@dataclass(unsafe_hash=True)
class DCertDelegRegKey(PlutusData):
CONSTR_ID = 0
value: StakingCredential
@dataclass(unsafe_hash=True)
class DCertDelegDeRegKey(PlutusData):
CONSTR_ID = 1
value: StakingCredential
@dataclass(unsafe_hash=True)
class DCertDelegDelegate(PlutusData):
CONSTR_ID = 2
delegator: StakingCredential
delegatee: PubKeyHash
@dataclass(unsafe_hash=True)
class DCertPoolRegister(PlutusData):
CONSTR_ID = 3
pool_id: PubKeyHash
pool_vfr: PubKeyHash
@dataclass(unsafe_hash=True)
class DCertPoolRetire(PlutusData):
CONSTR_ID = 4
retirement_certificate: PubKeyHash
epoch: int
@dataclass(unsafe_hash=True)
class DCertGenesis(PlutusData):
CONSTR_ID = 5
@dataclass(unsafe_hash=True)
class DCertMir(PlutusData):
CONSTR_ID = 6
Certificate = Union[
DCertDelegRegKey,
DCertDelegDeRegKey,
DCertDelegDelegate,
DCertPoolRegister,
DCertPoolRetire,
DCertGenesis,
DCertMir,
]
# POSIX time in milliseconds, typically originating from the Cardano node.
# Note that Python's `time.time()` provides seconds, so remember to multiply by 1000.
POSIXTime = int
@dataclass(unsafe_hash=True)
class NegInfPOSIXTime(PlutusData):
"""
Negative infinite POSIX time, used to indicate that there is no lower bound for the execution of this transaction
"""
CONSTR_ID = 0
@dataclass(unsafe_hash=True)
class FinitePOSIXTime(PlutusData):
"""
Finite POSIX time, used to indicate that there is a lower or upper bound for the execution of this transaction
Note: POSIX time is in milliseconds, while Python's time.time() provides seconds, so remember to multiply/divide by 1000 when interacting with off-chain code.
"""
CONSTR_ID = 1
time: POSIXTime
@dataclass(unsafe_hash=True)
class PosInfPOSIXTime(PlutusData):
"""
Infinite POSIX time, used to indicate that there is no upper bound for the execution of this transaction
"""
CONSTR_ID = 2
ExtendedPOSIXTime = Union[NegInfPOSIXTime, FinitePOSIXTime, PosInfPOSIXTime]
@dataclass(unsafe_hash=True)
class UpperBoundPOSIXTime(PlutusData):
"""
Upper bound for the execution of this transaction
"""
CONSTR_ID = 0
limit: ExtendedPOSIXTime
closed: BoolData
@dataclass(unsafe_hash=True)
class LowerBoundPOSIXTime(PlutusData):
"""
Lower bound for the execution of this transaction
"""
CONSTR_ID = 0
limit: ExtendedPOSIXTime
closed: BoolData
@dataclass(unsafe_hash=True)
class POSIXTimeRange(PlutusData):
"""
Time range in which this transaction can be executed
Note: The transaction can be submitted at any point of time in the range.
Deriving the actual submission time can be tricky. Best practices use only the upper or lower bound, depending on the use case.
For example, if you accrue interest over time, use only the upper bound as the submission time, which is guaranteed to be after the actual submission time, but can be set tightly by the user to match the actual submission time.
"""
CONSTR_ID = 0
lower_bound: LowerBoundPOSIXTime
upper_bound: UpperBoundPOSIXTime
@dataclass(unsafe_hash=True)
class Minting(PlutusData):
"""
Script purpose indicating that the given policy id is being minted or burned
"""
CONSTR_ID = 0
policy_id: PolicyId
@dataclass(unsafe_hash=True)
class Spending(PlutusData):
"""
Script purpose indicating that the given transaction output is being spent, which is
owned by the invoked contract
"""
CONSTR_ID = 1
tx_out_ref: TxOutRef
@dataclass(unsafe_hash=True)
class Withdrawing(PlutusData):
"""
For scripts that validate reward withdrawals from a reward account.
The argument identifies the target reward account.
"""
CONSTR_ID = 2
staking_credential: StakingCredential
@dataclass(unsafe_hash=True)
class ConstitutionalCommitteeMember(PlutusData):
CONSTR_ID = 0
credential: Credential
@dataclass(unsafe_hash=True)
class DelegateRepresentative(PlutusData):
CONSTR_ID = 1
credential: Credential
@dataclass(unsafe_hash=True)
class StakePool(PlutusData):
CONSTR_ID = 2
verification_key_hash: PubKeyHash
Voter = Union[ConstitutionalCommitteeMember, DelegateRepresentative, StakePool]
@dataclass(unsafe_hash=True)
class GovernanceActionId(PlutusData):
CONSTR_ID = 0
transaction: TxId
# Note: is a non-negative index to the proposal
proposal_procedure: int
@dataclass(unsafe_hash=True)
class VoteNo(PlutusData):
CONSTR_ID = 0
@dataclass(unsafe_hash=True)
class VoteYes(PlutusData):
CONSTR_ID = 1
@dataclass(unsafe_hash=True)
class VoteAbstain(PlutusData):
CONSTR_ID = 2
Vote = Union[VoteNo, VoteYes, VoteAbstain]
@dataclass(unsafe_hash=True)
class SomeGovernanceActionId(PlutusData):
"""
Indicates that there is an governance action id associated with this output, given in the first field
"""
CONSTR_ID = 0
governance_action_id: GovernanceActionId
@dataclass(unsafe_hash=True)
class NoGovernanceActionId(PlutusData):
"""
Indicates that there is no governance action id associated with this output
"""
CONSTR_ID = 1
# To convert these values to interpretable values,
# use the index -> value mapping from aiken
# https://github.com/aiken-lang/stdlib/blob/2.2.0/lib/cardano/governance/protocol_parameters.ak
# Explicit mapping functions may follow
ProtocolParametersUpdate = Dict[int, Datum]
MaybeGovernanceActionId = Union[SomeGovernanceActionId, NoGovernanceActionId]
# Below are Governance Actions (GAXXX)
@dataclass(unsafe_hash=True)
class GAParameterChange(PlutusData):
CONSTR_ID = 0
# The last governance action of type 'ProtocolParameters'. They must all form a chain.
ancestor: MaybeGovernanceActionId
# The new proposed protocol parameters. Only values set to `Some` are relevant.
new_parameters: ProtocolParametersUpdate
# The optional guardrails script defined in the constitution.
# The script is executed by the ledger in addition to the hard-coded ledger rules.
# It must pass for the new protocol parameters to be deemed valid.
guardrails: Union[SomeScriptHash, NoScriptHash]
@dataclass(unsafe_hash=True)
class ProtocolVersion(PlutusData):
CONSTR_ID = 0
major: int
minor: int
@dataclass(unsafe_hash=True)
class GAHardForkInitiation(PlutusData):
CONSTR_ID = 1
# The last governance action of type 'HardFork'. They must all form a chain.
ancestor: MaybeGovernanceActionId
# The new proposed version. A few rules apply to proposing new versions:
#
# - The `major` component, if incremented, must be exactly one more than the current.
# - The `minor` component, if incremented, must be exactly one more than the current.
# - If the `major` component is incremented, `minor` must be set to `0`.
# - Neither `minor` nor `major` can be decremented.
new_version: ProtocolVersion
@dataclass(unsafe_hash=True)
class GATreasuryWithdrawals(PlutusData):
CONSTR_ID = 2
# A collection of beneficiaries, which can be plain verification key
# hashes or script hashes (e.g. DAO).
treasury_withdrawals: Dict[Credential, Lovelace]
# The optional guardrails script defined in the constitution. The script
# is executed by the ledger in addition to the hard-coded ledger rules.
#
# It must pass for the withdrawals to be authorized.
guardrails: SomeScriptHash
@dataclass(unsafe_hash=True)
class GANoConfidence(PlutusData):
CONSTR_ID = 3
# The last governance action of type `NoConfidence` or `ConstitutionalCommittee`.
# They must all form a chain.
ancestor: MaybeGovernanceActionId
@dataclass(unsafe_hash=True)
class GAUpdateCommittee(PlutusData):
CONSTR_ID = 4
# The last governance action of type `NoConfidence` or `ConstitutionalCommittee`.
# They must all / form a chain.
ancestor: MaybeGovernanceActionId
# Constitutional members to be removed.
evicted_members: List[Credential]
# Constitutional members to be added.
# Int value is a "mandate", an epoch number after which constitutional committee member
# mandate expires.
added_members: Dict[Credential, int]
# The new quorum value, as a ratio of a numerator and a denominator.
# The quorum specifies the threshold of 'Yes' votes necessary for the constitutional committee to accept a proposal procedure.
quorum: Fraction
AnchorDataHash = bytes
@dataclass(unsafe_hash=True)
class Anchor(PlutusData):
"""
Represents a proposal procedure in governance.
"""
CONSTR_ID = 0
url: bytes
data_hash: AnchorDataHash
@dataclass(unsafe_hash=True)
class Constitution(PlutusData):
CONSTR_ID = 0
# Anchor
anchor: Anchor
# Guardrails for operations as a script
guardrails: MaybeScriptHash
@dataclass(unsafe_hash=True)
class GANewConstitution(PlutusData):
CONSTR_ID = 5
# The last governance action of type `Constitution` or `ConstitutionalCommittee`.
# They must all form a chain.
ancestor: MaybeGovernanceActionId
constitution: Constitution
@dataclass(unsafe_hash=True)
class GAInfo(PlutusData):
# No effect on chain, only informative nature
CONSTR_ID = 6
GovernanceAction = Union[
GAParameterChange,
GAHardForkInitiation,
GATreasuryWithdrawals,
GANoConfidence,
GAUpdateCommittee,
GANewConstitution,
GAInfo,
]
@dataclass(unsafe_hash=True)
class ProposalProcedure(PlutusData):
"""
Represents a proposal procedure in governance.
"""
CONSTR_ID = 0
deposit: Lovelace
reward_account: Credential
governance_action: GovernanceAction
anchor: Anchor
@dataclass(unsafe_hash=True)
class Publishing(PlutusData):
"""
Needed when delegating to a pool using stake credentials defined as a
custom script. This purpose is also triggered when de-registering such
stake credentials.
The index is a 0-based index of the given `Certificate` in `certificates`.
"""
CONSTR_ID = 3
certificate_index: int
certificate: Certificate
@dataclass(unsafe_hash=True)
class Voting(PlutusData):
"""
Voting for a type of voter using a governance action id to vote
yes / no / abstain inside a transaction.
The voter is who is doing the governance action.
"""
CONSTR_ID = 4
voter: Voter
@dataclass(unsafe_hash=True)
class Proposing(PlutusData):
"""
Used to propose a governance action.
A 0-based index of the given `ProposalProcedure` in `proposal_procedures`.
"""
CONSTR_ID = 5
proposal_index: int
proposal_procedure: ProposalProcedure
# The reason that this script is being invoked
ScriptPurpose = Union[Minting, Spending, Withdrawing, Publishing, Voting, Proposing]
@dataclass()
class TxInfo(PlutusData):
"""
A complex agglomeration of everything that could be of interest to the executed script, regarding the transaction
that invoked the script
"""
CONSTR_ID = 0
# The input UTXOs of the transaction.
inputs: List[TxInInfo]
# The reference UTXOs of the transaction.
reference_inputs: List[TxInInfo]
# The output UTXOs created by the transaction.
outputs: List[TxOut]
# Transaction fee to be payed for the transaction.
fee: Lovelace
# The value minted in the transaction.
mint: Value
certificates: List[Certificate]
# Withdrawals from specific stake keys
# NOTE: Withdrawals are ordered by ascending Credential. Yet, note that `Script` credentials are treated as **lower values** than `VerificationKey` credentials.
withdrawals: Dict[StakingCredential, int]
# The range of time in which this transaction is valid
validity_range: POSIXTimeRange
# The signatures for the transaction.
signatories: List[PubKeyHash]
# All redeemers passed to all script invocations
# NOTE: Redeemers are ordered by ascending ScriptPurpose.
redeemers: Dict[ScriptPurpose, Redeemer]
# All datums present in any inputs
datums: Dict[DatumHash, Datum]
# The ID of the transaction.
id: TxId
# metadata for governance actions
# NOTE: Votes are ordered by ascending Voter and GovernanceActionId. First constructor variants in a type are treated as lower indices; except for Credential where `Script` credentials are treated as **lower values** than `VerificationKey` credentials.
votes: Dict[Voter, Dict[GovernanceActionId, Vote]]
proposal_procedures: List[ProposalProcedure]
current_treasury_amount: OptionalLovelace
treasury_donation: OptionalLovelace
@dataclass(unsafe_hash=True)
class ScriptContext(PlutusData):
"""
Auxiliary information about the transaction and reason for invocation of the called script.
"""
CONSTR_ID = 0
transaction: TxInfo
redeemer: Redeemer
purpose: ScriptPurpose
Classes
class Address (payment_credential: PubKeyCredential | ScriptCredential, staking_credential: NoStakingCredential | SomeStakingCredential)-
A Shelley address, consisting of a payment and staking credential
Expand source code
@dataclass(unsafe_hash=True) class Address(PlutusData): """ A Shelley address, consisting of a payment and staking credential """ CONSTR_ID = 0 payment_credential: Credential staking_credential: Union[NoStakingCredential, SomeStakingCredential]Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var payment_credential : PubKeyCredential | ScriptCredential-
The type of the None singleton.
var staking_credential : NoStakingCredential | SomeStakingCredential-
The type of the None singleton.
class Anchor (url: bytes, data_hash: bytes)-
Represents a proposal procedure in governance.
Expand source code
@dataclass(unsafe_hash=True) class Anchor(PlutusData): """ Represents a proposal procedure in governance. """ CONSTR_ID = 0 url: bytes data_hash: AnchorDataHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var data_hash : bytes-
The type of the None singleton.
var url : bytes-
The type of the None singleton.
class BoxedInt (value: int)-
A boxed integer, used to represent an optional integer value
Expand source code
@dataclass(unsafe_hash=True) class BoxedInt(PlutusData): """ A boxed integer, used to represent an optional integer value """ CONSTR_ID = 0 value: intAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var value : int-
The type of the None singleton.
class Constitution (anchor: Anchor, guardrails: SomeScriptHash | NoScriptHash)-
Constitution(anchor: opshin.ledger.api_v3.Anchor, guardrails: opshin.ledger.api_v3.SomeScriptHash | opshin.ledger.api_v3.NoScriptHash)
Expand source code
@dataclass(unsafe_hash=True) class Constitution(PlutusData): CONSTR_ID = 0 # Anchor anchor: Anchor # Guardrails for operations as a script guardrails: MaybeScriptHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var anchor : Anchor-
The type of the None singleton.
var guardrails : SomeScriptHash | NoScriptHash-
The type of the None singleton.
class ConstitutionalCommitteeMember (credential: PubKeyCredential | ScriptCredential)-
ConstitutionalCommitteeMember(credential: opshin.ledger.api_v3.PubKeyCredential | opshin.ledger.api_v3.ScriptCredential)
Expand source code
@dataclass(unsafe_hash=True) class ConstitutionalCommitteeMember(PlutusData): CONSTR_ID = 0 credential: CredentialAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var credential : PubKeyCredential | ScriptCredential-
The type of the None singleton.
class DCertDelegDeRegKey (value: StakingHash | StakingPtr)-
DCertDelegDeRegKey(value: opshin.ledger.api_v3.StakingHash | opshin.ledger.api_v3.StakingPtr)
Expand source code
@dataclass(unsafe_hash=True) class DCertDelegDeRegKey(PlutusData): CONSTR_ID = 1 value: StakingCredentialAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var value : StakingHash | StakingPtr-
The type of the None singleton.
class DCertDelegDelegate (delegator: StakingHash | StakingPtr, delegatee: bytes)-
DCertDelegDelegate(delegator: opshin.ledger.api_v3.StakingHash | opshin.ledger.api_v3.StakingPtr, delegatee: bytes)
Expand source code
@dataclass(unsafe_hash=True) class DCertDelegDelegate(PlutusData): CONSTR_ID = 2 delegator: StakingCredential delegatee: PubKeyHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var delegatee : bytes-
The type of the None singleton.
var delegator : StakingHash | StakingPtr-
The type of the None singleton.
class DCertDelegRegKey (value: StakingHash | StakingPtr)-
DCertDelegRegKey(value: opshin.ledger.api_v3.StakingHash | opshin.ledger.api_v3.StakingPtr)
Expand source code
@dataclass(unsafe_hash=True) class DCertDelegRegKey(PlutusData): CONSTR_ID = 0 value: StakingCredentialAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var value : StakingHash | StakingPtr-
The type of the None singleton.
class DCertGenesis-
DCertGenesis()
Expand source code
@dataclass(unsafe_hash=True) class DCertGenesis(PlutusData): CONSTR_ID = 5Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class DCertMir-
DCertMir()
Expand source code
@dataclass(unsafe_hash=True) class DCertMir(PlutusData): CONSTR_ID = 6Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class DCertPoolRegister (pool_id: bytes, pool_vfr: bytes)-
DCertPoolRegister(pool_id: bytes, pool_vfr: bytes)
Expand source code
@dataclass(unsafe_hash=True) class DCertPoolRegister(PlutusData): CONSTR_ID = 3 pool_id: PubKeyHash pool_vfr: PubKeyHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var pool_id : bytes-
The type of the None singleton.
var pool_vfr : bytes-
The type of the None singleton.
class DCertPoolRetire (retirement_certificate: bytes, epoch: int)-
DCertPoolRetire(retirement_certificate: bytes, epoch: int)
Expand source code
@dataclass(unsafe_hash=True) class DCertPoolRetire(PlutusData): CONSTR_ID = 4 retirement_certificate: PubKeyHash epoch: intAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var epoch : int-
The type of the None singleton.
var retirement_certificate : bytes-
The type of the None singleton.
class DelegateRepresentative (credential: PubKeyCredential | ScriptCredential)-
DelegateRepresentative(credential: opshin.ledger.api_v3.PubKeyCredential | opshin.ledger.api_v3.ScriptCredential)
Expand source code
@dataclass(unsafe_hash=True) class DelegateRepresentative(PlutusData): CONSTR_ID = 1 credential: CredentialAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var credential : PubKeyCredential | ScriptCredential-
The type of the None singleton.
class FalseData-
A Datum that represents False in Haskell implementations. It is thus used as an encoding for False in the ScriptContext.
Example value: FalseData()
Expand source code
@dataclass(unsafe_hash=True) class FalseData(PlutusData): """ A Datum that represents False in Haskell implementations. It is thus used as an encoding for False in the ScriptContext. Example value: FalseData() """ CONSTR_ID = 0Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class FinitePOSIXTime (time: int)-
Finite POSIX time, used to indicate that there is a lower or upper bound for the execution of this transaction Note: POSIX time is in milliseconds, while Python's time.time() provides seconds, so remember to multiply/divide by 1000 when interacting with off-chain code.
Expand source code
@dataclass(unsafe_hash=True) class FinitePOSIXTime(PlutusData): """ Finite POSIX time, used to indicate that there is a lower or upper bound for the execution of this transaction Note: POSIX time is in milliseconds, while Python's time.time() provides seconds, so remember to multiply/divide by 1000 when interacting with off-chain code. """ CONSTR_ID = 1 time: POSIXTimeAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var time : int-
The type of the None singleton.
class GAHardForkInitiation (ancestor: SomeGovernanceActionId | NoGovernanceActionId, new_version: ProtocolVersion)-
GAHardForkInitiation(ancestor: opshin.ledger.api_v3.SomeGovernanceActionId | opshin.ledger.api_v3.NoGovernanceActionId, new_version: opshin.ledger.api_v3.ProtocolVersion)
Expand source code
@dataclass(unsafe_hash=True) class GAHardForkInitiation(PlutusData): CONSTR_ID = 1 # The last governance action of type 'HardFork'. They must all form a chain. ancestor: MaybeGovernanceActionId # The new proposed version. A few rules apply to proposing new versions: # # - The `major` component, if incremented, must be exactly one more than the current. # - The `minor` component, if incremented, must be exactly one more than the current. # - If the `major` component is incremented, `minor` must be set to `0`. # - Neither `minor` nor `major` can be decremented. new_version: ProtocolVersionAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var ancestor : SomeGovernanceActionId | NoGovernanceActionId-
The type of the None singleton.
var new_version : ProtocolVersion-
The type of the None singleton.
class GAInfo-
GAInfo()
Expand source code
@dataclass(unsafe_hash=True) class GAInfo(PlutusData): # No effect on chain, only informative nature CONSTR_ID = 6Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class GANewConstitution (ancestor: SomeGovernanceActionId | NoGovernanceActionId, constitution: Constitution)-
GANewConstitution(ancestor: opshin.ledger.api_v3.SomeGovernanceActionId | opshin.ledger.api_v3.NoGovernanceActionId, constitution: opshin.ledger.api_v3.Constitution)
Expand source code
@dataclass(unsafe_hash=True) class GANewConstitution(PlutusData): CONSTR_ID = 5 # The last governance action of type `Constitution` or `ConstitutionalCommittee`. # They must all form a chain. ancestor: MaybeGovernanceActionId constitution: ConstitutionAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var ancestor : SomeGovernanceActionId | NoGovernanceActionId-
The type of the None singleton.
var constitution : Constitution-
The type of the None singleton.
class GANoConfidence (ancestor: SomeGovernanceActionId | NoGovernanceActionId)-
GANoConfidence(ancestor: opshin.ledger.api_v3.SomeGovernanceActionId | opshin.ledger.api_v3.NoGovernanceActionId)
Expand source code
@dataclass(unsafe_hash=True) class GANoConfidence(PlutusData): CONSTR_ID = 3 # The last governance action of type `NoConfidence` or `ConstitutionalCommittee`. # They must all form a chain. ancestor: MaybeGovernanceActionIdAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var ancestor : SomeGovernanceActionId | NoGovernanceActionId-
The type of the None singleton.
class GAParameterChange (ancestor: SomeGovernanceActionId | NoGovernanceActionId, new_parameters: Dict[int, pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData], guardrails: SomeScriptHash | NoScriptHash)-
GAParameterChange(ancestor: opshin.ledger.api_v3.SomeGovernanceActionId | opshin.ledger.api_v3.NoGovernanceActionId, new_parameters: Dict[int, pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData], guardrails: opshin.ledger.api_v3.SomeScriptHash | opshin.ledger.api_v3.NoScriptHash)
Expand source code
@dataclass(unsafe_hash=True) class GAParameterChange(PlutusData): CONSTR_ID = 0 # The last governance action of type 'ProtocolParameters'. They must all form a chain. ancestor: MaybeGovernanceActionId # The new proposed protocol parameters. Only values set to `Some` are relevant. new_parameters: ProtocolParametersUpdate # The optional guardrails script defined in the constitution. # The script is executed by the ledger in addition to the hard-coded ledger rules. # It must pass for the new protocol parameters to be deemed valid. guardrails: Union[SomeScriptHash, NoScriptHash]Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var ancestor : SomeGovernanceActionId | NoGovernanceActionId-
The type of the None singleton.
var guardrails : SomeScriptHash | NoScriptHash-
The type of the None singleton.
var new_parameters : Dict[int, pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData]-
The type of the None singleton.
class GATreasuryWithdrawals (treasury_withdrawals: Dict[PubKeyCredential | ScriptCredential, int], guardrails: SomeScriptHash)-
GATreasuryWithdrawals(treasury_withdrawals: Dict[opshin.ledger.api_v3.PubKeyCredential | opshin.ledger.api_v3.ScriptCredential, int], guardrails: opshin.ledger.api_v3.SomeScriptHash)
Expand source code
@dataclass(unsafe_hash=True) class GATreasuryWithdrawals(PlutusData): CONSTR_ID = 2 # A collection of beneficiaries, which can be plain verification key # hashes or script hashes (e.g. DAO). treasury_withdrawals: Dict[Credential, Lovelace] # The optional guardrails script defined in the constitution. The script # is executed by the ledger in addition to the hard-coded ledger rules. # # It must pass for the withdrawals to be authorized. guardrails: SomeScriptHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var guardrails : SomeScriptHash-
The type of the None singleton.
var treasury_withdrawals : Dict[PubKeyCredential | ScriptCredential, int]-
The type of the None singleton.
class GAUpdateCommittee (ancestor: SomeGovernanceActionId | NoGovernanceActionId, evicted_members: List[PubKeyCredential | ScriptCredential], added_members: Dict[PubKeyCredential | ScriptCredential, int], quorum: Fraction)-
GAUpdateCommittee(ancestor: opshin.ledger.api_v3.SomeGovernanceActionId | opshin.ledger.api_v3.NoGovernanceActionId, evicted_members: List[opshin.ledger.api_v3.PubKeyCredential | opshin.ledger.api_v3.ScriptCredential], added_members: Dict[opshin.ledger.api_v3.PubKeyCredential | opshin.ledger.api_v3.ScriptCredential, int], quorum: opshin.std.fractions.Fraction)
Expand source code
@dataclass(unsafe_hash=True) class GAUpdateCommittee(PlutusData): CONSTR_ID = 4 # The last governance action of type `NoConfidence` or `ConstitutionalCommittee`. # They must all / form a chain. ancestor: MaybeGovernanceActionId # Constitutional members to be removed. evicted_members: List[Credential] # Constitutional members to be added. # Int value is a "mandate", an epoch number after which constitutional committee member # mandate expires. added_members: Dict[Credential, int] # The new quorum value, as a ratio of a numerator and a denominator. # The quorum specifies the threshold of 'Yes' votes necessary for the constitutional committee to accept a proposal procedure. quorum: FractionAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var added_members : Dict[PubKeyCredential | ScriptCredential, int]-
The type of the None singleton.
var ancestor : SomeGovernanceActionId | NoGovernanceActionId-
The type of the None singleton.
var evicted_members : List[PubKeyCredential | ScriptCredential]-
The type of the None singleton.
var quorum : Fraction-
The type of the None singleton.
class GovernanceActionId (transaction: bytes, proposal_procedure: int)-
GovernanceActionId(transaction: bytes, proposal_procedure: int)
Expand source code
@dataclass(unsafe_hash=True) class GovernanceActionId(PlutusData): CONSTR_ID = 0 transaction: TxId # Note: is a non-negative index to the proposal proposal_procedure: intAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var proposal_procedure : int-
The type of the None singleton.
var transaction : bytes-
The type of the None singleton.
class LowerBoundPOSIXTime (limit: NegInfPOSIXTime | FinitePOSIXTime | PosInfPOSIXTime, closed: TrueData | FalseData)-
Lower bound for the execution of this transaction
Expand source code
@dataclass(unsafe_hash=True) class LowerBoundPOSIXTime(PlutusData): """ Lower bound for the execution of this transaction """ CONSTR_ID = 0 limit: ExtendedPOSIXTime closed: BoolDataAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var closed : TrueData | FalseData-
The type of the None singleton.
var limit : NegInfPOSIXTime | FinitePOSIXTime | PosInfPOSIXTime-
The type of the None singleton.
class Minting (policy_id: bytes)-
Script purpose indicating that the given policy id is being minted or burned
Expand source code
@dataclass(unsafe_hash=True) class Minting(PlutusData): """ Script purpose indicating that the given policy id is being minted or burned """ CONSTR_ID = 0 policy_id: PolicyIdAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var policy_id : bytes-
The type of the None singleton.
class NegInfPOSIXTime-
Negative infinite POSIX time, used to indicate that there is no lower bound for the execution of this transaction
Expand source code
@dataclass(unsafe_hash=True) class NegInfPOSIXTime(PlutusData): """ Negative infinite POSIX time, used to indicate that there is no lower bound for the execution of this transaction """ CONSTR_ID = 0Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class NoGovernanceActionId-
Indicates that there is no governance action id associated with this output
Expand source code
@dataclass(unsafe_hash=True) class NoGovernanceActionId(PlutusData): """ Indicates that there is no governance action id associated with this output """ CONSTR_ID = 1Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class NoOutputDatum-
Indicates that there is no datum associated with an output
Expand source code
@dataclass(unsafe_hash=True) class NoOutputDatum(PlutusData): """ Indicates that there is no datum associated with an output """ CONSTR_ID = 0Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class NoScriptHash-
Indicates that there is no script associated with an output
Expand source code
@dataclass(unsafe_hash=True) class NoScriptHash(PlutusData): """ Indicates that there is no script associated with an output """ CONSTR_ID = 1Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class NoStakingCredential-
Indicates that this address has no staking credentials. Its funds can not be delegated.
Expand source code
@dataclass(unsafe_hash=True) class NoStakingCredential(PlutusData): """ Indicates that this address has no staking credentials. Its funds can not be delegated. """ CONSTR_ID = 1Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class NoValue-
An empty value (None case of Optional / Maybe)
Expand source code
@dataclass(unsafe_hash=True) class NoValue(PlutusData): """ An empty value (None case of Optional / Maybe) """ CONSTR_ID = 1Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class POSIXTimeRange (lower_bound: LowerBoundPOSIXTime, upper_bound: UpperBoundPOSIXTime)-
Time range in which this transaction can be executed Note: The transaction can be submitted at any point of time in the range. Deriving the actual submission time can be tricky. Best practices use only the upper or lower bound, depending on the use case. For example, if you accrue interest over time, use only the upper bound as the submission time, which is guaranteed to be after the actual submission time, but can be set tightly by the user to match the actual submission time.
Expand source code
@dataclass(unsafe_hash=True) class POSIXTimeRange(PlutusData): """ Time range in which this transaction can be executed Note: The transaction can be submitted at any point of time in the range. Deriving the actual submission time can be tricky. Best practices use only the upper or lower bound, depending on the use case. For example, if you accrue interest over time, use only the upper bound as the submission time, which is guaranteed to be after the actual submission time, but can be set tightly by the user to match the actual submission time. """ CONSTR_ID = 0 lower_bound: LowerBoundPOSIXTime upper_bound: UpperBoundPOSIXTimeAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var lower_bound : LowerBoundPOSIXTime-
The type of the None singleton.
var upper_bound : UpperBoundPOSIXTime-
The type of the None singleton.
class PosInfPOSIXTime-
Infinite POSIX time, used to indicate that there is no upper bound for the execution of this transaction
Expand source code
@dataclass(unsafe_hash=True) class PosInfPOSIXTime(PlutusData): """ Infinite POSIX time, used to indicate that there is no upper bound for the execution of this transaction """ CONSTR_ID = 2Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class ProposalProcedure (deposit: int, reward_account: PubKeyCredential | ScriptCredential, governance_action: GAParameterChange | GAHardForkInitiation | GATreasuryWithdrawals | GANoConfidence | GAUpdateCommittee | GANewConstitution | GAInfo, anchor: Anchor)-
Represents a proposal procedure in governance.
Expand source code
@dataclass(unsafe_hash=True) class ProposalProcedure(PlutusData): """ Represents a proposal procedure in governance. """ CONSTR_ID = 0 deposit: Lovelace reward_account: Credential governance_action: GovernanceAction anchor: AnchorAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var anchor : Anchor-
The type of the None singleton.
var deposit : int-
The type of the None singleton.
var governance_action : GAParameterChange | GAHardForkInitiation | GATreasuryWithdrawals | GANoConfidence | GAUpdateCommittee | GANewConstitution | GAInfo-
The type of the None singleton.
var reward_account : PubKeyCredential | ScriptCredential-
The type of the None singleton.
class Proposing (proposal_index: int, proposal_procedure: ProposalProcedure)-
Used to propose a governance action. A 0-based index of the given
ProposalProcedureinproposal_procedures.Expand source code
@dataclass(unsafe_hash=True) class Proposing(PlutusData): """ Used to propose a governance action. A 0-based index of the given `ProposalProcedure` in `proposal_procedures`. """ CONSTR_ID = 5 proposal_index: int proposal_procedure: ProposalProcedureAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var proposal_index : int-
The type of the None singleton.
var proposal_procedure : ProposalProcedure-
The type of the None singleton.
class ProtocolVersion (major: int, minor: int)-
ProtocolVersion(major: int, minor: int)
Expand source code
@dataclass(unsafe_hash=True) class ProtocolVersion(PlutusData): CONSTR_ID = 0 major: int minor: intAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var major : int-
The type of the None singleton.
var minor : int-
The type of the None singleton.
class PubKeyCredential (credential_hash: bytes)-
Part of an address that is authenticated by a public key hash
Example value: PubKeyCredential(bytes.fromhex("c06ddaad12fc4ded18e56feac72957c1aa75fce6096b40e63ec88274"))
Expand source code
@dataclass(unsafe_hash=True) class PubKeyCredential(PlutusData): """ Part of an address that is authenticated by a public key hash Example value: PubKeyCredential(bytes.fromhex("c06ddaad12fc4ded18e56feac72957c1aa75fce6096b40e63ec88274")) """ CONSTR_ID = 0 credential_hash: PubKeyHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var credential_hash : bytes-
The type of the None singleton.
class Publishing (certificate_index: int, certificate: DCertDelegRegKey | DCertDelegDeRegKey | DCertDelegDelegate | DCertPoolRegister | DCertPoolRetire | DCertGenesis | DCertMir)-
Needed when delegating to a pool using stake credentials defined as a custom script. This purpose is also triggered when de-registering such stake credentials.
The index is a 0-based index of the given
Certificateincertificates.Expand source code
@dataclass(unsafe_hash=True) class Publishing(PlutusData): """ Needed when delegating to a pool using stake credentials defined as a custom script. This purpose is also triggered when de-registering such stake credentials. The index is a 0-based index of the given `Certificate` in `certificates`. """ CONSTR_ID = 3 certificate_index: int certificate: CertificateAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var certificate : DCertDelegRegKey | DCertDelegDeRegKey | DCertDelegDelegate | DCertPoolRegister | DCertPoolRetire | DCertGenesis | DCertMir-
The type of the None singleton.
var certificate_index : int-
The type of the None singleton.
class ScriptContext (transaction: TxInfo, redeemer: pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData, purpose: Minting | Spending | Withdrawing | Publishing | Voting | Proposing)-
Auxiliary information about the transaction and reason for invocation of the called script.
Expand source code
@dataclass(unsafe_hash=True) class ScriptContext(PlutusData): """ Auxiliary information about the transaction and reason for invocation of the called script. """ CONSTR_ID = 0 transaction: TxInfo redeemer: Redeemer purpose: ScriptPurposeAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var purpose : Minting | Spending | Withdrawing | Publishing | Voting | Proposing-
The type of the None singleton.
var redeemer : pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData-
The type of the None singleton.
var transaction : TxInfo-
The type of the None singleton.
class ScriptCredential (credential_hash: bytes)-
Part of an address that is authenticated by a smart cotnract
Example value: ScriptCredential(bytes.fromhex("c06ddaad12fc4ded18e56feac72957c1aa75fce6096b40e63ec88274"))
Expand source code
@dataclass(unsafe_hash=True) class ScriptCredential(PlutusData): """ Part of an address that is authenticated by a smart cotnract Example value: ScriptCredential(bytes.fromhex("c06ddaad12fc4ded18e56feac72957c1aa75fce6096b40e63ec88274")) """ CONSTR_ID = 1 credential_hash: ValidatorHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var credential_hash : bytes-
The type of the None singleton.
class SomeDatumHash (datum_hash: bytes)-
Indicates that there is a datum associated with this output, which has the given hash.
Expand source code
@dataclass(unsafe_hash=True) class SomeDatumHash(PlutusData): """ Indicates that there is a datum associated with this output, which has the given hash. """ CONSTR_ID = 1 datum_hash: DatumHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var datum_hash : bytes-
The type of the None singleton.
class SomeGovernanceActionId (governance_action_id: GovernanceActionId)-
Indicates that there is an governance action id associated with this output, given in the first field
Expand source code
@dataclass(unsafe_hash=True) class SomeGovernanceActionId(PlutusData): """ Indicates that there is an governance action id associated with this output, given in the first field """ CONSTR_ID = 0 governance_action_id: GovernanceActionIdAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var governance_action_id : GovernanceActionId-
The type of the None singleton.
class SomeOutputDatum (datum: pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData)-
Indicates that there is an datum associated with an output, which is inlined and equal to the attached datum
Expand source code
@dataclass(unsafe_hash=True) class SomeOutputDatum(PlutusData): """ Indicates that there is an datum associated with an output, which is inlined and equal to the attached datum """ CONSTR_ID = 2 datum: DatumAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var datum : pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData-
The type of the None singleton.
class SomeOutputDatumHash (datum_hash: bytes)-
Indicates that there is an datum associated with an output, which has the attached hash
Expand source code
@dataclass(unsafe_hash=True) class SomeOutputDatumHash(PlutusData): """ Indicates that there is an datum associated with an output, which has the attached hash """ CONSTR_ID = 1 datum_hash: DatumHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var datum_hash : bytes-
The type of the None singleton.
class SomeScriptHash (script_hash: bytes)-
Indicates that there is a script associated with this output, which has the given hash.
Expand source code
@dataclass(unsafe_hash=True) class SomeScriptHash(PlutusData): """ Indicates that there is a script associated with this output, which has the given hash. """ CONSTR_ID = 0 script_hash: ScriptHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var script_hash : bytes-
The type of the None singleton.
class SomeStakingCredential (staking_credential: StakingHash | StakingPtr)-
Indicates that this address has staking credentials. Its funds can be delegated by the credentialed user.
Expand source code
@dataclass(unsafe_hash=True) class SomeStakingCredential(PlutusData): """ Indicates that this address has staking credentials. Its funds can be delegated by the credentialed user. """ CONSTR_ID = 0 staking_credential: StakingCredentialAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var staking_credential : StakingHash | StakingPtr-
The type of the None singleton.
class Spending (tx_out_ref: TxOutRef)-
Script purpose indicating that the given transaction output is being spent, which is owned by the invoked contract
Expand source code
@dataclass(unsafe_hash=True) class Spending(PlutusData): """ Script purpose indicating that the given transaction output is being spent, which is owned by the invoked contract """ CONSTR_ID = 1 tx_out_ref: TxOutRefAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var tx_out_ref : TxOutRef-
The type of the None singleton.
class StakePool (verification_key_hash: bytes)-
StakePool(verification_key_hash: bytes)
Expand source code
@dataclass(unsafe_hash=True) class StakePool(PlutusData): CONSTR_ID = 2 verification_key_hash: PubKeyHashAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var verification_key_hash : bytes-
The type of the None singleton.
class StakingHash (value: PubKeyCredential | ScriptCredential)-
Indicates that the stake of this address is controlled by the associated credential
Expand source code
@dataclass(unsafe_hash=True) class StakingHash(PlutusData): """ Indicates that the stake of this address is controlled by the associated credential """ CONSTR_ID = 0 value: CredentialAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var value : PubKeyCredential | ScriptCredential-
The type of the None singleton.
class StakingPtr (slot_no: int, tx_index: int, cert_index: int)-
Indicates that the stake of this address is controlled by the associated pointer.
In an address, a chain pointer refers to a point of the chain containing a stake key registration certificate. A point is identified by the 3 coordinates in this object.
Expand source code
@dataclass(unsafe_hash=True) class StakingPtr(PlutusData): """ Indicates that the stake of this address is controlled by the associated pointer. In an address, a chain pointer refers to a point of the chain containing a stake key registration certificate. A point is identified by the 3 coordinates in this object. """ CONSTR_ID = 1 # an absolute slot number slot_no: int # a transaction index (within that slot) tx_index: int # a (delegation) certificate index (within that transaction) cert_index: intAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var cert_index : int-
The type of the None singleton.
var slot_no : int-
The type of the None singleton.
var tx_index : int-
The type of the None singleton.
class TrueData-
A Datum that represents True in Haskell implementations. It is thus used as an encoding for True in the ScriptContext.
Example value: TrueData()
Expand source code
@dataclass(unsafe_hash=True) class TrueData(PlutusData): """ A Datum that represents True in Haskell implementations. It is thus used as an encoding for True in the ScriptContext. Example value: TrueData() """ CONSTR_ID = 1Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class TxInInfo (out_ref: TxOutRef, resolved: TxOut)-
The plutus representation of an transaction output, that is consumed by the transaction.
Expand source code
@dataclass(unsafe_hash=True) class TxInInfo(PlutusData): """ The plutus representation of an transaction output, that is consumed by the transaction. """ CONSTR_ID = 0 out_ref: TxOutRef resolved: TxOutAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var out_ref : TxOutRef-
The type of the None singleton.
var resolved : TxOut-
The type of the None singleton.
class TxInfo (inputs: List[TxInInfo], reference_inputs: List[TxInInfo], outputs: List[TxOut], fee: int, mint: Dict[bytes, Dict[bytes, int]], certificates: List[DCertDelegRegKey | DCertDelegDeRegKey | DCertDelegDelegate | DCertPoolRegister | DCertPoolRetire | DCertGenesis | DCertMir], withdrawals: Dict[StakingHash | StakingPtr, int], validity_range: POSIXTimeRange, signatories: List[bytes], redeemers: Dict[Minting | Spending | Withdrawing | Publishing | Voting | Proposing, pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData], datums: Dict[bytes, pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData], id: bytes, votes: Dict[ConstitutionalCommitteeMember | DelegateRepresentative | StakePool, Dict[GovernanceActionId, VoteNo | VoteYes | VoteAbstain]], proposal_procedures: List[ProposalProcedure], current_treasury_amount: BoxedInt | NoValue, treasury_donation: BoxedInt | NoValue)-
A complex agglomeration of everything that could be of interest to the executed script, regarding the transaction that invoked the script
Expand source code
@dataclass() class TxInfo(PlutusData): """ A complex agglomeration of everything that could be of interest to the executed script, regarding the transaction that invoked the script """ CONSTR_ID = 0 # The input UTXOs of the transaction. inputs: List[TxInInfo] # The reference UTXOs of the transaction. reference_inputs: List[TxInInfo] # The output UTXOs created by the transaction. outputs: List[TxOut] # Transaction fee to be payed for the transaction. fee: Lovelace # The value minted in the transaction. mint: Value certificates: List[Certificate] # Withdrawals from specific stake keys # NOTE: Withdrawals are ordered by ascending Credential. Yet, note that `Script` credentials are treated as **lower values** than `VerificationKey` credentials. withdrawals: Dict[StakingCredential, int] # The range of time in which this transaction is valid validity_range: POSIXTimeRange # The signatures for the transaction. signatories: List[PubKeyHash] # All redeemers passed to all script invocations # NOTE: Redeemers are ordered by ascending ScriptPurpose. redeemers: Dict[ScriptPurpose, Redeemer] # All datums present in any inputs datums: Dict[DatumHash, Datum] # The ID of the transaction. id: TxId # metadata for governance actions # NOTE: Votes are ordered by ascending Voter and GovernanceActionId. First constructor variants in a type are treated as lower indices; except for Credential where `Script` credentials are treated as **lower values** than `VerificationKey` credentials. votes: Dict[Voter, Dict[GovernanceActionId, Vote]] proposal_procedures: List[ProposalProcedure] current_treasury_amount: OptionalLovelace treasury_donation: OptionalLovelaceAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var certificates : List[DCertDelegRegKey | DCertDelegDeRegKey | DCertDelegDelegate | DCertPoolRegister | DCertPoolRetire | DCertGenesis | DCertMir]-
The type of the None singleton.
var current_treasury_amount : BoxedInt | NoValue-
The type of the None singleton.
var datums : Dict[bytes, pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData]-
The type of the None singleton.
var fee : int-
The type of the None singleton.
var id : bytes-
The type of the None singleton.
var inputs : List[TxInInfo]-
The type of the None singleton.
var mint : Dict[bytes, Dict[bytes, int]]-
The type of the None singleton.
var outputs : List[TxOut]-
The type of the None singleton.
var proposal_procedures : List[ProposalProcedure]-
The type of the None singleton.
var redeemers : Dict[Minting | Spending | Withdrawing | Publishing | Voting | Proposing, pycardano.plutus.PlutusData | dict | int | bytes | pycardano.serialization.IndefiniteList | pycardano.serialization.RawCBOR | pycardano.plutus.RawPlutusData]-
The type of the None singleton.
var reference_inputs : List[TxInInfo]-
The type of the None singleton.
var signatories : List[bytes]-
The type of the None singleton.
var treasury_donation : BoxedInt | NoValue-
The type of the None singleton.
var validity_range : POSIXTimeRange-
The type of the None singleton.
var votes : Dict[ConstitutionalCommitteeMember | DelegateRepresentative | StakePool, Dict[GovernanceActionId, VoteNo | VoteYes | VoteAbstain]]-
The type of the None singleton.
var withdrawals : Dict[StakingHash | StakingPtr, int]-
The type of the None singleton.
class TxOut (address: Address, value: Dict[bytes, Dict[bytes, int]], datum: NoOutputDatum | SomeOutputDatumHash | SomeOutputDatum, reference_script: SomeScriptHash | NoScriptHash)-
The plutus representation of an transaction output, consisting of - address: address owning this output - value: tokens associated with this output - datum: datum associated with this output - reference_script: reference script associated with this output
Expand source code
@dataclass(unsafe_hash=True) class TxOut(PlutusData): """ The plutus representation of an transaction output, consisting of - address: address owning this output - value: tokens associated with this output - datum: datum associated with this output - reference_script: reference script associated with this output """ CONSTR_ID = 0 address: Address value: Value datum: OutputDatum reference_script: Union[NoScriptHash, SomeScriptHash]Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var address : Address-
The type of the None singleton.
var datum : NoOutputDatum | SomeOutputDatumHash | SomeOutputDatum-
The type of the None singleton.
var reference_script : SomeScriptHash | NoScriptHash-
The type of the None singleton.
var value : Dict[bytes, Dict[bytes, int]]-
The type of the None singleton.
class TxOutRef (id: bytes, idx: int)-
A reference to a transaction output (hash/id + index)
Expand source code
@dataclass(unsafe_hash=True) class TxOutRef(PlutusData): """ A reference to a transaction output (hash/id + index) """ CONSTR_ID = 0 id: TxId idx: intAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var id : bytes-
The type of the None singleton.
var idx : int-
The type of the None singleton.
class UpperBoundPOSIXTime (limit: NegInfPOSIXTime | FinitePOSIXTime | PosInfPOSIXTime, closed: TrueData | FalseData)-
Upper bound for the execution of this transaction
Expand source code
@dataclass(unsafe_hash=True) class UpperBoundPOSIXTime(PlutusData): """ Upper bound for the execution of this transaction """ CONSTR_ID = 0 limit: ExtendedPOSIXTime closed: BoolDataAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var closed : TrueData | FalseData-
The type of the None singleton.
var limit : NegInfPOSIXTime | FinitePOSIXTime | PosInfPOSIXTime-
The type of the None singleton.
class VoteAbstain-
VoteAbstain()
Expand source code
@dataclass(unsafe_hash=True) class VoteAbstain(PlutusData): CONSTR_ID = 2Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class VoteNo-
VoteNo()
Expand source code
@dataclass(unsafe_hash=True) class VoteNo(PlutusData): CONSTR_ID = 0Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class VoteYes-
VoteYes()
Expand source code
@dataclass(unsafe_hash=True) class VoteYes(PlutusData): CONSTR_ID = 1Ancestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
class Voting (voter: ConstitutionalCommitteeMember | DelegateRepresentative | StakePool)-
Voting for a type of voter using a governance action id to vote yes / no / abstain inside a transaction. The voter is who is doing the governance action.
Expand source code
@dataclass(unsafe_hash=True) class Voting(PlutusData): """ Voting for a type of voter using a governance action id to vote yes / no / abstain inside a transaction. The voter is who is doing the governance action. """ CONSTR_ID = 4 voter: VoterAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var voter : ConstitutionalCommitteeMember | DelegateRepresentative | StakePool-
The type of the None singleton.
class Withdrawing (staking_credential: StakingHash | StakingPtr)-
For scripts that validate reward withdrawals from a reward account. The argument identifies the target reward account.
Expand source code
@dataclass(unsafe_hash=True) class Withdrawing(PlutusData): """ For scripts that validate reward withdrawals from a reward account. The argument identifies the target reward account. """ CONSTR_ID = 2 staking_credential: StakingCredentialAncestors
- pycardano.plutus.PlutusData
- pycardano.serialization.ArrayCBORSerializable
- pycardano.serialization.CBORSerializable
Class variables
var CONSTR_ID-
The type of the None singleton.
Instance variables
var staking_credential : StakingHash | StakingPtr-
The type of the None singleton.