apollo

package module
v1.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 41 Imported by: 1

README

apollo logo

Apollo: Pure Golang Cardano Building blocks

Pure Golang Cardano Serialization

The Objective of this library is to give Developers Access to each and every needed resource for cardano development. The final goal is to be able to have this library interact directly with the node without intermediaries.

Little Sample Usage:

package main

import (
    "encoding/hex"
    "fmt"

    "github.com/fxamacker/cbor/v2"
    "github.com/Salvionied/apollo"
    "github.com/Salvionied/apollo/txBuilding/Backend/BlockFrostChainContext"
    "github.com/Salvionied/apollo/constants"
)

func main() {
    bfc, err := BlockFrostChainContext.NewBlockfrostChainContext(constants.BLOCKFROST_BASE_URL_PREVIEW, int(constants.PREVIEW), "blockfrost_api_key")
    if err != nil {
        panic(err)
    }

    cc := apollo.NewEmptyBackend()
    SEED := "your mnemonic here"
    apollob := apollo.New(&cc)
    apollob, err = apollob.SetWalletFromMnemonic(SEED, constants.PREVIEW)
    if err != nil {
        panic(err)
    }
    apollob, err = apollob.SetWalletAsChangeAddress()
    if err != nil {
        panic(err)
    }
    utxos, err := bfc.Utxos(*apollob.GetWallet().GetAddress())
    if err != nil {
        panic(err)
    }
    apollob, err = apollob.AddLoadedUTxOs(utxos...).PayToAddressBech32("your address here", 1_000_000).
        Complete()
    if err != nil {
        panic(err)
    }
    apollob = apollob.Sign()
    tx := apollob.GetTx()
    cborred, err := cbor.Marshal(tx)
    if err != nil {
        panic(err)
    }
    fmt.Println(hex.EncodeToString(cborred))
    tx_id, err := bfc.SubmitTx(*tx)
    if err != nil {
		panic(err)
	}
    fmt.Println(hex.EncodeToString(tx_id.Payload))

}

If you have any questions or requests feel free to drop into this discord and ask :) https://discord.gg/MH4CmJcg49

By: Edoardo Salvioni - Zhaata

Documentation

Index

Constants

View Source
const (
	EX_MEMORY_BUFFER = 0.2
	EX_STEP_BUFFER   = 0.2
	STAKE_DEPOSIT    = 2_000_000
)
View Source
const PlutusV1 = "V1"

Plutus script version identifiers used in the builder.

View Source
const PlutusV2 = "V2"
View Source
const PlutusV3 = "V3"

Variables

This section is empty.

Functions

func CountRequiredAssets added in v1.1.0

func CountRequiredAssets(assets MultiAsset.MultiAsset[int64]) int

func CreatePoolParams added in v1.5.0

func CreatePoolParams(
	operator serialization.PubKeyHash,
	vrfKeyHash []byte,
	pledge int64,
	cost int64,
	margin Certificate.UnitInterval,
	rewardAccount []byte,
	poolOwners []serialization.PubKeyHash,
	relays RelayPkg.Relays,
) *Certificate.PoolParams

*

CreatePoolParams creates a PoolParams structure for pool registration.

Note: PoolMetadata must be set manually after creation if needed, as it uses an anonymous struct type.

Params:

operator (serialization.PubKeyHash): The pool operator's public key hash.
vrfKeyHash ([]byte): The VRF key hash (32 bytes).
pledge (int64): The pool pledge amount in lovelace.
cost (int64): The pool cost in lovelace.

margin (Certificate.UnitInterval): The pool margin (fraction between 0 and 1).

rewardAccount ([]byte): The reward account (29 bytes: 1 byte header + 28 bytes stake credential).

	poolOwners ([]serialization.PubKeyHash): List of pool owner public key hashes.
	relays (RelayPkg.Relays): List of relay entries.

Returns:

*Certificate.PoolParams: A pointer to the created pool parameters with PoolMetadata set to nil.

func GetStakeCredentialFromAddress added in v1.5.0

func GetStakeCredentialFromAddress(
	address Address.Address,
) (*Certificate.Credential, error)

*

GetStakeCredentialFromAddress extracts a stake credential from an address's staking part.

Params:

	address (Address.Address): The address from which to extract the stake credential.

Returns:

*Certificate.Credential: The stake credential, or nil if the address has no staking part.
error: An error if the staking part is invalid.

func NewBlockfrostBackend

func NewBlockfrostBackend(
	projectId string,
	network constants.Network,

) (BlockFrostChainContext.BlockFrostChainContext, error)

*

NewBlockfrostBackend creates a BlockFrostChainContext instance based
on the specified network and project ID.

Params:
	projectId (string): The project ID to authenticate with BlockFrost.
	network (Network): The network to configure the BlockFrost context for.

Returns:

BlockFrostChainContext.BlockFrostChainContext: A BlockFrostChainContext instance configured for the specified network.

func NewEmptyBackend added in v1.0.3

func NewEmptyBackend() FixedChainContext.FixedChainContext

* NewEmptyBackend creates and returns an empty FixedChainContext instance, which is iused for cases where no specific backend context is required.

Returns:

FixedChainContext.FixedChainContext: An empty FixedChainContext instance.

func NewMaestroBackend added in v1.0.12

func NewMaestroBackend(
	projectId string,
	network constants.Network,
) (MaestroChainContext.MaestroChainContext, error)

NewMaestroBackend NewMaestroBackend creates a MaestroChainContext instance based on the specified network and project ID. Params: projectId (string): The project ID to authenticate with Maestro. network (Network): The network to configure the Maestro context for. Returns: MaestroChainContext.MaestroChainContext: A MaestroChainContext instance configured for the specified network.

func PlutusV1CostModelKey added in v1.7.0

func PlutusV1CostModelKey() serialization.CustomBytes

PlutusV1CostModelKey returns the CBOR map key for the Plutus V1 cost model in the script data hash.

func PlutusV2CostModelKey added in v1.7.0

func PlutusV2CostModelKey() serialization.CustomBytes

PlutusV2CostModelKey returns the CBOR map key for the Plutus V2 cost model in the script data hash.

func PlutusV3CostModelKey added in v1.7.0

func PlutusV3CostModelKey() serialization.CustomBytes

PlutusV3CostModelKey returns the CBOR map key for the Plutus V3 cost model in the script data hash.

func SortInputs added in v1.0.3

func SortInputs(inputs []UTxO.UTxO) []UTxO.UTxO

*

SortInputs sorts a slice of UTxO objects based on their strings.

Params:
	inputs ([]UTxO.UTxO): A slice of UTxO objects to be sorted.

Returns:
	[]UTxO.UTxO: A new slice of UTxO objects sorted based on input strings.

func SortUtxos added in v1.0.3

func SortUtxos(utxos []UTxO.UTxO) []UTxO.UTxO

* SortUtxos sorts a slice of UTxO objects in descending order based on their amounts.

Params:

utxos ([]UTxO.UTxO): A slice of UTxO objects to be sorted.

Returns:

