@mysten/suins
Version:
40 lines (39 loc) • 1.58 kB
TypeScript
import type { SuiClient } from '@mysten/sui/client';
import type { Transaction } from '@mysten/sui/transactions';
import type { CoinTypeDiscount, NameRecord, Network, PackageInfo, SuinsClientConfig, SuinsPriceList } from './types.js';
export declare class SuinsClient {
client: SuiClient;
network: Network;
config: PackageInfo;
constructor(config: SuinsClientConfig);
/**
* Returns the price list for SuiNS names in the base asset.
*/
getPriceList(): Promise<SuinsPriceList>;
/**
* Returns the renewal price list for SuiNS names in the base asset.
*/
getRenewalPriceList(): Promise<SuinsPriceList>;
/**
* Returns the coin discount list for SuiNS names.
*/
getCoinTypeDiscount(): Promise<CoinTypeDiscount>;
getNameRecord(name: string): Promise<NameRecord | null>;
/**
* Calculates the registration or renewal price for an SLD (Second Level Domain).
* It expects a domain name, the number of years and a `SuinsPriceList` object,
* as returned from `suinsClient.getPriceList()` function, or `suins.getRenewalPriceList()` function.
*
* It throws an error:
* 1. if the name is a subdomain
* 2. if the name is not a valid SuiNS name
* 3. if the years are not between 1 and 5
*/
calculatePrice({ name, years, isRegistration, }: {
name: string;
years: number;
isRegistration?: boolean;
}): Promise<number>;
getPriceInfoObject(tx: Transaction, feed: string): Promise<string[]>;
getObjectType(objectId: string): Promise<string>;
}