rawContracts

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

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) Address added in v0.6.0

func (p *Core) Address() common.Address

func (*Core) GetCallDataVaultDebt added in v0.6.0

func (p *Core) GetCallDataVaultDebt(poolID *big.Int, collateralType common.Address) ([]byte, error)

func (*Core) UnpackVaultDebt added in v0.6.0

func (p *Core) UnpackVaultDebt(value []byte) (*big.Int, error)

type ERC7412

type ERC7412 struct {
	// contains filtered or unexported fields
}

ERC7412 is data struct for erc7412 contract implementation

func (*ERC7412) Address

func (p *ERC7412) Address() common.Address

func (*ERC7412) GetCallFulfillOracleQuery

func (p *ERC7412) GetCallFulfillOracleQuery(feedID string) ([]byte, error)

func (*ERC7412) GetCallFulfillOracleQueryAll added in v0.3.2

func (p *ERC7412) GetCallFulfillOracleQueryAll(feedIDs []string) ([]byte, error)

type Forwarder

type Forwarder struct {
	// contains filtered or unexported fields
}

Forwarder is an implementation of the trustedMulticallForwarder contract

func (*Forwarder) Address

func (p *Forwarder) Address() common.Address

func (*Forwarder) Aggregate3Value

func (*Forwarder) Aggregate3ValueHistorical added in v0.10.0

func (p *Forwarder) Aggregate3ValueHistorical(value uint64, arg []forwarder.TrustedMulticallForwarderCall3Value, blockNumber *big.Int) ([]ForwarderResult, error)

type ForwarderResult

type ForwarderResult struct {
	Success    bool
	ReturnData []byte
}

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

func NewCore added in v0.6.0

func NewCore(address common.Address, provider *ethclient.Client) (IRawCoreContract, error)

NewCore is used to get new Core instance

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

func NewERC7412(address common.Address, provider *ethclient.Client) (IRawERC7412Contract, error)

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

func NewPerps

func NewPerps(address common.Address, provider *ethclient.Client) (IRawPerpsContract, error)

NewPerps is used to get new Perps instance

type Perps

type Perps struct {
	// contains filtered or unexported fields
}

Perps is a raw perps contract implementation

func (*Perps) Address

func (p *Perps) Address() common.Address

func (*Perps) GetCallDataAvailableMargin added in v0.3.2

func (p *Perps) GetCallDataAvailableMargin(accountID *big.Int) ([]byte, error)

func (*Perps) GetCallDataMarketSummary

func (p *Perps) GetCallDataMarketSummary(marketID *big.Int) ([]byte, error)

func (*Perps) GetCallDataOpenPosition

func (p *Perps) GetCallDataOpenPosition(marketID *big.Int, accountID *big.Int) ([]byte, error)

func (*Perps) GetCallDataRequiredMargins added in v0.3.2

func (p *Perps) GetCallDataRequiredMargins(accountID *big.Int) ([]byte, error)

func (*Perps) UnpackAvailableMargin added in v0.3.2

func (p *Perps) UnpackAvailableMargin(value []byte) (res *big.Int, err error)

func (*Perps) UnpackGetMarketSummary

func (p *Perps) UnpackGetMarketSummary(value []byte) (res *perpsMarket.IPerpsMarketModuleMarketSummary, err error)

func (*Perps) UnpackOpenPosition

func (p *Perps) UnpackOpenPosition(value []byte) (res struct {
	TotalPnl       *big.Int
	AccruedFunding *big.Int
	PositionSize   *big.Int
}, err error)

func (*Perps) UnpackRequiredMargins added in v0.3.2

func (p *Perps) UnpackRequiredMargins(value []byte) (res struct {
	RequiredInitialMargin     *big.Int
	RequiredMaintenanceMargin *big.Int
	MaxLiquidationReward      *big.Int
}, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL