cmd/wallet-js-sdk/src/didcomm/blinded.js
/**
   *
   * This function provides functionality of sharing peer DID with connecting party for blinded DIDComm.
   *
   * @param {Object} connection - connection record of the connection established.
   */
This function provides functionality of sharing peer DID with connecting party for blinded DIDComm.
This function provides functionality of sharing peer DID with connecting party for blinded DIDComm .
async sharePeerDID(connection) {
    let { ConnectionID } = connection;
    console.debug("Sending DID Doc request");
    let response = await this.agent.blindedrouting.sendDIDDocRequest({
      connectionID: ConnectionID,
    });
    console.log("payload from did doc response", response);
    if (!response || !response.payload || !response.payload.message) {
      throw "no response DID found in did doc response";
    }
    let { message } = response.payload;
    let peerDID = message.data.didDoc;
    if (!peerDID) {
      console.error(
        "failed to get peerDID from inviter, could not find peer DID in response message."
      );
      throw "failed to get peer DID from inviter";
    }
    console.debug("received peer DID");
    console.debug("requesting peer DID from wallet");
    let walletDID = await requestDIDFromMediator(this.agent, peerDID);
    console.debug(`wallet's peer DID: ${JSON.stringify(walletDID, null, 2)}`);
    console.log("sharing wallet peer DID to inviter");
    await this.agent.blindedrouting.sendRegisterRouteRequest({
      messageID: message["@id"],
      didDoc: walletDID,
    });
  }
async sharePeerDID ( connection ) { let { ConnectionID } = connection ; console . debug ( "Sending DID Doc request" ) ; let response = await this . agent . blindedrouting . sendDIDDocRequest ( { connectionID : ConnectionID , } ) ; console . log ( "payload from did doc response" , response ) ; if ( ! response || ! response . payload || ! response . payload . message ) { throw "no response DID found in did doc response" ; } let { message } = response . payload ; let peerDID = message . data . didDoc ; if ( ! peerDID ) { console . error ( "failed to get peerDID from inviter, could not find peer DID in response message." ) ; throw "failed to get peer DID from inviter" ; } console . debug ( "received peer DID" ) ; console . debug ( "requesting peer DID from wallet" ) ; let walletDID = await requestDIDFromMediator ( this . agent , peerDID ) ; console . debug ( ` ${ JSON . stringify ( walletDID , null , 2 ) } ` ) ; console . log ( "sharing wallet peer DID to inviter" ) ; await this . agent . blindedrouting . sendRegisterRouteRequest ( { messageID : message [ "@id" ] , didDoc : walletDID , } ) ; }
This function provides functionality of sharing peer DID with connecting party for blinded DIDComm.
This function provides functionality of sharing peer DID with connecting party for blinded DIDComm .
// request peer DID from other party // request wallet peer DID from router by sending peer DID from other party // share wallet peer DID to other party