Documentation ¶
Index ¶
- type Adjudicator
- func (a *Adjudicator) BurnToken(amount *big.Int) error
- func (a *Adjudicator) Deposit(id channel.ID, part wallet.Address, amount *big.Int) error
- func (a *Adjudicator) Holding(id channel.ID, addr wallet.Address) (*big.Int, error)
- func (a *Adjudicator) MintToken(amount *big.Int) error
- func (a *Adjudicator) Register(ch *adj.SignedChannel) error
- func (a *Adjudicator) StateReg(id channel.ID) (*adj.StateReg, error)
- func (a *Adjudicator) TokenBalance(owner adj.AccountID) (*big.Int, error)
- func (a *Adjudicator) TokenTransfer(receiver adj.AccountID, amount *big.Int) error
- func (a *Adjudicator) TotalHolding(id channel.ID, addrs []wallet.Address) (*big.Int, error)
- func (a *Adjudicator) Withdraw(req adj.SignedWithdrawReq) (*big.Int, error)
- type AssetHolder
- func (ah *AssetHolder) Deposit(id channel.ID, part wallet.Address, amount *big.Int) error
- func (ah *AssetHolder) Holding(id channel.ID, addr wallet.Address) (*big.Int, error)
- func (ah *AssetHolder) TotalHolding(id channel.ID, addrs []wallet.Address) (*big.Int, error)
- func (ah *AssetHolder) Withdraw(id channel.ID, part wallet.Address) (*big.Int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adjudicator ¶
Adjudicator wraps a fabric client.Contract to connect to the Adjudicator chaincode.
func NewAdjudicatorBinding ¶
func NewAdjudicatorBinding(network *client.Network, chainCode string) *Adjudicator
NewAdjudicatorBinding creates the bindings for the on-chain Adjudicator. These bindings are the main point of interaction with the chaincode.
func (*Adjudicator) BurnToken ¶
func (a *Adjudicator) BurnToken(amount *big.Int) error
BurnToken marshals the given amount and sends a request to the Adjudicator chaincode to burn the amount of tokens.
func (*Adjudicator) Deposit ¶
Deposit marshals the given parameters and sends a deposits request to the Adjudicator chaincode.
func (*Adjudicator) Holding ¶
Holding marshals the given parameters and sends a holding request to the Adjudicator chaincode. The response contains the current holding of the given address in the channel.
func (*Adjudicator) MintToken ¶
func (a *Adjudicator) MintToken(amount *big.Int) error
MintToken marshals the given amount and sends a request to the Adjudicator chaincode to mint the amount of tokens.
func (*Adjudicator) Register ¶
func (a *Adjudicator) Register(ch *adj.SignedChannel) error
Register marshals the signed channel state and sends a register request to the Adjudicator chaincode.
func (*Adjudicator) StateReg ¶
StateReg marshals the given channel id and sends a state reg request to the Adjudicator chaincode. The response contains the current registered state of the given channel.
func (*Adjudicator) TokenBalance ¶
TokenBalance marshals the given owner id and sends a token balance request to the Adjudicator chaincode. The response contains the amount of tokens the given owner id holds.
func (*Adjudicator) TokenTransfer ¶
TokenTransfer marshals the given parameters and sends a token transfer request to the Adjudicator chaincode.
func (*Adjudicator) TotalHolding ¶
TotalHolding marshals the given parameters and sends a total holding request to the Adjudicator chaincode. The response contains the sum of the current holdings of the given addresses in the channel.
func (*Adjudicator) Withdraw ¶
func (a *Adjudicator) Withdraw(req adj.SignedWithdrawReq) (*big.Int, error)
Withdraw marshals the given withdraw request and sends it to the Adjudicator chaincode. The response contains the amount of funds withdrawn form the channel.
type AssetHolder ¶
AssetHolder wraps a fabric client.Contract to connect to the AssetHolder chaincode.
func NewAssetHolderBinding ¶
func NewAssetHolderBinding(network *client.Network, chainCode string) *AssetHolder
NewAssetHolderBinding creates the bindings for the on-chain AssetHolder. These are only needed for isolated AssetHolder chaincode testing. There is no connection to the Adjudicator here.
func (*AssetHolder) Deposit ¶
Deposit marshals the given parameters and sends a deposits request to the AssetHolder chaincode.
func (*AssetHolder) Holding ¶
Holding marshals the given parameters and sends a holding request to the AssetHolder chaincode. The response contains the current holding of the given address in the channel.
func (*AssetHolder) TotalHolding ¶
TotalHolding marshals the given parameters and sends a total holding request to the AssetHolder chaincode. The response contains the sum of the current holdings of the given addresses in the channel.