This page describes how you can perform a transaction on chain
It is not possible to execute a transaction from a wallet without the approval of the user. Therefore to be able to transfer a token, we will need to do two things: i) create the transfer and ii) ask the user for his approval.
The object that can ask the user his approval is called a Signer, once we've created a Signer object we can use the Signer to perform a transaction.
Function
1
//Creating the signer
2
venlyConnect.createSigner();
3
4
//Asking the signer to transfer a certain value to a certain destination.
5
signer.executeTransfer({
6
walletId:'<WALLET_ID>',
7
to:'<BLOCKCHAIN ADDRESS>',
8
value:3.1415,
9
secretType:'<BLOCKCHAIN>',
10
data:'0x<encoded_function>'
11
})
Copied!
Using the data attribute, you can pass in any encoded function call
The function reference describes the different functions that are available in the Widget. For each function, you can find the signature, it's parameters, and possible options documented.