src/index.js
/**
   * Send document via SmartInvoice platform to the receiver
   * @async
   * @param {String} receiverDID Decentralize identifier of the receiver
   * @param {File} file Document which should be sent
   * @param {Object} payload Additional information which should be attached to the document
   */
Send document via SmartInvoice platform to the receiver
@async
@param {String} receiverDID Decentralize identifier of the receiver
@param {File} file Document which should be sent
@param {Object} payload Additional information which should be attached to the document
Send document via SmartInvoice platform to the receiver @async @param { String } receiverDID Decentralize identifier of the receiver @param { File } file Document which should be sent @param { Object } payload Additional information which should be attached to the document
sendTo(receiverDID, file, payload) {
    const self = this;
    self.encryptAndUploadDocument(file).then((response) => {
      const dri = response.data;
      self
        .encryptTransactionPayloadFor(receiverDID, dri, payload)
        .then((encryptedTransactionPayload) => {
          self.sendDocument(dri, encryptedTransactionPayload, receiverDID);
        });
    });
  }
sendTo ( receiverDID , file , payload ) { const self = this ; self . encryptAndUploadDocument ( file ) . then ( ( response ) => { const dri = response . data ; self . encryptTransactionPayloadFor ( receiverDID , dri , payload ) . then ( ( encryptedTransactionPayload ) => { self . sendDocument ( dri , encryptedTransactionPayload , receiverDID ) ; } ) ; } ) ; }
Send document via SmartInvoice platform to the receiver
 @async
 @param {String} receiverDID Decentralize identifier of the receiver
 @param {File} file Document which should be sent
 @param {Object} payload Additional information which should be attached to the document
Send document via SmartInvoice platform to the receiver @async @param { String } receiverDID Decentralize identifier of the receiver @param { File } file Document which should be sent @param { Object } payload Additional information which should be attached to the document