Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update adr-043-nft-module #12293

Merged
merged 3 commits into from
Jun 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions docs/architecture/adr-043-nft-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* 2021-05-01: Initial Draft
* 2021-07-02: Review updates
* 2022-06-15: Add batch operation

## Status

Expand Down Expand Up @@ -113,24 +114,31 @@ This ADR doesn't specify values that `data` can take; however, best practices re

```go
type Keeper interface {
NewClass(class Class)
UpdateClass(class Class)
NewClass(ctx sdk.Context,class Class)
UpdateClass(ctx sdk.Context,class Class)

Mint(nft NFT,receiver sdk.AccAddress) // updates totalSupply
Burn(classId string, nftId string) // updates totalSupply
Update(nft NFT)
Transfer(classId string, nftId string, receiver sdk.AccAddress)
Mint(ctx sdk.Context,nft NFT,receiver sdk.AccAddress) // updates totalSupply
BatchMint(ctx sdk.Context, tokens []NFT,receiver sdk.AccAddress) error

GetClass(classId string) Class
GetClasses() []Class
Burn(ctx sdk.Context, classId string, nftId string) // updates totalSupply
BatchBurn(ctx sdk.Context, classID string, nftIDs []string) error

GetNFT(classId string, nftId string) NFT
GetNFTsOfClassByOwner(classId string, owner sdk.AccAddress) []NFT
GetNFTsOfClass(classId string) []NFT
Update(ctx sdk.Context, nft NFT)
BatchUpdate(ctx sdk.Context, tokens []NFT) error

GetOwner(classId string, nftId string) sdk.AccAddress
GetBalance(classId string, owner sdk.AccAddress) uint64
GetTotalSupply(classId string) uint64
Transfer(ctx sdk.Context, classId string, nftId string, receiver sdk.AccAddress)
BatchTransfer(ctx sdk.Context, classID string, nftIDs []string, receiver sdk.AccAddress) error

GetClass(ctx sdk.Context, classId string) Class
GetClasses(ctx sdk.Context) []Class

GetNFT(ctx sdk.Context, classId string, nftId string) NFT
GetNFTsOfClassByOwner(ctx sdk.Context, classId string, owner sdk.AccAddress) []NFT
GetNFTsOfClass(ctx sdk.Context, classId string) []NFT

GetOwner(ctx sdk.Context, classId string, nftId string) sdk.AccAddress
GetBalance(ctx sdk.Context, classId string, owner sdk.AccAddress) uint64
GetTotalSupply(ctx sdk.Context, classId string) uint64
}
```

Expand Down