[]UTxO.UTxO: A new slice of UTxO objects sorted by descending amounts.

Types

type Apollo

type Apollo struct {
	Context Base.ChainContext

	Fee           int64
	FeePadding    int64
	Ttl           int64
	ValidityStart int64
	// contains filtered or unexported fields
}

func New

func New(cc Base.ChainContext) *Apollo

*

New creates and initializes a new Apollo instance with the specified chain context,

in which sets up various internal data structures for building and handling transactions.

Params:

	cc (Base.ChainContext): The chain context to use for transaction building.

Returns:
	*Apollo: A pointer to the initialized Apollo instance.

func (*Apollo) AddCollateral added in v1.0.5

func (b *Apollo) AddCollateral(utxo UTxO.UTxO) *Apollo

func (*Apollo) AddDatum added in v1.0.3

func (b *Apollo) AddDatum(pd *PlutusData.PlutusData) *Apollo

*

	AddDatum appends a Plutus datum to the list of data associated with the Apollo instance.

	Params:
   		pd (*PlutusData.PlutusData): The Plutus datum to be added.

	Returns:

*Apollo: A pointer to the modified Apollo instance with the datum added.

func (*Apollo) AddInput added in v1.0.3

func (b *Apollo) AddInput(utxos ...UTxO.UTxO) *Apollo

*

AddInput appends one or more UTxOs to the list of preselected
UTxOs for transaction inputs.

Params:
	utxos (...UTxO.UTxO): A set of UTxOs to be added as inputs.

Returns:
	*Apollo: A pointer to the modified Apollo instance.

func (*Apollo) AddInputAddress added in v1.0.3

func (b *Apollo) AddInputAddress(address Address.Address) *Apollo

*

AddInputAddress appends an input address to the list of input addresses for the transaction.

Params:
	address (Address.Address): The input address to be added.

Returns:
	*Apollo: A pointer to the modified Apollo instance.

func (*Apollo) AddInputAddressFromBech32 added in v1.0.3

func (b *Apollo) AddInputAddressFromBech32(address string) *Apollo

*

AddInputAddressFromBech32 decodes a Bech32 address and
appends it to the list of input addresses for the transaction.

Params:
	address (string): The Bech32 address to be decoded and added

Returns:
	*Apollo: A pointer to the modified Apollo instance.

func (*Apollo) AddLoadedUTxOs added in v1.0.3

func (b *Apollo) AddLoadedUTxOs(utxos ...UTxO.UTxO) *Apollo

*

AddLoadedUTxOs appends one or more UTxOs to the list of loaded UTxOs.

Params:
	utxos (...UTxO.UTxO): A set of UTxOs to be added to the loaded UTxOs.

Returns:
	*Apollo: A pointer to the modified Apollo instance.

func (*Apollo) AddNativeScript added in v1.7.2

func (b *Apollo) AddNativeScript(script NativeScript.NativeScript) *Apollo

AddNativeScript attaches a native script witness to the transaction. Scripts are deduplicated by their ledger script hash.

func (*Apollo) AddNativeScripts added in v1.7.2

func (b *Apollo) AddNativeScripts(
	scripts ...NativeScript.NativeScript,
) *Apollo

AddNativeScripts attaches one or more native script witnesses.

func (*Apollo) AddPayment added in v1.0.3

func (b *Apollo) AddPayment(payment PaymentI) *Apollo

*

AddPayment appends a payment to the list of payments for the transaction.

Params:
	payment (PaymentI): The payment to be added.

Returns:

*Apollo: A pointer to the modified Apollo instance with the payment added.

func (*Apollo) AddProposal added in v1.7.2

func (b *Apollo) AddProposal(
	proposal Governance.ProposalProcedure,
) *Apollo

AddProposal adds a governance proposal (Conway era field 20).

func (*Apollo) AddReferenceInput added in v1.0.3

func (b *Apollo) AddReferenceInput(txHash string, index int) *Apollo

*

AddReferenceInput adds a reference input to the transaction.

Params:

	txHash (string): The hexadecimal representation of the reference transaction hash.
	index (int): The index of the reference input within its transaction.

Returns:

*Apollo: A pointer to the modified Apollo instance with the added reference input.

func (*Apollo) AddReferenceInputV3 added in v1.3.0

func (b *Apollo) AddReferenceInputV3(txHash string, index int) *Apollo

func (*Apollo) AddReferenceScriptV1 added in v1.7.0

func (b *Apollo) AddReferenceScriptV1() *Apollo

AddReferenceScriptV1 marks that the transaction references a Plutus V1 script, ensuring the V1 cost model is included in the script data hash.

func (*Apollo) AddReferenceScriptV2 added in v1.7.0

func (b *Apollo) AddReferenceScriptV2() *Apollo

AddReferenceScriptV2 marks that the transaction references a Plutus V2 script, ensuring the V2 cost model is included in the script data hash.

func (*Apollo) AddReferenceScriptV3 added in v1.7.0

func (b *Apollo) AddReferenceScriptV3() *Apollo

AddReferenceScriptV3 marks that the transaction references a Plutus V3 script, ensuring the V3 cost model is included in the script data hash.

func (*Apollo) AddRequiredSigner added in v1.0.3

func (b *Apollo) AddRequiredSigner(pkh serialization.PubKeyHash) *Apollo

*

	AddRequiredSigner appends a public key hash to the list of required signers.

 	Params:

  		pkh (serialization.PubKeyHash): The public key hash to add as a required signer.

	Returns:

*Apollo: A pointer to the modified Apollo instance with the required signer added.

func (*Apollo) AddRequiredSignerFromAddress added in v1.0.3

func (b *Apollo) AddRequiredSignerFromAddress(
	address Address.Address,
	addPaymentPart, addStakingPart bool,
) *Apollo

*

	AddRequiredSignerFromAddress extracts the payment and staking parts from an address and adds them as required signers.

 	Params:

address (Address.Address): The address from which to extract the parts and add them as required signers.

addPaymentPart (bool): Indicates whether to add the payment part as a required signer.

  		addStakingPart (bool): Indicates whether to add the staking part as a required signer.

	Returns:

*Apollo: A pointer to the modified Apollo instance with the required signers added.

func (*Apollo) AddRequiredSignerFromBech32 added in v1.0.3

func (b *Apollo) AddRequiredSignerFromBech32(
	address string,
	addPaymentPart, addStakingPart bool,
) *Apollo

*

AddRequiredSignerFromBech32 decodes an address in Bech32 format and adds
its payment and staking parts as required signers.

Params:

address (string): The Bech32-encoded address to decode and add its parts as required signers.

addPaymentPart (bool): Indicates whether to add the payment part as a required signer.

   		addStakingPart (bool): Indicates whether to add the staking part as a required signer.

	Returns:

*Apollo: A pointer to the modified Apollo instance with the required signers added.

func (*Apollo) AddTreasuryDonation added in v1.7.2

func (b *Apollo) AddTreasuryDonation(
	amount int64,
) *Apollo

*

AddTreasuryDonation adds to the treasury donation amount
(Conway era field 22) on the transaction body.

