Skip to content

Commit

Permalink
Adds new signature for ParseWallet utility function (#15)
Browse files Browse the repository at this point in the history
* Adds new signature for ParseWallet utility function

* Renames ParseWallet to UnmarshalWallet
  • Loading branch information
tomglenn committed Jan 15, 2024
1 parent 0416042 commit fad3af8
Showing 1 changed file with 4 additions and 0 deletions.
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)

// UnmarshalWallet unmarshals and returns the account's wallet as a map[string]int64.
UnmarshalWallet(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

0 comments on commit fad3af8

Please sign in to comment.