chainsync

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Byron   = Era{/* contains filtered or unexported fields */}
	Shelley = Era{/* contains filtered or unexported fields */}
	Allegra = Era{/* contains filtered or unexported fields */}
	Mary    = Era{/* contains filtered or unexported fields */}
	Alonzo  = Era{/* contains filtered or unexported fields */}
	Babbage = Era{/* contains filtered or unexported fields */}
)
View Source
var Origin = PointString("origin").Point()

Functions

func Enough added in v0.7.7

func Enough(have Value, want Value) (bool, error)

Types

type AssetID

type AssetID string

func (AssetID) AssetName

func (a AssetID) AssetName() string

func (AssetID) AssetNameUTF8

func (a AssetID) AssetNameUTF8() (string, bool)

func (AssetID) HasAssetID

func (a AssetID) HasAssetID(re *regexp.Regexp) bool

func (AssetID) HasPolicyID

func (a AssetID) HasPolicyID(s string) bool

func (AssetID) IsZero

func (a AssetID) IsZero() bool

func (AssetID) MatchAssetName

func (a AssetID) MatchAssetName(re *regexp.Regexp) ([]string, bool)

func (AssetID) PolicyID

func (a AssetID) PolicyID() string

func (AssetID) String

func (a AssetID) String() string

type Block

type Block struct {
	Body       []Tx        `json:"body,omitempty"       dynamodbav:"body,omitempty"`
	Header     BlockHeader `json:"header,omitempty"     dynamodbav:"header,omitempty"`
	HeaderHash string      `json:"headerHash,omitempty" dynamodbav:"headerHash,omitempty"`
}

type BlockHeader

type BlockHeader struct {
	BlockHash       string                 `json:"blockHash,omitempty"       dynamodbav:"blockHash,omitempty"`
	BlockHeight     uint64                 `json:"blockHeight,omitempty"     dynamodbav:"blockHeight,omitempty"`
	BlockSize       uint64                 `json:"blockSize,omitempty"       dynamodbav:"blockSize,omitempty"`
	IssuerVK        string                 `json:"issuerVK,omitempty"        dynamodbav:"issuerVK,omitempty"`
	IssuerVrf       string                 `json:"issuerVrf,omitempty"       dynamodbav:"issuerVrf,omitempty"`
	LeaderValue     map[string][]byte      `json:"leaderValue,omitempty"     dynamodbav:"leaderValue,omitempty"`
	Nonce           map[string]string      `json:"nonce,omitempty"           dynamodbav:"nonce,omitempty"`
	OpCert          map[string]interface{} `json:"opCert,omitempty"          dynamodbav:"opCert,omitempty"`
	PrevHash        string                 `json:"prevHash,omitempty"        dynamodbav:"prevHash,omitempty"`
	ProtocolVersion map[string]int         `json:"protocolVersion,omitempty" dynamodbav:"protocolVersion,omitempty"`
	Signature       string                 `json:"signature,omitempty"       dynamodbav:"signature,omitempty"`
	Slot            uint64                 `json:"slot,omitempty"            dynamodbav:"slot,omitempty"`
}

type ByronBlock

type ByronBlock struct {
	Body   ByronBody
	Hash   string
	Header ByronHeader
}

type ByronBody

type ByronBody struct {
	DlgPayload    []json.RawMessage `json:"dlgPayload,omitempty"`
	TxPayload     []ByronTxPayload  `json:"txPayload,omitempty"`
	UpdatePayload json.RawMessage   `json:"updatePayload,omitempty"`
}

type ByronHeader

type ByronHeader struct {
	BlockHeight     uint64 `json:"blockHeight,omitempty"`
	GenesisKey      string
	Epoch           uint32
	Proof           json.RawMessage
	PrevHash        string
	ProtocolMagicId uint64
	ProtocolVersion ProtocolVersion
	Signature       json.RawMessage
	Slot            uint64 `json:"slot,omitempty"`
	SoftwareVersion map[string]interface{}
}

type ByronTxBody

type ByronTxBody struct {
	Inputs  []TxIn
	Outputs []TxOut
}

type ByronTxPayload

type ByronTxPayload struct {
	ID      string
	Witness []ByronWitness
}

type ByronWitness

type ByronWitness struct {
	RedeemWitness map[string]string
}

type Datums

type Datums map[string]string

func (*Datums) UnmarshalDynamoDBAttributeValue

func (d *Datums) UnmarshalDynamoDBAttributeValue(item *dynamodb.AttributeValue) error

func (*Datums) UnmarshalJSON

func (d *Datums) UnmarshalJSON(i []byte) error

type Era

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

func (Era) AlonzoOrGreater

func (e Era) AlonzoOrGreater() bool

func (Era) String

func (e Era) String() string

type IntersectionFound

type IntersectionFound struct {
	Point Point
	Tip   Point
}

type IntersectionNotFound

type IntersectionNotFound struct {
	Tip Point
}

