PrepareTransaction

Create a new Contract with detailed specifics defined in RDF 1.1 Turtle format.

rpc PrepareTransaction

asset_controller_api.v1.PrepareTransaction

Create a new Contract with detailed specifics defined in RDF 1.1 Turtle format.

requests PrepareTransactionRequest

asset_controller.PrepareTransactionRequest

FieldTypeDescription
textstringContract details in RDF 1.1 Turtle format
verifier optionalstringOptional verifier
resp, _ := assetcontroller.PrepareTransaction(ctx, &v1.PrepareTransactionRequest{
  Text: "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>",
  Verifier: "zWalletPublicKey",
})
fmt.Println(resp)
const preparetransactionrequest = new PrepareTransactionRequest();
preparetransactionrequest.setText("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>");
preparetransactionrequest.setVerifier("zWalletPublicKey");

service.prepareTransaction(preparetransactionrequest, (err, value:PrepareTransactionResponse|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 prepareTransactionRequest = new PrepareTransactionRequest{
        Text = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>",
        Verifier = "zWalletPublicKey",
      };
      var reply = client.PrepareTransaction(prepareTransactionRequest, 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.PrepareTransactionRequest;
import asset_controller_api.v1.AssetController.PrepareTransactionResponse;
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);
    
    PrepareTransactionRequest req_PrepareTransactionRequest =
        PrepareTransactionRequest.newBuilder()
          .setText("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>")
          .setVerifier("zWalletPublicKey")
          .build();
    PrepareTransactionResponse resp = blockStub.getContractTtl(req_PrepareTransactionRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const preparetransactionrequest = new PrepareTransactionRequest();
preparetransactionrequest.setText("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>");
preparetransactionrequest.setVerifier("zWalletPublicKey");

service.prepareTransaction(preparetransactionrequest, (err, value:PrepareTransactionResponse|null) => {
    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::PrepareTransactionRequest;

#[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(
    PrepareTransactionRequest{
      text: String::from("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>"),
      verifier: String::from("zWalletPublicKey")
    });
// sending request and waiting for response
  let response = client.prepare_transaction(request).await?.into_inner();
  println!("RESPONSE={:?}", response);
  Ok(())
}
package app

import io.grpc.ManagedChannelBuilder
import asset_controller_api.v1.AssetController.PrepareTransactionRequest
import asset_controller_api.v1.AssetController.PrepareTransactionResponse
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_PrepareTransactionRequest = PrepareTransactionRequest.newBuilder()
          .setText("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>")
          .setVerifier("zPublicKey")
          .build()
    val resp = blockStub.prepareTransaction(req_PrepareTransactionRequest)
    println(resp)
    channel.shutdown()
}


returns PrepareTransactionResponse

asset_controller.PrepareTransactionResponse

FieldTypeDescription
statusStatusStatus of the transaction
uetrstringA Unique End-to-end Transaction Reference, string of 36 unique characters.
{
  "status": 1,
  "uetr": "UETR"
}