Params:
	amount (int64): The donation amount in lovelace.

Returns:
	*Apollo: The modified Apollo instance.

func (*Apollo) AddVerificationKeyWitness added in v1.0.3

func (b *Apollo) AddVerificationKeyWitness(
	vkw VerificationKeyWitness.VerificationKeyWitness,
) *Apollo

*

AddVerificationKeyWitness adds a verification key witness to the transaction.

Params:

	vkw (VerificationKeyWitness.VerificationKeyWitness): The verification key witness to add.

Returns:

*Apollo: A pointer to the modified Apollo instance with the added verification key witness.

func (*Apollo) AddVote added in v1.7.2

func (b *Apollo) AddVote(
	voter Governance.Voter,
	actionId Governance.GovActionId,
	procedure Governance.VotingProcedure,
) *Apollo

AddVote adds a governance vote (Conway era field 19).

func (*Apollo) AddWithdrawal added in v1.0.5

func (b *Apollo) AddWithdrawal(
	address Address.Address,
	amount int,
	redeemerData PlutusData.PlutusData,
) *Apollo

func (*Apollo) AttachDatum added in v1.0.3

func (b *Apollo) AttachDatum(datum *PlutusData.PlutusData) *Apollo

*

AttachDatum attaches a datum to the transaction.

Params:
	datum *PlutusData.PlutusData: The datum to attach.

Returns:
	*Apollo: A pointer to the Apollo object with the datum added.

func (*Apollo) AttachNativeScript added in v1.7.2

func (b *Apollo) AttachNativeScript(script NativeScript.NativeScript) *Apollo

AttachNativeScript is an alias for AddNativeScript.

func (*Apollo) AttachV1Script added in v1.0.3

func (b *Apollo) AttachV1Script(script PlutusData.PlutusV1Script) *Apollo

*

Attach a Plutus V1 script to the Apollo transaction.

Params:
	script: The Plutus V1 script to attach.

Returns:
	*Apollo: A pointer to the Apollo objecy with the attached script.

func (*Apollo) AttachV2Script added in v1.0.3

func (b *Apollo) AttachV2Script(script PlutusData.PlutusV2Script) *Apollo

*

Attach a Plutus V2 script to the Apollo transaction.

Params:
	script: The Plutus V2 script to attach.

Returns:
	*Apollo: A pointer to the Apollo objecy with the attached script.

func (*Apollo) AttachV3Script added in v1.3.0

func (b *Apollo) AttachV3Script(script PlutusData.PlutusV3Script) *Apollo

func (*Apollo) AuthorizeCommitteeHotKey added in v1.7.2

func (b *Apollo) AuthorizeCommitteeHotKey(
	cold Certificate.Credential,
	hot Certificate.Credential,
) *Apollo

AuthorizeCommitteeHotKey adds a committee hot key authorization certificate (kind 14).

func (*Apollo) Clone added in v1.0.3

func (b *Apollo) Clone() *Apollo

*

Clone creates a deep copy of the Apollo object.

Returns:
	*Apollo: A pointer to the cloned Apollo object.

func (*Apollo) CollectFrom added in v1.0.3

func (b *Apollo) CollectFrom(
	inputUtxo UTxO.UTxO,
	redeemer Redeemer.Redeemer,
) *Apollo

*

Collect a UTXO and its associated redeemer for inclusion in the transaction.

Params:
	inputUtxo: The UTXO to collect.
	redeemer: The redeemer associated with the UTXO.

Returns:

*Apollo: A pointer to the Apollo object with the collected UTXO and redeemer.

func (*Apollo) Complete added in v1.0.3

func (b *Apollo) Complete() (
	*Apollo, []byte, error,
)

*

Complete assembles and finalizes the Apollo
transaction, handling inputs, change, fees,
collateral and witness data.

If this fails due to a script failure, it
returns the failed tx cbor as bytes for
diagnostic purposes.

Returns:

*Apollo: A pointer to the Apollo object
representing the completed transaction.
[]byte: The failed transaction bytes for
diagnostics, or nil on success.
error: An error if any issues are encountered
during the process.

func (*Apollo) CompleteExact added in v1.0.10

func (b *Apollo) CompleteExact(
	fee int,
) (*Apollo, []byte, error)

func (*Apollo) ConsumeAssetsFromUtxo added in v1.0.3

func (b *Apollo) ConsumeAssetsFromUtxo(
	utxo UTxO.UTxO,
	payments ...PaymentI,
) (*Apollo, error)

*

	ConsumeAssetsFromUtxo adds a UTxO as an input to the transaction and deducts the specified asset payments from it.

 	Params:
   		utxo (UTxO.UTxO): The UTxO to be consumed as an input.

   		payments (...PaymentI): Asset payments to be deducted from the UTxO.

 	Returns:
	   	*Apollo: A pointer to the modified Apollo instance.
	   	error: An error if the payments exceed the UTxO value.

func (*Apollo) ConsumeUTxO added in v1.0.3

func (b *Apollo) ConsumeUTxO(
	utxo UTxO.UTxO,
	payments ...PaymentI,
) (*Apollo, error)

*

ConsumeUTxO adds a UTxO as an input to the transaction and deducts the specified payments from it.

Params:
	utxo (UTxO.UTxO): The UTxO to be consumed as an input.
	payments (...PaymentI): A set of payments to be deducted from the UTxO.

Returns:
	*Apollo: A pointer to the modified Apollo instance.
	error: An error if the payments exceed the UTxO value.

func (*Apollo) DelegateStake added in v1.5.0

func (b *Apollo) DelegateStake(
	stakeCredential *Certificate.Credential,
	poolKeyHash serialization.PubKeyHash,
) (*Apollo, error)

*

DelegateStake delegates a stake key to a stake pool.

Params:

stakeCredential (*Certificate.Credential): The stake credential to delegate.
If nil, it will attempt to extract from the wallet.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake delegation certificate added.
error: An error if the stake credential cannot be determined.

func (*Apollo) DelegateStakeAndVote added in v1.5.0

func (b *Apollo) DelegateStakeAndVote(
	stakeCredential *Certificate.Credential,
	poolKeyHash serialization.PubKeyHash,
	drep *Certificate.Drep,
) (*Apollo, error)

*

DelegateStakeAndVote delegates a stake key to both a stake pool and a DRep (stake-and-vote-delegation-certificate).

Params:

stakeCredential (*Certificate.Credential): The stake credential to delegate.
If nil, it will attempt to extract from the wallet.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	drep (*Certificate.Drep): The DRep to delegate votes to.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake and vote delegation certificate added.
error: An error if the stake credential cannot be determined.

func (*Apollo) DelegateStakeAndVoteFromAddress added in v1.5.0

func (b *Apollo) DelegateStakeAndVoteFromAddress(
	address Address.Address,
	poolKeyHash serialization.PubKeyHash,
	drep *Certificate.Drep,
) (*Apollo, error)

*

DelegateStakeAndVoteFromAddress delegates a stake key from an address to both a stake pool and a DRep.

