chaincode

package
v0.0.0-...-d669a3f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 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)

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

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

func (*SmartContract) Name

func (*SmartContract) Symbol

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