types

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const AddressLength = 32

AddressLength is expected bytes len for business entity Address

Variables

This section is empty.

Functions

func ConvertToAsset

func ConvertToAsset(in []*MultiSwapAsset) ([]*pb.Asset, error)

ConvertToAsset converts MultiSwapAsset to Asset

func IsValidAddressLen

func IsValidAddressLen(val []byte) bool

IsValidAddressLen checks if address length is valid

Types

type Address

type Address pb.Address

Address might be more complicated structure contains fields like isIndustrial bool or isMultisig bool

func AddrFromBase58Check

func AddrFromBase58Check(in string) (*Address, error)

AddrFromBase58Check creates address from base58 string

func AddrFromBytes

func AddrFromBytes(in []byte) *Address

AddrFromBytes creates address from bytes

func (*Address) Bytes

func (a *Address) Bytes() []byte

Bytes returns address bytes

func (*Address) CheckWithStub added in v0.0.4

func (a *Address) CheckWithStub(stub shim.ChaincodeStubInterface) error

CheckWithStub checks if the address is blacklisted by querying the account information from the provided ChaincodeStubInterface.

func (*Address) Empty added in v0.0.6

func (a *Address) Empty() bool

Empty return true if len(a.Address) == 0

func (*Address) Equal

func (a *Address) Equal(b *Address) bool

Equal compares two addresses

func (*Address) IsUserIDSame

func (a *Address) IsUserIDSame(b *Address) bool

IsUserIDSame checks if userIDs are the same

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

MarshalJSON marshals address to json

func (*Address) String

func (a *Address) String() string

String returns address string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals address from json

func (*Address) UnmarshalText added in v0.0.2

func (a *Address) UnmarshalText(text []byte) error

type BytesDecoder added in v0.0.3

type BytesDecoder interface {
	DecodeFromBytes([]byte) error
}

BytesDecoder defines an interface for decoding an object from bytes.

type BytesEncoder added in v0.0.3

type BytesEncoder interface {
	EncodeToBytes() ([]byte, error)
}

BytesEncoder defines an interface for encoding an object to bytes.

type Checker added in v0.0.4

type Checker interface {
	Check() error
}

Checker is an interface that can be implemented by types that can check themselves.

type CheckerWithStub added in v0.0.4

type CheckerWithStub interface {
	CheckWithStub(stub shim.ChaincodeStubInterface) error
}

CheckerWithStub is an interface that can be implemented by types that can check themselves.

type Hex

type Hex []byte

Hex is a wrapper for []byte

func (*Hex) UnmarshalText added in v0.0.2

func (h *Hex) UnmarshalText(text []byte) error

type MultiSwapAsset

type MultiSwapAsset struct {
	Group  string `json:"group,omitempty"`
	Amount string `json:"amount,omitempty"`
}

MultiSwapAsset is a wrapper for asset

type MultiSwapAssets

type MultiSwapAssets struct {
	Assets []*MultiSwapAsset
}

MultiSwapAssets is a wrapper for asset

type Sender

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

Sender is a wrapper for address

func NewSenderFromAddr

func NewSenderFromAddr(addr *Address) *Sender

NewSenderFromAddr creates sender from address

func (*Sender) Address

func (s *Sender) Address() *Address

Address returns address

func (*Sender) Equal

func (s *Sender) Equal(addr *Address) bool

Equal compares two senders

func (*Sender) UnmarshalText added in v0.0.2

func (s *Sender) UnmarshalText(text []byte) error

type StubBytesDecoder added in v0.0.3

type StubBytesDecoder interface {
	DecodeFromBytesWithStub(shim.ChaincodeStubInterface, []byte) error
}

BytesDecoder defines an interface for decoding an object from bytes with a stub.

type StubBytesEncoder added in v0.0.3

type StubBytesEncoder interface {
	EncodeToBytesWithStub(shim.ChaincodeStubInterface) ([]byte, error)
}

BytesEncoder defines an interface for encoding an object to bytes with a stub.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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