Documentation
¶
Overview ¶
Package handler take request from the smart contract API and pass the DTO object to the service layer.
Index ¶
- type AccountingHandler
- type HealthCheckHandler
- type NftHandler
- func (n *NftHandler) BalanceOf(ctx contractapi.TransactionContextInterface, balanceOfNFT dto.BalanceOfNFT) (int, error)
- func (n *NftHandler) Mint(ctx contractapi.TransactionContextInterface, mintNFT dto.MintNFT) (string, error)
- func (n *NftHandler) OwnerOf(ctx contractapi.TransactionContextInterface, ownerNFT dto.OwnerNFT) (string, error)
- func (n *NftHandler) TransferNFT(ctx contractapi.TransactionContextInterface, transferNFT dto.TransferNFT) error
- type TokenHandler
- func (t *TokenHandler) Burn(ctx contractapi.TransactionContextInterface, burnDto dto.BurnToken) error
- func (t *TokenHandler) CreateTokenType(ctx contractapi.TransactionContextInterface, tokenTypeDto dto.CreateTokenType) (string, error)
- func (t *TokenHandler) Exchange(ctx contractapi.TransactionContextInterface, exchangeToken dto.ExchangeToken) error
- func (t *TokenHandler) Issue(ctx contractapi.TransactionContextInterface, issueDto dto.IssueToken) error
- func (t *TokenHandler) Mint(ctx contractapi.TransactionContextInterface, mintDto dto.MintToken) error
- func (t *TokenHandler) Swap(ctx contractapi.TransactionContextInterface, swapDto dto.SwapToken) error
- func (t *TokenHandler) Transfer(ctx contractapi.TransactionContextInterface, transferDto dto.TransferToken) error
- type WalletHandler
- func (w *WalletHandler) BalanceOf(ctx contractapi.TransactionContextInterface, balanceDto dto.Balance) (string, error)
- func (w *WalletHandler) CreateWallet(ctx contractapi.TransactionContextInterface, createWalletDto dto.CreateWallet) (string, error)
- func (w *WalletHandler) EnrollToken(ctx contractapi.TransactionContextInterface, enrollmentDto dto.Enrollment) error
- func (w *WalletHandler) UpdateWallet(ctx contractapi.TransactionContextInterface, updateWalletDto dto.UpdateWallet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountingHandler ¶
type AccountingHandler struct {
// contains filtered or unexported fields
}
func NewAccountingHandler ¶
func NewAccountingHandler() AccountingHandler
func (*AccountingHandler) CalculateBalance ¶
func (a *AccountingHandler) CalculateBalance(ctx contractapi.TransactionContextInterface, accountingBalance dto.AccountingBalance) error
CalculateBalance calculate balance of list transaction from client.
func (*AccountingHandler) GetAccountingTx ¶
func (a *AccountingHandler) GetAccountingTx(ctx contractapi.TransactionContextInterface) ([]string, error)
GetAccountingTx return limit 10 transaction have status pending to accounting balance.
type HealthCheckHandler ¶
type HealthCheckHandler struct {
// contains filtered or unexported fields
}
func NewHealthCheckHandler ¶
func NewHealthCheckHandler() HealthCheckHandler
func (*HealthCheckHandler) CreateHealthCheck ¶
func (hc *HealthCheckHandler) CreateHealthCheck(ctx contractapi.TransactionContextInterface) (string, error)
Transfer to transfer token between wallet.
type NftHandler ¶
type NftHandler struct {
// contains filtered or unexported fields
}
func NewNftHandler ¶
func NewNftHandler() NftHandler
func (*NftHandler) BalanceOf ¶
func (n *NftHandler) BalanceOf(ctx contractapi.TransactionContextInterface, balanceOfNFT dto.BalanceOfNFT) (int, error)
func (*NftHandler) Mint ¶
func (n *NftHandler) Mint(ctx contractapi.TransactionContextInterface, mintNFT dto.MintNFT) (string, error)
func (*NftHandler) OwnerOf ¶
func (n *NftHandler) OwnerOf(ctx contractapi.TransactionContextInterface, ownerNFT dto.OwnerNFT) (string, error)
func (*NftHandler) TransferNFT ¶
func (n *NftHandler) TransferNFT(ctx contractapi.TransactionContextInterface, transferNFT dto.TransferNFT) error
type TokenHandler ¶
type TokenHandler struct {
// contains filtered or unexported fields
}
func NewTokenHandler ¶
func NewTokenHandler() *TokenHandler
func (*TokenHandler) Burn ¶
func (t *TokenHandler) Burn(ctx contractapi.TransactionContextInterface, burnDto dto.BurnToken) error
Burn to burn token existed in the system.
func (*TokenHandler) CreateTokenType ¶
func (t *TokenHandler) CreateTokenType(ctx contractapi.TransactionContextInterface, tokenTypeDto dto.CreateTokenType) (string, error)
CreateTokenType to create new token type.
func (*TokenHandler) Exchange ¶
func (t *TokenHandler) Exchange(ctx contractapi.TransactionContextInterface, exchangeToken dto.ExchangeToken) error
func (*TokenHandler) Issue ¶
func (t *TokenHandler) Issue(ctx contractapi.TransactionContextInterface, issueDto dto.IssueToken) error
Issue to issue new token type form stable token.
func (*TokenHandler) Mint ¶
func (t *TokenHandler) Mint(ctx contractapi.TransactionContextInterface, mintDto dto.MintToken) error
Mint generate new token for wallet.
func (*TokenHandler) Swap ¶
func (t *TokenHandler) Swap(ctx contractapi.TransactionContextInterface, swapDto dto.SwapToken) error
Swap to swap between different token type.
func (*TokenHandler) Transfer ¶
func (t *TokenHandler) Transfer(ctx contractapi.TransactionContextInterface, transferDto dto.TransferToken) error
Transfer to transfer token between wallet.
type WalletHandler ¶
type WalletHandler struct {
// contains filtered or unexported fields
}
func NewWalletHandler ¶
func NewWalletHandler() *WalletHandler
func (*WalletHandler) BalanceOf ¶
func (w *WalletHandler) BalanceOf(ctx contractapi.TransactionContextInterface, balanceDto dto.Balance) (string, error)
BalanceOf to return balance of wallet
func (*WalletHandler) CreateWallet ¶
func (w *WalletHandler) CreateWallet(ctx contractapi.TransactionContextInterface, createWalletDto dto.CreateWallet) (string, error)
CreateWallet generate new wallet with token type
func (*WalletHandler) EnrollToken ¶
func (w *WalletHandler) EnrollToken(ctx contractapi.TransactionContextInterface, enrollmentDto dto.Enrollment) error
EnrollToken to create or update enrollment policy for token
func (*WalletHandler) UpdateWallet ¶
func (w *WalletHandler) UpdateWallet(ctx contractapi.TransactionContextInterface, updateWalletDto dto.UpdateWallet) error
UpdateWallet to update status of wallet