chaincode

package
v0.0.0-...-05edea0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

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

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

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)

Initialize sets information for a token and initializes the contract. name is the name of the token. symbol is the symbol of the token.

func (*SmartContract) Mint

Mint creates a new unspent transaction output (UTXO) owned by the minter

func (*SmartContract) Name

Name returns a descriptive name for fungible tokens in this contract.

func (*SmartContract) Symbol

Symbol returns an abbreviated name for fungible tokens in this contract.

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)

type UTXO

type UTXO struct {
	Key    string `json:"utxo_key"`
	Owner  string `json:"owner"`
	Amount int    `json:"amount"`
}

UTXO represents an unspent transaction output

Jump to

Keyboard shortcuts

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