UNPKG

@stacks/bns

Version:

Library for working with the Stacks Blockchain Naming System BNS.

134 lines (133 loc) 5.02 kB
import { IntegerType, PublicKey } from '@stacks/common'; import { StacksNetwork } from '@stacks/network'; import { ClarityValue, PostCondition, StacksTransactionWire } from '@stacks/transactions'; export declare const BNS_CONTRACT_NAME = "bns"; export interface PriceFunction { base: IntegerType; coefficient: IntegerType; b1: IntegerType; b2: IntegerType; b3: IntegerType; b4: IntegerType; b5: IntegerType; b6: IntegerType; b7: IntegerType; b8: IntegerType; b9: IntegerType; b10: IntegerType; b11: IntegerType; b12: IntegerType; b13: IntegerType; b14: IntegerType; b15: IntegerType; b16: IntegerType; nonAlphaDiscount: IntegerType; noVowelDiscount: IntegerType; } export interface BnsContractCallOptions { functionName: string; functionArgs: ClarityValue[]; publicKey: PublicKey; network: StacksNetwork; postConditions?: PostCondition[]; } export interface BnsReadOnlyOptions { functionName: string; functionArgs: ClarityValue[]; senderAddress: string; network: StacksNetwork; } export interface CanRegisterNameOptions { fullyQualifiedName: string; network: StacksNetwork; } export declare function canRegisterName({ fullyQualifiedName, network, }: CanRegisterNameOptions): Promise<boolean>; export interface GetNamespacePriceOptions { namespace: string; network: StacksNetwork; } export declare function getNamespacePrice({ namespace, network, }: GetNamespacePriceOptions): Promise<bigint>; export interface GetNamePriceOptions { fullyQualifiedName: string; network: StacksNetwork; } export declare function getNamePrice({ fullyQualifiedName, network, }: GetNamePriceOptions): Promise<bigint>; export interface PreorderNamespaceOptions { namespace: string; salt: string; stxToBurn: IntegerType; publicKey: string; network: StacksNetwork; } export declare function buildPreorderNamespaceTx({ namespace, salt, stxToBurn, publicKey, network, }: PreorderNamespaceOptions): Promise<StacksTransactionWire>; export interface RevealNamespaceOptions { namespace: string; salt: string; priceFunction: PriceFunction; lifetime: IntegerType; namespaceImportAddress: string; publicKey: string; network: StacksNetwork; } export declare function buildRevealNamespaceTx({ namespace, salt, priceFunction, lifetime, namespaceImportAddress, publicKey, network, }: RevealNamespaceOptions): Promise<StacksTransactionWire>; export interface ImportNameOptions { namespace: string; name: string; beneficiary: string; zonefile: string; publicKey: string; network: StacksNetwork; } export declare function buildImportNameTx({ namespace, name, beneficiary, zonefile, publicKey, network, }: ImportNameOptions): Promise<StacksTransactionWire>; export interface ReadyNamespaceOptions { namespace: string; publicKey: string; network: StacksNetwork; } export declare function buildReadyNamespaceTx({ namespace, publicKey, network, }: ReadyNamespaceOptions): Promise<StacksTransactionWire>; export interface PreorderNameOptions { fullyQualifiedName: string; salt: string; stxToBurn: IntegerType; publicKey: PublicKey; network: StacksNetwork; } export declare function buildPreorderNameTx({ fullyQualifiedName, salt, stxToBurn, publicKey, network, }: PreorderNameOptions): Promise<StacksTransactionWire>; export interface RegisterNameOptions { fullyQualifiedName: string; salt: string; zonefile: string; publicKey: PublicKey; network: StacksNetwork; } export declare function buildRegisterNameTx({ fullyQualifiedName, salt, zonefile, publicKey, network, }: RegisterNameOptions): Promise<StacksTransactionWire>; export interface UpdateNameOptions { fullyQualifiedName: string; zonefile: string; publicKey: string; network: StacksNetwork; } export declare function buildUpdateNameTx({ fullyQualifiedName, zonefile, publicKey, network, }: UpdateNameOptions): Promise<StacksTransactionWire>; export interface TransferNameOptions { fullyQualifiedName: string; newOwnerAddress: string; publicKey: string; network: StacksNetwork; zonefile?: string; } export declare function buildTransferNameTx({ fullyQualifiedName, newOwnerAddress, zonefile, publicKey, network, }: TransferNameOptions): Promise<StacksTransactionWire>; export interface RevokeNameOptions { fullyQualifiedName: string; publicKey: string; network: StacksNetwork; } export declare function buildRevokeNameTx({ fullyQualifiedName, publicKey, network, }: RevokeNameOptions): Promise<StacksTransactionWire>; export interface RenewNameOptions { fullyQualifiedName: string; stxToBurn: IntegerType; publicKey: string; network: StacksNetwork; newOwnerAddress?: string; zonefile?: string; } export declare function buildRenewNameTx({ fullyQualifiedName, stxToBurn, newOwnerAddress, zonefile, publicKey, network, }: RenewNameOptions): Promise<StacksTransactionWire>;