From f800200ea6e7b78609c69cc00cdac7beced4e07a Mon Sep 17 00:00:00 2001 From: ByteZhang Date: Thu, 10 Oct 2024 21:28:20 +0800 Subject: [PATCH] feat: ada support conway --- .../src/api/cardano/CardanoSignTransaction.ts | 82 ++++++++++++++++- .../src/api/cardano/helper/auxiliaryData.ts | 87 ++++++++++++------- .../src/api/cardano/helper/certificate.ts | 47 ++++++++++ packages/core/src/data/messages/messages.json | 82 ++++++++++++++--- packages/core/src/types/api/cardano.ts | 30 +++++-- .../scripts/protobuf-patches/index.js | 1 + packages/hd-transport/src/types/messages.ts | 54 ++++++++---- submodules/firmware | 2 +- 8 files changed, 313 insertions(+), 72 deletions(-) diff --git a/packages/core/src/api/cardano/CardanoSignTransaction.ts b/packages/core/src/api/cardano/CardanoSignTransaction.ts index fac88b846..3b1797fac 100644 --- a/packages/core/src/api/cardano/CardanoSignTransaction.ts +++ b/packages/core/src/api/cardano/CardanoSignTransaction.ts @@ -1,3 +1,5 @@ +import semver from 'semver'; +import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared'; import { BaseMethod } from '../BaseMethod'; import { PROTO } from '../../constants'; import { UI_REQUEST } from '../../constants/ui-request'; @@ -24,7 +26,10 @@ import type { CardanoSignedTxData, CardanoSignedTxWitness, CardanoAuxiliaryDataSupplement, + CardanoSignTransaction as CardanoSignTransactionType, } from '../../types/api/cardano'; +import { DeviceFirmwareRange } from '../../types'; +import { getDeviceFirmwareVersion, getMethodVersionRange } from '../../utils'; export default class CardanoSignTransaction extends BaseMethod { hasBundle?: boolean; @@ -48,6 +53,16 @@ export default class CardanoSignTransaction extends BaseMethod { const { payload } = this; + // convert legacy parameters to new parameter + // payload.auxiliaryData.governanceRegistrationParameters are legacy params kept for backward compatibility (for now) + if (payload.auxiliaryData && payload.auxiliaryData.governanceRegistrationParameters) { + console.warn( + 'Please use cVoteRegistrationParameters instead of governanceRegistrationParameters.' + ); + payload.auxiliaryData.cVoteRegistrationParameters = + payload.auxiliaryData.governanceRegistrationParameters; + } + // validate incoming parameters validateParams(payload, [ { name: 'signingMode', type: 'number', required: true }, @@ -69,6 +84,8 @@ export default class CardanoSignTransaction extends BaseMethod { { name: 'additionalWitnessRequests', type: 'array', allowEmpty: true }, { name: 'derivationType', type: 'number' }, { name: 'includeNetworkId', type: 'boolean' }, + { name: 'chunkify', type: 'boolean' }, + { name: 'tagCborSets', type: 'boolean' }, ]); const inputsWithPath = payload.inputs.map(transformInput); @@ -172,9 +189,65 @@ export default class CardanoSignTransaction extends BaseMethod { ? payload.derivationType : PROTO.CardanoDerivationType.ICARUS, includeNetworkId: payload.includeNetworkId, + chunkify: payload.chunkify, + tagCborSets: payload.tagCborSets, }; } + hasConway = () => { + const payload = this.payload as CardanoSignTransactionType; + if (payload.tagCborSets != null) { + return true; + } + if (payload.auxiliaryData?.cVoteRegistrationParameters != null) { + return true; + } + for (const certificate of payload.certificates ?? []) { + if (certificate.dRep != null) { + return true; + } + if (certificate.deposit != null) { + return true; + } + if ( + certificate.type === PROTO.CardanoCertificateType.STAKE_REGISTRATION_CONWAY || + certificate.type === PROTO.CardanoCertificateType.STAKE_DEREGISTRATION_CONWAY || + certificate.type === PROTO.CardanoCertificateType.VOTE_DELEGATION + ) { + return true; + } + } + + return false; + }; + + supportConwayVersionRange = (): DeviceFirmwareRange => ({ + model_touch: { + min: '4.11.0', + }, + }); + + checkSupportConway = () => { + const firmwareVersion = getDeviceFirmwareVersion(this.device.features)?.join('.'); + + const versionRange = getMethodVersionRange( + this.device.features, + type => this.supportConwayVersionRange()[type] + ); + + if (!versionRange) { + return; + } + + if (!semver.valid(firmwareVersion) || semver.lt(firmwareVersion, versionRange.min)) { + throw ERRORS.TypedError( + HardwareErrorCode.CallMethodNeedUpgradeFirmware, + `Device firmware version is too low, please update to ${versionRange.min}`, + { current: firmwareVersion, require: versionRange.min } + ); + } + }; + async signTx(): Promise { const typedCall = this.device.getCommands().typedCall.bind(this.device.getCommands()); @@ -202,6 +275,8 @@ export default class CardanoSignTransaction extends BaseMethod { reference_inputs_count: this.params.referenceInputs.length, derivation_type: this.params.derivationType, include_network_id: this.params.includeNetworkId, + chunkify: this.params.chunkify, + tag_cbor_sets: this.params.tagCborSets, }; // init @@ -250,9 +325,10 @@ export default class CardanoSignTransaction extends BaseMethod { auxiliaryDataSupplement = { type: auxiliaryDataType, auxiliaryDataHash: message.auxiliary_data_hash as unknown as string, + cVoteRegistrationSignature: message.cvote_registration_signature, // @ts-expect-error - governanceSignature: message.governance_signature, - catalystSignature: message.governance_signature, + catalystSignature: message.cvote_registration_signature, + governanceSignature: message.cvote_registration_signature, }; } await typedCall('CardanoTxHostAck', 'CardanoTxItemAck'); @@ -310,6 +386,8 @@ export default class CardanoSignTransaction extends BaseMethod { } run() { + this.checkSupportConway(); + return this.signTx(); } } diff --git a/packages/core/src/api/cardano/helper/auxiliaryData.ts b/packages/core/src/api/cardano/helper/auxiliaryData.ts index ed82d8d51..c397ea6bd 100644 --- a/packages/core/src/api/cardano/helper/auxiliaryData.ts +++ b/packages/core/src/api/cardano/helper/auxiliaryData.ts @@ -8,41 +8,65 @@ import { validateParams } from '../../helpers/paramsValidator'; import { validatePath } from '../../helpers/pathUtils'; import type { CardanoAuxiliaryData, - CardanoGovernanceRegistrationDelegation, - CardanoGovernanceRegistrationParameters, + CardanoCVoteRegistrationParameters, + CardanoCVoteRegistrationDelegation, } from '../../../types/api/cardano'; import { PROTO } from '../../../constants'; const MAX_DELEGATION_COUNT = 32; const transformDelegation = ( - delegation: CardanoGovernanceRegistrationDelegation -): PROTO.CardanoGovernanceRegistrationDelegation => { + delegation: CardanoCVoteRegistrationDelegation +): PROTO.CardanoCVoteRegistrationDelegation => { + // @ts-expect-error votingPublicKey is a legacy param kept for backward compatibility (for now) + if (delegation.votingPublicKey) { + console.warn('Please use votePublicKey instead of votingPublicKey.'); + // @ts-expect-error + delegation.votePublicKey = delegation.votingPublicKey; + } + validateParams(delegation, [ { name: 'votingPublicKey', type: 'string', required: true }, { name: 'weight', type: 'uint', required: true }, ]); return { - voting_public_key: delegation.votingPublicKey, + vote_public_key: delegation.votePublicKey, weight: delegation.weight, }; }; -const transformGovernanceRegistrationParameters = ( - governanceRegistrationParameters: CardanoGovernanceRegistrationParameters -): PROTO.CardanoGovernanceRegistrationParametersType => { - validateParams(governanceRegistrationParameters, [ - { name: 'votingPublicKey', type: 'string' }, +const transformCvoteRegistrationParameters = ( + cVoteRegistrationParameters: CardanoCVoteRegistrationParameters +): PROTO.CardanoCVoteRegistrationParametersType => { + // votingPublicKey and rewardAddressParameters are legacy params kept for backward compatibility (for now) + // @ts-expect-error + if (cVoteRegistrationParameters.votingPublicKey) { + console.warn('Please use votePublicKey instead of votingPublicKey.'); + // @ts-expect-error + cVoteRegistrationParameters.votePublicKey = cVoteRegistrationParameters.votingPublicKey; + } + // @ts-expect-error + if (cVoteRegistrationParameters.rewardAddressParameters) { + console.warn('Please use paymentAddressParameters instead of rewardAddressParameters.'); + cVoteRegistrationParameters.paymentAddressParameters = + // @ts-expect-error + cVoteRegistrationParameters.rewardAddressParameters; + } + + validateParams(cVoteRegistrationParameters, [ + { name: 'votePublicKey', type: 'string' }, { name: 'stakingPath', required: true }, { name: 'nonce', type: 'uint', required: true }, { name: 'format', type: 'number' }, { name: 'delegations', type: 'array', allowEmpty: true }, { name: 'votingPurpose', type: 'uint' }, + { name: 'paymentAddress', type: 'string' }, ]); - validateAddressParameters(governanceRegistrationParameters.rewardAddressParameters); + const { paymentAddressParameters } = cVoteRegistrationParameters; + validateAddressParameters(paymentAddressParameters); - const { delegations } = governanceRegistrationParameters; + const { delegations } = cVoteRegistrationParameters; if (delegations && delegations.length > MAX_DELEGATION_COUNT) { throw ERRORS.TypedError( HardwareErrorCode.CallMethodInvalidParameter, @@ -51,15 +75,16 @@ const transformGovernanceRegistrationParameters = ( } return { - voting_public_key: governanceRegistrationParameters.votingPublicKey, - staking_path: validatePath(governanceRegistrationParameters.stakingPath, 3), - reward_address_parameters: addressParametersToProto( - governanceRegistrationParameters.rewardAddressParameters - ), - nonce: governanceRegistrationParameters.nonce as unknown as number, - format: governanceRegistrationParameters.format, - delegations: delegations?.map(transformDelegation) as any, - voting_purpose: governanceRegistrationParameters.votingPurpose, + vote_public_key: cVoteRegistrationParameters.votePublicKey, + staking_path: validatePath(cVoteRegistrationParameters.stakingPath, 3), + payment_address_parameters: paymentAddressParameters + ? addressParametersToProto(paymentAddressParameters) + : undefined, + nonce: cVoteRegistrationParameters.nonce as unknown as number, + format: cVoteRegistrationParameters.format, + delegations: delegations?.map(transformDelegation) ?? [], + voting_purpose: cVoteRegistrationParameters.votingPurpose, + payment_address: cVoteRegistrationParameters.paymentAddress, }; }; @@ -73,32 +98,32 @@ export const transformAuxiliaryData = ( }, ]); - let governanceRegistrationParameters; - if (auxiliaryData.governanceRegistrationParameters) { - governanceRegistrationParameters = transformGovernanceRegistrationParameters( - auxiliaryData.governanceRegistrationParameters + let cVoteRegistrationParameters; + if (auxiliaryData.cVoteRegistrationParameters) { + cVoteRegistrationParameters = transformCvoteRegistrationParameters( + auxiliaryData.cVoteRegistrationParameters ); } return { hash: auxiliaryData.hash, - governance_registration_parameters: governanceRegistrationParameters, + cvote_registration_parameters: cVoteRegistrationParameters, }; }; export const modifyAuxiliaryDataForBackwardsCompatibility = ( auxiliary_data: PROTO.CardanoTxAuxiliaryData ): PROTO.CardanoTxAuxiliaryData => { - const { governance_registration_parameters } = auxiliary_data; - if (governance_registration_parameters) { - governance_registration_parameters.reward_address_parameters = + const { cvote_registration_parameters } = auxiliary_data; + if (cvote_registration_parameters?.payment_address_parameters) { + cvote_registration_parameters.payment_address_parameters = modifyAddressParametersForBackwardsCompatibility( - governance_registration_parameters.reward_address_parameters + cvote_registration_parameters.payment_address_parameters ); return { ...auxiliary_data, - governance_registration_parameters, + cvote_registration_parameters, }; } diff --git a/packages/core/src/api/cardano/helper/certificate.ts b/packages/core/src/api/cardano/helper/certificate.ts index b9b57cd8a..a04dea32c 100644 --- a/packages/core/src/api/cardano/helper/certificate.ts +++ b/packages/core/src/api/cardano/helper/certificate.ts @@ -9,6 +9,7 @@ import type { CardanoPoolMetadata, CardanoPoolRelay, CardanoPoolOwner, + CardanoDRep, } from '../../../types/api/cardano'; import { PROTO } from '../../../constants'; @@ -156,6 +157,37 @@ const transformPoolParameters = ( }; }; +const transformDRep = (dRep: CardanoDRep | undefined): PROTO.CardanoDRep | undefined => { + if (!dRep) { + return undefined; + } + + validateParams(dRep, [ + { name: 'type', type: 'number', required: true }, + { name: 'keyHash', type: 'string' }, + { name: 'scriptHash', type: 'string' }, + ]); + + if (dRep.type === PROTO.CardanoDRepType.KEY_HASH && !dRep.keyHash) { + throw ERRORS.TypedError( + HardwareErrorCode.CallMethodInvalidParameter, + 'key_hash must be supplied for key_hash type' + ); + } + + if (dRep.type === PROTO.CardanoDRepType.SCRIPT_HASH && !dRep.scriptHash) { + throw ERRORS.TypedError( + HardwareErrorCode.CallMethodInvalidParameter, + 'script_hash must be supplied for script_hash type' + ); + } + return { + type: dRep.type, + key_hash: dRep.keyHash, + script_hash: dRep.scriptHash, + }; +}; + export const transformCertificate = ( certificate: CardanoCertificate ): CertificateWithPoolOwnersAndRelays => { @@ -176,12 +208,25 @@ export const transformCertificate = ( paramsToValidate.push({ name: 'poolParameters', type: 'object', required: true }); } + if ( + certificate.type === PROTO.CardanoCertificateType.STAKE_REGISTRATION_CONWAY || + certificate.type === PROTO.CardanoCertificateType.STAKE_DEREGISTRATION_CONWAY + ) { + paramsToValidate.push({ name: 'deposit', required: true }); + } + + if (certificate.type === PROTO.CardanoCertificateType.VOTE_DELEGATION) { + paramsToValidate.push({ name: 'dRep', type: 'object', required: true }); + } + validateParams(certificate, paramsToValidate); const { poolParameters, poolOwners, poolRelays } = transformPoolParameters( certificate.poolParameters ); + const dRep = transformDRep(certificate.dRep); + return { certificate: { type: certificate.type, @@ -190,6 +235,8 @@ export const transformCertificate = ( key_hash: certificate.keyHash, pool: certificate.pool, pool_parameters: poolParameters, + deposit: certificate.deposit, + drep: dRep, }, poolOwners, poolRelays, diff --git a/packages/core/src/data/messages/messages.json b/packages/core/src/data/messages/messages.json index 3c6a89517..d59f341d5 100644 --- a/packages/core/src/data/messages/messages.json +++ b/packages/core/src/data/messages/messages.json @@ -1889,7 +1889,18 @@ "STAKE_REGISTRATION": 0, "STAKE_DEREGISTRATION": 1, "STAKE_DELEGATION": 2, - "STAKE_POOL_REGISTRATION": 3 + "STAKE_POOL_REGISTRATION": 3, + "STAKE_REGISTRATION_CONWAY": 7, + "STAKE_DEREGISTRATION_CONWAY": 8, + "VOTE_DELEGATION": 9 + } + }, + "CardanoDRepType": { + "values": { + "KEY_HASH": 0, + "SCRIPT_HASH": 1, + "ABSTAIN": 2, + "NO_CONFIDENCE": 3 } }, "CardanoPoolRelayType": { @@ -1902,10 +1913,10 @@ "CardanoTxAuxiliaryDataSupplementType": { "values": { "NONE": 0, - "GOVERNANCE_REGISTRATION_SIGNATURE": 1 + "CVOTE_REGISTRATION_SIGNATURE": 1 } }, - "CardanoGovernanceRegistrationFormat": { + "CardanoCVoteRegistrationFormat": { "values": { "CIP15": 0, "CIP36": 1 @@ -2079,6 +2090,10 @@ "rule": "required", "type": "CardanoDerivationType", "id": 6 + }, + "chunkify": { + "type": "bool", + "id": 7 } } }, @@ -2234,6 +2249,17 @@ "options": { "default": 0 } + }, + "chunkify": { + "type": "bool", + "id": 22 + }, + "tag_cbor_sets": { + "type": "bool", + "id": 23, + "options": { + "default": false + } } } }, @@ -2455,6 +2481,23 @@ } } }, + "CardanoDRep": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoDRepType", + "id": 1 + }, + "key_hash": { + "type": "bytes", + "id": 2 + }, + "script_hash": { + "type": "bytes", + "id": 3 + } + } + }, "CardanoTxCertificate": { "fields": { "type": { @@ -2485,6 +2528,14 @@ "key_hash": { "type": "bytes", "id": 6 + }, + "deposit": { + "type": "uint64", + "id": 7 + }, + "drep": { + "type": "CardanoDRep", + "id": 8 } } }, @@ -2513,9 +2564,9 @@ } } }, - "CardanoGovernanceRegistrationDelegation": { + "CardanoCVoteRegistrationDelegation": { "fields": { - "voting_public_key": { + "vote_public_key": { "rule": "required", "type": "bytes", "id": 1 @@ -2527,9 +2578,9 @@ } } }, - "CardanoGovernanceRegistrationParametersType": { + "CardanoCVoteRegistrationParametersType": { "fields": { - "voting_public_key": { + "vote_public_key": { "type": "bytes", "id": 1 }, @@ -2541,8 +2592,7 @@ "packed": false } }, - "reward_address_parameters": { - "rule": "required", + "payment_address_parameters": { "type": "CardanoAddressParametersType", "id": 3 }, @@ -2552,7 +2602,7 @@ "id": 4 }, "format": { - "type": "CardanoGovernanceRegistrationFormat", + "type": "CardanoCVoteRegistrationFormat", "id": 5, "options": { "default": "CIP15" @@ -2560,19 +2610,23 @@ }, "delegations": { "rule": "repeated", - "type": "CardanoGovernanceRegistrationDelegation", + "type": "CardanoCVoteRegistrationDelegation", "id": 6 }, "voting_purpose": { "type": "uint64", "id": 7 + }, + "payment_address": { + "type": "string", + "id": 8 } } }, "CardanoTxAuxiliaryData": { "fields": { - "governance_registration_parameters": { - "type": "CardanoGovernanceRegistrationParametersType", + "cvote_registration_parameters": { + "type": "CardanoCVoteRegistrationParametersType", "id": 1 }, "hash": { @@ -2648,7 +2702,7 @@ "type": "bytes", "id": 2 }, - "governance_signature": { + "cvote_registration_signature": { "type": "bytes", "id": 3 } diff --git a/packages/core/src/types/api/cardano.ts b/packages/core/src/types/api/cardano.ts index 6d3a03868..8aa5a0527 100644 --- a/packages/core/src/types/api/cardano.ts +++ b/packages/core/src/types/api/cardano.ts @@ -1,3 +1,4 @@ +import type { UintType } from '@onekeyfe/hd-transport'; import type { PROTO } from '../../constants'; export interface CardanoAddressParameters { @@ -32,6 +33,12 @@ export type AssetGroupWithTokens = { tokens: PROTO.CardanoToken[]; }; +export interface CardanoDRep { + type: PROTO.CardanoDRepType; + keyHash?: string; + scriptHash?: string; +} + export interface CardanoCertificate { type: PROTO.CardanoCertificateType; path?: string | number[]; @@ -39,6 +46,8 @@ export interface CardanoCertificate { poolParameters?: CardanoPoolParameters; scriptHash?: string; keyHash?: string; + deposit?: UintType; + dRep?: CardanoDRep; } export type CertificateWithPoolOwnersAndRelays = { @@ -129,8 +138,8 @@ export interface CardanoReferenceInput { prev_index: number; } -export interface CardanoGovernanceRegistrationDelegation { - votingPublicKey: string; +export interface CardanoCVoteRegistrationDelegation { + votePublicKey: string; weight: number; } @@ -141,19 +150,20 @@ export interface CardanoCatalystRegistrationParameters { nonce: string; } -export interface CardanoGovernanceRegistrationParameters { - votingPublicKey?: string; +export interface CardanoCVoteRegistrationParameters { + votePublicKey?: string; stakingPath: string | number[]; - rewardAddressParameters: CardanoAddressParameters; + paymentAddressParameters: CardanoAddressParameters; nonce: string; - format?: PROTO.CardanoGovernanceRegistrationFormat; - delegations?: CardanoGovernanceRegistrationDelegation[]; + format?: PROTO.CardanoCVoteRegistrationFormat; + delegations?: CardanoCVoteRegistrationDelegation[]; votingPurpose?: number; + paymentAddress?: string; } export interface CardanoAuxiliaryData { hash?: string; - governanceRegistrationParameters?: CardanoGovernanceRegistrationParameters; + cVoteRegistrationParameters?: CardanoCVoteRegistrationParameters; } export interface CardanoSignTransaction { @@ -178,6 +188,8 @@ export interface CardanoSignTransaction { signingMode: PROTO.CardanoTxSigningMode; derivationType?: PROTO.CardanoDerivationType; includeNetworkId?: boolean; + chunkify?: boolean; + tagCborSets?: boolean; } export interface CardanoSignedTxWitness { @@ -190,7 +202,7 @@ export interface CardanoSignedTxWitness { export interface CardanoAuxiliaryDataSupplement { type: PROTO.CardanoTxAuxiliaryDataSupplementType; auxiliaryDataHash: string; - catalystSignature?: string; + cVoteRegistrationSignature?: string; } export interface CardanoSignedTxData { diff --git a/packages/hd-transport/scripts/protobuf-patches/index.js b/packages/hd-transport/scripts/protobuf-patches/index.js index 5d255c1ce..d6f41c8e4 100644 --- a/packages/hd-transport/scripts/protobuf-patches/index.js +++ b/packages/hd-transport/scripts/protobuf-patches/index.js @@ -127,6 +127,7 @@ const TYPE_PATCH = { 'CardanoPoolParametersType.cost': UINT_TYPE, 'CardanoPoolParametersType.margin_numerator': UINT_TYPE, 'CardanoPoolParametersType.margin_denominator': UINT_TYPE, + 'CardanoTxCertificate.deposit': UINT_TYPE, 'CardanoSignTxInit.ttl': UINT_TYPE, 'CardanoSignTxInit.validity_interval_start': UINT_TYPE, 'CardanoSignTxInit.total_collateral': UINT_TYPE, diff --git a/packages/hd-transport/src/types/messages.ts b/packages/hd-transport/src/types/messages.ts index c2fdd16d9..3c8ffd637 100644 --- a/packages/hd-transport/src/types/messages.ts +++ b/packages/hd-transport/src/types/messages.ts @@ -753,6 +753,16 @@ export enum CardanoCertificateType { STAKE_DEREGISTRATION = 1, STAKE_DELEGATION = 2, STAKE_POOL_REGISTRATION = 3, + STAKE_REGISTRATION_CONWAY = 7, + STAKE_DEREGISTRATION_CONWAY = 8, + VOTE_DELEGATION = 9, +} + +export enum CardanoDRepType { + KEY_HASH = 0, + SCRIPT_HASH = 1, + ABSTAIN = 2, + NO_CONFIDENCE = 3, } export enum CardanoPoolRelayType { @@ -763,10 +773,10 @@ export enum CardanoPoolRelayType { export enum CardanoTxAuxiliaryDataSupplementType { NONE = 0, - GOVERNANCE_REGISTRATION_SIGNATURE = 1, + CVOTE_REGISTRATION_SIGNATURE = 1, } -export enum CardanoGovernanceRegistrationFormat { +export enum CardanoCVoteRegistrationFormat { CIP15 = 0, CIP36 = 1, } @@ -831,6 +841,7 @@ export type CardanoGetAddress = { network_id: number; address_parameters: CardanoAddressParametersType; derivation_type: CardanoDerivationType; + chunkify?: boolean; }; // CardanoAddress @@ -874,6 +885,8 @@ export type CardanoSignTxInit = { has_collateral_return?: boolean; total_collateral?: UintType; reference_inputs_count?: number; + chunkify?: boolean; + tag_cbor_sets?: boolean; }; // CardanoTxInput @@ -952,6 +965,13 @@ export type CardanoPoolParametersType = { relays_count: number; }; +// CardanoDRep +export type CardanoDRep = { + type: CardanoDRepType; + key_hash?: string; + script_hash?: string; +}; + // CardanoTxCertificate export type CardanoTxCertificate = { type: CardanoCertificateType; @@ -960,6 +980,8 @@ export type CardanoTxCertificate = { pool_parameters?: CardanoPoolParametersType; script_hash?: string; key_hash?: string; + deposit?: UintType; + drep?: CardanoDRep; }; // CardanoTxWithdrawal @@ -970,26 +992,27 @@ export type CardanoTxWithdrawal = { key_hash?: string; }; -// CardanoGovernanceRegistrationDelegation -export type CardanoGovernanceRegistrationDelegation = { - voting_public_key: string; +// CardanoCVoteRegistrationDelegation +export type CardanoCVoteRegistrationDelegation = { + vote_public_key: string; weight: number; }; -// CardanoGovernanceRegistrationParametersType -export type CardanoGovernanceRegistrationParametersType = { - voting_public_key?: string; +// CardanoCVoteRegistrationParametersType +export type CardanoCVoteRegistrationParametersType = { + vote_public_key?: string; staking_path: number[]; - reward_address_parameters: CardanoAddressParametersType; + payment_address_parameters?: CardanoAddressParametersType; nonce: number; - format?: CardanoGovernanceRegistrationFormat; - delegations: CardanoGovernanceRegistrationDelegation[]; + format?: CardanoCVoteRegistrationFormat; + delegations: CardanoCVoteRegistrationDelegation[]; voting_purpose?: number; + payment_address?: string; }; // CardanoTxAuxiliaryData export type CardanoTxAuxiliaryData = { - governance_registration_parameters?: CardanoGovernanceRegistrationParametersType; + cvote_registration_parameters?: CardanoCVoteRegistrationParametersType; hash?: string; }; @@ -1023,7 +1046,7 @@ export type CardanoTxItemAck = {}; export type CardanoTxAuxiliaryDataSupplement = { type: CardanoTxAuxiliaryDataSupplementType; auxiliary_data_hash?: string; - governance_signature?: string; + cvote_registration_signature?: string; }; // CardanoTxWitnessRequest @@ -4135,10 +4158,11 @@ export type MessageType = { CardanoPoolRelayParameters: CardanoPoolRelayParameters; CardanoPoolMetadataType: CardanoPoolMetadataType; CardanoPoolParametersType: CardanoPoolParametersType; + CardanoDRep: CardanoDRep; CardanoTxCertificate: CardanoTxCertificate; CardanoTxWithdrawal: CardanoTxWithdrawal; - CardanoGovernanceRegistrationDelegation: CardanoGovernanceRegistrationDelegation; - CardanoGovernanceRegistrationParametersType: CardanoGovernanceRegistrationParametersType; + CardanoCVoteRegistrationDelegation: CardanoCVoteRegistrationDelegation; + CardanoCVoteRegistrationParametersType: CardanoCVoteRegistrationParametersType; CardanoTxAuxiliaryData: CardanoTxAuxiliaryData; CardanoTxMint: CardanoTxMint; CardanoTxCollateralInput: CardanoTxCollateralInput; diff --git a/submodules/firmware b/submodules/firmware index cb6efa83c..1a791cbf3 160000 --- a/submodules/firmware +++ b/submodules/firmware @@ -1 +1 @@ -Subproject commit cb6efa83c9d1a97ad0c31dfa92b746af904628da +Subproject commit 1a791cbf3d312c3c12feee3e82f7a1d8803581d9