Quantum
  • Welcome to Quantum
  • Developer portal
    • Pricing
  • Self-Custody Infrastructure
    • Pincode Management
    • Private Key Management
  • Quickstart guide
  • Authentication
    • API Authentication
  • Faucets
  • Networks & URLs
  • Walletify Api
    • Overview
    • Getting started
    • User Management
    • Signing Methods
    • Testnet Assets
    • Basic Guides
      • Create a user
      • Retrieve a user
      • Update a user
      • Delete a user
      • Create a signing method
      • Update a signing method
      • Delete a signing method
      • Create a wallet
      • Retrieve wallet
      • Archive a wallet
      • Import a wallet
      • Export a wallet
      • Retrieve native balance
      • Retrieve ERC20 tokens
      • Retrieve NFTs
      • Transfer a native token
      • Transfer an ERC20 token
      • Transfer an NFT
      • Transfer a fungible token
      • Signatures
      • Read a contract
      • Execute a contract call
      • Get Transaction status
      • Resubmit a transaction
      • Get wallet events
      • Webhooks
    • Advanced Guides
      • Burn an NFT
      • Filter Spam NFTs
      • Filter NSFW NFTs
      • SWAP Token Pairs
      • Gasless/Meta Transactions
      • Sign RAW Transactions
      • Using Fiat Onramp with Walletify-API
      • Deploy an Ethereum contract
      • Integrate with WalletConnect
      • Set Up NFT Token Gating
      • Chain Specific Fields
      • Integrate with WalletConnect
      • Encrypted PIN Transfer
  • Nft Wizard Api
    • Overview
    • Getting started
    • Basic Guides
      • Get any NFT info
      • Get any NFT contract
      • Get NFTs by any wallet
      • Get wallets by any NFT
      • Create contract
      • Retrieve Contract
      • Delete Contract
      • Check Contract Status
      • Retrieve Contract Metadata
      • Update Contract Metadata
      • Create Token-type (NFT template)
      • Retrieve Token-type (NFT template)
      • Delete Token-type (NFT Template)
      • Check Token-type Status
      • Retrieve Token-type Metadata
      • Update Token-type Metadata
      • Mint an NFT
      • Batch Mint NFTs
      • Update NFT Metadata
      • Retrieve NFT Metadata
      • Add Audio to your NFTs
      • Add Video to your NFTs
      • Store NFT Media
      • Webhooks
    • Advanced Guides
      • Mass Minting
      • Speed Up Minting
      • Dynamic NFTs
      • Configure Royalties
      • Create Company Minter Wallet
      • Retrieve Company Minter Wallets
      • Store NFT Metadata on IPFS
      • View NFT on sandbox/testnet
    • NFT Configuration
      • Attributes
      • Animation & Media
      • Collection Info
      • Max Supply
      • Mint Number
      • Burnable
      • Metadata Storage
  • TMINTER API
    • Overview
    • Getting started
    • Basic Guide
      • Retrieve Any NFT Information
      • Retrieve NFT Contract Information
      • Retrieve NFTs by Wallet Address
      • Retrieve Wallets by NFT
      • Create a New NFT Contract
      • Retrieve a Contract
      • Delete a Contract
      • Check Contract Status
      • Retrieve Contract Metadata
      • Update Contract Metadata
      • Create Token-Type
      • Retrieve Token-Type
      • Delete Token-Type
      • Check Token-Type Status
      • Retrieve Token-Type Metadata
      • Update Token-Type Metadata
      • Mint a Single NFT
      • Batch Mint Multiple NFTs
      • Update NFT Metadata
      • Retrieve NFT Metadata
      • Add Audio to Your NFTs
      • Add Video to Your NFTs
      • Store NFT Media
      • Webhooks for NFT Events
    • Advance Guide
      • Dynamic NFT Creation
      • Token Economics and Supply Control
      • Advanced Minting: Royalty Distribution
      • Cross-Chain NFT Minting
      • NFT Sharding (Fractional Ownership)
      • Batch NFT Minting with Custom Metadata
      • Add Interactivity to NFTs
      • Advanced Media Integration: VR and AR
      • Webhook Triggers for Automated Processes
Powered by GitBook
On this page
  • How to sign RAW transactions?
  • Context
  • Types of transaction
  1. Walletify Api
  2. Advanced Guides

Sign RAW Transactions

PreviousGasless/Meta TransactionsNextUsing Fiat Onramp with Walletify-API

Last updated 10 months ago

How to sign RAW transactions?

🚧

The Venly Wallet-API takes care of the complete blockchain management to execute transactions (signing, submitting, and follow-up).

We advise only using the regular transaction API (POST /transactions/execute) to perform blockchain operations. Only use the below-described functionality if you have a deep understanding how blockchain technology works.

Context

In some cases, you may want to submit transactions yourself to the blockchain. For example, you may want to submit transactions through your own blockchain node when you run your own node.

