services

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounting

type Accounting interface {
	GetTx(ctx contractapi.TransactionContextInterface) ([]string, error)
	CalculateBalance(ctx contractapi.TransactionContextInterface, txIds dto.AccountingBalance) error
}

type HealthCheck

type HealthCheck interface {
	//CreateHealthCheck to create new ping msg in the system.
	CreateHealthCheck(ctx contractapi.TransactionContextInterface) (string, error)
}

type NFT

type NFT interface {
	// Mint generate new NFT token
	Mint(ctx contractapi.TransactionContextInterface, gs1Number string, ownerWalletId string, metaData string) (string, error)

	// OwnerOf return owner wallet id of nft token
	OwnerOf(ctx contractapi.TransactionContextInterface, nftTokenId string) (string, error)

	// BalanceOf return number nft of wallet address
	BalanceOf(ctx contractapi.TransactionContextInterface, ownerWalletId string) (int, error)

	// TransferFrom to transfer nft token from owner to other wallet
	TransferFrom(ctx contractapi.TransactionContextInterface, ownerWalletId string, toWalletId string, nftTokenId string) error
}

type Token

type Token interface {
	// Transfer to transfer token between wallet.
	// But state balance of wallet not update at the time.
	// It will be update when accounting job start
	Transfer(ctx contractapi.TransactionContextInterface, fromWalletId, toWalletId string, amount float64) error

	// Mint to init token in the system
	Mint(ctx contractapi.TransactionContextInterface, walletId string, amount float64) error

	// Burn to delete token in the system
	Burn(ctx contractapi.TransactionContextInterface, walletId string, amount float64) error

	//CreateType to create new token type in the system.
	CreateType(ctx contractapi.TransactionContextInterface, name string, tickerToken string, rate float64) (string, error)

	//Swap to swap between token type.
	Swap(ctx contractapi.TransactionContextInterface, fromWalletId, toWalletId string, amount float64) error

	//Issue to issue new token type from stable token.
	Issue(ctx contractapi.TransactionContextInterface, tokenId, fromWalletId, toWalletId string, amount float64) error

	// Exchange to exchange token between two user have diff token type
	Exchange(ctx contractapi.TransactionContextInterface, fromWalletFirstToken, toWalletFirstToken,
		fromWalletSecondToken, toWalletSecondToken string, amount float64) error
}

type Wallet

type Wallet interface {
	// Create to create new wallet. Each wallet belong to token type
	Create(ctx contractapi.TransactionContextInterface, tokenId string, status glossary.Status) (string, error)

	// Update to update status of wallet. Active or InActive
	Update(ctx contractapi.TransactionContextInterface, walletId string, status glossary.Status) error

	// BalanceOf get balance of wallet
	BalanceOf(ctx contractapi.TransactionContextInterface, walletId string) (string, error)

	// EnrollToken to register wallet id that will be issue/mint token into.
	// Currently support add list from wallet id and to wallet id
	EnrollToken(ctx contractapi.TransactionContextInterface, tokenId string, fromWalletId []string, toWalletId []string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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