Sign a Transaction
A web application may also request Adena to create a signed transaction via the adena.SignTx method. Upon receiving the request, Adena will prompt the user to sign the transaction.
If the user proceeds to sign the transaction, Adena will return the encoded transaction data on the console.
Code
adena.SignTx(
tx: {
messages: [
{
type: "string",
value: object
},
// you may add additional messages within the brackets
...
],
memo?: string
},
isNotification?: boolean // default: true
)Params
message.type
string
"/bank.MsgSend" for transfers
"/vm.m_call" for contract calls
"/vm.m_addpkg" for adding packages
"/vm.m_run" for simulating transactions
message.value
object
Values (must match the type's format)
memo
string
Transaction memo (tag)
tx
[Transaction Model]
Transaction info
isNotification
boolean
Notification (default: true)
Response
code
number
Account number
status
string
Returns success or failure
type
string
Response type
message
string
Descriptive message of the result
data
object
Encoded Transaction Model
Transaction Model
messages[].type
string
"/bank.MsgSend" for transfers "/vm.m_call" for contract calls "/vm.m_addpkg" for adding packages "/vm.m_run" for executing a gno script
messages[].value
object
Values (must match the type's format)
memo
String
Transaction memo (tag)
Encoded Transaction Model
encodedTransaction
string
Signed and encoded transaction
/bank.MsgSend
/bank.MsgSendSample Request
Sample Response
/vm.m_call
/vm.m_callSample Request
Sample Response
/vm.m_addpkg
/vm.m_addpkgSample Request
Sample Response
/vm.m_run
/vm.m_runSample Request
Sample Response
Last updated