Documentation ¶
Index ¶
- Variables
- func NewP2pkhAuthProofSignature(txo *types.TransactionOrder, signer crypto.Signer) ([]byte, error)
- func NewP2pkhAuthProofSignatureFromKey(txo *types.TransactionOrder, privKey []byte) ([]byte, error)
- func NewP2pkhFeeProofSignature(txo *types.TransactionOrder, signer crypto.Signer) ([]byte, error)
- func NewP2pkhFeeSignatureFromKey(txo *types.TransactionOrder, privKey []byte) ([]byte, error)
- func NewP2pkhSignature(signer crypto.Signer, sigBytesFn func() ([]byte, error)) ([]byte, error)
- func NewTransactionOrder(networkID types.NetworkID, systemID types.SystemID, unitID types.UnitID, ...) (*types.TransactionOrder, error)
- type Bill
- func (b *Bill) Lock(lockStatus uint64, txOptions ...Option) (*types.TransactionOrder, error)
- func (b *Bill) ReclaimFromFeeCredit(closeFCProof *types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
- func (b *Bill) Split(targetUnits []*money.TargetUnit, txOptions ...Option) (*types.TransactionOrder, error)
- func (b *Bill) SwapWithDustCollector(transDCProofs []*types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
- func (b *Bill) Transfer(newOwnerPredicate []byte, txOptions ...Option) (*types.TransactionOrder, error)
- func (b *Bill) TransferToDustCollector(targetBill *Bill, txOptions ...Option) (*types.TransactionOrder, error)
- func (b *Bill) TransferToFeeCredit(fcr *FeeCreditRecord, amount uint64, latestAdditionTime uint64, ...) (*types.TransactionOrder, error)
- func (b *Bill) Unlock(txOptions ...Option) (*types.TransactionOrder, error)
- type FeeCreditRecord
- func (f *FeeCreditRecord) AddFeeCredit(ownerPredicate []byte, transFCProof *types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
- func (f *FeeCreditRecord) CloseFeeCredit(targetBillID types.UnitID, targetBillCounter uint64, txOptions ...Option) (*types.TransactionOrder, error)
- func (f *FeeCreditRecord) DeleteFeeCredit(txOptions ...Option) (*types.TransactionOrder, error)
- func (f *FeeCreditRecord) Lock(lockStatus uint64, txOptions ...Option) (*types.TransactionOrder, error)
- func (f *FeeCreditRecord) SetFeeCredit(ownerPredicate []byte, amount uint64, txOptions ...Option) (*types.TransactionOrder, error)
- func (f *FeeCreditRecord) Unlock(txOptions ...Option) (*types.TransactionOrder, error)
- type FungibleToken
- func (t *FungibleToken) Burn(targetTokenID types.UnitID, targetTokenCounter uint64, txOptions ...Option) (*types.TransactionOrder, error)
- func (t *FungibleToken) GetID() TokenID
- func (t *FungibleToken) GetLockStatus() uint64
- func (t *FungibleToken) GetOwnerPredicate() Predicate
- func (t *FungibleToken) Join(burnTxProofs []*types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
- func (t *FungibleToken) Lock(lockStatus uint64, txOptions ...Option) (*types.TransactionOrder, error)
- func (t *FungibleToken) Mint(txOptions ...Option) (*types.TransactionOrder, error)
- func (t *FungibleToken) Split(amount uint64, ownerPredicate []byte, txOptions ...Option) (*types.TransactionOrder, error)
- func (t *FungibleToken) Transfer(ownerPredicate []byte, txOptions ...Option) (*types.TransactionOrder, error)
- func (t *FungibleToken) Unlock(txOptions ...Option) (*types.TransactionOrder, error)
- type FungibleTokenType
- type MoneyPartitionClient
- type MoneyTxSigner
- type NodeInfoResponse
- type NonFungibleToken
- func (t *NonFungibleToken) GetID() TokenID
- func (t *NonFungibleToken) GetLockStatus() uint64
- func (t *NonFungibleToken) GetOwnerPredicate() Predicate
- func (t *NonFungibleToken) Lock(lockStatus uint64, txOptions ...Option) (*types.TransactionOrder, error)
- func (t *NonFungibleToken) Mint(txOptions ...Option) (*types.TransactionOrder, error)
- func (t *NonFungibleToken) Transfer(ownerPredicate []byte, txOptions ...Option) (*types.TransactionOrder, error)
- func (t *NonFungibleToken) Unlock(txOptions ...Option) (*types.TransactionOrder, error)
- func (t *NonFungibleToken) Update(data []byte, txOptions ...Option) (*types.TransactionOrder, error)
- type NonFungibleTokenType
- type Option
- type Options
- type PartitionClient
- type PeerInfo
- type Predicate
- type PubKey
- type PubKeyHash
- type TokenID
- type TokenTypeID
- type TokensPartitionClient
- type TransactionRecordAndProof
- type TxHash
- type Unit
Constants ¶
This section is empty.
Variables ¶
View Source
var NoParent = TokenTypeID(nil)
Functions ¶
func NewP2pkhAuthProofSignature ¶
NewP2pkhAuthProofSignature creates a standard P2PKH predicate signature for AuthProof.
func NewP2pkhAuthProofSignatureFromKey ¶
func NewP2pkhAuthProofSignatureFromKey(txo *types.TransactionOrder, privKey []byte) ([]byte, error)
NewP2pkhAuthProofSignatureFromKey creates a standard P2PKH predicate signature for AuthProof.
func NewP2pkhFeeProofSignature ¶
NewP2pkhFeeProofSignature creates a standard P2PKH fee predicate signature for FeeProof.
func NewP2pkhFeeSignatureFromKey ¶
func NewP2pkhFeeSignatureFromKey(txo *types.TransactionOrder, privKey []byte) ([]byte, error)
NewP2pkhFeeSignatureFromKey creates a standard P2PKH fee predicate signature for FeeProof.
func NewP2pkhSignature ¶
NewP2pkhSignature creates a standard P2PKH predicate signature.
Types ¶
type Bill ¶
type Bill struct { NetworkID types.NetworkID SystemID types.SystemID ID types.UnitID Value uint64 LockStatus uint64 Counter uint64 }
func (*Bill) ReclaimFromFeeCredit ¶
func (b *Bill) ReclaimFromFeeCredit(closeFCProof *types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
func (*Bill) Split ¶
func (b *Bill) Split(targetUnits []*money.TargetUnit, txOptions ...Option) (*types.TransactionOrder, error)
func (*Bill) SwapWithDustCollector ¶
func (b *Bill) SwapWithDustCollector(transDCProofs []*types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
func (*Bill) TransferToDustCollector ¶
func (*Bill) TransferToFeeCredit ¶
func (b *Bill) TransferToFeeCredit(fcr *FeeCreditRecord, amount uint64, latestAdditionTime uint64, txOptions ...Option) (*types.TransactionOrder, error)
type FeeCreditRecord ¶
type FeeCreditRecord struct { NetworkID types.NetworkID SystemID types.SystemID ID types.UnitID Balance uint64 Timeout uint64 LockStatus uint64 Counter *uint64 }
func (*FeeCreditRecord) AddFeeCredit ¶
func (f *FeeCreditRecord) AddFeeCredit(ownerPredicate []byte, transFCProof *types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
func (*FeeCreditRecord) CloseFeeCredit ¶
func (f *FeeCreditRecord) CloseFeeCredit(targetBillID types.UnitID, targetBillCounter uint64, txOptions ...Option) (*types.TransactionOrder, error)
func (*FeeCreditRecord) DeleteFeeCredit ¶
func (f *FeeCreditRecord) DeleteFeeCredit(txOptions ...Option) (*types.TransactionOrder, error)
func (*FeeCreditRecord) Lock ¶
func (f *FeeCreditRecord) Lock(lockStatus uint64, txOptions ...Option) (*types.TransactionOrder, error)
func (*FeeCreditRecord) SetFeeCredit ¶
func (f *FeeCreditRecord) SetFeeCredit(ownerPredicate []byte, amount uint64, txOptions ...Option) (*types.TransactionOrder, error)
func (*FeeCreditRecord) Unlock ¶
func (f *FeeCreditRecord) Unlock(txOptions ...Option) (*types.TransactionOrder, error)
type FungibleToken ¶
type FungibleToken struct { NetworkID types.NetworkID SystemID types.SystemID ID TokenID Symbol string TypeID TokenTypeID TypeName string OwnerPredicate []byte // TODO: could use sdktypes.Predicate? Counter uint64 LockStatus uint64 Amount uint64 DecimalPlaces uint32 Burned bool }
func (*FungibleToken) Burn ¶
func (t *FungibleToken) Burn(targetTokenID types.UnitID, targetTokenCounter uint64, txOptions ...Option) (*types.TransactionOrder, error)
func (*FungibleToken) GetID ¶
func (t *FungibleToken) GetID() TokenID
func (*FungibleToken) GetLockStatus ¶
func (t *FungibleToken) GetLockStatus() uint64
func (*FungibleToken) GetOwnerPredicate ¶
func (t *FungibleToken) GetOwnerPredicate() Predicate
func (*FungibleToken) Join ¶
func (t *FungibleToken) Join(burnTxProofs []*types.TxRecordProof, txOptions ...Option) (*types.TransactionOrder, error)
func (*FungibleToken) Lock ¶
func (t *FungibleToken) Lock(lockStatus uint64, txOptions ...Option) (*types.TransactionOrder, error)
func (*FungibleToken) Mint ¶
func (t *FungibleToken) Mint(txOptions ...Option) (*types.TransactionOrder, error)
func (*FungibleToken) Split ¶
func (t *FungibleToken) Split(amount uint64, ownerPredicate []byte, txOptions ...Option) (*types.TransactionOrder, error)
func (*FungibleToken) Transfer ¶
func (t *FungibleToken) Transfer(ownerPredicate []byte, txOptions ...Option) (*types.TransactionOrder, error)
func (*FungibleToken) Unlock ¶
func (t *FungibleToken) Unlock(txOptions ...Option) (*types.TransactionOrder, error)
type FungibleTokenType ¶
type FungibleTokenType struct { NetworkID types.NetworkID SystemID types.SystemID ID TokenTypeID ParentTypeID TokenTypeID Symbol string Name string Icon *tokens.Icon SubTypeCreationPredicate Predicate TokenMintingPredicate Predicate TokenTypeOwnerPredicate Predicate DecimalPlaces uint32 }
func (*FungibleTokenType) Define ¶
func (tt *FungibleTokenType) Define(txOptions ...Option) (*types.TransactionOrder, error)
type MoneyPartitionClient ¶
type MoneyTxSigner ¶
type MoneyTxSigner struct {
// contains filtered or unexported fields
}
MoneyTxSigner helper struct to generate standard transaction signatures.
func NewMoneyTxSigner ¶
func NewMoneyTxSigner(signer abcrypto.Signer) (*MoneyTxSigner, error)
func NewMoneyTxSignerFromKey ¶
func NewMoneyTxSignerFromKey(privKey []byte) (*MoneyTxSigner, error)
func (*MoneyTxSigner) AddAuthProof ¶
func (s *MoneyTxSigner) AddAuthProof(tx *types.TransactionOrder) error
func (*MoneyTxSigner) AddFeeProof ¶
func (s *MoneyTxSigner) AddFeeProof(tx *types.TransactionOrder) error
func (*MoneyTxSigner) SignTx ¶
func (s *MoneyTxSigner) SignTx(tx *types.TransactionOrder) error
SignTx generates transaction specific P2PKH AuthProof and FeeProof.
type NodeInfoResponse ¶
type NodeInfoResponse struct { NetworkID types.NetworkID `json:"networkId"` // hex encoded network identifier SystemID types.SystemID `json:"systemId"` // hex encoded system identifier Name string `json:"name"` // one of [money node | tokens node | evm node] Self PeerInfo `json:"self"` // information about this peer BootstrapNodes []PeerInfo `json:"bootstrapNodes"` RootValidators []PeerInfo `json:"rootValidators"` PartitionValidators []PeerInfo `json:"partitionValidators"` OpenConnections []PeerInfo `json:"openConnections"` // all libp2p connections to other peers in the network }
type NonFungibleToken ¶
type NonFungibleToken struct { NetworkID types.NetworkID SystemID types.SystemID ID TokenID Symbol string TypeID TokenTypeID TypeName string OwnerPredicate []byte // TODO: could use sdktypes.Predicate? Counter uint64 LockStatus uint64 Name string URI string Data []byte DataUpdatePredicate Predicate }
func (*NonFungibleToken) GetID ¶
func (t *NonFungibleToken) GetID() TokenID
func (*NonFungibleToken) GetLockStatus ¶
func (t *NonFungibleToken) GetLockStatus() uint64
func (*NonFungibleToken) GetOwnerPredicate ¶
func (t *NonFungibleToken) GetOwnerPredicate() Predicate
func (*NonFungibleToken) Lock ¶
func (t *NonFungibleToken) Lock(lockStatus uint64, txOptions ...Option) (*types.TransactionOrder, error)
func (*NonFungibleToken) Mint ¶
func (t *NonFungibleToken) Mint(txOptions ...Option) (*types.TransactionOrder, error)
func (*NonFungibleToken) Transfer ¶
func (t *NonFungibleToken) Transfer(ownerPredicate []byte, txOptions ...Option) (*types.TransactionOrder, error)
func (*NonFungibleToken) Unlock ¶
func (t *NonFungibleToken) Unlock(txOptions ...Option) (*types.TransactionOrder, error)
func (*NonFungibleToken) Update ¶
func (t *NonFungibleToken) Update(data []byte, txOptions ...Option) (*types.TransactionOrder, error)
type NonFungibleTokenType ¶
type NonFungibleTokenType struct { NetworkID types.NetworkID SystemID types.SystemID ID TokenTypeID ParentTypeID TokenTypeID Symbol string Name string Icon *tokens.Icon SubTypeCreationPredicate Predicate TokenMintingPredicate Predicate TokenTypeOwnerPredicate Predicate DataUpdatePredicate Predicate }
func (*NonFungibleTokenType) Define ¶
func (tt *NonFungibleTokenType) Define(txOptions ...Option) (*types.TransactionOrder, error)
type Option ¶
type Option func(*Options)
func WithFeeCreditRecordID ¶
func WithMaxFee ¶
func WithReferenceNumber ¶
func WithTimeout ¶
type Options ¶
type Options struct { Timeout uint64 FeeCreditRecordID types.UnitID MaxFee uint64 ReferenceNumber []byte }
func OptionsWithDefaults ¶
type PartitionClient ¶
type PartitionClient interface { GetNodeInfo(ctx context.Context) (*NodeInfoResponse, error) GetRoundNumber(ctx context.Context) (uint64, error) SendTransaction(ctx context.Context, tx *types.TransactionOrder) ([]byte, error) ConfirmTransaction(ctx context.Context, tx *types.TransactionOrder, log *slog.Logger) (*types.TxRecordProof, error) GetTransactionProof(ctx context.Context, txHash types.Bytes) (*types.TxRecordProof, error) GetFeeCreditRecordByOwnerID(ctx context.Context, ownerID []byte) (*FeeCreditRecord, error) Close() }
type PubKeyHash ¶
type PubKeyHash []byte
type TokenTypeID ¶
type TokensPartitionClient ¶
type TokensPartitionClient interface { PartitionClient GetFungibleToken(ctx context.Context, id TokenID) (*FungibleToken, error) GetFungibleTokens(ctx context.Context, ownerID []byte) ([]*FungibleToken, error) GetFungibleTokenTypes(ctx context.Context, creator PubKey) ([]*FungibleTokenType, error) GetFungibleTokenTypeHierarchy(ctx context.Context, typeID TokenTypeID) ([]*FungibleTokenType, error) GetNonFungibleToken(ctx context.Context, id TokenID) (*NonFungibleToken, error) GetNonFungibleTokens(ctx context.Context, ownerID []byte) ([]*NonFungibleToken, error) GetNonFungibleTokenTypes(ctx context.Context, creator PubKey) ([]*NonFungibleTokenType, error) GetNonFungibleTokenTypeHierarchy(ctx context.Context, typeID TokenTypeID) ([]*NonFungibleTokenType, error) }
type TransactionRecordAndProof ¶
func (*TransactionRecordAndProof) ToBaseType ¶
func (t *TransactionRecordAndProof) ToBaseType() (*types.TxRecordProof, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.