mixin

package
v0.0.0-...-78afc55 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalGenerateAddress

func LocalGenerateAddress(viewKey, spendKey string) (*common.Address, error)

func LocalSignRawTransaction

func LocalSignRawTransaction(assetId string)

func ParseKeyFromHex

func ParseKeyFromHex(src string) (crypto.Key, error)

Types

type Mint

type Mint struct {
	Group       string `json:"group"`
	Amount      string `json:"amount"`
	Batch       int64  `json:"batch"`
	Transaction string `json:"transaction"`
}

type MixinKey

type MixinKey struct {
	Address  string
	ViewKey  string
	SpendKey string
}

func LocalGenerateKey

func LocalGenerateKey() (MixinKey, error)

type MixinNetwork

type MixinNetwork struct {
	// contains filtered or unexported fields
}

func NewMixinNetwork

func NewMixinNetwork(node string) *MixinNetwork

func (*MixinNetwork) GetInfo

func (m *MixinNetwork) GetInfo() (*NodeInfo, error)

func (*MixinNetwork) GetTransaction

func (m *MixinNetwork) GetTransaction(hash string) (*Transaction, error)

func (*MixinNetwork) GetTransactionUTXO

func (m *MixinNetwork) GetTransactionUTXO(hash string, viewKey string) ([]*UTXO, error)

func (*MixinNetwork) ListAllNodes

func (m *MixinNetwork) ListAllNodes() ([]*Node, error)

func (*MixinNetwork) ListMintDistributions

func (m *MixinNetwork) ListMintDistributions() ([]*Mint, error)

func (*MixinNetwork) ListSnapshotsSince

func (m *MixinNetwork) ListSnapshotsSince(since, count uint64) ([]*SnapshotWithTransaction, error)

func (*MixinNetwork) SendRawTransaction

func (m *MixinNetwork) SendRawTransaction(raw string) (string, error)

type Node

type Node struct {
	Id          string `json:"id`
	Signer      string `json:"signer"`
	Payee       string `json:"payee"`
	Transaction string `json:"transaction"`
	Timestamp   int64  `json:"timestamp"`
	State       string `json:"state"`
}

type NodeInfo

type NodeInfo struct {
	Network string `json:"network"`
	Node    string `json:"node"`
	Version string `json:"version"`
	Uptime  string `json:"uptime"`
	Queue   struct {
		Caches       int64 `json:"caches"`
		Finals       int64 `json:"finals"`
		Transactions int64 `json:"transactions"`
	} `json:"queue"`
	Graph struct {
		Topology  int64 `json:"topology"`
		Consensus []struct {
			Node      string  `json:"node"`
			Payee     string  `json:"payee"`
			Signer    string  `json:"signer"`
			State     string  `json:"state"`
			Timestamp int64   `json:"timestamp"`
			Works     []int64 `json:"works"`
		} `json:"consensus"`
	} `json:"graph"`
	Mint struct {
		Batch  int64  `json:"batch"`
		Pledge string `json:"pledge"`
		Pool   string `json:"pool"`
	} `json:"mint"`
}

type SnapshotWithTransaction

type SnapshotWithTransaction struct {
	Hash        string      `json:"hash"`
	Timestamp   uint64      `json:"timestamp"`
	Topology    uint64      `json:"topology"`
	Transaction Transaction `json:"transaction"`
}

type Transaction

type Transaction struct {
	Version uint8  `json:"version"`
	Asset   string `json:"asset"`
	Inputs  []struct {
		Hash    string              `json:"hash"`
		Index   int                 `json:"index"`
		Genesis string              `json:"genesis"`
		Deposit *common.DepositData `json:"deposit"`
		Mint    *common.MintData    `json:"mint"`
	} `json:"inputs"`
	Outputs []struct {
		Type   uint8          `json:"type"`
		Amount number.Decimal `json:"amount"`
		Keys   []crypto.Key   `json:"keys"`
		Script string         `json:"script"`
		Mask   crypto.Key     `json:"mask"`
	} `json:"outputs"`
	Extra string `json:"extra"`
	Hash  string `json:"hash"`
}

func (*Transaction) Deposit

func (tx *Transaction) Deposit() *common.DepositData

func (*Transaction) UTXOs

func (tx *Transaction) UTXOs(view crypto.Key) []*UTXO

type UTXO

type UTXO struct {
	Asset    string         `json:"asset"`
	Hash     string         `json:"hash"`
	Index    int            `json:"index"`
	Amount   number.Decimal `json:"amount"`
	Receiver string         `json:"receiver"`
	Extra    string         `json:"extra"`

	Key  crypto.Key `json:"key,omitempty"`
	Mask crypto.Key `json:"mask,omitempty"`
}

Jump to

Keyboard shortcuts

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