diff --git a/src/asynch/account/mod.rs b/src/asynch/account/mod.rs index 9b2bbb2..43f3731 100644 --- a/src/asynch/account/mod.rs +++ b/src/asynch/account/mod.rs @@ -68,7 +68,7 @@ where None, classic_address, None, - Some(ledger_index), + Some(ledger_index.into()), None, None, None, diff --git a/src/models/flag_collection.rs b/src/models/flag_collection.rs index c4f00bd..44bb4bc 100644 --- a/src/models/flag_collection.rs +++ b/src/models/flag_collection.rs @@ -96,6 +96,15 @@ where } } +impl FlagCollection +where + T: IntoEnumIterator + Serialize, +{ + pub fn len(&self) -> usize { + self.0.len() + } +} + fn flag_to_u32(flag: &T) -> XRPLModelResult where T: Serialize, diff --git a/src/models/requests/account_channels.rs b/src/models/requests/account_channels.rs index 7c8903b..80f5231 100644 --- a/src/models/requests/account_channels.rs +++ b/src/models/requests/account_channels.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request}; /// This request returns information about an account's Payment /// Channels. This includes only channels where the specified @@ -42,11 +42,9 @@ pub struct AccountChannels<'a> { /// account's Address. The request returns channels where /// this account is the channel's owner/source. pub account: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// Limit the number of transactions to retrieve. Cannot /// be less than 10 or more than 400. The default is 200. pub limit: Option, @@ -56,7 +54,7 @@ pub struct AccountChannels<'a> { pub destination_account: Option>, /// Value from a previous paginated response. /// Resume retrieving data where that response left off. - pub marker: Option, + pub marker: Option>, } impl<'a> Model for AccountChannels<'a> {} @@ -67,9 +65,9 @@ impl<'a> AccountChannels<'a> { account: Cow<'a, str>, destination_account: Option>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, limit: Option, - marker: Option, + marker: Option>, ) -> Self { Self { common_fields: CommonFields { @@ -77,8 +75,10 @@ impl<'a> AccountChannels<'a> { id, }, account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), limit, destination_account, marker, diff --git a/src/models/requests/account_currencies.rs b/src/models/requests/account_currencies.rs index 4ff2e37..a9b9111 100644 --- a/src/models/requests/account_currencies.rs +++ b/src/models/requests/account_currencies.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{default_false, requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// This request retrieves a list of currencies that an account /// can send or receive, based on its trust lines. This is not @@ -22,11 +22,9 @@ pub struct AccountCurrencies<'a> { /// A unique identifier for the account, most commonly /// the account's Address. pub account: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// If true, then the account field only accepts a public /// key or XRP Ledger address. Otherwise, account can be /// a secret or passphrase (not recommended). @@ -52,7 +50,7 @@ impl<'a> AccountCurrencies<'a> { id: Option>, account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, strict: Option, ) -> Self { Self { @@ -61,8 +59,10 @@ impl<'a> AccountCurrencies<'a> { id, }, account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), strict, } } diff --git a/src/models/requests/account_info.rs b/src/models/requests/account_info.rs index 84d8f42..52f6ce9 100644 --- a/src/models/requests/account_info.rs +++ b/src/models/requests/account_info.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// This request retrieves information about an account, its /// activity, and its XRP balance. All information retrieved @@ -21,11 +21,9 @@ pub struct AccountInfo<'a> { /// A unique identifier for the account, most commonly the /// account's Address. pub account: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// If true, then the account field only accepts a public /// key or XRP Ledger address. Otherwise, account can be /// a secret or passphrase (not recommended). @@ -59,7 +57,7 @@ impl<'a> AccountInfo<'a> { id: Option>, account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, strict: Option, queue: Option, signer_lists: Option, @@ -70,8 +68,10 @@ impl<'a> AccountInfo<'a> { id, }, account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), strict, queue, signer_lists, diff --git a/src/models/requests/account_lines.rs b/src/models/requests/account_lines.rs index 3571cf2..ba2bd17 100644 --- a/src/models/requests/account_lines.rs +++ b/src/models/requests/account_lines.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// This request returns information about an account's trust /// lines, including balances in all non-XRP currencies and @@ -22,11 +22,9 @@ pub struct AccountLines<'a> { /// A unique identifier for the account, most commonly the /// account's Address. pub account: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// Limit the number of trust lines to retrieve. The server /// is not required to honor this value. Must be within the /// inclusive range 10 to 400. @@ -53,7 +51,7 @@ impl<'a> AccountLines<'a> { id: Option>, account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, limit: Option, peer: Option>, ) -> Self { @@ -63,8 +61,10 @@ impl<'a> AccountLines<'a> { id, }, account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), limit, peer, } diff --git a/src/models/requests/account_nfts.rs b/src/models/requests/account_nfts.rs index a9e7904..9111420 100644 --- a/src/models/requests/account_nfts.rs +++ b/src/models/requests/account_nfts.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, Marker, Request}; /// This method retrieves all of the NFTs currently owned /// by the specified account. @@ -24,7 +24,7 @@ pub struct AccountNfts<'a> { pub limit: Option, /// Value from a previous paginated response. Resume /// retrieving data where that response left off. - pub marker: Option, + pub marker: Option>, } impl<'a> Model for AccountNfts<'a> {} @@ -44,7 +44,7 @@ impl<'a> AccountNfts<'a> { id: Option>, account: Cow<'a, str>, limit: Option, - marker: Option, + marker: Option>, ) -> Self { Self { common_fields: CommonFields { diff --git a/src/models/requests/account_objects.rs b/src/models/requests/account_objects.rs index d78c438..47036d4 100644 --- a/src/models/requests/account_objects.rs +++ b/src/models/requests/account_objects.rs @@ -5,7 +5,7 @@ use strum_macros::Display; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request}; /// Represents the object types that an AccountObjects /// Request can ask for. @@ -39,11 +39,9 @@ pub struct AccountObjects<'a> { /// A unique identifier for the account, most commonly the /// account's address. pub account: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// If included, filter results to include only this type /// of ledger object. The valid types are: check, deposit_preauth, /// escrow, offer, payment_channel, signer_list, ticket, @@ -58,7 +56,7 @@ pub struct AccountObjects<'a> { pub limit: Option, /// Value from a previous paginated response. Resume retrieving /// data where that response left off. - pub marker: Option, + pub marker: Option>, } impl<'a> Model for AccountObjects<'a> {} @@ -78,11 +76,11 @@ impl<'a> AccountObjects<'a> { id: Option>, account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, r#type: Option, deletion_blockers_only: Option, limit: Option, - marker: Option, + marker: Option>, ) -> Self { Self { common_fields: CommonFields { @@ -90,8 +88,10 @@ impl<'a> AccountObjects<'a> { id, }, account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), r#type, deletion_blockers_only, limit, diff --git a/src/models/requests/account_offers.rs b/src/models/requests/account_offers.rs index 647d3f3..c5880dd 100644 --- a/src/models/requests/account_offers.rs +++ b/src/models/requests/account_offers.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request}; /// This request retrieves a list of offers made by a given account /// that are outstanding as of a particular ledger version. @@ -20,11 +20,9 @@ pub struct AccountOffers<'a> { /// A unique identifier for the account, most commonly the /// account's Address. pub account: Cow<'a, str>, - /// A 20-byte hex string identifying the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or "current", - /// "closed", or "validated" to select a ledger dynamically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// Limit the number of transactions to retrieve. The server is /// not required to honor this value. Must be within the inclusive /// range 10 to 400. @@ -35,7 +33,7 @@ pub struct AccountOffers<'a> { pub strict: Option, /// Value from a previous paginated response. Resume retrieving /// data where that response left off. - pub marker: Option, + pub marker: Option>, } impl<'a> Model for AccountOffers<'a> {} @@ -55,10 +53,10 @@ impl<'a> AccountOffers<'a> { id: Option>, account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, limit: Option, strict: Option, - marker: Option, + marker: Option>, ) -> Self { Self { common_fields: CommonFields { @@ -66,8 +64,10 @@ impl<'a> AccountOffers<'a> { id, }, account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), limit, strict, marker, diff --git a/src/models/requests/account_tx.rs b/src/models/requests/account_tx.rs index 1f16e80..3082a91 100644 --- a/src/models/requests/account_tx.rs +++ b/src/models/requests/account_tx.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request}; /// This request retrieves from the ledger a list of /// transactions that involved the specified account. @@ -20,10 +20,9 @@ pub struct AccountTx<'a> { /// A unique identifier for the account, most commonly the /// account's address. pub account: Cow<'a, str>, - /// Use to look for transactions from a single ledger only. - pub ledger_hash: Option>, - /// Use to look for transactions from a single ledger only. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// Defaults to false. If set to true, returns transactions /// as hex strings instead of JSON. pub binary: Option, @@ -48,7 +47,7 @@ pub struct AccountTx<'a> { /// data where that response left off. This value is stable even /// if there is a change in the server's range of available /// ledgers. - pub marker: Option, + pub marker: Option>, } impl<'a> Model for AccountTx<'a> {} @@ -68,13 +67,13 @@ impl<'a> AccountTx<'a> { id: Option>, account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, binary: Option, forward: Option, ledger_index_min: Option, ledger_index_max: Option, limit: Option, - marker: Option, + marker: Option>, ) -> Self { Self { common_fields: CommonFields { @@ -82,8 +81,10 @@ impl<'a> AccountTx<'a> { id, }, account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), binary, forward, ledger_index_min, diff --git a/src/models/requests/book_offers.rs b/src/models/requests/book_offers.rs index ca27a3d..125adb6 100644 --- a/src/models/requests/book_offers.rs +++ b/src/models/requests/book_offers.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{currency::Currency, requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// The book_offers method retrieves a list of offers, also known /// as the order book, between two currencies. @@ -27,11 +27,9 @@ pub struct BookOffers<'a> { /// issuer fields (omit issuer for XRP), /// like currency amounts. pub taker_pays: Currency<'a>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// If provided, the server does not provide more than /// this many offers in the results. The total number of /// results returned may be fewer than the limit, @@ -62,7 +60,7 @@ impl<'a> BookOffers<'a> { taker_gets: Currency<'a>, taker_pays: Currency<'a>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, limit: Option, taker: Option>, ) -> Self { @@ -73,8 +71,10 @@ impl<'a> BookOffers<'a> { }, taker_gets, taker_pays, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), limit, taker, } diff --git a/src/models/requests/deposit_authorize.rs b/src/models/requests/deposit_authorize.rs index 2c58e47..1c83842 100644 --- a/src/models/requests/deposit_authorize.rs +++ b/src/models/requests/deposit_authorize.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// The deposit_authorized command indicates whether one account /// is authorized to send payments directly to another. @@ -21,11 +21,9 @@ pub struct DepositAuthorized<'a> { pub destination_account: Cow<'a, str>, /// The sender of a possible payment. pub source_account: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, } impl<'a> Model for DepositAuthorized<'a> {} @@ -46,7 +44,7 @@ impl<'a> DepositAuthorized<'a> { destination_account: Cow<'a, str>, source_account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, ) -> Self { Self { common_fields: CommonFields { @@ -55,8 +53,10 @@ impl<'a> DepositAuthorized<'a> { }, source_account, destination_account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), } } } diff --git a/src/models/requests/gateway_balances.rs b/src/models/requests/gateway_balances.rs index e5f3838..cb91184 100644 --- a/src/models/requests/gateway_balances.rs +++ b/src/models/requests/gateway_balances.rs @@ -5,7 +5,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// This request calculates the total balances issued by a /// given account, optionally excluding amounts held by @@ -24,11 +24,9 @@ pub struct GatewayBalances<'a> { /// An operational address to exclude from the balances /// issued, or an array of such addresses. pub hotwallet: Option>>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger version to use, or a - /// shortcut string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// If true, only accept an address or public key for the /// account parameter. Defaults to false. pub strict: Option, @@ -52,7 +50,7 @@ impl<'a> GatewayBalances<'a> { account: Cow<'a, str>, hotwallet: Option>>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, strict: Option, ) -> Self { Self { @@ -62,8 +60,10 @@ impl<'a> GatewayBalances<'a> { }, account, strict, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), hotwallet, } } diff --git a/src/models/requests/ledger_data.rs b/src/models/requests/ledger_data.rs index c30bb75..6975eed 100644 --- a/src/models/requests/ledger_data.rs +++ b/src/models/requests/ledger_data.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request}; /// The ledger_data method retrieves contents of the specified /// ledger. You can iterate through several calls to retrieve @@ -21,17 +21,15 @@ pub struct LedgerData<'a> { /// If set to true, return ledger objects as hashed hex /// strings instead of JSON. pub binary: Option, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// Limit the number of ledger objects to retrieve. /// The server is not required to honor this value. pub limit: Option, /// Value from a previous paginated response. /// Resume retrieving data where that response left off. - pub marker: Option, + pub marker: Option>, } impl<'a> Model for LedgerData<'a> {} @@ -51,17 +49,19 @@ impl<'a> LedgerData<'a> { id: Option>, binary: Option, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, limit: Option, - marker: Option, + marker: Option>, ) -> Self { Self { common_fields: CommonFields { command: RequestMethod::LedgerData, id, }, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), binary, limit, marker, diff --git a/src/models/requests/ledger_entry.rs b/src/models/requests/ledger_entry.rs index a2a5ff3..14b6bc1 100644 --- a/src/models/requests/ledger_entry.rs +++ b/src/models/requests/ledger_entry.rs @@ -5,7 +5,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model, XRPLModelException, XRPLModelResult}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// Required fields for requesting a DepositPreauth if not /// querying by object ID. @@ -82,12 +82,9 @@ pub struct LedgerEntry<'a> { pub directory: Option>, pub escrow: Option>, pub index: Option>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut string - /// (e.g. "validated" or "closed" or "current") to choose a ledger - /// automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, pub offer: Option>, pub payment_channel: Option>, pub ripple_state: Option>, @@ -173,7 +170,7 @@ impl<'a> LedgerEntry<'a> { escrow: Option>, index: Option>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, offer: Option>, payment_channel: Option>, ripple_state: Option>, @@ -195,8 +192,10 @@ impl<'a> LedgerEntry<'a> { ripple_state, ticket, binary, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), } } } diff --git a/src/models/requests/mod.rs b/src/models/requests/mod.rs index 532d142..43c913e 100644 --- a/src/models/requests/mod.rs +++ b/src/models/requests/mod.rs @@ -20,7 +20,10 @@ pub mod ledger_data; pub mod ledger_entry; pub mod manifest; pub mod nft_buy_offers; +pub mod nft_history; +pub mod nft_info; pub mod nft_sell_offers; +pub mod nfts_by_issuer; pub mod no_ripple_check; pub mod path_find; pub mod ping; @@ -35,7 +38,7 @@ pub mod transaction_entry; pub mod tx; pub mod unsubscribe; -use alloc::borrow::Cow; +use alloc::{borrow::Cow, string::String}; use derive_new::new; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; @@ -76,8 +79,16 @@ pub enum RequestMethod { // Path methods BookOffers, DepositAuthorized, - NftBuyOffers, - NftSellOffers, + #[serde(rename = "nft_buy_offers")] + NFTBuyOffers, + #[serde(rename = "nft_history")] + NFTHistory, + #[serde(rename = "nft_info")] + NFTInfo, + #[serde(rename = "nft_sell_offers")] + NFTSellOffers, + #[serde(rename = "nfts_by_issuer")] + NFTsByIssuer, PathFind, RipplePathFind, @@ -125,8 +136,11 @@ pub enum XRPLRequest<'a> { ChannelVerify(channel_verify::ChannelVerify<'a>), BookOffers(book_offers::BookOffers<'a>), DepositAuthorized(deposit_authorize::DepositAuthorized<'a>), - NftBuyOffers(nft_buy_offers::NftBuyOffers<'a>), - NftSellOffers(nft_sell_offers::NftSellOffers<'a>), + NFTBuyOffers(nft_buy_offers::NftBuyOffers<'a>), + NFTHistory(nft_history::NFTHistory<'a>), + NFTInfo(nft_info::NFTInfo<'a>), + NFTSellOffers(nft_sell_offers::NftSellOffers<'a>), + NFTsByIssuer(nfts_by_issuer::NFTsByIssuer<'a>), PathFind(path_find::PathFind<'a>), RipplePathFind(ripple_path_find::RipplePathFind<'a>), Ledger(ledger::Ledger<'a>), @@ -260,13 +274,13 @@ impl<'a> From> for XRPLRequest<'a> { impl<'a> From> for XRPLRequest<'a> { fn from(request: nft_buy_offers::NftBuyOffers<'a>) -> Self { - XRPLRequest::NftBuyOffers(request) + XRPLRequest::NFTBuyOffers(request) } } impl<'a> From> for XRPLRequest<'a> { fn from(request: nft_sell_offers::NftSellOffers<'a>) -> Self { - XRPLRequest::NftSellOffers(request) + XRPLRequest::NFTSellOffers(request) } } @@ -382,8 +396,11 @@ impl<'a> Request<'a> for XRPLRequest<'a> { XRPLRequest::ChannelVerify(request) => request.get_common_fields(), XRPLRequest::BookOffers(request) => request.get_common_fields(), XRPLRequest::DepositAuthorized(request) => request.get_common_fields(), - XRPLRequest::NftBuyOffers(request) => request.get_common_fields(), - XRPLRequest::NftSellOffers(request) => request.get_common_fields(), + XRPLRequest::NFTBuyOffers(request) => request.get_common_fields(), + XRPLRequest::NFTHistory(request) => request.get_common_fields(), + XRPLRequest::NFTInfo(request) => request.get_common_fields(), + XRPLRequest::NFTSellOffers(request) => request.get_common_fields(), + XRPLRequest::NFTsByIssuer(request) => request.get_common_fields(), XRPLRequest::PathFind(request) => request.get_common_fields(), XRPLRequest::RipplePathFind(request) => request.get_common_fields(), XRPLRequest::Ledger(request) => request.get_common_fields(), @@ -423,8 +440,11 @@ impl<'a> Request<'a> for XRPLRequest<'a> { XRPLRequest::ChannelVerify(request) => request.get_common_fields_mut(), XRPLRequest::BookOffers(request) => request.get_common_fields_mut(), XRPLRequest::DepositAuthorized(request) => request.get_common_fields_mut(), - XRPLRequest::NftBuyOffers(request) => request.get_common_fields_mut(), - XRPLRequest::NftSellOffers(request) => request.get_common_fields_mut(), + XRPLRequest::NFTBuyOffers(request) => request.get_common_fields_mut(), + XRPLRequest::NFTHistory(request) => request.get_common_fields_mut(), + XRPLRequest::NFTInfo(request) => request.get_common_fields_mut(), + XRPLRequest::NFTSellOffers(request) => request.get_common_fields_mut(), + XRPLRequest::NFTsByIssuer(request) => request.get_common_fields_mut(), XRPLRequest::PathFind(request) => request.get_common_fields_mut(), XRPLRequest::RipplePathFind(request) => request.get_common_fields_mut(), XRPLRequest::Ledger(request) => request.get_common_fields_mut(), @@ -454,6 +474,78 @@ pub struct CommonFields<'a> { pub id: Option>, } +#[skip_serializing_none] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, new)] +pub struct LookupByLedgerRequest<'a> { + /// A 20-byte hex string for the ledger version to use. + pub ledger_hash: Option>, + /// The ledger index of the ledger to use, or a shortcut + /// string to choose a ledger automatically. + pub ledger_index: Option>, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] +#[serde(untagged)] +pub enum Marker<'a> { + Int(u32), + Str(Cow<'a, str>), +} + +impl From for Marker<'_> { + fn from(value: u32) -> Self { + Marker::Int(value) + } +} + +impl<'a> From<&'a str> for Marker<'a> { + fn from(value: &'a str) -> Self { + Marker::Str(Cow::Borrowed(value)) + } +} + +impl<'a> From> for Marker<'a> { + fn from(value: Cow<'a, str>) -> Self { + Marker::Str(value) + } +} + +impl From for Marker<'_> { + fn from(value: String) -> Self { + Marker::Str(Cow::Owned(value)) + } +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] +#[serde(untagged)] +pub enum LedgerIndex<'a> { + Int(u32), + Str(Cow<'a, str>), +} + +impl From for LedgerIndex<'_> { + fn from(value: u32) -> Self { + LedgerIndex::Int(value) + } +} + +impl<'a> From<&'a str> for LedgerIndex<'a> { + fn from(value: &'a str) -> Self { + LedgerIndex::Str(Cow::Borrowed(value)) + } +} + +impl<'a> From> for LedgerIndex<'a> { + fn from(value: Cow<'a, str>) -> Self { + LedgerIndex::Str(value) + } +} + +impl From for LedgerIndex<'_> { + fn from(value: String) -> Self { + LedgerIndex::Str(Cow::Owned(value)) + } +} + /// The base trait for all request models. /// Used to identify the model as a request. pub trait Request<'a> { diff --git a/src/models/requests/nft_buy_offers.rs b/src/models/requests/nft_buy_offers.rs index d8a4c4c..f932576 100644 --- a/src/models/requests/nft_buy_offers.rs +++ b/src/models/requests/nft_buy_offers.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request}; /// This method retrieves all of buy offers for the specified NFToken. #[skip_serializing_none] @@ -15,18 +15,16 @@ pub struct NftBuyOffers<'a> { pub common_fields: CommonFields<'a>, /// The unique identifier of a NFToken object. pub nft_id: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// Limit the number of NFT buy offers to retrieve. /// This value cannot be lower than 50 or more than 500. /// The default is 250. pub limit: Option, /// Value from a previous paginated response. /// Resume retrieving data where that response left off. - pub marker: Option, + pub marker: Option>, } impl<'a> Model for NftBuyOffers<'a> {} @@ -46,18 +44,20 @@ impl<'a> NftBuyOffers<'a> { id: Option>, nft_id: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, limit: Option, - marker: Option, + marker: Option>, ) -> Self { Self { common_fields: CommonFields { - command: RequestMethod::NftBuyOffers, + command: RequestMethod::NFTBuyOffers, id, }, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), nft_id, - ledger_hash, - ledger_index, limit, marker, } diff --git a/src/models/requests/nft_history.rs b/src/models/requests/nft_history.rs new file mode 100644 index 0000000..4d165b7 --- /dev/null +++ b/src/models/requests/nft_history.rs @@ -0,0 +1,74 @@ +use alloc::borrow::Cow; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::Model; + +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request, RequestMethod}; + +/// The `nft_history` method retreives a list of transactions that involved the +/// specified NFToken. +#[skip_serializing_none] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] +pub struct NFTHistory<'a> { + /// The common fields shared by all requests. + #[serde(flatten)] + pub common_fields: CommonFields<'a>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, + /// The unique identifier of an NFToken. + /// The request returns past transactions of this NFToken. + pub nft_id: Cow<'a, str>, + pub ledger_index_min: Option, + pub ledger_index_max: Option, + pub binary: Option, + pub forward: Option, + pub limit: Option, + pub marker: Option>, +} + +impl Model for NFTHistory<'_> {} + +impl<'a> Request<'a> for NFTHistory<'a> { + fn get_common_fields(&self) -> &CommonFields<'a> { + &self.common_fields + } + + fn get_common_fields_mut(&mut self) -> &mut CommonFields<'a> { + &mut self.common_fields + } +} + +impl<'a> NFTHistory<'a> { + pub fn new( + id: Option>, + nft_id: Cow<'a, str>, + ledger_hash: Option>, + ledger_index: Option>, + ledger_index_min: Option, + ledger_index_max: Option, + binary: Option, + forward: Option, + limit: Option, + marker: Option>, + ) -> Self { + Self { + common_fields: CommonFields { + command: RequestMethod::NFTHistory, + id, + }, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), + nft_id, + ledger_index_min, + ledger_index_max, + binary, + forward, + limit, + marker, + } + } +} diff --git a/src/models/requests/nft_info.rs b/src/models/requests/nft_info.rs new file mode 100644 index 0000000..4609657 --- /dev/null +++ b/src/models/requests/nft_info.rs @@ -0,0 +1,56 @@ +use alloc::borrow::Cow; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::Model; + +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request, RequestMethod}; + +/// The `nft_info` method retrieves all the information about the +/// NFToken +#[skip_serializing_none] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] +pub struct NFTInfo<'a> { + /// The common fields shared by all requests. + #[serde(flatten)] + pub common_fields: CommonFields<'a>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, + /// The unique identifier of an NFToken. + /// The request returns past transactions of this NFToken. + pub nft_id: Cow<'a, str>, +} + +impl Model for NFTInfo<'_> {} + +impl<'a> Request<'a> for NFTInfo<'a> { + fn get_common_fields(&self) -> &CommonFields<'a> { + &self.common_fields + } + + fn get_common_fields_mut(&mut self) -> &mut CommonFields<'a> { + &mut self.common_fields + } +} + +impl<'a> NFTInfo<'a> { + pub fn new( + id: Option>, + nft_id: Cow<'a, str>, + ledger_hash: Option>, + ledger_index: Option>, + ) -> Self { + Self { + common_fields: CommonFields { + command: RequestMethod::NFTInfo, + id, + }, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), + nft_id, + } + } +} diff --git a/src/models/requests/nft_sell_offers.rs b/src/models/requests/nft_sell_offers.rs index fa4dd6f..f8817a6 100644 --- a/src/models/requests/nft_sell_offers.rs +++ b/src/models/requests/nft_sell_offers.rs @@ -33,7 +33,7 @@ impl<'a> NftSellOffers<'a> { pub fn new(id: Option>, nft_id: Cow<'a, str>) -> Self { Self { common_fields: CommonFields { - command: RequestMethod::NftSellOffers, + command: RequestMethod::NFTSellOffers, id, }, nft_id, diff --git a/src/models/requests/nfts_by_issuer.rs b/src/models/requests/nfts_by_issuer.rs new file mode 100644 index 0000000..d7b20ed --- /dev/null +++ b/src/models/requests/nfts_by_issuer.rs @@ -0,0 +1,65 @@ +use alloc::borrow::Cow; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::Model; + +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Marker, Request, RequestMethod}; + +/// The `nfts_by_issuer` method retrieves all of the NFTokens +/// issued by an account +#[skip_serializing_none] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] +pub struct NFTsByIssuer<'a> { + /// The common fields shared by all requests. + #[serde(flatten)] + pub common_fields: CommonFields<'a>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, + /// The unique identifier for an account that issues NFTokens + /// The request returns NFTokens issued by this account. + pub issuer: Cow<'a, str>, + pub limit: Option, + pub marker: Option>, + pub nft_taxon: Option, +} + +impl Model for NFTsByIssuer<'_> {} + +impl<'a> Request<'a> for NFTsByIssuer<'a> { + fn get_common_fields(&self) -> &CommonFields<'a> { + &self.common_fields + } + + fn get_common_fields_mut(&mut self) -> &mut CommonFields<'a> { + &mut self.common_fields + } +} + +impl<'a> NFTsByIssuer<'a> { + pub fn new( + id: Option>, + issuer: Cow<'a, str>, + ledger_hash: Option>, + ledger_index: Option>, + limit: Option, + marker: Option>, + nft_taxon: Option, + ) -> Self { + Self { + common_fields: CommonFields { + command: RequestMethod::NFTsByIssuer, + id, + }, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), + issuer, + limit, + marker, + nft_taxon, + } + } +} diff --git a/src/models/requests/no_ripple_check.rs b/src/models/requests/no_ripple_check.rs index 21bffb7..854d89d 100644 --- a/src/models/requests/no_ripple_check.rs +++ b/src/models/requests/no_ripple_check.rs @@ -5,7 +5,7 @@ use strum_macros::Display; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// Enum representing the options for the address role in /// a NoRippleCheckRequest. @@ -42,11 +42,9 @@ pub struct NoRippleCheck<'a> { /// No Ripple on all trust lines. Users should have Default Ripple /// disabled, and should enable No Ripple on all trust lines. pub role: NoRippleCheckRole, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut string - /// to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// The maximum number of trust line problems to include in the /// results. Defaults to 300. pub limit: Option, @@ -74,7 +72,7 @@ impl<'a> NoRippleCheck<'a> { account: Cow<'a, str>, role: NoRippleCheckRole, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, limit: Option, transactions: Option, ) -> Self { @@ -85,8 +83,10 @@ impl<'a> NoRippleCheck<'a> { }, account, role, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), transactions, limit, } diff --git a/src/models/requests/ripple_path_find.rs b/src/models/requests/ripple_path_find.rs index 4f7f5cf..1ac23f7 100644 --- a/src/models/requests/ripple_path_find.rs +++ b/src/models/requests/ripple_path_find.rs @@ -5,7 +5,7 @@ use serde_with::skip_serializing_none; use crate::models::{currency::Currency, requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// The ripple_path_find method is a simpl<'a>ified version of /// the path_find method that provides a single response with @@ -42,11 +42,9 @@ pub struct RipplePathFind<'a> { /// Unique address of the account that would send funds /// in a transaction. pub source_account: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, /// Currency Amount that would be spent in the transaction. /// Cannot be used with source_currencies. pub send_max: Option>, @@ -79,7 +77,7 @@ impl<'a> RipplePathFind<'a> { destination_amount: Currency<'a>, source_account: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, send_max: Option>, source_currencies: Option>>, ) -> Self { @@ -91,8 +89,10 @@ impl<'a> RipplePathFind<'a> { destination_account, destination_amount, source_account, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), send_max, source_currencies, } diff --git a/src/models/requests/transaction_entry.rs b/src/models/requests/transaction_entry.rs index 8f3c988..6d466d8 100644 --- a/src/models/requests/transaction_entry.rs +++ b/src/models/requests/transaction_entry.rs @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none; use crate::models::{requests::RequestMethod, Model}; -use super::{CommonFields, Request}; +use super::{CommonFields, LedgerIndex, LookupByLedgerRequest, Request}; /// The transaction_entry method retrieves information on a /// single transaction from a specific ledger version. @@ -22,11 +22,9 @@ pub struct TransactionEntry<'a> { pub common_fields: CommonFields<'a>, /// Unique hash of the transaction you are looking up. pub tx_hash: Cow<'a, str>, - /// A 20-byte hex string for the ledger version to use. - pub ledger_hash: Option>, - /// The ledger index of the ledger to use, or a shortcut - /// string to choose a ledger automatically. - pub ledger_index: Option>, + /// The unique identifier of a ledger. + #[serde(flatten)] + pub ledger_lookup: Option>, } impl<'a> Model for TransactionEntry<'a> {} @@ -46,7 +44,7 @@ impl<'a> TransactionEntry<'a> { id: Option>, tx_hash: Cow<'a, str>, ledger_hash: Option>, - ledger_index: Option>, + ledger_index: Option>, ) -> Self { Self { common_fields: CommonFields { @@ -54,8 +52,10 @@ impl<'a> TransactionEntry<'a> { id, }, tx_hash, - ledger_hash, - ledger_index, + ledger_lookup: Some(LookupByLedgerRequest { + ledger_hash, + ledger_index, + }), } } } diff --git a/src/models/transactions/metadata.rs b/src/models/transactions/metadata.rs new file mode 100644 index 0000000..16d322f --- /dev/null +++ b/src/models/transactions/metadata.rs @@ -0,0 +1,169 @@ +use alloc::collections::BTreeMap; +use alloc::{borrow::Cow, vec::Vec}; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::ledger::objects::LedgerEntryType; +use crate::models::requests::LedgerIndex; +use crate::models::Amount; + +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct NFTokenMetadata<'a> { + #[serde(rename = "NFToken")] + pub nftoken: NFTokenMetadataFields<'a>, +} + +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct NFTokenMetadataFields<'a> { + #[serde(rename = "NFTokenID")] + pub nftoken_id: Cow<'a, str>, + #[serde(rename = "URI")] + pub uri: Cow<'a, str>, +} +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Fields<'a> { + pub account: Option>, + pub balance: Option>, + pub book_directory: Option>, + pub expiration: Option, + pub flags: Option, + pub low_limit: Option, Cow<'a, str>>>, + pub high_limit: Option, Cow<'a, str>>>, + pub next_page_min: Option>, + #[serde(rename = "NFTokens")] + pub nftokens: Option>>, + pub previous_page_min: Option>, + pub sequence: Option, + pub taker_gets: Option>, + pub taker_pays: Option>, + pub xchain_claim_id: Option>, +} + +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub enum AffectedNode<'a> { + #[serde(rename_all = "PascalCase")] + CreatedNode { + ledger_entry_type: LedgerEntryType, + ledger_index: LedgerIndex<'a>, + new_fields: Fields<'a>, + }, + #[serde(rename_all = "PascalCase")] + ModifiedNode { + ledger_entry_type: LedgerEntryType, + ledger_index: LedgerIndex<'a>, + final_fields: Option>, + previous_fields: Option>, + previous_txn_id: Option>, + previous_txn_lgr_seq: Option, + }, + #[serde(rename_all = "PascalCase")] + DeletedNode { + ledger_entry_type: LedgerEntryType, + ledger_index: LedgerIndex<'a>, + final_fields: Fields<'a>, + previous_fields: Option>, + }, +} + +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct TransactionMetadata<'a> { + pub affected_nodes: Vec>, + pub transaction_index: i32, + pub transaction_result: Amount<'a>, + #[serde(rename = "delivered_amount")] + pub delivered_amount: Option>, +} + +#[cfg(test)] +mod test_serde { + #[test] + fn test_deserialize_deleted_node() { + let json = r#" + { + "DeletedNode": { + "FinalFields": { + "Account": "rHzKtpcB1KC1YuU4PBhk9m2abqrf2kZsfV", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799474F20E441AE211B08", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "3C5524789C20AE661CF4985EF694F11128FE267D084CB5E77DBB5FFD78E31E1C", + "PreviousTxnLgrSeq": 92173580, + "Sequence": 29337056, + "TakerGets": "17250658754", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "159709.5313591656" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "D11F69DE8A8CACB130F2E2B9893E5C97B9EE4136759C66C1F3497C8575FF5ED0" + } + } + "#; + let deleted_node = serde_json::from_str::(json); + + assert!(deleted_node.is_ok()); + } + + #[test] + fn test_deserialize_modified_node() { + let json = r#" + { + "ModifiedNode": { + "FinalFields": { + "Account": "rHzKtpcB1KC1YuU4PBhk9m2abqrf2kZsfV", + "Balance": "5000542889", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 29337064 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "991ED60C316200D33B2EA3E56E505433394DBA7FF5E7ADE8C8850D02BEF1F53A", + "PreviousFields": { + "Balance": "5000542904", + "Sequence": 29337063 + }, + "PreviousTxnID": "960FAFAF9CA0465B7475F888946F0D58F9CF49B18F3991D826B03A5025368DDE", + "PreviousTxnLgrSeq": 92173588 + } + } + "#; + let modified_node = serde_json::from_str::(json); + + assert!(modified_node.is_ok()); + } + + #[test] + fn test_deserialize_created_node() { + let json = r#" + { + "CreatedNode": { + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "991ED60C316200D33B2EA3E56E505433394DBA7FF5E7ADE8C8850D02BEF1F53A", + "NewFields": { + "Account": "rHzKtpcB1KC1YuU4PBhk9m2abqrf2kZsfV", + "Balance": "5000542889", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 29337064 + } + } + } + "#; + let created_node = serde_json::from_str::(json); + + assert!(created_node.is_ok()); + } +} diff --git a/src/models/transactions/mod.rs b/src/models/transactions/mod.rs index 84eefcf..b8c8cf4 100644 --- a/src/models/transactions/mod.rs +++ b/src/models/transactions/mod.rs @@ -14,6 +14,7 @@ pub mod escrow_cancel; pub mod escrow_create; pub mod escrow_finish; pub mod exceptions; +pub mod metadata; pub mod nftoken_accept_offer; pub mod nftoken_burn; pub mod nftoken_cancel_offer; diff --git a/src/utils/exceptions.rs b/src/utils/exceptions.rs index ae3230f..776265e 100644 --- a/src/utils/exceptions.rs +++ b/src/utils/exceptions.rs @@ -3,7 +3,9 @@ use alloc::string::String; use thiserror_no_std::Error; -use crate::XRPLSerdeJsonError; +#[cfg(feature = "models")] +use crate::models::XRPLModelException; +use crate::{core::exceptions::XRPLCoreException, XRPLSerdeJsonError}; pub type XRPLUtilsResult = core::result::Result; @@ -14,6 +16,13 @@ pub enum XRPLUtilsException { XRPLTimeRangeError(#[from] XRPLTimeRangeException), #[error("XRP Range error: {0}")] XRPRangeError(#[from] XRPRangeException), + #[error("XRPL NFT ID error: {0}")] + XRPLNFTIdError(#[from] XRPLNFTIdException), + #[error("XRPL Core error: {0}")] + XRPLCoreError(#[from] XRPLCoreException), + #[cfg(feature = "models")] + #[error("XRPL Model error: {0}")] + XRPLModelError(#[from] XRPLModelException), #[error("ISO Code error: {0}")] ISOCodeError(#[from] ISOCodeException), #[error("Decimal error: {0}")] @@ -22,8 +31,10 @@ pub enum XRPLUtilsException { BigDecimalError(#[from] bigdecimal::ParseBigDecimalError), #[error("serde_json error: {0}")] SerdeJsonError(#[from] XRPLSerdeJsonError), - #[error("Invalid Hex error: {0}")] + #[error("From Hex error: {0}")] FromHexError(#[from] hex::FromHexError), + #[error("ParseInt error: {0}")] + ParseIntError(#[from] core::num::ParseIntError), } #[derive(Debug, Clone, PartialEq, Error)] @@ -62,6 +73,13 @@ pub enum XRPRangeException { UnexpectedICAmountOverflow { max: usize, found: usize }, } +#[derive(Debug, Clone, PartialEq, Error)] +#[non_exhaustive] +pub enum XRPLNFTIdException { + #[error("Invalid NFT ID length (expected: {expected} found: {found})")] + InvalidNFTIdLength { expected: usize, found: usize }, +} + #[derive(Debug, Clone, PartialEq, Error)] #[non_exhaustive] pub enum ISOCodeException { diff --git a/src/utils/get_nftoken_id.rs b/src/utils/get_nftoken_id.rs new file mode 100644 index 0000000..314bc54 --- /dev/null +++ b/src/utils/get_nftoken_id.rs @@ -0,0 +1,149 @@ +use alloc::{borrow::Cow, vec::Vec}; + +use crate::models::ledger::objects::LedgerEntryType; +use crate::models::transactions::metadata::TransactionMetadata; +use crate::models::transactions::metadata::{AffectedNode, NFTokenMetadata}; + +/// Flattens objects into a single list, and applies func to every object in objects. +fn flatmap(func: impl Fn(T) -> Vec, list_of_items: Vec) -> Vec { + let mut modified_items: Vec = Vec::new(); + for item in list_of_items { + modified_items.extend(func(item)); + } + modified_items +} + +pub fn get_nftoken_ids_from_nftokens(nftokens: Vec>) -> Vec> { + nftokens + .into_iter() + .map(|token| token.nftoken.nftoken_id) + .collect() +} + +fn has_nftoken_page(node: &AffectedNode) -> bool { + match node { + AffectedNode::CreatedNode { + ledger_entry_type, .. + } => ledger_entry_type == &LedgerEntryType::NFTokenPage, + AffectedNode::ModifiedNode { + ledger_entry_type, + previous_fields, + .. + } => { + ledger_entry_type == &LedgerEntryType::NFTokenPage + && previous_fields.is_some() + && previous_fields.as_ref().unwrap().nftokens.is_some() + } + _ => false, + } +} + +fn get_previous_nftokens<'a>(node: &'a AffectedNode) -> Vec> { + match node { + AffectedNode::ModifiedNode { + previous_fields, .. + } => { + if let Some(previous_fields) = previous_fields { + if let Some(new_nftokens) = &previous_fields.nftokens { + new_nftokens.clone() + } else { + Vec::new() + } + } else { + Vec::new() + } + } + _ => Vec::new(), + } +} + +fn get_new_nftokens<'a>(node: &'a AffectedNode) -> Vec> { + match node { + AffectedNode::ModifiedNode { final_fields, .. } => { + if let Some(final_fields) = final_fields { + if let Some(new_nftokens) = &final_fields.nftokens { + new_nftokens.clone() + } else { + Vec::new() + } + } else { + Vec::new() + } + } + AffectedNode::CreatedNode { new_fields, .. } => { + if let Some(new_nftokens) = &new_fields.nftokens { + new_nftokens.clone() + } else { + Vec::new() + } + } + _ => Vec::new(), + } +} + +pub fn get_nftoken_id<'a: 'b, 'b>(meta: &'a TransactionMetadata<'a>) -> Option> { + let affected_nodes: Vec<&AffectedNode> = meta + .affected_nodes + .iter() + .filter(|node| has_nftoken_page(node)) + .collect(); + + if affected_nodes.is_empty() { + return None; + } + + let previous_token_ids: Vec> = + get_nftoken_ids_from_nftokens(flatmap(get_previous_nftokens, affected_nodes.clone())); + + let final_token_ids: Vec> = + get_nftoken_ids_from_nftokens(flatmap(get_new_nftokens, affected_nodes)); + + final_token_ids + .into_iter() + .find(|id| !previous_token_ids.contains(id)) +} + +#[cfg(test)] +mod test { + use lazy_static::lazy_static; + use serde::{Deserialize, Serialize}; + + use crate::models::transactions::metadata::TransactionMetadata; + + #[derive(Debug, Clone, Serialize, Deserialize)] + struct Txn { + pub meta: TransactionMetadata<'static>, + } + + fn load_tests() -> &'static Option<(Txn, Txn)> { + pub const NFTOKEN_MINT_RESPONSE_1: &str = + include_str!("./test_data/transaction_jsons/nftokenmint_response1.json"); + pub const NFTOKEN_MINT_RESPONSE_2: &str = + include_str!("./test_data/transaction_jsons/nftokenmint_response2.json"); + + lazy_static! { + static ref TEST_CASES: Option<(Txn, Txn,)> = Some(( + serde_json::from_str(NFTOKEN_MINT_RESPONSE_1).expect("load_tests_1"), + serde_json::from_str(NFTOKEN_MINT_RESPONSE_2).expect("load_tests_2"), + )); + } + + &TEST_CASES + } + + #[test] + fn test_nftoken_id() { + let (txn1, txn2) = load_tests() + .as_ref() + .expect("test_decoding_a_valid_nftoken_id"); + let nftoken_id1 = super::get_nftoken_id(&txn1.meta); + let nftoken_id2 = super::get_nftoken_id(&txn2.meta); + let expected_nftoken_id1 = + Some("00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5F8AA66A00000228".into()); + let expected_nftoken_id2 = + Some("0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA766254000003EE".into()); + + assert_eq!(nftoken_id1, expected_nftoken_id1); + assert_eq!(nftoken_id2, expected_nftoken_id2); + } +} diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 2b87a8d..a63283e 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -1,6 +1,10 @@ //! Convenience utilities for the XRP Ledger pub mod exceptions; +#[cfg(feature = "models")] +pub mod get_nftoken_id; +#[cfg(feature = "models")] +pub mod parse_nftoken_id; pub mod time_conversion; #[cfg(feature = "models")] pub(crate) mod transactions; diff --git a/src/utils/parse_nftoken_id.rs b/src/utils/parse_nftoken_id.rs new file mode 100644 index 0000000..f07150f --- /dev/null +++ b/src/utils/parse_nftoken_id.rs @@ -0,0 +1,96 @@ +use alloc::borrow::Cow; + +use crate::{ + core::addresscodec::encode_classic_address, + models::{transactions::nftoken_mint::NFTokenMintFlag, FlagCollection}, + utils::exceptions::XRPLNFTIdException, +}; + +use super::exceptions::XRPLUtilsResult; + +pub struct NFTokenId<'a> { + pub nftoken_id: Cow<'a, str>, + pub flags: FlagCollection, + pub transfer_fee: u32, + pub issuer: Cow<'a, str>, + pub taxon: u64, + pub sequence: u32, +} + +/// Unscrambles or rescrambles a taxon in an NFTokenID. +/// +/// An issuer may issue several NFTs with the same taxon; to ensure that NFTs +/// are spread across multiple pages we lightly mix the taxon up by using the +/// sequence (which is not under the issuer's direct control) as the seed for +/// a simple linear congruential generator. +/// +/// From the Hull-Dobell theorem we know that f(x)=(m*x+c) mod n will yield a +/// permutation of [0, n) when n is a power of 2 if m is congruent to 1 mod 4 +/// and c is odd. By doing a bitwise XOR with this permutation we can +/// scramble/unscramble the taxon. +/// +/// The XLS-20d proposal fixes m = 384160001 and c = 2459. +/// We then take the modulus of 2^32 which is 4294967296. +pub fn unscramble_taxon(taxon: u64, token_seq: u64) -> u64 { + return (taxon ^ (384160001 * token_seq + 2459)) % 4294967296; +} + +/// Parse an NFTokenID into the information it is encoding. +/// +/// Example decoding: +/// +/// 000B 0539 C35B55AA096BA6D87A6E6C965A6534150DC56E5E 12C5D09E 0000000C +/// +--- +--- +--------------------------------------- +------- +------- +/// | | | | | +/// | | | | `---> Sequence: 12 +/// | | | | +/// | | | `---> Scrambled Taxon: 314,953,886 +/// | | | Unscrambled Taxon: 1337 +/// | | | +/// | | `---> Issuer: rJoxBSzpXhPtAuqFmqxQtGKjA13jUJWthE +/// | | +/// | `---> TransferFee: 1337.0 bps or 13.37% +/// | +/// `---> Flags: 11 -> lsfBurnable, lsfOnlyXRP and lsfTransferable +pub fn parse_nftoken_id(nft_id: Cow) -> XRPLUtilsResult> { + const EXPECTED_LEN: usize = 64; + + if nft_id.len() != EXPECTED_LEN { + return Err(XRPLNFTIdException::InvalidNFTIdLength { + expected: EXPECTED_LEN, + found: nft_id.len(), + } + .into()); + } + let scrambled_taxon = u64::from_str_radix(&nft_id[48..56], 16)?; + let sequence = u32::from_str_radix(&nft_id[56..64], 16)?; + let flags = u32::from_str_radix(&nft_id[0..4], 16)?; + let transfer_fee = u32::from_str_radix(&nft_id[4..8], 16)?; + let issuer_bytes = hex::decode(&nft_id[8..48])?; + let issuer = encode_classic_address(issuer_bytes.as_ref())?; + + Ok(NFTokenId { + nftoken_id: nft_id, + flags: flags.try_into()?, + transfer_fee, + issuer: issuer.into(), + taxon: unscramble_taxon(scrambled_taxon, sequence as u64), + sequence, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_nftoken_id() { + let nft_id = "000B0539C35B55AA096BA6D87A6E6C965A6534150DC56E5E12C5D09E0000000C"; + let nftoken_id = parse_nftoken_id(Cow::Borrowed(nft_id)).unwrap(); + assert_eq!(nftoken_id.flags.len(), 3); + assert_eq!(nftoken_id.transfer_fee, 1337); + assert_eq!(nftoken_id.issuer, "rJoxBSzpXhPtAuqFmqxQtGKjA13jUJWthE"); + assert_eq!(nftoken_id.taxon, 1337); + assert_eq!(nftoken_id.sequence, 12); + } +} diff --git a/src/utils/test_data/transaction_jsons/XChainCreateClaimID.json b/src/utils/test_data/transaction_jsons/XChainCreateClaimID.json new file mode 100644 index 0000000..533f146 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/XChainCreateClaimID.json @@ -0,0 +1,118 @@ +{ + "tx": { + "Account": "rLVUz66tawieqTPAHuTyFTN6pLbHcXiTzd", + "Fee": "20", + "Flags": 2147483648, + "NetworkID": 2552, + "OtherChainSource": "rL5Zd9m5XEoGPddMwYY5H5C8ARcR47b6oM", + "Sequence": 1007784, + "SignatureReward": "100", + "SigningPubKey": "039E925058C740A5B73E49300FC205D058520DE37F2C63C4EE3A0D1B50C4E44080", + "TransactionType": "XChainCreateClaimID", + "TxnSignature": "304402201C6F95B9997FB63DCD9854664707C58C46AA3207612FE32366B77DA084786CAF02205752C58821D7FAFAE26F77DC10AC0AFDDCBCCF4FCBED90E6B8C4523A0EB3E008", + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + } + }, + "date": 1695324353000 + }, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Flags": 0, + "MinAccountCreateAmount": "10000000", + "OwnerNode": "0", + "SignatureReward": "100", + "XChainAccountClaimCount": "e3", + "XChainAccountCreateCount": "0", + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + } + }, + "XChainClaimID": "b0" + }, + "LedgerEntryType": "Bridge", + "LedgerIndex": "114C0DC89656D1B0FB1F4A3426034C3FCE75BCE65D9574B5D96ABC2B24D6C8F1", + "PreviousFields": { + "XChainClaimID": "af" + }, + "PreviousTxnID": "3F6F3BBE584115D1A575AB24BA32B47184F2323B65DE5C8C8EE144A55115E0B9", + "PreviousTxnLgrSeq": 1027822 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rLVUz66tawieqTPAHuTyFTN6pLbHcXiTzd", + "RootIndex": "6C1EA1A93D590E831CCC0EE2CBE26C146A3A6FD36F5854DC5E5AB5CE78FAE49C" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "6C1EA1A93D590E831CCC0EE2CBE26C146A3A6FD36F5854DC5E5AB5CE78FAE49C" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "XChainOwnedClaimID", + "LedgerIndex": "A00BD77AE864509D796B39041AD48E9DEFEC9AF20E5C09CEF2F5DA41D6CFEB1E", + "NewFields": { + "Account": "rLVUz66tawieqTPAHuTyFTN6pLbHcXiTzd", + "OtherChainSource": "rL5Zd9m5XEoGPddMwYY5H5C8ARcR47b6oM", + "SignatureReward": "100", + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + } + }, + "XChainClaimID": "b0" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLVUz66tawieqTPAHuTyFTN6pLbHcXiTzd", + "Balance": "39999940", + "Flags": 0, + "OwnerCount": 3, + "Sequence": 1007785 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "FD919D0BAA90C759DA4C7130AEEF6AE7FA2AF074F5E867D40BCBE1ECD8D8D0EA", + "PreviousFields": { + "Balance": "39999960", + "OwnerCount": 2, + "Sequence": 1007784 + }, + "PreviousTxnID": "3F6F3BBE584115D1A575AB24BA32B47184F2323B65DE5C8C8EE144A55115E0B9", + "PreviousTxnLgrSeq": 1027822 + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "hash": "998E76B9840DA5A6009592A2674D0166A9C4862193193AA46EA6B77A64781FB4", + "ledger_index": 1027837, + "date": 1695324353000 + } diff --git a/src/utils/test_data/transaction_jsons/XChainCreateClaimID2.json b/src/utils/test_data/transaction_jsons/XChainCreateClaimID2.json new file mode 100644 index 0000000..b69cacf --- /dev/null +++ b/src/utils/test_data/transaction_jsons/XChainCreateClaimID2.json @@ -0,0 +1,118 @@ +{ + "tx": { + "Account": "rwmUSzi5Xp31AjMTEdbvxgWqLETcVNU6Fv", + "Fee": "12", + "Flags": 0, + "LastLedgerSequence": 1027798, + "NetworkID": 2552, + "OtherChainSource": "rBXdfZ7NVpdjRfYajPMpviGgq7HLDeuBdR", + "Sequence": 1027778, + "SignatureReward": "100", + "SigningPubKey": "EDDDD69DF802B8DB82D644EF92E2C1F06AC128A275CDFF86F013180D104ED39D3B", + "TransactionType": "XChainCreateClaimID", + "TxnSignature": "67BE63527EC8A0C872F23E2C4EB97C1F3E7D3FED6D10C8310B9235D3891B6B9343768A080E258F6C3687BFC4B7C5FD429ABB33654C99DE46471FD6F2A7035303", + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + } + }, + "date": 1695324182000 + }, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Flags": 0, + "MinAccountCreateAmount": "10000000", + "OwnerNode": "0", + "SignatureReward": "100", + "XChainAccountClaimCount": "e2", + "XChainAccountCreateCount": "0", + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + } + }, + "XChainClaimID": "ac" + }, + "LedgerEntryType": "Bridge", + "LedgerIndex": "114C0DC89656D1B0FB1F4A3426034C3FCE75BCE65D9574B5D96ABC2B24D6C8F1", + "PreviousFields": { + "XChainClaimID": "ab" + }, + "PreviousTxnID": "80C33D1FB349D698CFDB1A85E8368557C5B7219B74DFCB2B05E0B10E2667F902", + "PreviousTxnLgrSeq": 1027779 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rwmUSzi5Xp31AjMTEdbvxgWqLETcVNU6Fv", + "Balance": "19999988", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 1027779 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "33442CE111B258424548888D8999F6D064A0866B1300C44AB72E1C5A09765D9D", + "PreviousFields": { + "Balance": "20000000", + "OwnerCount": 0, + "Sequence": 1027778 + }, + "PreviousTxnID": "7C9ACA230488547B4F39EBCE332447FB90AE59B64C1B03BBF474B509B43739EC", + "PreviousTxnLgrSeq": 1027778 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "439684B06C22596B5B86D2F50903B6AA6F68BD07BED636FC6325704B09DE5D61", + "NewFields": { + "Owner": "rwmUSzi5Xp31AjMTEdbvxgWqLETcVNU6Fv", + "RootIndex": "439684B06C22596B5B86D2F50903B6AA6F68BD07BED636FC6325704B09DE5D61" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "XChainOwnedClaimID", + "LedgerIndex": "8097863E1200B0174006541763AA8F604782DA10C1BD37190D753C699D69C678", + "NewFields": { + "Account": "rwmUSzi5Xp31AjMTEdbvxgWqLETcVNU6Fv", + "OtherChainSource": "rBXdfZ7NVpdjRfYajPMpviGgq7HLDeuBdR", + "SignatureReward": "100", + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + } + }, + "XChainClaimID": "ac" + } + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "hash": "A42C4E7F5BAF8A9BEB56853114EE686D554F15F400B8DA885A344B13C32D07BC", + "ledger_index": 1027780, + "date": 1695324182000 +} diff --git a/src/utils/test_data/transaction_jsons/nftokenmint_response1.json b/src/utils/test_data/transaction_jsons/nftokenmint_response1.json new file mode 100644 index 0000000..9baf354 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/nftokenmint_response1.json @@ -0,0 +1,480 @@ +{ + "tx": { + "Account": "rXMART8usFd5kABXCayoP6ZfB35b4v43t", + "Fee": "12", + "Flags": 8, + "Issuer": "rMhoejpvS8mWfiffy4Zj8H2KbVs1oZCVsP", + "LastLedgerSequence": 77781480, + "Memos": [ + { + "Memo": { + "MemoData": "68747470733A2F2F786D6172742E6172742F766965772D6E66742F38646261376436386533383665363865653636393030373461633965653438323A31363735373034353330383336", + "MemoType": "784D6172742D4E46542D6D696E74" + } + } + ], + "NFTokenTaxon": 5545, + "Sequence": 72168792, + "SigningPubKey": "ED8BB649713ED492AE35B4B5CA745CCA55ADF8EF4CEDB2CC8BA4E28557E993AD2F", + "TransactionType": "NFTokenMint", + "TransferFee": 5000, + "TxnSignature": "8E4B05FE811BA0DCFE9B4E54B0550D2B934336C09449C2FC14E8F6CFE20069115D18C5930E744220E84C06C145F93F5C291C4CC96D19425C941E2603652B8C02", + "URI": "697066733A2F2F626166796265696161736F7073366D6D783772616732743464687833616B3374747432683462647274657279786C373662366C78646E6A7962336D2F6D657461646174612E6A736F6E", + "date": 1676330052000, + "warnings": [ + { + "id": 1004, + "message": "This is a reporting server. The default behavior of a reporting server is to only return validated data. If you are looking for not yet validated data, include \"ledger_index : current\" in your request, which will cause this server to forward the request to a p2p node. If the forward is successful the response will include \"forwarded\" : \"true\"" + } + ] + }, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "NFTokens": [ + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1AD9556900000225", + "URI": "697066733A2F2F62616679626569626732726B6B6768616B6B727433696D61656F6D6D65377164747169687A756F713272327875637872776478676565356A7272652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1EF9501C0000021A", + "URI": "697066733A2F2F62616679626569626A74736F7270637879366465797A666B3233676D6863786E67356C7536746277786E786269627667776575357172356B7A34752F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1FFCAED5000000E1", + "URI": "697066733A2F2F6261667962656962736432653571337674686375777034746868336F6B633673746F676C696D6873746C70347663336564333632796375346978342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB21D71D900000009E", + "URI": "697066733A2F2F6261667962656964736B686B746C646233686F6F637A786A7577766932377835696C637677776278696C33366371366736746362667478653573612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB22ADCA8600000194", + "URI": "697066733A2F2F6261667962656964786336343471776B35626172357036756561376C747A786F3737786B647665616666633435337A66777565646737336B7966752F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB24F382CE000001CC", + "URI": "697066733A2F2F62616679626569626A363563346E77737A3773756C773364756D6E776B6F616D6E786770716270656E726D6567356F76657067763233356C687A342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB25F7188700000093", + "URI": "697066733A2F2F626166796265696371767069796C6271616D6371336C636175727A706A696465367468346233376C68346A7766786C65646C63686533756F6179342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB28A8254800000146", + "URI": "697066733A2F2F626166796265696571627072637873686370647865677268686B6C786570666535376970696E6571687137656C706F68326B356E32753571706C792F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB2F794C20000001EE", + "URI": "697066733A2F2F626166796265696832656D6A7A616A687337747A6B616C68646B756D363737357678326F76616C33726F6D696368336A3434326A6F3468366166342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB31BF046800000226", + "URI": "697066733A2F2F6261667962656965696E7A787774776B7672666E646E626A7061636D61776E6C7A7564616A726473616777703474676B6F643363756477697337692F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB38BCCC930000009F", + "URI": "697066733A2F2F62616679626569636E6678796D66676D70346A6E7365716678617A7633326E65796D697333357769637333336333616B616D72707773323233716D2F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3B6DE94400000152", + "URI": "697066733A2F2F626166796265696435726C676577667762736676683368346C7434756B763267766A7634656B61736778327A766A6D67377166773775737A7576342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3BD97DC1000001CD", + "URI": "697066733A2F2F62616679626569656A6B677A706C6766616775737564646174326A3335657163756A3762337376356D6C3568613569786676327535747A337170652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F2283CE000000CC", + "URI": "697066733A2F2F62616679626569667670746C366B69666C746E3661766F6179663473347A3364796466796B6A666466646A626A76746575696A706B626A336733752F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F8E144B00000147", + "URI": "697066733A2F2F62616679626569636675336272636F6C6962767171727736703464617772636A6B75737877637436366C6F736C797576636D766C66766D643478692F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB41D3AFB30000017F", + "URI": "697066733A2F2F6261667962656967796166656E357877766F346973706E777A3275376E696664687477366C686A376A6E37333334643732366A36656178367377342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB45F3AAA600000174", + "URI": "697066733A2F2F626166796265696774766B3336696F766C68777562326F6B6934747069726670647070337437747171777A6F36746D33706575373478636C3474712F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB465F3F23000001EF", + "URI": "697066733A2F2F62616679626569646B37796D37736775747A7A766E70736669796B6A7379733565646568637936707370756C74337137646B696F7A737A376271652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB47CE1E6500000131", + "URI": "697066733A2F2F6261667962656968627A683362786C76716578327163747665616B71656271357066366468637569773779796D6C696E6A346F74327636736937612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB48A4F76B00000227", + "URI": "697066733A2F2F626166796265696179766F6C686F3462777A736D6A69363633337174696975776B71753664726272746877667277626236346B62776174346E76342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB49A84D20000000EE", + "URI": "697066733A2F2F62616679626569633269337535366163646A6764643573733434753674743767656B35796A6D637933766E71676F3265633734686D6D6D676D74612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4B82B0EF000000AB", + "URI": "697066733A2F2F626166796265696462756637356D67616A6F63336969363465667675786D64356F7236746C3236356E7865623675616A34656232356F35657066652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4DC848D7000000E3", + "URI": "697066733A2F2F626166796265696169746C677662756774636B37786C6C6934717378683434663467687A6171376B6F6662666135657A6D796A336C7461766877612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5079949800000196", + "URI": "697066733A2F2F62616679626569666F616B736468666A63716575783676766577377078326E34786F6773656E7133377A6176656233696973666E6D64347A6666342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5253D84700000153", + "URI": "697066733A2F2F62616679626569633735366A6F6263786961346776643477717634696E6E766F6C6C75767068676171666161656168353676626C713471343434792F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB52BF2CC0000001CE", + "URI": "697066733A2F2F626166796265696268626E6F356664353272717663656A6769656C336B6E796C77727A366A747233767A77336B75656F363674697033716B36356D2F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB542E0F0200000110", + "URI": "697066733A2F2F62616679626569666F73776A6B33666775726F6F6F767864326E7372336B676164706768633732366A683672776579776432656E736E74686777792F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5499938F0000018B", + "URI": "697066733A2F2F6261667962656961663473797979367A6C6E76716F3664646A326779727A786C6F7779636F6C74746A6777676F33637270373333336E7A676767652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5C6E313C000000FA", + "URI": "697066733A2F2F626166796265696669793734673662767575646A6E757A6661676F6368656E6C6936666E3633616C6C6C717562617A756C7362736F636C636B66342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5D44EE22000001F0", + "URI": "697066733A2F2F62616679626569636171686F6D7A6F36677334656761376D68647A6D6E6F67657274687337776C78777677746B33696B64646E6D7A647273637A6D2F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5F8AA66A00000228", + "URI": "697066733A2F2F626166796265696161736F7073366D6D783772616732743464687833616B3374747432683462647274657279786C373662366C78646E6A7962336D2F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB61651529000001E5", + "URI": "697066733A2F2F62616679626569637432737174363732766563677232367862776E797A373365657565777A37616D32736869767578376E756232367837326D62342F6D657461646174612E6A736F6E" + } + } + ], + "NextPageMin": "05BDF50FBDEF54276A1C889252E71B4347C3A0BDE73120BB868538B400000182", + "PreviousPageMin": "05BDF50FBDEF54276A1C889252E71B4347C3A0BDE73120BB175153BE0000007C" + }, + "LedgerEntryType": "NFTokenPage", + "LedgerIndex": "05BDF50FBDEF54276A1C889252E71B4347C3A0BDE73120BB626863EE000000AC", + "PreviousFields": { + "NFTokens": [ + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1AD9556900000225", + "URI": "697066733A2F2F62616679626569626732726B6B6768616B6B727433696D61656F6D6D65377164747169687A756F713272327875637872776478676565356A7272652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1EF9501C0000021A", + "URI": "697066733A2F2F62616679626569626A74736F7270637879366465797A666B3233676D6863786E67356C7536746277786E786269627667776575357172356B7A34752F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1FFCAED5000000E1", + "URI": "697066733A2F2F6261667962656962736432653571337674686375777034746868336F6B633673746F676C696D6873746C70347663336564333632796375346978342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB21D71D900000009E", + "URI": "697066733A2F2F6261667962656964736B686B746C646233686F6F637A786A7577766932377835696C637677776278696C33366371366736746362667478653573612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB22ADCA8600000194", + "URI": "697066733A2F2F6261667962656964786336343471776B35626172357036756561376C747A786F3737786B647665616666633435337A66777565646737336B7966752F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB24F382CE000001CC", + "URI": "697066733A2F2F62616679626569626A363563346E77737A3773756C773364756D6E776B6F616D6E786770716270656E726D6567356F76657067763233356C687A342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB25F7188700000093", + "URI": "697066733A2F2F626166796265696371767069796C6271616D6371336C636175727A706A696465367468346233376C68346A7766786C65646C63686533756F6179342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB28A8254800000146", + "URI": "697066733A2F2F626166796265696571627072637873686370647865677268686B6C786570666535376970696E6571687137656C706F68326B356E32753571706C792F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB2F794C20000001EE", + "URI": "697066733A2F2F626166796265696832656D6A7A616A687337747A6B616C68646B756D363737357678326F76616C33726F6D696368336A3434326A6F3468366166342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB31BF046800000226", + "URI": "697066733A2F2F6261667962656965696E7A787774776B7672666E646E626A7061636D61776E6C7A7564616A726473616777703474676B6F643363756477697337692F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB38BCCC930000009F", + "URI": "697066733A2F2F62616679626569636E6678796D66676D70346A6E7365716678617A7633326E65796D697333357769637333336333616B616D72707773323233716D2F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3B6DE94400000152", + "URI": "697066733A2F2F626166796265696435726C676577667762736676683368346C7434756B763267766A7634656B61736778327A766A6D67377166773775737A7576342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3BD97DC1000001CD", + "URI": "697066733A2F2F62616679626569656A6B677A706C6766616775737564646174326A3335657163756A3762337376356D6C3568613569786676327535747A337170652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F2283CE000000CC", + "URI": "697066733A2F2F62616679626569667670746C366B69666C746E3661766F6179663473347A3364796466796B6A666466646A626A76746575696A706B626A336733752F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F8E144B00000147", + "URI": "697066733A2F2F62616679626569636675336272636F6C6962767171727736703464617772636A6B75737877637436366C6F736C797576636D766C66766D643478692F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB41D3AFB30000017F", + "URI": "697066733A2F2F6261667962656967796166656E357877766F346973706E777A3275376E696664687477366C686A376A6E37333334643732366A36656178367377342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB45F3AAA600000174", + "URI": "697066733A2F2F626166796265696774766B3336696F766C68777562326F6B6934747069726670647070337437747171777A6F36746D33706575373478636C3474712F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB465F3F23000001EF", + "URI": "697066733A2F2F62616679626569646B37796D37736775747A7A766E70736669796B6A7379733565646568637936707370756C74337137646B696F7A737A376271652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB47CE1E6500000131", + "URI": "697066733A2F2F6261667962656968627A683362786C76716578327163747665616B71656271357066366468637569773779796D6C696E6A346F74327636736937612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB48A4F76B00000227", + "URI": "697066733A2F2F626166796265696179766F6C686F3462777A736D6A69363633337174696975776B71753664726272746877667277626236346B62776174346E76342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB49A84D20000000EE", + "URI": "697066733A2F2F62616679626569633269337535366163646A6764643573733434753674743767656B35796A6D637933766E71676F3265633734686D6D6D676D74612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4B82B0EF000000AB", + "URI": "697066733A2F2F626166796265696462756637356D67616A6F63336969363465667675786D64356F7236746C3236356E7865623675616A34656232356F35657066652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4DC848D7000000E3", + "URI": "697066733A2F2F626166796265696169746C677662756774636B37786C6C6934717378683434663467687A6171376B6F6662666135657A6D796A336C7461766877612F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5079949800000196", + "URI": "697066733A2F2F62616679626569666F616B736468666A63716575783676766577377078326E34786F6773656E7133377A6176656233696973666E6D64347A6666342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5253D84700000153", + "URI": "697066733A2F2F62616679626569633735366A6F6263786961346776643477717634696E6E766F6C6C75767068676171666161656168353676626C713471343434792F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB52BF2CC0000001CE", + "URI": "697066733A2F2F626166796265696268626E6F356664353272717663656A6769656C336B6E796C77727A366A747233767A77336B75656F363674697033716B36356D2F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB542E0F0200000110", + "URI": "697066733A2F2F62616679626569666F73776A6B33666775726F6F6F767864326E7372336B676164706768633732366A683672776579776432656E736E74686777792F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5499938F0000018B", + "URI": "697066733A2F2F6261667962656961663473797979367A6C6E76716F3664646A326779727A786C6F7779636F6C74746A6777676F33637270373333336E7A676767652F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5C6E313C000000FA", + "URI": "697066733A2F2F626166796265696669793734673662767575646A6E757A6661676F6368656E6C6936666E3633616C6C6C717562617A756C7362736F636C636B66342F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5D44EE22000001F0", + "URI": "697066733A2F2F62616679626569636171686F6D7A6F36677334656761376D68647A6D6E6F67657274687337776C78777677746B33696B64646E6D7A647273637A6D2F6D657461646174612E6A736F6E" + } + }, + { + "NFToken": { + "NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB61651529000001E5", + "URI": "697066733A2F2F62616679626569637432737174363732766563677232367862776E797A373365657565777A37616D32736869767578376E756232367837326D62342F6D657461646174612E6A736F6E" + } + } + ] + }, + "PreviousTxnID": "C6DDE35463575822835391EAC1E6E03CC7545EFE0144D8D410FB5EA6A9746CE0", + "PreviousTxnLgrSeq": 77781454 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rXMART8usFd5kABXCayoP6ZfB35b4v43t", + "Balance": "16344096437", + "Domain": "786D6172742E617274", + "EmailHash": "D48190C85BE485DEA4CF4A56A8E93772", + "Flags": 0, + "OwnerCount": 4816, + "Sequence": 72168793 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "141E89D379C6949CA34BCB244DCBB7A6B2889781B157119CCC05ED19DFB676B0", + "PreviousFields": { + "Balance": "16344096449", + "Sequence": 72168792 + }, + "PreviousTxnID": "E17B8C46E87FD5FADA045AD19A572661F01DEC6CFB7A24536211EF8999A99C47", + "PreviousTxnLgrSeq": 77781459 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rMhoejpvS8mWfiffy4Zj8H2KbVs1oZCVsP", + "Balance": "1471369312", + "BurnedNFTokens": 1, + "Domain": "706978656C736F66756B69796F2E636F6D", + "Flags": 8388608, + "MintedNFTokens": 553, + "NFTokenMinter": "rXMART8usFd5kABXCayoP6ZfB35b4v43t", + "OwnerCount": 19, + "Sequence": 77578378 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "9DA74F431B2F406947558A12C01D4A080CAA5AC3FFA221C444E32A89B56C519A", + "PreviousFields": { + "MintedNFTokens": 552 + }, + "PreviousTxnID": "C6DDE35463575822835391EAC1E6E03CC7545EFE0144D8D410FB5EA6A9746CE0", + "PreviousTxnLgrSeq": 77781454 + } + } + ], + "TransactionIndex": 42, + "TransactionResult": "tesSUCCESS" + }, + "hash": "1C57BFD847DBBAB78211229AA9AC8965B8EF705390ABAD8C2E79C98520EE9B10", + "ledger_index": 77781462, + "date": 1676330052000 + } \ No newline at end of file diff --git a/src/utils/test_data/transaction_jsons/nftokenmint_response2.json b/src/utils/test_data/transaction_jsons/nftokenmint_response2.json new file mode 100644 index 0000000..9bac693 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/nftokenmint_response2.json @@ -0,0 +1,348 @@ +{ + "tx": { + "Account": "rJMBXARKGNGTP5428VdksLLEbPYP5dxn9d", + "Fee": "5500", + "Flags": 8, + "LastLedgerSequence": 77804703, + "Memos": [ + { + "Memo": { + "MemoData": "43726561746564206F6E206E66742E6F6E7872702E636F6D" + } + } + ], + "NFTokenTaxon": 23935453, + "Sequence": 72918661, + "SigningPubKey": "021E4C21B87E989C95EBBB228738A3E73F169E6F9CA73CE4FDA5B5827AF34987DF", + "TransactionType": "NFTokenMint", + "TransferFee": 4700, + "TxnSignature": "3045022100E18E831549F5E5E59AFF7D13DB6AF41CAD3E1F0BB447FC48D7007E08A03E82D7022039D279BDDEA2C5BFCD24CB67FF875D1D6058AB7CFC3CD6030A29DF6EC375FE26", + "URI": "697066733A2F2F516D594B71784A347779696E38466A6F516A55797363704E7167627568537373646631726F675334353144315161", + "date": 1676421542000, + "warnings": [ + { + "id": 1004, + "message": "This is a reporting server. The default behavior of a reporting server is to only return validated data. If you are looking for not yet validated data, include \"ledger_index : current\" in your request, which will cause this server to forward the request to a p2p node. If the forward is successful the response will include \"forwarded\" : \"true\"" + } + ] + }, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "NFTokens": [ + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF32DC40200000218", + "URI": "697066733A2F2F516D564D527647464D68635637416D5153375A31535A3753667645546F4A4E4E4C6F68694E67356F647251557242" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF424182F00000303", + "URI": "697066733A2F2F516D6167744843744D394D5259343777744B7841744138576E3942726652577A484D48444E74344735344E6D6D45" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF58F04F000000192", + "URI": "697066733A2F2F516D644562464C6A5261794D425532383243685731545979526A4E6F6D6A397375645A32323275427379434C4675" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF593075100000245", + "URI": "697066733A2F2F516D65384A37335478556A6A4551583651686434317A75536B4A316B4637644A574543424B46534771504B525536" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF5FEABEA000002C0", + "URI": "697066733A2F2F516D515175517266675666376D336A54716E6A726A63554B4A5A3439696374536235654D65783979566F6363326B" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF64A555000000346", + "URI": "697066733A2F2F516D596445464A39577A4D615375543438423272317A777034717A78506442384155436866584874765141675A71" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6B5F9ED000003C1", + "URI": "697066733A2F2F516D584668746251444D3239443539336A48504C4869554A4B586A776A776D56746F744346616172677A6374694C" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6D2C66C00000016", + "URI": "697066733A2F2F516D6466386D4467535778415A59663133575A746A627464736A6B5A636A355A6564676F4C44576468384B32684B" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF74DCF190000020D", + "URI": "697066733A2F2F516D55614877636E6E6B62354357653858336D6E704D7575517A695777774B6545436F42326E6E724B57364D486A" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF7D1B0370000014F", + "URI": "697066733A2F2F516D62755332414276576D4B57366D5437736F715346384C766952314C75767263794258574E57675755486F6864" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF844E322000002F8", + "URI": "697066733A2F2F516D6234756343754859677635394A5350325A5039767045764E6D7A515071504C323277563874636D33774D4144" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF86F7BFF00000187", + "URI": "697066733A2F2F516D614A6B337464574C46513166593436734A707842566446697567326455343478686B516373543336384E4848" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF8AF97BF00000373", + "URI": "697066733A2F2F516D54474B6975326A386D683454784A57596F586E3474346A644A4A48467A36764675726B4D554C345571397071" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA6A50670000033B", + "URI": "697066733A2F2F516D54597A6A3262506F616B36593943734272526B735277426D3745574A44686F4577556661324B7A5534757733" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA766254000003EE", + "URI": "697066733A2F2F516D594B71784A347779696E38466A6F516A55797363704E7167627568537373646631726F675334353144315161" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFAD5C4E0000003B6", + "URI": "697066733A2F2F516D53774855547A4E585153356E64484E633565566B6359794A73656E5458736F6E6F6779475A54486142554B73" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFC4F7ECA0000017C", + "URI": "697066733A2F2F516D656B4E7435595A6F4B6E78764667345745504E694C5042524D324E4B33594837454E43386162535946454A66" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFCCF92B200000368", + "URI": "697066733A2F2F516D614E555A3470484B73714439366279526E623746356D6B477279634A576E696B615A566D6239396D396E3745" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFD3B07CF000003E3", + "URI": "697066733A2F2F516D55426F325242596F70526A656F4A7134686570366A57663258716E7A344B46366866537754636463564B5052" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE1EB6E1000002B5", + "URI": "697066733A2F2F516D563348623434313776687352637963726470537A757262514E5755394E345443733548345038697A5335686D" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE8A5B7A00000330", + "URI": "697066733A2F2F516D656144416F6D4C596664344D6F586832674B754E3656776B794C36585377426B725155654870445944506A33" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFEF5CFF7000003AB", + "URI": "697066733A2F2F516D51783143755371523771653670786F6E6935575938796D5245334E75637A6B50364A7665356434505A573358" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFF48850300000043", + "URI": "697066733A2F2F516D5034674D485761396B777174327858733372383772585A6641674B437459626D73746D61754C795448526E75" + } + } + ], + "PreviousPageMin": "BE4B401B2F62ED35CC67362165AA813CCA06316FCA06316FF2F2C36100000021" + }, + "LedgerEntryType": "NFTokenPage", + "LedgerIndex": "BE4B401B2F62ED35CC67362165AA813CCA06316FFFFFFFFFFFFFFFFFFFFFFFFF", + "PreviousFields": { + "NFTokens": [ + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF32DC40200000218", + "URI": "697066733A2F2F516D564D527647464D68635637416D5153375A31535A3753667645546F4A4E4E4C6F68694E67356F647251557242" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF424182F00000303", + "URI": "697066733A2F2F516D6167744843744D394D5259343777744B7841744138576E3942726652577A484D48444E74344735344E6D6D45" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF58F04F000000192", + "URI": "697066733A2F2F516D644562464C6A5261794D425532383243685731545979526A4E6F6D6A397375645A32323275427379434C4675" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF593075100000245", + "URI": "697066733A2F2F516D65384A37335478556A6A4551583651686434317A75536B4A316B4637644A574543424B46534771504B525536" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF5FEABEA000002C0", + "URI": "697066733A2F2F516D515175517266675666376D336A54716E6A726A63554B4A5A3439696374536235654D65783979566F6363326B" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF64A555000000346", + "URI": "697066733A2F2F516D596445464A39577A4D615375543438423272317A777034717A78506442384155436866584874765141675A71" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6B5F9ED000003C1", + "URI": "697066733A2F2F516D584668746251444D3239443539336A48504C4869554A4B586A776A776D56746F744346616172677A6374694C" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6D2C66C00000016", + "URI": "697066733A2F2F516D6466386D4467535778415A59663133575A746A627464736A6B5A636A355A6564676F4C44576468384B32684B" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF74DCF190000020D", + "URI": "697066733A2F2F516D55614877636E6E6B62354357653858336D6E704D7575517A695777774B6545436F42326E6E724B57364D486A" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF7D1B0370000014F", + "URI": "697066733A2F2F516D62755332414276576D4B57366D5437736F715346384C766952314C75767263794258574E57675755486F6864" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF844E322000002F8", + "URI": "697066733A2F2F516D6234756343754859677635394A5350325A5039767045764E6D7A515071504C323277563874636D33774D4144" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF86F7BFF00000187", + "URI": "697066733A2F2F516D614A6B337464574C46513166593436734A707842566446697567326455343478686B516373543336384E4848" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF8AF97BF00000373", + "URI": "697066733A2F2F516D54474B6975326A386D683454784A57596F586E3474346A644A4A48467A36764675726B4D554C345571397071" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA6A50670000033B", + "URI": "697066733A2F2F516D54597A6A3262506F616B36593943734272526B735277426D3745574A44686F4577556661324B7A5534757733" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFAD5C4E0000003B6", + "URI": "697066733A2F2F516D53774855547A4E585153356E64484E633565566B6359794A73656E5458736F6E6F6779475A54486142554B73" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFC4F7ECA0000017C", + "URI": "697066733A2F2F516D656B4E7435595A6F4B6E78764667345745504E694C5042524D324E4B33594837454E43386162535946454A66" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFCCF92B200000368", + "URI": "697066733A2F2F516D614E555A3470484B73714439366279526E623746356D6B477279634A576E696B615A566D6239396D396E3745" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFD3B07CF000003E3", + "URI": "697066733A2F2F516D55426F325242596F70526A656F4A7134686570366A57663258716E7A344B46366866537754636463564B5052" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE1EB6E1000002B5", + "URI": "697066733A2F2F516D563348623434313776687352637963726470537A757262514E5755394E345443733548345038697A5335686D" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE8A5B7A00000330", + "URI": "697066733A2F2F516D656144416F6D4C596664344D6F586832674B754E3656776B794C36585377426B725155654870445944506A33" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFEF5CFF7000003AB", + "URI": "697066733A2F2F516D51783143755371523771653670786F6E6935575938796D5245334E75637A6B50364A7665356434505A573358" + } + }, + { + "NFToken": { + "NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFF48850300000043", + "URI": "697066733A2F2F516D5034674D485761396B777174327858733372383772585A6641674B437459626D73746D61754C795448526E75" + } + } + ] + }, + "PreviousTxnID": "12E8B027A922BDDD80E89005D1E813AA52E6BFC02C72AC490E002A3F3D2448A4", + "PreviousTxnLgrSeq": 77803196 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rJMBXARKGNGTP5428VdksLLEbPYP5dxn9d", + "Balance": "509694877", + "BurnedNFTokens": 206, + "Flags": 0, + "MintedNFTokens": 1007, + "OwnerCount": 38, + "Sequence": 72918662 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E3EDB522680D817CCE9CBC714D33EC5F567478D2DB551617A41856456D532AB2", + "PreviousFields": { + "Balance": "509700377", + "MintedNFTokens": 1006, + "Sequence": 72918661 + }, + "PreviousTxnID": "8E476510367BF294618730C443D2A22D9857B37C407DB7D7C6A5D4D477359033", + "PreviousTxnLgrSeq": 77804606 + } + } + ], + "TransactionIndex": 16, + "TransactionResult": "tesSUCCESS" + }, + "hash": "77130966274E7DB385AC262A944AC20178611EE694EE0CA75A32C8760791521F", + "ledger_index": 77804695, + "date": 1676421542000 + } \ No newline at end of file diff --git a/src/utils/test_data/transaction_jsons/offer_cancelled.json b/src/utils/test_data/transaction_jsons/offer_cancelled.json new file mode 100644 index 0000000..c2b9ddc --- /dev/null +++ b/src/utils/test_data/transaction_jsons/offer_cancelled.json @@ -0,0 +1,90 @@ +{ + "Account": "rEUt5Wy44vDKBDaGkUWG6oSTvxmqgnKWCg", + "Fee": "15", + "Flags": 2147483648, + "LastLedgerSequence": 72374248, + "OfferSequence": 70922543, + "Sequence": 70922544, + "SigningPubKey": "ED024DA5B0A65470D8582D43BDD54D2BD861C9485CFB13EFA2928650CE6686A86D", + "TransactionType": "OfferCancel", + "TxnSignature": "37EB64C659AE77A70FB93A2DFA0AE5282E3B6C0C8E89A3FE08E004D216CB5C8C62219761E3764AFCBA82692DF6204516FD63C0265CC894B360EA06F18401E90E", + "date": 708682141, + "hash": "40FDBE9F71213696FE67CC80B2847E7DA1D3E03A4446D34DCC7DE347137FF436", + "inLedger": 72374247, + "ledger_index": 72374247, + "meta": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "57147f7b444d5b06", + "Flags": 0, + "RootIndex": "2004607367326F467796C4080157BE0997B306F1CA6AE0C657147F7B444D5B06", + "TakerGetsCurrency": "0000000000000000000000005844580000000000", + "TakerGetsIssuer": "DEC71A7A7168ED930218B15994FD007CE80A4913", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "2004607367326F467796C4080157BE0997B306F1CA6AE0C657147F7B444D5B06" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rEUt5Wy44vDKBDaGkUWG6oSTvxmqgnKWCg", + "Balance": "1283353963", + "Flags": 0, + "OwnerCount": 2, + "Sequence": 70922545 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "2CAC78E1EEC7340A666AED1DE99DB8B6C8235CB6675903CAB26EA5C62D4F0BB4", + "PreviousFields": { + "Balance": "1283353978", + "OwnerCount": 3, + "Sequence": 70922544 + }, + "PreviousTxnID": "3C6A9B3C72B79DB877AC205ADC1700281C20D08CCD30A6779C3E1B550B558B95", + "PreviousTxnLgrSeq": 72373937 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rEUt5Wy44vDKBDaGkUWG6oSTvxmqgnKWCg", + "BookDirectory": "2004607367326F467796C4080157BE0997B306F1CA6AE0C657147F7B444D5B06", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "3C6A9B3C72B79DB877AC205ADC1700281C20D08CCD30A6779C3E1B550B558B95", + "PreviousTxnLgrSeq": 72373937, + "Sequence": 70922543, + "TakerGets": { + "currency": "XDX", + "issuer": "rMJAXYsbNzhwp7FfYnAsYP5ty3R9XnurPo", + "value": "82335.52909" + }, + "TakerPays": "47504858" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "A867E960F0D9F88D7BE2885AA3E69C5F2C7F76499D6CC483E353D6616EEBD352" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rEUt5Wy44vDKBDaGkUWG6oSTvxmqgnKWCg", + "RootIndex": "FEB025593E20EE2B66382D9F9079719A40AD0DE257CBBD6421092037E39C9A53" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "FEB025593E20EE2B66382D9F9079719A40AD0DE257CBBD6421092037E39C9A53" + } + } + ], + "TransactionIndex": 16, + "TransactionResult": "tesSUCCESS" + }, + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/offer_created.json b/src/utils/test_data/transaction_jsons/offer_created.json new file mode 100644 index 0000000..09bb70c --- /dev/null +++ b/src/utils/test_data/transaction_jsons/offer_created.json @@ -0,0 +1,93 @@ +{ + "Account": "rJHbqhp9Sea4f43RoUanrDE1gW9MymTLp9", + "Expiration": 740218424, + "Fee": "25", + "Flags": 2148007936, + "LastLedgerSequence": 72374322, + "Sequence": 71307620, + "SigningPubKey": "020AF1B1419DB3C80FBB3B2621315F78F03806118094140B6FE535ED809561AC23", + "TakerGets": "44930000", + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "14.524821" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100C1CA7C960C1BD0B2EA9ACCA13BB429C1C5B558AB2B8AFE9FE3815DB075E07806022030152DC46694A3BF8BA1509944F9388723CB30C678E659613D4B3BF8166CCCA5", + "date": 708682430, + "hash": "463E28521ACA7FB5F4081E7E368FA5AEB76FB641FCB3C92CA9E8971A990CE84A", + "inLedger": 72374321, + "ledger_index": 72374321, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rJHbqhp9Sea4f43RoUanrDE1gW9MymTLp9", + "RootIndex": "3418F55643869450792F7047DC92DD661D38E68AC827C378D7C12FE8E017DD2B" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "3418F55643869450792F7047DC92DD661D38E68AC827C378D7C12FE8E017DD2B" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rJHbqhp9Sea4f43RoUanrDE1gW9MymTLp9", + "Balance": "69932774", + "Flags": 0, + "OwnerCount": 3, + "Sequence": 71307621 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "72D49D4E2ECA5153A90413AA4BCEFBFBE748A2B66A96F5E5611089C095BD666D", + "PreviousFields": { + "Balance": "69932799", + "OwnerCount": 2, + "Sequence": 71307620 + }, + "PreviousTxnID": "70C2D1F863FBF18CA7E9B17D7B35A19BD5ED22C8B703D447A21C746E1F66F311", + "PreviousTxnLgrSeq": 72374313 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "ExchangeRate": "4e0b7c2f29ac3197", + "Flags": 0, + "RootIndex": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4E0B7C2F29AC3197", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4E0B7C2F29AC3197" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "DFA50F8A0710C8483D5DEF31E87BFA5DBC617F16045EC187EB21A07B7A2B23DA", + "NewFields": { + "Account": "rJHbqhp9Sea4f43RoUanrDE1gW9MymTLp9", + "BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4E0B7C2F29AC3197", + "Expiration": 740218424, + "Flags": 131072, + "Sequence": 71307620, + "TakerGets": "44930000", + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "14.524821" + } + } + } + } + ], + "TransactionIndex": 37, + "TransactionResult": "tesSUCCESS" + }, + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/offer_partially_filled_and_filled.json b/src/utils/test_data/transaction_jsons/offer_partially_filled_and_filled.json new file mode 100644 index 0000000..82efc8b --- /dev/null +++ b/src/utils/test_data/transaction_jsons/offer_partially_filled_and_filled.json @@ -0,0 +1,391 @@ +{ + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 655360, + "LastLedgerSequence": 69465967, + "Memos": [ + { + "Memo": { + "MemoData": "FB440A33756EB27101D52DC01A097AABBC8852C104090CB53FF051EB851EB852406E000000000000406E99999999999A3FF0083126E978D5" + } + } + ], + "Sequence": 2978465, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TakerGets": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "194.0900821202701" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "179.9744397842505" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "45B6A5D968AC63BAF052BFCB68AEBB1C3AE0E2CAA30D8CB753D78CDD2E601748235374B8BF21C1ADF98095BCAA7206C584F6F42BB27D1EF0BDA3F2FB0FD58207", + "date": 697291341, + "hash": "CC7E314E86F40CA8342E991D1F20444B2889110988EB6E5674E219031B07A9D4", + "inLedger": 69465967, + "ledger_index": 69465967, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "4", + "Owner": "rNzgS71DyJPMnWMA8aS7NqvXP7bNuwyaZo", + "RootIndex": "E5EDA666FF7FA049136BE952984ABDE9F59BD97C0EEFD1ADB93094E27047573A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "091BE53F6AFE8089FCD573C96D0E3B7E9145FEA4057924EA298D950F7F667352" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-143.1629304840639" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "USD", + "issuer": "rPu2feBaViWGmWJhvaF5yLocTVD8FUxd2A", + "value": "1000000000" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "LowNode": "1fce" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "14BE4365C33BE6BF6AF293C0CF48F8556037541C016DDF37A8AC71C028803206", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-260.7872232039884" + } + }, + "PreviousTxnID": "32DE54D6ADA7060BDED9407327C4401ADC2441A4D80A138654E808B5167C2466", + "PreviousTxnLgrSeq": 69429668 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "181.1375018324144" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "HighNode": "26", + "LowLimit": { + "currency": "USD", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "100000" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "197E542413061266DC6995ADD18728149974484D717A415649AE12E89E297DA5", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "20D7FEEABCA8072B9F2662F3A23BF87483FEB8055EFBE95D857AE4BBB792D0B8", + "PreviousTxnLgrSeq": 69465965 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-120.4655520405203" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "USD", + "issuer": "rPu2feBaViWGmWJhvaF5yLocTVD8FUxd2A", + "value": "1000000000" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + }, + "LowNode": "991" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "1B0CE75F44E3498B444ACB80AA40E3212954BBD55D237205182612EA8998877F", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-5.377793518422876" + } + }, + "PreviousTxnID": "32DE54D6ADA7060BDED9407327C4401ADC2441A4D80A138654E808B5167C2466", + "PreviousTxnLgrSeq": 69429668 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-32143.92279120974" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "USD", + "issuer": "rNzgS71DyJPMnWMA8aS7NqvXP7bNuwyaZo", + "value": "1000000000" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "LowNode": "29d" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "3924BC09BEECCE4B411D17789803B66074F248365D70A9757A21478352D75383", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-32207.79827532589" + } + }, + "PreviousTxnID": "3778786185BB8335BB3B14258CAF060630EE91ACFC6B7362D5ED6333DC5B3109", + "PreviousTxnLgrSeq": 69465965 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rNzgS71DyJPMnWMA8aS7NqvXP7bNuwyaZo", + "BookDirectory": "E8900917D0B37ED23351E4A7276E10B5BE987CCD4EA2A08A5422D10C4ECC8000", + "BookNode": "0", + "Flags": 131072, + "OwnerNode": "5", + "PreviousTxnID": "3778786185BB8335BB3B14258CAF060630EE91ACFC6B7362D5ED6333DC5B3109", + "PreviousTxnLgrSeq": 69465965, + "Sequence": 5931, + "TakerGets": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "80353A895BD8033894C868B6BCC01B8CA23FC12E82769122ECDAF9880BF31274", + "PreviousFields": { + "TakerGets": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "63.7479881398749" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "62.4730283770749" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-8427.912727359367" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "USD", + "issuer": "rNzgS71DyJPMnWMA8aS7NqvXP7bNuwyaZo", + "value": "1000000000" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + }, + "LowNode": "4af" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "9723C56F7296CD00954B197C97C2EEE149CA42542F025F067A0037B0D4734CE8", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-8365.439698982293" + } + }, + "PreviousTxnID": "3778786185BB8335BB3B14258CAF060630EE91ACFC6B7362D5ED6333DC5B3109", + "PreviousTxnLgrSeq": 69465965 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + }, + "HighNode": "326", + "LowLimit": { + "currency": "USD", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "10000000" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "CE8BC6520C7A30953A4AC6733394E6924DAA4C3CB16CFB9EAC02EA7494417D59", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "177.9159084729707" + } + }, + "PreviousTxnID": "F90D4CB0BBB7F1AAE3F221A062E616595ADBB636C0B0E60891A6EF880E083EB7", + "PreviousTxnLgrSeq": 69465967 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rNzgS71DyJPMnWMA8aS7NqvXP7bNuwyaZo", + "Balance": "24135271925", + "Flags": 0, + "MessageKey": "02000000000000000000000000C03555B48C4398613CE55C8B728FFF2C91265101", + "OwnerCount": 34, + "Sequence": 5936 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E3795FE99A17BDE69DC0234FF295C811302E451B773A8D96EAAF3846628E8A43", + "PreviousFields": { + "OwnerCount": 35 + }, + "PreviousTxnID": "496EA410ACF2B767ADDB3781D55F2E514CD8B34A2B64ED732EE83236E072412F", + "PreviousTxnLgrSeq": 69460853 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "CC7E314E86F40CA8342E991D1F20444B2889110988EB6E5674E219031B07A9D4", + "Balance": "2487581399", + "Flags": 0, + "OwnerCount": 216, + "Sequence": 2978466 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "F90D4CB0BBB7F1AAE3F221A062E616595ADBB636C0B0E60891A6EF880E083EB7", + "Balance": "2487581409", + "Sequence": 2978465 + }, + "PreviousTxnID": "F90D4CB0BBB7F1AAE3F221A062E616595ADBB636C0B0E60891A6EF880E083EB7", + "PreviousTxnLgrSeq": 69465967 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5422d10c4ecc8000", + "Flags": 0, + "RootIndex": "E8900917D0B37ED23351E4A7276E10B5BE987CCD4EA2A08A5422D10C4ECC8000", + "TakerGetsCurrency": "0000000000000000000000005553440000000000", + "TakerGetsIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "E8900917D0B37ED23351E4A7276E10B5BE987CCD4EA2A08A5422D10C4ECC8000" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rPu2feBaViWGmWJhvaF5yLocTVD8FUxd2A", + "BookDirectory": "E8900917D0B37ED23351E4A7276E10B5BE987CCD4EA2A08A5422D49D5E80FAFB", + "BookNode": "0", + "Flags": 131072, + "OwnerNode": "0", + "Sequence": 67701941, + "TakerGets": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "127.4104863074605" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "124.9122414779025" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "FBF23A35CFD5CED0C995D78063D497F707A681737CB384BC90CD40B466D21F96", + "PreviousFields": { + "TakerGets": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "244.8" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "240" + } + }, + "PreviousTxnID": "898C5F3A8060A3BFAF99D8F0762714D8224DCB2B7FC4F79A95A6A24E259E6FAF", + "PreviousTxnLgrSeq": 69429769 + } + } + ], + "TransactionIndex": 15, + "TransactionResult": "tesSUCCESS" + }, + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/offer_with_expiration.json b/src/utils/test_data/transaction_jsons/offer_with_expiration.json new file mode 100644 index 0000000..9f4ca0e --- /dev/null +++ b/src/utils/test_data/transaction_jsons/offer_with_expiration.json @@ -0,0 +1,127 @@ +{ + "Account": "rJHHRtt6qmiz71tyGFMZUoxMGakdgqEou5", + "Expiration": 708682061, + "Fee": "20", + "Flags": 0, + "LastLedgerSequence": 72374175, + "OfferSequence": 67782876, + "Sequence": 67782878, + "SigningPubKey": "026C5ACDB50D55179AF872ACAB51576DEBB309302FCF1E72889777EC77031F6ADC", + "TakerGets": "50000000", + "TakerPays": { + "currency": "457175696C69627269756D000000000000000000", + "issuer": "rpakCr61Q92abPXJnVboKENmpKssWyHpwu", + "value": "230.7776699646076" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3044022054DFB5CF41AEA6E224FF5B9C91ACB80ED9544CE06BC3CA71F79BC63DEA9E7D8F0220669706DB65CDED48D4F93BFBD3013C3E03BBB13FE1211C90C6785BA72CADBBBA", + "date": 708681822, + "hash": "6BF848D3996143219272E868F47DD726240CBF4D9FA0F0FA2801CB9AACC79776", + "inLedger": 72374166, + "ledger_index": 72374166, + "meta": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "02BAC5DA6C1E7476B6469A9AD560AB618ABC63C7AA1C2CCC55979555DAFFC91C", + "NewFields": { + "Account": "rJHHRtt6qmiz71tyGFMZUoxMGakdgqEou5", + "BookDirectory": "8DFA6E78CAB715332FBF45CB8FCE3BF4FD55FF70592FD0A04F1065D244CE80F8", + "Expiration": 708682061, + "Sequence": 67782878, + "TakerGets": "50000000", + "TakerPays": { + "currency": "457175696C69627269756D000000000000000000", + "issuer": "rpakCr61Q92abPXJnVboKENmpKssWyHpwu", + "value": "230.7776699646076" + } + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rJHHRtt6qmiz71tyGFMZUoxMGakdgqEou5", + "BookDirectory": "8DFA6E78CAB715332FBF45CB8FCE3BF4FD55FF70592FD0A04F1066F6B0C0BD2E", + "BookNode": "0", + "Expiration": 708682031, + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "15F78285E2236EF8E7268D9BE0A2BD2341F702D979C4013D0FC5354CF5A70120", + "PreviousTxnLgrSeq": 72374158, + "Sequence": 67782876, + "TakerGets": "50000000", + "TakerPays": { + "currency": "457175696C69627269756D000000000000000000", + "issuer": "rpakCr61Q92abPXJnVboKENmpKssWyHpwu", + "value": "230.8404670389911" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "45C5FA82C61E7F01B191551E532A61187600FA63006A6C7727A450671B350AD4" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rJHHRtt6qmiz71tyGFMZUoxMGakdgqEou5", + "RootIndex": "559D3DEC473D3BC0A503E38A8CFB632E17190F78763B96BC6A6D8A3B7360F1D0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "559D3DEC473D3BC0A503E38A8CFB632E17190F78763B96BC6A6D8A3B7360F1D0" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "8DFA6E78CAB715332FBF45CB8FCE3BF4FD55FF70592FD0A04F1065D244CE80F8", + "NewFields": { + "ExchangeRate": "4f1065d244ce80f8", + "RootIndex": "8DFA6E78CAB715332FBF45CB8FCE3BF4FD55FF70592FD0A04F1065D244CE80F8", + "TakerPaysCurrency": "457175696C69627269756D000000000000000000", + "TakerPaysIssuer": "0C0EA5B382100A2405ADD5A93ECE617FAEEE156D" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f1066f6b0c0bd2e", + "Flags": 0, + "RootIndex": "8DFA6E78CAB715332FBF45CB8FCE3BF4FD55FF70592FD0A04F1066F6B0C0BD2E", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "457175696C69627269756D000000000000000000", + "TakerPaysIssuer": "0C0EA5B382100A2405ADD5A93ECE617FAEEE156D" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "8DFA6E78CAB715332FBF45CB8FCE3BF4FD55FF70592FD0A04F1066F6B0C0BD2E" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rJHHRtt6qmiz71tyGFMZUoxMGakdgqEou5", + "Balance": "207351731", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 67782879 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "CD5FFCEA88A52BBD0559E3EFE0B5D385D447B088477B36948A3DF019874E76E6", + "PreviousFields": { + "Balance": "207351751", + "Sequence": 67782878 + }, + "PreviousTxnID": "AFB25623792838FFF9D59E5E24E812E335D467CD75602DE81F2875CD4E869922", + "PreviousTxnLgrSeq": 72374158 + } + } + ], + "TransactionIndex": 33, + "TransactionResult": "tesSUCCESS" + }, + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/payment_iou.json b/src/utils/test_data/transaction_jsons/payment_iou.json new file mode 100644 index 0000000..1e8e1f7 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/payment_iou.json @@ -0,0 +1,123 @@ +{ + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied.", + "ledger_hash": "F3F1416BF2E813396AB01FAA38E9F1023AC4D2368D94B0D52B2BC603CEEC01C3", + "ledger_index": 10459371, + "status": "closed", + "type": "transaction", + "validated": true, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.525330905250352" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001E8", + "LowLimit": { + "currency": "USD", + "issuer": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "value": "1000000000" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "2F323020B4288ACD4066CC64C89DAD2E4D5DFC2D44571942A51C005BF79D6E25", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.535330905250352" + } + }, + "PreviousTxnID": "DC061E6F47B1B6E9A496A31B1AF87194B4CB24B2EBF8A59F35E31E12509238BD", + "PreviousTxnLgrSeq": 10459364 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.02" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001E8", + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "1000000000" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "AAE13AF5192EFBFD49A8EEE5869595563FEB73228C0B38FED9CC3D20EE74F399", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.01" + } + }, + "PreviousTxnID": "DC061E6F47B1B6E9A496A31B1AF87194B4CB24B2EBF8A59F35E31E12509238BD", + "PreviousTxnLgrSeq": 10459364 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Balance": "239555992", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 38 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E9A39B0BA8703D5FFD05D9EAD01EE6C0E7A15CF33C2C6B7269107BD2BD535818", + "PreviousFields": { + "Balance": "239567992", + "Sequence": 37 + }, + "PreviousTxnID": "DC061E6F47B1B6E9A496A31B1AF87194B4CB24B2EBF8A59F35E31E12509238BD", + "PreviousTxnLgrSeq": 10459364 + } + } + ], + "TransactionIndex": 2, + "TransactionResult": "tesSUCCESS" + }, + "transaction": { + "Account": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Amount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0.01" + }, + "Destination": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10459379, + "Sequence": 37, + "SigningPubKey": "03F16A52EBDCA6EBF5D99828E1E6918C64D45E6F136476A8F4757512FE553D18F0", + "TransactionType": "Payment", + "TxnSignature": "3044022031D6AB55CDFD17E06DA0BAD6D6B7DC9B5CA8FFF50405F2FCD3ED8D3893B1835E02200524CC1E7D70AE3F00C9F94405C55EE179C363F534905168AE8B5BA01CF568A0", + "date": 471644150, + "hash": "34671C179737CC89E0F8BBAA83C313885ED1733488FC0F3088BAE16A3D9A5B1B" + } +} diff --git a/src/utils/test_data/transaction_jsons/payment_iou_destination_no_balance.json b/src/utils/test_data/transaction_jsons/payment_iou_destination_no_balance.json new file mode 100644 index 0000000..561cf00 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/payment_iou_destination_no_balance.json @@ -0,0 +1,121 @@ + { + "Account": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Amount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0.01" + }, + "Destination": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10425102, + "Sequence": 16, + "SigningPubKey": "03F16A52EBDCA6EBF5D99828E1E6918C64D45E6F136476A8F4757512FE553D18F0", + "TransactionType": "Payment", + "TxnSignature": "3044022017DC45606103FF2CCE5D63E340D1E2B302BE16C206673B99712058CA0DBD2CC5022074A19CF5AF9CDFCEC821650A4C22E83E49E14956E1F2A094181E8E14F6881200", + "date": 471494760, + "hash": "D038C9D95926EACAA9FBDF3E6CA0675ACF1700B3CE13FF4CA52B463B58860BBA", + "inLedger": 10425094, + "ledger_index": 10425094, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.535330905250352" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "1e8", + "LowLimit": { + "currency": "USD", + "issuer": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "value": "1000000000" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "2F323020B4288ACD4066CC64C89DAD2E4D5DFC2D44571942A51C005BF79D6E25", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.545330905250352" + } + }, + "PreviousTxnID": "CEB7B6040C2989B9849C8D7E49F710457EDDE1D95ECDF1E298FD30CF2AC5BE11", + "PreviousTxnLgrSeq": 10424776 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.01" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "1e8", + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "1000000000" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "AAE13AF5192EFBFD49A8EEE5869595563FEB73228C0B38FED9CC3D20EE74F399", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "A788447CF5FD7108CBF49416E2335F95ED3F5A9FC016686C8F9EFB34BBEA613A", + "PreviousTxnLgrSeq": 10425088 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Balance": "239807992", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 17 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E9A39B0BA8703D5FFD05D9EAD01EE6C0E7A15CF33C2C6B7269107BD2BD535818", + "PreviousFields": { + "Balance": "239819992", + "Sequence": 16 + }, + "PreviousTxnID": "3109F5A0F891CCA20B4D891EB7437973F40A7664C5176092EB2E5C0A949992AD", + "PreviousTxnLgrSeq": 10424942 + } + } + ], + "TransactionIndex": 3, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0.01" + } + }, + "validated": true + } diff --git a/src/utils/test_data/transaction_jsons/payment_iou_multipath.json b/src/utils/test_data/transaction_jsons/payment_iou_multipath.json new file mode 100644 index 0000000..ef451b1 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/payment_iou_multipath.json @@ -0,0 +1,285 @@ +{ + "Account": "r4nmQNH4Fhjfh6cHDbvVSsBv7KySbj4cBf", + "Amount": { + "currency": "USD", + "issuer": "rnYDWQaRdMb5neCGgvFfhw3MBoxmv5LtfH", + "value": "300" + }, + "Destination": "rnYDWQaRdMb5neCGgvFfhw3MBoxmv5LtfH", + "Fee": "10", + "Flags": 0, + "Paths": [ + [ + { + "account": "rJsaPnGdeo7BhMnHjuc3n44Mf7Ra1qkSVJ", + "currency": "USD", + "issuer": "rJsaPnGdeo7BhMnHjuc3n44Mf7Ra1qkSVJ", + "type": 49, + "type_hex": "0000000000000031" + } + ], + [ + { + "account": "rGpeQzUWFu4fMhJHZ1Via5aqFC3A5twZUD", + "currency": "USD", + "issuer": "rGpeQzUWFu4fMhJHZ1Via5aqFC3A5twZUD", + "type": 49, + "type_hex": "0000000000000031" + } + ], + [ + { + "account": "rrnsYgWn13Z28GtRgznrSUsLfMkvsXCZSu", + "currency": "USD", + "issuer": "rrnsYgWn13Z28GtRgznrSUsLfMkvsXCZSu", + "type": 49, + "type_hex": "0000000000000031" + } + ] + ], + "Sequence": 4, + "SigningPubKey": "0324CAAFA2212D2AEAB9D42D481535614AED486293E1FB1380FF070C3DD7FB4264", + "TransactionType": "Payment", + "TxnSignature": "3044022007192E2113C236D541BA72FE628F2BDAA467120F3F61F588B63023E4EAE79E06022051813E7809F3DB07B29AEA65D61C1DD1B830C130840A15A67718ADC6FD94C44B", + "date": 472608260, + "hash": "029E6CF9C7962A324BD52A90732184991309DD964E7E8B2D52CAF138CB92CB29", + "inLedger": 8, + "ledger_index": 8, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 131072, + "HighLimit": { + "currency": "USD", + "issuer": "r4nmQNH4Fhjfh6cHDbvVSsBv7KySbj4cBf", + "value": "100" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rrnsYgWn13Z28GtRgznrSUsLfMkvsXCZSu", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "1AC76982771D3660656D83FA7CCE8E833C42DA797BECAAB30F36D6EEF73BE91B", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-100" + } + }, + "PreviousTxnID": "5E732D1DCC74EC0A5658FADC3B0FF7BBDDB83F630A04527A82DB671B04180FAD", + "PreviousTxnLgrSeq": 5 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r4nmQNH4Fhjfh6cHDbvVSsBv7KySbj4cBf", + "Balance": "999999990", + "Flags": 0, + "OwnerCount": 3, + "Sequence": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "5302F37F1D9290D8D92A31651FF71531504183695C2C43EC136B1CF4AC7E08FA", + "PreviousFields": { + "Balance": "1000000000", + "Sequence": 4 + }, + "PreviousTxnID": "60357254ABC66B61EA9B13851A2862B55D7B5CF4EBE1D5682E95EBE217037B3A", + "PreviousTxnLgrSeq": 4 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 131072, + "HighLimit": { + "currency": "USD", + "issuer": "r4nmQNH4Fhjfh6cHDbvVSsBv7KySbj4cBf", + "value": "100" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rJsaPnGdeo7BhMnHjuc3n44Mf7Ra1qkSVJ", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "9D9CE283FB821F2A2DA5BCA55DFB2FD7758D129F3060B1F7834B7784AF4CD15C", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-100" + } + }, + "PreviousTxnID": "84EE2961C88A4B87A0F234CDF4C66BB488781DA2FF823814381473B40875C2AA", + "PreviousTxnLgrSeq": 5 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 131072, + "HighLimit": { + "currency": "USD", + "issuer": "r4nmQNH4Fhjfh6cHDbvVSsBv7KySbj4cBf", + "value": "100" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rGpeQzUWFu4fMhJHZ1Via5aqFC3A5twZUD", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "C5F104A35DB835AF4A4C4664BCDA57A88873DCEF23DF567485654FAEE5645949", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-100" + } + }, + "PreviousTxnID": "CC0817117A0C9055E26FB2E482AC0EF8B4321D874D55428F5F22DEAEE18E0931", + "PreviousTxnLgrSeq": 5 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "100" + }, + "Flags": 65536, + "HighLimit": { + "currency": "USD", + "issuer": "rJsaPnGdeo7BhMnHjuc3n44Mf7Ra1qkSVJ", + "value": "0" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rnYDWQaRdMb5neCGgvFfhw3MBoxmv5LtfH", + "value": "1000" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "CC07E55B7114FAD14663E5BDD16458E3EFA300C2C139E4E0FC9E2635E3D8099E", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "8A8DE047F4A1886A2A1E8231AE3D66D162BA0ADD00B781CAAFF946F104474E63", + "PreviousTxnLgrSeq": 4 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-100" + }, + "Flags": 131072, + "HighLimit": { + "currency": "USD", + "issuer": "rnYDWQaRdMb5neCGgvFfhw3MBoxmv5LtfH", + "value": "1000" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rrnsYgWn13Z28GtRgznrSUsLfMkvsXCZSu", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "FBCA655A6C287E90234BF96E8CF950B8B0DE4438C95F408A0E55D256EA2A8DD1", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "CDF04C313E841ACA1103B3E2D360E5EB18236808D281B645A2BC72426FDC8EA6", + "PreviousTxnLgrSeq": 4 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "100" + }, + "Flags": 65536, + "HighLimit": { + "currency": "USD", + "issuer": "rGpeQzUWFu4fMhJHZ1Via5aqFC3A5twZUD", + "value": "0" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rnYDWQaRdMb5neCGgvFfhw3MBoxmv5LtfH", + "value": "1000" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "FDBBB8BF83FF697C7F68E67AAA06A9E0774CB2727B53E95E63B6416AF0B1A2A7", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "8BF77D4762500ED72F291B19D75489397EBF23D870C975B33B3C114E54F36740", + "PreviousTxnLgrSeq": 4 + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "status": "success", + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/payment_iou_redeem.json b/src/utils/test_data/transaction_jsons/payment_iou_redeem.json new file mode 100644 index 0000000..8724829 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/payment_iou_redeem.json @@ -0,0 +1,81 @@ +{ + "Account": "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", + "Amount": { + "currency": "USD", + "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "value": "100" + }, + "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Fee": "10", + "Flags": 2147483648, + "Sequence": 2, + "SigningPubKey": "02691AC5AE1C4C333AE5DF8A93BDC495F0EEBFC6DB0DA7EB6EF808F3AFC006E3FE", + "TransactionType": "Payment", + "TxnSignature": "304402205523DC0073C7F7DB92765367526A7A2CF1B6E2A42C6B102E96F58FC69689CBF60220371264F1472C6694F8453506503351B256722274CE1324E2B3B1885C18485D59", + "date": 472366860, + "hash": "44AA46A2728AD7A7E856B27D8815D935D174F63CAA60E4BD90C5CC74D440E753", + "inLedger": 6, + "ledger_index": 6, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-100" + }, + "Flags": 131072, + "HighLimit": { + "currency": "USD", + "issuer": "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", + "value": "500" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "88DA36A0E2F92E2E3504DC7936FDB719769486A6BE1BEC4F1E3B580538D28B4A", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-200" + } + }, + "PreviousTxnID": "C0AA2D9C82E68C06F81340B633D36EA983A834F6377FA18139D4EE7AA6A2973D", + "PreviousTxnLgrSeq": 5 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", + "Balance": "999999980", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 3 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "DE3BE7FDF6864FB024807B36BFCB4607E7CDA7D4C155C7AFB4B0973D638938BF", + "PreviousFields": { + "Balance": "999999990", + "Sequence": 2 + }, + "PreviousTxnID": "88CD25B9BF28097156E1EA79281994FFD002EE3D3F67E99ED791C38DA3967CB6", + "PreviousTxnLgrSeq": 4 + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "status": "success", + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/payment_iou_redeem_then_issue.json b/src/utils/test_data/transaction_jsons/payment_iou_redeem_then_issue.json new file mode 100644 index 0000000..a6a4c1f --- /dev/null +++ b/src/utils/test_data/transaction_jsons/payment_iou_redeem_then_issue.json @@ -0,0 +1,81 @@ +{ + "Account": "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", + "Amount": { + "currency": "USD", + "issuer": "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", + "value": "200" + }, + "Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Fee": "10", + "Flags": 2147483648, + "Sequence": 3, + "SigningPubKey": "02691AC5AE1C4C333AE5DF8A93BDC495F0EEBFC6DB0DA7EB6EF808F3AFC006E3FE", + "TransactionType": "Payment", + "TxnSignature": "304402207068EDB074FE388DB198A5D3B51A2846BB937F76F558D2D9245B11A20DFD5DAF022055A5B5D65C637A34C48361AFD0E97780D6FAED98A4221CE0838EE3598C0EECDE", + "date": 472374260, + "hash": "8EE52E8CC50AB0841A34E755E882BBC50F855A750AC954D7E7050E71672BE77E", + "inLedger": 8, + "ledger_index": 8, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "100" + }, + "Flags": 196608, + "HighLimit": { + "currency": "USD", + "issuer": "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", + "value": "500" + }, + "HighNode": "0000000000000000", + "LowLimit": { + "currency": "USD", + "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "value": "500" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "88DA36A0E2F92E2E3504DC7936FDB719769486A6BE1BEC4F1E3B580538D28B4A", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-100" + } + }, + "PreviousTxnID": "951C7AB715ECF4E2B2254F336D9529783AE924E8B4784884E45EA0697ED78B61", + "PreviousTxnLgrSeq": 7 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rPMh7Pi9ct699iZUTWaytJUoHcJ7cgyziK", + "Balance": "999999970", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 4 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "DE3BE7FDF6864FB024807B36BFCB4607E7CDA7D4C155C7AFB4B0973D638938BF", + "PreviousFields": { + "Balance": "999999980", + "Sequence": 3 + }, + "PreviousTxnID": "8D380F8548020FAF6CD42D0E9EDA92B51D4D7DDC4327644893CA1F24688F3715", + "PreviousTxnLgrSeq": 6 + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "status": "success", + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/payment_iou_spend_full_balance.json b/src/utils/test_data/transaction_jsons/payment_iou_spend_full_balance.json new file mode 100644 index 0000000..a3f8dcd --- /dev/null +++ b/src/utils/test_data/transaction_jsons/payment_iou_spend_full_balance.json @@ -0,0 +1,123 @@ +{ + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied.", + "ledger_hash": "605F02CC71269E0C3253FC582503D0A69533DF9E744F1613CB132A67261527F2", + "ledger_index": 10458307, + "status": "closed", + "type": "transaction", + "validated": true, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.545330905250352" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001E8", + "LowLimit": { + "currency": "USD", + "issuer": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "value": "1000000000" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "2F323020B4288ACD4066CC64C89DAD2E4D5DFC2D44571942A51C005BF79D6E25", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.345330905250352" + } + }, + "PreviousTxnID": "24525F80080EAC8857F1A29A47AEF23FD2B0A52DAF7DC3900A4E31831187FCB1", + "PreviousTxnLgrSeq": 10443886 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001E8", + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "1000000000" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "AAE13AF5192EFBFD49A8EEE5869595563FEB73228C0B38FED9CC3D20EE74F399", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.2" + } + }, + "PreviousTxnID": "24525F80080EAC8857F1A29A47AEF23FD2B0A52DAF7DC3900A4E31831187FCB1", + "PreviousTxnLgrSeq": 10443886 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Balance": "99976002", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 3 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C24354B286600B8F28E51233B4AC41A3B4DDD0FDC9BCF96BB171573F6B40A4AE", + "PreviousFields": { + "Balance": "99988002", + "Sequence": 2 + }, + "PreviousTxnID": "A788447CF5FD7108CBF49416E2335F95ED3F5A9FC016686C8F9EFB34BBEA613A", + "PreviousTxnLgrSeq": 10425088 + } + } + ], + "TransactionIndex": 3, + "TransactionResult": "tesSUCCESS" + }, + "transaction": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Amount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0.2" + }, + "Destination": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10458314, + "Sequence": 2, + "SigningPubKey": "039371D0465097AC8F9C02EB60D5599AAD08AADBD623D6D40D642CF2D7C0481B83", + "TransactionType": "Payment", + "TxnSignature": "304502210097A62D87FF08A050F1832B974F06FB4F0C83F6661CC916AE190A439C8DB3863202204CD27C5C6A9067BA5A1DA9BB940FDF3F7C6B073225911E567B1E37E9C29E99D4", + "date": 471639670, + "hash": "5AC7632779C3AE649236F728C2C6811D7ADDE6CCC5018B8754C6EB953FCB1BC5" + } +} diff --git a/src/utils/test_data/transaction_jsons/payment_xrp_create_account.json b/src/utils/test_data/transaction_jsons/payment_xrp_create_account.json new file mode 100644 index 0000000..81807c4 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/payment_xrp_create_account.json @@ -0,0 +1,60 @@ +{ + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied.", + "ledger_hash": "5FA9BBBE9EF6CE4BF9BB56CC3A70106C1475EA4C02EDE26651710FAA46E81F60", + "ledger_index": 10424084, + "meta": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C24354B286600B8F28E51233B4AC41A3B4DDD0FDC9BCF96BB171573F6B40A4AE", + "NewFields": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Balance": "100000000", + "Sequence": 1 + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Balance": "339903994", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 9 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E9A39B0BA8703D5FFD05D9EAD01EE6C0E7A15CF33C2C6B7269107BD2BD535818", + "PreviousFields": { + "Balance": "439915994", + "Sequence": 8 + }, + "PreviousTxnID": "0E6CF1A13C6A804BE50B08C1D0446C7405D8461254CC6B62337CA9FEA4DF13EC", + "PreviousTxnLgrSeq": 10424064 + } + } + ], + "TransactionIndex": 3, + "TransactionResult": "tesSUCCESS" + }, + "status": "closed", + "transaction": { + "Account": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Amount": "100000000", + "Destination": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10424091, + "Sequence": 8, + "SigningPubKey": "03F16A52EBDCA6EBF5D99828E1E6918C64D45E6F136476A8F4757512FE553D18F0", + "TransactionType": "Payment", + "TxnSignature": "304402207676FE35FF0D01E01F13531760658ADECC493181A4EF618A970E4C209FC989C102206660147F17B46469864E9E10152844C4DA62363DB70B5F610E6DAEA87A6781A9", + "date": 471490400, + "hash": "43CAAC76C95358CA2F84EA8BF5BFC327B90B21039A3C69EC4EAC7FEDC54CDB9F" + }, + "type": "transaction", + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/trustline_create.json b/src/utils/test_data/transaction_jsons/trustline_create.json new file mode 100644 index 0000000..ca23820 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/trustline_create.json @@ -0,0 +1,108 @@ +{ + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied.", + "ledger_hash": "CA4C25E271FDB00836A091E8073F6692784BEB116B33675533F9511B17FC2B72", + "ledger_index": 10483144, + "status": "closed", + "type": "transaction", + "validated": true, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "00000000000001F1", + "Owner": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "RootIndex": "6319526CE8F9A8A44D7A870A89DC1B4AD848AA4F066FCB5390A9A268F6E16AEA" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "58E06162628C5E2292DA172A97573FA5613C4A223810686428BF8431B3D67C58" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "84C8F98961F2F10CB1B5C4FB649C18B05A9D3FC20C3A78B75C86CD30D7EAC39C", + "NewFields": { + "Owner": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "RootIndex": "84C8F98961F2F10CB1B5C4FB649C18B05A9D3FC20C3A78B75C86CD30D7EAC39C" + } + } + }, + { + "ModifiedNode": { + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "A3C1529122C3DBD6C96B9DF009FF4896023FE6B4E05A508B1E81F3DCD9A6274B", + "PreviousTxnID": "CA4BD65D1E29552B17041B219105E1BC0FE00837C798DE9F9E2EA670097ACE33", + "PreviousTxnLgrSeq": 10483128 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "RippleState", + "LedgerIndex": "AAE13AF5192EFBFD49A8EEE5869595563FEB73228C0B38FED9CC3D20EE74F399", + "NewFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "10" + }, + "Flags": 65536, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001F2", + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "100" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Balance": "99740302", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 23 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C24354B286600B8F28E51233B4AC41A3B4DDD0FDC9BCF96BB171573F6B40A4AE", + "PreviousFields": { + "Balance": "99752302", + "OwnerCount": 0, + "Sequence": 22 + }, + "PreviousTxnID": "8A3F4CA1D349B4BE896DFDED6B6D0F0DCA4FCA75E082C30A4175813DDB9BCDA6", + "PreviousTxnLgrSeq": 10482869 + } + } + ], + "TransactionIndex": 10, + "TransactionResult": "tesSUCCESS" + }, + "transaction": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10483152, + "LimitAmount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "100" + }, + "Sequence": 22, + "SigningPubKey": "039371D0465097AC8F9C02EB60D5599AAD08AADBD623D6D40D642CF2D7C0481B83", + "TransactionType": "TrustSet", + "TxnSignature": "3044022048862FBF688AFFA81E8A08DB08C2559BB5D7E935B5E4597EE6ADF2E901BC9A6402200B7CDBAD2001CB9797AD56E22D9DA1C23F7F5DC1BB8DB22F013DEE78EAC46BE4", + "date": 471748760, + "hash": "8375C1ED96BB4DD66FD697F34755F9B03DB62CD098627B834028728670CF93EF" + } +} diff --git a/src/utils/test_data/transaction_jsons/trustline_delete.json b/src/utils/test_data/transaction_jsons/trustline_delete.json new file mode 100644 index 0000000..6419d94 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/trustline_delete.json @@ -0,0 +1,156 @@ +{ + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied.", + "ledger_hash": "BFD12A293442E8C083A98092C7A8A199A3732B2360643E40BB8704DE3DF8EA5E", + "ledger_index": 10482869, + "status": "closed", + "type": "transaction", + "validated": true, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.545330905250352" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001E8", + "LowLimit": { + "currency": "USD", + "issuer": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "value": "1000000000" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "2F323020B4288ACD4066CC64C89DAD2E4D5DFC2D44571942A51C005BF79D6E25", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1.525330905250352" + } + }, + "PreviousTxnID": "D1B2B5508585E1BB48E1D76629C59F6368AAB9568457D058486DCC4DCAECCE30", + "PreviousTxnLgrSeq": 10482855 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "00000000000001F1", + "Owner": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "RootIndex": "6319526CE8F9A8A44D7A870A89DC1B4AD848AA4F066FCB5390A9A268F6E16AEA" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "58E06162628C5E2292DA172A97573FA5613C4A223810686428BF8431B3D67C58" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "RootIndex": "84C8F98961F2F10CB1B5C4FB649C18B05A9D3FC20C3A78B75C86CD30D7EAC39C" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "84C8F98961F2F10CB1B5C4FB649C18B05A9D3FC20C3A78B75C86CD30D7EAC39C" + } + }, + { + "ModifiedNode": { + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "A3C1529122C3DBD6C96B9DF009FF4896023FE6B4E05A508B1E81F3DCD9A6274B", + "PreviousTxnID": "758E69A2A2F5E7713ACCA70DC82DD89D7B45B9E020A7E19B9312F0C49A8834BA", + "PreviousTxnLgrSeq": 10482869 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 0, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001F2", + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "0" + }, + "LowNode": "0000000000000000", + "PreviousTxnID": "CA491349DAF4D4EB1E5D2EF1DD4BBC84640C22B4C94C3C9AD40B190151A7878B", + "PreviousTxnLgrSeq": 10482862 + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "AAE13AF5192EFBFD49A8EEE5869595563FEB73228C0B38FED9CC3D20EE74F399", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.02" + }, + "Flags": 65536 + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Balance": "99752302", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 22 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C24354B286600B8F28E51233B4AC41A3B4DDD0FDC9BCF96BB171573F6B40A4AE", + "PreviousFields": { + "Balance": "99764302", + "OwnerCount": 1, + "Sequence": 21 + }, + "PreviousTxnID": "CA491349DAF4D4EB1E5D2EF1DD4BBC84640C22B4C94C3C9AD40B190151A7878B", + "PreviousTxnLgrSeq": 10482862 + } + } + ], + "TransactionIndex": 9, + "TransactionResult": "tesSUCCESS" + }, + "transaction": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Amount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0.02" + }, + "Destination": "rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10482877, + "Sequence": 21, + "SigningPubKey": "039371D0465097AC8F9C02EB60D5599AAD08AADBD623D6D40D642CF2D7C0481B83", + "TransactionType": "Payment", + "TxnSignature": "3045022100E718DDE0149F89CF58FAD1847ED7AD9D61D833E07969A71FA7918D2F6D414AAE022041226ADCB68C2B64CA37AAB4C268922F2EE09DFBF8B234B282E9104643C6351D", + "date": 471747550, + "hash": "8A3F4CA1D349B4BE896DFDED6B6D0F0DCA4FCA75E082C30A4175813DDB9BCDA6" + } +} diff --git a/src/utils/test_data/transaction_jsons/trustline_set_limit.json b/src/utils/test_data/transaction_jsons/trustline_set_limit.json new file mode 100644 index 0000000..c926b72 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/trustline_set_limit.json @@ -0,0 +1,87 @@ +{ + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied.", + "ledger_hash": "BB1814E087367EB56D7EBF0DB99481291894A53FF8B155511C6CC45D57F42E27", + "ledger_index": 10479523, + "status": "closed", + "type": "transaction", + "validated": true, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.02" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001E8", + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "200" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "AAE13AF5192EFBFD49A8EEE5869595563FEB73228C0B38FED9CC3D20EE74F399", + "PreviousFields": { + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "100" + } + }, + "PreviousTxnID": "A9A654F03855FEBD714E49B2C190A62C310081339AA0AA49C38F0B734E81C173", + "PreviousTxnLgrSeq": 10479514 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Balance": "99884302", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 11 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C24354B286600B8F28E51233B4AC41A3B4DDD0FDC9BCF96BB171573F6B40A4AE", + "PreviousFields": { + "Balance": "99896302", + "Sequence": 10 + }, + "PreviousTxnID": "BD850F01540CE35B68C1125E2055BBFEEF961D65AEFBC0CE39CF814685144117", + "PreviousTxnLgrSeq": 10479508 + } + } + ], + "TransactionIndex": 10, + "TransactionResult": "tesSUCCESS" + }, + "transaction": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10479530, + "LimitAmount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "200" + }, + "Sequence": 10, + "SigningPubKey": "039371D0465097AC8F9C02EB60D5599AAD08AADBD623D6D40D642CF2D7C0481B83", + "TransactionType": "TrustSet", + "TxnSignature": "304502210088A7B69070516F1456AE93CC7189C213E60F1E5276F0FFEB64419CFD3A75FDBA02202E852593523240D5BD59B4DF3FAC97E112F75DF712B07E9C9FC64D824E2E0CB2", + "date": 471732720, + "hash": "9F54793122AD0CF1552A4E76991CB481E6FAD467176976500E11EA76CAC9D9EA" + } +} diff --git a/src/utils/test_data/transaction_jsons/trustline_set_limit2.json b/src/utils/test_data/transaction_jsons/trustline_set_limit2.json new file mode 100644 index 0000000..78d1772 --- /dev/null +++ b/src/utils/test_data/transaction_jsons/trustline_set_limit2.json @@ -0,0 +1,107 @@ +{ + "Account": "rsApBGKJmMfExxZBrGnzxEXyq7TMhMRg4e", + "Fee": "10", + "Flags": 0, + "LimitAmount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "300" + }, + "Sequence": 10, + "SigningPubKey": "0337930D40B5A285B7ABC75574FAEC947D1221ABD0155E0D393223DFDA5A7905B2", + "TransactionType": "TrustSet", + "TxnSignature": "30450221009E1A07D8FD71276D776712EDCD044769C7DB0590FDFA90EC405BBFFA2A5B658402207280B2F1DFDFAEF4A52C14D3EB726CF0520FB2B79B4037C0F5FD0DF9D4166A62", + "date": 424538770, + "hash": "09A89A9DB790C553441637C677FF26D3A606C9EDF688447273B2C0B83D98383C", + "inLedger": 1046325, + "ledger_index": 1046325, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "RootIndex": "6319526CE8F9A8A44D7A870A89DC1B4AD848AA4F066FCB5390A9A268F6E16AEA" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "6319526CE8F9A8A44D7A870A89DC1B4AD848AA4F066FCB5390A9A268F6E16AEA" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "RippleState", + "LedgerIndex": "791DCC45D985B40DC7E3BFB7394B5287E8027BCFCE07F5A55A2492738724F97B", + "NewFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 65536, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "LowLimit": { + "currency": "USD", + "issuer": "rsApBGKJmMfExxZBrGnzxEXyq7TMhMRg4e", + "value": "300" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rsApBGKJmMfExxZBrGnzxEXyq7TMhMRg4e", + "Balance": "9248902096", + "Flags": 0, + "OwnerCount": 2, + "Sequence": 11 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "96E491543BAA99142135D2C304174585C285FA44A2896970BAA66EA460F15479", + "PreviousFields": { + "Balance": "9248902106", + "OwnerCount": 1, + "Sequence": 10 + }, + "PreviousTxnID": "C6175CC7CF4B4C875DE991AA2812ABA00EE795CE5547FD70023E3B170BD1030F", + "PreviousTxnLgrSeq": 1043147 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "Balance": "149999980", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 3, + "TransferRate": 1002000000 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "A3C1529122C3DBD6C96B9DF009FF4896023FE6B4E05A508B1E81F3DCD9A6274B", + "PreviousTxnID": "5F338A7BF4C38633C75BED1672E146898904FC8272B45DA7D188716D998B71C5", + "PreviousTxnLgrSeq": 1045132 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rsApBGKJmMfExxZBrGnzxEXyq7TMhMRg4e", + "RootIndex": "AB72F278F646031B4531BE7EC45A78F3693B9375BEA7B2A794ECC32742C87843" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "AB72F278F646031B4531BE7EC45A78F3693B9375BEA7B2A794ECC32742C87843" + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "validated": true +} diff --git a/src/utils/test_data/transaction_jsons/trustline_set_limit_zero.json b/src/utils/test_data/transaction_jsons/trustline_set_limit_zero.json new file mode 100644 index 0000000..e1ce90b --- /dev/null +++ b/src/utils/test_data/transaction_jsons/trustline_set_limit_zero.json @@ -0,0 +1,87 @@ +{ + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied.", + "ledger_hash": "BCA3403873155ECFEB616ED9923D94430CB26EA7206CBCC4F86EACE47B33F950", + "ledger_index": 10460919, + "status": "closed", + "type": "transaction", + "validated": true, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.02" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "00000000000001E8", + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "0" + }, + "LowNode": "0000000000000000" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "AAE13AF5192EFBFD49A8EEE5869595563FEB73228C0B38FED9CC3D20EE74F399", + "PreviousFields": { + "LowLimit": { + "currency": "USD", + "issuer": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "value": "100" + } + }, + "PreviousTxnID": "1BBAC938211E7C2B5A0DD00153557E0A47B38F93AF0F1831C4ECE0E6387B8B96", + "PreviousTxnLgrSeq": 10460914 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Balance": "99940002", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 6 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C24354B286600B8F28E51233B4AC41A3B4DDD0FDC9BCF96BB171573F6B40A4AE", + "PreviousFields": { + "Balance": "99952002", + "Sequence": 5 + }, + "PreviousTxnID": "1BBAC938211E7C2B5A0DD00153557E0A47B38F93AF0F1831C4ECE0E6387B8B96", + "PreviousTxnLgrSeq": 10460914 + } + } + ], + "TransactionIndex": 8, + "TransactionResult": "tesSUCCESS" + }, + "transaction": { + "Account": "rLDYrujdKUfVx28T9vRDAbyJ7G2WVXKo4K", + "Fee": "12000", + "Flags": 2147483648, + "LastLedgerSequence": 10460926, + "LimitAmount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "Sequence": 5, + "SigningPubKey": "039371D0465097AC8F9C02EB60D5599AAD08AADBD623D6D40D642CF2D7C0481B83", + "TransactionType": "TrustSet", + "TxnSignature": "3045022100CAF0DD8A64B68CC9CD44166A381FE07B69AAC5219BB3E90D5A2BD73FB9919DBA022071BE14E0E8ABB0B1841A7A4D1A983C8AC32CFA0E7C9A45FA3565AE5477C076A8", + "date": 471650760, + "hash": "B836ADBA4D77638C5F8C99B5FC0FC6A92D5F82FF3C90759F44773835BAD2AB86" + } +}