Params:

address (Address.Address): The address containing the stake key to delegate.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	drep (*Certificate.Drep): The DRep to delegate votes to.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake and vote delegation certificate added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) DelegateStakeAndVoteFromBech32 added in v1.5.0

func (b *Apollo) DelegateStakeAndVoteFromBech32(
	address string,
	poolKeyHash serialization.PubKeyHash,
	drep *Certificate.Drep,
) (*Apollo, error)

*

DelegateStakeAndVoteFromBech32 delegates a stake key from a Bech32 address to both a stake pool and a DRep.

Params:

address (string): The Bech32 address containing the stake key to delegate.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	drep (*Certificate.Drep): The DRep to delegate votes to.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake and vote delegation certificate added.
error: An error if the address cannot be decoded.

func (*Apollo) DelegateStakeFromAddress added in v1.5.0

func (b *Apollo) DelegateStakeFromAddress(
	address Address.Address,
	poolKeyHash serialization.PubKeyHash,
) (*Apollo, error)

*

DelegateStakeFromAddress delegates a stake key from an address to a stake pool.

Params:

address (Address.Address): The address containing the stake key to delegate.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake delegation certificate added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) DelegateStakeFromBech32 added in v1.5.0

func (b *Apollo) DelegateStakeFromBech32(
	address string,
	poolKeyHash serialization.PubKeyHash,
) (*Apollo, error)

*

DelegateStakeFromBech32 delegates a stake key from a Bech32 address to a stake pool.

Params:

address (string): The Bech32 address containing the stake key to delegate.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake delegation certificate added.
error: An error if the address cannot be decoded.

func (*Apollo) DelegateVote added in v1.5.0

func (b *Apollo) DelegateVote(
	stakeCredential *Certificate.Credential,
	drep *Certificate.Drep,
) (*Apollo, error)

*

DelegateVote delegates a stake key to vote for a DRep (vote-delegation-certificate).

Params:

	stakeCredential (*Certificate.Credential): The stake credential to delegate.
	If nil, it will attempt to extract from the wallet.
	drep (*Certificate.Drep): The DRep to delegate votes to.

Returns:

*Apollo: A pointer to the modified Apollo instance with vote delegation certificate added.
error: An error if the stake credential cannot be determined.

func (*Apollo) DelegateVoteFromAddress added in v1.5.0

func (b *Apollo) DelegateVoteFromAddress(
	address Address.Address,
	drep *Certificate.Drep,
) (*Apollo, error)

*

DelegateVoteFromAddress delegates a stake key from an address to vote for a DRep.

Params:

	address (Address.Address): The address containing the stake key to delegate.
	drep (*Certificate.Drep): The DRep to delegate votes to.

Returns:

*Apollo: A pointer to the modified Apollo instance with vote delegation certificate added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) DelegateVoteFromBech32 added in v1.5.0

func (b *Apollo) DelegateVoteFromBech32(
	address string,
	drep *Certificate.Drep,
) (*Apollo, error)

*

DelegateVoteFromBech32 delegates a stake key from a Bech32 address to vote for a DRep.

Params:

	address (string): The Bech32 address containing the stake key to delegate.
	drep (*Certificate.Drep): The DRep to delegate votes to.

Returns:

*Apollo: A pointer to the modified Apollo instance with vote delegation certificate added.
error: An error if the address cannot be decoded.

func (*Apollo) DeregisterPool added in v1.5.0

func (b *Apollo) DeregisterPool(
	poolKeyHash serialization.PubKeyHash,
	epochNo uint64,
) *Apollo

*

DeregisterPool deregisters a stake pool (pool-retirement-certificate).

Params:

	poolKeyHash (serialization.PubKeyHash): The pool key hash of the pool to retire.
	epochNo (uint64): The epoch number when the pool should be retired.

Returns:

*Apollo: A pointer to the modified Apollo instance with pool retirement certificate added.

func (*Apollo) DeregisterStake added in v1.5.0

func (b *Apollo) DeregisterStake(
	stakeCredential *Certificate.Credential,
) (*Apollo, error)

*

DeregisterStake deregisters a stake key, allowing the stake deposit to be returned.

Params:

	stakeCredential (*Certificate.Credential): The stake credential to deregister.
	If nil, it will attempt to extract from the wallet.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake deregistration certificate added.
error: An error if the stake credential cannot be determined.

func (*Apollo) DeregisterStakeFromAddress added in v1.5.0

func (b *Apollo) DeregisterStakeFromAddress(
	address Address.Address,
) (*Apollo, error)

*

DeregisterStakeFromAddress deregisters a stake key from an address.

Params:

	address (Address.Address): The address containing the stake key to deregister.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake deregistration certificate added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) DeregisterStakeFromBech32 added in v1.5.0

func (b *Apollo) DeregisterStakeFromBech32(address string) (*Apollo, error)

*

DeregisterStakeFromBech32 deregisters a stake key from a Bech32 address.

Params:

	address (string): The Bech32 address containing the stake key to deregister.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake deregistration certificate added.
error: An error if the address cannot be decoded.

func (*Apollo) DisableExecutionUnitsEstimation added in v1.0.3

func (b *Apollo) DisableExecutionUnitsEstimation() *Apollo

*

	DisableExecutionUnitsEstimation disables the estimation of execution units for the transaction.

 	Returns:

*Apollo: A pointer to the modified Apollo instance with execution units estimation disabled.

func (*Apollo) ForceFee added in v1.7.0

func (b *Apollo) ForceFee(fee int64) *Apollo

*

ForceFee sets a fixed fee for the transaction,
bypassing automatic fee estimation. When set,
the estimateFee method will return this fee
instead of computing one.

Params:

	fee (int64): The fee to use for the transaction.

Returns:

	*Apollo: A pointer to the modified Apollo instance.

func (*Apollo) GetBurns added in v1.0.5

func (b *Apollo) GetBurns() (burns Value.Value)

func (*Apollo) GetEstimatedFee added in v1.7.0

func (b *Apollo) GetEstimatedFee() (int64, error)

*

GetEstimatedFee estimates the transaction fee based on
execution units and transaction size. This is the public
wrapper around the internal fee estimation logic.

Returns:

	int64: The estimated transaction fee.
	error: An error if fee estimation fails.

func (*Apollo) GetMints added in v1.7.0

func (b *Apollo) GetMints() Value.Value

*

GetMints returns all pending mints (both positive
and negative quantities) as a Value. This exposes
the internal mint tracking for external callers.

Returns:

	Value.Value: The total minted value.

func (*Apollo) GetPaymentsLength added in v1.1.0

func (b *Apollo) GetPaymentsLength() int

func (*Apollo) GetRedeemers added in v1.1.0

func (b *Apollo) GetRedeemers() map[string]Redeemer.Redeemer

func (*Apollo) GetSortedInputs added in v1.1.0

func (b *Apollo) GetSortedInputs() []UTxO.UTxO

func (*Apollo) GetStakeCredentialFromWallet added in v1.5.0

