Documentation
¶
Index ¶
- type SmartContract
- func (s *SmartContract) ClientID(ctx contractapi.TransactionContextInterface) (string, error)
- func (s *SmartContract) ClientUTXOs(ctx contractapi.TransactionContextInterface) ([]*UTXO, error)
- func (s *SmartContract) Initialize(ctx contractapi.TransactionContextInterface, name string, symbol string) (bool, error)
- func (s *SmartContract) Mint(ctx contractapi.TransactionContextInterface, amount int) (*UTXO, error)
- func (s *SmartContract) Name(ctx contractapi.TransactionContextInterface) (string, error)
- func (s *SmartContract) Symbol(ctx contractapi.TransactionContextInterface) (string, error)
- func (s *SmartContract) Transfer(ctx contractapi.TransactionContextInterface, utxoInputKeys []string, ...) ([]UTXO, error)
- type UTXO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SmartContract ¶
type SmartContract struct {
contractapi.Contract
}
SmartContract provides functions for transferring tokens using UTXO transactions
func (*SmartContract) ClientID ¶
func (s *SmartContract) ClientID(ctx contractapi.TransactionContextInterface) (string, error)
ClientID returns the client id of the calling client Users can use this function to get their own client id, which they can then give to others as the payment address
func (*SmartContract) ClientUTXOs ¶
func (s *SmartContract) ClientUTXOs(ctx contractapi.TransactionContextInterface) ([]*UTXO, error)
ClientUTXOs returns all UTXOs owned by the calling client
func (*SmartContract) Initialize ¶
func (s *SmartContract) Initialize(ctx contractapi.TransactionContextInterface, name string, symbol string) (bool, error)
Set information for a token and intialize contract. param {String} name The name of the token param {String} symbol The symbol of the token
func (*SmartContract) Mint ¶
func (s *SmartContract) Mint(ctx contractapi.TransactionContextInterface, amount int) (*UTXO, error)
Mint creates a new unspent transaction output (UTXO) owned by the minter
func (*SmartContract) Name ¶
func (s *SmartContract) Name(ctx contractapi.TransactionContextInterface) (string, error)
func (*SmartContract) Symbol ¶
func (s *SmartContract) Symbol(ctx contractapi.TransactionContextInterface) (string, error)
func (*SmartContract) Transfer ¶
func (s *SmartContract) Transfer(ctx contractapi.TransactionContextInterface, utxoInputKeys []string, utxoOutputs []UTXO) ([]UTXO, error)
Transfer transfers UTXOs containing tokens from client to recipient(s)
Click to show internal directories.
Click to hide internal directories.