UNPKG

@iota/iota-names-sdk

Version:
78 lines (77 loc) 2.11 kB
import { Network } from '@iota/iota-sdk/client'; import { IotaGraphQLClient } from '@iota/iota-sdk/graphql'; import type { TransactionObjectArgument, TransactionObjectInput } from '@iota/iota-sdk/transactions'; import { CouponBcs, CouponHouseBcs } from './bcs'; export interface CoinConfig { type: string; } export type PackageInfo = { adminAddress: string; adminCap: string; auctionPackageId: string; auctionHouseObjectId: string; coins: { [key: string]: { type: string; metadataId: string; }; }; couponsPackageId: string; iotaNamesObjectId: string; packageId: string; paymentsPackageId: string; publisherId: string; registryTableId: string; reverseRegistryTableId: string; subnamesPackageId: string; tempSubnameProxyPackageId: string; upgradeCap: string; }; export interface NameRecord { name: string; nftId: string; targetAddress: string; expirationTimestampMs: number; data: Record<string, string>; avatar?: string; } export type VersionedPackageId = { latest: string; v1: string; [key: string]: string; }; export type BaseParams = { coinConfig?: CoinConfig; coin: TransactionObjectInput; couponCodes?: string[]; address?: string; }; export type RegistrationParams = BaseParams & { name: string; }; export type RenewalParams = BaseParams & { name: string; nft: TransactionObjectInput; years: number; }; export type ReceiptParams = { paymentIntent: TransactionObjectArgument; payment: TransactionObjectArgument; coinConfig: CoinConfig; }; export type CouponHouse = typeof CouponHouseBcs.$inferType; export type Coupon = typeof CouponBcs.$inferType & { couponCode: string; }; export type IotaNamesClientConfig = { graphQlClient: IotaGraphQLClient; } & IotaNamesClientNetworkConfig; export type IotaNamesClientNetworkConfig = { network: Network; } | { packageInfo: PackageInfo; }; export type IotaNamesPriceList = Map<[number, number], number>; export type IotaNamesCoreConfig = { max_years: number; };