contract

package
v0.0.0-...-dcea795 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCallContractItems           = runtime.MaxContractCallItems
	MaxCallContractItemsTotalBytes = runtime.MaxContractCallItemsTotalBytes
)
View Source
const MaxContractSourceBytes = runtime.MaxTypedContractSourceBytes

Variables

View Source
var (
	CallContractFactHint = hint.MustNewHint("mitum-contract-call-operation-fact-v0.0.1")
	CallContractHint     = hint.MustNewHint("mitum-contract-call-operation-v0.0.1")
	CallContractItemHint = hint.MustNewHint("mitum-contract-call-item-v0.0.1")
)
View Source
var (
	RegisterContractFactHint = hint.MustNewHint("mitum-contract-register-operation-fact-v0.0.1")
	RegisterContractHint     = hint.MustNewHint("mitum-contract-register-operation-v0.0.1")
)

Functions

func NewRegisterContractProcessor

func NewRegisterContractProcessor(encs encoder.Encoders) ctypes.GetNewProcessorWithProposal

Types

type CallContract

type CallContract struct {
	common.BaseOperation
}

func NewCallContract

func NewCallContract(fact CallContractFact) (CallContract, error)

func (*CallContract) DecodeBSON

func (op *CallContract) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CallContract) DecodeJSON

func (op *CallContract) DecodeJSON(b []byte, enc encoder.Encoder) error

func (CallContract) MarshalBSON

func (op CallContract) MarshalBSON() ([]byte, error)

func (CallContract) MarshalJSON

func (op CallContract) MarshalJSON() ([]byte, error)

type CallContractFact

type CallContractFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewCallContractFact

func NewCallContractFact(
	token []byte, sender, contract base.Address, callData map[string]string, currency types.CurrencyID,
) CallContractFact

func NewCallContractFactWithItems

func NewCallContractFactWithItems(
	token []byte, sender, contract base.Address, items []CallContractItem, currency types.CurrencyID,
) CallContractFact

func (CallContractFact) Addresses

func (fact CallContractFact) Addresses() ([]base.Address, error)

func (CallContractFact) Bytes

func (fact CallContractFact) Bytes() []byte

func (CallContractFact) CallData

func (fact CallContractFact) CallData() map[string]string

func (CallContractFact) Contract

func (fact CallContractFact) Contract() base.Address

func (*CallContractFact) DecodeBSON

func (fact *CallContractFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CallContractFact) DecodeJSON

func (fact *CallContractFact) DecodeJSON(b []byte, enc encoder.Encoder) error

func (CallContractFact) GenerateHash

func (fact CallContractFact) GenerateHash() util.Hash

func (CallContractFact) Hash

func (fact CallContractFact) Hash() util.Hash

func (CallContractFact) IsValid

func (fact CallContractFact) IsValid(b []byte) error

func (CallContractFact) Items

func (fact CallContractFact) Items() []CallContractItem

func (CallContractFact) MarshalBSON

func (fact CallContractFact) MarshalBSON() ([]byte, error)

func (CallContractFact) MarshalJSON

func (fact CallContractFact) MarshalJSON() ([]byte, error)

func (CallContractFact) Sender

func (fact CallContractFact) Sender() base.Address

func (CallContractFact) Token

func (fact CallContractFact) Token() base.Token

type CallContractFactBSONUnmarshaler

type CallContractFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Sender   string   `bson:"sender"`
	Contract string   `bson:"contract"`
	CallData bson.Raw `bson:"call_data"`
	Items    bson.Raw `bson:"items"`
	Currency string   `bson:"currency"`
}

type CallContractFactJSONMarshaler

type CallContractFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender   base.Address       `json:"sender"`
	Contract base.Address       `json:"contract"`
	CallData map[string]string  `json:"call_data,omitempty"`
	Items    []CallContractItem `json:"items,omitempty"`
	Currency types.CurrencyID   `json:"currency"`
}

type CallContractFactJSONUnmarshaler

type CallContractFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender   string           `json:"sender"`
	Contract string           `json:"contract"`
	CallData *json.RawMessage `json:"call_data"`
	Items    *json.RawMessage `json:"items"`
	Currency string           `json:"currency"`
}

type CallContractItem

type CallContractItem struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewCallContractItem

func NewCallContractItem(function string, callData map[string]string) CallContractItem

func (CallContractItem) Bytes

func (it CallContractItem) Bytes() []byte

func (CallContractItem) CallData

func (it CallContractItem) CallData() map[string]string

func (*CallContractItem) DecodeBSON

func (it *CallContractItem) DecodeBSON(b []byte, _ *bsonenc.Encoder) error

func (*CallContractItem) DecodeJSON

func (it *CallContractItem) DecodeJSON(b []byte, enc encoder.Encoder) error

func (CallContractItem) Function

func (it CallContractItem) Function() string

func (CallContractItem) IsValid