func (b *Apollo) GetStakeCredentialFromWallet() (*Certificate.Credential, error)

*

GetStakeCredentialFromWallet extracts a stake credential from the wallet's stake verification key.

Returns:
	*Certificate.Credential: The stake credential.
	error: An error if the wallet doesn't have a stake key or extraction fails.

func (*Apollo) GetTx added in v1.0.3

func (b *Apollo) GetTx() *Transaction.Transaction

*

GetTx returns the transaction associated with the Apollo object.

Returns:
	*Transacction.Transaction: A pointer to the transaction.

func (*Apollo) GetUsedUTxOs added in v1.0.3

func (b *Apollo) GetUsedUTxOs() map[string]bool

*

GetUsedUTxOs returns the map of used UTxOs in the
transaction.

Returns:
   map[string]bool: The map of used UTxOs.

func (*Apollo) GetWallet added in v1.0.3

func (b *Apollo) GetWallet() apollotypes.Wallet

*

GetWallet returns the wallet associated with the Apollo instance.

Returns:
	apollotypes.Wallet: The wallet associated with the Apollo instance.

func (*Apollo) LoadTxCbor added in v1.0.3

func (b *Apollo) LoadTxCbor(txCbor string) (*Apollo, error)

*

LoadTxCbor loads a transaction from its CBOR representation and updates
the apollo instances.

Params:
	txCbor (string): The CBOR-encoded representation of the transaction.

Returns:

*Apollo: A pointer to the modified Apollo instance with the loaded transaction.
error: An error, if any, encountered during loading.

func (*Apollo) MintAssets added in v1.0.3

func (b *Apollo) MintAssets(mintUnit Unit) *Apollo

*

MintAssets adds a minting unit to the transaction's minting set.

Params:
	mintUnit Unit: The minting unit to add.

Returns:
	*Apollo: A pointer to the Apollo object to support method chaining.

func (*Apollo) MintAssetsWithNativeScript added in v1.7.2

func (b *Apollo) MintAssetsWithNativeScript(
	mintUnit Unit,
	script NativeScript.NativeScript,
) *Apollo

MintAssetsWithNativeScript adds a minting unit and attaches the native script witness required by the minting policy.

func (*Apollo) MintAssetsWithNativeScripts added in v1.7.2

func (b *Apollo) MintAssetsWithNativeScripts(
	mintUnit Unit,
	scripts ...NativeScript.NativeScript,
) *Apollo

MintAssetsWithNativeScripts adds a minting unit and attaches one or more native script witnesses required by native-script minting policies.

func (*Apollo) MintAssetsWithRedeemer added in v1.0.3

func (b *Apollo) MintAssetsWithRedeemer(
	mintUnit Unit,
	redeemerData PlutusData.PlutusData,
) *Apollo

*

MintAssetsWithRedeemer adds a minting unit with an
associated redeemer to the transaction's minting set.
The redeemer is auto-created with the MINT tag from
the provided PlutusData.

Params:
	mintUnit Unit: The minting unit to add.
	redeemerData PlutusData.PlutusData: The redeemer
		data for the minting unit.

Returns:
	*Apollo: A pointer to the Apollo object with
	the minting unit added.

func (*Apollo) MintAssetsWithRedeemerAndExUnits added in v1.8.0

func (b *Apollo) MintAssetsWithRedeemerAndExUnits(
	mintUnit Unit,
	redeemerData PlutusData.PlutusData,
	exUnits Redeemer.ExecutionUnits,
) *Apollo

*

MintAssetsWithRedeemerAndExUnits adds a minting unit with an
associated redeemer and caller-supplied execution units to the
transaction's minting set. Use this when ExUnits have been
pre-computed (e.g. offline evaluation) and should not be
replaced by on-chain estimation.

Unlike MintAssetsWithRedeemer, this does not flip the estimation
flag; if the transaction needs estimation for other redeemers,
call SetEstimationExUnitsRequired() explicitly. Note that
enabling estimation will overwrite these ExUnits when the
evaluator returns values for this redeemer.

Params:
	mintUnit Unit: The minting unit to add.
	redeemerData PlutusData.PlutusData: The redeemer
		data for the minting unit.
	exUnits Redeemer.ExecutionUnits: The explicit
		execution units to attach to the redeemer.

Returns:
	*Apollo: A pointer to the Apollo object with
	the minting unit added.

func (*Apollo) PayToAddress added in v1.0.3

func (b *Apollo) PayToAddress(
	address Address.Address,
	lovelace int,
	units ...Unit,
) *Apollo

*

	PayToAddress creates a payment to the specified address with the given lovelace and units,
	then adds it to the list of payment.

	Params:
		address (Address.Address): The recipient's address for the payment.
   		lovelace (int): The amount in lovelace to send in the payment.
   		units (...Unit): A set of units to include in the payment.

	Returns:

*Apollo: A pointer to the modified Apollo instance with the payment added.

func (*Apollo) PayToAddressBech32 added in v1.0.3

func (b *Apollo) PayToAddressBech32(
	address string,
	lovelace int,
	units ...Unit,
) *Apollo

*

PayToAddressBech32 creates a payment to the specified Bech32 address
with the given lovelace and units.

Params:
	address (string): The Bech32 address to which the payment will be made.
	lovelace (int): The amount in lovelace to be paid.
	units (...Unit): The units (assets) to be paid along with the lovelace.

Returns:

*Apollo: A pointer to the modified Apollo instance with the payment added.

func (*Apollo) PayToAddressWithV1ReferenceScript added in v1.6.0

func (b *Apollo) PayToAddressWithV1ReferenceScript(
	address Address.Address,
	lovelace int,
	script PlutusData.PlutusV1Script,
	units ...Unit,
) *Apollo

PayToAddressWithV1ReferenceScript creates a payment to the specified address with a Plutus V1 reference script attached to the output.

func (*Apollo) PayToAddressWithV2ReferenceScript added in v1.6.0

func (b *Apollo) PayToAddressWithV2ReferenceScript(
	address Address.Address,
	lovelace int,
	script PlutusData.PlutusV2Script,
	units ...Unit,
) *Apollo

PayToAddressWithV2ReferenceScript creates a payment to the specified address with a Plutus V2 reference script attached to the output.

func (*Apollo) PayToAddressWithV3ReferenceScript added in v1.6.0

func (b *Apollo) PayToAddressWithV3ReferenceScript(
	address Address.Address,
	lovelace int,
	script PlutusData.PlutusV3Script,
	units ...Unit,
) *Apollo

PayToAddressWithV3ReferenceScript creates a payment to the specified address with a Plutus V3 reference script attached to the output.

func (*Apollo) PayToContract added in v1.0.3

func (b *Apollo) PayToContract(
	contractAddress Address.Address,
	pd *PlutusData.PlutusData,
	lovelace int,
	isInline bool,
	units ...Unit,
) *Apollo

*

PayToContract creates a payment to a smart contract address and includes a Plutus datum, which

 	is added to the list of payments, and if a datum is provided, it is added to the data list.

	Params:

