Documentation
¶
Index ¶
- type Approval
- type Nft
- type TokenERC721Contract
- func (c *TokenERC721Contract) Approve(ctx contractapi.TransactionContextInterface, operator string, tokenId string) (bool, error)
- func (c *TokenERC721Contract) BalanceOf(ctx contractapi.TransactionContextInterface, owner string) int
- func (c *TokenERC721Contract) Burn(ctx contractapi.TransactionContextInterface, tokenId string) (bool, error)
- func (c *TokenERC721Contract) ClientAccountBalance(ctx contractapi.TransactionContextInterface) (int, error)
- func (c *TokenERC721Contract) ClientAccountID(ctx contractapi.TransactionContextInterface) (string, error)
- func (c *TokenERC721Contract) GetApproved(ctx contractapi.TransactionContextInterface, tokenId string) (string, error)
- func (c *TokenERC721Contract) Initialize(ctx contractapi.TransactionContextInterface, name string, symbol string) (bool, error)
- func (c *TokenERC721Contract) IsApprovedForAll(ctx contractapi.TransactionContextInterface, owner string, operator string) (bool, error)
- func (c *TokenERC721Contract) MintWithTokenURI(ctx contractapi.TransactionContextInterface, tokenId string, tokenURI string) (*Nft, error)
- func (c *TokenERC721Contract) Name(ctx contractapi.TransactionContextInterface) (string, error)
- func (c *TokenERC721Contract) OwnerOf(ctx contractapi.TransactionContextInterface, tokenId string) (string, error)
- func (c *TokenERC721Contract) SetApprovalForAll(ctx contractapi.TransactionContextInterface, operator string, approved bool) (bool, error)
- func (c *TokenERC721Contract) Symbol(ctx contractapi.TransactionContextInterface) (string, error)
- func (c *TokenERC721Contract) TokenURI(ctx contractapi.TransactionContextInterface, tokenId string) (string, error)
- func (c *TokenERC721Contract) TotalSupply(ctx contractapi.TransactionContextInterface) int
- func (c *TokenERC721Contract) TransferFrom(ctx contractapi.TransactionContextInterface, from string, to string, ...) (bool, error)
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Nft ¶
type Nft struct {
TokenId string `json:"tokenId"`
Owner string `json:"owner"`
TokenURI string `json:"tokenURI"`
Approved string `json:"approved"`
}
Define structs to be used by chaincode
type TokenERC721Contract ¶
type TokenERC721Contract struct {
contractapi.Contract
}
TokenERC721Contract contract for managing CRUD operations
func (*TokenERC721Contract) Approve ¶
func (c *TokenERC721Contract) Approve(ctx contractapi.TransactionContextInterface, operator string, tokenId string) (bool, error)
Approve changes or reaffirms the approved client for a non-fungible token param {String} operator The new approved client param {String} tokenId the non-fungible token to approve returns {Boolean} Return whether the approval was successful or not
func (*TokenERC721Contract) BalanceOf ¶
func (c *TokenERC721Contract) BalanceOf(ctx contractapi.TransactionContextInterface, owner string) int
BalanceOf counts all non-fungible tokens assigned to an owner param owner {String} An owner for whom to query the balance returns {int} The number of non-fungible tokens owned by the owner, possibly zero
func (*TokenERC721Contract) Burn ¶
func (c *TokenERC721Contract) Burn(ctx contractapi.TransactionContextInterface, tokenId string) (bool, error)
Burn a non-fungible token param {String} tokenId Unique ID of a non-fungible token returns {Boolean} Return whether the burn was successful or not
func (*TokenERC721Contract) ClientAccountBalance ¶
func (c *TokenERC721Contract) ClientAccountBalance(ctx contractapi.TransactionContextInterface) (int, error)
ClientAccountBalance returns the balance of the requesting client's account. returns {Number} Returns the account balance
func (*TokenERC721Contract) ClientAccountID ¶
func (c *TokenERC721Contract) ClientAccountID(ctx contractapi.TransactionContextInterface) (string, error)
func (*TokenERC721Contract) GetApproved ¶
func (c *TokenERC721Contract) GetApproved(ctx contractapi.TransactionContextInterface, tokenId string) (string, error)
GetApproved returns the approved client for a single non-fungible token param {String} tokenId the non-fungible token to find the approved client for returns {Object} Return the approved client for this non-fungible token, or null if there is none
func (*TokenERC721Contract) Initialize ¶
func (c *TokenERC721Contract) Initialize(ctx contractapi.TransactionContextInterface, name string, symbol string) (bool, error)
func (*TokenERC721Contract) IsApprovedForAll ¶
func (c *TokenERC721Contract) IsApprovedForAll(ctx contractapi.TransactionContextInterface, owner string, operator string) (bool, error)
IsApprovedForAll returns if a client is an authorized operator for another client param {String} owner The client that owns the non-fungible tokens param {String} operator The client that acts on behalf of the owner returns {Boolean} Return true if the operator is an approved operator for the owner, false otherwise
func (*TokenERC721Contract) MintWithTokenURI ¶
func (c *TokenERC721Contract) MintWithTokenURI(ctx contractapi.TransactionContextInterface, tokenId string, tokenURI string) (*Nft, error)
func (*TokenERC721Contract) Name ¶
func (c *TokenERC721Contract) Name(ctx contractapi.TransactionContextInterface) (string, error)
func (*TokenERC721Contract) OwnerOf ¶
func (c *TokenERC721Contract) OwnerOf(ctx contractapi.TransactionContextInterface, tokenId string) (string, error)
OwnerOf finds the owner of a non-fungible token param {String} tokenId The identifier for a non-fungible token returns {String} Return the owner of the non-fungible token
func (*TokenERC721Contract) SetApprovalForAll ¶
func (c *TokenERC721Contract) SetApprovalForAll(ctx contractapi.TransactionContextInterface, operator string, approved bool) (bool, error)
SetApprovalForAll enables or disables approval for a third party ("operator") to manage all the message sender's assets param {String} operator A client to add to the set of authorized operators param {Boolean} approved True if the operator is approved, false to revoke approval returns {Boolean} Return whether the approval was successful or not
func (*TokenERC721Contract) Symbol ¶
func (c *TokenERC721Contract) Symbol(ctx contractapi.TransactionContextInterface) (string, error)
func (*TokenERC721Contract) TokenURI ¶
func (c *TokenERC721Contract) TokenURI(ctx contractapi.TransactionContextInterface, tokenId string) (string, error)
func (*TokenERC721Contract) TotalSupply ¶
func (c *TokenERC721Contract) TotalSupply(ctx contractapi.TransactionContextInterface) int
func (*TokenERC721Contract) TransferFrom ¶
func (c *TokenERC721Contract) TransferFrom(ctx contractapi.TransactionContextInterface, from string, to string, tokenId string) (bool, error)