Get details of a specific Contract by UETR.
rpc GetContractDetail
GetContractDetail
asset_controller_api.v1.GetContractDetail
asset_controller_api.v1.GetContractDetail
Get details of a specific Contract by UETR.
requests GetContractDetailRequest
GetContractDetailRequest
asset_controller.GetContractDetailRequest
asset_controller.GetContractDetailRequest
Field | Type | Description |
---|---|---|
uetr | string | A Unique End-to-end Transaction Reference, string of 36 unique characters. |
verifier optional | string | Wallet verifier. |
resp, _ := assetcontroller.GetContractDetail(ctx, &v1.GetContractDetailRequest{
Uetr: "UETR",
Verifier: "zWalletPublicKey",
})
fmt.Println(resp)
const getcontractdetailrequest = new GetContractDetailRequest();
getcontractdetailrequest.setUetr("UETR");
getcontractdetailrequest.setVerifier("zWalletPublicKey");
service.getContractDetail(getcontractdetailrequest, (err, value:GetContractDetailResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using AssetControllerApi.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 AssetController.AssetControllerClient(channel);
var headers = new Metadata();
var getContractDetailRequest = new GetContractDetailRequest{
Uetr = "UETR",
Verifier = "zWalletPublicKey",
};
var reply = client.GetContractDetail(getContractDetailRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import asset_controller_api.v1.AssetController.GetContractDetailRequest;
import asset_controller_api.v1.AssetController.GetContractDetailResponse;
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);
GetContractDetailRequest req_GetContractDetailRequest =
GetContractDetailRequest.newBuilder()
.setUetr("Uetr")
.setVerifier("zWalletPublicKey")
.build();
GetContractDetailResponse resp = blockStub.getContractDetail(req_GetContractDetailRequest);
System.out.println(resp);
channel.shutdown();
}
}
const getcontractdetailrequest = new GetContractDetailRequest();
getcontractdetailrequest.setUetr("UETR");
getcontractdetailrequest.setVerifier("zWalletPublicKey");
service.getContractDetail(getcontractdetailrequest, (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::asset_controller_api::v1::GetContractDetailRequest;
#[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(
GetContractDetailRequest{
uetr: String::from("UETR"),
verifier: String::from("zWalletPublicKey")
});
// sending request and waiting for response
let response = client.get_contract_detail(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import asset_controller_api.v1.AssetController.GetContractDetailRequest
import asset_controller_api.v1.AssetController.GetContractDetailrResponse
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_GetContractDetailRequest = GetContractDetailRequest.newBuilder()
.setUetr("Uetr")
.setVerifier("zPublicKey")
.build()
val resp = blockStub.getContractDetail(req_GetContractDetailRequest)
println(resp)
channel.shutdown()
}
returns GetContractDetailResponse
GetContractDetailResponse
asset_controller.GetContractDetailResponse
asset_controller.GetContractDetailResponse
Field | Type | Description |
---|---|---|
contract_type | string | Type of this contract |
commitments | Commitment repeated | Lists all fund transfers specified in the contract |
created | string | [RFC3339 Timestamp] Time the contract was created |
hash_presenter | string | [MultibaseVerifier] that is responsible for presenting the secret |
hash | bytes | [Sha256 Hash] Hash of the secret |
expiration | string | [RFC3339 Timestamp] Expiration time of the contract where all funds are returned to all participants |
memo | string | Human-readable memo field |
log | LogEntry repeated | Log of all interactions of this contract |
{
"contract_type": "Asset Swap",
"commitments": [
{
"sender": "zSender1PublicKey",
"recipient": "zRecipient1PublicKey",
"amount": {
"currency_code": "USD",
"amount": 100,
"decimals": 2
}
},
{
"sender": "zSender2PublicKey",
"recipient": "zRecipient1PublicKey",
"amount": {
"currency_code": "MXN",
"amount": 100,
"decimals": 2
}
}
],
"created": "2023-12-19T16:39:56-08:00",
"hash_presenter": "zSender1PublicKey",
"hash": "d04b98f48e8f8bcc15c6ae5ac050801cd6dcfd428fb5f9e65c4e16e7807340fa",
"expiration": "2023-12-19T16:39:57-08:00",
"memo": "Currency swap",
"log": [
{
"sender": "zSender1PublicKey",
"receiver": "zRecipient1PublicKey",
"amount": {
"currency_code": "USD",
"amount": 100,
"decimals": 2
},
"timestamp": "2006-01-02T15:04:05Z",
"kind": "ContractPayment",
"state": "Awaiting",
"event": "Received promissory",
"promissory_id": "00000000-0000-0000-0000-000000000000"
}
]
}