contractAddress (Address.Address): The smart contract address to send the payment to.
pd (*PlutusData.PlutusData): Plutus datum to include in the payment.
lovelace (int): The amount in lovelace to send in the payment.
isInline (bool): Indicates if the payment is inline with the datum.
units (...Unit): A set of units to include in the payment.

Returns:

*Apollo: A pointer to the modified Apollo instance with the payment and datum added.

func (*Apollo) PayToContractAsHash added in v1.7.0

func (b *Apollo) PayToContractAsHash(
	contractAddress Address.Address,
	pdHash []byte,
	lovelace int,
	isInline bool,
	units ...Unit,
) *Apollo

*

PayToContractAsHash creates a payment to a smart
contract address using a pre-computed datum hash
instead of inline datum data.

Params:

	contractAddress (Address.Address): The contract
	  address to send the payment to.
	pdHash ([]byte): The pre-computed datum hash.
	lovelace (int): The amount in lovelace to send.
	isInline (bool): Whether the datum is inline.
	units (...Unit): Units to include in the payment.

Returns:

	*Apollo: A pointer to the modified Apollo instance.

func (*Apollo) PayToContractWithV1ReferenceScript added in v1.6.0

func (b *Apollo) PayToContractWithV1ReferenceScript(
	contractAddress Address.Address,
	pd *PlutusData.PlutusData,
	lovelace int,
	isInline bool,
	script PlutusData.PlutusV1Script,
	units ...Unit,
) *Apollo

PayToContractWithV1ReferenceScript creates a payment to a contract address with a datum and a Plutus V1 reference script attached to the output.

func (*Apollo) PayToContractWithV2ReferenceScript added in v1.6.0

func (b *Apollo) PayToContractWithV2ReferenceScript(
	contractAddress Address.Address,
	pd *PlutusData.PlutusData,
	lovelace int,
	isInline bool,
	script PlutusData.PlutusV2Script,
	units ...Unit,
) *Apollo

PayToContractWithV2ReferenceScript creates a payment to a contract address with a datum and a Plutus V2 reference script attached to the output.

func (*Apollo) PayToContractWithV3ReferenceScript added in v1.6.0

func (b *Apollo) PayToContractWithV3ReferenceScript(
	contractAddress Address.Address,
	pd *PlutusData.PlutusData,
	lovelace int,
	isInline bool,
	script PlutusData.PlutusV3Script,
	units ...Unit,
) *Apollo

PayToContractWithV3ReferenceScript creates a payment to a contract address with a datum and a Plutus V3 reference script attached to the output.

func (*Apollo) RegisterAndDelegateStake added in v1.5.0

