Exemplo n.º 1
0
        /// <summary>
        /// Builds a GET_CLAIM_DEF ledger request.
        /// </summary>
        /// <remarks>
        /// Builds a request message that is suitable for getting a claim definition from a ledger.
        /// </remarks>
        /// <note type="note">The <paramref name="signatureType"/> parameter only accepts the value
        /// 'CL' at present.</note>
        /// <param name="submitterDid">The DID of the party that will submit the request.</param>
        /// <param name="xref">The sequence number of the schema the claim definition targets.</param>
        /// <param name="signatureType">The type of signature used in the claim definition.</param>
        /// <param name="origin">The DID of the issuer of the claim definition.</param>
        /// <returns>An asynchronous <see cref="Task{T}"/> that resolves to a <see cref="string"/>
        /// containing the request JSON. </returns>
        public static Task <string> BuildGetClaimDefTxnAsync(string submitterDid, int xref, string signatureType, string origin)
        {
            var taskCompletionSource = new TaskCompletionSource <string>();
            var commandHandle        = PendingCommands.Add(taskCompletionSource);

            var result = IndyNativeMethods.indy_build_get_claim_def_txn(
                commandHandle,
                submitterDid,
                xref,
                signatureType,
                origin,
                _buildRequestCallback
                );

            CallbackHelper.CheckResult(result);

            return(taskCompletionSource.Task);
        }