AssociateWallet

Associates the wallet with the account specified in the bearer JWT token provided by User Management.

rpc AssociateWallet

wallet_api.v1.AssociateWallet

Associates the wallet with the account specified in the bearer JWT token provided by User Management.

requests AssociateWalletRequest

wallet_api.v1.AssociateWalletRequest

FieldTypeDescription
wallet_idstringUUID of the wallet.
api_keystringAPI key given to the wallet owner at the time of owner creation.
resp, _ := custodialWallet.AssociateWallet(ctx, &v1.AssociateWalletRequest{
  ApiKey: "API_KEY",
  WalletId: "zWalletIDMultibase58Encoded",
})
fmt.Println(resp)
const associatewalletrequest = new AssociateWalletRequest();
associatewalletrequest.setApiKey("API_KEY");
associatewalletrequest.setWalletId("zWalletIDMultibase58Encoded");

service.associateWallet(associatewalletrequest, (err, value:AssociateWalletResponse|null) => {
    const resp = JSON.stringify(err ? err : value);
    console.log("received ", resp);
})
using System;
using Grpc.Core;
using WalletApi.V1;

namespace main
{
  class Program
  {
    static void Main(string[] args)
    {
      Channel channel = new Channel("wallet.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure); 
      var client = new CustodialWallet.CustodialWalletClient(channel); 
      var headers = new Metadata();
      var associateWalletRequest = new AssociateWalletRequest{
        ApiKey = "API_KEY",
        WalletId = "zWalletIDMultibase58Encoded",
      };
      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 wallet_api.v1.Wallet.AssociateWalletRequest;
import wallet_api.v1.Wallet.AssociateWalletResponse;
import wallet_api.v1.CustodialWalletGrpc;

public class App {
  public static void main(String[] args) {
    ManagedChannel channel = ManagedChannelBuilder
      .forAddress("wallet.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
      .usePlaintext()
      .build();
    CustodialWalletGrpc.CustodialWalletBlockingStub blockStub =
        CustodialWalletGrpc.newBlockingStub(channel);
    
    AssociateWalletRequest req_AssociateWalletRequest =
        AssociateWalletRequest.newBuilder()
          .setApiKey("API_KEY")
          .setWalletId("zWalletIDMultibase58Encoded")
          .build();
    AssociateWalletResponse resp = blockStub.associateWallet(req_AssociateWalletRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const associatewalletrequest = new AssociateWalletRequest();
associatewalletrequest.setApiKey("API_KEY");
associatewalletrequest.setWalletId("zWalletIDMultibase58Encoded");

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::wallet_api::v1::wallet_service_client::CustodialWalletClient;
use grpc-sdks::wallet_api::v1::AssociateWalletRequest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let channel = Channel::from_static("wallet.YOUR_SANDBOX_ID.knoxnetworks.io")
    .connect()
    .await?;
  let mut client = CustodialWalletClient::new(channel); 

  let request = tonic::Request::new(
    AssociateWalletRequest{
      api_key: String::from("API_KEY"),
      wallet_id: String::from("zWalletIDMultibase58Encoded")
    });
// 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 wallet_api.v1.Wallet.AssociateWalletRequest
import wallet_api.v1.Wallet.AssociateWalletResponse
import wallet_api.v1.CustodialWalletGrpc

fun main() {
    val channel = ManagedChannelBuilder
            .forAddress("wallet.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
            .usePlaintext()
            .build()
    var blockStub = CustodialWalletGrpc.newBlockingStub(channel)
    
    val req_AssociateWalletRequest = AssociateWalletRequest.newBuilder()
          .setApiKey("API_KEY")
          .setWalletId("zWalletIDMultibase58Encoded")
          .build()
    val resp = blockStub.associateWallet(req_AssociateWalletRequest)
    println(resp)
    channel.shutdown()
}


returns AssociateWalletResponse

wallet_api.v1.AssociateWalletResponse

FieldTypeDescription
wallet_idstringUUID of the wallet.
didstringW3C Decentralized Identifier (DID) of the wallet.
public_keystringPublic key of the wallet.
{
  "wallet_id": "zWalletIDMultibase58Encoded",
  "did": "did:method-name:zDIDMultibase58Encoded",
  "public_key": "zPublicKeyMultibase58Encoded"
}