Komodo DeFi Framework Method: task::init_trezor::user_action
task::init_trezor::user_action
When you see the pin grid on your device, or it asks for a passphrase word, use this method.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | integer | ✓ | The identifying number returned when initiating the initialisation process. |
| user_action | object | ✓ | Object containing the params below |
| user_action.action_type | string | ✓ | Either TrezorPin or TrezorPassphrase, depending on which is requested by responses from related methods returning "status": "UserActionRequired" |
| user_action.pin | string (number) | – | When the Trezor device is displaying a grid of numbers for PIN entry, this param will contain your Trezor pin, as mapped through your keyboard numpad. See the image below for more information. |
| user_action.passphrase | string | – | The passphrase functions like an extra word added to your recovery seed, and it used to access hidden wallets. To access the default wallet, input an empty string here. |
Response Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| result | string | ✓ | The outcome of the request. |
{
"mmrpc": "2.0",
"result": {
"status": "Error",
"details": {
"error": "Error on platform coin KMD creation: Hardware Wallet context is not initialized",
"error_path": "lib.init_utxo_standard_activation.utxo_coin_builder",
"error_trace": "lib:103] init_utxo_standard_activation:79] utxo_coin_builder:317]",
"error_type": "CoinCreationError",
"error_data": {
"ticker": "KMD",
"error": "Hardware Wallet context is not initialized"
}
}
},
"id": null
}
📌 Examples
Command (for TrezorPin)
POST task::init_trezor::user_action
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPin",
"pin": "862743"
}
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPin",
"pin": "862743"
}
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPin",
"pin": "862743"
}
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPin",
"pin": "862743"
}
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPin",
"pin": "862743"
}
}
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","method":"task::init_trezor::user_action","params":{"task_id":0,"user_action":{"action_type":"TrezorPin","pin":"862743"}}}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPin",
"pin": "862743"
}
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command (for TrezorPassphrase)
POST task::init_trezor::user_action
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPassphrase",
"passphrase": "breakfast"
}
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPassphrase",
"passphrase": "breakfast"
}
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPassphrase",
"passphrase": "breakfast"
}
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPassphrase",
"passphrase": "breakfast"
}
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPassphrase",
"passphrase": "breakfast"
}
}
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","method":"task::init_trezor::user_action","params":{"task_id":0,"user_action":{"action_type":"TrezorPassphrase","passphrase":"breakfast"}}}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::init_trezor::user_action",
"params": {
"task_id": 0,
"user_action": {
"action_type": "TrezorPassphrase",
"passphrase": "breakfast"
}
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (success)
{
"mmrpc": "2.0",
"result": "success",
"id": null
}