Skip to main content

sdk.basecontract

Home > @openformat/sdk > BaseContract

BaseContract class

Creates a new instance of the BaseContract which manages the provider and signer

Signature:

export declare class BaseContract 

Constructors

ConstructorModifiersDescription
(constructor)(provider, appId, signer)Constructs a new instance of the BaseContract class

Properties

PropertyModifiersTypeDescription
appIdstring
providerproviders.Provider
signer?Signer | undefined(Optional)
subgraphEndpoint?string(Optional)

Methods

MethodModifiersDescription
checkNetworksMatch()protectedThrows an error if the current signer and provider's networks differ
getGasPrice()protected

getGasPrice function to fetch the appropriate gas parameters.

This function checks if the network supports EIP-1559 and returns the appropriate gas parameters for a transaction. If EIP-1559 is not supported, it uses the standard gas price.

getSubgraphEndpoint()
setStarId(starId)