To be able to do this, you will need to encode the RAW transaction data and sign this data with the respective Venly-wallet. The resulting signature can then be used to submit the transaction to the blockchain.

This page shows examples of retrieving the signature for different chains.

Request Endpoint:

HTTP

POST /api/signatures

Request Body:

The body for the endpoint depends on which chain the transaction is for. First, there is a set of common fields and then there are some custom fields per (type of) chain.

📘

Note that there is a difference between creating a transaction for a native token transfer or calling a contract:

  • For native token transactions, the provided API can be used as described, without providing a data element. No encoded function is needed.

  • For calling contracts or doing (ERC-20, ERC-721, or ERC-1155) token transactions, which are basically contract calls as well (safeTransferFrom function), you'll need to construct the (transaction-)data yourself.

There are a number of libraries that allow you to build the encoded transaction data (e.g. web3j for Java, web3py for Python, etc.)

In web3j, building the encoded function looks something like this:

List inputParams = new ArrayList(); List outputParams = new ArrayList(); Function function = new Function("fuctionName", inputParams, outputParams); String encodedFunction = FunctionEncoder.encode(function)

The encodedFunction is what needs to be passed as data in the Request Body.

Types

  • ETHEREUM_TRANSACTION

  • BSC_TRANSACTION

  • AVAC_TRANSACTION

  • MATIC_TRANSACTION

  • GOCHAIN_TRANSACTION

  • VECHAIN_TRANSACTION

  • BITCOIN_TRANSACTION

  • LITECOIN_TRANSACTION

  • AETERNITY_TRANSACTION

  • NEO_NATIVE_TRANSACTION

  • NEO_GAS_TRANSACTION

  • HEDERA_TRANSACTION

Common Fields

Parameter
Param Type
Value
Description
Example Value

Signing-Method

Header

id:value

id: This is the ID of the signing method value: This is the value of the signing method

756ae7a7-3713-43ee-9936-0dff50306488:123456

Field
Type
Description
Mandatory

pincode (Deprecated)

String

The PIN code of the wallet that needs to sign for this request.

❌

walletId

String

The ID of the wallet you want to use to sign the transaction.

✅

submit

boolean

Whether or not you also immediately want to submit the transaction to the blockchain.

✅

type

Type

The type of transaction you are trying to sign.See types for the possible values.

✅

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: Type
}

Custom Fields

EVM based chains

This applies to the following types ETHEREUM_TRANSACTION , BSC_TRANSACTION , AVAC_TRANSACTION , MATIC_TRANSACTION and GOCHAIN_TRANSACTION .

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: Type,
  
  to!: string,
  value?: number,
  data?: string,
  gas!: number,
  gasPrice!: number,
  nonce!: number
}
Field
Type
Description
Mandatory?

to

String

The destination of the transaction.

✅

value

number

The amount of native currency in wei (e.g. Ether, Matic, BNB) you want to include in the transaction.

❌

data

String

The data you want to include in the transaction (if any). Here you can for example add an encoded contract call (encodedFunction).

❌

gas

number

The max amount of gas (gas limit) this transaction is allowed to use.

✅

gasPrice

number

The price in wei that you want to pay for one amount of gas.

✅

nonce

number

The nonce (sequence) of the transaction.

✅

📘

If you want a prediction of the gas/gasPrice and the next nonce, you can submit the request first to POST /signatures/prepare (leaving these fields empty). This will then return you a gas estimate + the next nonce.

Types of transaction

Vechain Transaction

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: VECHAIN_TRANSACTION,
  
  blockRef?: string,
  chainTag?: string,
  expiration?: number,
  gas?: number,
  gasPriceCoef?: number,
  nonce?: string,
  clauses!: [{
    to!: string,
    amount?: number,
    data?: string
  }] 
}

Bitcoin Transaction

JSON

 {
  walletId!: string,
  submit!: boolean,
  type!: BITCOIN_TRANSACTION,
  
  to!: string,
  value?: number,
  feePerByte?: number
}

Litecoin Transaction

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: LITECOIN_TRANSACTION,
  
  to!: string,
  value?: number,
  feePerKiloByte?: number
}

AEternity Transaction

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: AETERNITY_TRANSACTION,
  
  to!: string,
  value?: number,
  data?: string,
  nonce?: number,
  fee?: number,
  ttl?: number
}

Neo native Transaction

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: NEO_NATIVE_TRANSACTION,
  
  to!: string,
  value?: number
}

Neo gas Transaction

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: NEO_GAS_TRANSACTION,
  
  to!: string,
  value?: number
}

Hedera Transaction

JSON

{
  walletId!: string,
  submit!: boolean,
  type!: HEDERA_TRANSACTION,
  
  data?: string
}

Response Body:

JSON

{
  type!: 'TRANSACTION_SIGNATURE',
  signedTransaction!: string
}
reference