dash-platform-sdk
    Preparing search index...

    Class DocumentsController

    Collection of methods to work with documents like creation, querying or preparing a transition action

    Index

    Methods

    • Creates a {DocumentWASM} instance that can be used to submit a document in the network.

      Parameters

      • dataContractId: IdentifierLike

        {IdentifierLike} Identifier of the Data Contract

      • documentType: string

        {string} Document type as string

      • data: object

        {object} Data as JSON object

      • owner: IdentifierLike

        {IdentifierLike} Identifier of the document's owner

      • Optionalrevision: bigint

        {bigint=} revision (optional)

      Returns Promise<DocumentWASM>

    • Helper function for creating {StateTransitionWASM} from documents. It may be used to create any of 6 Document Transition actions:

      1. Create - creates a document
      2. Replace - replaces a document
      3. Delete - deletes a document
      4. Transfer - transfer a document from one identity to another
      5. SetPrice - set a price for a document in credits
      6. Purchase - purchase a document from identity (if price was set)

      Parameters

      • document: DocumentWASM

        {DocumentWASM} Instance of the document to make transition with

      • batchType: BatchType

        {BatchType} Type of the document transition

      • identityContractNonce: bigint

        {bigint} Identity contract nonce

      • Optionalparams: CreateStateTransitionDocumentBatchParams

        {CreateStateTransitionDocumentBatchParams=} Additional params, required for Transfer, SetPrice, Purchase transitions

      Returns StateTransitionWASM