From 0e03b926755cf97fa52e83e174d39f64ffb6fc0f Mon Sep 17 00:00:00 2001 From: Caleb Kniffen Date: Wed, 12 Oct 2022 12:28:40 -0500 Subject: [PATCH] fix(ValidationStream): Add `cookie` and `data` to interface (#2110) Add and document more fields on the ValidationStream interface Fixes #2095 --- packages/xrpl/HISTORY.md | 2 ++ packages/xrpl/src/models/methods/subscribe.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/xrpl/HISTORY.md b/packages/xrpl/HISTORY.md index 20ff6e9a..48548e36 100644 --- a/packages/xrpl/HISTORY.md +++ b/packages/xrpl/HISTORY.md @@ -4,7 +4,9 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr ## Unreleased ### Added * Support for ExpandedSignerList amendment that expands the maximum signer list to 32 entries. +* Add `cookie` and `data` to `ValidationStream` interface * Addtional check for memos field format, provide more detailed error messages. + ## 2.4.0 (2022-09-01) ### Added * Export `verify` from ripple-keypairs as `verifyKeypairSignature` for use in web-apps. diff --git a/packages/xrpl/src/models/methods/subscribe.ts b/packages/xrpl/src/models/methods/subscribe.ts index 5f0ed891..346b9153 100644 --- a/packages/xrpl/src/models/methods/subscribe.ts +++ b/packages/xrpl/src/models/methods/subscribe.ts @@ -189,6 +189,18 @@ export interface ValidationStream extends BaseStream { amendments?: string[] /** The amendments this server wants to be added to the protocol. */ base_fee?: number + /** + * An arbitrary value chosen by the server at startup. + * + * If the same validation key pair signs validations with different cookies + * concurrently, that usually indicates that multiple servers are incorrectly + * configured to use the same validation key pair. + */ + cookie?: string + /** + * The contents of the validation message in its canonical binary form + */ + data?: string /** * The unscaled transaction cost (reference_fee value) this server wants to * set by Fee voting.