type Point

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

func (Point) MarshalCBOR

func (p Point) MarshalCBOR() ([]byte, error)

func (Point) MarshalDynamoDBAttributeValue

func (p Point) MarshalDynamoDBAttributeValue(item *dynamodb.AttributeValue) error

func (Point) MarshalJSON

func (p Point) MarshalJSON() ([]byte, error)

func (Point) PointString

func (p Point) PointString() (PointString, bool)

func (Point) PointStruct

func (p Point) PointStruct() (*PointStruct, bool)

func (Point) PointType

func (p Point) PointType() PointType

func (Point) String

func (p Point) String() string

func (*Point) UnmarshalCBOR

func (p *Point) UnmarshalCBOR(data []byte) error

func (*Point) UnmarshalDynamoDBAttributeValue

func (p *Point) UnmarshalDynamoDBAttributeValue(item *dynamodb.AttributeValue) error

func (*Point) UnmarshalJSON

func (p *Point) UnmarshalJSON(data []byte) error

type PointString

type PointString string

func (PointString) Point

func (p PointString) Point() Point

type PointStruct

type PointStruct struct {
	BlockNo uint64 `json:"blockNo,omitempty" dynamodbav:"blockNo,omitempty"`
	Hash    string `json:"hash,omitempty"    dynamodbav:"hash,omitempty"`
	Slot    uint64 `json:"slot,omitempty"    dynamodbav:"slot,omitempty"`
}

func (PointStruct) Point

func (p PointStruct) Point() Point

type PointType

type PointType int
const (
	PointTypeString PointType = 1
	PointTypeStruct PointType = 2
)

type Points

type Points []Point

func (Points) Len

func (pp Points) Len() int

func (Points) Less

func (pp Points) Less(i, j int) bool

func (Points) String

func (pp Points) String() string

func (Points) Swap

func (pp Points) Swap(i, j int)

type ProtocolVersion

type ProtocolVersion struct {
	Major uint32
	Minor uint32
	Patch uint32 `json:"patch,omitempty"`
}

type Response

type Response struct {
	Type        string          `json:"type,omitempty"        dynamodbav:"type,omitempty"`
	Version     string          `json:"version,omitempty"     dynamodbav:"version,omitempty"`
	ServiceName string          `json:"servicename,omitempty" dynamodbav:"servicename,omitempty"`
	MethodName  string          `json:"methodname,omitempty"  dynamodbav:"methodname,omitempty"`
	Result      *Result         `json:"result,omitempty"      dynamodbav:"result,omitempty"`
	Reflection  json.RawMessage `json:"reflection,omitempty"  dynamodbav:"reflection,omitempty"`
}

type Result

type Result struct {
	IntersectionFound    *IntersectionFound    `json:",omitempty" dynamodbav:",omitempty"`
	IntersectionNotFound *IntersectionNotFound `json:",omitempty" dynamodbav:",omitempty"`
	RollForward          *RollForward          `json:",omitempty" dynamodbav:",omitempty"`
	RollBackward         *RollBackward         `json:",omitempty" dynamodbav:",omitempty"`
}

type RollBackward

type RollBackward struct {
	Point Point `json:"point,omitempty" dynamodbav:"point,omitempty"`
	Tip   Point `json:"tip,omitempty"   dynamodbav:"tip,omitempty"`
}

type RollForward

type RollForward struct {
	Block RollForwardBlock `json:"block,omitempty" dynamodbav:"block,omitempty"`
	Tip   Point            `json:"tip,omitempty"   dynamodbav:"tip,omitempty"`
}

type RollForwardBlock

type RollForwardBlock struct {
	Allegra *Block      `json:"allegra,omitempty" dynamodbav:"allegra,omitempty"`
	Alonzo  *Block      `json:"alonzo,omitempty"  dynamodbav:"alonzo,omitempty"`
	Babbage *Block      `json:"babbage,omitempty" dynamodbav:"babbage,omitempty"`
	Byron   *ByronBlock `json:"byron,omitempty"   dynamodbav:"byron,omitempty"`
	Mary    *Block      `json:"mary,omitempty"    dynamodbav:"mary,omitempty"`
	Shelley *Block      `json:"shelley,omitempty" dynamodbav:"shelley,omitempty"`
}

func (RollForwardBlock) AlonzoOrGreaterBlock

func (r RollForwardBlock) AlonzoOrGreaterBlock() *Block

func (RollForwardBlock) Era

func (r RollForwardBlock) Era() Era

func (RollForwardBlock) PointStruct

func (r RollForwardBlock) PointStruct() PointStruct

type Tx

