@superfluid-finance/sdk-core
Version:
SDK Core for building with Superfluid Protocol
175 lines • 8.05 kB
TypeScript
import { ContractTransaction, ethers } from "ethers";
import { ClaimableData, ClaimAllForMemberParams, ERC20AllowanceParams, ERC20ApproveParams, ERC20BalanceOfParams, ERC20TransferFromParams, ERC20TransferParams, GetClaimableNowParams, GetClaimableParams, GetDisconnectedBalanceParams, GetMemberFlowRateParams, GetTotalAmountReceivedByMemberParams, GetUnitsParams, SuperfluidPoolDecreaseAllowanceParams, SuperfluidPoolIncreaseAllowanceParams, UpdateMemberParams } from "./interfaces";
import { ISuperfluidPool } from "./typechain-types";
/**
* Superfluid Pool Helper Class
* @description A helper class to interact with the SuperfluidPool contract.
*/
export default class SuperfluidPoolClass {
readonly contract: ISuperfluidPool;
constructor(poolAddress: string);
/**
* Retrieves the pool admin.
* @param providerOrSigner A provider or signer object
* @returns The pool admin.
*/
getPoolAdmin: (providerOrSigner: ethers.providers.Provider | ethers.Signer) => Promise<string>;
/**
* Retrieves the SuperToken.
* @param providerOrSigner A provider or signer object
* @returns The SuperToken for this pool.
*/
getSuperToken: (providerOrSigner: ethers.providers.Provider | ethers.Signer) => Promise<string>;
/**
* Retrieves the total units.
* Returns the same value as totalSupply.
* @param providerOrSigner A provider or signer object
* @returns The total units.
*/
getTotalUnits: (providerOrSigner: ethers.providers.Provider | ethers.Signer) => Promise<string>;
/**
* Retrieves the total connected units.
* @param providerOrSigner A provider or signer object
* @returns The total connected units.
*/
getTotalConnectedUnits: (providerOrSigner: ethers.providers.Provider | ethers.Signer) => Promise<string>;
/**
* Retrieves the units for a specific member.
* @param member The member's address.
* @param providerOrSigner A provider or signer object
* @returns The units for the specified member.
*/
getUnits: (params: GetUnitsParams) => Promise<string>;
/**
* Retrieves the total connected flow rate.
* @param providerOrSigner A provider or signer object
* @returns The total connected flow rate.
*/
getTotalConnectedFlowRate: (providerOrSigner: ethers.providers.Provider | ethers.Signer) => Promise<string>;
/**
* Retrieves the total disconnected flow rate.
* @param providerOrSigner A provider or signer object
* @returns The total disconnected flow rate.
*/
getTotalDisconnectedFlowRate: (providerOrSigner: ethers.providers.Provider | ethers.Signer) => Promise<string>;
/**
* Retrieves the disconnected balance for the pool a specific time.
* @param time The time of the disconnected balance.
* @param providerOrSigner A provider or signer object
* @returns The disconnected balance.
*/
getDisconnectedBalance: (params: GetDisconnectedBalanceParams) => Promise<string>;
/**
* Retrieves the flow rate for a specific member.
* @param member The member's address.
* @param providerOrSigner A provider or signer object
* @returns The flow rate for the specified member.
*/
getMemberFlowRate: (params: GetMemberFlowRateParams) => Promise<string>;
/**
* Retrieves the flow rate for a specific member.
* @param member The member's address.
* @param providerOrSigner A provider or signer object
* @returns The total amount received by the member.
*/
getTotalAmountReceivedByMember: (params: GetTotalAmountReceivedByMemberParams) => Promise<string>;
/**
* Retrieves the claimable amount for a specific member and time.
* @param member The member's address.
* @param time The amount claimable at time.
* @param providerOrSigner A provider or signer object
* @returns The claimable amount.
*/
getClaimable: (params: GetClaimableParams) => Promise<string>;
/**
* Retrieves the claimable amount for a specific member at the current time.
* @param member The member's address.
* @param providerOrSigner A provider or signer object
* @returns ClaimableData: { timestamp, claimableBalance }
*/
getClaimableNow: (params: GetClaimableNowParams) => Promise<ClaimableData>;
/**
* Updates the units for a specific member.
* @param member The member's address.
* @param newUnits The new units value.
* @param signer The transaction signer.
* @returns A promise that resolves when the update is complete.
*/
updateMemberUnits: (params: UpdateMemberParams) => Promise<ContractTransaction>;
/**
* Claims all available funds for a specific member.
* @param member The member's address.
* @param signer The transaction signer.
* @returns A promise that resolves when the claim is complete.
*/
claimAllForMember: (params: ClaimAllForMemberParams) => Promise<ContractTransaction>;
/**
* Claims all available funds.
* @returns A promise that resolves when the claim is complete.
*/
claimAll: (signer: ethers.Signer) => Promise<ContractTransaction>;
/**
* Increases the allowance for a specific spender.
* @param spender The spender's address.
* @param amount The amount to increase the allowance by.
* @param signer The transaction signer.
* @returns A promise that resolves when the allowance increase is complete.
*/
increaseAllowance: (params: SuperfluidPoolIncreaseAllowanceParams) => Promise<ContractTransaction>;
/**
* Decreases the allowance for a specific spender.
* @param spender The spender's address.
* @param amount The amount to decrease the allowance by.
* @param signer The transaction signer.
* @param overrides The transaction overrides.
* @returns A promise that resolves when the allowance decrease is complete.
*/
decreaseAllowance: (params: SuperfluidPoolDecreaseAllowanceParams) => Promise<ContractTransaction>;
/**
* Retrieves the total supply.
* Returns the same value as getTotalUnits.
* @returns The total supply.
*/
totalSupply: (providerOrSigner: ethers.providers.Provider | ethers.Signer) => Promise<string>;
/**
* Retrieves the balance of an account.
* @param account The account's address.
* @param providerOrSigner A provider or signer object
* @returns The account's balance.
*/
balanceOf: (params: ERC20BalanceOfParams) => Promise<string>;
/**
* Retrieves the allowance for a specific owner and spender.
* @param owner The owner's address.
* @param spender The spender's address.
* @param providerOrSigner A provider or signer object
* @returns The allowance.
*/
allowance: (params: ERC20AllowanceParams) => Promise<string>;
/**
* Approves an amount to be spent by a specific spender.
* @param spender The spender's address.
* @param amount The amount to approve.
* @param signer The transaction signer.
* @returns A promise that resolves when the approval is complete.
*/
approve: (params: ERC20ApproveParams) => Promise<ContractTransaction>;
/**
* Transfers an amount to a specific recipient.
* @param to The recipient's address.
* @param amount The amount to transfer.
* @param signer The transaction signer.
* @returns A promise that resolves when the transfer is complete.
*/
transfer: (params: ERC20TransferParams) => Promise<ContractTransaction>;
/**
* Transfers an amount from a specific sender to a recipient.
* @param from The sender's address.
* @param to The recipient's address.
* @param amount The amount to transfer.
* @param signer The transaction signer.
* @returns A promise that resolves when the transfer is complete.
*/
transferFrom: (params: ERC20TransferFromParams) => Promise<ContractTransaction>;
}
//# sourceMappingURL=SuperfluidPool.d.ts.map