@superfluid-finance/sdk-core
Version:
SDK Core for building with Superfluid Protocol
119 lines • 6.57 kB
TypeScript
import Host from "./Host";
import Operation from "./Operation";
import SuperfluidAgreement from "./SuperfluidAgreement";
import { IApproveSubscriptionParams, IClaimParams, ICreateIndexParams, IDeleteSubscriptionParams, IDistributeParams, IGetIndexParams, IGetSubscriptionParams, IRevokeSubscriptionParams, IUpdateIndexValueParams, IUpdateSubscriptionUnitsParams, IWeb3Index, IWeb3Subscription } from "./interfaces";
import { IInstantDistributionAgreementV1 } from "./typechain-types";
/**
* Instant Distribution Agreement V1 Helper Class
* @description A helper class to interact with the IDAV1 contract.
*/
export default class InstantDistributionAgreementV1 extends SuperfluidAgreement {
readonly host: Host;
readonly contract: IInstantDistributionAgreementV1;
constructor(hostAddress: string, idaV1Address: string);
/** ### IDA Read Functions ### */
/**
* Get the details of a `Subscription`.
* @param superToken the superToken of the agreement
* @param publisher the address of the publisher of the index
* @param indexId the index id
* @param subscriber the subscriber's address
* @param providerOrSigner a provider or signer object
* @returns {Promise<IWeb3Subscription>} Web3 Subscription object
*/
getSubscription: (params: IGetSubscriptionParams) => Promise<IWeb3Subscription>;
/**
* Get the details of an `Index`.
* @param superToken the superToken of the agreement
* @param publisher the address of the publisher of the index
* @param indexId the index id
* @param providerOrSigner a provider or signer object
* @returns {Promise<IWeb3Index>} Web3 Index object
*/
getIndex: (params: IGetIndexParams) => Promise<IWeb3Index>;
/** ### IDA Write Functions ### */
/**
* Creates an IDA Index.
* @param indexId The id of the index.
* @param superToken The address of the `index` superToken.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
createIndex: (params: ICreateIndexParams) => Operation;
/**
* Distributes `amount` of `superToken` to an index
* @param indexId The id of the index.
* @param amount The amount of `superToken` to be distributed.
* @param superToken The superToken to be distributed.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
distribute: (params: IDistributeParams) => Operation;
/**
* Updates the `indexValue` of an index.
* @description NOTE: It has the same effect as `distribute`, but is closer to the low level data structure of the index.
* @param indexId The id of the index.
* @param indexValue The new indexValue.
* @param superToken The superToken to be distributed.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
updateIndexValue: (params: IUpdateIndexValueParams) => Operation;
/**
* Updates the `units` allocated to a Subscription.
* @param indexId The id of the index.
* @param superToken The superToken of the index.
* @param subscriber The subscriber address whose units you want to update.
* @param units The amount of units you want to update to.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
updateSubscriptionUnits: (params: IUpdateSubscriptionUnitsParams) => Operation;
/**
* Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
* @param indexId The id of the index.
* @param superToken The superToken of the index.
* @param publisher The publisher of the index you want to approve.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
approveSubscription: (params: IApproveSubscriptionParams) => Operation;
/**
* Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
* @param indexId The id of the index.
* @param superToken The superToken of the index.
* @param subscriber The subscriber address whose subscription you want to revoke.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
revokeSubscription: (params: IRevokeSubscriptionParams) => Operation;
/**
* Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
* @param indexId The id of the index.
* @param superToken The superToken of the index.
* @param subscriber The subscriber address whose subscription you want to delete.
* @param publisher The publisher address of the index you are targeting.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
deleteSubscription: (params: IDeleteSubscriptionParams) => Operation;
/**
* Claims any pending tokens allocated to the Subscription (unapproved).
* @param indexId The id of the index.
* @param superToken The superToken of the index.
* @param subscriber The subscriber address whose subscription you want to delete.
* @param publisher The publisher address of the index you are targeting.
* @param userData Extra user data provided.
* @param overrides ethers overrides object for more control over the transaction sent.
* @returns {Operation} An instance of Operation which can be executed or batched.
*/
claim: (params: IClaimParams) => Operation;
}
//# sourceMappingURL=InstantDistributionAgreementV1.d.ts.map