πŸ”—evm

Description

The transfer function is used to transfer cryptocurrency from one account to another on a specified blockchain network. This function requires the sender's private key, the value to be transferred, the receiver's address, the blockchain network, and the environment (testnet or mainnet).

Parameters

Parameter
Type
Description

privateKey

string

The private key of the account sending the cryptocurrency.

value

string

The value of cryptocurrency to be transferred, specified in the smallest unit of the cryptocurrency.

receiver

string

The address of the account that will receive the cryptocurrency.

blockchain

string

The blockchain network on which the transfer will occur.

env

string

The environment on which the transfer will occur (testnet or mainnet).

Response

Field
Type
Description

code

number

The status code of the operation (0 for failure, 1 for success).

result

object

The receipt of the transaction if the operation was successful.

error

string

The error message if the operation failed.

Example Request and Response

Prerequisites

Before making requests with QUBIT SDK, you must have it installed.

You can install QUBIT SDK using either npm or yarn. Use the following commands to install QUBIT SDK:

Request

Here is an example of how to make a transfer request using the QUBIT SDK:

Response

Use Cases

  • Crypto Wallets: The transfer function can be used by crypto wallets to transfer cryptocurrency from one account to another.

  • Decentralized Exchanges: The transfer function can be used by decentralized exchanges to transfer cryptocurrency from one account to another when users are exchanging one cryptocurrency for another.

  • Crypto Payment Gateways: The transfer function can be used by crypto payment gateways to facilitate cryptocurrency transactions between buyers and sellers.

Last updated