token

package
v0.0.0-...-1b25507 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApproveFactHint = hint.MustNewHint("mitum-token-approve-operation-fact-v0.0.1")
	ApproveHint     = hint.MustNewHint("mitum-token-approve-operation-v0.0.1")
)
View Source
var (
	BurnFactHint = hint.MustNewHint("mitum-token-burn-operation-fact-v0.0.1")
	BurnHint     = hint.MustNewHint("mitum-token-burn-operation-v0.0.1")
)
View Source
var (
	MintFactHint = hint.MustNewHint("mitum-token-mint-operation-fact-v0.0.1")
	MintHint     = hint.MustNewHint("mitum-token-mint-operation-v0.0.1")
)
View Source
var (
	RegisterModelFactHint = hint.MustNewHint("mitum-token-register-model-operation-fact-v0.0.1")
	RegisterModelHint     = hint.MustNewHint("mitum-token-register-model-operation-v0.0.1")
)
View Source
var (
	TransferFactHint = hint.MustNewHint("mitum-token-transfer-operation-fact-v0.0.1")
	TransferHint     = hint.MustNewHint("mitum-token-transfer-operation-v0.0.1")
)
View Source
var (
	TransferFromFactHint = hint.MustNewHint("mitum-token-transfer-from-operation-fact-v0.0.1")
	TransferFromHint     = hint.MustNewHint("mitum-token-transfer-from-operation-v0.0.1")
)
View Source
var ApproveItemHint = hint.MustNewHint("mitum-token-approve-item-v0.0.1")
View Source
var MaxApproveItems = 100
View Source
var MaxTransferFromItems = 100
View Source
var MaxTransferItems = 100
View Source
var TransferFromItemHint = hint.MustNewHint("mitum-token-transfer-from-item-v0.0.1")
View Source
var TransferItemHint = hint.MustNewHint("mitum-token-transfer-item-v0.0.1")

Functions

func ErrBaseOperationProcess

func ErrBaseOperationProcess(e error, formatter string, args ...interface{}) base.BaseOperationProcessReasonError

func ErrStateNotFound

func ErrStateNotFound(name string, k string, e error) base.BaseOperationProcessReasonError

func ErrStringProcess

func ErrStringProcess(t any) string

func NewApproveProcessor

func NewApproveProcessor() ctypes.GetNewProcessor

func NewBurnProcessor

func NewBurnProcessor() ctypes.GetNewProcessor

func NewMintProcessor

func NewMintProcessor() ctypes.GetNewProcessor

func NewRegisterModelProcessor

func NewRegisterModelProcessor() ctypes.GetNewProcessor

func NewTransferFromProcessor

func NewTransferFromProcessor() ctypes.GetNewProcessor

func NewTransferProcessor

func NewTransferProcessor() types.GetNewProcessor

func PrepareSenderTotalAmounts

func PrepareSenderTotalAmounts(
	holder string,
	required map[string]common.Big,
	getStateFunc base.GetStateFunc,
) (map[string]common.Big, error)

Types

type Approve

type Approve struct {
	extras.ExtendedOperation
}

func NewApprove

func NewApprove(fact ApproveFact) Approve

func (*Approve) DecodeBSON

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

func (*Approve) DecodeJSON

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

func (Approve) DupKey

func (op Approve) DupKey() (map[types.DuplicationKeyType][]string, error)

func (Approve) MarshalBSON

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

func (Approve) MarshalJSON

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

type ApproveFact

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

func NewApproveFact

func NewApproveFact(
	token []byte,
	sender base.Address,
	items []ApproveItem,
	currency types.CurrencyID,
) ApproveFact

func (ApproveFact) ActiveContract

func (fact ApproveFact) ActiveContract() []base.Address

func (ApproveFact) Addresses

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

func (ApproveFact) Bytes

func (fact ApproveFact) Bytes() []byte

func (ApproveFact) Currency

func (fact ApproveFact) Currency() types.CurrencyID

func (*ApproveFact) DecodeBSON

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

func (*ApproveFact) DecodeJSON

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

func (ApproveFact) DupKey

func (fact ApproveFact) DupKey() (map[types.DuplicationKeyType][]string, error)

func (ApproveFact) FactUser

func (fact ApproveFact) FactUser() base.Address

func (ApproveFact) FeeBase

func (fact ApproveFact) FeeBase() (types.CurrencyID, int, int, bool)

