chaincode

package
v0.0.0-...-5789681 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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