cardano

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtLeast

func AtLeast(amt int32) func(utxo Utxo) bool

func ExcludeScripts

func ExcludeScripts(enabled bool) func(utxo Utxo) bool

func ExcludeTokens

func ExcludeTokens(enabled bool) func(utxo Utxo) bool

func HasToken

func HasToken(assetID string) func(utxo Utxo) bool

Types

type Asset

type Asset struct {
	AssetName   string `json:"asset_name,omitempty"`
	Description string `json:"description,omitempty"`
	Name        string `json:"name,omitempty"`
	PolicyId    string `json:"policy_id,omitempty"`
	Ticker      string `json:"ticker,omitempty"`
	Url         string `json:"url,omitempty"`
}

func (Asset) ID

func (a Asset) ID() string

type BuildOption

type BuildOption func(options *BuildOptions)

func Certificate

func Certificate(files ...string) BuildOption

func Fee

func Fee(fee string) BuildOption

func Mint

func Mint(s string) BuildOption

func MintScriptFile

func MintScriptFile(filename string) BuildOption

func TxIn

func TxIn(address string, index int32) BuildOption

func TxOut

func TxOut(address string, quantity string, tokens ...string) BuildOption

type BuildOptions

type BuildOptions struct {
	Fee            string
	Mint           string
	MintScriptFile string
	TxIn           []txIn
	TxOut          []txOut
	Certificates   []string
}

func MakeBuildOptions

func MakeBuildOptions(opts ...BuildOption) BuildOptions

type CLI

type CLI struct {
	Cmd              []string
	Dir              string
	PoolDir          string
	SocketPath       string
	TestnetMagic     string
	TreasuryAddr     string
	TreasurySkeyFile string
	Debug            bool
}

func (CLI) Build

func (c CLI) Build(opts ...BuildOption) ([]byte, error)

func (CLI) CreateWallet

func (c CLI) CreateWallet(ctx context.Context, initialFunds, name string) (wallet string, err error)

func (CLI) DataDir

func (c CLI) DataDir() string

DataDir returns the path to the directory containing the server data

func (CLI) Delegate

func (c CLI) Delegate(ctx context.Context, address string) (tx Tx, err error)

func (CLI) FindAllWallets

func (c CLI) FindAllWallets(query string) ([]string, error)

func (CLI) FundWallet

func (c CLI) FundWallet(ctx context.Context, address, quantity string) (tx Tx, err error)

func (CLI) KeyHash

func (c CLI) KeyHash(ctx context.Context, wallet string) (keyHash string, err error)

func (CLI) MinFee

func (c CLI) MinFee(ctx context.Context, filename string, txIn, txOut, witnesses int32) (fee string, err error)

func (*CLI) NormalizeAddress

func (c *CLI) NormalizeAddress(address string) (string, error)

func (CLI) PolicyID

func (c CLI) PolicyID(ctx context.Context, filename string) (policyID string, err error)

func (CLI) ProtocolParameters

func (c CLI) ProtocolParameters(ctx context.Context) (filename string, err error)

func (CLI) QueryTip

func (c CLI) QueryTip() (*Tip, error)

func (CLI) RegisterStake

func (c CLI) RegisterStake(ctx context.Context, address string) (tx Tx, err error)

func (CLI) Sign

func (c CLI) Sign(ctx context.Context, raw []byte, wallets ...string) (data []byte, err error)

func (CLI) Submit

func (c CLI) Submit(ctx context.Context, signed []byte) (err error)

func (CLI) Utxos

func (c CLI) Utxos(address string, excludes ...func(Utxo) bool) (utxos Utxos, err error)

Utxos retrieves the list of utxos from cardano node.

TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
111b3dc09d55e1708a22c866f697f358ccfe94dda61df8c0b9bca5b9081989ba     0        1000000000 lovelace + 1000000000 5a3932c9cbe8b7ac58eefde2de45da2091b6df15052042656114c83c.test + 2000000000 5a3932c9cbe8b7ac58eefde2de45da2091b6df15052042656114c83c.test + TxOutDatumHashNone
4d746439745c787087ac001c91270767ba0b4d10849fb6e8ab7c327b39f337f8     0        1000000000 lovelace + 1000000000 5a3932c9cbe8b7ac58eefde2de45da2091b6df15052042656114c83c.test + TxOutDatumHashNone
52afd623b02712d5b37f582eae28ec31ee222547ff59e46d30015f2e3ab583f2     1        1000000000 lovelace + TxOutDatumHashNone
77c564a216621c883e628de4586254f7a4ea49d12daa560c5f22bd9886bf06b8     1        1000000000 lovelace + TxOutDatumHashNone
7a35e91a434183f6af77f7f2193efddb9661db024a6cdd391a4d6f7809b2627b     1        1000000000 lovelace + TxOutDatumHashNone
79ca8a27a1c05030d0c4290ddaf8c6e49ea8080aa867e7068a0b16e425b77d60     0        1000000000000 lovelace + TxOutDatumHashNone
84ab3e643b0bbd7856fdde0e723e50ba40008fc01b7b1ac03b9b861211e13d3d     0        5010000000000 lovelace + TxOutDatumHashNone
a1d4e06b6a0a5acdd0d3669b3a09ad195754fbde2387361935941df41474e5bd     0        5010000000000 lovelace + TxOutDatumHashNone

func (CLI) Version

func (c CLI) Version() (version Version, err error)

func (*CLI) WalletLocation

func (c *CLI) WalletLocation(addressMnemonic string) string

type Tip

type Tip struct {
	Block int32
	Epoch int32
	Era   string
	Hash  string
	Slot  int32
}

type Token

type Token struct {
	Asset    *Asset `json:"asset,omitempty"`
	Quantity string `json:"quantity,omitempty"`
}

type Tx

type Tx struct {
	ID string
}

func ParseTx

func ParseTx(data []byte) (Tx, error)

type Utxo

type Utxo struct {
	Address   string  `json:"address,omitempty"`
	DatumHash string  `json:"datum_hash,omitempty"`
	Index     int32   `json:"index,omitempty"`
	Tokens    []Token `json:"tokens,omitempty"`
	Value     string  `json:"value,omitempty"`
}

func ParseUtxos

func ParseUtxos(buf *bytes.Buffer) []Utxo

func (Utxo) String

func (u Utxo) String() string

func (Utxo) TxIn

func (u Utxo) TxIn() string

type Utxos

type Utxos []Utxo

func (Utxos) Filter

func (uu Utxos) Filter(includes ...func(utxo Utxo) bool) (filtered Utxos)

func (Utxos) Find

func (uu Utxos) Find(address string, index int32) (Utxo, error)

type Version

type Version struct {
	Revision string
	Git      string
}

Jump to

Keyboard shortcuts

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