Creates a wallet for a given owner, which can manage the wallet.
rpc CreateWallet
CreateWallet
wallet_api.v1.CreateWallet
wallet_api.v1.CreateWallet
Creates a wallet for a given owner, which can manage the wallet.
requests CreateWalletRequest
CreateWalletRequest
wallet_api.v1.CreateWalletRequest
wallet_api.v1.CreateWalletRequest
Field | Type | Description |
---|---|---|
wallet_name | string | Human friendly name of the wallet. |
api_key | string | API key given to the wallet owner at the time of owner creation. |
resp, _ := custodialWallet.CreateWallet(ctx, &v1.CreateWalletRequest{
ApiKey: "API_KEY",
WalletName: "WALLET_NAME",
})
fmt.Println(resp)
const createwalletrequest = new CreateWalletRequest();
createwalletrequest.setApiKey("API_KEY");
createwalletrequest.setWalletName("WALLET_NAME");
service.createWallet(createwalletrequest, (err, value:CreateWalletResponse|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 createWalletRequest = new CreateWalletRequest{
ApiKey = "API_KEY",
WalletName = "WALLET_NAME",
};
var reply = client.CreateWallet(createWalletRequest, 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.CreateWalletRequest;
import wallet_api.v1.Wallet.CreateWalletResponse;
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);
CreateWalletRequest req_CreateWalletRequest =
CreateWalletRequest.newBuilder()
.setApiKey("API_KEY")
.setWalletName("WALLET_NAME")
.build();
CreateWalletResponse resp = blockStub.createWallet(req_CreateWalletRequest);
System.out.println(resp);
channel.shutdown();
}
}
const createwalletrequest = new CreateWalletRequest();
createwalletrequest.setApiKey("API_KEY");
createwalletrequest.setWalletName("WALLET_NAME");
service.createWallet(createwalletrequest, (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::CreateWalletRequest;
#[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(
CreateWalletRequest{
api_key: String::from("API_KEY"),
wallet_name: String::from("WALLET_NAME")
});
// sending request and waiting for response
let response = client.create_wallet(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import wallet_api.v1.Wallet.CreateWalletRequest
import wallet_api.v1.Wallet.CreateWalletResponse
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_CreateWalletRequest = CreateWalletRequest.newBuilder()
.setApiKey("API_KEY")
.setWalletName("WALLET_NAME")
.build()
val resp = blockStub.createWallet(req_CreateWalletRequest)
println(resp)
channel.shutdown()
}
returns CreateWalletResponse
CreateWalletResponse
wallet_api.v1.CreateWalletResponse
wallet_api.v1.CreateWalletResponse
Field | Type | Description |
---|---|---|
wallet_id | string | UUID of the wallet. |
wallet_name | string | Human friendly name of the wallet. |
public_key | string | Public key of the wallet. |
did | string | W3C Decentralized Identifier (DID) of the wallet. |
{
"wallet_id": "zWalletIDMultibase58Encoded",
"wallet_name": "WALLET_NAME",
"public_key": "zPublicKeyMultibase58Encoded",
"did": "did:method-name:zDIDMultibase58Encoded"
}