func (ApproveFact) FeePayer

func (fact ApproveFact) FeePayer() base.Address

func (ApproveFact) GenerateHash

func (fact ApproveFact) GenerateHash() util.Hash

func (ApproveFact) IsValid

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

func (ApproveFact) Items

func (fact ApproveFact) Items() []ApproveItem

func (ApproveFact) MarshalBSON

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

func (ApproveFact) MarshalJSON

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

func (ApproveFact) Sender

func (fact ApproveFact) Sender() base.Address

func (ApproveFact) Signer

func (fact ApproveFact) Signer() base.Address

func (ApproveFact) Token

func (fact ApproveFact) Token() base.Token

type ApproveFactBSONUnmarshaler

type ApproveFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Sender   string   `bson:"sender"`
	Items    bson.Raw `bson:"items"`
	Currency string   `bson:"currency"`
}

type ApproveFactJSONMarshaler

type ApproveFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender   base.Address     `json:"sender"`
	Items    []ApproveItem    `json:"items"`
	Currency types.CurrencyID `json:"currency"`
}

type ApproveFactJSONUnmarshaler

type ApproveFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender   string          `json:"sender"`
	Items    json.RawMessage `json:"items"`
	Currency string          `json:"currency"`
}

type ApproveItem

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

func NewApproveItem

func NewApproveItem(contract base.Address, approved base.Address, amount common.Big) ApproveItem

func (ApproveItem) Addresses

func (it ApproveItem) Addresses() ([]base.Address, error)

func (ApproveItem) Amount

func (it ApproveItem) Amount() common.Big

func (ApproveItem) Approved

func (it ApproveItem) Approved() base.Address

func (ApproveItem) Bytes

func (it ApproveItem) Bytes() []byte

func (ApproveItem) Contract

func (it ApproveItem) Contract() base.Address

func (*ApproveItem) DecodeBSON

func (it *ApproveItem) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*ApproveItem) DecodeJSON

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

func (ApproveItem) IsValid

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

func (ApproveItem) MarshalBSON

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

func (ApproveItem) MarshalJSON

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

type ApproveItemProcessor

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

func (*ApproveItemProcessor) Close

func (opp *ApproveItemProcessor) Close()

func (*ApproveItemProcessor) PreProcess

func (opp *ApproveItemProcessor) PreProcess(
	_ context.Context, _ base.Operation, getStateFunc base.GetStateFunc,
) error

func (*ApproveItemProcessor) Process

func (opp *ApproveItemProcessor) Process(
	_ context.Context, _ base.Operation, getStateFunc base.GetStateFunc,
) ([]base.StateMergeValue, error)

type ApproveProcessor

type ApproveProcessor struct {
	*base.BaseOperationProcessor
}

func (*ApproveProcessor) Close

func (opp *ApproveProcessor) Close() error

func (*ApproveProcessor) PreProcess

func (*ApproveProcessor) Process

type ApprovesItemBSONUnmarshaler

type ApprovesItemBSONUnmarshaler struct {
	Hint     string `bson:"_hint"`
	Contract string `bson:"contract"`
	Approved string `bson:"approved"`
	Amount   string `bson:"amount"`
}

type ApprovesItemJSONMarshaler

type ApprovesItemJSONMarshaler struct {
	hint.BaseHinter
	Contract base.Address `json:"contract"`
	Approved base.Address `json:"approved"`
	Amount   string       `json:"amount"`
}

type ApprovesItemJSONUnmarshaler

type ApprovesItemJSONUnmarshaler struct {
	Hint     hint.Hint `json:"_hint"`
	Contract string    `json:"contract"`
	Approved string    `json:"approved"`
	Amount   string    `json:"amount"`
}

type Burn

type Burn struct {
	extras.ExtendedOperation
}

func NewBurn

func NewBurn(fact BurnFact) Burn

func (*Burn) DecodeBSON

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

func (*Burn) DecodeJSON

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

func (Burn) DupKey

func (op Burn) DupKey() (map[types.DuplicationKeyType][]string, error)

func (Burn) MarshalJSON

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

type BurnFact

type BurnFact struct {
	TokenFact
	// contains filtered or unexported fields
}

func NewBurnFact

func NewBurnFact(
	token []byte,
	sender, contract base.Address,
	currency types.CurrencyID,
	target base.Address,
	amount common.Big,
) BurnFact

