Sign & Send a Transaction

A web application may create an unsigned transaction and request Adena to sign and send the transaction with the connected account via the doContract method. Upon receiving the request, Adena will prompt the user to approve the transaction.

If the user approves the transaction, Adena will use the user's private key to sign the transaction to create a signed transaction and broadcast it immediately.

Code

adena.DoContract({
    tx: {
        messages: [
            {
                type: "string",
                value: object
            },
            // you may add additional messages within the brackets
            ...
        ],
        memo?: string
    }, 
    isNotification?: boolean // default: true
)

Params

Key
Type
Description

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

Key
Type
Description

code

number

Account number

status

string

Returns success or failure

type

string

Response type

message

string

Descriptive message of the result

data

object

Transaction Result Model

Transaction Model

Key
Type
Description

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)

Transaction Result Model

Key
Type
Description

hash

string

Transaction hash

height

string

Block height

checkTx

object

Only returns on successful transactions

deliverTx

object

Only returns on successful transactions

/bank.MsgSend

Sample Request

Sample Response

/vm.m_call

Sample Request

Sample Response

/vm.m_addpkg

Sample Request

Sample Response

/vm.m_run

Sample Request

Sample Response

Last updated