binding

package
v0.0.0-...-8619d99 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adjudicator

type Adjudicator struct {
	Contract *client.Contract
}

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

func (a *Adjudicator) Deposit(id channel.ID, part wallet.Address, amount *big.Int) error

Deposit marshals the given parameters and sends a deposits request to the Adjudicator chaincode.

func (*Adjudicator) Holding

func (a *Adjudicator) Holding(id channel.ID, addr wallet.Address) (*big.Int, error)

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

func (a *Adjudicator) StateReg(id channel.ID) (*adj.StateReg, error)

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

func (a *Adjudicator) TokenBalance(owner adj.AccountID) (*big.Int, error)

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

func (a *Adjudicator) TokenTransfer(receiver adj.AccountID, amount *big.Int) error

TokenTransfer marshals the given parameters and sends a token transfer request to the Adjudicator chaincode.

func (*Adjudicator) TotalHolding

func (a *Adjudicator) TotalHolding(id channel.ID, addrs []wallet.Address) (*big.Int, error)

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

type AssetHolder struct {
	Contract *client.Contract
}

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

func (ah *AssetHolder) Deposit(id channel.ID, part wallet.Address, amount *big.Int) error

Deposit marshals the given parameters and sends a deposits request to the AssetHolder chaincode.

func (*AssetHolder) Holding

func (ah *AssetHolder) Holding(id channel.ID, addr wallet.Address) (*big.Int, error)

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

func (ah *AssetHolder) TotalHolding(id channel.ID, addrs []wallet.Address) (*big.Int, error)

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.

func (*AssetHolder) Withdraw

func (ah *AssetHolder) Withdraw(id channel.ID, part wallet.Address) (*big.Int, error)

Withdraw marshals the given parameters and sends a withdrawal request to the AssetHolder chaincode. The response contains the amount of funds withdrawn form the channel.

Jump to

Keyboard shortcuts

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