aftermath-ts-sdk
Version:
Aftermath TypeScript SDK
50 lines • 2.03 kB
TypeScript
import { AftermathApi } from "../../general/providers";
import { Caller } from "../../general/utils/caller";
import { CallerConfig, SuiAddress } from "../../types";
/**
* The `ReferralVault` class provides functionality for querying and managing
* referral information within the Aftermath protocol. It allows you to look
* up the referrer for a given address.
*/
export declare class ReferralVault extends Caller {
private readonly Provider?;
/**
* Contains static configuration relevant to the referral system, if any.
* Currently empty but can be extended for future needs.
*/
static readonly constants: {};
/**
* Creates a new instance of `ReferralVault` to interact with referral-related
* features in the Aftermath protocol.
*
* @param config - Optional caller configuration, including Sui network and access token.
* @param Provider - An optional `AftermathApi` provider instance for referral-specific methods.
*/
constructor(config?: CallerConfig, Provider?: AftermathApi | undefined);
/**
* Retrieves the referrer address for a specified referee (user).
*
* @param inputs - An object containing the `referee` Sui address.
* @returns A promise that resolves to either the referrer's `SuiAddress` or the string `"None"` if no referrer exists.
*
* @example
* ```typescript
* const afSdk = new Aftermath("MAINNET");
* await afSdk.init(); // initialize provider
*
* const referralVault = afSdk.ReferralVault();
*
* const referrer = await referralVault.getReferrer({ referee: "0x<user_address>" });
* console.log("Referrer address:", referrer);
* ```
*/
getReferrer(inputs: {
referee: SuiAddress;
}): Promise<SuiAddress | "None">;
/**
* Internal helper to retrieve the configured `ReferralVault` provider from
* `AftermathApi`, throwing an error if not defined.
*/
private useProvider;
}
//# sourceMappingURL=referralVault.d.ts.map