Called by the browser to initialize a stream with the server to listen for events such as challenge completion.
rpc WaitForCompletion
WaitForCompletion
vc_api.v1.WaitForCompletion
vc_api.v1.WaitForCompletion
Called by the browser to initialize a stream with the server to listen for events such as challenge completion.
requests WaitForCompletionRequest
WaitForCompletionRequest
vc_api.v1.WaitForCompletionRequest
vc_api.v1.WaitForCompletionRequest
Field | Type | Description |
---|---|---|
nonce | string | Value used for the challenge. |
stream, _ := credentialAdapterService.WaitForCompletion(ctx, &v1.WaitForCompletionRequest{
Nonce: "NonceLengthVariesByAlgo",
})
resp, _ := stream.Recv()
fmt.Println(resp)
const waitforcompletionrequest = new WaitForCompletionRequest();
waitforcompletionrequest.setNonce("NonceLengthVariesByAlgo");
const stream = service.waitForCompletion(waitforcompletionrequest)
stream.on("data", (value:WaitForCompletionResponse|null) => {
console.log("received ", value);
})
using System;
using Grpc.Core;
using System.Threading.Tasks;
using VcApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("vc.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new CredentialAdapterService.CredentialAdapterServiceClient(channel);
var headers = new Metadata();
var waitForCompletionRequest = new WaitForCompletionRequest{
Nonce = "NonceLengthVariesByAlgo",
};
using(var call = client.WaitForCompletion(waitForCompletionRequest, headers))
{
var responseReaderTask = Task.Run(async () =>
{
while (await call.ResponseStream.MoveNext())
{
Console.WriteLine("Response: " + call.ResponseStream.Current);
}
});
responseReaderTask.Wait();
}
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import java.util.Iterator;
import vc_api.v1.CredentialAdapterServiceGrpc;
import vc_api.v1.Vc.WaitForCompletionRequest;
import vc_api.v1.Vc.WaitForCompletionResponse;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("vc.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
CredentialAdapterServiceGrpc.CredentialAdapterServiceBlockingStub blockStub =
CredentialAdapterServiceGrpc.newBlockingStub(channel);
WaitForCompletionRequest req_WaitForCompletionRequest =
WaitForCompletionRequest.newBuilder()
.setNonce("NonceLengthVariesByAlgo")
.build();
Iterator resp = blockStub.waitForCompletion(req_WaitForCompletionRequest);
while (resp.hasNext()) {
System.out.println(resp.next());
}
channel.shutdown();
}
}
const waitforcompletionrequest = new WaitForCompletionRequest();
waitforcompletionrequest.setNonce("NonceLengthVariesByAlgo");
const stream = service.waitForCompletion(waitforcompletionrequest)
stream.on("data", (value) => {
console.log("received ", value);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::vc_api::v1::credential_adapter_service_client::CredentialAdapterServiceClient;
use grpc-sdks::vc_api::v1::WaitForCompletionRequest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("vc.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = CredentialAdapterServiceClient::new(channel);
let request = tonic::Request::new(
WaitForCompletionRequest{
nonce: String::from("NonceLengthVariesByAlgo")
});
// sending request and waiting for response
let response = client.wait_for_completion(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import vc_api.v1.CredentialAdapterServiceGrpc
import vc_api.v1.Vc.WaitForCompletionRequest
import vc_api.v1.Vc.WaitForCompletionResponse
fun main() {
val channel = ManagedChannelBuilder
.forAddress("vc.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = CredentialAdapterServiceGrpc.newBlockingStub(channel)
val req_WaitForCompletionRequest = WaitForCompletionRequest.newBuilder()
.setNonce("NonceLengthVariesByAlgo")
.build()
val resp = blockStub.waitForCompletion(req_WaitForCompletionRequest)
while (resp.hasNext()) {
println(resp.next())
}
channel.shutdown()
}
returns stream of WaitForCompletionResponse
WaitForCompletionResponse
vc_api.v1.WaitForCompletionResponse
vc_api.v1.WaitForCompletionResponse
Field | Type | Description |
---|---|---|
did | string | W3C Decentralized Identifier (DID) of the wallet. |
data | string | JSON representation of the credential. |
{
"did": "did:method-name:zDIDMultibase58Encoded",
"data": "DATA"
}