Submit and send the signed transaction

The Notardec API is based on Ethereum technology. Signing a transaction is the only way to actually “write” to blockchain. The process of signing is explained here. Additional documentation can be found in the TEOS API documentation (which is the basis for the Notardec API) here. Signing can be done with any TEOS compatible device such as a build of the White-Label APP (e.g. NOTRZR APP), a hardware device with a TEOS-enabled bridge or any software product, e.g. an Autosigner

POST /transactions/{transactionId}/submit

{
  "signerAddress": "string",
  "signedTransaction": "string",
  "description": "string"
}
  • transactionId: The ID of the transaction we want to submit.
  • signerAddress: The ID of the wallet that this transaction belongs to.
  • signedTransaction: Signed transaction data
Transaction data

To confirm the transaction, you need to get the signing data

The “signedTransaction” parameter is a hashed signing data parameters. There is an example how to hash this using ethereum library in TypeScript

import type { Wallet } from 'ethers';

async function submitTransaction (
      transactionId: string,
      signingParameters: {
        TargetAddress: string;
        Nonce: string;
        GasPrice: string;
        GasLimit: string;
        DataToSign: string;
      },
      transactionWallet: Wallet,
    ){
      const _transaction = {
        nonce: +signingParameters.Nonce,
        value: 'Amount' in signingParameters ? +signingParameters['Amount' as any] : 0,
        gasLimit: +signingParameters.GasLimit,
        gasPrice: +signingParameters.GasPrice,
        to: signingParameters.TargetAddress,
        data: signingParameters.DataToSign,
      };
      const signedTransaction = await transactionWallet.sign(_transaction);
      const payload = {
        transactionId: transactionId
        signerAddress: signingParameters.TargetAddress,
        signedTransaction: signedTransaction,
        description: "Submit transaction"
      }
}
      const response = await submitSignedTransaction(NOTARDEC_API_KEY, request.token, payload)
Code Example
async function submitSignedTransaction(
  apiKey: string,
  token: string,
  payload: SubmitSignedTransactionPayload
): Promise<SubmitSignedTransactionDto> {
  const result = await axios.post(`${process.env.NOTARDEC_URL}/transactions/${payload.transactionId}/submit`, payload, {
    headers: {
      'X-API-KEY': apiKey,
      Authorization: `Bearer ${token}`,
    },
  });
  return result.data;
}

Here, the first parameter we pass is the Notardec Key, the second is the token, the third is the request body. The request body and the response body will have the following form:

Request:
{
  "transactionId": "string",
  "signerAddress": "string",
  "signedTransaction": "string",
  "description": "string"
}
Response
{
  "value": {
    "status": "string",
    "transactionId": "string"
  }
}