@iota/iota-names-sdk
Version:
IOTA-Names SDK
109 lines (108 loc) • 3.98 kB
TypeScript
import type { Transaction, TransactionObjectArgument, TransactionObjectInput } from '@iota/iota-sdk/transactions';
import type { IotaNamesClient } from './iota-names-client.js';
import type { ReceiptParams, RegistrationParams, RenewalParams } from './types.js';
export declare class IotaNamesTransaction {
iotaNamesClient: IotaNamesClient;
transaction: Transaction;
constructor(client: IotaNamesClient, transaction: Transaction);
/**
* Registers a name.
*/
register(params: RegistrationParams): Promise<TransactionObjectArgument>;
/**
* Renews an NFT for a number of years.
*/
renew(params: RenewalParams): Promise<void>;
initRegistration(name: string): TransactionObjectArgument;
initRenewal(nft: TransactionObjectInput, years: number): TransactionObjectArgument;
handleBasePayment(paymentIntent: TransactionObjectArgument, payment: TransactionObjectArgument, paymentType: string): TransactionObjectArgument;
finalizeRegister(receipt: TransactionObjectArgument): TransactionObjectArgument;
finalizeRenew(receipt: TransactionObjectArgument, nft: TransactionObjectInput): TransactionObjectArgument;
getBasePrice(paymentIntent: TransactionObjectArgument): TransactionObjectArgument;
applyCoupon(couponCode: string, paymentIntent: TransactionObjectArgument): import("@iota/iota-sdk/dist/cjs/transactions/Transaction.js").TransactionResult;
generateReceipt(params: ReceiptParams): TransactionObjectArgument;
/**
* Creates a subname.
*/
createSubname({ parentNft, name, expirationTimestampMs, allowChildCreation, allowTimeExtension, }: {
parentNft: TransactionObjectInput;
name: string;
expirationTimestampMs: number;
allowChildCreation: boolean;
allowTimeExtension: boolean;
}): import("@iota/iota-sdk/dist/cjs/transactions/Transaction.js").TransactionResult;
/**
* Builds the PTB to create a leaf subname.
* Parent can be a `NameRegistration` or a `SubnameRegistration` 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;
/**
* Unsets a default name for the user.
*/
unsetDefault(): 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;
/**
* Unsets the user data of an NFT.
*/
unsetUserData({ nft, key, isSubname, }: {
nft: TransactionObjectInput;
key: string;
isSubname?: boolean;
}): void;
/**
* Burns an expired NFT to collect storage rebates.
*/
burnExpired({ nft, isSubname }: {
nft: TransactionObjectInput;
isSubname?: boolean;
}): void;
}