Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Latest commit

 

History

History
76 lines (68 loc) · 1.69 KB

tezosGetPublicKey.md

File metadata and controls

76 lines (68 loc) · 1.69 KB

Tezos: get public key

Display requested public key on device and returns it to caller. User is presented with a description of the requested public key and asked to confirm the export.

ES6

const result = await TrezorConnect.tezosGetPublicKey(params);

CommonJS

TrezorConnect.tezosGetPublicKey(params).then(function(result) {

});

Params

Optional common params

Exporting single public key

  • pathrequired string | Array<number> minimum length is 3. read more
  • showOnTrezoroptional boolean determines if public key will be displayed on device.

Exporting bundle of public keys

  • bundle - Array of Objects with path and showOnTrezor fields

Example

Result with only one public key

TrezorConnect.tezosGetPublicKey({
    path: "m/49'/1729'/0'",
});

Result with bundle of public keys

TrezorConnect.tezosGetPublicKey({
    bundle: [
        { path: "m/49'/1729'/0'" }, // account 1
        { path: "m/49'/1729'/1'" }, // account 2
        { path: "m/49'/1729'/2'" }  // account 3
    ]
});

Result

Result with only one public key

{
    success: true,
    payload: {
        publicKey: string,       
        path: Array<number>, 
        serializedPath: string, 
    }
}

Result with bundle of public keys

{
    success: true,
    payload: [
        { path, serializedPath, publicKey }, // account 1
        { path, serializedPath, publicKey }, // account 2
        { path, serializedPath, publicKey }, // account 3
    ]
}

Error

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