forked from Kava-Labs/kava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adapter.go
18 lines (15 loc) · 853 Bytes
/
adapter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package types
import sdk "github.com/cosmos/cosmos-sdk/types"
// SourceAdapter queries source shares from an external module.
type SourceAdapter interface {
// OwnerSharesBySource returns source shares owned by one address.
//
// For example, the shares a user owns in the mage:fusd and bnb:fusd swap pools.
// It returns the shares for several sources at once, in a map of sourceIDs to shares. Specifying no sourceIDS will return no shares.
// Note the returned map does not have a deterministic order.
OwnerSharesBySource(ctx sdk.Context, owner sdk.AccAddress, sourceIDs []string) map[string]sdk.Dec
// TotalSharesBySource returns the sum of all shares for a source (across all users).
//
// For example, the total number of shares in the mage:fusd swap pool for all users.
TotalSharesBySource(ctx sdk.Context, sourceID string) sdk.Dec
}