func (BurnFact) ActiveContract

func (fact BurnFact) ActiveContract() []base.Address

func (BurnFact) Addresses

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

func (BurnFact) Amount

func (fact BurnFact) Amount() common.Big

func (BurnFact) Bytes

func (fact BurnFact) Bytes() []byte

func (*BurnFact) DecodeBSON

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

func (*BurnFact) DecodeJSON

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

func (BurnFact) DupKey

func (fact BurnFact) DupKey() (map[types.DuplicationKeyType][]string, error)

func (BurnFact) GenerateHash

func (fact BurnFact) GenerateHash() util.Hash

func (BurnFact) IsValid

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

func (BurnFact) MarshalBSON

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

func (BurnFact) MarshalJSON

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

func (BurnFact) Target

func (fact BurnFact) Target() base.Address

type BurnFactBSONUnmarshaler

type BurnFactBSONUnmarshaler struct {
	Target string `bson:"target"`
	Amount string `bson:"amount"`
}

type BurnFactJSONMarshaler

type BurnFactJSONMarshaler struct {
	TokenFactJSONMarshaler
	Target base.Address `json:"target"`
	Amount common.Big   `json:"amount"`
}

type BurnFactJSONUnMarshaler

type BurnFactJSONUnMarshaler struct {
	Target string `json:"target"`
	Amount string `json:"amount"`
}

type BurnProcessor

type BurnProcessor struct {
	*base.BaseOperationProcessor
}

func (*BurnProcessor) Close

func (opp *BurnProcessor) Close() error

func (*BurnProcessor) PreProcess

func (*BurnProcessor) Process

type Mint

type Mint struct {
	extras.ExtendedOperation
}

func NewMint

func NewMint(fact MintFact) Mint

func (*Mint) DecodeBSON

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

func (*Mint) DecodeJSON

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

func (Mint) DupKey

func (op Mint) DupKey() (map[types.DuplicationKeyType][]string, error)

func (Mint) MarshalJSON

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

type MintFact

type MintFact struct {
	TokenFact
	// contains filtered or unexported fields
}

func NewMintFact

func NewMintFact(
	token []byte,
	sender, contract base.Address,
	currency types.CurrencyID,
	receiver base.Address,
	amount common.Big,
) MintFact

func (MintFact) ActiveContractOwnerHandlerOnly

func (fact MintFact) ActiveContractOwnerHandlerOnly() [][2]base.Address

func (MintFact) Addresses

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

func (MintFact) Amount

func (fact MintFact) Amount() common.Big

func (MintFact) Bytes

func (fact MintFact) Bytes() []byte

func (*MintFact) DecodeBSON

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

func (*MintFact) DecodeJSON

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

func (MintFact) DupKey

func (fact MintFact) DupKey() (map[types.DuplicationKeyType][]string, error)

func (MintFact) GenerateHash

func (fact MintFact) GenerateHash() util.Hash

func (MintFact) IsValid

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

func (MintFact) MarshalBSON

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

func (MintFact) MarshalJSON

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

func (MintFact) Receiver

func (fact MintFact) Receiver() base.Address

type MintFactBSONUnmarshaler

type MintFactBSONUnmarshaler struct {
	Receiver string `bson:"receiver"`
	Amount   string `bson:"amount"`
}

type MintFactJSONMarshaler

type MintFactJSONMarshaler struct {
	TokenFactJSONMarshaler
	Receiver base.Address `json:"receiver"`
	Amount   common.Big   `json:"amount"`
}

type MintFactJSONUnMarshaler

type MintFactJSONUnMarshaler struct {
	Receiver string `json:"receiver"`
	Amount   string `json:"amount"`
}

type MintProcessor

type MintProcessor struct {
	*base.BaseOperationProcessor
}

func (*MintProcessor) Close

func (opp *MintProcessor) Close() error

func (*MintProcessor) PreProcess

func (*MintProcessor) Process

type RegisterModel

type RegisterModel struct {
	extras.ExtendedOperation
}

func NewRegisterModel

func NewRegisterModel(fact RegisterModelFact) RegisterModel

func (*RegisterModel) DecodeBSON

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

func (*RegisterModel) DecodeJSON

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

func (RegisterModel) DupKey

func (op RegisterModel) DupKey() (map[ctypes.DuplicationKeyType][]string, error)