func (it CallContractItem) IsValid([]byte) error

func (CallContractItem) MarshalBSON

func (it CallContractItem) MarshalBSON() ([]byte, error)

func (CallContractItem) MarshalJSON

func (it CallContractItem) MarshalJSON() ([]byte, error)

func (CallContractItem) Rebuild

func (it CallContractItem) Rebuild() CallContractItem

func (*CallContractItem) UnmarshalBSON

func (it *CallContractItem) UnmarshalBSON(b []byte) error

func (*CallContractItem) UnmarshalJSON

func (it *CallContractItem) UnmarshalJSON(b []byte) error

type CallContractItemBSONUnmarshaler

type CallContractItemBSONUnmarshaler struct {
	Hint     string            `bson:"_hint"`
	Function string            `bson:"function"`
	CallData map[string]string `bson:"call_data"`
}

type CallContractItemJSONMarshaler

type CallContractItemJSONMarshaler struct {
	hint.BaseHinter
	Function string            `json:"function"`
	CallData map[string]string `json:"call_data"`
}

type CallContractItemJSONUnmarshaler

type CallContractItemJSONUnmarshaler struct {
	Hint     string            `json:"_hint"`
	Function string            `json:"function"`
	CallData map[string]string `json:"call_data"`
}

type CallContractProcessor

type CallContractProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*CallContractProcessor) Close

func (opp *CallContractProcessor) Close() error

func (*CallContractProcessor) PreProcess

func (*CallContractProcessor) Process

type RegisterContract

type RegisterContract struct {
	common.BaseOperation
}

func NewRegisterContract

func NewRegisterContract(fact RegisterContractFact) (RegisterContract, error)

func (*RegisterContract) DecodeBSON

func (op *RegisterContract) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*RegisterContract) DecodeJSON

func (op *RegisterContract) DecodeJSON(b []byte, enc encoder.Encoder) error

func (RegisterContract) MarshalBSON

func (op RegisterContract) MarshalBSON() ([]byte, error)

func (RegisterContract) MarshalJSON

func (op RegisterContract) MarshalJSON() ([]byte, error)

type RegisterContractFact

type RegisterContractFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewRegisterContractFact

func NewRegisterContractFact(token []byte, sender, contract base.Address, code string, callData map[string]string, currency ctypes.CurrencyID) RegisterContractFact

func (RegisterContractFact) Addresses

func (fact RegisterContractFact) Addresses() ([]base.Address, error)

func (RegisterContractFact) Bytes

func (fact RegisterContractFact) Bytes() []byte

func (RegisterContractFact) Contract

func (fact RegisterContractFact) Contract() base.Address

func (RegisterContractFact) ContractCode

func (fact RegisterContractFact) ContractCode() string

func (*RegisterContractFact) DecodeBSON

func (fact *RegisterContractFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*RegisterContractFact) DecodeJSON

func (fact *RegisterContractFact) DecodeJSON(b []byte, enc encoder.Encoder) error

func (RegisterContractFact) GenerateHash

func (fact RegisterContractFact) GenerateHash() util.Hash

func (RegisterContractFact) Hash

func (fact RegisterContractFact) Hash() util.Hash

func (RegisterContractFact) IsValid

func (fact RegisterContractFact) IsValid(b []byte) error

func (RegisterContractFact) MarshalBSON

func (fact RegisterContractFact) MarshalBSON() ([]byte, error)

func (RegisterContractFact) MarshalJSON

func (fact RegisterContractFact) MarshalJSON() ([]byte, error)

func (RegisterContractFact) Sender

func (fact RegisterContractFact) Sender() base.Address

func (RegisterContractFact) Token

func (fact RegisterContractFact) Token() base.Token

type RegisterContractFactJSONMarshaler

type RegisterContractFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender   base.Address      `json:"sender"`
	Contract base.Address      `json:"contract"`
	Code     string            `json:"code"`
	CallData map[string]string `json:"init_data"`
	Currency ctypes.CurrencyID `json:"currency"`
}

type RegisterContractFactJSONUnmarshaler

type RegisterContractFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender   string            `json:"sender"`
	Contract string            `json:"contract"`
	Code     string            `json:"code"`
	CallData map[string]string `json:"init_data"`
	Currency string            `json:"currency"`
}

type RegisterContractProcessor

type RegisterContractProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*RegisterContractProcessor) Close

func (opp *RegisterContractProcessor) Close() error

func (*RegisterContractProcessor) PreProcess

func (*RegisterContractProcessor) Process

type RegisterModelFactBSONUnmarshaler

type RegisterModelFactBSONUnmarshaler struct {
	Hint     string            `bson:"_hint"`
	Sender   string            `bson:"sender"`
	Contract string            `bson:"contract"`
	Code     string            `bson:"code"`
	CallData map[string]string `bson:"init_data"`
	Currency string            `bson:"currency"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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