Cardano: get public key

Retrieves BIP32-Ed25519 extended public derived by given BIP32-Ed25519 path. User is presented with a description of the requested key and asked to confirm the export on Trezor.

const result = await TrezorConnect.cardanoGetPublicKey(params);

Params

Optional common params

CardanoGetPublicKey type

Exporting single public key

  • pathrequired string | Array<number> minimum length is 3. read more
  • showOnTrezoroptional boolean determines if publick key will be displayed on device. Default is set to true
  • derivationTypeoptional CardanoDerivationType enum. determines used derivation type. Default is set to ICARUS_TREZOR=2

Exporting bundle of publick keys

  • bundle - Array of Objects with path and showOnTrezor fields

Example

Display public key of first cardano account:

TrezorConnect.cardanoGetPublicKey({
    path: "m/44'/1815'/0'",
});

Return a bundle of cardano public keys without displaying them on device:

TrezorConnect.cardanoGetPublicKey({
    bundle: [
        { path: "m/44'/1815'/0'", showOnTrezor: false }, // account 1
        { path: "m/44'/1815'/1'", showOnTrezor: false }, // account 2
        { path: "m/44'/1815'/2'", showOnTrezor: false }, // account 3
    ],
});

Result

CardanoPublicKey type

Result with only one public key

{
    success: true,
    payload: {
        path: Array<number>, // hardended path
        serializedPath: string,
        publicKey: string,
        node: HDPubNode,
    }
}

Result with a bundle of public keys

{
    success: true,
    payload: [
        { path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode }, // account 1
        { path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode}, // account 2
        { path: Array<number>, serializedPath: string, publicKey: string, node: HDPubNode }  // account 3
    ]
}

Error

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