func (RegisterModel) MarshalJSON

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

type RegisterModelFact

type RegisterModelFact struct {
	TokenFact
	// contains filtered or unexported fields
}

func NewRegisterModelFact

func NewRegisterModelFact(
	token []byte,
	sender, contract base.Address,
	currency ctypes.CurrencyID,
	symbol types.TokenSymbol,
	name string,
	decimal common.Big,
	initialSupply common.Big,
) RegisterModelFact

func (RegisterModelFact) Bytes

func (fact RegisterModelFact) Bytes() []byte

func (RegisterModelFact) Decimal

func (fact RegisterModelFact) Decimal() common.Big

func (*RegisterModelFact) DecodeBSON

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

func (*RegisterModelFact) DecodeJSON

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

func (RegisterModelFact) DupKey

func (fact RegisterModelFact) DupKey() (map[ctypes.DuplicationKeyType][]string, error)

func (RegisterModelFact) GenerateHash

func (fact RegisterModelFact) GenerateHash() util.Hash

func (RegisterModelFact) InActiveContractOwnerHandlerOnly

func (fact RegisterModelFact) InActiveContractOwnerHandlerOnly() [][2]base.Address

func (RegisterModelFact) InitialSupply

func (fact RegisterModelFact) InitialSupply() common.Big

func (RegisterModelFact) IsValid

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

func (RegisterModelFact) MarshalBSON

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

func (RegisterModelFact) MarshalJSON

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

func (RegisterModelFact) Name

func (fact RegisterModelFact) Name() string

func (RegisterModelFact) Symbol

func (fact RegisterModelFact) Symbol() types.TokenSymbol

type RegisterModelFactBSONUnmarshaler

type RegisterModelFactBSONUnmarshaler struct {
	Symbol        string `bson:"symbol"`
	Name          string `bson:"name"`
	Decimal       string `bson:"decimal"`
	InitialSupply string `bson:"initial_supply"`
}

type RegisterModelFactJSONMarshaler

type RegisterModelFactJSONMarshaler struct {
	TokenFactJSONMarshaler
	Symbol        types.TokenSymbol `json:"symbol"`
	Name          string            `json:"name"`
	Decimal       common.Big        `json:"decimal"`
	InitialSupply common.Big        `json:"initial_supply"`
}

type RegisterModelFactJSONUnMarshaler

type RegisterModelFactJSONUnMarshaler struct {
	Symbol        string `json:"symbol"`
	Name          string `json:"name"`
	Decimal       string `json:"decimal"`
	InitialSupply string `json:"initial_supply"`
}

type RegisterModelProcessor

type RegisterModelProcessor struct {
	*base.BaseOperationProcessor
}

func (*RegisterModelProcessor) Close

func (opp *RegisterModelProcessor) Close() error

func (*RegisterModelProcessor) PreProcess

func (*RegisterModelProcessor) Process

type TestBurnProcessor

type TestBurnProcessor struct {
	*test.BaseTestOperationProcessorNoItem[Burn]
}

func NewTestBurnProcessor

func NewTestBurnProcessor(tp *test.TestProcessor) TestBurnProcessor

func (*TestBurnProcessor) Create

func (t *TestBurnProcessor) Create() *TestBurnProcessor

func (*TestBurnProcessor) Decode

func (t *TestBurnProcessor) Decode(fileName string) *TestBurnProcessor

func (*TestBurnProcessor) IsValid

func (t *TestBurnProcessor) IsValid() *TestBurnProcessor

func (*TestBurnProcessor) LoadOperation

func (t *TestBurnProcessor) LoadOperation(fileName string,
) *TestBurnProcessor

func (*TestBurnProcessor) MakeOperation

func (t *TestBurnProcessor) MakeOperation(
	sender base.Address, privatekey base.Privatekey, contract, target base.Address, amount int64, currency types.CurrencyID,
) *TestBurnProcessor

func (*TestBurnProcessor) Print

func (t *TestBurnProcessor) Print(fileName string,
) *TestBurnProcessor

func (*TestBurnProcessor) RunPreProcess

func (t *TestBurnProcessor) RunPreProcess() *TestBurnProcessor

func (*TestBurnProcessor) RunProcess

func (t *TestBurnProcessor) RunProcess() *TestBurnProcessor

func (*TestBurnProcessor) SetAccount

