Skip to main content

scdoSignTransaction

Use requirement

  • Firmware version required
    • UKey Lite 24 / UKey Lite 25 / UKey Core 26: 4.10.0

SCDO: sign transaction

Signs transaction using the private key derived by given BIP32 path.

const response = await HardwareSDK.scdoSignTransaction(connectId, deviceId, {
path: "m/44'/541'/0'/0/0",
nonce: "0x0",
gasPrice: "0xbebc200",
gasLimit: "0x5208",
to: "1S0118a02f993fc7a4348fd36b7f7a596948f02b31",
value: "0xf4240",
timestamp: "0",
data: "0x", // optional
txType: 0, // optional
});

Params

Optional common params

  • path - required string | Array<number> minimum length is 3. read more
  • nonce - required string transaction nonce in hex
  • gasPrice - required string transaction gas price in hex
  • gasLimit - required string transaction gas limit in hex
  • to - required string destination address
  • value - required string transaction value in hex
  • timestamp - optional string transaction timestamp
  • data - optional string transaction data in hex
  • txType - optional number transaction type

Example

const response = await HardwareSDK.scdoSignTransaction(connectId, deviceId, {
path: "m/44'/541'/0'/0/0",
nonce: "0x0",
gasPrice: "0xbebc200",
gasLimit: "0x5208",
to: "1S0118a02f993fc7a4348fd36b7f7a596948f02b31",
value: "0xf4240",
timestamp: "0",
});

Result

{
success: true,
payload: {
signature: string,
data_length: number,
path: string
}
}

Error

{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}