UNPKG

@mysten/suins

Version:
144 lines (143 loc) 4.22 kB
import { DiscountInfo, ReceiptParams, RegistrationParams, RenewalParams } from "./types.mjs"; import { SuinsClient } from "./suins-client.mjs"; import * as _mysten_sui_transactions0 from "@mysten/sui/transactions"; import { Transaction, TransactionObjectArgument, TransactionObjectInput } from "@mysten/sui/transactions"; //#region src/suins-transaction.d.ts declare class SuinsTransaction { suinsClient: SuinsClient; transaction: Transaction; constructor(client: SuinsClient, transaction: Transaction); /** * Registers a domain for a number of years. */ register(params: RegistrationParams): TransactionObjectArgument; /** * Renews an NFT for a number of years. */ renew(params: RenewalParams): void; initRegistration(domain: string): TransactionObjectArgument; initRenewal(nft: TransactionObjectInput, years: number): TransactionObjectArgument; calculatePrice(baseAmount: TransactionObjectArgument, paymentType: string, priceInfoObjectId: string): TransactionObjectArgument; handleBasePayment(paymentIntent: TransactionObjectArgument, paymentArg: TransactionObjectArgument, paymentType: string): TransactionObjectArgument; handlePayment(paymentIntent: TransactionObjectArgument, paymentArg: TransactionObjectArgument, paymentType: string, priceInfoObjectId: string, maxAmount?: bigint): TransactionObjectArgument; finalizeRegister(receipt: TransactionObjectArgument): TransactionObjectArgument; finalizeRenew(receipt: TransactionObjectArgument, nft: TransactionObjectInput): TransactionObjectArgument; calculatePriceAfterDiscount(paymentIntent: TransactionObjectArgument, paymentType: string): TransactionObjectArgument; generateReceipt(params: ReceiptParams): TransactionObjectArgument; /** * Applies a coupon to the payment intent. */ applyCoupon(intent: TransactionObjectArgument, couponCode: string): TransactionObjectArgument; /** * Applies a discount to the payment intent. */ applyDiscount(intent: TransactionObjectArgument, discountInfo: DiscountInfo): void; /** * Creates a subdomain. */ createSubName({ parentNft, name, expirationTimestampMs, allowChildCreation, allowTimeExtension }: { parentNft: TransactionObjectInput; name: string; expirationTimestampMs: number; allowChildCreation: boolean; allowTimeExtension: boolean; }): _mysten_sui_transactions0.TransactionResult; /** * Builds the PTB to create a leaf subdomain. * Parent can be a `SuinsRegistration` or a `SubDomainRegistration` object. * Can be passed in as an ID or a TransactionArgument. */ createLeafSubName({ parentNft, name, targetAddress }: { parentNft: TransactionObjectInput; name: string; targetAddress: string; }): void; /** * Removes a leaf subname. */ removeLeafSubName({ parentNft, name }: { parentNft: TransactionObjectInput; name: string; }): void; /** * Sets the target address of an NFT. */ setTargetAddress({ nft, // Can be string or argument address, isSubname }: { nft: TransactionObjectInput; address?: string; isSubname?: boolean; }): void; /** * Sets a default name for the user. */ setDefault(name: string): void; /** * Edits the setup of a subname. */ editSetup({ parentNft, name, allowChildCreation, allowTimeExtension }: { parentNft: TransactionObjectInput; name: string; allowChildCreation: boolean; allowTimeExtension: boolean; }): void; /** * Extends the expiration of a subname. */ extendExpiration({ nft, expirationTimestampMs }: { nft: TransactionObjectInput; expirationTimestampMs: number; }): void; /** * Sets the user data of an NFT. */ setUserData({ nft, value, key, isSubname }: { nft: TransactionObjectInput; value: string; key: string; isSubname?: boolean; }): void; /** * Burns an expired NFT to collect storage rebates. */ burnExpired({ nft, isSubname }: { nft: TransactionObjectInput; isSubname?: boolean; }): void; } //#endregion export { SuinsTransaction }; //# sourceMappingURL=suins-transaction.d.mts.map