func (t *TestBurnProcessor) SetAccount(
	priv string, amount int64, cid types.CurrencyID, target []test.Account, inState bool,
) *TestBurnProcessor

func (*TestBurnProcessor) SetAmount

func (t *TestBurnProcessor) SetAmount(
	am int64, cid types.CurrencyID, target []types.Amount,
) *TestBurnProcessor

func (*TestBurnProcessor) SetContractAccount

func (t *TestBurnProcessor) SetContractAccount(
	owner base.Address, priv string, amount int64, cid types.CurrencyID, target []test.Account, inState bool,
) *TestBurnProcessor

func (*TestBurnProcessor) SetCurrency

func (t *TestBurnProcessor) SetCurrency(
	cid string, am int64, addr base.Address, target []types.CurrencyID, instate bool,
) *TestBurnProcessor

type TestMintProcessor

type TestMintProcessor struct {
	*test.BaseTestOperationProcessorNoItem[Mint]
}

func NewTestMintProcessor

func NewTestMintProcessor(tp *test.TestProcessor) TestMintProcessor

func (*TestMintProcessor) Create

func (t *TestMintProcessor) Create() *TestMintProcessor

func (*TestMintProcessor) Decode

func (t *TestMintProcessor) Decode(fileName string) *TestMintProcessor

func (*TestMintProcessor) IsValid

func (t *TestMintProcessor) IsValid() *TestMintProcessor

func (*TestMintProcessor) LoadOperation

func (t *TestMintProcessor) LoadOperation(fileName string,
) *TestMintProcessor

func (*TestMintProcessor) MakeOperation

func (t *TestMintProcessor) MakeOperation(
	sender base.Address, privatekey base.Privatekey, contract, receiver base.Address, amount int64, currency types.CurrencyID,
) *TestMintProcessor

func (*TestMintProcessor) Print

func (t *TestMintProcessor) Print(fileName string,
) *TestMintProcessor

func (*TestMintProcessor) RunPreProcess

func (t *TestMintProcessor) RunPreProcess() *TestMintProcessor

func (*TestMintProcessor) RunProcess

func (t *TestMintProcessor) RunProcess() *TestMintProcessor

func (*TestMintProcessor) SetAccount

func (t *TestMintProcessor) SetAccount(
	priv string, amount int64, cid types.CurrencyID, target []test.Account, inState bool,
) *TestMintProcessor

func (*TestMintProcessor) SetAmount

func (t *TestMintProcessor) SetAmount(
	am int64, cid types.CurrencyID, target []types.Amount,
) *TestMintProcessor

func (*TestMintProcessor) SetContractAccount

func (t *TestMintProcessor) SetContractAccount(
	owner base.Address, priv string, amount int64, cid types.CurrencyID, target []test.Account, inState bool,
) *TestMintProcessor

func (*TestMintProcessor) SetCurrency

func (t *TestMintProcessor) SetCurrency(
	cid string, am int64, addr base.Address, target []types.CurrencyID, instate bool,
) *TestMintProcessor

type TestRegisterTokenProcessor

type TestRegisterTokenProcessor struct {
	*test.BaseTestOperationProcessorNoItem[RegisterModel]
}

func NewTestRegisterTokenProcessor

func NewTestRegisterTokenProcessor(tp *test.TestProcessor) TestRegisterTokenProcessor

func (*TestRegisterTokenProcessor) Create

func (*TestRegisterTokenProcessor) Decode

func (*TestRegisterTokenProcessor) IsValid

func (*TestRegisterTokenProcessor) LoadOperation

func (t *TestRegisterTokenProcessor) LoadOperation(fileName string,
) *TestRegisterTokenProcessor

func (*TestRegisterTokenProcessor) MakeOperation

func (t *TestRegisterTokenProcessor) MakeOperation(
	sender base.Address, privatekey base.Privatekey, contract base.Address,
	symbol, name string, decimal, initialSupply int64, currency ctypes.CurrencyID,
) *TestRegisterTokenProcessor

func (*TestRegisterTokenProcessor) Print

func (*TestRegisterTokenProcessor) RunPreProcess

func (*TestRegisterTokenProcessor) RunProcess

func (*TestRegisterTokenProcessor) SetAccount

func (t *TestRegisterTokenProcessor) SetAccount(
	priv string, amount int64, cid ctypes.CurrencyID, target []test.Account, inState bool,
) *TestRegisterTokenProcessor

