forked from keep-starknet-strange/art-peace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Announcement/Launch ready (keep-starknet-strange#240)
* Start factions onchain full flow & likes integration * Factions, quests, touch ups, ux, and other features/improvements fully integrated * Formatting and update abi * Fix onchain tests
- Loading branch information
1 parent
91819b4
commit d9b2286
Showing
80 changed files
with
4,711 additions
and
1,333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package quests | ||
|
||
import "github.com/keep-starknet-strange/art-peace/backend/core" | ||
|
||
var QuestClaimData = map[int]func(*Quest, string) []int{ | ||
NFTMintQuestType: NFTMintQuestClaimData, | ||
} | ||
|
||
func (q *Quest) GetQuestClaimData(user string) []int { | ||
if f, ok := QuestClaimData[q.Type]; ok { | ||
return f(q, user) | ||
} | ||
return nil | ||
} | ||
|
||
func NFTMintQuestClaimData(q *Quest, user string) []int { | ||
nftQuestInputs := NewNFTQuestInputs(q.InputData) | ||
if nftQuestInputs.IsDaily { | ||
tokenId, err := core.PostgresQueryOne[int]("SELECT token_id FROM NFTs WHERE minter = $1 AND day_index = $2", user, nftQuestInputs.ClaimDay) | ||
if err != nil { | ||
return nil | ||
} | ||
return []int{*tokenId} | ||
} else { | ||
tokenId, err := core.PostgresQueryOne[int]("SELECT token_id FROM NFTs WHERE minter = $1", user) | ||
if err != nil { | ||
return nil | ||
} | ||
return []int{*tokenId} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.