Skip to content

Latest commit

 

History

History
114 lines (104 loc) · 2.78 KB

File metadata and controls

114 lines (104 loc) · 2.78 KB

Tezos: Sign transaction

Asks device to sign given transaction. User is asked to confirm all transaction details on Trezor.

ES6

const result = await TrezorConnect.tezosSignTransaction(params);

CommonJS

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

});

Params

Optional common params

  • path - obligatory string | Array<number>
  • branch - obligatory string
  • operation - obligatory Object type of TezosOperation

Example

Sign transaction operation

TrezorConnect.tezosSignTransaction({
    path: "m/44'/1729'/0'",
    branch: "BKk7ZsvvkQSntQ31j2Hxsw8bfYtUKGjsKHT2aQrxAqUYyQUHxmM",
    operation: {
        transaction: {
            source: "tz1ckrgqGGGBt4jGDmwFhtXc1LNpZJUnA9F2",
            destination: "tz1cTfmc5uuBr2DmHDgkXTAoEcufvXLwq5TP",
            counter: 20449,
            amount: 1000000000,
            fee: 10000,
            gas_limit: 11000,
            storage_limit: 277
        }
    }
});

Sign origination operation

TrezorConnect.tezosSignTransaction({
    path: "m/44'/1729'/0'",
    branch: "BLHRTdZ5vUKSDbkp5vcG1m6ZTST4SRiHWUhGodysLTbvACwi77d",
    operation: {
        origination: {
            source: "tz1ckrgqGGGBt4jGDmwFhtXc1LNpZJUnA9F2",
            manager_pubkey: "tz1ckrgqGGGBt4jGDmwFhtXc1LNpZJUnA9F2",
            delegate: "tz1boot1pK9h2BVGXdyvfQSv8kd1LQM6H889",
            balance: 100000000,
            fee: 10000,
            counter: 20450,
            gas_limit: 10100,
            storage_limit: 277,
            spendable: true,
            delegatable: true
        }
    }
});

Sign delegation operation

TrezorConnect.tezosSignTransaction({
    path: "m/44'/1729'/0'",
    branch: "BMXAKyvzcH1sGQMqpvqXsZGskYU4GuY9Y14c9g3LcNzMRtfLzFa",
    operation: {
        reveal: {
            source: "KT1XYKxAFhtpTKWyoK2MrAQsMQ39KyV7NyA9",
            public_key: "edpkuxZ5W8c2jmcaGuCFZxRDSWxS7hp98zcwj2YpUZkJWs5F7UMuF6",
            counter: 1,
            fee: 10000,
            gas_limit: 10100,
            storage_limit: 277
        },
        delegation: {
            source: "KT1XYKxAFhtpTKWyoK2MrAQsMQ39KyV7NyA9",
            delegate: "tz1boot3mLsohEn4pV9Te3hQihH6N8U3ks59",
            counter: 2,
            fee: 10000,
            gas_limit: 10100,
            storage_limit: 277
        }
    }
});

Result

{
    success: true,
    payload: {
        signature: string,
        sig_op_contents: string,
        operation_hash: string,
    }
}

Error

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