diff --git a/classes/SubtopiaClient.html b/classes/SubtopiaClient.html index 4f5dcdc..ad99931 100644 --- a/classes/SubtopiaClient.html +++ b/classes/SubtopiaClient.html @@ -1,7 +1,7 @@
Protected
constructorProtected
constructorClaims a subscription for a given subscriber.
This method is used to create a discount for a subscription. +
This method is used to create a discount for a subscription. The method returns the transaction ID.
Optional
parseA promise that resolves to an object containing the transaction ID.
-This method is used to create a subscription. +
This method is used to create a subscription. It takes a subscriber and a duration as arguments and returns a promise that resolves to an object containing the transaction ID and subscription ID.
A promise that resolves to an object containing the transaction ID and subscription ID.
-This method is used to delete a discount. +
This method is used to delete a discount. It takes a duration object as an argument and returns a promise that resolves to an object containing the transaction ID.
A promise that resolves to an object containing the transaction ID.
-This method is used to delete a subscription. +
This method is used to delete a subscription. It takes a subscriber and a subscription ID as arguments and returns a promise that resolves to an object containing the transaction ID.
A promise that resolves to an object containing the transaction ID.
-This method is used to disable the application (updates the lifecycle). +
This method is used to disable the application (updates the lifecycle). Has to be called before deleting the application. Upon disabling, product will stop allowing new subscriptions to be sold, existing subscribers will only be able to cancel their subscriptions. Product can be deleted once all subscriptions are cancelled or expired. The method returns the transaction ID.
A promise that resolves to an object containing the transaction ID.
-This method is used to enable the application (updates the lifecycle). +
This method is used to get the state of the application. +
This method is used to get the state of the application. It returns an object containing the product name, subscription name, manager, price, total subscriptions, maximum subscriptions, coin ID, subscription type, lifecycle, creation time, oracle ID, unit name, image URL, and discounts.
A boolean indicating whether to parse the whole units (default is true).
A promise that resolves to an object containing the state of the application.
-This method is used to get the discount based on the duration. +
This method is used to get the discount based on the duration. It takes a duration object as an argument and returns a promise that resolves to a DiscountRecord.
A promise that resolves to the discount record.
-This method is used to calculate the locker creation fee. +
This method is used to calculate the locker creation fee. It takes the creator's address as an argument and returns a promise that resolves to the fee amount.
The address of the creator.
A promise that resolves to the locker creation fee.
-This method is used to get a subscription. +
This method is used to get a subscription. It takes an AlgodClient and a subscriber address as arguments and returns a promise that resolves to a SubscriptionRecord.
A promise that resolves to a SubscriptionRecord.
-This method is used to calculate the platform fee for a subscription. +
Checks if a given address is a subscriber.
+Checks if a given address is a subscriber.
The address of the potential subscriber.
This method is used to transfer a subscription from one subscriber to another. +
This method is used to transfer a subscription from one subscriber to another. It takes an old subscriber, a new subscriber address, and a subscription ID as arguments and returns a promise that resolves to an object containing the transaction ID.
A promise that resolves to an object containing the transaction ID.
-Protected
updateThis method is used to update the lifecycle state of the application. +
Protected
updateThis method is used to update the lifecycle state of the application. The method returns the transaction ID.
The new lifecycle state.
A promise that resolves to an object containing the transaction ID.
-Static
initThis method initializes a SubtopiaClient instance. +
Static
initThis method initializes a SubtopiaClient instance. It retrieves the product's global state, validates it, and instantiates a new SubtopiaClient.
Optional
timeout?: numberA promise that resolves to a SubtopiaClient instance.
import { SubtopiaClient } from "@algorand/subtopia";
const subtopiaClient = await SubtopiaClient.init({
algodClient: algodClient,
productID: productID,
creator: creator
});
-Generated using TypeDoc
Generated using TypeDoc
The
-SubtopiaClient
class is responsible for interacting with a Subtopia Product contracts on the Algorand blockchain. It provides methods for initializing the client, managing the lifecycle of the application, creating and managing subscriptions, and retrieving information about the application and subscriptions.