scdoSignTransaction

Use requirement

  • Firmware version required

    • Touch: 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

  • pathrequired string | Array<number> minimum length is 3. read more

  • noncerequired string transaction nonce in hex

  • gasPricerequired string transaction gas price in hex

  • gasLimitrequired string transaction gas limit in hex

  • torequired string destination address

  • valuerequired string transaction value in hex

  • timestampoptional string transaction timestamp

  • dataoptional string transaction data in hex

  • txTypeoptional 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
    }
}

Last updated