Documentation ¶
Index ¶
- type Core
- type ERC7412
- type Forwarder
- func (p *Forwarder) Address() common.Address
- func (p *Forwarder) Aggregate3Value(value uint64, arg []forwarder.TrustedMulticallForwarderCall3Value) ([]ForwarderResult, error)
- func (p *Forwarder) Aggregate3ValueHistorical(value uint64, arg []forwarder.TrustedMulticallForwarderCall3Value, ...) ([]ForwarderResult, error)
- type ForwarderResult
- type IRawCoreContract
- type IRawERC7412Contract
- type IRawForwarderContract
- type IRawPerpsContract
- type Perps
- func (p *Perps) Address() common.Address
- func (p *Perps) GetCallDataAvailableMargin(accountID *big.Int) ([]byte, error)
- func (p *Perps) GetCallDataMarketSummary(marketID *big.Int) ([]byte, error)
- func (p *Perps) GetCallDataOpenPosition(marketID *big.Int, accountID *big.Int) ([]byte, error)
- func (p *Perps) GetCallDataRequiredMargins(accountID *big.Int) ([]byte, error)
- func (p *Perps) UnpackAvailableMargin(value []byte) (res *big.Int, err error)
- func (p *Perps) UnpackGetMarketSummary(value []byte) (res *perpsMarket.IPerpsMarketModuleMarketSummary, err error)
- func (p *Perps) UnpackOpenPosition(value []byte) (res struct{ ... }, err error)
- func (p *Perps) UnpackRequiredMargins(value []byte) (res struct{ ... }, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶ added in v0.6.0
type Core struct {
// contains filtered or unexported fields
}
Core is a raw core contract implementation
func (*Core) GetCallDataVaultDebt ¶ added in v0.6.0
type ERC7412 ¶
type ERC7412 struct {
// contains filtered or unexported fields
}
ERC7412 is data struct for erc7412 contract implementation
func (*ERC7412) GetCallFulfillOracleQuery ¶
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
Forwarder is an implementation of the trustedMulticallForwarder contract
func (*Forwarder) Aggregate3Value ¶
func (p *Forwarder) Aggregate3Value(value uint64, arg []forwarder.TrustedMulticallForwarderCall3Value) ([]ForwarderResult, error)
func (*Forwarder) Aggregate3ValueHistorical ¶ added in v0.10.0
func (p *Forwarder) Aggregate3ValueHistorical(value uint64, arg []forwarder.TrustedMulticallForwarderCall3Value, blockNumber *big.Int) ([]ForwarderResult, error)
type ForwarderResult ¶
ForwarderResult is a data struct for the trustedMulticallForwarder method response
type IRawCoreContract ¶ added in v0.6.0
type IRawCoreContract interface { UnpackVaultDebt(value []byte) (*big.Int, error) GetCallDataVaultDebt(poolID *big.Int, collateralType common.Address) ([]byte, error) // Address is used to get perps contract address Address() common.Address }
IRawCoreContract is an interface for the raw implementation of the core data contracts
type IRawERC7412Contract ¶
type IRawERC7412Contract interface { // GetCallFulfillOracleQuery is used to get calldata for fulfillOracleQuery method GetCallFulfillOracleQuery(feedID string) ([]byte, error) // GetCallFulfillOracleQueryAll(feedIDs []string) ([]byte, error) // Address is used to get contract address Address() common.Address }
IRawERC7412Contract is a ERC7412 contract interface
func NewERC7412 ¶
NewERC7412 is used to get new ERC7412 instance
type IRawForwarderContract ¶
type IRawForwarderContract interface { // Aggregate3Value is used to call aggregate3Value contract method Aggregate3Value(value uint64, arg []forwarder.TrustedMulticallForwarderCall3Value) ([]ForwarderResult, error) Aggregate3ValueHistorical(value uint64, arg []forwarder.TrustedMulticallForwarderCall3Value, blockNumber *big.Int) ([]ForwarderResult, error) // Address is used to get contract address Address() common.Address }
IRawForwarderContract is a trustedMulticallForwarder interface
func NewForwarder ¶
func NewForwarder(address common.Address, provider *ethclient.Client) (IRawForwarderContract, error)
NewForwarder is used to get new Forwarder instance
type IRawPerpsContract ¶
type IRawPerpsContract interface { // GetCallDataOpenPosition is used to get calldata for the getOpenPosition method GetCallDataOpenPosition(marketID *big.Int, accountID *big.Int) ([]byte, error) // GetCallDataMarketSummary is used to get calldata for the getMarketSummary method GetCallDataMarketSummary(marketID *big.Int) ([]byte, error) // GetCallDataRequiredMargins(accountID *big.Int) ([]byte, error) // GetCallDataAvailableMargin(accountID *big.Int) ([]byte, error) // UnpackGetMarketSummary is used to unpack outputs for the getMarketSummary method UnpackGetMarketSummary(value []byte) (res *perpsMarket.IPerpsMarketModuleMarketSummary, err error) // UnpackAvailableMargin(value []byte) (res *big.Int, err error) // UnpackRequiredMargins(value []byte) (res struct { RequiredInitialMargin *big.Int RequiredMaintenanceMargin *big.Int MaxLiquidationReward *big.Int }, err error) // UnpackOpenPosition is used to unpack outputs for the getOpenPosition method UnpackOpenPosition(value []byte) (res struct { TotalPnl *big.Int AccruedFunding *big.Int PositionSize *big.Int }, err error) // Address is used to get perps contract address Address() common.Address }
IRawPerpsContract is an interface for the raw implementation of the perps data contracts
type Perps ¶
type Perps struct {
// contains filtered or unexported fields
}
Perps is a raw perps contract implementation
func (*Perps) GetCallDataAvailableMargin ¶ added in v0.3.2
func (*Perps) GetCallDataMarketSummary ¶
func (*Perps) GetCallDataOpenPosition ¶
func (*Perps) GetCallDataRequiredMargins ¶ added in v0.3.2
func (*Perps) UnpackAvailableMargin ¶ added in v0.3.2
func (*Perps) UnpackGetMarketSummary ¶
func (p *Perps) UnpackGetMarketSummary(value []byte) (res *perpsMarket.IPerpsMarketModuleMarketSummary, err error)