Construct a new BaseAPI object.
An instance of the Premia SDK.
The address of the Orderbook contract.
The address of the Pool Factory contract.
Readonly
premiaThe address of the PremiaStaking
contract.
The address of the UserSettings
contract.
The address of the Vault Registry contract.
The address of the VxPremia
contract.
Connects to an ERC1155 contract using a provider.
This function leverages the ERC1155__factory
to connect to a ERC1155 contract.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
The address of the pool contract to connect to.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected ERC1155 contract instance.
Connects to an ERC4626 contract using a provider.
This function leverages the ERC4626__factory
to connect to a ERC4626 contract.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
The address of the Vault contract to connect to.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected ERC4626 contract instance.
Connects to an Oracle Adapter contract at a given address using a provider.
This function leverages the IOracleAdapter__factory
to connect to an Oracle Adapter contract on the blockchain.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
The address of the Oracle Adapter contract to connect to.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected Oracle Adapter contract instance.
Connects to the Orderbook contract using a provider.
This function leverages the OrderbookStream__factory
to connect to the Orderbook contract.
If no provider is specified, it will default to using the novaSigner or novaProvider from the premia
object.
Will throw an error if the connection to the contract fails.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.novaSigner
or this.premia.novaProvider
.
The connected Orderbook contract instance.
Connects to a pool contract at a given address using a provider.
This function uses the IPool__factory
to connect to a pool contract on the blockchain.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
The address of the pool contract to connect to.
Optional
provider: ProviderThe provider to use for the connection. If not specified, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected pool contract instance.
Connects to the Pool Factory contract using a provider.
This function utilizes the IPoolFactory__factory
to connect to the Pool Factory contract.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected Pool Factory contract instance.
Connects to a token contract at a given address using a provider.
This function utilizes the SolidStateERC20__factory
to connect to a token contract on the blockchain.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
The address of the token contract to connect to.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function will default to using this.premia.signer
or this.premia.provider
.
The connected token contract instance.
Connects to the UserSettings contract using a provider.
This function leverages the UserSettings__factory
to connect to the UserSettings contract.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected UserSettings contract instance.
Connects to a Vault contract at a given address using a provider.
This function utilizes the IVault__factory
to connect to a Vault contract.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
The address of the Vault contract to connect to.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected Vault contract instance.
Connects to the Vault Registry contract using a provider.
This function utilizes the IVaultRegistry__factory
to connect to the Vault Factory contract.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected Vault Factory contract instance.
Connects to the VxPremia contract using a provider.
This function leverages the VxPremia __factory
to connect to the VxPremia contract.
If no provider is specified, it will default to using the signer or provider from the premia
object.
Will throw an error if the connection to the contract fails.
Optional
provider: ProviderThe provider to use for the connection. If not provided, the function defaults to using this.premia.signer
or this.premia.provider
.
The connected VxPremia contract instance.
Generated using TypeDoc
The
ContractAPI
class extendsBaseAPI
and is used for interacting with various types of contracts pertaining to the Premia protocol.It includes methods for connecting to Pool, Token, Oracle Adapter, Pool Factory, Vault Registry, Vault, and Orderbook contracts. The connection to the contracts is made using a
Provider
, which defaults topremia.signer
orpremia.provider
if not provided.The class also includes methods for setting the addresses for the Orderbook, Pool Factory, and Vault Registry contracts.