apollotypes

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address serAddress.Address

type AikenPlutusJSON added in v1.0.3

type AikenPlutusJSON struct {
	Preamble struct {
		Title         string `json:"title"`
		Description   string `json:"description"`
		Version       string `json:"version"`
		PlutusVersion string `json:"plutusVersion"`
		License       string `json:"license"`
	} `json:"preamble"`
	Validators []struct {
		Title string `json:"title"`
		Datum struct {
			Title  string `json:"title"`
			Schema struct {
				Ref string `json:"$ref"`
			} `json:"schema"`
		} `json:"datum"`
		Redeemer struct {
			Title  string `json:"title"`
			Schema struct {
				Ref string `json:"$ref"`
			} `json:"schema"`
		} `json:"redeemer"`
		CompiledCode string `json:"compiledCode"`
		Hash         string `json:"hash"`
	} `json:"validators"`
	Definitions struct {
	} `json:"definitions"`
}

func (*AikenPlutusJSON) GetScript added in v1.0.3

func (apj *AikenPlutusJSON) GetScript(
	name string,
) (*PlutusData.PlutusV2Script, error)

*

GetScript retrives a Plutus V2 script by its name from an AikenPlutusJSON object.
It searches through the Validators and returns the script if found.

Params:
	apj (*AikenPlutusJSON): A pointer to an AikenPlutusJSON object.
	name (string): the name of the script to retrieve.

Returns:

(*PlutusData.PlutusV2Script, error): A pointer to a Plutus V2 script and an error (if any).

type Backend

type Backend Base.ChainContext

type ExternalWallet added in v1.0.3

type ExternalWallet struct {
	Address serAddress.Address
}

func (*ExternalWallet) GetAddress added in v1.0.3

func (ew *ExternalWallet) GetAddress() *serAddress.Address

*

GetAddress returns the address associated with an external wallet.

Returns:
	*serAddress.Address: A pointer to the address of the external wallet.

func (*ExternalWallet) PkeyHash added in v1.0.3

func (ew *ExternalWallet) PkeyHash() serialization.PubKeyHash

*

PkeyHash returns the public key hash associated with an external wallet.
It computes and returns the public key hash based on the PaymentPart
of the wallet's address.

Returns:
	serialization.PubKeyHash: The public key hash of the external wallet.

func (*ExternalWallet) SignTx added in v1.0.3

*

SignTx signs a transaction using an external wallet.

Params:
	tx (Transaction.Transaction): The transaction to be signed.

Returns:

TransactionWitnessSet.TransactionWitnessSet: The withness set associated with the signed transaction.

func (*ExternalWallet) SkeyHash added in v1.1.0

func (ew *ExternalWallet) SkeyHash() serialization.PubKeyHash

type GenericWallet

type GenericWallet struct {
	SigningKey           Key.SigningKey
	VerificationKey      Key.VerificationKey
	Address              serAddress.Address
	StakeSigningKey      Key.SigningKey
	StakeVerificationKey Key.VerificationKey
}

func (*GenericWallet) GetAddress

func (gw *GenericWallet) GetAddress() *serAddress.Address

*

GetAddress returns the address associated with a generic wallet.

Returns:
	*serAddress.Address: A pointer to the address of a generic wallet.

func (*GenericWallet) PkeyHash added in v1.0.3

func (gw *GenericWallet) PkeyHash() serialization.PubKeyHash

*

PkeyHash calculates and returns the public key hash associated with a generic wallet.

It computes the public key hash by calling the Hash() method on the wallet's VerificationKey.
Then it returns as a serialization.PubKeyHas type.

Returns:

serialization.PubKeyHash: The public key hash of the generic wallet.

func (*GenericWallet) SignTx

*

SignTx signs a transaction using a generic wallet and returns the updated TransactionWitnessSet.

It takes a transaction of type Transaction.Transaction and signs it using the wallet's SigningKey.

Then it appends the corresponding VerificationKeyWitness to the TransactionWitnessSet and returns
the updated witness set.

Parameters:
   	wallet (*GenericWallet): A pointer to a generic wallet.
	tx (Transaction.Transaction): The transaction to be signed.

Returns:

TransactionWitnessSet.TransactionWitnessSet: The updated TransactionWitnessSet after signing the transaction.

func (*GenericWallet) SkeyHash added in v1.1.0

func (gw *GenericWallet) SkeyHash() serialization.PubKeyHash

type Wallet

type Wallet interface {
	GetAddress() *serAddress.Address
	SignTx(
		tx Transaction.Transaction,
		usedUtxos []UTxO.UTxO,
	) TransactionWitnessSet.TransactionWitnessSet
	PkeyHash() serialization.PubKeyHash
	SkeyHash() serialization.PubKeyHash
}

Jump to

Keyboard shortcuts

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