Associate Wallet with the authenticated account in the bearer token.
rpc AssociateWallet
AssociateWallet
user_api.v1.AssociateWallet
user_api.v1.AssociateWallet
Associate Wallet with the authenticated account in the bearer token.
requests AssociateWalletRequest
AssociateWalletRequest
user_api.v1.AssociateWalletRequest
user_api.v1.AssociateWalletRequest
Field | Type | Description |
---|---|---|
did | string | W3C Decentralized Identifier (DID) of the wallet to be associated with the account in the bearer token. |
resp, _ := userApiService.AssociateWallet(ctx, &v1.AssociateWalletRequest{
Did: "did:method-name:zDIDMultibase58Encoded",
})
fmt.Println(resp)
const associatewalletrequest = new AssociateWalletRequest();
associatewalletrequest.setDid("did:method-name:zDIDMultibase58Encoded");
service.associateWallet(associatewalletrequest, (err, value:AssociateWalletResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using UserApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new UserApiService.UserApiServiceClient(channel);
var headers = new Metadata();
var associateWalletRequest = new AssociateWalletRequest{
Did = "did:method-name:zDIDMultibase58Encoded",
};
var reply = client.AssociateWallet(associateWalletRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import user_api.v1.User.AssociateWalletRequest;
import user_api.v1.User.AssociateWalletResponse;
import user_api.v1.UserApiServiceGrpc;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
UserApiServiceGrpc.UserApiServiceBlockingStub blockStub =
UserApiServiceGrpc.newBlockingStub(channel);
AssociateWalletRequest req_AssociateWalletRequest =
AssociateWalletRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.build();
AssociateWalletResponse resp = blockStub.associateWallet(req_AssociateWalletRequest);
System.out.println(resp);
channel.shutdown();
}
}
const associatewalletrequest = new AssociateWalletRequest();
associatewalletrequest.setDid("did:method-name:zDIDMultibase58Encoded");
service.associateWallet(associatewalletrequest, (err, value) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::user_api::v1::user_api_service_client::UserApiServiceClient;
use grpc-sdks::user_api::v1::AssociateWalletRequest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = UserApiServiceClient::new(channel);
let request = tonic::Request::new(
AssociateWalletRequest{
did: String::from("did:method-name:zDIDMultibase58Encoded")
});
// sending request and waiting for response
let response = client.associate_wallet(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import user_api.v1.User.AssociateWalletRequest
import user_api.v1.User.AssociateWalletResponse
import user_api.v1.UserApiServiceGrpc
fun main() {
val channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = UserApiServiceGrpc.newBlockingStub(channel)
val req_AssociateWalletRequest = AssociateWalletRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.build()
val resp = blockStub.associateWallet(req_AssociateWalletRequest)
println(resp)
channel.shutdown()
}
returns AssociateWalletResponse
AssociateWalletResponse
user_api.v1.AssociateWalletResponse
user_api.v1.AssociateWalletResponse
{}