func (*TestRegisterTokenProcessor) SetAmount

func (*TestRegisterTokenProcessor) SetContractAccount

func (t *TestRegisterTokenProcessor) SetContractAccount(
	owner base.Address, priv string, amount int64, cid ctypes.CurrencyID, target []test.Account, inState bool,
) *TestRegisterTokenProcessor

func (*TestRegisterTokenProcessor) SetCurrency

func (t *TestRegisterTokenProcessor) SetCurrency(
	cid string, am int64, addr base.Address, target []ctypes.CurrencyID, instate bool,
) *TestRegisterTokenProcessor

type TokenFact

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

func NewTokenFact

func NewTokenFact(
	baseFact base.BaseFact,
	sender, contract base.Address,
	currency types.CurrencyID,
) TokenFact

func (TokenFact) Addresses

func (fact TokenFact) Addresses() []base.Address

func (TokenFact) Bytes

func (fact TokenFact) Bytes() []byte

func (TokenFact) Contract

func (fact TokenFact) Contract() base.Address

func (TokenFact) Currency

func (fact TokenFact) Currency() types.CurrencyID

func (*TokenFact) DecodeBSON

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

func (*TokenFact) DecodeJSON

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

func (TokenFact) FactUser

func (fact TokenFact) FactUser() base.Address

func (TokenFact) FeeBase

func (fact TokenFact) FeeBase() (types.CurrencyID, int, int, bool)

func (TokenFact) FeePayer

func (fact TokenFact) FeePayer() base.Address

func (TokenFact) IsValid

func (fact TokenFact) IsValid([]byte) error

func (TokenFact) JSONMarshaler

func (fact TokenFact) JSONMarshaler() TokenFactJSONMarshaler

func (TokenFact) MarshalBSON

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

func (TokenFact) MarshalJSON

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

func (TokenFact) Sender

func (fact TokenFact) Sender() base.Address

func (TokenFact) Signer

func (fact TokenFact) Signer() base.Address

type TokenFactBSONUnmarshaler

type TokenFactBSONUnmarshaler struct {
	Hint     string `bson:"_hint"`
	Sender   string `bson:"sender"`
	Contract string `bson:"contract"`
	Currency string `bson:"currency"`
}

type TokenFactJSONMarshaler

type TokenFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender   base.Address      `json:"sender"`
	Contract base.Address      `json:"contract"`
	Currency ctypes.CurrencyID `json:"currency"`
}

type TokenFactJSONUnmarshaler

type TokenFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender   string `json:"sender"`
	Contract string `json:"contract"`
	Currency string `json:"currency"`
}

type Transfer

type Transfer struct {
	extras.ExtendedOperation
}

func NewTransfer

func NewTransfer(fact TransferFact) Transfer

func (*Transfer) DecodeBSON

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

func (*Transfer) DecodeJSON

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

func (Transfer) DupKey

func (op Transfer) DupKey() (map[types.DuplicationKeyType][]string, error)

func (Transfer) MarshalBSON

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

func (Transfer) MarshalJSON

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

type TransferFact

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

func NewTransferFact

func NewTransferFact(
	token []byte,
	sender base.Address,
	items []TransferItem,
	currency types.CurrencyID,
) TransferFact

func (TransferFact) ActiveContract

func (fact TransferFact) ActiveContract() []base.Address

func (TransferFact) Addresses

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

func (TransferFact) Bytes

func (fact TransferFact) Bytes() []byte

func (TransferFact) Currency

func (fact TransferFact) Currency() types.CurrencyID

func (*TransferFact) DecodeBSON

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

func (*TransferFact) DecodeJSON

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

func (TransferFact) DupKey

func (fact TransferFact) DupKey() (map[types.DuplicationKeyType][]string, error)

func (TransferFact) FactUser

func (fact TransferFact) FactUser() base.Address

func (TransferFact) FeeBase

func (fact TransferFact) FeeBase() (types.CurrencyID, int, int, bool)

func (TransferFact) FeePayer

func (fact TransferFact) FeePayer() base.Address

func (TransferFact) GenerateHash

func (fact TransferFact) GenerateHash() util.Hash

func (TransferFact) IsValid

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

func (TransferFact) Items

func (fact TransferFact) Items() []TransferItem

