Protected
Readonly
_contractThe wrapped contract that the entity is holding.
This should not be used directly. Instead, the getter contract
should
be used to have the correct type of the wrapped contract.
Readonly
addressthe inner contract address
Readonly
chainOptional
Readonly
multicallThe Multicall
instance used by this entity.
Readonly
networkThe networkConnection
of this entity.
Private
readthis._contract
but with the casted type.
PendleEntity#_contract
The config of this entity.
It can be used to pass as configuration for a new entity. It should be overridden in the subclass.
Get the address of the PT token, correspond to this market.
Optional
params: MulticallStaticParamsthe additional parameters for read method.
The naming is in uppercase to reflect the same function of the contract.
Get the address of the SY token, correspond to this market.
Optional
params: MulticallStaticParamsthe additional parameters for read method.
The naming is in uppercase to reflect the same function of the contract.
Optional
params: MulticallStaticParamsGet the active balance of a give user.
Optional
params: MulticallStaticParamsthe additional parameters for read method.
Merge user-defined parameters with the default parameters (from
getDefaultMetaMethodExtraParam()
) and return the result to use use in a
write method.
the type of the meta method, used to determine the correct return type of the write functions.
the user defined parameters
the merged parameters
Get the allowance
the owner's address
the spender's address
Optional
params: MulticallStaticParamsthe balance of the user
Perform ERC20's approve
method.
the type of the meta method. This should be infer by tsc
to
determine the correct return type. See
ERC20 contract interaction tutorial with Pendle SDK
to see the example usage with explanation.
the spender's Address
the amount to approve
the additional parameters for write method.
When params
is not defined, or when params.method
is not defined, this
method will perform the transaction, and return
Promise<ethers.ContractTransaction>
.
Otherwise, params.method
's value is used to determine the return type.
See MetaMethodReturnType for the detailed explanation of the return type.
Get the balance of an user, given the account
the account address of the user
Optional
params: MulticallStaticParamsthe additional parameters for read method.
the balance of the user
Get the decimals of the token
Optional
params: MulticallStaticParamsthe additional parameters for read method.
the decimals of the token.
the set of parameters for an entity's write-method (that will do
a metaCall
). It should be overridden in the subclass.
Get the info of the market.
Optional
params: MulticallStaticParams & { the additional parameters for read method.
Get the reward tokens of a market.
Optional
params: MulticallStaticParamsthe additional parameters for read method.
List of addresses of the reward tokens.
Get the market info of an user.
Optional
params: MulticallStaticParams & { the additional parameters for read method.
use the individual functions that returns the corresponding fields instead.
Get the name of the token
Optional
params: MulticallStaticParamsthe additional parameters for read method.
the name of the token.
Alias for MarketEntity#PT
Optional
params: MulticallStaticParamsGet the entity of the PT token, correspond to this market.
Optional
params: MulticallStaticParams & { the additional parameters for read method.
Get the market state of a given router.
Optional
params: MulticallStaticParams & { the additional parameters for read method.
The market state base on the router address.
Perform the redeem reward action.
the type of the meta method. This should be infer by tsc
to
determine the correct return type. See
ERC20 contract interaction tutorial with Pendle SDK
to see the example usage with explanation.
the receiver address.
the additional parameters for write method.
When params
is not defined, or when params.method
is not defined, this
method will perform the transaction, and return
Promise<ethers.ContractTransaction>
.
Otherwise, params.method
's value is used to determine the return type.
See MetaMethodReturnType for the detailed explanation of the return type.
Simulate the redeem rewards actions, and return only the amounts for each reward tokens.
the receiver address.
This function cannot be called with multicall because it is not a views
function.
Calling with multicall will mutate the contract's state.
Simulate the redeem rewards actions, and return only the list of pair of token address with the corresponding amount.
Optional
params: MulticallStaticParamsthe additional parameters for read method.
Alias for MarketEntity#SY
Optional
params: MulticallStaticParamsGet the entity of the SY token, correspond to this market.
Optional
params: MulticallStaticParams & { the additional parameters for read method.
Get the symbol of the token
Optional
params: MulticallStaticParamsthe additional parameters for read method.
the symbol of the token.
Get the total supply of the token
Optional
params: MulticallStaticParamsthe additional parameters for read method.
the total supply of the token.
Perform ERC20's transfer
method.
the type of the meta method. This should be infer by tsc
to
determine the correct return type. See
ERC20 contract interaction tutorial with Pendle SDK
to see the example usage with explanation.
the receiver's Address
the amount to transfer
the additional parameters for write method.
When params
is not defined, or when params.method
is not defined,
this method will perform the transaction, and return
Promise<ethers.ContractTransaction>
.
Otherwise, params.method
's value is used to determine the return type.
See MetaMethodReturnType for the detailed explanation of the return type.
Alias for MarketEntity#YT
Optional
params: MulticallStaticParamsGet the entity of the PT token, correspond to this market.
Optional
params: MulticallStaticParams & { the additional parameters for read method.
Static
createStatic
toConvert IPRouterStatic.UserMarketInfoStructOutput to UserMarketInfo.
Both structures have the same shape, but the return type has a stricter type.
Generated using TypeDoc
This class represents an ERC20 token