# Sending Transactions
Transactions are a formal action on a blockchain. They are always initiated in Sensilet with a call to the transferBsv
and transferSensibleFt
method. They can involve a simple
sending of bsv, may result in sending tokens. In Sensilet, using the sensilet.transferBsv
and sensilet.transferSensibleFt
method directly, sending a transaction will involve
composing an options object like this:
const transactionParameters = {
receivers: [{
address: "xxxxxxx",
amount: 10000 //unit: Sat.
}],
broadcast: true, //default is true, sensilet will broadcast this tx. also you can send false to get a signed rawHex and broadcast yourself
};
// txHash is a hex string
// As with any RPC call, it may throw an error
const txid = await sensilet.transferBsv(transactionParameters);
const tokenTransactionParameters = {
genesis, //Unique identifier of the token
receivers: [{
address: "xxxxxxx",
amount: 10000 //Minimum unit of token,must be an integer.
}],
broadcast: true, //default is true, sensilet will broadcast this tx. also you can send false to get a signed rawHex and broadcast yourself
};
// txHash is a hex string
// As with any RPC call, it may throw an error
const txid = await sensilet.transferSensibleFt(tokenTransactionParameters);
# Example
# Transaction Parameters
Many transaction parameters are handled for you by Sensilet, but it's good to know what all the parameters do.
# address
A hex-encoded BitcoinSV address.
# amount
the amount for send to address
# genesis
when paying sensible FT , unique identifier of the token
# broadcast [optional]
default is true, sensilet will broadcast this tx. also you can send false to get a signed rawHex and broadcast yourself