func (TransferFact) MarshalBSON

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

func (TransferFact) MarshalJSON

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

func (TransferFact) Sender

func (fact TransferFact) Sender() base.Address

func (TransferFact) Signer

func (fact TransferFact) Signer() base.Address

func (TransferFact) Token

func (fact TransferFact) Token() base.Token

type TransferFactBSONUnmarshaler

type TransferFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Sender   string   `bson:"sender"`
	Items    bson.Raw `bson:"items"`
	Currency string   `bson:"currency"`
}

type TransferFactJSONMarshaler

type TransferFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender   base.Address     `json:"sender"`
	Items    []TransferItem   `json:"items"`
	Currency types.CurrencyID `json:"currency"`
}

type TransferFactJSONUnmarshaler

type TransferFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender   string          `json:"sender"`
	Items    json.RawMessage `json:"items"`
	Currency string          `json:"currency"`
}

type TransferFrom

type TransferFrom struct {
	extras.ExtendedOperation
}

func NewTransferFrom

func NewTransferFrom(fact TransferFromFact) TransferFrom

func (*TransferFrom) DecodeBSON

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

func (*TransferFrom) DecodeJSON

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

func (TransferFrom) DupKey

func (op TransferFrom) DupKey() (map[types.DuplicationKeyType][]string, error)

func (TransferFrom) MarshalBSON

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

func (TransferFrom) MarshalJSON

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

type TransferFromFact

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

func NewTransferFromFact

func NewTransferFromFact(
	token []byte,
	sender base.Address,
	items []TransferFromItem,
	currency types.CurrencyID,
) TransferFromFact

func (TransferFromFact) ActiveContract

func (fact TransferFromFact) ActiveContract() []base.Address

func (TransferFromFact) Addresses

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

func (TransferFromFact) Bytes

func (fact TransferFromFact) Bytes() []byte

func (TransferFromFact) Currency

func (fact TransferFromFact) Currency() types.CurrencyID

func (*TransferFromFact) DecodeBSON

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

func (*TransferFromFact) DecodeJSON

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

func (TransferFromFact) DupKey

func (fact TransferFromFact) DupKey() (map[types.DuplicationKeyType][]string, error)

func (TransferFromFact) FactUser

func (fact TransferFromFact) FactUser() base.Address

func (TransferFromFact) FeeBase

func (fact TransferFromFact) FeeBase() (types.CurrencyID, int, int, bool)

func (TransferFromFact) FeePayer

func (fact TransferFromFact) FeePayer() base.Address

func (TransferFromFact) GenerateHash

func (fact TransferFromFact) GenerateHash() util.Hash

func (TransferFromFact) IsValid

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

func (TransferFromFact) Items

func (fact TransferFromFact) Items() []TransferFromItem

func (TransferFromFact) MarshalBSON

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

func (TransferFromFact) MarshalJSON

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

func (TransferFromFact) Sender

func (fact TransferFromFact) Sender() base.Address

func (TransferFromFact) Signer

func (fact TransferFromFact) Signer() base.Address

func (TransferFromFact) Token

func (fact TransferFromFact) Token() base.Token

type TransferFromFactBSONUnmarshaler

type TransferFromFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Sender   string   `bson:"sender"`
	Items    bson.Raw `bson:"items"`
	Currency string   `bson:"currency"`
}

type TransferFromFactJSONMarshaler

type TransferFromFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender   base.Address       `json:"sender"`
	Items    []TransferFromItem `json:"items"`
	Currency types.CurrencyID   `json:"currency"`
}

type TransferFromFactJSONUnmarshaler

type TransferFromFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender   string          `json:"sender"`
	Items    json.RawMessage `json:"items"`
	Currency string          `json:"currency"`
}

type TransferFromItem

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

func NewTransferFromItem

func NewTransferFromItem(
	contract base.Address, receiver, target base.Address, amount common.Big,
) TransferFromItem

func (TransferFromItem) Addresses

func (it TransferFromItem) Addresses() ([]base.Address, error)

func (TransferFromItem) Amount

func (it TransferFromItem) Amount() common.Big

func (TransferFromItem) Bytes

func (it TransferFromItem) Bytes() []byte

func (TransferFromItem) Contract

func (it TransferFromItem) Contract() base.Address

func (*TransferFromItem) DecodeBSON

func (it *TransferFromItem) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*TransferFromItem) DecodeJSON

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