func (b *Apollo) RegisterAndDelegateStake(
	stakeCredential *Certificate.Credential,
	poolKeyHash serialization.PubKeyHash,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateStake registers a stake key and delegates it to a stake pool in one transaction.

Params:

stakeCredential (*Certificate.Credential): The stake credential to register and delegate.
If nil, it will attempt to extract from the wallet.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	coin (int64): The coin to register and delegate.

Returns:

*Apollo: A pointer to the modified Apollo instance with both certificates added.
error: An error if the stake credential cannot be determined.

func (*Apollo) RegisterAndDelegateStakeAndVote added in v1.5.0

func (b *Apollo) RegisterAndDelegateStakeAndVote(
	stakeCredential *Certificate.Credential,
	poolKeyHash serialization.PubKeyHash,
	drep *Certificate.Drep,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateStakeAndVote registers a stake key and delegates it to both a stake pool and a DRep in one transaction (registration-stake-and-vote-delegation-certificate).

Params:

stakeCredential (*Certificate.Credential): The stake credential to register and delegate.
If nil, it will attempt to extract from the wallet.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	drep (*Certificate.Drep): The DRep to delegate votes to.
	coin (int64): The coin to register and delegate.
Returns:

*Apollo: A pointer to the modified Apollo instance with all certificates added.
error: An error if the stake credential cannot be determined.

func (*Apollo) RegisterAndDelegateStakeAndVoteFromAddress added in v1.5.0

func (b *Apollo) RegisterAndDelegateStakeAndVoteFromAddress(
	address Address.Address,
	poolKeyHash serialization.PubKeyHash,
	drep *Certificate.Drep,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateStakeAndVoteFromAddress registers and delegates a stake key from an address to both a stake pool and a DRep.

Params:
	address (Address.Address): The address containing the stake key.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	drep (*Certificate.Drep): The DRep to delegate votes to.
	coin (int64): The coin to register and delegate.
Returns:

*Apollo: A pointer to the modified Apollo instance with all certificates added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) RegisterAndDelegateStakeAndVoteFromBech32 added in v1.5.0

func (b *Apollo) RegisterAndDelegateStakeAndVoteFromBech32(
	address string,
	poolKeyHash serialization.PubKeyHash,
	drep *Certificate.Drep,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateStakeAndVoteFromBech32 registers and delegates a stake key from a Bech32 address to both a stake pool and a DRep.

Params:
	address (string): The Bech32 address containing the stake key.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	drep (*Certificate.Drep): The DRep to delegate votes to.
	coin (int64): The coin to register and delegate.
Returns:

*Apollo: A pointer to the modified Apollo instance with all certificates added.
error: An error if the address cannot be decoded.

func (*Apollo) RegisterAndDelegateStakeFromAddress added in v1.5.0

func (b *Apollo) RegisterAndDelegateStakeFromAddress(
	address Address.Address,
	poolKeyHash serialization.PubKeyHash,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateStakeFromAddress registers and delegates a stake key from an address to a stake pool.

Params:
	address (Address.Address): The address containing the stake key.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	coin (int64): The coin to register and delegate.

Returns:

*Apollo: A pointer to the modified Apollo instance with both certificates added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) RegisterAndDelegateStakeFromBech32 added in v1.5.0

func (b *Apollo) RegisterAndDelegateStakeFromBech32(
	address string,
	poolKeyHash serialization.PubKeyHash,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateStakeFromBech32 registers and delegates a stake key from a Bech32 address to a stake pool.

Params:
	address (string): The Bech32 address containing the stake key.

	poolKeyHash (serialization.PubKeyHash): The pool key hash to delegate to.
	coin (int64): The coin to register and delegate.

Returns:

*Apollo: A pointer to the modified Apollo instance with both certificates added.
error: An error if the address cannot be decoded.

func (*Apollo) RegisterAndDelegateVote added in v1.5.0

func (b *Apollo) RegisterAndDelegateVote(
	stakeCredential *Certificate.Credential,
	drep *Certificate.Drep,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateVote registers a stake key and delegates it to vote for a DRep in one transaction (registration-and-vote-delegation-certificate).

Params:

	stakeCredential (*Certificate.Credential): The stake credential to register and delegate.
	If nil, it will attempt to extract from the wallet.
	drep (*Certificate.Drep): The DRep to delegate votes to.
	coin (int64): The coin to register and delegate.
Returns:

*Apollo: A pointer to the modified Apollo instance with both certificates added.
error: An error if the stake credential cannot be determined.

func (*Apollo) RegisterAndDelegateVoteFromAddress added in v1.5.0

func (b *Apollo) RegisterAndDelegateVoteFromAddress(
	address Address.Address,
	drep *Certificate.Drep,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateVoteFromAddress registers and delegates a stake key from an address to vote for a DRep.

Params:
	address (Address.Address): The address containing the stake key.
	drep (*Certificate.Drep): The DRep to delegate votes to.
	coin (int64): The coin to register and delegate.
Returns:

*Apollo: A pointer to the modified Apollo instance with both certificates added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) RegisterAndDelegateVoteFromBech32 added in v1.5.0

func (b *Apollo) RegisterAndDelegateVoteFromBech32(
	address string,
	drep *Certificate.Drep,
	coin int64,
) (*Apollo, error)

*

RegisterAndDelegateVoteFromBech32 registers and delegates a stake key from a Bech32 address to vote for a DRep.

Params:
	address (string): The Bech32 address containing the stake key.
	drep (*Certificate.Drep): The DRep to delegate votes to.
	coin (int64): The coin to register and delegate.
Returns:

*Apollo: A pointer to the modified Apollo instance with both certificates added.
error: An error if the address cannot be decoded.

func (*Apollo) RegisterDRep added in v1.7.2

func (b *Apollo) RegisterDRep(
	credential Certificate.Credential,
	coin int64,
	anchor *Certificate.Anchor,
) *Apollo

RegisterDRep adds a DRep registration certificate (kind 16).

func (*Apollo) RegisterPool added in v1.5.0

func (b *Apollo) RegisterPool(poolParams *Certificate.PoolParams) *Apollo

*

RegisterPool registers a stake pool (pool-registration-certificate).

Params:

	poolParams (*Certificate.PoolParams): The pool parameters including operator, VRF key hash, pledge, cost, margin, reward account, pool owners, relays, and optional metadata.

Returns:

*Apollo: A pointer to the modified Apollo instance with pool registration certificate added.

func (*Apollo) RegisterStake added in v1.5.0

func (b *Apollo) RegisterStake(
	stakeCredential *Certificate.Credential,
) (*Apollo, error)

*

RegisterStake registers a stake key for staking.

Params:

	stakeCredential (*Certificate.Credential): The stake credential to register.
	If nil, it will attempt to extract from the wallet.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake registration certificate added.
error: An error if the stake credential cannot be determined.

func (*Apollo) RegisterStakeFromAddress added in v1.5.0

func (b *Apollo) RegisterStakeFromAddress(
	address Address.Address,
) (*Apollo, error)

*

RegisterStakeFromAddress registers a stake key from an address.

Params:

	address (Address.Address): The address containing the stake key to register.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake registration certificate added.

error: An error if the stake credential cannot be extracted from the address.

func (*Apollo) RegisterStakeFromBech32 added in v1.5.0

func (b *Apollo) RegisterStakeFromBech32(address string) (*Apollo, error)

*

RegisterStakeFromBech32 registers a stake key from a Bech32 address.

Params:

	address (string): The Bech32 address containing the stake key to register.

Returns:

*Apollo: A pointer to the modified Apollo instance with stake registration certificate added.
error: An error if the address cannot be decoded.

func (*Apollo) ResignCommitteeColdKey added in v1.7.2

func (b *Apollo) ResignCommitteeColdKey(
	cold Certificate.Credential,
	anchor *Certificate.Anchor,
) *Apollo

ResignCommitteeColdKey adds a committee cold key resignation certificate (kind 15).

func (*Apollo) RetireDRep added in v1.7.2

func (b *Apollo) RetireDRep(
	credential Certificate.Credential,
	coin int64,
) *Apollo

RetireDRep adds a DRep unregistration certificate (kind 17).

func (*Apollo) SetAdditionalUTxOs added in v1.7.0

func (b *Apollo) SetAdditionalUTxOs(
	utxos []UTxO.UTxO,
) *Apollo

SetAdditionalUTxOs sets extra UTxOs to pass to the backend during transaction evaluation (e.g. for reference inputs).

func (*Apollo) SetCertificates added in v1.3.0

func (b *Apollo) SetCertificates(c *Certificate.Certificates) *Apollo

func (*Apollo) SetChangeAddress added in v1.0.3

func (b *Apollo) SetChangeAddress(address Address.Address) *Apollo

*

	SetChangeAddress sets the change address for the transaction using an Address object.

 	Params:

   	address (Address.Address): The Address object to set as the change address.

Returns:

*Apollo: A pointer to the modified Apollo instance with the change address set.

func (*Apollo) SetChangeAddressBech32 added in v1.0.3

func (b *Apollo) SetChangeAddressBech32(address string) *Apollo

*

SetChangeAddressBech32 sets the change address for the transaction using a Bech32-encoded address.

Params:

  		address (string): The Bech32-encoded address to set as the change address.

	Returns:

*Apollo: A pointer to the modified Apollo instance with the change address set.

func (*Apollo) SetCollateralAmount added in v1.1.0

func (b *Apollo) SetCollateralAmount(amount int) *Apollo

*

	SetCollateralAmount sets the collateral amount for the transaction.

 	Returns:

*Apollo: A pointer to the modified Apollo instance with the collateral amount set.

func (*Apollo) SetCurrentTreasuryValue added in v1.7.2

func (b *Apollo) SetCurrentTreasuryValue(
	value int64,
) *Apollo

*

SetCurrentTreasuryValue sets the current treasury value
(Conway era field 21) on the transaction body.

Params:
	value (int64): The current treasury value in lovelace.

Returns:
	*Apollo: The modified Apollo instance.

func (*Apollo) SetEstimationExUnitsRequired added in v1.0.3

func (b *Apollo) SetEstimationExUnitsRequired() *Apollo

*

SetEstimationExUnitsRequired enables the estimation of execution units
for the transaction.

Returns:

*Apollo: A pointer to the modified Apollo instance with execution units estimation enabled.

func (*Apollo) SetFeePadding added in v1.0.5

func (b *Apollo) SetFeePadding(padding int64) *Apollo

func (*Apollo) SetMetadataFromJSON added in v1.7.2

func (b *Apollo) SetMetadataFromJSON(jsonData []byte) *Apollo

SetMetadataFromJSON parses a cardano-cli-style metadata JSON document using the no-schema conversion and sets it as Shelley Mary metadata.

func (*Apollo) SetMetadataFromJSONWithSchema added in v1.7.2

func (b *Apollo) SetMetadataFromJSONWithSchema(
	jsonData []byte,
	schema Metadata.JSONSchema,
) *Apollo

SetMetadataFromJSONWithSchema parses a metadata JSON document using the selected Cardano metadata JSON schema and sets it as Shelley Mary metadata.

func (*Apollo) SetShelleyMetadata added in v1.0.3

func (b *Apollo) SetShelleyMetadata(
	metadata Metadata.ShelleyMaryMetadata,
) *Apollo

*

SetShelleyMetadata function sets the Shelley Mary metadata for the transaction's
auxiliary data.

Params:

	metadata (Metadata.ShelleyMaryMetadata): The Shelley Mary metadat to set.

Returns:

*Apollo: A pointer to the modified Apollo instance with the Shelley Mary metadata set.

func (*Apollo) SetTtl added in v1.0.3

func (b *Apollo) SetTtl(ttl int64) *Apollo

*

SetTtl function sets the time-to-live (TTL) for the transaction.

Params:
	ttl (int64): The TTL value to set fro the transaction.

Returns:
	*Apollo: A pointer to the modified Apollo instance with the TTl set.

func (*Apollo) SetValidityStart added in v1.0.3

func (b *Apollo) SetValidityStart(invalidBefore int64) *Apollo

*

SetValidityStart function sets the validity start for the transaction.

Params:

	invalidBefore (int64): The validity start value to set for the transaction.

Returns:

*Apollo: A pointer to the modified Apollo instance with the validity start set.

func (*Apollo) SetWalletAsChangeAddress added in v1.0.3

func (b *Apollo) SetWalletAsChangeAddress() (*Apollo, error)

*

Set the wallet as the change address for the Apollo transaction.

Returns:

*Apollo: A pointer to the Apollo object with the wallet set as the change address.

func (*Apollo) SetWalletFromBech32 added in v1.0.3

func (a *Apollo) SetWalletFromBech32(address string) *Apollo

*

Set the wallet for the Apollo transaction using a Bech32 address.

Params:
	address: The Bech32 address to use as the wallet.

Returns:
	*Apollo: A pointer to the Apollo object with the wallet set.

func (*Apollo) SetWalletFromKeypair added in v1.0.5

func (a *Apollo) SetWalletFromKeypair(
	vkey string,
	skey string,
	network constants.Network,
) *Apollo

For use with key pairs generated by cardano-cli

func (*Apollo) SetWalletFromMnemonic

func (a *Apollo) SetWalletFromMnemonic(
	mnemonic string,
	network constants.Network,
) (*Apollo, error)

func (*Apollo) Sign added in v1.0.3

func (b *Apollo) Sign() *Apollo

*

Sign the Apollo transaction using the wallet's keys.

Returns:
	*Apollo: A pointer to the Apollo object with the transaction signed.

func (*Apollo) SignWithSkey added in v1.0.3

func (b *Apollo) SignWithSkey(
	vkey Key.VerificationKey,
	skey Key.SigningKey,
) (*Apollo, error)

*

Sign the Apollo transaction with the given verification key and signing key.

Parameters:
	vkey: The verification key to sign with.
	skey: The signing key to sign with.

Returns:
	*Apollo: A pointer to the Apollo object with the transaction signed.
	error: An error if the signing fails.

func (*Apollo) Submit added in v1.0.3

func (b *Apollo) Submit() (serialization.TransactionId, error)

*

Submit function submits the constructed transaction to the blockchain
network using the associated chain context.

Returns:
	serialization.TransactionId: The ID of the submitted transaction.
	error: An error, if any, encountered during transaction submission.

func (*Apollo) UpdateDRep added in v1.7.2

func (b *Apollo) UpdateDRep(
	credential Certificate.Credential,
	anchor *Certificate.Anchor,
) *Apollo

UpdateDRep adds a DRep update certificate (kind 18).

func (*Apollo) UpdateRedeemers added in v1.1.0

func (b *Apollo) UpdateRedeemers(
	newRedeemers map[string]Redeemer.Redeemer,
) *Apollo

func (*Apollo) UtxoFromRef added in v1.0.3

func (b *Apollo) UtxoFromRef(txHash string, txIndex int) (*UTxO.UTxO, error)

*

UtxoFromRef retrieves a UTxO (Unspent Transaction Output) given its transaction hash and index.

Params:

txHash (string): The hexadecimal representation of the transaction hash.

  		txIndex (int): The index of the UTxO within the transaction's outputs.

	Returns:
  		*UTxO.UTxO: A pointer to the retrieved UTxO, or nil if not found.

type Payment added in v1.0.3

type Payment struct {
	Lovelace  int
	Receiver  Address.Address
	Units     []Unit
	Datum     *PlutusData.PlutusData
	DatumHash []byte
	IsInline  bool
	ScriptRef *PlutusData.ScriptRef
}

func NewPayment added in v1.0.3

func NewPayment(receiver string, lovelace int, units []Unit) *Payment

*

NewPayment creates a new Payment object.

Params:
	receiver (string): The receiver's address.
	lovelace (int): The amount in Lovelace.
	units ([]Unit): The assets units to be included.

Returns:
	*Payment: The newly created Payment object.

func NewPaymentFromValue added in v1.0.3

func NewPaymentFromValue(receiver Address.Address, value Value.Value) *Payment

*

NewPaymentFromValue creates a new Payment object from an Address
and Value object.

Params:
	receiver (Address.Address): The receiver's address.
	value (Value.Value): The value object containing payment details.

Returns:
	*Payment: The newly created Payment object.

func PaymentFromTxOut added in v1.0.3

func PaymentFromTxOut(txOut *TransactionOutput.TransactionOutput) *Payment

*

PaymentFromTxOut creates a Payment object from a TransactionOutput.

Params:

	txOut (*TransactionOutput.TransactionOutput): The TransactionOutput to create the Payment.

Returns:
	*Payment: The created Payment object.

func (*Payment) EnsureMinUTXO added in v1.0.3

func (p *Payment) EnsureMinUTXO(cc Base.ChainContext)

*

EnsureMinUTXO ensures that the payment amount meets the minimun UTXO requirement.

Params:
	cc (Base.ChainContext): The chain context.

func (*Payment) ToTxOut added in v1.0.3

*

ToTxOut converts a Payment object to a TransactionOutput object.

Returns:

*TransactionOutput.TransactionOutput: The created TransactionOutput object.

ScriptRef is only valid on post-Alonzo outputs, so any payment with a ScriptRef must take the post-Alonzo path even if it has no inline datum or datum hash.

func (*Payment) ToValue added in v1.0.3

func (p *Payment) ToValue() Value.Value

*

ToValue converts a Payment to a Value object.

Returns:
	Value.Value: The constructed Value object representing the payment.

type PaymentI added in v1.0.3

type PaymentI interface {
	EnsureMinUTXO(cc Base.ChainContext)
	ToTxOut() *TransactionOutput.TransactionOutput
	ToValue() Value.Value
}

type Unit added in v1.0.3

type Unit struct {
	PolicyId string
	Name     string
	Quantity int
}

func NewUnit added in v1.0.3

func NewUnit(policyId string, name string, quantity int) Unit

*

NewUnit creates a new Unit with the provided information.

Params:
	policyId (string): The policy ID of the asset.
	name (string): The name of the asset.
	quantity (int): The quantity of the asset.

Returns:
	Unit: The newly created Unit instance.

func (*Unit) ToValue added in v1.0.3

func (u *Unit) ToValue() Value.Value

*

ToValue converts a Unit to a Value object.

Returns:
	Value: The constructed Value object representing the asset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL