diff --git a/docs/methods/cardanoSignTransaction.md b/docs/methods/cardanoSignTransaction.md index bce5b2d06..7614a961a 100644 --- a/docs/methods/cardanoSignTransaction.md +++ b/docs/methods/cardanoSignTransaction.md @@ -15,14 +15,9 @@ TrezorConnect.cardanoSignTransaction(params).then(function(result) { }); ``` -### Notes -**Unfortunately we are aware of the fact that currently at most ~14 inputs are supported per transaction. This should be resolved when the cardano app is updated to support transaction streaming. Meanwhile, a workaround is to send multiple smaller transactions containing less inputs.** - -**Also, each serialized transaction output size is currently limited to 512 bytes at Trezor firmware level. This limitation is a mitigation measure to prevent sending large (especially change) outputs containing many tokens that Trezor would not be able to spend given that currently the full Cardano transaction is held in-memory. Once Cardano-transaction signing is refactored to be streamed, this limit can be lifted.** - ### Params [****Optional common params****](commonParams.md) -###### [flowtype](../../src/js/types/networks/cardano.js#L62-L109) +###### [flowtype](../../src/js/types/networks/cardano.js#L61-L171) * `inputs` — *obligatory* `Array` of [CardanoInput](../../src/js/types/networks/cardano.js#L61) * `outputs` - *obligatory* `Array` of [CardanoOutput](../../src/js/types/networks/cardano.js#L76) * `fee` - *obligatory* `String` @@ -30,9 +25,10 @@ TrezorConnect.cardanoSignTransaction(params).then(function(result) { * `networkId` - *obligatory* `Integer` 1 for Mainnet, 0 for Testnet * `ttl` - *optional* `String` * `validityIntervalStart` - *optional* `String` -* `certificates` - *optional* `Array` of [CardanoCertificate](../../src/js/types/networks/cardano.js#L85) -* `withdrawals` - *optional* `Array` of [CardanoWithdrawal](../../src/js/types/networks/cardano.js#L90) -* `metadata` - *optional* `String` +* `certificates` - *optional* `Array` of [CardanoCertificate](../../src/js/types/networks/cardano.js#L123) +* `withdrawals` - *optional* `Array` of [CardanoWithdrawal](../../src/js/types/networks/cardano.js#L130) +* `auixiliaryData` - *optional* [CardanoAuxiliaryData](../../src/js/types/networks/cardano.js#140) +* `metadata` - *removed* - use `auxiliaryData` instead ### Stake pool registration certificate specifics @@ -63,7 +59,7 @@ TrezorConnect.cardanoSignTransaction({ }, { addressParameters: { - addressType: 0, + addressType: 0, // base address type path: "m/1852'/1815'/0'/0/0", stakingPath: "m/1852'/1815'/0'/2/0", }, @@ -90,15 +86,15 @@ TrezorConnect.cardanoSignTransaction({ validityIntervalStart: "20", certificates: [ { - type: 0, + type: 0, // stake registration certificate type path: "m/1852'/1815'/0'/2/0", }, { - type: 1, + type: 1, // stake deregistration certificate type path: "m/1852'/1815'/0'/2/0", }, { - type: 2, + type: 2, // stake delegation certificate type path: "m/1852'/1815'/0'/2/0", pool: "f61c42cbf7c8c53af3f520508212ad3e72f674f957fe23ff0acb4973", }, @@ -109,7 +105,9 @@ TrezorConnect.cardanoSignTransaction({ amount: "1000", } ], - metadata: "a200a11864a118c843aa00ff01a119012c590100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + auxiliaryData: { + blob: "a200a11864a118c843aa00ff01a119012c590100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, protocolMagic: 764824073, networkId: 1, }); @@ -191,8 +189,44 @@ TrezorConnect.cardanoSignTransaction({ }); ``` +#### Catalyst voting key registration +```javascript +TrezorConnect.cardanoSignTransaction({ + inputs: [ + { + path: "m/1852'/1815'/0'/0/0", + prev_hash: "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7", + prev_index: 0, + } + ], + outputs: [ + { + address: "addr1q84sh2j72ux0l03fxndjnhctdg7hcppsaejafsa84vh7lwgmcs5wgus8qt4atk45lvt4xfxpjtwfhdmvchdf2m3u3hlsd5tq5r", + amount: "3003112", + } + ], + fee: "42", + ttl: "10", + auxiliaryData: { + catalystRegistrationParameters: { + votingPublicKey: + "1af8fa0b754ff99253d983894e63a2b09cbb56c833ba18c3384210163f63dcfc", + stakingPath: "m/1852'/1815'/0'/2/0", + rewardAddressParameters: { + addressType: 0, // base address type + path: "m/1852'/1815'/0'/0/0", + stakingPath: "m/1852'/1815'/0'/2/0", + }, + nonce: "22634813", + }, + }, + protocolMagic: 764824073, + networkId: 1, +}); +``` + ### Result -###### [flowtype](../../src/js/types/networks/cardano.js#L107-L110) +###### [flowtype](../../src/js/types/networks/cardano.js#L158-L162) ```javascript { success: true, diff --git a/src/js/core/methods/CardanoSignTransaction.js b/src/js/core/methods/CardanoSignTransaction.js index 45a79d9a2..5d761dca6 100644 --- a/src/js/core/methods/CardanoSignTransaction.js +++ b/src/js/core/methods/CardanoSignTransaction.js @@ -8,6 +8,7 @@ import { addressParametersToProto, validateAddressParameters, } from './helpers/cardanoAddressParameters'; +import { transformAuxiliaryData } from './helpers/cardanoAuxiliaryData'; import { transformCertificate } from './helpers/cardanoCertificate'; import { validateTokenBundle, tokenBundleToProto } from './helpers/cardanoTokens'; import { ERRORS } from '../../constants'; @@ -26,6 +27,7 @@ const CardanoSignTransactionFeatures = Object.freeze({ SignStakePoolRegistrationAsOwner: ['0', '2.3.5'], ValidityIntervalStart: ['0', '2.3.5'], MultiassetOutputs: ['0', '2.3.5'], + AuxiliaryData: ['0', '2.3.7'], }); export default class CardanoSignTransaction extends AbstractMethod { @@ -42,6 +44,14 @@ export default class CardanoSignTransaction extends AbstractMethod { this.info = 'Sign Cardano transaction'; const { payload } = message; + + if (payload.metadata) { + throw ERRORS.TypedError( + 'Method_InvalidParameter', + 'Metadata field has been replaced by auxiliaryData.', + ); + } + // validate incoming parameters validateParams(payload, [ { name: 'inputs', type: 'array', obligatory: true }, @@ -50,7 +60,6 @@ export default class CardanoSignTransaction extends AbstractMethod { { name: 'ttl', type: 'amount' }, { name: 'certificates', type: 'array', allowEmpty: true }, { name: 'withdrawals', type: 'array', allowEmpty: true }, - { name: 'metadata', type: 'string' }, { name: 'validityIntervalStart', type: 'amount' }, { name: 'protocolMagic', type: 'number', obligatory: true }, { name: 'networkId', type: 'number', obligatory: true }, @@ -115,6 +124,11 @@ export default class CardanoSignTransaction extends AbstractMethod { }); } + let auxiliaryData; + if (payload.auxiliaryData) { + auxiliaryData = transformAuxiliaryData(payload.auxiliaryData); + } + this.params = { inputs, outputs, @@ -122,7 +136,7 @@ export default class CardanoSignTransaction extends AbstractMethod { ttl: payload.ttl, certificates, withdrawals, - metadata: payload.metadata, + auxiliary_data: auxiliaryData, validity_interval_start: payload.validityIntervalStart, protocol_magic: payload.protocolMagic, network_id: payload.networkId, @@ -156,6 +170,10 @@ export default class CardanoSignTransaction extends AbstractMethod { this._ensureFeatureIsSupported('MultiassetOutputs'); } }); + + if (params.auxiliary_data) { + this._ensureFeatureIsSupported('AuxiliaryData'); + } } async run() { diff --git a/src/js/core/methods/helpers/cardanoAuxiliaryData.js b/src/js/core/methods/helpers/cardanoAuxiliaryData.js new file mode 100644 index 000000000..0b9aa7441 --- /dev/null +++ b/src/js/core/methods/helpers/cardanoAuxiliaryData.js @@ -0,0 +1,56 @@ +/* @flow */ +import { addressParametersToProto, validateAddressParameters } from './cardanoAddressParameters'; +import { validateParams } from './paramsValidator'; +import { validatePath } from '../../../utils/pathUtils'; + +import type { + CardanoTxAuxiliaryDataType, + CardanoCatalystRegistrationParametersType, +} from '../../../types/trezor/protobuf'; +import type { + CardanoAuxiliaryData, + CardanoCatalystRegistrationParameters, +} from '../../../types/networks/cardano'; + +const transformCatalystRegistrationParameters = ( + catalystRegistrationParameters: CardanoCatalystRegistrationParameters, +): CardanoCatalystRegistrationParametersType => { + validateParams(catalystRegistrationParameters, [ + { name: 'votingPublicKey', type: 'string', obligatory: true }, + { name: 'stakingPath', obligatory: true }, + { name: 'nonce', type: 'amount', obligatory: true }, + ]); + validateAddressParameters(catalystRegistrationParameters.rewardAddressParameters); + + return { + voting_public_key: catalystRegistrationParameters.votingPublicKey, + staking_path: validatePath(catalystRegistrationParameters.stakingPath, 3), + reward_address_parameters: addressParametersToProto( + catalystRegistrationParameters.rewardAddressParameters, + ), + nonce: catalystRegistrationParameters.nonce, + }; +}; + +export const transformAuxiliaryData = ( + auxiliaryData: CardanoAuxiliaryData, +): CardanoTxAuxiliaryDataType => { + validateParams(auxiliaryData, [ + { + name: 'blob', + type: 'string', + }, + ]); + + let catalystRegistrationParameters; + if (auxiliaryData.catalystRegistrationParameters) { + catalystRegistrationParameters = transformCatalystRegistrationParameters( + auxiliaryData.catalystRegistrationParameters, + ); + } + + return { + blob: auxiliaryData.blob, + catalyst_registration_parameters: catalystRegistrationParameters, + }; +}; diff --git a/src/js/types/__tests__/cardano.js b/src/js/types/__tests__/cardano.js index 017be79d7..85b57e1b3 100644 --- a/src/js/types/__tests__/cardano.js +++ b/src/js/types/__tests__/cardano.js @@ -204,6 +204,12 @@ export const cardanoSignTransaction = async () => { { address: 'Ae2..', amount: '3003112', + tokenBundle: [ + { + policyId: 'aaff00..', + tokenAmounts: [{ assetNameBytes: 'aaff00..', amount: '3003112' }], + }, + ], }, { addressParameters: { @@ -218,11 +224,74 @@ export const cardanoSignTransaction = async () => { }, }, amount: '3003112', + tokenBundle: [ + { + policyId: 'aaff00..', + tokenAmounts: [{ assetNameBytes: 'aaff00..', amount: '3003112' }], + }, + ], + }, + ], + certificates: [ + { + type: 0, + path: 'm/44', + pool: 'aaff00..', + poolParameters: { + poolId: 'aaff00..', + vrfKeyHash: 'aaff00..', + pledge: '500000000', + cost: '340000000', + margin: { + numerator: '1', + denominator: '2', + }, + rewardAccount: 'stake1uya87zwnmax0v6nnn8ptqkl6ydx4522kpsc3l3wmf3yswygwx45el', + owners: [ + { + stakingKeyPath: "m/1852'", + stakingKeyHash: 'aaff00..', + }, + { + stakingKeyHash: 'aaff00..', + }, + ], + relays: [ + { + type: 0, + ipv4Address: '192.168.0.1', + ipv6Address: '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + port: 1234, + hostName: 'www.test2.test', + }, + ], + metadata: { + url: 'https://www.test.test', + hash: 'aaff00..', + }, + }, }, ], - certificates: [{ type: 0, path: 'm/44', pool: 'aaff00..' }], withdrawals: [{ path: 'm/44', amount: '3003112' }], - metadata: 'aaff00..', + auxiliaryData: { + blob: 'aaff00..', + catalystRegistrationParameters: { + votingPublicKey: 'aaff00..', + stakingPath: 'm/44', + rewardAddressParameters: { + addressType: 0, + path: 'm/44', + stakingPath: 'm/44', + stakingKeyHash: 'aaff00..', + certificatePointer: { + blockIndex: 0, + txIndex: 0, + certificateIndex: 0, + }, + }, + nonce: '0', + }, + }, fee: '42', ttl: '10', protocolMagic: 0, diff --git a/src/js/types/networks/cardano.js b/src/js/types/networks/cardano.js index a35a3173d..0352f5edf 100644 --- a/src/js/types/networks/cardano.js +++ b/src/js/types/networks/cardano.js @@ -130,6 +130,18 @@ export type CardanoWithdrawal = { amount: string, }; +export type CardanoCatalystRegistrationParameters = { + votingPublicKey: string, + stakingPath: string | number[], + rewardAddressParameters: CardanoAddressParameters, + nonce: string, +}; + +export type CardanoAuxiliaryData = { + blob?: string, + catalystRegistrationParameters?: CardanoCatalystRegistrationParameters, +}; + export type CardanoSignTransaction = { inputs: CardanoInput[], outputs: CardanoOutput[], @@ -137,10 +149,10 @@ export type CardanoSignTransaction = { ttl?: string, certificates?: CardanoCertificate[], withdrawals?: CardanoWithdrawal[], - metadata?: string, validityIntervalStart?: string, protocolMagic: number, networkId: number, + auxiliaryData?: CardanoAuxiliaryData, }; export type CardanoSignedTx = { diff --git a/src/ts/types/__tests__/cardano.ts b/src/ts/types/__tests__/cardano.ts index 6b93099d1..31d08a1e0 100644 --- a/src/ts/types/__tests__/cardano.ts +++ b/src/ts/types/__tests__/cardano.ts @@ -169,6 +169,12 @@ export const cardanoSignTransaction = async () => { { address: 'Ae2..', amount: '3003112', + tokenBundle: [ + { + policyId: 'aaff00..', + tokenAmounts: [{ assetNameBytes: 'aaff00..', amount: '3003112' }], + }, + ], }, { addressParameters: { @@ -183,13 +189,76 @@ export const cardanoSignTransaction = async () => { }, }, amount: '3003112', + tokenBundle: [ + { + policyId: 'aaff00..', + tokenAmounts: [{ assetNameBytes: 'aaff00..', amount: '3003112' }], + }, + ], + }, + ], + certificates: [ + { + type: 0, + path: 'm/44', + pool: 'aaff00..', + poolParameters: { + poolId: 'aaff00..', + vrfKeyHash: 'aaff00..', + pledge: '500000000', + cost: '340000000', + margin: { + numerator: '1', + denominator: '2', + }, + rewardAccount: 'stake1uya87zwnmax0v6nnn8ptqkl6ydx4522kpsc3l3wmf3yswygwx45el', + owners: [ + { + stakingKeyPath: "m/1852'", + stakingKeyHash: 'aaff00..', + }, + { + stakingKeyHash: 'aaff00..', + }, + ], + relays: [ + { + type: 0, + ipv4Address: '192.168.0.1', + ipv6Address: '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + port: 1234, + hostName: 'www.test2.test', + }, + ], + metadata: { + url: 'https://www.test.test', + hash: 'aaff00..', + }, + }, }, ], + withdrawals: [{ path: 'm/44', amount: '3003112' }], + auxiliaryData: { + blob: 'aaff00..', + catalystRegistrationParameters: { + votingPublicKey: 'aaff00..', + stakingPath: 'm/44', + rewardAddressParameters: { + addressType: 0, + path: 'm/44', + stakingPath: 'm/44', + stakingKeyHash: 'aaff00..', + certificatePointer: { + blockIndex: 0, + txIndex: 0, + certificateIndex: 0, + }, + }, + nonce: '0', + }, + }, fee: '42', ttl: '10', - certificates: [{ type: 0, path: 'm/44', pool: 'aaff00..' }], - withdrawals: [{ path: 'm/44', amount: '3003112' }], - metadata: 'aaff00..', protocolMagic: 0, networkId: 0, }); diff --git a/src/ts/types/networks/cardano.d.ts b/src/ts/types/networks/cardano.d.ts index 8cd5c9ff5..c95953341 100644 --- a/src/ts/types/networks/cardano.d.ts +++ b/src/ts/types/networks/cardano.d.ts @@ -4,6 +4,7 @@ import { HDNodeType, CardanoAddressType, CardanoCertificateType, + CardanoPoolRelayType, } from '../trezor/protobuf'; // GetPublicKey @@ -55,31 +56,93 @@ export interface CardanoAddress { // Sign transaction - export interface CardanoInput { path: string | number[]; prev_hash: string; prev_index: number; } + +export type CardanoToken = { + assetNameBytes: string; + amount: string; +} + +export type CardanoAssetGroup = { + policyId: string; + tokenAmounts: CardanoToken[]; +} + export type CardanoOutput = | { addressParameters: CardanoAddressParameters; amount: string; + tokenBundle?: CardanoAssetGroup[]; } | { address: string; amount: string; - }; + tokenBundle?: CardanoAssetGroup[]; + } + +export type CardanoPoolOwner = { + stakingKeyPath?: string | number[]; + stakingKeyHash?: string; +} + +export type CardanoPoolRelay = { + type: CardanoPoolRelayType; + ipv4Address?: string; + ipv6Address?: string; + port?: number; + hostName?: string; +} + +export type CardanoPoolMetadata = { + url: string; + hash: string; +} + +export type CardanoPoolMargin = { + numerator: string; + denominator: string; +} + +export type CardanoPoolParameters = { + poolId: string; + vrfKeyHash: string; + pledge: string; + cost: string; + margin: CardanoPoolMargin; + rewardAccount: string; + owners: CardanoPoolOwner[]; + relays: CardanoPoolRelay[]; + metadata: CardanoPoolMetadata; +} + export type CardanoCertificate = { type: CardanoCertificateType; path: string | number[]; pool?: string; + poolParameters?: CardanoPoolParameters; } + export type CardanoWithdrawal = { path: string | number[]; amount: string; } +export type CardanoCatalystRegistrationParameters = { + votingPublicKey: string; + stakingPath: string | number[]; + rewardAddressParameters: CardanoAddressParameters; + nonce: string; +} + +export type CardanoAuxiliaryData = { + blob?: string; + catalystRegistrationParameters?: CardanoCatalystRegistrationParameters; +} + export interface CardanoSignTransaction { inputs: CardanoInput[]; outputs: CardanoOutput[]; @@ -87,10 +150,10 @@ export interface CardanoSignTransaction { ttl?: string; certificates?: CardanoCertificate[]; withdrawals?: CardanoWithdrawal[]; - metadata?: string; validityIntervalStart?: string; protocolMagic: number; networkId: number; + auxiliaryData?: CardanoAuxiliaryData; } export interface CardanoSignedTx { diff --git a/tests/__fixtures__/cardanoSignTransaction.js b/tests/__fixtures__/cardanoSignTransaction.js index 7c15a9e60..b12f82402 100644 --- a/tests/__fixtures__/cardanoSignTransaction.js +++ b/tests/__fixtures__/cardanoSignTransaction.js @@ -505,11 +505,72 @@ export default { protocolMagic: PROTOCOL_MAGICS.mainnet, networkId: NETWORK_IDS.mainnet, }, + result: false, + }, + + { + description: 'signAuxiliaryData', + params: { + inputs: [SAMPLE_INPUTS.shelley_input], + outputs: [SAMPLE_OUTPUTS.simple_shelley_output], + fee: FEE, + ttl: TTL, + auxiliaryData: { + blob: + 'a200a11864a118c843aa00ff01a119012c590100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + }, + protocolMagic: PROTOCOL_MAGICS.mainnet, + networkId: NETWORK_IDS.mainnet, + }, result: { hash: '1875f1d59a53f1cb4c43949867d72bcfd857fa3b64feb88f41b78ddaa1a21cbf', serializedTx: '83a500818258203b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b700018182583901eb0baa5e570cffbe2934db29df0b6a3d7c0430ee65d4c3a7ab2fefb91bc428e4720702ebd5dab4fb175324c192dc9bb76cc5da956e3c8dff0102182a030a075820ea4c91860dd5ec5449f8f985d227946ff39086b17f10b5afb93d12ee87050b6aa100818258205d010cf16fdeff40955633d6c565f3844a288a24967cf6b76acbeb271b4f13c15840b2015772a91043aeb04b98111744a098afdade0db5e30206538d7f2814965a5800d45240137f4d0dc81845a71e67cda38beaf816a520d73c4decbf7cbf0f6d08a200a11864a118c843aa00ff01a119012c590100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', }, + legacyResults: [ + { + // older FW doesn't support auxiliary data + rules: ['<2.3.7'], + payload: false, + }, + ], + }, + + { + description: 'signCatalystVotingRegistration', + params: { + inputs: [SAMPLE_INPUTS.shelley_input], + outputs: [SAMPLE_OUTPUTS.simple_shelley_output], + fee: FEE, + ttl: TTL, + auxiliaryData: { + catalystRegistrationParameters: { + votingPublicKey: + '1af8fa0b754ff99253d983894e63a2b09cbb56c833ba18c3384210163f63dcfc', + stakingPath: "m/1852'/1815'/0'/2/0", + rewardAddressParameters: { + addressType: 0, + path: "m/1852'/1815'/0'/0/0", + stakingPath: "m/1852'/1815'/0'/2/0", + }, + nonce: '22634813', + }, + }, + protocolMagic: PROTOCOL_MAGICS.mainnet, + networkId: NETWORK_IDS.mainnet, + }, + result: { + hash: '839a587109358e0aa81b8fb3d5fa74665fac303425ec544a4db7f6ba4e882dff', + serializedTx: + '83a500818258203b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b700018182583901eb0baa5e570cffbe2934db29df0b6a3d7c0430ee65d4c3a7ab2fefb91bc428e4720702ebd5dab4fb175324c192dc9bb76cc5da956e3c8dff0102182a030a075820a943e9166f1bb6d767b175384d3bd7d23645170df36fc1861fbf344135d8e120a100818258205d010cf16fdeff40955633d6c565f3844a288a24967cf6b76acbeb271b4f13c15840187ecd899e01390272a8d8289088199b3453945fa076819b5b5df60c325c10315477cc801044dfb553e780a300d79627ef5c09e64c6f953cc33bbc59152c900282a219ef64a40158201af8fa0b754ff99253d983894e63a2b09cbb56c833ba18c3384210163f63dcfc025820bc65be1b0b9d7531778a1317c2aa6de936963c3f9ac7d5ee9e9eda25e0c97c5e0358390180f9e2c88e6c817008f3a812ed889b4a4da8e0bd103f86e7335422aa122a946b9ad3d2ddf029d3a828f0468aece76895f15c9efbd69b4277041a0159613d19ef65a101584074f27d877bbb4a5fc4f7c56869905c11f70bad0af3de24b23afaa1d024e750930f434ecc4b73e5d1723c2cb8548e8bf6098ac876487b3a6ed0891cb76994d40980', + }, + legacyResults: [ + { + // older FW doesn't support auxiliary data + rules: ['<2.3.7'], + payload: false, + }, + ], }, {