func (TransferFromItem) IsValid

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

func (TransferFromItem) MarshalBSON

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

func (TransferFromItem) MarshalJSON

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

func (TransferFromItem) Receiver

func (it TransferFromItem) Receiver() base.Address

func (TransferFromItem) Target

func (it TransferFromItem) Target() base.Address

type TransferFromItemBSONUnmarshaler

type TransferFromItemBSONUnmarshaler struct {
	Hint     string `bson:"_hint"`
	Contract string `bson:"contract"`
	Receiver string `bson:"receiver"`
	Target   string `bson:"target"`
	Amount   string `bson:"amount"`
}

type TransferFromItemJSONMarshaler

type TransferFromItemJSONMarshaler struct {
	hint.BaseHinter
	Contract base.Address `json:"contract"`
	Receiver base.Address `json:"receiver"`
	Target   base.Address `json:"target"`
	Amount   string       `json:"amount"`
}

type TransferFromItemJSONUnmarshaler

type TransferFromItemJSONUnmarshaler struct {
	Hint     hint.Hint `json:"_hint"`
	Contract string    `json:"contract"`
	Receiver string    `json:"receiver"`
	Target   string    `json:"target"`
	Amount   string    `json:"amount"`
}

type TransferFromItemProcessor

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

func (*TransferFromItemProcessor) Close

func (opp *TransferFromItemProcessor) Close()

func (*TransferFromItemProcessor) PreProcess

func (opp *TransferFromItemProcessor) PreProcess(
	_ context.Context, _ base.Operation, getStateFunc base.GetStateFunc,
) error

func (*TransferFromItemProcessor) Process

type TransferFromProcessor

type TransferFromProcessor struct {
	*base.BaseOperationProcessor
}

func (*TransferFromProcessor) Close

func (opp *TransferFromProcessor) Close() error

func (*TransferFromProcessor) PreProcess

func (*TransferFromProcessor) Process

type TransferItem

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

func NewTransferItem

func NewTransferItem(contract base.Address, receiver base.Address, amount common.Big,
) TransferItem

func (TransferItem) Addresses

func (it TransferItem) Addresses() ([]base.Address, error)

func (TransferItem) Amount

func (it TransferItem) Amount() common.Big

func (TransferItem) Bytes

func (it TransferItem) Bytes() []byte

func (TransferItem) Contract

func (it TransferItem) Contract() base.Address

func (*TransferItem) DecodeBSON

func (it *TransferItem) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*TransferItem) DecodeJSON

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

func (TransferItem) IsValid

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

func (TransferItem) MarshalBSON

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

func (TransferItem) MarshalJSON

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

func (TransferItem) Receiver

func (it TransferItem) Receiver() base.Address

type TransferItemBSONUnmarshaler

type TransferItemBSONUnmarshaler struct {
	Hint     string `bson:"_hint"`
	Contract string `bson:"contract"`
	Receiver string `bson:"receiver"`
	Amount   string `bson:"amount"`
}

type TransferItemJSONMarshaler

type TransferItemJSONMarshaler struct {
	hint.BaseHinter
	Contract base.Address `json:"contract"`
	Receiver base.Address `json:"receiver"`
	Amount   string       `json:"amount"`
}

type TransferItemJSONUnmarshaler

type TransferItemJSONUnmarshaler struct {
	Hint     hint.Hint `json:"_hint"`
	Contract string    `json:"contract"`
	Receiver string    `json:"receiver"`
	Amount   string    `json:"amount"`
}

type TransferItemProcessor

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

func (*TransferItemProcessor) Close

func (opp *TransferItemProcessor) Close()

func (*TransferItemProcessor) PreProcess

func (opp *TransferItemProcessor) PreProcess(
	_ context.Context, _ base.Operation, getStateFunc base.GetStateFunc,
) error

func (*TransferItemProcessor) Process

func (opp *TransferItemProcessor) Process(
	_ context.Context, _ base.Operation, getStateFunc base.GetStateFunc,
) ([]base.StateMergeValue, error)

type TransferProcessor

type TransferProcessor struct {
	*base.BaseOperationProcessor
}

func (*TransferProcessor) Close

func (opp *TransferProcessor) Close() error

func (*TransferProcessor) PreProcess

func (*TransferProcessor) Process

Jump to

Keyboard shortcuts

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