2022-04-07 06:19:24 +00:00
|
|
|
package prism
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/galacticship/terra"
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Prism struct {
|
|
|
|
Amps *Amps
|
|
|
|
YLUNAStaking *YLUNAStaking
|
|
|
|
Farm *Farm
|
2022-04-08 05:10:57 +00:00
|
|
|
Governance *Governance
|
2022-04-07 06:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewPrism(querier *terra.Querier) (*Prism, error) {
|
|
|
|
amps, err := NewAmps(querier)
|
|
|
|
if err != nil {
|
|
|
|
return nil, errors.Wrap(err, "creating amps")
|
|
|
|
}
|
|
|
|
ylunastaking, err := NewYLUNAStaking(querier)
|
|
|
|
if err != nil {
|
|
|
|
return nil, errors.Wrap(err, "creating yluna staking")
|
|
|
|
}
|
|
|
|
farm, err := NewFarm(querier)
|
|
|
|
if err != nil {
|
|
|
|
return nil, errors.Wrap(err, "creating farm")
|
|
|
|
}
|
2022-04-08 05:10:57 +00:00
|
|
|
gov, err := NewGovernance(querier)
|
|
|
|
if err != nil {
|
|
|
|
return nil, errors.Wrap(err, "creating governance")
|
|
|
|
}
|
2022-04-07 06:19:24 +00:00
|
|
|
return &Prism{
|
|
|
|
Amps: amps,
|
|
|
|
YLUNAStaking: ylunastaking,
|
|
|
|
Farm: farm,
|
2022-04-08 05:10:57 +00:00
|
|
|
Governance: gov,
|
2022-04-07 06:19:24 +00:00
|
|
|
}, nil
|
|
|
|
}
|