Links
Comment on page

Transaction API

Sign transaction

await window.spika.signTransaction(transaction);
returns signed transaction or false on error.

Sign and submit transaction

await window.spika.signAndSubmitTransaction(transaction);
This method will return submitted transaction hash or false on error.
Below is an example of valid payload that can be submitted for user's approval as well as response received.
Request Example
1
{
2
"method": "signAndSubmitTransaction",
3
"args": {
4
"type": "entry_function_payload",
5
"function": "0x1::coin::transfer",
6
"type_arguments": [
7
"0x1::aptos_coin::AptosCoin"
8
],
9
"arguments": [
10
"0x06f0a3edf4ae07c5fdc22e97e5c315addd5cbef4241afbbe607301b98163bb57",
11
"717"
12
]
13
},
14
"id": 6
15
}
Response Example
1
{
2
"hash": "0x87dc302865ff0e1dd2b792da57ccee576bd4e3ea97140d4071a483d3e46d67db",
3
"sender": "0xa7eb62961ed6b836a43fb7bbd17a82e8e37f971cd7605b149c68b1683b2baa4e",
4
"sequence_number": "0",
5
"max_gas_amount": "2000",
6
"gas_unit_price": "1",
7
"expiration_timestamp_secs": "1661461645",
8
"payload": {
9
"function": "0x1::coin::transfer",
10
"type_arguments": [
11
"0x1::aptos_coin::AptosCoin"
12
],
13
"arguments": [
14
"0x6f0a3edf4ae07c5fdc22e97e5c315addd5cbef4241afbbe607301b98163bb57",
15
"717"
16
],
17
"type": "entry_function_payload"
18
},
19
"signature": {
20
"public_key": "0x1af2bfb3fe713a332b865319971e842e8d6cbe3e2a418d45395b91939faac39b",
21
"signature": "0x3a7916b14d478a4fc3994fe6c375632f637206846b90e9277201f119dfb407454736599641c5a2c52b0def38fc1979640156c462006f161c7f67ec66a662a10b",
22
"type": "ed25519_signature"
23
}
24
}