trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
724 stars 251 forks source link

Connect: Add permission manifest #4863

Open szymonlesisz opened 5 years ago

szymonlesisz commented 5 years ago

Extend TrezorConnect.manifest function with requested permissions, for example it could be called like this:

TrezorConnect.manifest({
    email: 'dev@email.com',
    appUrl: 'some.app.com',
    permissions: [
        {
            type: 'read',
            coins: ['btc', 'xlm']
            accounts: ["m/49'/0'/0'", "m/44'/148'/0'"]
        },
        {
            type: 'write',
            coin: ['bitcoin', 'stellar']
            accounts: ["m/49'/0'/0'", "m/44'/148'/0'"]
        },
    ],
});

Once granted will never ask for export in popup, however if you decide get keys/addresses/whatever from the account which is not specified in manifest (in this case "m/44'/148'/1'") then confirmation screen will appear

tsusanka commented 2 years ago

Related: https://github.com/trezor/trezor-suite/issues/4862#issuecomment-553342960