UNPKG

@handcash/handcash-connect

Version:
111 lines (110 loc) 3.67 kB
import Environments from './environments'; import HandCashConnectService from './api/handcash_connect_service'; import { AddMintOrderItemsParams, CreateItemsOrder, CreateCollectionMetadata, CreateItemsOrderParams, BurnAndCreateItemsOrderParams, ItemTransferAndCreateItemsOrder, Item } from './types/items'; import { PaymentResult } from './types/payments'; type Params = { appId: string; appSecret: string; authToken: string; env?: (typeof Environments)['prod']; }; /** * * HandCashMinter provides all the features needed to inscribe ordinals. * * @param {string} appId - The app id of your app. You get it from your developer dashboard. * @param {string} appSecret - The app secret of your app. You get it from your developer dashboard. * @param {Object} [env] - Optional: The environment to use. Defaults to prod. * */ export default class HandCashMinter { handCashConnectService: HandCashConnectService; static fromAppCredentials(params: Params): HandCashMinter; constructor({ handCashConnectService }: { handCashConnectService: HandCashConnectService; }); /** * * Create Items * * @param params {AddMintOrderItemsParams} * returns {Promise<CreateOrderItemResult[]} * * */ createItemsOrder(params: CreateItemsOrderParams): Promise<CreateItemsOrder>; /** * Burn and Create Items * returns {Promise<CreateOrderItemResult[]} */ burnAndCreateItemsOrder(params: BurnAndCreateItemsOrderParams): Promise<ItemTransferAndCreateItemsOrder>; /** * * Create Items * * @param params {AddMintOrderItemsParams} * returns {Promise<CreateOrderItemResult[]} * * */ createCollectionOrder(collectionMetadata: CreateCollectionMetadata): Promise<CreateItemsOrder>; /** * * Creates an order to inscribe items. * * @param referencedCollection {string} The id of the collection that the items belong to * @returns {Promise<CreateItemsOrder} * * */ createCollectionItemsOrder(referencedCollection: string): Promise<CreateItemsOrder>; /** * Adds items to an existing items order. * @param params - Parameters for adding items to an order * @returns - Promise of CreateItemsOrder */ addOrderItems(params: AddMintOrderItemsParams): Promise<CreateItemsOrder>; /** * * Commits the existing order so no more items can be added to it. The payment should be completed afterwards. * * @param orderId {string} * @returns {Promise<CreateItemsOrder} * * */ commitOrder(orderId: string): Promise<CreateItemsOrder>; /** * * After the payment has been completed, this method is used to inscribe in the items in the blockchain in batches. * * @param orderId {string} * @returns {Promise<CreateItemsOrder} * * */ inscribeNextBatch(orderId: string): Promise<CreateItemsOrder>; /** * * Gets an already created items order by its id. * * @param orderId {string} * @returns {Promise<CreateItemsOrder} * * */ getOrder(orderId: string): Promise<CreateItemsOrder>; /** * * Gets the items in an order by its id. The order must be completed. * * @param orderId {string} * @returns {Promise<OrdinalItem[]} * * */ getOrderItems(orderId: string): Promise<Item[]>; /** * * Pays a payment request from an items order. * * @param paymentRequestId {string} * @returns {Promise<CreateItemsOrder} * * */ payPaymentRequest(paymentRequestId: string): Promise<PaymentResult>; } export {};