diff --git a/packages/transactions/src/builders.ts b/packages/transactions/src/builders.ts index 621a46ad9..24219d19d 100644 --- a/packages/transactions/src/builders.ts +++ b/packages/transactions/src/builders.ts @@ -366,6 +366,49 @@ export type ServerFailureNoSuchChainTipRejection = { txid: string; }; +export type TooMuchChainingRejection = { + error: string; + reason: TxRejectedReason.TooMuchChaining; + reason_data: { + actual: number; + expected: number; + is_origin: boolean; + message: string; + principal: string; + }; + txid: string; +}; + +export type ConflictingNonceInMempoolRejection = { + error: string; + reason: TxRejectedReason.ConflictingNonceInMempool; + reason_data?: undefined; + txid: string; +}; + +export type BadTransactionVersionRejection = { + error: string; + reason: TxRejectedReason.BadTransactionVersion; + reason_data?: undefined; + txid: string; +}; + +export type TransferRecipientCannotEqualSenderRejection = { + error: string; + reason: TxRejectedReason.TransferRecipientCannotEqualSender; + reason_data: { + recipient: string; + }; + txid: string; +}; + +export type TransferAmountMustBePositiveRejection = { + error: string; + reason: TxRejectedReason.TransferAmountMustBePositive; + reason_data?: undefined; + txid: string; +}; + export type ServerFailureDatabaseRejection = { error: string; reason: TxRejectedReason.ServerFailureDatabase; @@ -375,6 +418,22 @@ export type ServerFailureDatabaseRejection = { txid: string; }; +export type EstimatorErrorRejection = { + error: string; + reason: TxRejectedReason.EstimatorError; + reason_data: { + message: string; + }; + txid: string; +}; + +export type TemporarilyBlacklistedRejection = { + error: string; + reason: TxRejectedReason.TemporarilyBlacklisted; + reason_data?: undefined; + txid: string; +}; + export type ServerFailureOtherRejection = { error: string; reason: TxRejectedReason.ServerFailureOther; @@ -408,7 +467,14 @@ export type TxBroadcastResultRejected = | BadAddressVersionByteRejection | NoCoinbaseViaMempoolRejection | ServerFailureNoSuchChainTipRejection + | TooMuchChainingRejection + | ConflictingNonceInMempoolRejection + | BadTransactionVersionRejection + | TransferRecipientCannotEqualSenderRejection + | TransferAmountMustBePositiveRejection | ServerFailureDatabaseRejection + | EstimatorErrorRejection + | TemporarilyBlacklistedRejection | ServerFailureOtherRejection; export type TxBroadcastResult = TxBroadcastResultOk | TxBroadcastResultRejected; diff --git a/packages/transactions/src/constants.ts b/packages/transactions/src/constants.ts index 47ea8aab2..ed8cbefd7 100644 --- a/packages/transactions/src/constants.ts +++ b/packages/transactions/src/constants.ts @@ -252,6 +252,13 @@ export enum TxRejectedReason { BadAddressVersionByte = 'BadAddressVersionByte', NoCoinbaseViaMempool = 'NoCoinbaseViaMempool', ServerFailureNoSuchChainTip = 'ServerFailureNoSuchChainTip', + TooMuchChaining = 'TooMuchChaining', + ConflictingNonceInMempool = 'ConflictingNonceInMempool', + BadTransactionVersion = 'BadTransactionVersion', + TransferRecipientCannotEqualSender = 'TransferRecipientCannotEqualSender', + TransferAmountMustBePositive = 'TransferAmountMustBePositive', ServerFailureDatabase = 'ServerFailureDatabase', + EstimatorError = 'EstimatorError', + TemporarilyBlacklisted = 'TemporarilyBlacklisted', ServerFailureOther = 'ServerFailureOther', }