Categorygithub.com/ApeX-Protocol/multicall-go
modulepackage
1.0.0
Repository: https://github.com/apex-protocol/multicall-go.git
Documentation: pkg.go.dev

# README

multicall-go

The multi call of Golang

Usage

func GetPrice(ctx context.Context, pairAddress string) (*big.Int, error) {
	mc := multicall.NewMultiCall(multicall.ArbitrumTestnetRpc, 
		multicall.ArbitrumTestnetMultiCallAddress)
	
	calls := []*multicall.ViewCall{
		{"key-1", contract.PriceOracleMetaData.ABI,
			"0xe7F83e97BC5Fd77CCf4CD25c17Fcb566E7c62781",
			"getMarkPrice",
			[]interface{}{common.HexToAddress(pairAddress)}},
	}
	
	result, err := mc.CallTargets(ctx, calls)
	if err != nil {
		return nil, err
	}
	
	gotVal, ok := result["key-1"]
	if !ok {
		return nil, err
	} 
	
	price := gotVal[0].(*big.Int)
	return price, nil
}

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author

# Constants

arbitrum One chain.
arbitrum One chain.
arbitrum One chain.
arbitrum One chain.
binance smart chain.
binance smart chain.
binance smart chain.
binance smart chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
via: https://rpc.info/ and https://github.com/makerdao/multicall eth chain.
polygon matic chain.
polygon matic chain.
polygon matic chain.
polygon matic chain.

# Structs

No description provided by the author

# Interfaces

No description provided by the author