types

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepHash

func DeepHash(data []any) [48]byte

func Max

func Max[T constraints.Ordered](s ...T) T

Types

type BalanceResponse

type BalanceResponse struct {
	Balance string `json:"balance"`
}

func (BalanceResponse) ToBigInt

func (b BalanceResponse) ToBigInt() *big.Int

type Base64String

type Base64String []byte

func (Base64String) Base64

func (self Base64String) Base64() string

func (Base64String) Bytes

func (self Base64String) Bytes() []byte

func (*Base64String) Decode

func (self *Base64String) Decode(s string) error

func (Base64String) Head

func (self Base64String) Head(i int) []byte

func (Base64String) MarshalJSON

func (self Base64String) MarshalJSON() (out []byte, err error)

func (*Base64String) MarshalTo

func (self *Base64String) MarshalTo(buf []byte) (n int, err error)

func (*Base64String) Scan

func (self *Base64String) Scan(src interface{}) error

func (Base64String) Size

func (self Base64String) Size() int

func (*Base64String) Unmarshal

func (self *Base64String) Unmarshal(buf []byte) error

func (*Base64String) UnmarshalJSON

func (self *Base64String) UnmarshalJSON(data []byte) error

func (Base64String) Value

func (self Base64String) Value() (driver.Value, error)

type BigInt

type BigInt struct {
	big.Int
	Valid bool
}

func (BigInt) MarshalJSON

func (b BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalJSON

func (b *BigInt) UnmarshalJSON(p []byte) error

type Buffer

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

func NewBuffer

func NewBuffer(buf []byte) *Buffer

func (*Buffer) Write

func (self *Buffer) Write(data []byte) (n int, err error)

type BundleItem

type BundleItem struct {
	SignatureType signer.SignatureType `json:"signature_type"`
	Signature     Base64String         `json:"signature"`
	Owner         Base64String         `json:"owner"`  //  utils.Base64Encode(pubkey)
	Target        Base64String         `json:"target"` // optional, if exist must length 32, and is base64 str
	Anchor        Base64String         `json:"anchor"` // optional, if exist must length 32, and is base64 str
	Tags          Tags                 `json:"tags"`
	Data          Base64String         `json:"data"`
	Id            Base64String         `json:"id"`
	// contains filtered or unexported fields
}

func (*BundleItem) Encode

func (self *BundleItem) Encode(out io.Writer) (err error)

func (*BundleItem) GetTag

func (self *BundleItem) GetTag(name string) (value string, found bool)

func (*BundleItem) IsSigned

func (self *BundleItem) IsSigned() bool

func (BundleItem) Marshal

func (self BundleItem) Marshal() ([]byte, error)

func (BundleItem) MarshalJSON

func (self BundleItem) MarshalJSON() ([]byte, error)

func (BundleItem) MarshalTo

func (self BundleItem) MarshalTo(buf []byte) (n int, err error)

func (*BundleItem) NestBundles

func (self *BundleItem) NestBundles(dataItems []*BundleItem) (err error)

func (*BundleItem) Reader

func (self *BundleItem) Reader() (out *bytes.Buffer, err error)

func (*BundleItem) Sign

func (self *BundleItem) Sign(signer signer.Signer) (err error)

func (*BundleItem) Size

func (self *BundleItem) Size() (out int)

func (*BundleItem) String

func (self *BundleItem) String() string

func (*BundleItem) Unmarshal

func (self *BundleItem) Unmarshal(buf []byte) (err error)

func (*BundleItem) UnmarshalFromReader

func (self *BundleItem) UnmarshalFromReader(reader io.Reader) (err error)

Reverse operation of Reader

func (*BundleItem) UnmarshalJSON

func (self *BundleItem) UnmarshalJSON(data []byte) error

func (*BundleItem) VerifySignature

func (self *BundleItem) VerifySignature() (err error)

type Chunk added in v0.5.0

type Chunk struct {
	ID     string
	Offset int64
	Data   []byte
}

type ChunkInfoResponse added in v0.5.7

type ChunkInfoResponse struct {
	Chunks []int `json:"chunks"`
	Total  int   `json:"total"`
}

type ChunkResponse added in v0.5.0

type ChunkResponse struct {
	ID  string
	Min int
	Max int
}

type File

type File struct {
	Data          io.ReadCloser
	Header        http.Header
	ContentLength int64
	ContentType   string
}

type Job added in v0.5.0

type Job struct {
	Chunk Chunk
	Index int
}

type NodeInfo

type NodeInfo struct {
	Version   string            `json:"version"`
	Addresses map[string]string `json:"addresses"`
	Gateway   string            `json:"gateway"`
}

type Receipt added in v0.5.6

type Receipt struct {
	Signature      string `json:"signature"`
	Timestamp      int64  `json:"timestamp"`
	Version        string `json:"version"`
	DeadlineHeight int    `json:"deadlineHeight"`
}

type ReceiptResponse added in v0.5.6

type ReceiptResponse struct {
	Data struct {
		Transactions struct {
			Edges []struct {
				Node struct {
					Receipt struct {
						Signature      string `json:"signature"`
						Timestamp      int64  `json:"timestamp"`
						Version        string `json:"version"`
						DeadlineHeight int    `json:"deadlineHeight"`
					} `json:"receipt"`
				} `json:"node"`
			} `json:"edges"`
		} `json:"transactions"`
	} `json:"data"`
}

type RewardAddr

type RewardAddr []byte

func (RewardAddr) Bytes

func (self RewardAddr) Bytes() []byte

func (*RewardAddr) IsUnclaimed

func (self *RewardAddr) IsUnclaimed() bool

func (*RewardAddr) UnmarshalJSON

func (self *RewardAddr) UnmarshalJSON(data []byte) error

type Tag

type Tag struct {
	Name  string `json:"name" avro:"name"`
	Value string `json:"value" avro:"value"`
}

type Tags

type Tags []Tag

func (Tags) Append

func (self Tags) Append(tags []Tag) Tags

func (Tags) Marshal

func (self Tags) Marshal() ([]byte, error)

func (Tags) Size

func (self Tags) Size() int

func (Tags) Unmarshal

func (self Tags) Unmarshal(data []byte) error

type TopUpConfirmation

type TopUpConfirmation struct {
	Confirmed bool     `json:"confirmed"`
	Hash      string   `json:"hash"`
	Balance   *big.Int `json:"balance"`
}

type TopUpConfirmationResponse

type TopUpConfirmationResponse struct {
	Confirmed bool `json:"confirmed"`
}

type Transaction

type Transaction struct {
	ID        string `json:"id"`
	Currency  string `json:"currency"`
	Address   string `json:"address"`
	Owner     string `json:"owner"`
	Signature string `json:"signature"`
	Target    string `json:"target"`
	Tags      []Tag  `json:"tags"`
	Anchor    string `json:"anchor"`
	DataSize  string `json:"data_size"`
	RawSize   string `json:"raw_size"`
}

type TxToBalanceRequest

type TxToBalanceRequest struct {
	TxId string `json:"tx_id"`
}

Jump to

Keyboard shortcuts

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