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

Adds new signature for ParseWallet utility function #15

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions economy.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package hiro

import (
"context"
"github.com/heroiclabs/nakama-common/api"
"github.com/heroiclabs/nakama-common/runtime"
)

Expand Down Expand Up @@ -186,6 +187,9 @@ type EconomySystem interface {
// Grant will add currencies, and reward modifiers to a user's economy by ID.
Grant(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, currencies map[string]int64, items map[string]int64, modifiers []*RewardModifier, walletMetadata map[string]interface{}) (map[string]int64, error)

// ParseWallet parses and returns the account's wallet as a map[string]int64.
ParseWallet(account *api.Account) (map[string]int64, error)

// PurchaseIntent will create a purchase intent for a particular store item for a user ID.
PurchaseIntent(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, itemID string, store EconomyStoreType, sku string) error

Expand Down