type Tx struct {
	ID          string          `json:"id,omitempty"       dynamodbav:"id,omitempty"`
	InputSource string          `json:"inputSource,omitempty"  dynamodbav:"inputSource,omitempty"`
	Body        TxBody          `json:"body,omitempty"     dynamodbav:"body,omitempty"`
	Witness     Witness         `json:"witness,omitempty"  dynamodbav:"witness,omitempty"`
	Metadata    json.RawMessage `json:"metadata,omitempty" dynamodbav:"metadata,omitempty"`
	// Raw serialized transaction, base64.
	Raw string `json:"raw,omitempty" dynamodbav:"raw,omitempty"`
}

type TxBody

type TxBody struct {
	Certificates            []json.RawMessage `json:"certificates,omitempty"            dynamodbav:"certificates,omitempty"`
	Collaterals             []TxIn            `json:"collaterals,omitempty"             dynamodbav:"collaterals,omitempty"`
	Fee                     num.Int           `json:"fee,omitempty"                     dynamodbav:"fee,omitempty"`
	Inputs                  []TxIn            `json:"inputs,omitempty"                  dynamodbav:"inputs,omitempty"`
	Mint                    *Value            `json:"mint,omitempty"                    dynamodbav:"mint,omitempty"`
	Network                 json.RawMessage   `json:"network,omitempty"                 dynamodbav:"network,omitempty"`
	Outputs                 TxOuts            `json:"outputs,omitempty"                 dynamodbav:"outputs,omitempty"`
	RequiredExtraSignatures []string          `json:"requiredExtraSignatures,omitempty" dynamodbav:"requiredExtraSignatures,omitempty"`
	ScriptIntegrityHash     string            `json:"scriptIntegrityHash,omitempty"     dynamodbav:"scriptIntegrityHash,omitempty"`
	TimeToLive              int64             `json:"timeToLive,omitempty"              dynamodbav:"timeToLive,omitempty"`
	Update                  json.RawMessage   `json:"update,omitempty"                  dynamodbav:"update,omitempty"`
	ValidityInterval        ValidityInterval  `json:"validityInterval"                  dynamodbav:"validityInterval,omitempty"`
	Withdrawals             map[string]int64  `json:"withdrawals,omitempty"             dynamodbav:"withdrawals,omitempty"`
	CollateralReturn        *TxOut            `json:"collateralReturn,omitempty"        dynamodbav:"collateralReturn,omitempty"`
	TotalCollateral         *int64            `json:"totalCollateral,omitempty"         dynamodbav:"totalCollateral,omitempty"`
	References              []TxIn            `json:"references,omitempty"              dynamodbav:"references,omitempty"`
}

type TxID

type TxID string

func NewTxID

func NewTxID(txHash string, index int) TxID

func (TxID) Index

func (t TxID) Index() int

func (TxID) String

func (t TxID) String() string

func (TxID) TxHash

func (t TxID) TxHash() string

type TxIn

type TxIn struct {
	TxHash string `json:"txId"  dynamodbav:"txId"`
	Index  int    `json:"index" dynamodbav:"index"`
}

func (TxIn) String

func (t TxIn) String() string

func (TxIn) TxID

func (t TxIn) TxID() TxID

type TxOut

type TxOut struct {
	Address   string          `json:"address,omitempty"   dynamodbav:"address,omitempty"`
	Datum     string          `json:"datum,omitempty"     dynamodbav:"datum,omitempty"`
	DatumHash string          `json:"datumHash,omitempty" dynamodbav:"datumHash,omitempty"`
	Value     Value           `json:"value,omitempty"     dynamodbav:"value,omitempty"`
	Script    json.RawMessage `json:"script,omitempty"    dynamodbav:"script,omitempty"`
}

type TxOuts

type TxOuts []TxOut

func (TxOuts) FindByAssetID

func (tt TxOuts) FindByAssetID(assetID AssetID) (TxOut, bool)

type ValidityInterval

type ValidityInterval struct {
	InvalidBefore    uint64 `json:"invalidBefore,omitempty"    dynamodbav:"invalidBefore,omitempty"`
	InvalidHereafter uint64 `json:"invalidHereafter,omitempty" dynamodbav:"invalidHereafter,omitempty"`
}

type Value

type Value struct {
	Coins  num.Int             `json:"coins,omitempty"  dynamodbav:"coins,omitempty"`
	Assets map[AssetID]num.Int `json:"assets,omitempty" dynamodbav:"assets,omitempty"`
}

func Add added in v0.7.7

func Add(a Value, b Value) Value

func Subtract added in v0.7.7

func Subtract(a Value, b Value) Value

type Witness

type Witness struct {
	Bootstrap  []json.RawMessage `json:"bootstrap,omitempty"  dynamodbav:"bootstrap,omitempty"`
	Datums     Datums            `json:"datums,omitempty"     dynamodbav:"datums,omitempty"`
	Redeemers  json.RawMessage   `json:"redeemers,omitempty"  dynamodbav:"redeemers,omitempty"`
	Scripts    json.RawMessage   `json:"scripts,omitempty"    dynamodbav:"scripts,omitempty"`
	Signatures map[string]string `json:"signatures,omitempty" dynamodbav:"signatures,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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