Compare commits

..

46 Commits

Author SHA1 Message Date
Mayukha Vadari
61bcb7621f Merge branch 'develop' into ripple/wasmi 2026-03-03 11:18:26 -04:00
Sergey Kuznetsov
5300e65686 tests: Improve stability of Subscribe tests (#6420)
The `Subscribe` tests were flaky, because each test performs some operations (e.g. sends transactions) and waits for messages to appear in subscription with a 100ms timeout. If tests are slow (e.g. compiled in debug mode or a slow machine) then some of them could fail. This change adds an attempt to synchronize the background Env's thread and the test's thread by ensuring that all the scheduled operations are started before the test's thread starts to wait for a websocket message. This is done by limiting I/O threads of the app inside Env to 1 and adding a synchronization barrier after closing the ledger.
2026-03-03 08:46:55 -05:00
Mayukha Vadari
a3f71b1774 Merge branch 'develop' into ripple/wasmi 2026-03-02 17:06:17 -05:00
Alex Kremer
afc660a1b5 refactor: Fix clang-tidy bugprone-empty-catch check (#6419)
This change fixes or suppresses instances detected by the `bugprone-empty-catch` clang-tidy check.
2026-03-02 17:08:56 +00:00
Mayukha Vadari
b08bcf5d21 Merge branch 'develop' into ripple/wasmi 2026-02-27 16:41:44 -05:00
Vito Tumas
1a7f824b89 refactor: Splits invariant checks into multiple classes (#6440)
The invariant check system had grown into a single monolithic file pair containing 24 invariant checker classes. The large `InvariantCheck.cpp` file was a frequent source of merge conflicts and difficult to navigate. This refactoring improves maintainability and readability with zero behavioral changes.

In particular, this change:
- Splits `InvariantCheck.h` and `InvariantCheck.cpp` into 10 focused header/source pairs organized by domain under a new `invariants/` subdirectory.
- Extracts the shared `Privilege` enum and `hasPrivilege()` function into a dedicated `InvariantCheckPrivilege.h` header, so domain-specific files can reference them independently.
2026-02-27 21:02:39 +00:00
Mayukha Vadari
77dfd56ace Merge branch 'develop' into ripple/wasmi 2026-02-27 13:49:25 -05:00
Sergey Kuznetsov
b58c681189 chore: Make nix hook optional (#6431)
This change makes the `nix` pre-commit hook optional in development environments, and enforced only inside Github Actions.
2026-02-27 13:36:10 -05:00
Mayukha Vadari
404f35d556 test: Grep for failures in CI (#6339)
This change adjusts the CI tests to make it easier to spot errors, without needing to sift through the thousands of lines of output.
2026-02-27 03:01:38 +00:00
Alex Kremer
2e595b6031 chore: Enable clang-tidy checks without issues (#6414)
This change enables all clang-tidy checks that are already passing. It also modifies the clang-tidy CI job, so it runs against all files if .clang-tidy changed.
2026-02-26 18:26:58 +00:00
Bart
3a8a18c2ca refactor: Use uint256 directly as key instead of void pointer (#6313)
This change replaces `void const*` by `uint256 const&` for database fetches.

Object hashes are expressed using the `uint256` data type, and are converted to `void *` when calling the `fetch` or `fetchBatch` functions. However, in these fetch functions they are converted back to `uint256`, making the conversion process unnecessary. In a few cases the underlying pointer is needed, but that can then be easy obtained via `[hash variable].data()`.
2026-02-25 18:23:34 -05:00
Ayaz Salikhov
65e63ebef3 chore: Update cleanup-workspace to delete old .conan2 dir on macOS (#6412) 2026-02-25 01:12:16 +00:00
Valentin Balaschenko
bdd106d992 Explicitly trim the heap after cache sweeps (#6022)
Limited to Linux/glibc builds.
2026-02-24 21:33:13 +00:00
Valentin Balaschenko
24cbaf76a5 ci: Update prepare-runner action to fix macOS build environment (empty)
Updates XRPLF/actions prepare-runner to version 2cbf48101 which fixes
pip upgrade failures on macOS runners with Homebrew-managed Python.

* This commit was cherry-picked from "release-3.1", but ended up empty
  because the changes are already present. It is included only for
  accounting - to indicate that all changes/commits from the previous
  release will be in the next one.
2026-02-24 12:52:32 -05:00
Valentin Balaschenko
3a805cc646 Disable featureBatch and fixBatchInnerSigs amendments (#6402) 2026-02-24 12:49:59 -05:00
Mayukha Vadari
9c3c0280b1 Merge branch 'develop' into ripple/wasmi 2026-02-18 12:35:51 -05:00
Mayukha Vadari
bd16f7989d Merge branch 'develop' into ripple/wasmi 2026-02-10 17:26:33 -05:00
Mayukha Vadari
2ec4a1114e Merge branch 'develop' into ripple/wasmi 2026-02-04 18:13:00 -05:00
Mayukha Vadari
b2627039f6 Merge branch 'develop' into ripple/wasmi 2026-02-03 14:51:59 -05:00
Mayukha Vadari
e85e7b1b1a Merge branch 'develop' into ripple/wasmi 2026-01-29 13:53:55 -05:00
Mayukha Vadari
72fffb6e51 Merge branch 'develop' into ripple/wasmi 2026-01-28 15:56:18 -05:00
Mayukha Vadari
f7ee580f01 Merge commit '5f638f55536def0d88b970d1018a465a238e55f4' into ripple/wasmi 2026-01-28 15:56:11 -05:00
Mayukha Vadari
122d405750 Merge commit '92046785d1fea5f9efe5a770d636792ea6cab78b' into ripple/wasmi 2026-01-28 15:56:04 -05:00
Mayukha Vadari
d7ed6d6512 Merge branch 'develop' into ripple/wasmi 2026-01-27 13:26:39 -05:00
Mayukha Vadari
8bc6f9cd70 Merge branch 'develop' into ripple/wasmi 2026-01-23 13:13:11 -05:00
Mayukha Vadari
ed5139d4e3 Merge branch 'develop' into ripple/wasmi 2026-01-21 12:57:29 -05:00
Mayukha Vadari
7a9d245950 Merge branch 'develop' into ripple/wasmi 2026-01-14 13:01:35 -05:00
Olek
d83ec96848 Switch to wasmi v1.0.6 (#6204) 2026-01-12 13:36:02 -05:00
Mayukha Vadari
419d53ec4c Merge branch 'develop' into ripple/wasmi 2026-01-12 13:10:58 -05:00
Mayukha Vadari
d4d70d5675 Merge branch 'develop' into ripple/wasmi 2026-01-12 12:27:48 -05:00
Mayukha Vadari
bbc28b3b1c Merge branch 'develop' into ripple/wasmi 2026-01-08 11:42:28 -05:00
Mayukha Vadari
5aab274b7a Merge branch 'develop' into ripple/wasmi 2026-01-07 16:52:10 -05:00
Mayukha Vadari
2c30e41191 use the develop hashes 2026-01-07 16:50:45 -05:00
Mayukha Vadari
8ea5106b0b Merge branch 'develop' into ripple/wasmi 2026-01-07 14:34:49 -05:00
Mayukha Vadari
1977df9c2e Merge remote-tracking branch 'upstream/develop' into ripple/wasmi 2026-01-05 18:43:49 -05:00
Mayukha Vadari
6c95548df5 Merge remote-tracking branch 'upstream/develop' into ripple/wasmi 2025-12-22 15:51:19 -08:00
Mayukha Vadari
90e0bbd0fc Merge branch 'develop' into ripple/wasmi 2025-12-08 14:28:41 -05:00
Olek
b57df290de Use conan repo for wasmi lib (#6109)
* Use conan repo for wasmi lib
* Generate lockfile
2025-12-08 13:02:01 -05:00
Mayukha Vadari
8a403f1241 Merge branch 'develop' into ripple/wasmi 2025-12-05 14:32:48 -05:00
Mayukha Vadari
6d2640871d Merge branch 'develop' into ripple/wasmi 2025-12-02 18:40:54 -05:00
Olek
500bb68831 Fix win build (#6076) 2025-11-24 16:56:23 -05:00
Mayukha Vadari
16087c9680 fix merge issue 2025-11-25 02:57:47 +05:30
Mayukha Vadari
25c3060fef remove conan.lock (temporary) 2025-11-25 02:40:57 +05:30
Mayukha Vadari
ce9f0b38a4 Merge branch 'develop' into ripple/wasmi 2025-11-25 02:33:47 +05:30
Mayukha Vadari
35f7cbf772 update 2025-11-25 02:31:51 +05:30
Mayukha Vadari
0db564d261 WASMI data 2025-11-04 15:57:07 -05:00
196 changed files with 5300 additions and 31754 deletions

View File

@@ -1,105 +1,143 @@
---
Checks: "-*,
bugprone-argument-comment
bugprone-argument-comment,
bugprone-assert-side-effect,
bugprone-bad-signal-to-kill-thread,
bugprone-bool-pointer-implicit-conversion,
bugprone-casting-through-void,
bugprone-chained-comparison,
bugprone-compare-pointer-to-member-virtual-function,
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-empty-catch,
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-inaccurate-erase,
bugprone-incorrect-enable-if,
bugprone-incorrect-roundings,
bugprone-infinite-loop,
bugprone-integer-division,
bugprone-lambda-function-name,
bugprone-macro-parentheses,
bugprone-macro-repeated-side-effects,
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-multi-level-implicit-pointer-conversion,
bugprone-multiple-new-in-one-expression,
bugprone-multiple-statement-macro,
bugprone-no-escape,
bugprone-non-zero-enum-to-bool-conversion,
bugprone-parent-virtual-call,
bugprone-posix-return,
bugprone-redundant-branch-condition,
bugprone-shared-ptr-array-mismatch,
bugprone-signal-handler,
bugprone-signed-char-misuse,
bugprone-sizeof-container,
bugprone-spuriously-wake-up-functions,
bugprone-standalone-empty,
bugprone-string-constructor,
bugprone-string-integer-assignment,
bugprone-string-literal-with-embedded-nul,
bugprone-stringview-nullptr,
bugprone-suspicious-enum-usage,
bugprone-suspicious-include,
bugprone-suspicious-memory-comparison,
bugprone-suspicious-memset-usage,
bugprone-suspicious-realloc-usage,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-swapped-arguments,
bugprone-terminating-continue,
bugprone-throw-keyword-missing,
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
bugprone-unhandled-exception-at-new,
bugprone-unique-ptr-array-mismatch,
bugprone-unsafe-functions,
bugprone-virtual-near-miss,
cppcoreguidelines-no-suspend-with-lock,
cppcoreguidelines-virtual-class-destructor,
hicpp-ignored-remove-result,
misc-definitions-in-headers,
misc-header-include-cycle,
misc-misplaced-const,
misc-static-assert,
misc-throw-by-value-catch-by-reference,
misc-unused-alias-decls,
misc-unused-using-decls,
readability-duplicate-include,
readability-enum-initial-value,
readability-misleading-indentation,
readability-non-const-parameter,
readability-redundant-declaration,
readability-reference-to-constructed-temporary,
modernize-deprecated-headers,
modernize-make-shared,
modernize-make-unique,
performance-implicit-conversion-in-loop,
performance-move-constructor-init,
performance-trivially-destructible
"
# bugprone-assert-side-effect,
# bugprone-bad-signal-to-kill-thread,
# bugprone-bool-pointer-implicit-conversion,
# bugprone-casting-through-void,
# bugprone-chained-comparison,
# bugprone-compare-pointer-to-member-virtual-function,
# bugprone-copy-constructor-init,
# ---
# checks that have some issues that need to be resolved:
#
# bugprone-crtp-constructor-accessibility,
# bugprone-dangling-handle,
# bugprone-dynamic-static-initializers,
# bugprone-empty-catch,
# bugprone-fold-init-type,
# bugprone-forward-declaration-namespace,
# bugprone-inaccurate-erase,
# bugprone-inc-dec-in-conditions,
# bugprone-incorrect-enable-if,
# bugprone-incorrect-roundings,
# bugprone-infinite-loop,
# bugprone-integer-division,
# bugprone-lambda-function-name,
# bugprone-macro-parentheses,
# bugprone-macro-repeated-side-effects,
# bugprone-misplaced-operator-in-strlen-in-alloc,
# bugprone-misplaced-pointer-arithmetic-in-alloc,
# bugprone-misplaced-widening-cast,
# bugprone-move-forwarding-reference,
# bugprone-multi-level-implicit-pointer-conversion,
# bugprone-multiple-new-in-one-expression,
# bugprone-multiple-statement-macro,
# bugprone-no-escape,
# bugprone-non-zero-enum-to-bool-conversion,
# bugprone-optional-value-conversion,
# bugprone-parent-virtual-call,
# bugprone-pointer-arithmetic-on-polymorphic-object,
# bugprone-posix-return,
# bugprone-redundant-branch-condition,
# bugprone-reserved-identifier,
# bugprone-return-const-ref-from-parameter,
# bugprone-shared-ptr-array-mismatch,
# bugprone-signal-handler,
# bugprone-signed-char-misuse,
# bugprone-sizeof-container,
# bugprone-sizeof-expression,
# bugprone-spuriously-wake-up-functions,
# bugprone-standalone-empty,
# bugprone-string-constructor,
# bugprone-string-integer-assignment,
# bugprone-string-literal-with-embedded-nul,
# bugprone-stringview-nullptr,
# bugprone-suspicious-enum-usage,
# bugprone-suspicious-include,
# bugprone-suspicious-memory-comparison,
# bugprone-suspicious-memset-usage,
# bugprone-suspicious-missing-comma,
# bugprone-suspicious-realloc-usage,
# bugprone-suspicious-semicolon,
# bugprone-suspicious-string-compare,
# bugprone-suspicious-stringview-data-usage,
# bugprone-swapped-arguments,
# bugprone-switch-missing-default-case,
# bugprone-terminating-continue,
# bugprone-throw-keyword-missing,
# bugprone-too-small-loop-variable,
# bugprone-undefined-memory-manipulation,
# bugprone-undelegated-constructor,
# bugprone-unhandled-exception-at-new,
# bugprone-unhandled-self-assignment,
# bugprone-unique-ptr-array-mismatch,
# bugprone-unsafe-functions,
# bugprone-move-forwarding-reference,
# bugprone-unused-local-non-trivial-variable,
# bugprone-unused-raii,
# bugprone-return-const-ref-from-parameter,
# bugprone-switch-missing-default-case,
# bugprone-sizeof-expression,
# bugprone-suspicious-stringview-data-usage,
# bugprone-suspicious-missing-comma,
# bugprone-pointer-arithmetic-on-polymorphic-object,
# bugprone-optional-value-conversion,
# bugprone-too-small-loop-variable,
# bugprone-unused-return-value,
# bugprone-use-after-move,
# bugprone-virtual-near-miss,
# cppcoreguidelines-init-variables,
# bugprone-unhandled-self-assignment,
# bugprone-unused-raii,
#
# cppcoreguidelines-misleading-capture-default-by-value,
# cppcoreguidelines-no-suspend-with-lock,
# cppcoreguidelines-init-variables,
# cppcoreguidelines-pro-type-member-init,
# cppcoreguidelines-pro-type-static-cast-downcast,
# cppcoreguidelines-rvalue-reference-param-not-moved,
# cppcoreguidelines-use-default-member-init,
# cppcoreguidelines-virtual-class-destructor,
# hicpp-ignored-remove-result,
# cppcoreguidelines-rvalue-reference-param-not-moved,
#
# llvm-namespace-comment,
# misc-const-correctness,
# misc-definitions-in-headers,
# misc-header-include-cycle,
# misc-include-cleaner,
# misc-misplaced-const,
# misc-redundant-expression,
# misc-static-assert,
# misc-throw-by-value-catch-by-reference,
# misc-unused-alias-decls,
# misc-unused-using-decls,
#
# readability-avoid-nested-conditional-operator,
# readability-avoid-return-with-void-value,
# readability-braces-around-statements,
# readability-container-contains,
# readability-container-size-empty,
# readability-convert-member-functions-to-static,
# readability-const-return-type,
# readability-else-after-return,
# readability-implicit-bool-conversion,
# readability-inconsistent-declaration-parameter-name,
# readability-identifier-naming,
# readability-make-member-function-const,
# readability-math-missing-parentheses,
# readability-redundant-inline-specifier,
# readability-redundant-member-init,
# readability-redundant-casting,
# readability-redundant-string-init,
# readability-simplify-boolean-expr,
# readability-static-definition-in-anonymous-namespace,
# readability-suspicious-call-argument,
# readability-use-std-min-max,
# readability-static-accessed-through-instance,
#
# modernize-concat-nested-namespaces,
# modernize-deprecated-headers,
# modernize-make-shared,
# modernize-make-unique,
# modernize-pass-by-value,
# modernize-type-traits,
# modernize-use-designated-initializers,
@@ -111,79 +149,50 @@ Checks: "-*,
# modernize-use-starts-ends-with,
# modernize-use-std-numbers,
# modernize-use-using,
#
# performance-faster-string-find,
# performance-for-range-copy,
# performance-implicit-conversion-in-loop,
# performance-inefficient-vector-operation,
# performance-move-const-arg,
# performance-move-constructor-init,
# performance-no-automatic-move,
# performance-trivially-destructible,
# readability-avoid-nested-conditional-operator,
# readability-avoid-return-with-void-value,
# readability-braces-around-statements,
# readability-const-return-type,
# readability-container-contains,
# readability-container-size-empty,
# readability-convert-member-functions-to-static,
# readability-duplicate-include,
# readability-else-after-return,
# readability-enum-initial-value,
# readability-implicit-bool-conversion,
# readability-inconsistent-declaration-parameter-name,
# readability-identifier-naming,
# readability-make-member-function-const,
# readability-math-missing-parentheses,
# readability-misleading-indentation,
# readability-non-const-parameter,
# readability-redundant-casting,
# readability-redundant-declaration,
# readability-redundant-inline-specifier,
# readability-redundant-member-init,
# readability-redundant-string-init,
# readability-reference-to-constructed-temporary,
# readability-simplify-boolean-expr,
# readability-static-accessed-through-instance,
# readability-static-definition-in-anonymous-namespace,
# readability-suspicious-call-argument,
# readability-use-std-min-max
# ---
#
# CheckOptions:
# readability-braces-around-statements.ShortStatementLines: 2
# readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
# readability-identifier-naming.ClassCase: CamelCase
# readability-identifier-naming.StructCase: CamelCase
# readability-identifier-naming.UnionCase: CamelCase
# readability-identifier-naming.EnumCase: CamelCase
# readability-identifier-naming.EnumConstantCase: CamelCase
# readability-identifier-naming.ScopedEnumConstantCase: CamelCase
# readability-identifier-naming.GlobalConstantCase: UPPER_CASE
# readability-identifier-naming.GlobalConstantPrefix: "k"
# readability-identifier-naming.GlobalVariableCase: CamelCase
# readability-identifier-naming.GlobalVariablePrefix: "g"
# readability-identifier-naming.ConstexprFunctionCase: camelBack
# readability-identifier-naming.ConstexprMethodCase: camelBack
# readability-identifier-naming.ClassMethodCase: camelBack
# readability-identifier-naming.ClassMemberCase: camelBack
# readability-identifier-naming.ClassConstantCase: UPPER_CASE
# readability-identifier-naming.ClassConstantPrefix: "k"
# readability-identifier-naming.StaticConstantCase: UPPER_CASE
# readability-identifier-naming.StaticConstantPrefix: "k"
# readability-identifier-naming.StaticVariableCase: UPPER_CASE
# readability-identifier-naming.StaticVariablePrefix: "k"
# readability-identifier-naming.ConstexprVariableCase: UPPER_CASE
# readability-identifier-naming.ConstexprVariablePrefix: "k"
# readability-identifier-naming.LocalConstantCase: camelBack
# readability-identifier-naming.LocalVariableCase: camelBack
# readability-identifier-naming.TemplateParameterCase: CamelCase
# readability-identifier-naming.ParameterCase: camelBack
# readability-identifier-naming.FunctionCase: camelBack
# readability-identifier-naming.MemberCase: camelBack
# readability-identifier-naming.PrivateMemberSuffix: _
# readability-identifier-naming.ProtectedMemberSuffix: _
# readability-identifier-naming.PublicMemberSuffix: ""
# readability-identifier-naming.FunctionIgnoredRegexp: ".*tag_invoke.*"
# bugprone-unsafe-functions.ReportMoreUnsafeFunctions: true
CheckOptions:
# readability-braces-around-statements.ShortStatementLines: 2
# readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
# readability-identifier-naming.ClassCase: CamelCase
# readability-identifier-naming.StructCase: CamelCase
# readability-identifier-naming.UnionCase: CamelCase
# readability-identifier-naming.EnumCase: CamelCase
# readability-identifier-naming.EnumConstantCase: CamelCase
# readability-identifier-naming.ScopedEnumConstantCase: CamelCase
# readability-identifier-naming.GlobalConstantCase: UPPER_CASE
# readability-identifier-naming.GlobalConstantPrefix: "k"
# readability-identifier-naming.GlobalVariableCase: CamelCase
# readability-identifier-naming.GlobalVariablePrefix: "g"
# readability-identifier-naming.ConstexprFunctionCase: camelBack
# readability-identifier-naming.ConstexprMethodCase: camelBack
# readability-identifier-naming.ClassMethodCase: camelBack
# readability-identifier-naming.ClassMemberCase: camelBack
# readability-identifier-naming.ClassConstantCase: UPPER_CASE
# readability-identifier-naming.ClassConstantPrefix: "k"
# readability-identifier-naming.StaticConstantCase: UPPER_CASE
# readability-identifier-naming.StaticConstantPrefix: "k"
# readability-identifier-naming.StaticVariableCase: UPPER_CASE
# readability-identifier-naming.StaticVariablePrefix: "k"
# readability-identifier-naming.ConstexprVariableCase: UPPER_CASE
# readability-identifier-naming.ConstexprVariablePrefix: "k"
# readability-identifier-naming.LocalConstantCase: camelBack
# readability-identifier-naming.LocalVariableCase: camelBack
# readability-identifier-naming.TemplateParameterCase: CamelCase
# readability-identifier-naming.ParameterCase: camelBack
# readability-identifier-naming.FunctionCase: camelBack
# readability-identifier-naming.MemberCase: camelBack
# readability-identifier-naming.PrivateMemberSuffix: _
# readability-identifier-naming.ProtectedMemberSuffix: _
# readability-identifier-naming.PublicMemberSuffix: ""
# readability-identifier-naming.FunctionIgnoredRegexp: ".*tag_invoke.*"
bugprone-unsafe-functions.ReportMoreUnsafeFunctions: true
# bugprone-unused-return-value.CheckedReturnTypes: ::std::error_code;::std::error_condition;::std::errc
# misc-include-cleaner.IgnoreHeaders: '.*/(detail|impl)/.*;.*(expected|unexpected).*;.*ranges_lower_bound\.h;time.h;stdlib.h;__chrono/.*;fmt/chrono.h;boost/uuid/uuid_hash.hpp'
#

View File

@@ -11,7 +11,7 @@ on:
jobs:
# Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks.
run-hooks:
uses: XRPLF/actions/.github/workflows/pre-commit.yml@320be44621ca2a080f05aeb15817c44b84518108
uses: XRPLF/actions/.github/workflows/pre-commit.yml@56de1bdf19639e009639a50b8d17c28ca954f267
with:
runs_on: ubuntu-latest
container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-41ec7c1" }'

View File

@@ -101,7 +101,7 @@ jobs:
steps:
- name: Cleanup workspace (macOS and Windows)
if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }}
uses: XRPLF/actions/cleanup-workspace@cf0433aa74563aead044a1e395610c96d65a37cf
uses: XRPLF/actions/cleanup-workspace@c7d9ce5ebb03c752a354889ecd870cadfc2b1cd4
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -229,8 +229,21 @@ jobs:
env:
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
run: |
./xrpld --unittest --unittest-jobs "${BUILD_NPROC}"
set -o pipefail
./xrpld --unittest --unittest-jobs "${BUILD_NPROC}" 2>&1 | tee unittest.log
- name: Show test failure summary
if: ${{ failure() && !inputs.build_only }}
working-directory: ${{ runner.os == 'Windows' && format('{0}/{1}', env.BUILD_DIR, inputs.build_type) || env.BUILD_DIR }}
run: |
if [ ! -f unittest.log ]; then
echo "unittest.log not found; embedded tests may not have run."
exit 0
fi
if ! grep -E "failed" unittest.log; then
echo "Log present but no failure lines found in unittest.log."
fi
- name: Debug failure (Linux)
if: ${{ failure() && runner.os == 'Linux' && !inputs.build_only }}
run: |

View File

@@ -78,9 +78,9 @@ jobs:
id: run_clang_tidy
continue-on-error: true
env:
FILES: ${{ inputs.files }}
TARGETS: ${{ inputs.files != '' && inputs.files || 'src tests' }}
run: |
run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "$BUILD_DIR" $FILES 2>&1 | tee clang-tidy-output.txt
run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" ${TARGETS} 2>&1 | tee clang-tidy-output.txt
- name: Upload clang-tidy output
if: steps.run_clang_tidy.outcome != 'success'

View File

@@ -22,7 +22,8 @@ jobs:
if: ${{ inputs.check_only_changed }}
runs-on: ubuntu-latest
outputs:
any_changed: ${{ steps.changed_files.outputs.any_changed }}
clang_tidy_config_changed: ${{ steps.changed_clang_tidy.outputs.any_changed }}
any_cpp_changed: ${{ steps.changed_files.outputs.any_changed }}
all_changed_files: ${{ steps.changed_files.outputs.all_changed_files }}
steps:
- name: Checkout repository
@@ -38,10 +39,17 @@ jobs:
**/*.ipp
separator: " "
- name: Get changed clang-tidy configuration
id: changed_clang_tidy
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
with:
files: |
.clang-tidy
run-clang-tidy:
needs: [determine-files]
if: ${{ always() && !cancelled() && (!inputs.check_only_changed || needs.determine-files.outputs.any_changed == 'true') }}
if: ${{ always() && !cancelled() && (!inputs.check_only_changed || needs.determine-files.outputs.any_cpp_changed == 'true' || needs.determine-files.outputs.clang_tidy_config_changed == 'true') }}
uses: ./.github/workflows/reusable-clang-tidy-files.yml
with:
files: ${{ inputs.check_only_changed && needs.determine-files.outputs.all_changed_files || '' }}
files: ${{ (needs.determine-files.outputs.clang_tidy_config_changed == 'true' && '') || (inputs.check_only_changed && needs.determine-files.outputs.all_changed_files || '') }}
create_issue_on_failure: ${{ inputs.create_issue_on_failure }}

View File

@@ -64,7 +64,7 @@ jobs:
steps:
- name: Cleanup workspace (macOS and Windows)
if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }}
uses: XRPLF/actions/cleanup-workspace@cf0433aa74563aead044a1e395610c96d65a37cf
uses: XRPLF/actions/cleanup-workspace@c7d9ce5ebb03c752a354889ecd870cadfc2b1cd4
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

3
.gitignore vendored
View File

@@ -80,6 +80,3 @@ DerivedData
# clangd cache
/.cache
# python cache
__pycache__

View File

@@ -14,11 +14,8 @@ repos:
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: trailing-whitespace
exclude: ^include/xrpl/protocol_autogen/(transactions|ledger_objects)/
- id: end-of-file-fixer
exclude: ^include/xrpl/protocol_autogen/(transactions|ledger_objects)/
- id: mixed-line-ending
exclude: ^include/xrpl/protocol_autogen/(transactions|ledger_objects)/
- id: check-merge-conflict
args: [--assume-in-merge]
@@ -28,7 +25,6 @@ repos:
- id: clang-format
args: [--style=file]
"types_or": [c++, c, proto]
exclude: ^include/xrpl/protocol_autogen/(transactions|ledger_objects)/
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: e2c2116d86a80e72e7146a06e68b7c228afc6319 # frozen: v0.6.13
@@ -50,7 +46,7 @@ repos:
rev: 1cfa010f078c354f3ffb8413616280cc28f5ba21 # frozen: v9.4.0
hooks:
- id: cspell # Spell check changed files
exclude: (.config/cspell.config.yaml|^include/xrpl/protocol_autogen/(transactions|ledger_objects)/)
exclude: .config/cspell.config.yaml
- id: cspell # Spell check the commit message
name: check commit message spelling
args:
@@ -65,7 +61,15 @@ repos:
hooks:
- id: nix-fmt
name: Format Nix files
entry: nix --extra-experimental-features 'nix-command flakes' fmt
entry: |
bash -c '
if command -v nix &> /dev/null || [ "$GITHUB_ACTIONS" = "true" ]; then
nix --extra-experimental-features "nix-command flakes" fmt "$@"
else
echo "Skipping nix-fmt: nix not installed and not in GitHub Actions"
exit 0
fi
' --
language: system
types:
- nix

View File

@@ -106,6 +106,7 @@ find_package(OpenSSL REQUIRED)
find_package(secp256k1 REQUIRED)
find_package(SOCI REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(wasmi REQUIRED)
find_package(xxHash REQUIRED)
target_link_libraries(

View File

@@ -251,6 +251,29 @@ pip3 install pre-commit
pre-commit install
```
## Clang-tidy
All code must pass `clang-tidy` checks according to the settings in [`.clang-tidy`](./.clang-tidy).
There is a Continuous Integration job that runs clang-tidy on pull requests. The CI will check:
- All changed C++ files (`.cpp`, `.h`, `.ipp`) when only code files are modified
- **All files in the repository** when the `.clang-tidy` configuration file is changed
This ensures that configuration changes don't introduce new warnings across the codebase.
### Running clang-tidy locally
Before running clang-tidy, you must build the project to generate required files (particularly protobuf headers). Refer to [`BUILD.md`](./BUILD.md) for build instructions.
Then run clang-tidy on your local changes:
```
run-clang-tidy -p build src tests
```
This will check all source files in the `src` and `tests` directories using the compile commands from your `build` directory.
## Contracts and instrumentation
We are using [Antithesis](https://antithesis.com/) for continuous fuzzing,

View File

@@ -47,6 +47,7 @@ target_link_libraries(
Xrpl::opts
Xrpl::syslibs
secp256k1::secp256k1
wasmi::wasmi
xrpl.libpb
xxHash::xxhash
$<$<BOOL:${voidstar}>:antithesis-sdk-cpp>)
@@ -74,23 +75,15 @@ add_module(xrpl protocol)
target_link_libraries(xrpl.libxrpl.protocol PUBLIC xrpl.libxrpl.crypto xrpl.libxrpl.json)
# Level 05
## Set up code generation for protocol_autogen module
include(XrplProtocolAutogen)
setup_protocol_autogen()
add_module(xrpl protocol_autogen)
target_link_libraries(xrpl.libxrpl.protocol_autogen PUBLIC xrpl.libxrpl.protocol)
# Level 06
add_module(xrpl core)
target_link_libraries(xrpl.libxrpl.core PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json
xrpl.libxrpl.protocol xrpl.libxrpl.protocol_autogen)
xrpl.libxrpl.protocol)
# Level 07
# Level 06
add_module(xrpl resource)
target_link_libraries(xrpl.libxrpl.resource PUBLIC xrpl.libxrpl.protocol)
# Level 08
# Level 07
add_module(xrpl net)
target_link_libraries(xrpl.libxrpl.net PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json
xrpl.libxrpl.protocol xrpl.libxrpl.resource)
@@ -119,7 +112,6 @@ target_link_libraries(
PUBLIC xrpl.libxrpl.basics
xrpl.libxrpl.json
xrpl.libxrpl.protocol
xrpl.libxrpl.protocol_autogen
xrpl.libxrpl.rdb
xrpl.libxrpl.server
xrpl.libxrpl.shamap
@@ -149,7 +141,6 @@ target_link_modules(
net
nodestore
protocol
protocol_autogen
rdb
resource
server

View File

@@ -29,7 +29,6 @@ install(TARGETS common
xrpl.libxrpl.net
xrpl.libxrpl.nodestore
xrpl.libxrpl.protocol
xrpl.libxrpl.protocol_autogen
xrpl.libxrpl.resource
xrpl.libxrpl.server
xrpl.libxrpl.shamap

View File

@@ -1,155 +0,0 @@
#[===================================================================[
Protocol Autogen - Code generation for protocol wrapper classes
#]===================================================================]
# Options for code generation
set(CODEGEN_VENV_DIR
""
CACHE PATH
"Path to Python virtual environment for code generation. If provided, automatic venv setup is skipped."
)
# Function to set up code generation for protocol_autogen module
# This runs at configure time to generate C++ wrapper classes from macro files
function (setup_protocol_autogen)
# Directory paths
set(MACRO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol/detail")
set(AUTOGEN_HEADER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol_autogen")
set(SCRIPTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/scripts")
# Input macro files
set(TRANSACTIONS_MACRO "${MACRO_DIR}/transactions.macro")
set(LEDGER_ENTRIES_MACRO "${MACRO_DIR}/ledger_entries.macro")
set(SFIELDS_MACRO "${MACRO_DIR}/sfields.macro")
# Python scripts
set(GENERATE_TX_SCRIPT "${SCRIPTS_DIR}/generate_tx_classes.py")
set(GENERATE_LEDGER_SCRIPT "${SCRIPTS_DIR}/generate_ledger_classes.py")
set(REQUIREMENTS_FILE "${SCRIPTS_DIR}/requirements.txt")
# Create output directories
file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/transactions")
file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/ledger_objects")
# Find Python3 - check if already found by Conan or find it ourselves
if (NOT Python3_EXECUTABLE)
find_package(Python3 COMPONENTS Interpreter QUIET)
endif ()
if (NOT Python3_EXECUTABLE)
# Try finding python3 executable directly
find_program(Python3_EXECUTABLE NAMES python3 python)
endif ()
if (NOT Python3_EXECUTABLE)
message(FATAL_ERROR "Python3 not found. Code generation cannot proceed.")
return()
endif ()
message(STATUS "Using Python3 for code generation: ${Python3_EXECUTABLE}")
# Set up Python virtual environment for code generation
if (CODEGEN_VENV_DIR)
# User-provided venv - skip automatic setup
set(VENV_DIR "${CODEGEN_VENV_DIR}")
message(STATUS "Using user-provided Python venv: ${VENV_DIR}")
else ()
# Use default venv in build directory
set(VENV_DIR "${CMAKE_CURRENT_BINARY_DIR}/codegen_venv")
endif ()
# Determine the Python executable path in the venv
if (WIN32)
set(VENV_PYTHON "${VENV_DIR}/Scripts/python.exe")
set(VENV_PIP "${VENV_DIR}/Scripts/pip.exe")
else ()
set(VENV_PYTHON "${VENV_DIR}/bin/python")
set(VENV_PIP "${VENV_DIR}/bin/pip")
endif ()
# Only auto-setup venv if not user-provided
if (NOT CODEGEN_VENV_DIR)
# Check if venv needs to be created or updated
set(VENV_NEEDS_UPDATE FALSE)
if (NOT EXISTS "${VENV_PYTHON}")
set(VENV_NEEDS_UPDATE TRUE)
message(STATUS "Creating Python virtual environment for code generation...")
elseif ("${REQUIREMENTS_FILE}" IS_NEWER_THAN "${VENV_DIR}/.requirements_installed")
set(VENV_NEEDS_UPDATE TRUE)
message(STATUS "Updating Python virtual environment (requirements changed)...")
endif ()
# Create/update virtual environment if needed
if (VENV_NEEDS_UPDATE)
message(STATUS "Setting up Python virtual environment at ${VENV_DIR}")
execute_process(COMMAND ${Python3_EXECUTABLE} -m venv "${VENV_DIR}"
RESULT_VARIABLE VENV_RESULT ERROR_VARIABLE VENV_ERROR)
if (NOT VENV_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to create virtual environment: ${VENV_ERROR}")
endif ()
message(STATUS "Installing Python dependencies...")
execute_process(COMMAND ${VENV_PIP} install --upgrade pip
RESULT_VARIABLE PIP_UPGRADE_RESULT OUTPUT_QUIET
ERROR_VARIABLE PIP_UPGRADE_ERROR)
if (NOT PIP_UPGRADE_RESULT EQUAL 0)
message(WARNING "Failed to upgrade pip: ${PIP_UPGRADE_ERROR}")
endif ()
execute_process(COMMAND ${VENV_PIP} install -r "${REQUIREMENTS_FILE}"
RESULT_VARIABLE PIP_INSTALL_RESULT ERROR_VARIABLE PIP_INSTALL_ERROR)
if (NOT PIP_INSTALL_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to install Python dependencies: ${PIP_INSTALL_ERROR}")
endif ()
# Mark requirements as installed
file(TOUCH "${VENV_DIR}/.requirements_installed")
message(STATUS "Python virtual environment ready")
endif ()
endif ()
# Generate transaction classes at configure time
message(STATUS "Generating transaction classes from transactions.macro...")
execute_process(COMMAND ${VENV_PYTHON} "${GENERATE_TX_SCRIPT}" "${TRANSACTIONS_MACRO}"
--header-dir "${AUTOGEN_HEADER_DIR}/transactions" --sfields-macro
"${SFIELDS_MACRO}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE TX_GEN_RESULT
OUTPUT_VARIABLE TX_GEN_OUTPUT
ERROR_VARIABLE TX_GEN_ERROR)
if (NOT TX_GEN_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to generate transaction classes:\n${TX_GEN_ERROR}")
else ()
message(STATUS "Transaction classes generated successfully")
endif ()
# Generate ledger entry classes at configure time
message(STATUS "Generating ledger entry classes from ledger_entries.macro...")
execute_process(COMMAND ${VENV_PYTHON} "${GENERATE_LEDGER_SCRIPT}" "${LEDGER_ENTRIES_MACRO}"
--header-dir "${AUTOGEN_HEADER_DIR}/ledger_objects" --sfields-macro
"${SFIELDS_MACRO}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE LEDGER_GEN_RESULT
OUTPUT_VARIABLE LEDGER_GEN_OUTPUT
ERROR_VARIABLE LEDGER_GEN_ERROR)
if (NOT LEDGER_GEN_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to generate ledger entry classes:\n${LEDGER_GEN_ERROR}")
else ()
message(STATUS "Ledger entry classes generated successfully")
endif ()
# Register dependencies so CMake reconfigures when these files change
set_property(DIRECTORY
APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS
"${TRANSACTIONS_MACRO}"
"${LEDGER_ENTRIES_MACRO}"
"${SFIELDS_MACRO}"
"${GENERATE_TX_SCRIPT}"
"${GENERATE_LEDGER_SCRIPT}"
"${SCRIPTS_DIR}/macro_parser_common.py"
"${SCRIPTS_DIR}/templates/Transaction.h.mako"
"${SCRIPTS_DIR}/templates/LedgerEntry.h.mako"
"${REQUIREMENTS_FILE}")
endfunction ()

View File

@@ -3,6 +3,7 @@
"requires": [
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1765850150.075",
"xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1765850149.987",
"wasmi/1.0.6#407c9db14601a8af1c7dd3b388f3e4cd%1768164779.349",
"sqlite3/3.49.1#8631739a4c9b93bd3d6b753bac548a63%1765850149.926",
"soci/4.0.3#a9f8d773cd33e356b5879a4b0564f287%1765850149.46",
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1765850147.878",

View File

@@ -35,6 +35,7 @@ class Xrpl(ConanFile):
"openssl/3.5.5",
"secp256k1/0.7.1",
"soci/4.0.3",
"wasmi/1.0.6",
"zlib/1.3.1",
]
@@ -215,6 +216,7 @@ class Xrpl(ConanFile):
"soci::soci",
"secp256k1::secp256k1",
"sqlite3::sqlite",
"wasmi::wasmi",
"xxhash::xxhash",
"zlib::zlib",
]

View File

@@ -176,6 +176,8 @@ words:
- nixfmt
- nixos
- nixpkgs
- NOLINT
- NOLINTNEXTLINE
- nonxrp
- noripple
- nudb
@@ -291,6 +293,7 @@ words:
- venv
- vfalco
- vinnie
- wasmi
- wextra
- wptr
- writeme

View File

@@ -0,0 +1,73 @@
#pragma once
#include <xrpl/beast/utility/Journal.h>
#include <chrono>
#include <cstdint>
#include <string_view>
namespace xrpl {
// cSpell:ignore ptmalloc
// -----------------------------------------------------------------------------
// Allocator interaction note:
// - This facility invokes glibc's malloc_trim(0) on Linux/glibc to request that
// ptmalloc return free heap pages to the OS.
// - If an alternative allocator (e.g. jemalloc or tcmalloc) is linked or
// preloaded (LD_PRELOAD), calling glibc's malloc_trim typically has no effect
// on the *active* heap. The call is harmless but may not reclaim memory
// because those allocators manage their own arenas.
// - Only glibc sbrk/arena space is eligible for trimming; large mmap-backed
// allocations are usually returned to the OS on free regardless of trimming.
// - Call at known reclamation points (e.g., after cache sweeps / online delete)
// and consider rate limiting to avoid churn.
// -----------------------------------------------------------------------------
struct MallocTrimReport
{
bool supported{false};
int trimResult{-1};
std::int64_t rssBeforeKB{-1};
std::int64_t rssAfterKB{-1};
std::chrono::microseconds durationUs{-1};
std::int64_t minfltDelta{-1};
std::int64_t majfltDelta{-1};
[[nodiscard]] std::int64_t
deltaKB() const noexcept
{
if (rssBeforeKB < 0 || rssAfterKB < 0)
return 0;
return rssAfterKB - rssBeforeKB;
}
};
/**
* @brief Attempt to return freed memory to the operating system.
*
* On Linux with glibc malloc, this issues ::malloc_trim(0), which may release
* free space from ptmalloc arenas back to the kernel. On other platforms, or if
* a different allocator is in use, this function is a no-op and the report will
* indicate that trimming is unsupported or had no effect.
*
* @param tag Identifier for logging/debugging purposes.
* @param journal Journal for diagnostic logging.
* @return Report containing before/after metrics and the trim result.
*
* @note If an alternative allocator (jemalloc/tcmalloc) is linked or preloaded,
* calling glibc's malloc_trim may have no effect on the active heap. The
* call is harmless but typically does not reclaim memory under those
* allocators.
*
* @note Only memory served from glibc's sbrk/arena heaps is eligible for trim.
* Large allocations satisfied via mmap are usually returned on free
* independently of trimming.
*
* @note Intended for use after operations that free significant memory (e.g.,
* cache sweeps, ledger cleanup, online delete). Consider rate limiting.
*/
MallocTrimReport
mallocTrim(std::string_view tag, beast::Journal journal);
} // namespace xrpl

View File

@@ -77,16 +77,16 @@ public:
If the object is not found or an error is encountered, the
result will indicate the condition.
@note This will be called concurrently.
@param key A pointer to the key data.
@param hash The hash of the object.
@param pObject [out] The created object if successful.
@return The result of the operation.
*/
virtual Status
fetch(void const* key, std::shared_ptr<NodeObject>* pObject) = 0;
fetch(uint256 const& hash, std::shared_ptr<NodeObject>* pObject) = 0;
/** Fetch a batch synchronously. */
virtual std::pair<std::vector<std::shared_ptr<NodeObject>>, Status>
fetchBatch(std::vector<uint256 const*> const& hashes) = 0;
fetchBatch(std::vector<uint256> const& hashes) = 0;
/** Store a single object.
Depending on the implementation this may happen immediately

View File

@@ -15,9 +15,10 @@
// Add new amendments to the top of this list.
// Keep it sorted in reverse chronological order.
XRPL_FIX (PermissionedDomainInvariant, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (ExpiredNFTokenOfferRemoval, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (BatchInnerSigs, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (BatchInnerSigs, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(LendingProtocol, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo)
@@ -31,7 +32,7 @@ XRPL_FEATURE(TokenEscrow, Supported::yes, VoteBehavior::DefaultNo
XRPL_FIX (EnforceNFTokenTrustlineV2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMv1_3, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionedDEX, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Batch, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Batch, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(SingleAssetVault, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo)
// Check flags in Credential transactions

View File

@@ -1,152 +0,0 @@
#pragma once
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/SField.h>
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol_autogen/STObjectValidation.h>
#include <xrpl/protocol_autogen/Utils.h>
#include <optional>
#include <string>
namespace xrpl::ledger_entries {
/**
* @brief Base class for type-safe ledger entry wrappers.
*
* This class provides common functionality for all ledger entry types,
* including access to common fields (sfLedgerIndex, sfLedgerEntryType, sfFlags).
*
* This is an immutable wrapper around SLE (Serialized Ledger Entry).
* Use the corresponding Builder classes to construct new ledger entries.
*/
class LedgerEntryBase
{
public:
/**
* @brief Construct a ledger entry wrapper from an existing SLE object.
* @param sle The underlying serialized ledger entry to wrap
*/
explicit LedgerEntryBase(SLE const& sle) : sle_(sle)
{
}
/**
* @brief Validate the ledger entry
* @return true if validation passes, false otherwise
*/
[[nodiscard]]
bool
validate()
{
if (!sle_.isFieldPresent(sfLedgerEntryType))
{
return false;
}
auto ledgerEntryType = static_cast<LedgerEntryType>(sle_.getFieldU16(sfLedgerEntryType));
return protocol_autogen::validateSTObject(
sle_, LedgerFormats::getInstance().findByType(ledgerEntryType)->getSOTemplate());
}
/**
* @brief Get the ledger entry type.
* @return The type of this ledger entry
*/
[[nodiscard]]
LedgerEntryType
getType() const
{
return sle_.getType();
}
/**
* @brief Get the key (index) of this ledger entry.
*
* The key uniquely identifies this ledger entry in the ledger state.
* @return A constant reference to the 256-bit key
*/
[[nodiscard]]
uint256 const&
getKey() const
{
return sle_.key();
}
// Common field getters (from LedgerFormats.cpp commonFields)
/**
* @brief Get the ledger index (sfLedgerIndex).
*
* This field is OPTIONAL and represents the index of the ledger entry.
* @return The ledger index if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint256>
getLedgerIndex() const
{
if (sle_.isFieldPresent(sfLedgerIndex))
{
return sle_.at(sfLedgerIndex);
}
return std::nullopt;
}
/**
* @brief Check if the ledger entry has a ledger index.
* @return true if sfLedgerIndex is present, false otherwise
*/
[[nodiscard]]
bool
hasLedgerIndex() const
{
return sle_.isFieldPresent(sfLedgerIndex);
}
/**
* @brief Get the ledger entry type field (sfLedgerEntryType).
*
* This field is REQUIRED for all ledger entries and indicates the type
* of the ledger entry (e.g., AccountRoot, RippleState, Offer, etc.).
* @return The ledger entry type as a 16-bit unsigned integer
*/
[[nodiscard]]
uint16_t
getLedgerEntryType() const
{
return sle_.at(sfLedgerEntryType);
}
/**
* @brief Get the flags field (sfFlags).
*
* This field is REQUIRED for all ledger entries and contains
* type-specific flags that modify the behavior of the ledger entry.
* @return The flags value as a 32-bit unsigned integer
*/
[[nodiscard]]
std::uint32_t
getFlags() const
{
return sle_.at(sfFlags);
}
/**
* @brief Get the underlying SLE object.
*
* Provides direct access to the wrapped serialized ledger entry object
* for cases where the type-safe accessors are insufficient.
* @return A constant reference to the underlying SLE object
*/
[[nodiscard]]
SLE const&
getSle() const
{
return sle_;
}
protected:
/** @brief The underlying serialized ledger entry being wrapped. */
SLE const& sle_;
};
} // namespace xrpl::ledger_entries

View File

@@ -1,78 +0,0 @@
#pragma once
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/SField.h>
#include <xrpl/protocol/STAccount.h>
#include <xrpl/protocol/STAmount.h>
#include <xrpl/protocol/STBlob.h>
#include <xrpl/protocol/STInteger.h>
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STObject.h>
#include <xrpl/protocol_autogen/STObjectValidation.h>
namespace xrpl::ledger_entries {
/**
* Base class for all ledger entry builders.
* Provides common field setters that are available for all ledger entry types.
*/
template <typename Derived>
class LedgerEntryBuilderBase
{
public:
LedgerEntryBuilderBase() = default;
LedgerEntryBuilderBase(
SF_UINT16::type::value_type ledgerEntryType,
SF_UINT32::type::value_type flags = 0)
{
object_[sfLedgerEntryType] = ledgerEntryType;
object_[sfFlags] = flags;
}
/**
* @brief Validate the ledger entry
* @return true if validation passes, false otherwise
*/
[[nodiscard]]
bool
validate()
{
if (!object_.isFieldPresent(sfLedgerEntryType))
{
return false;
}
auto ledgerEntryType = static_cast<LedgerEntryType>(object_.getFieldU16(sfLedgerEntryType));
return protocol_autogen::validateSTObject(
object_, LedgerFormats::getInstance().findByType(ledgerEntryType)->getSOTemplate());
}
/**
* Set the ledger index.
* @param value Ledger index
* @return Reference to the derived builder for method chaining.
*/
Derived&
setLedgerIndex(uint256 const& value)
{
object_[sfLedgerIndex] = value;
return static_cast<Derived&>(*this);
}
/**
* Set the flags.
* @param value Flags value
* @return Reference to the derived builder for method chaining.
*/
Derived&
setFlags(uint32_t value)
{
object_.setFieldU32(sfFlags, value);
return static_cast<Derived&>(*this);
}
protected:
STObject object_{sfLedgerEntry};
};
} // namespace xrpl::ledger_entries

View File

@@ -1,81 +0,0 @@
<!-- cspell:words pyparsing -->
# Protocol Autogen
This directory contains auto-generated C++ wrapper classes for XRP Ledger protocol types.
## Generated Files
The files in this directory are automatically generated at **CMake configure time** from macro definition files:
- **Transaction classes** (in `transactions/`): Generated from `include/xrpl/protocol/detail/transactions.macro` by `scripts/generate_tx_classes.py`
- **Ledger entry classes** (in `ledger_objects/`): Generated from `include/xrpl/protocol/detail/ledger_entries.macro` by `scripts/generate_ledger_classes.py`
## Generation Process
The generation happens automatically when you **configure** the project (not during build). When you run CMake, the system:
1. Creates a Python virtual environment in the build directory (`codegen_venv`)
2. Installs Python dependencies from `scripts/requirements.txt` into the venv (only if needed)
3. Runs the Python generation scripts using the venv Python interpreter
4. Parses the macro files to extract type definitions
5. Generates type-safe C++ wrapper classes using Mako templates
6. Places the generated headers in this directory
### When Regeneration Happens
The code is regenerated when:
- You run CMake configure for the first time
- The Python virtual environment doesn't exist
- `scripts/requirements.txt` has been modified
To force regeneration, delete the build directory and reconfigure.
### Python Dependencies
The code generation requires the following Python packages (automatically installed):
- `pcpp` - C preprocessor for Python
- `pyparsing` - Parser combinator library
- `Mako` - Template engine
These are isolated in a virtual environment and won't affect your system Python installation.
## Version Control
The generated `.h` files **are checked into version control**. This means:
- Developers without Python 3 can still build the project using the committed files
- CI/CD systems don't need to run code generation if files are up to date
- Changes to generated files are visible in code review
## Modifying Generated Code
**Do not manually edit generated files.** Any changes will be overwritten the next time CMake configure runs.
To modify the generated classes:
- Edit the macro files in `include/xrpl/protocol/detail/`
- Edit the Mako templates in `scripts/templates/`
- Edit the generation scripts in `scripts/`
- Update Python dependencies in `scripts/requirements.txt`
- Run CMake configure to regenerate
## Adding Common Fields
If you add a new common field to `TxFormats.cpp` or `LedgerFormats.cpp`, you should also update the corresponding base classes and templates manually:
Base classes:
- `TransactionBase.h` - Add getters for new common transaction fields
- `TransactionBuilderBase.h` - Add setters, and if the field is required, add it to the constructor parameters
- `LedgerEntryBase.h` - Add getters for new common ledger entry fields
- `LedgerEntryBuilderBase.h` - Add setters, and if the field is required, add it to the constructor parameters
Templates (update to pass required common fields to base class constructors):
- `scripts/templates/Transaction.h.mako`
- `scripts/templates/LedgerEntry.h.mako`
These files are **not auto-generated** and must be updated by hand.

View File

@@ -1,32 +0,0 @@
#pragma once
#include <xrpl/protocol/SOTemplate.h>
#include <xrpl/protocol/STObject.h>
namespace xrpl::protocol_autogen {
[[nodiscard]]
bool
validateSTObject(STObject const& obj, SOTemplate const& format)
{
for (auto const& field : format)
{
if (obj.isFieldPresent(field.sField()) && field.style() == soeREQUIRED)
{
return false;
}
if (!field.supportMPT() && obj.isFieldPresent(field.sField()) &&
field.sField().fieldType == STI_ISSUE)
{
auto const& amount = obj.getFieldAmount(field.sField());
if (amount.asset().holds<MPTIssue>())
return false;
}
}
return true;
}
} // namespace xrpl::protocol_autogen

View File

@@ -1,444 +0,0 @@
#pragma once
#include <xrpl/protocol/SField.h>
#include <xrpl/protocol/STAccount.h>
#include <xrpl/protocol/STArray.h>
#include <xrpl/protocol/STObject.h>
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/TxFormats.h>
#include <xrpl/protocol_autogen/STObjectValidation.h>
#include <xrpl/protocol_autogen/Utils.h>
#include <optional>
#include <string>
namespace xrpl::transactions {
/**
* @brief Base class for all transaction wrapper types.
*
* Provides type-safe read-only accessors for common transaction fields.
* This is an immutable wrapper around STTx. Use the corresponding Builder classes
* to construct new transactions.
*/
class TransactionBase
{
public:
/**
* @brief Construct a transaction wrapper from an existing STTx object.
* @param tx The underlying transaction object to wrap
*/
explicit TransactionBase(STTx const& tx) : tx_(tx)
{
}
/**
* @brief Validate the transaction
* @return true if validation passes, false otherwise
*/
[[nodiscard]]
bool
validate() const
{
return protocol_autogen::validateSTObject(
tx_, TxFormats::getInstance().findByType(tx_.getTxnType())->getSOTemplate());
}
/**
* @brief Get the transaction type.
* @return The type of this transaction
*/
[[nodiscard]]
xrpl::TxType
getTransactionType() const
{
return tx_.getTxnType();
}
/**
* @brief Get the account initiating the transaction (sfAccount).
*
* This field is REQUIRED for all transactions.
* @return The account ID of the transaction sender
*/
[[nodiscard]]
AccountID
getAccount() const
{
return tx_.at(sfAccount);
}
/**
* @brief Get the sequence number of the transaction (sfSequence).
*
* This field is REQUIRED for all transactions.
* @return The sequence number
*/
[[nodiscard]]
std::uint32_t
getSequence() const
{
return tx_.at(sfSequence);
}
/**
* @brief Get the transaction fee (sfFee).
*
* This field is REQUIRED for all transactions.
* @return The fee amount
*/
[[nodiscard]]
STAmount
getFee() const
{
return tx_.at(sfFee);
}
/**
* @brief Get the signing public key (sfSigningPubKey).
*
* This field is REQUIRED for all transactions.
* @return The public key used for signing as a blob
*/
[[nodiscard]]
Blob
getSigningPubKey() const
{
return tx_.getFieldVL(sfSigningPubKey);
}
/**
* @brief Get the transaction flags (sfFlags).
*
* This field is OPTIONAL.
* @return The flags value if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint32_t>
getFlags() const
{
if (tx_.isFieldPresent(sfFlags))
return tx_.at(sfFlags);
return std::nullopt;
}
/**
* @brief Check if the transaction has flags set.
* @return true if sfFlags is present, false otherwise
*/
[[nodiscard]]
bool
hasFlags() const
{
return tx_.isFieldPresent(sfFlags);
}
/**
* @brief Get the source tag (sfSourceTag).
*
* This field is OPTIONAL and used to identify the source of a payment.
* @return The source tag value if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint32_t>
getSourceTag() const
{
if (tx_.isFieldPresent(sfSourceTag))
return tx_.at(sfSourceTag);
return std::nullopt;
}
/**
* @brief Check if the transaction has a source tag.
* @return true if sfSourceTag is present, false otherwise
*/
[[nodiscard]]
bool
hasSourceTag() const
{
return tx_.isFieldPresent(sfSourceTag);
}
/**
* @brief Get the previous transaction ID (sfPreviousTxnID).
*
* This field is OPTIONAL and used for transaction chaining.
* @return The previous transaction ID if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint256>
getPreviousTxnID() const
{
if (tx_.isFieldPresent(sfPreviousTxnID))
return tx_.at(sfPreviousTxnID);
return std::nullopt;
}
/**
* @brief Check if the transaction has a previous transaction ID.
* @return true if sfPreviousTxnID is present, false otherwise
*/
[[nodiscard]]
bool
hasPreviousTxnID() const
{
return tx_.isFieldPresent(sfPreviousTxnID);
}
/**
* @brief Get the last ledger sequence (sfLastLedgerSequence).
*
* This field is OPTIONAL and specifies the latest ledger sequence
* in which this transaction can be included.
* @return The last ledger sequence if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint32_t>
getLastLedgerSequence() const
{
if (tx_.isFieldPresent(sfLastLedgerSequence))
return tx_.at(sfLastLedgerSequence);
return std::nullopt;
}
/**
* @brief Check if the transaction has a last ledger sequence.
* @return true if sfLastLedgerSequence is present, false otherwise
*/
[[nodiscard]]
bool
hasLastLedgerSequence() const
{
return tx_.isFieldPresent(sfLastLedgerSequence);
}
/**
* @brief Get the account transaction ID (sfAccountTxnID).
*
* This field is OPTIONAL and used to track transaction sequences.
* @return The account transaction ID if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint256>
getAccountTxnID() const
{
if (tx_.isFieldPresent(sfAccountTxnID))
return tx_.at(sfAccountTxnID);
return std::nullopt;
}
/**
* @brief Check if the transaction has an account transaction ID.
* @return true if sfAccountTxnID is present, false otherwise
*/
[[nodiscard]]
bool
hasAccountTxnID() const
{
return tx_.isFieldPresent(sfAccountTxnID);
}
/**
* @brief Get the operation limit (sfOperationLimit).
*
* This field is OPTIONAL and limits the number of operations in a transaction.
* @return The operation limit if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint32_t>
getOperationLimit() const
{
if (tx_.isFieldPresent(sfOperationLimit))
return tx_.at(sfOperationLimit);
return std::nullopt;
}
/**
* @brief Check if the transaction has an operation limit.
* @return true if sfOperationLimit is present, false otherwise
*/
[[nodiscard]]
bool
hasOperationLimit() const
{
return tx_.isFieldPresent(sfOperationLimit);
}
/**
* @brief Get the memos array (sfMemos).
*
* This field is OPTIONAL and contains arbitrary data attached to the transaction.
* @note This is an untyped field (STArray).
* @return A reference wrapper to the memos array if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getMemos() const
{
if (tx_.isFieldPresent(sfMemos))
return tx_.getFieldArray(sfMemos);
return std::nullopt;
}
/**
* @brief Check if the transaction has memos.
* @return true if sfMemos is present, false otherwise
*/
[[nodiscard]]
bool
hasMemos() const
{
return tx_.isFieldPresent(sfMemos);
}
/**
* @brief Get the ticket sequence (sfTicketSequence).
*
* This field is OPTIONAL and used when consuming a ticket instead of a sequence number.
* @return The ticket sequence if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint32_t>
getTicketSequence() const
{
if (tx_.isFieldPresent(sfTicketSequence))
return tx_.at(sfTicketSequence);
return std::nullopt;
}
/**
* @brief Check if the transaction has a ticket sequence.
* @return true if sfTicketSequence is present, false otherwise
*/
[[nodiscard]]
bool
hasTicketSequence() const
{
return tx_.isFieldPresent(sfTicketSequence);
}
/**
* @brief Get the transaction signature (sfTxnSignature).
*
* This field is OPTIONAL and contains the signature for single-signed transactions.
* @return The transaction signature as a blob if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<Blob>
getTxnSignature() const
{
if (tx_.isFieldPresent(sfTxnSignature))
return tx_.getFieldVL(sfTxnSignature);
return std::nullopt;
}
/**
* @brief Check if the transaction has a transaction signature.
* @return true if sfTxnSignature is present, false otherwise
*/
[[nodiscard]]
bool
hasTxnSignature() const
{
return tx_.isFieldPresent(sfTxnSignature);
}
/**
* @brief Get the signers array (sfSigners).
*
* This field is OPTIONAL and contains the list of signers for multi-signed transactions.
* @note This is an untyped field (STArray).
* @return A reference wrapper to the signers array if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getSigners() const
{
if (tx_.isFieldPresent(sfSigners))
return tx_.getFieldArray(sfSigners);
return std::nullopt;
}
/**
* @brief Check if the transaction has signers.
* @return true if sfSigners is present, false otherwise
*/
[[nodiscard]]
bool
hasSigners() const
{
return tx_.isFieldPresent(sfSigners);
}
/**
* @brief Get the network ID (sfNetworkID).
*
* This field is OPTIONAL and identifies the network this transaction is intended for.
* @return The network ID if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<uint32_t>
getNetworkID() const
{
if (tx_.isFieldPresent(sfNetworkID))
return tx_.at(sfNetworkID);
return std::nullopt;
}
/**
* @brief Check if the transaction has a network ID.
* @return true if sfNetworkID is present, false otherwise
*/
[[nodiscard]]
bool
hasNetworkID() const
{
return tx_.isFieldPresent(sfNetworkID);
}
/**
* @brief Get the delegate account (sfDelegate).
*
* This field is OPTIONAL and specifies a delegate account for the transaction.
* @return The delegate account ID if present, std::nullopt otherwise
*/
[[nodiscard]]
std::optional<AccountID>
getDelegate() const
{
if (tx_.isFieldPresent(sfDelegate))
return tx_.at(sfDelegate);
return std::nullopt;
}
/**
* @brief Check if the transaction has a delegate account.
* @return true if sfDelegate is present, false otherwise
*/
[[nodiscard]]
bool
hasDelegate() const
{
return tx_.isFieldPresent(sfDelegate);
}
/**
* @brief Get the underlying STTx object.
*
* Provides direct access to the wrapped transaction object for cases
* where the type-safe accessors are insufficient.
* @return A constant reference to the underlying STTx object
*/
[[nodiscard]]
STTx const&
getSTTx() const
{
return tx_;
}
protected:
/** @brief The underlying transaction object being wrapped. */
STTx const& tx_;
};
} // namespace xrpl::transactions

View File

@@ -1,182 +0,0 @@
#pragma once
#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/PublicKey.h>
#include <xrpl/protocol/SField.h>
#include <xrpl/protocol/STAccount.h>
#include <xrpl/protocol/STAmount.h>
#include <xrpl/protocol/STBlob.h>
#include <xrpl/protocol/STInteger.h>
#include <xrpl/protocol/STObject.h>
#include <xrpl/protocol/STXChainBridge.h>
#include <xrpl/protocol/SecretKey.h>
#include <xrpl/protocol/Serializer.h>
#include <xrpl/protocol/TxFormats.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/STObjectValidation.h>
namespace xrpl::transactions {
/**
* Base class for all transaction builders.
* Provides common field setters that are available for all transaction types.
*/
template <typename Derived>
class TransactionBuilderBase
{
public:
TransactionBuilderBase() = default;
TransactionBuilderBase(
SF_UINT16::type::value_type transactionType,
SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence,
std::optional<SF_AMOUNT::type::value_type> fee)
{
object_[sfTransactionType] = transactionType;
setAccount(account);
if (sequence)
{
setSequence(*sequence);
}
if (fee)
{
setFee(*fee);
}
}
/**
* @brief Validate the transaction
* @return true if validation passes, false otherwise
*/
[[nodiscard]]
bool
validate()
{
if (!object_.isFieldPresent(sfTransactionType))
{
return false;
}
auto transactionType = static_cast<TxType>(object_.getFieldU16(sfTransactionType));
return protocol_autogen::validateSTObject(
object_, TxFormats::getInstance().findByType(transactionType)->getSOTemplate());
}
/**
* Set the account that is sending the transaction.
* @param value Account address (typically as a string)
* @return Reference to the derived builder for method chaining.
*/
Derived&
setAccount(AccountID const& value)
{
object_[sfAccount] = value;
return static_cast<Derived&>(*this);
}
/**
* Set the transaction fee.
* @param value Fee in drops (typically as a string or number)
* @return Reference to the derived builder for method chaining.
*/
Derived&
setFee(STAmount const& value)
{
object_[sfFee] = value;
return static_cast<Derived&>(*this);
}
/**
* Set the sequence number.
* @param value Sequence number
* @return Reference to the derived builder for method chaining.
*/
Derived&
setSequence(std::uint32_t const& value)
{
object_[sfSequence] = value;
return static_cast<Derived&>(*this);
}
/**
* Set transaction flags.
* @param value Flags value
* @return Reference to the derived builder for method chaining.
*/
Derived&
setFlags(std::uint32_t const& value)
{
object_[sfFlags] = value;
return static_cast<Derived&>(*this);
}
/**
* Set the source tag.
* @param value Source tag
* @return Reference to the derived builder for method chaining.
*/
Derived&
setSourceTag(std::uint32_t const& value)
{
object_[sfSourceTag] = value;
return static_cast<Derived&>(*this);
}
/**
* Set the last ledger sequence.
* @param value Last ledger sequence number
* @return Reference to the derived builder for method chaining.
*/
Derived&
setLastLedgerSequence(std::uint32_t const& value)
{
object_[sfLastLedgerSequence] = value;
return static_cast<Derived&>(*this);
}
/**
* Set the account transaction ID.
* @param value Account transaction ID (typically as a hex string)
* @return Reference to the derived builder for method chaining.
*/
Derived&
setAccountTxnID(uint256 const& value)
{
object_[sfAccountTxnID] = value;
return static_cast<Derived&>(*this);
}
/**
* Sign the transaction with the given keys.
*
* This sets the SigningPubKey field and computes the TxnSignature.
*
* @param publicKey The public key for signing
* @param secretKey The secret key for signing
* @return Reference to the derived builder for method chaining.
*/
Derived&
sign(PublicKey const& publicKey, SecretKey const& secretKey)
{
// Set the signing public key
object_.setFieldVL(sfSigningPubKey, publicKey.slice());
// Build the signing data: HashPrefix::txSign + serialized object
// (without signing fields)
Serializer s;
s.add32(HashPrefix::txSign);
object_.addWithoutSigningFields(s);
// Sign and set the signature
auto const sig = xrpl::sign(publicKey, secretKey, s.slice());
object_.setFieldVL(sfTxnSignature, sig);
return static_cast<Derived&>(*this);
}
protected:
STObject object_{sfTransaction};
};
} // namespace xrpl::transactions

View File

@@ -1,14 +0,0 @@
#pragma once
#include <optional>
#include <type_traits>
namespace xrpl::protocol_autogen {
template <typename ValueType>
using Optional = std::conditional_t<
std::is_reference_v<ValueType>,
std::optional<std::reference_wrapper<std::remove_reference_t<ValueType>>>,
std::optional<ValueType>>;
}

View File

@@ -1,347 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class AMMBuilder;
/**
* Ledger Entry: AMM
* Type: ltAMM (0x0079)
* RPC Name: amm
*
* Immutable wrapper around SLE providing type-safe field access.
* Use AMMBuilder to construct new ledger entries.
*/
class AMM : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltAMM;
/**
* Construct a AMM ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit AMM(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for AMM");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfTradingFee (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getTradingFee() const
{
if (hasTradingFee())
return this->sle_.at(sfTradingFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasTradingFee() const
{
return this->sle_.isFieldPresent(sfTradingFee);
}
/**
* Get sfVoteSlots (soeOPTIONAL)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getVoteSlots() const
{
if (this->sle_.isFieldPresent(sfVoteSlots))
return this->sle_.getFieldArray(sfVoteSlots);
return std::nullopt;
}
[[nodiscard]]
bool
hasVoteSlots() const
{
return this->sle_.isFieldPresent(sfVoteSlots);
}
/**
* Get sfAuctionSlot (soeOPTIONAL)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
std::optional<STObject>
getAuctionSlot() const
{
if (this->sle_.isFieldPresent(sfAuctionSlot))
return this->sle_.getFieldObject(sfAuctionSlot);
return std::nullopt;
}
[[nodiscard]]
bool
hasAuctionSlot() const
{
return this->sle_.isFieldPresent(sfAuctionSlot);
}
/**
* Get sfLPTokenBalance (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getLPTokenBalance() const
{
return this->sle_.at(sfLPTokenBalance);
}
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->sle_.at(sfAsset);
}
/**
* Get sfAsset2 (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset2() const
{
return this->sle_.at(sfAsset2);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getPreviousTxnID() const
{
if (hasPreviousTxnID())
return this->sle_.at(sfPreviousTxnID);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnID() const
{
return this->sle_.isFieldPresent(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPreviousTxnLgrSeq() const
{
if (hasPreviousTxnLgrSeq())
return this->sle_.at(sfPreviousTxnLgrSeq);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnLgrSeq() const
{
return this->sle_.isFieldPresent(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for AMM ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class AMMBuilder : public LedgerEntryBuilderBase<AMMBuilder>
{
public:
AMMBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_AMOUNT::type::value_type> const& lPTokenBalance,std::decay_t<typename SF_ISSUE::type::value_type> const& asset,std::decay_t<typename SF_ISSUE::type::value_type> const& asset2,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode)
: LedgerEntryBuilderBase<AMMBuilder>(ltAMM)
{
setAccount(account);
setLPTokenBalance(lPTokenBalance);
setAsset(asset);
setAsset2(asset2);
setOwnerNode(ownerNode);
}
AMMBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltAMM)
{
throw std::runtime_error("Invalid ledger entry type for AMM");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfTradingFee (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setTradingFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTradingFee] = value;
return *this;
}
/**
* Set sfVoteSlots (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setVoteSlots(STArray const& value)
{
object_.setFieldArray(sfVoteSlots, value);
return *this;
}
/**
* Set sfAuctionSlot (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setAuctionSlot(STObject const& value)
{
object_.setFieldObject(sfAuctionSlot, value);
return *this;
}
/**
* Set sfLPTokenBalance (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setLPTokenBalance(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfLPTokenBalance] = value;
return *this;
}
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAsset2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setAsset2(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset2] = STIssue(sfAsset2, value);
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed AMM wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
AMM
build(uint256 const& index)
{
return AMM{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,727 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class AccountRootBuilder;
/**
* Ledger Entry: AccountRoot
* Type: ltACCOUNT_ROOT (0x0061)
* RPC Name: account
*
* Immutable wrapper around SLE providing type-safe field access.
* Use AccountRootBuilder to construct new ledger entries.
*/
class AccountRoot : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltACCOUNT_ROOT;
/**
* Construct a AccountRoot ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit AccountRoot(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for AccountRoot");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSequence() const
{
return this->sle_.at(sfSequence);
}
/**
* Get sfBalance (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getBalance() const
{
return this->sle_.at(sfBalance);
}
/**
* Get sfOwnerCount (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getOwnerCount() const
{
return this->sle_.at(sfOwnerCount);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfAccountTxnID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getAccountTxnID() const
{
if (hasAccountTxnID())
return this->sle_.at(sfAccountTxnID);
return std::nullopt;
}
[[nodiscard]]
bool
hasAccountTxnID() const
{
return this->sle_.isFieldPresent(sfAccountTxnID);
}
/**
* Get sfRegularKey (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getRegularKey() const
{
if (hasRegularKey())
return this->sle_.at(sfRegularKey);
return std::nullopt;
}
[[nodiscard]]
bool
hasRegularKey() const
{
return this->sle_.isFieldPresent(sfRegularKey);
}
/**
* Get sfEmailHash (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT128::type::value_type>
getEmailHash() const
{
if (hasEmailHash())
return this->sle_.at(sfEmailHash);
return std::nullopt;
}
[[nodiscard]]
bool
hasEmailHash() const
{
return this->sle_.isFieldPresent(sfEmailHash);
}
/**
* Get sfWalletLocator (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getWalletLocator() const
{
if (hasWalletLocator())
return this->sle_.at(sfWalletLocator);
return std::nullopt;
}
[[nodiscard]]
bool
hasWalletLocator() const
{
return this->sle_.isFieldPresent(sfWalletLocator);
}
/**
* Get sfWalletSize (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getWalletSize() const
{
if (hasWalletSize())
return this->sle_.at(sfWalletSize);
return std::nullopt;
}
[[nodiscard]]
bool
hasWalletSize() const
{
return this->sle_.isFieldPresent(sfWalletSize);
}
/**
* Get sfMessageKey (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getMessageKey() const
{
if (hasMessageKey())
return this->sle_.at(sfMessageKey);
return std::nullopt;
}
[[nodiscard]]
bool
hasMessageKey() const
{
return this->sle_.isFieldPresent(sfMessageKey);
}
/**
* Get sfTransferRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getTransferRate() const
{
if (hasTransferRate())
return this->sle_.at(sfTransferRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasTransferRate() const
{
return this->sle_.isFieldPresent(sfTransferRate);
}
/**
* Get sfDomain (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getDomain() const
{
if (hasDomain())
return this->sle_.at(sfDomain);
return std::nullopt;
}
[[nodiscard]]
bool
hasDomain() const
{
return this->sle_.isFieldPresent(sfDomain);
}
/**
* Get sfTickSize (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT8::type::value_type>
getTickSize() const
{
if (hasTickSize())
return this->sle_.at(sfTickSize);
return std::nullopt;
}
[[nodiscard]]
bool
hasTickSize() const
{
return this->sle_.isFieldPresent(sfTickSize);
}
/**
* Get sfTicketCount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getTicketCount() const
{
if (hasTicketCount())
return this->sle_.at(sfTicketCount);
return std::nullopt;
}
[[nodiscard]]
bool
hasTicketCount() const
{
return this->sle_.isFieldPresent(sfTicketCount);
}
/**
* Get sfNFTokenMinter (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getNFTokenMinter() const
{
if (hasNFTokenMinter())
return this->sle_.at(sfNFTokenMinter);
return std::nullopt;
}
[[nodiscard]]
bool
hasNFTokenMinter() const
{
return this->sle_.isFieldPresent(sfNFTokenMinter);
}
/**
* Get sfMintedNFTokens (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getMintedNFTokens() const
{
if (hasMintedNFTokens())
return this->sle_.at(sfMintedNFTokens);
return std::nullopt;
}
[[nodiscard]]
bool
hasMintedNFTokens() const
{
return this->sle_.isFieldPresent(sfMintedNFTokens);
}
/**
* Get sfBurnedNFTokens (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getBurnedNFTokens() const
{
if (hasBurnedNFTokens())
return this->sle_.at(sfBurnedNFTokens);
return std::nullopt;
}
[[nodiscard]]
bool
hasBurnedNFTokens() const
{
return this->sle_.isFieldPresent(sfBurnedNFTokens);
}
/**
* Get sfFirstNFTokenSequence (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getFirstNFTokenSequence() const
{
if (hasFirstNFTokenSequence())
return this->sle_.at(sfFirstNFTokenSequence);
return std::nullopt;
}
[[nodiscard]]
bool
hasFirstNFTokenSequence() const
{
return this->sle_.isFieldPresent(sfFirstNFTokenSequence);
}
/**
* Get sfAMMID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getAMMID() const
{
if (hasAMMID())
return this->sle_.at(sfAMMID);
return std::nullopt;
}
[[nodiscard]]
bool
hasAMMID() const
{
return this->sle_.isFieldPresent(sfAMMID);
}
/**
* Get sfVaultID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getVaultID() const
{
if (hasVaultID())
return this->sle_.at(sfVaultID);
return std::nullopt;
}
[[nodiscard]]
bool
hasVaultID() const
{
return this->sle_.isFieldPresent(sfVaultID);
}
/**
* Get sfLoanBrokerID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getLoanBrokerID() const
{
if (hasLoanBrokerID())
return this->sle_.at(sfLoanBrokerID);
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanBrokerID() const
{
return this->sle_.isFieldPresent(sfLoanBrokerID);
}
};
/**
* Builder for AccountRoot ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class AccountRootBuilder : public LedgerEntryBuilderBase<AccountRootBuilder>
{
public:
AccountRootBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_UINT32::type::value_type> const& sequence,std::decay_t<typename SF_AMOUNT::type::value_type> const& balance,std::decay_t<typename SF_UINT32::type::value_type> const& ownerCount,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<AccountRootBuilder>(ltACCOUNT_ROOT)
{
setAccount(account);
setSequence(sequence);
setBalance(balance);
setOwnerCount(ownerCount);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
AccountRootBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltACCOUNT_ROOT)
{
throw std::runtime_error("Invalid ledger entry type for AccountRoot");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfBalance (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setBalance(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfBalance] = value;
return *this;
}
/**
* Set sfOwnerCount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setOwnerCount(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOwnerCount] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfAccountTxnID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setAccountTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfAccountTxnID] = value;
return *this;
}
/**
* Set sfRegularKey (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setRegularKey(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfRegularKey] = value;
return *this;
}
/**
* Set sfEmailHash (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setEmailHash(std::decay_t<typename SF_UINT128::type::value_type> const& value)
{
object_[sfEmailHash] = value;
return *this;
}
/**
* Set sfWalletLocator (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setWalletLocator(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfWalletLocator] = value;
return *this;
}
/**
* Set sfWalletSize (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setWalletSize(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfWalletSize] = value;
return *this;
}
/**
* Set sfMessageKey (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setMessageKey(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfMessageKey] = value;
return *this;
}
/**
* Set sfTransferRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setTransferRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfTransferRate] = value;
return *this;
}
/**
* Set sfDomain (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setDomain(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfDomain] = value;
return *this;
}
/**
* Set sfTickSize (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setTickSize(std::decay_t<typename SF_UINT8::type::value_type> const& value)
{
object_[sfTickSize] = value;
return *this;
}
/**
* Set sfTicketCount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setTicketCount(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfTicketCount] = value;
return *this;
}
/**
* Set sfNFTokenMinter (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setNFTokenMinter(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfNFTokenMinter] = value;
return *this;
}
/**
* Set sfMintedNFTokens (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setMintedNFTokens(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfMintedNFTokens] = value;
return *this;
}
/**
* Set sfBurnedNFTokens (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setBurnedNFTokens(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfBurnedNFTokens] = value;
return *this;
}
/**
* Set sfFirstNFTokenSequence (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setFirstNFTokenSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfFirstNFTokenSequence] = value;
return *this;
}
/**
* Set sfAMMID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setAMMID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfAMMID] = value;
return *this;
}
/**
* Set sfVaultID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setVaultID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfVaultID] = value;
return *this;
}
/**
* Set sfLoanBrokerID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountRootBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Build and return the completed AccountRoot wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
AccountRoot
build(uint256 const& index)
{
return AccountRoot{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,206 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class AmendmentsBuilder;
/**
* Ledger Entry: Amendments
* Type: ltAMENDMENTS (0x0066)
* RPC Name: amendments
*
* Immutable wrapper around SLE providing type-safe field access.
* Use AmendmentsBuilder to construct new ledger entries.
*/
class Amendments : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltAMENDMENTS;
/**
* Construct a Amendments ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Amendments(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Amendments");
}
}
// Ledger entry-specific field getters
/**
* Get sfAmendments (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VECTOR256::type::value_type>
getAmendments() const
{
if (hasAmendments())
return this->sle_.at(sfAmendments);
return std::nullopt;
}
[[nodiscard]]
bool
hasAmendments() const
{
return this->sle_.isFieldPresent(sfAmendments);
}
/**
* Get sfMajorities (soeOPTIONAL)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getMajorities() const
{
if (this->sle_.isFieldPresent(sfMajorities))
return this->sle_.getFieldArray(sfMajorities);
return std::nullopt;
}
[[nodiscard]]
bool
hasMajorities() const
{
return this->sle_.isFieldPresent(sfMajorities);
}
/**
* Get sfPreviousTxnID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getPreviousTxnID() const
{
if (hasPreviousTxnID())
return this->sle_.at(sfPreviousTxnID);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnID() const
{
return this->sle_.isFieldPresent(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPreviousTxnLgrSeq() const
{
if (hasPreviousTxnLgrSeq())
return this->sle_.at(sfPreviousTxnLgrSeq);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnLgrSeq() const
{
return this->sle_.isFieldPresent(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for Amendments ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class AmendmentsBuilder : public LedgerEntryBuilderBase<AmendmentsBuilder>
{
public:
AmendmentsBuilder()
: LedgerEntryBuilderBase<AmendmentsBuilder>(ltAMENDMENTS)
{
}
AmendmentsBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltAMENDMENTS)
{
throw std::runtime_error("Invalid ledger entry type for Amendments");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAmendments (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AmendmentsBuilder&
setAmendments(std::decay_t<typename SF_VECTOR256::type::value_type> const& value)
{
object_[sfAmendments] = value;
return *this;
}
/**
* Set sfMajorities (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AmendmentsBuilder&
setMajorities(STArray const& value)
{
object_.setFieldArray(sfMajorities, value);
return *this;
}
/**
* Set sfPreviousTxnID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AmendmentsBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AmendmentsBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed Amendments wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Amendments
build(uint256 const& index)
{
return Amendments{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,313 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class BridgeBuilder;
/**
* Ledger Entry: Bridge
* Type: ltBRIDGE (0x0069)
* RPC Name: bridge
*
* Immutable wrapper around SLE providing type-safe field access.
* Use BridgeBuilder to construct new ledger entries.
*/
class Bridge : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltBRIDGE;
/**
* Construct a Bridge ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Bridge(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Bridge");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfSignatureReward (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getSignatureReward() const
{
return this->sle_.at(sfSignatureReward);
}
/**
* Get sfMinAccountCreateAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getMinAccountCreateAmount() const
{
if (hasMinAccountCreateAmount())
return this->sle_.at(sfMinAccountCreateAmount);
return std::nullopt;
}
[[nodiscard]]
bool
hasMinAccountCreateAmount() const
{
return this->sle_.isFieldPresent(sfMinAccountCreateAmount);
}
/**
* Get sfXChainBridge (soeREQUIRED)
*/
[[nodiscard]]
SF_XCHAIN_BRIDGE::type::value_type
getXChainBridge() const
{
return this->sle_.at(sfXChainBridge);
}
/**
* Get sfXChainClaimID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getXChainClaimID() const
{
return this->sle_.at(sfXChainClaimID);
}
/**
* Get sfXChainAccountCreateCount (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getXChainAccountCreateCount() const
{
return this->sle_.at(sfXChainAccountCreateCount);
}
/**
* Get sfXChainAccountClaimCount (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getXChainAccountClaimCount() const
{
return this->sle_.at(sfXChainAccountClaimCount);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for Bridge ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class BridgeBuilder : public LedgerEntryBuilderBase<BridgeBuilder>
{
public:
BridgeBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_AMOUNT::type::value_type> const& signatureReward,std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type> const& xChainBridge,std::decay_t<typename SF_UINT64::type::value_type> const& xChainClaimID,std::decay_t<typename SF_UINT64::type::value_type> const& xChainAccountCreateCount,std::decay_t<typename SF_UINT64::type::value_type> const& xChainAccountClaimCount,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<BridgeBuilder>(ltBRIDGE)
{
setAccount(account);
setSignatureReward(signatureReward);
setXChainBridge(xChainBridge);
setXChainClaimID(xChainClaimID);
setXChainAccountCreateCount(xChainAccountCreateCount);
setXChainAccountClaimCount(xChainAccountClaimCount);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
BridgeBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltBRIDGE)
{
throw std::runtime_error("Invalid ledger entry type for Bridge");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfSignatureReward (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setSignatureReward(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfSignatureReward] = value;
return *this;
}
/**
* Set sfMinAccountCreateAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setMinAccountCreateAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfMinAccountCreateAmount] = value;
return *this;
}
/**
* Set sfXChainBridge (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setXChainBridge(std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type> const& value)
{
object_[sfXChainBridge] = value;
return *this;
}
/**
* Set sfXChainClaimID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setXChainClaimID(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfXChainClaimID] = value;
return *this;
}
/**
* Set sfXChainAccountCreateCount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setXChainAccountCreateCount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfXChainAccountCreateCount] = value;
return *this;
}
/**
* Set sfXChainAccountClaimCount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setXChainAccountClaimCount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfXChainAccountClaimCount] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BridgeBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed Bridge wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Bridge
build(uint256 const& index)
{
return Bridge{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,381 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class CheckBuilder;
/**
* Ledger Entry: Check
* Type: ltCHECK (0x0043)
* RPC Name: check
*
* Immutable wrapper around SLE providing type-safe field access.
* Use CheckBuilder to construct new ledger entries.
*/
class Check : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltCHECK;
/**
* Construct a Check ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Check(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Check");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfDestination (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getDestination() const
{
return this->sle_.at(sfDestination);
}
/**
* Get sfSendMax (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getSendMax() const
{
return this->sle_.at(sfSendMax);
}
/**
* Get sfSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSequence() const
{
return this->sle_.at(sfSequence);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfDestinationNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getDestinationNode() const
{
return this->sle_.at(sfDestinationNode);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
return this->sle_.at(sfExpiration);
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->sle_.isFieldPresent(sfExpiration);
}
/**
* Get sfInvoiceID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getInvoiceID() const
{
if (hasInvoiceID())
return this->sle_.at(sfInvoiceID);
return std::nullopt;
}
[[nodiscard]]
bool
hasInvoiceID() const
{
return this->sle_.isFieldPresent(sfInvoiceID);
}
/**
* Get sfSourceTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getSourceTag() const
{
if (hasSourceTag())
return this->sle_.at(sfSourceTag);
return std::nullopt;
}
[[nodiscard]]
bool
hasSourceTag() const
{
return this->sle_.isFieldPresent(sfSourceTag);
}
/**
* Get sfDestinationTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getDestinationTag() const
{
if (hasDestinationTag())
return this->sle_.at(sfDestinationTag);
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationTag() const
{
return this->sle_.isFieldPresent(sfDestinationTag);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for Check ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class CheckBuilder : public LedgerEntryBuilderBase<CheckBuilder>
{
public:
CheckBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_ACCOUNT::type::value_type> const& destination,std::decay_t<typename SF_AMOUNT::type::value_type> const& sendMax,std::decay_t<typename SF_UINT32::type::value_type> const& sequence,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT64::type::value_type> const& destinationNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<CheckBuilder>(ltCHECK)
{
setAccount(account);
setDestination(destination);
setSendMax(sendMax);
setSequence(sequence);
setOwnerNode(ownerNode);
setDestinationNode(destinationNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
CheckBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltCHECK)
{
throw std::runtime_error("Invalid ledger entry type for Check");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfDestination (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfSendMax (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setSendMax(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfSendMax] = value;
return *this;
}
/**
* Set sfSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfDestinationNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setDestinationNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfDestinationNode] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Set sfInvoiceID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setInvoiceID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfInvoiceID] = value;
return *this;
}
/**
* Set sfSourceTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setSourceTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSourceTag] = value;
return *this;
}
/**
* Set sfDestinationTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setDestinationTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfDestinationTag] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed Check wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Check
build(uint256 const& index)
{
return Check{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,307 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class CredentialBuilder;
/**
* Ledger Entry: Credential
* Type: ltCREDENTIAL (0x0081)
* RPC Name: credential
*
* Immutable wrapper around SLE providing type-safe field access.
* Use CredentialBuilder to construct new ledger entries.
*/
class Credential : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltCREDENTIAL;
/**
* Construct a Credential ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Credential(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Credential");
}
}
// Ledger entry-specific field getters
/**
* Get sfSubject (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getSubject() const
{
return this->sle_.at(sfSubject);
}
/**
* Get sfIssuer (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getIssuer() const
{
return this->sle_.at(sfIssuer);
}
/**
* Get sfCredentialType (soeREQUIRED)
*/
[[nodiscard]]
SF_VL::type::value_type
getCredentialType() const
{
return this->sle_.at(sfCredentialType);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
return this->sle_.at(sfExpiration);
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->sle_.isFieldPresent(sfExpiration);
}
/**
* Get sfURI (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getURI() const
{
if (hasURI())
return this->sle_.at(sfURI);
return std::nullopt;
}
[[nodiscard]]
bool
hasURI() const
{
return this->sle_.isFieldPresent(sfURI);
}
/**
* Get sfIssuerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getIssuerNode() const
{
return this->sle_.at(sfIssuerNode);
}
/**
* Get sfSubjectNode (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getSubjectNode() const
{
if (hasSubjectNode())
return this->sle_.at(sfSubjectNode);
return std::nullopt;
}
[[nodiscard]]
bool
hasSubjectNode() const
{
return this->sle_.isFieldPresent(sfSubjectNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for Credential ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class CredentialBuilder : public LedgerEntryBuilderBase<CredentialBuilder>
{
public:
CredentialBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& subject,std::decay_t<typename SF_ACCOUNT::type::value_type> const& issuer,std::decay_t<typename SF_VL::type::value_type> const& credentialType,std::decay_t<typename SF_UINT64::type::value_type> const& issuerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<CredentialBuilder>(ltCREDENTIAL)
{
setSubject(subject);
setIssuer(issuer);
setCredentialType(credentialType);
setIssuerNode(issuerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
CredentialBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltCREDENTIAL)
{
throw std::runtime_error("Invalid ledger entry type for Credential");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfSubject (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setSubject(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfSubject] = value;
return *this;
}
/**
* Set sfIssuer (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setIssuer(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfIssuer] = value;
return *this;
}
/**
* Set sfCredentialType (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setCredentialType(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfCredentialType] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Set sfURI (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setURI(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfURI] = value;
return *this;
}
/**
* Set sfIssuerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setIssuerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfIssuerNode] = value;
return *this;
}
/**
* Set sfSubjectNode (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setSubjectNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfSubjectNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed Credential wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Credential
build(uint256 const& index)
{
return Credential{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,263 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class DIDBuilder;
/**
* Ledger Entry: DID
* Type: ltDID (0x0049)
* RPC Name: did
*
* Immutable wrapper around SLE providing type-safe field access.
* Use DIDBuilder to construct new ledger entries.
*/
class DID : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltDID;
/**
* Construct a DID ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit DID(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for DID");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfDIDDocument (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getDIDDocument() const
{
if (hasDIDDocument())
return this->sle_.at(sfDIDDocument);
return std::nullopt;
}
[[nodiscard]]
bool
hasDIDDocument() const
{
return this->sle_.isFieldPresent(sfDIDDocument);
}
/**
* Get sfURI (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getURI() const
{
if (hasURI())
return this->sle_.at(sfURI);
return std::nullopt;
}
[[nodiscard]]
bool
hasURI() const
{
return this->sle_.isFieldPresent(sfURI);
}
/**
* Get sfData (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getData() const
{
if (hasData())
return this->sle_.at(sfData);
return std::nullopt;
}
[[nodiscard]]
bool
hasData() const
{
return this->sle_.isFieldPresent(sfData);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for DID ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class DIDBuilder : public LedgerEntryBuilderBase<DIDBuilder>
{
public:
DIDBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<DIDBuilder>(ltDID)
{
setAccount(account);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
DIDBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltDID)
{
throw std::runtime_error("Invalid ledger entry type for DID");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DIDBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfDIDDocument (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DIDBuilder&
setDIDDocument(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfDIDDocument] = value;
return *this;
}
/**
* Set sfURI (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DIDBuilder&
setURI(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfURI] = value;
return *this;
}
/**
* Set sfData (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DIDBuilder&
setData(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfData] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DIDBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DIDBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DIDBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed DID wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
DID
build(uint256 const& index)
{
return DID{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,218 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class DelegateBuilder;
/**
* Ledger Entry: Delegate
* Type: ltDELEGATE (0x0083)
* RPC Name: delegate
*
* Immutable wrapper around SLE providing type-safe field access.
* Use DelegateBuilder to construct new ledger entries.
*/
class Delegate : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltDELEGATE;
/**
* Construct a Delegate ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Delegate(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Delegate");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfAuthorize (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAuthorize() const
{
return this->sle_.at(sfAuthorize);
}
/**
* Get sfPermissions (soeREQUIRED)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
STArray const&
getPermissions() const
{
return this->sle_.getFieldArray(sfPermissions);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for Delegate ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class DelegateBuilder : public LedgerEntryBuilderBase<DelegateBuilder>
{
public:
DelegateBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_ACCOUNT::type::value_type> const& authorize,STArray const& permissions,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<DelegateBuilder>(ltDELEGATE)
{
setAccount(account);
setAuthorize(authorize);
setPermissions(permissions);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
DelegateBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltDELEGATE)
{
throw std::runtime_error("Invalid ledger entry type for Delegate");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfAuthorize (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateBuilder&
setAuthorize(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAuthorize] = value;
return *this;
}
/**
* Set sfPermissions (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateBuilder&
setPermissions(STArray const& value)
{
object_.setFieldArray(sfPermissions, value);
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed Delegate wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Delegate
build(uint256 const& index)
{
return Delegate{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,234 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class DepositPreauthBuilder;
/**
* Ledger Entry: DepositPreauth
* Type: ltDEPOSIT_PREAUTH (0x0070)
* RPC Name: deposit_preauth
*
* Immutable wrapper around SLE providing type-safe field access.
* Use DepositPreauthBuilder to construct new ledger entries.
*/
class DepositPreauth : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltDEPOSIT_PREAUTH;
/**
* Construct a DepositPreauth ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit DepositPreauth(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for DepositPreauth");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfAuthorize (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getAuthorize() const
{
if (hasAuthorize())
return this->sle_.at(sfAuthorize);
return std::nullopt;
}
[[nodiscard]]
bool
hasAuthorize() const
{
return this->sle_.isFieldPresent(sfAuthorize);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfAuthorizeCredentials (soeOPTIONAL)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getAuthorizeCredentials() const
{
if (this->sle_.isFieldPresent(sfAuthorizeCredentials))
return this->sle_.getFieldArray(sfAuthorizeCredentials);
return std::nullopt;
}
[[nodiscard]]
bool
hasAuthorizeCredentials() const
{
return this->sle_.isFieldPresent(sfAuthorizeCredentials);
}
};
/**
* Builder for DepositPreauth ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class DepositPreauthBuilder : public LedgerEntryBuilderBase<DepositPreauthBuilder>
{
public:
DepositPreauthBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<DepositPreauthBuilder>(ltDEPOSIT_PREAUTH)
{
setAccount(account);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
DepositPreauthBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltDEPOSIT_PREAUTH)
{
throw std::runtime_error("Invalid ledger entry type for DepositPreauth");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfAuthorize (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setAuthorize(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAuthorize] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfAuthorizeCredentials (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setAuthorizeCredentials(STArray const& value)
{
object_.setFieldArray(sfAuthorizeCredentials, value);
return *this;
}
/**
* Build and return the completed DepositPreauth wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
DepositPreauth
build(uint256 const& index)
{
return DepositPreauth{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,489 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class DirectoryNodeBuilder;
/**
* Ledger Entry: DirectoryNode
* Type: ltDIR_NODE (0x0064)
* RPC Name: directory
*
* Immutable wrapper around SLE providing type-safe field access.
* Use DirectoryNodeBuilder to construct new ledger entries.
*/
class DirectoryNode : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltDIR_NODE;
/**
* Construct a DirectoryNode ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit DirectoryNode(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for DirectoryNode");
}
}
// Ledger entry-specific field getters
/**
* Get sfOwner (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getOwner() const
{
if (hasOwner())
return this->sle_.at(sfOwner);
return std::nullopt;
}
[[nodiscard]]
bool
hasOwner() const
{
return this->sle_.isFieldPresent(sfOwner);
}
/**
* Get sfTakerPaysCurrency (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT160::type::value_type>
getTakerPaysCurrency() const
{
if (hasTakerPaysCurrency())
return this->sle_.at(sfTakerPaysCurrency);
return std::nullopt;
}
[[nodiscard]]
bool
hasTakerPaysCurrency() const
{
return this->sle_.isFieldPresent(sfTakerPaysCurrency);
}
/**
* Get sfTakerPaysIssuer (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT160::type::value_type>
getTakerPaysIssuer() const
{
if (hasTakerPaysIssuer())
return this->sle_.at(sfTakerPaysIssuer);
return std::nullopt;
}
[[nodiscard]]
bool
hasTakerPaysIssuer() const
{
return this->sle_.isFieldPresent(sfTakerPaysIssuer);
}
/**
* Get sfTakerGetsCurrency (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT160::type::value_type>
getTakerGetsCurrency() const
{
if (hasTakerGetsCurrency())
return this->sle_.at(sfTakerGetsCurrency);
return std::nullopt;
}
[[nodiscard]]
bool
hasTakerGetsCurrency() const
{
return this->sle_.isFieldPresent(sfTakerGetsCurrency);
}
/**
* Get sfTakerGetsIssuer (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT160::type::value_type>
getTakerGetsIssuer() const
{
if (hasTakerGetsIssuer())
return this->sle_.at(sfTakerGetsIssuer);
return std::nullopt;
}
[[nodiscard]]
bool
hasTakerGetsIssuer() const
{
return this->sle_.isFieldPresent(sfTakerGetsIssuer);
}
/**
* Get sfExchangeRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getExchangeRate() const
{
if (hasExchangeRate())
return this->sle_.at(sfExchangeRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasExchangeRate() const
{
return this->sle_.isFieldPresent(sfExchangeRate);
}
/**
* Get sfIndexes (soeREQUIRED)
*/
[[nodiscard]]
SF_VECTOR256::type::value_type
getIndexes() const
{
return this->sle_.at(sfIndexes);
}
/**
* Get sfRootIndex (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getRootIndex() const
{
return this->sle_.at(sfRootIndex);
}
/**
* Get sfIndexNext (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getIndexNext() const
{
if (hasIndexNext())
return this->sle_.at(sfIndexNext);
return std::nullopt;
}
[[nodiscard]]
bool
hasIndexNext() const
{
return this->sle_.isFieldPresent(sfIndexNext);
}
/**
* Get sfIndexPrevious (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getIndexPrevious() const
{
if (hasIndexPrevious())
return this->sle_.at(sfIndexPrevious);
return std::nullopt;
}
[[nodiscard]]
bool
hasIndexPrevious() const
{
return this->sle_.isFieldPresent(sfIndexPrevious);
}
/**
* Get sfNFTokenID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getNFTokenID() const
{
if (hasNFTokenID())
return this->sle_.at(sfNFTokenID);
return std::nullopt;
}
[[nodiscard]]
bool
hasNFTokenID() const
{
return this->sle_.isFieldPresent(sfNFTokenID);
}
/**
* Get sfPreviousTxnID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getPreviousTxnID() const
{
if (hasPreviousTxnID())
return this->sle_.at(sfPreviousTxnID);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnID() const
{
return this->sle_.isFieldPresent(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPreviousTxnLgrSeq() const
{
if (hasPreviousTxnLgrSeq())
return this->sle_.at(sfPreviousTxnLgrSeq);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnLgrSeq() const
{
return this->sle_.isFieldPresent(sfPreviousTxnLgrSeq);
}
/**
* Get sfDomainID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getDomainID() const
{
if (hasDomainID())
return this->sle_.at(sfDomainID);
return std::nullopt;
}
[[nodiscard]]
bool
hasDomainID() const
{
return this->sle_.isFieldPresent(sfDomainID);
}
};
/**
* Builder for DirectoryNode ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class DirectoryNodeBuilder : public LedgerEntryBuilderBase<DirectoryNodeBuilder>
{
public:
DirectoryNodeBuilder(std::decay_t<typename SF_VECTOR256::type::value_type> const& indexes,std::decay_t<typename SF_UINT256::type::value_type> const& rootIndex)
: LedgerEntryBuilderBase<DirectoryNodeBuilder>(ltDIR_NODE)
{
setIndexes(indexes);
setRootIndex(rootIndex);
}
DirectoryNodeBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltDIR_NODE)
{
throw std::runtime_error("Invalid ledger entry type for DirectoryNode");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfOwner (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfTakerPaysCurrency (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setTakerPaysCurrency(std::decay_t<typename SF_UINT160::type::value_type> const& value)
{
object_[sfTakerPaysCurrency] = value;
return *this;
}
/**
* Set sfTakerPaysIssuer (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setTakerPaysIssuer(std::decay_t<typename SF_UINT160::type::value_type> const& value)
{
object_[sfTakerPaysIssuer] = value;
return *this;
}
/**
* Set sfTakerGetsCurrency (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setTakerGetsCurrency(std::decay_t<typename SF_UINT160::type::value_type> const& value)
{
object_[sfTakerGetsCurrency] = value;
return *this;
}
/**
* Set sfTakerGetsIssuer (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setTakerGetsIssuer(std::decay_t<typename SF_UINT160::type::value_type> const& value)
{
object_[sfTakerGetsIssuer] = value;
return *this;
}
/**
* Set sfExchangeRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setExchangeRate(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfExchangeRate] = value;
return *this;
}
/**
* Set sfIndexes (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setIndexes(std::decay_t<typename SF_VECTOR256::type::value_type> const& value)
{
object_[sfIndexes] = value;
return *this;
}
/**
* Set sfRootIndex (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setRootIndex(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfRootIndex] = value;
return *this;
}
/**
* Set sfIndexNext (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setIndexNext(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfIndexNext] = value;
return *this;
}
/**
* Set sfIndexPrevious (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setIndexPrevious(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfIndexPrevious] = value;
return *this;
}
/**
* Set sfNFTokenID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setNFTokenID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfNFTokenID] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfDomainID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DirectoryNodeBuilder&
setDomainID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfDomainID] = value;
return *this;
}
/**
* Build and return the completed DirectoryNode wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
DirectoryNode
build(uint256 const& index)
{
return DirectoryNode{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,487 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class EscrowBuilder;
/**
* Ledger Entry: Escrow
* Type: ltESCROW (0x0075)
* RPC Name: escrow
*
* Immutable wrapper around SLE providing type-safe field access.
* Use EscrowBuilder to construct new ledger entries.
*/
class Escrow : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltESCROW;
/**
* Construct a Escrow ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Escrow(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Escrow");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfSequence (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getSequence() const
{
if (hasSequence())
return this->sle_.at(sfSequence);
return std::nullopt;
}
[[nodiscard]]
bool
hasSequence() const
{
return this->sle_.isFieldPresent(sfSequence);
}
/**
* Get sfDestination (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getDestination() const
{
return this->sle_.at(sfDestination);
}
/**
* Get sfAmount (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->sle_.at(sfAmount);
}
/**
* Get sfCondition (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getCondition() const
{
if (hasCondition())
return this->sle_.at(sfCondition);
return std::nullopt;
}
[[nodiscard]]
bool
hasCondition() const
{
return this->sle_.isFieldPresent(sfCondition);
}
/**
* Get sfCancelAfter (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCancelAfter() const
{
if (hasCancelAfter())
return this->sle_.at(sfCancelAfter);
return std::nullopt;
}
[[nodiscard]]
bool
hasCancelAfter() const
{
return this->sle_.isFieldPresent(sfCancelAfter);
}
/**
* Get sfFinishAfter (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getFinishAfter() const
{
if (hasFinishAfter())
return this->sle_.at(sfFinishAfter);
return std::nullopt;
}
[[nodiscard]]
bool
hasFinishAfter() const
{
return this->sle_.isFieldPresent(sfFinishAfter);
}
/**
* Get sfSourceTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getSourceTag() const
{
if (hasSourceTag())
return this->sle_.at(sfSourceTag);
return std::nullopt;
}
[[nodiscard]]
bool
hasSourceTag() const
{
return this->sle_.isFieldPresent(sfSourceTag);
}
/**
* Get sfDestinationTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getDestinationTag() const
{
if (hasDestinationTag())
return this->sle_.at(sfDestinationTag);
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationTag() const
{
return this->sle_.isFieldPresent(sfDestinationTag);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfDestinationNode (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getDestinationNode() const
{
if (hasDestinationNode())
return this->sle_.at(sfDestinationNode);
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationNode() const
{
return this->sle_.isFieldPresent(sfDestinationNode);
}
/**
* Get sfTransferRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getTransferRate() const
{
if (hasTransferRate())
return this->sle_.at(sfTransferRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasTransferRate() const
{
return this->sle_.isFieldPresent(sfTransferRate);
}
/**
* Get sfIssuerNode (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getIssuerNode() const
{
if (hasIssuerNode())
return this->sle_.at(sfIssuerNode);
return std::nullopt;
}
[[nodiscard]]
bool
hasIssuerNode() const
{
return this->sle_.isFieldPresent(sfIssuerNode);
}
};
/**
* Builder for Escrow ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class EscrowBuilder : public LedgerEntryBuilderBase<EscrowBuilder>
{
public:
EscrowBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_ACCOUNT::type::value_type> const& destination,std::decay_t<typename SF_AMOUNT::type::value_type> const& amount,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<EscrowBuilder>(ltESCROW)
{
setAccount(account);
setDestination(destination);
setAmount(amount);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
EscrowBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltESCROW)
{
throw std::runtime_error("Invalid ledger entry type for Escrow");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfSequence (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfDestination (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfCondition (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setCondition(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfCondition] = value;
return *this;
}
/**
* Set sfCancelAfter (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setCancelAfter(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCancelAfter] = value;
return *this;
}
/**
* Set sfFinishAfter (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setFinishAfter(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfFinishAfter] = value;
return *this;
}
/**
* Set sfSourceTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setSourceTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSourceTag] = value;
return *this;
}
/**
* Set sfDestinationTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setDestinationTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfDestinationTag] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfDestinationNode (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setDestinationNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfDestinationNode] = value;
return *this;
}
/**
* Set sfTransferRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setTransferRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfTransferRate] = value;
return *this;
}
/**
* Set sfIssuerNode (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowBuilder&
setIssuerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfIssuerNode] = value;
return *this;
}
/**
* Build and return the completed Escrow wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Escrow
build(uint256 const& index)
{
return Escrow{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,355 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class FeeSettingsBuilder;
/**
* Ledger Entry: FeeSettings
* Type: ltFEE_SETTINGS (0x0073)
* RPC Name: fee
*
* Immutable wrapper around SLE providing type-safe field access.
* Use FeeSettingsBuilder to construct new ledger entries.
*/
class FeeSettings : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltFEE_SETTINGS;
/**
* Construct a FeeSettings ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit FeeSettings(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for FeeSettings");
}
}
// Ledger entry-specific field getters
/**
* Get sfBaseFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getBaseFee() const
{
if (hasBaseFee())
return this->sle_.at(sfBaseFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasBaseFee() const
{
return this->sle_.isFieldPresent(sfBaseFee);
}
/**
* Get sfReferenceFeeUnits (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getReferenceFeeUnits() const
{
if (hasReferenceFeeUnits())
return this->sle_.at(sfReferenceFeeUnits);
return std::nullopt;
}
[[nodiscard]]
bool
hasReferenceFeeUnits() const
{
return this->sle_.isFieldPresent(sfReferenceFeeUnits);
}
/**
* Get sfReserveBase (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getReserveBase() const
{
if (hasReserveBase())
return this->sle_.at(sfReserveBase);
return std::nullopt;
}
[[nodiscard]]
bool
hasReserveBase() const
{
return this->sle_.isFieldPresent(sfReserveBase);
}
/**
* Get sfReserveIncrement (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getReserveIncrement() const
{
if (hasReserveIncrement())
return this->sle_.at(sfReserveIncrement);
return std::nullopt;
}
[[nodiscard]]
bool
hasReserveIncrement() const
{
return this->sle_.isFieldPresent(sfReserveIncrement);
}
/**
* Get sfBaseFeeDrops (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getBaseFeeDrops() const
{
if (hasBaseFeeDrops())
return this->sle_.at(sfBaseFeeDrops);
return std::nullopt;
}
[[nodiscard]]
bool
hasBaseFeeDrops() const
{
return this->sle_.isFieldPresent(sfBaseFeeDrops);
}
/**
* Get sfReserveBaseDrops (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getReserveBaseDrops() const
{
if (hasReserveBaseDrops())
return this->sle_.at(sfReserveBaseDrops);
return std::nullopt;
}
[[nodiscard]]
bool
hasReserveBaseDrops() const
{
return this->sle_.isFieldPresent(sfReserveBaseDrops);
}
/**
* Get sfReserveIncrementDrops (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getReserveIncrementDrops() const
{
if (hasReserveIncrementDrops())
return this->sle_.at(sfReserveIncrementDrops);
return std::nullopt;
}
[[nodiscard]]
bool
hasReserveIncrementDrops() const
{
return this->sle_.isFieldPresent(sfReserveIncrementDrops);
}
/**
* Get sfPreviousTxnID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getPreviousTxnID() const
{
if (hasPreviousTxnID())
return this->sle_.at(sfPreviousTxnID);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnID() const
{
return this->sle_.isFieldPresent(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPreviousTxnLgrSeq() const
{
if (hasPreviousTxnLgrSeq())
return this->sle_.at(sfPreviousTxnLgrSeq);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnLgrSeq() const
{
return this->sle_.isFieldPresent(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for FeeSettings ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class FeeSettingsBuilder : public LedgerEntryBuilderBase<FeeSettingsBuilder>
{
public:
FeeSettingsBuilder()
: LedgerEntryBuilderBase<FeeSettingsBuilder>(ltFEE_SETTINGS)
{
}
FeeSettingsBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltFEE_SETTINGS)
{
throw std::runtime_error("Invalid ledger entry type for FeeSettings");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfBaseFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setBaseFee(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfBaseFee] = value;
return *this;
}
/**
* Set sfReferenceFeeUnits (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setReferenceFeeUnits(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfReferenceFeeUnits] = value;
return *this;
}
/**
* Set sfReserveBase (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setReserveBase(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfReserveBase] = value;
return *this;
}
/**
* Set sfReserveIncrement (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setReserveIncrement(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfReserveIncrement] = value;
return *this;
}
/**
* Set sfBaseFeeDrops (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setBaseFeeDrops(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfBaseFeeDrops] = value;
return *this;
}
/**
* Set sfReserveBaseDrops (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setReserveBaseDrops(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfReserveBaseDrops] = value;
return *this;
}
/**
* Set sfReserveIncrementDrops (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setReserveIncrementDrops(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfReserveIncrementDrops] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
FeeSettingsBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed FeeSettings wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
FeeSettings
build(uint256 const& index)
{
return FeeSettings{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,167 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class LedgerHashesBuilder;
/**
* Ledger Entry: LedgerHashes
* Type: ltLEDGER_HASHES (0x0068)
* RPC Name: hashes
*
* Immutable wrapper around SLE providing type-safe field access.
* Use LedgerHashesBuilder to construct new ledger entries.
*/
class LedgerHashes : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltLEDGER_HASHES;
/**
* Construct a LedgerHashes ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit LedgerHashes(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for LedgerHashes");
}
}
// Ledger entry-specific field getters
/**
* Get sfFirstLedgerSequence (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getFirstLedgerSequence() const
{
if (hasFirstLedgerSequence())
return this->sle_.at(sfFirstLedgerSequence);
return std::nullopt;
}
[[nodiscard]]
bool
hasFirstLedgerSequence() const
{
return this->sle_.isFieldPresent(sfFirstLedgerSequence);
}
/**
* Get sfLastLedgerSequence (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getLastLedgerSequence() const
{
if (hasLastLedgerSequence())
return this->sle_.at(sfLastLedgerSequence);
return std::nullopt;
}
[[nodiscard]]
bool
hasLastLedgerSequence() const
{
return this->sle_.isFieldPresent(sfLastLedgerSequence);
}
/**
* Get sfHashes (soeREQUIRED)
*/
[[nodiscard]]
SF_VECTOR256::type::value_type
getHashes() const
{
return this->sle_.at(sfHashes);
}
};
/**
* Builder for LedgerHashes ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class LedgerHashesBuilder : public LedgerEntryBuilderBase<LedgerHashesBuilder>
{
public:
LedgerHashesBuilder(std::decay_t<typename SF_VECTOR256::type::value_type> const& hashes)
: LedgerEntryBuilderBase<LedgerHashesBuilder>(ltLEDGER_HASHES)
{
setHashes(hashes);
}
LedgerHashesBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltLEDGER_HASHES)
{
throw std::runtime_error("Invalid ledger entry type for LedgerHashes");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfFirstLedgerSequence (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LedgerHashesBuilder&
setFirstLedgerSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfFirstLedgerSequence] = value;
return *this;
}
/**
* Set sfLastLedgerSequence (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LedgerHashesBuilder&
setLastLedgerSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLastLedgerSequence] = value;
return *this;
}
/**
* Set sfHashes (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LedgerHashesBuilder&
setHashes(std::decay_t<typename SF_VECTOR256::type::value_type> const& value)
{
object_[sfHashes] = value;
return *this;
}
/**
* Build and return the completed LedgerHashes wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
LedgerHashes
build(uint256 const& index)
{
return LedgerHashes{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,815 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class LoanBuilder;
/**
* Ledger Entry: Loan
* Type: ltLOAN (0x0089)
* RPC Name: loan
*
* Immutable wrapper around SLE providing type-safe field access.
* Use LoanBuilder to construct new ledger entries.
*/
class Loan : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltLOAN;
/**
* Construct a Loan ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Loan(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Loan");
}
}
// Ledger entry-specific field getters
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfLoanBrokerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getLoanBrokerNode() const
{
return this->sle_.at(sfLoanBrokerNode);
}
/**
* Get sfLoanBrokerID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanBrokerID() const
{
return this->sle_.at(sfLoanBrokerID);
}
/**
* Get sfLoanSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getLoanSequence() const
{
return this->sle_.at(sfLoanSequence);
}
/**
* Get sfBorrower (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getBorrower() const
{
return this->sle_.at(sfBorrower);
}
/**
* Get sfLoanOriginationFee (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getLoanOriginationFee() const
{
if (hasLoanOriginationFee())
return this->sle_.at(sfLoanOriginationFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanOriginationFee() const
{
return this->sle_.isFieldPresent(sfLoanOriginationFee);
}
/**
* Get sfLoanServiceFee (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getLoanServiceFee() const
{
if (hasLoanServiceFee())
return this->sle_.at(sfLoanServiceFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanServiceFee() const
{
return this->sle_.isFieldPresent(sfLoanServiceFee);
}
/**
* Get sfLatePaymentFee (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getLatePaymentFee() const
{
if (hasLatePaymentFee())
return this->sle_.at(sfLatePaymentFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasLatePaymentFee() const
{
return this->sle_.isFieldPresent(sfLatePaymentFee);
}
/**
* Get sfClosePaymentFee (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getClosePaymentFee() const
{
if (hasClosePaymentFee())
return this->sle_.at(sfClosePaymentFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasClosePaymentFee() const
{
return this->sle_.isFieldPresent(sfClosePaymentFee);
}
/**
* Get sfOverpaymentFee (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getOverpaymentFee() const
{
if (hasOverpaymentFee())
return this->sle_.at(sfOverpaymentFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasOverpaymentFee() const
{
return this->sle_.isFieldPresent(sfOverpaymentFee);
}
/**
* Get sfInterestRate (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getInterestRate() const
{
if (hasInterestRate())
return this->sle_.at(sfInterestRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasInterestRate() const
{
return this->sle_.isFieldPresent(sfInterestRate);
}
/**
* Get sfLateInterestRate (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getLateInterestRate() const
{
if (hasLateInterestRate())
return this->sle_.at(sfLateInterestRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasLateInterestRate() const
{
return this->sle_.isFieldPresent(sfLateInterestRate);
}
/**
* Get sfCloseInterestRate (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCloseInterestRate() const
{
if (hasCloseInterestRate())
return this->sle_.at(sfCloseInterestRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasCloseInterestRate() const
{
return this->sle_.isFieldPresent(sfCloseInterestRate);
}
/**
* Get sfOverpaymentInterestRate (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getOverpaymentInterestRate() const
{
if (hasOverpaymentInterestRate())
return this->sle_.at(sfOverpaymentInterestRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasOverpaymentInterestRate() const
{
return this->sle_.isFieldPresent(sfOverpaymentInterestRate);
}
/**
* Get sfStartDate (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getStartDate() const
{
return this->sle_.at(sfStartDate);
}
/**
* Get sfPaymentInterval (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPaymentInterval() const
{
return this->sle_.at(sfPaymentInterval);
}
/**
* Get sfGracePeriod (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getGracePeriod() const
{
if (hasGracePeriod())
return this->sle_.at(sfGracePeriod);
return std::nullopt;
}
[[nodiscard]]
bool
hasGracePeriod() const
{
return this->sle_.isFieldPresent(sfGracePeriod);
}
/**
* Get sfPreviousPaymentDueDate (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPreviousPaymentDueDate() const
{
if (hasPreviousPaymentDueDate())
return this->sle_.at(sfPreviousPaymentDueDate);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousPaymentDueDate() const
{
return this->sle_.isFieldPresent(sfPreviousPaymentDueDate);
}
/**
* Get sfNextPaymentDueDate (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getNextPaymentDueDate() const
{
if (hasNextPaymentDueDate())
return this->sle_.at(sfNextPaymentDueDate);
return std::nullopt;
}
[[nodiscard]]
bool
hasNextPaymentDueDate() const
{
return this->sle_.isFieldPresent(sfNextPaymentDueDate);
}
/**
* Get sfPaymentRemaining (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPaymentRemaining() const
{
if (hasPaymentRemaining())
return this->sle_.at(sfPaymentRemaining);
return std::nullopt;
}
[[nodiscard]]
bool
hasPaymentRemaining() const
{
return this->sle_.isFieldPresent(sfPaymentRemaining);
}
/**
* Get sfPeriodicPayment (soeREQUIRED)
*/
[[nodiscard]]
SF_NUMBER::type::value_type
getPeriodicPayment() const
{
return this->sle_.at(sfPeriodicPayment);
}
/**
* Get sfPrincipalOutstanding (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getPrincipalOutstanding() const
{
if (hasPrincipalOutstanding())
return this->sle_.at(sfPrincipalOutstanding);
return std::nullopt;
}
[[nodiscard]]
bool
hasPrincipalOutstanding() const
{
return this->sle_.isFieldPresent(sfPrincipalOutstanding);
}
/**
* Get sfTotalValueOutstanding (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getTotalValueOutstanding() const
{
if (hasTotalValueOutstanding())
return this->sle_.at(sfTotalValueOutstanding);
return std::nullopt;
}
[[nodiscard]]
bool
hasTotalValueOutstanding() const
{
return this->sle_.isFieldPresent(sfTotalValueOutstanding);
}
/**
* Get sfManagementFeeOutstanding (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getManagementFeeOutstanding() const
{
if (hasManagementFeeOutstanding())
return this->sle_.at(sfManagementFeeOutstanding);
return std::nullopt;
}
[[nodiscard]]
bool
hasManagementFeeOutstanding() const
{
return this->sle_.isFieldPresent(sfManagementFeeOutstanding);
}
/**
* Get sfLoanScale (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_INT32::type::value_type>
getLoanScale() const
{
if (hasLoanScale())
return this->sle_.at(sfLoanScale);
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanScale() const
{
return this->sle_.isFieldPresent(sfLoanScale);
}
};
/**
* Builder for Loan ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class LoanBuilder : public LedgerEntryBuilderBase<LoanBuilder>
{
public:
LoanBuilder(std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT64::type::value_type> const& loanBrokerNode,std::decay_t<typename SF_UINT256::type::value_type> const& loanBrokerID,std::decay_t<typename SF_UINT32::type::value_type> const& loanSequence,std::decay_t<typename SF_ACCOUNT::type::value_type> const& borrower,std::decay_t<typename SF_UINT32::type::value_type> const& startDate,std::decay_t<typename SF_UINT32::type::value_type> const& paymentInterval,std::decay_t<typename SF_NUMBER::type::value_type> const& periodicPayment)
: LedgerEntryBuilderBase<LoanBuilder>(ltLOAN)
{
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
setOwnerNode(ownerNode);
setLoanBrokerNode(loanBrokerNode);
setLoanBrokerID(loanBrokerID);
setLoanSequence(loanSequence);
setBorrower(borrower);
setStartDate(startDate);
setPaymentInterval(paymentInterval);
setPeriodicPayment(periodicPayment);
}
LoanBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltLOAN)
{
throw std::runtime_error("Invalid ledger entry type for Loan");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfLoanBrokerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLoanBrokerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfLoanBrokerNode] = value;
return *this;
}
/**
* Set sfLoanBrokerID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Set sfLoanSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLoanSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLoanSequence] = value;
return *this;
}
/**
* Set sfBorrower (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setBorrower(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfBorrower] = value;
return *this;
}
/**
* Set sfLoanOriginationFee (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLoanOriginationFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfLoanOriginationFee] = value;
return *this;
}
/**
* Set sfLoanServiceFee (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLoanServiceFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfLoanServiceFee] = value;
return *this;
}
/**
* Set sfLatePaymentFee (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLatePaymentFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfLatePaymentFee] = value;
return *this;
}
/**
* Set sfClosePaymentFee (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setClosePaymentFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfClosePaymentFee] = value;
return *this;
}
/**
* Set sfOverpaymentFee (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setOverpaymentFee(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOverpaymentFee] = value;
return *this;
}
/**
* Set sfInterestRate (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfInterestRate] = value;
return *this;
}
/**
* Set sfLateInterestRate (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLateInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLateInterestRate] = value;
return *this;
}
/**
* Set sfCloseInterestRate (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setCloseInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCloseInterestRate] = value;
return *this;
}
/**
* Set sfOverpaymentInterestRate (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setOverpaymentInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOverpaymentInterestRate] = value;
return *this;
}
/**
* Set sfStartDate (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setStartDate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfStartDate] = value;
return *this;
}
/**
* Set sfPaymentInterval (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setPaymentInterval(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPaymentInterval] = value;
return *this;
}
/**
* Set sfGracePeriod (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setGracePeriod(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfGracePeriod] = value;
return *this;
}
/**
* Set sfPreviousPaymentDueDate (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setPreviousPaymentDueDate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousPaymentDueDate] = value;
return *this;
}
/**
* Set sfNextPaymentDueDate (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setNextPaymentDueDate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfNextPaymentDueDate] = value;
return *this;
}
/**
* Set sfPaymentRemaining (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setPaymentRemaining(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPaymentRemaining] = value;
return *this;
}
/**
* Set sfPeriodicPayment (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setPeriodicPayment(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfPeriodicPayment] = value;
return *this;
}
/**
* Set sfPrincipalOutstanding (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setPrincipalOutstanding(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfPrincipalOutstanding] = value;
return *this;
}
/**
* Set sfTotalValueOutstanding (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setTotalValueOutstanding(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfTotalValueOutstanding] = value;
return *this;
}
/**
* Set sfManagementFeeOutstanding (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setManagementFeeOutstanding(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfManagementFeeOutstanding] = value;
return *this;
}
/**
* Set sfLoanScale (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBuilder&
setLoanScale(std::decay_t<typename SF_INT32::type::value_type> const& value)
{
object_[sfLoanScale] = value;
return *this;
}
/**
* Build and return the completed Loan wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Loan
build(uint256 const& index)
{
return Loan{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,523 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class LoanBrokerBuilder;
/**
* Ledger Entry: LoanBroker
* Type: ltLOAN_BROKER (0x0088)
* RPC Name: loan_broker
*
* Immutable wrapper around SLE providing type-safe field access.
* Use LoanBrokerBuilder to construct new ledger entries.
*/
class LoanBroker : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltLOAN_BROKER;
/**
* Construct a LoanBroker ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit LoanBroker(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for LoanBroker");
}
}
// Ledger entry-specific field getters
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSequence() const
{
return this->sle_.at(sfSequence);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfVaultNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getVaultNode() const
{
return this->sle_.at(sfVaultNode);
}
/**
* Get sfVaultID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getVaultID() const
{
return this->sle_.at(sfVaultID);
}
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfOwner (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOwner() const
{
return this->sle_.at(sfOwner);
}
/**
* Get sfLoanSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getLoanSequence() const
{
return this->sle_.at(sfLoanSequence);
}
/**
* Get sfData (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getData() const
{
if (hasData())
return this->sle_.at(sfData);
return std::nullopt;
}
[[nodiscard]]
bool
hasData() const
{
return this->sle_.isFieldPresent(sfData);
}
/**
* Get sfManagementFeeRate (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getManagementFeeRate() const
{
if (hasManagementFeeRate())
return this->sle_.at(sfManagementFeeRate);
return std::nullopt;
}
[[nodiscard]]
bool
hasManagementFeeRate() const
{
return this->sle_.isFieldPresent(sfManagementFeeRate);
}
/**
* Get sfOwnerCount (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getOwnerCount() const
{
if (hasOwnerCount())
return this->sle_.at(sfOwnerCount);
return std::nullopt;
}
[[nodiscard]]
bool
hasOwnerCount() const
{
return this->sle_.isFieldPresent(sfOwnerCount);
}
/**
* Get sfDebtTotal (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getDebtTotal() const
{
if (hasDebtTotal())
return this->sle_.at(sfDebtTotal);
return std::nullopt;
}
[[nodiscard]]
bool
hasDebtTotal() const
{
return this->sle_.isFieldPresent(sfDebtTotal);
}
/**
* Get sfDebtMaximum (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getDebtMaximum() const
{
if (hasDebtMaximum())
return this->sle_.at(sfDebtMaximum);
return std::nullopt;
}
[[nodiscard]]
bool
hasDebtMaximum() const
{
return this->sle_.isFieldPresent(sfDebtMaximum);
}
/**
* Get sfCoverAvailable (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getCoverAvailable() const
{
if (hasCoverAvailable())
return this->sle_.at(sfCoverAvailable);
return std::nullopt;
}
[[nodiscard]]
bool
hasCoverAvailable() const
{
return this->sle_.isFieldPresent(sfCoverAvailable);
}
/**
* Get sfCoverRateMinimum (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCoverRateMinimum() const
{
if (hasCoverRateMinimum())
return this->sle_.at(sfCoverRateMinimum);
return std::nullopt;
}
[[nodiscard]]
bool
hasCoverRateMinimum() const
{
return this->sle_.isFieldPresent(sfCoverRateMinimum);
}
/**
* Get sfCoverRateLiquidation (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCoverRateLiquidation() const
{
if (hasCoverRateLiquidation())
return this->sle_.at(sfCoverRateLiquidation);
return std::nullopt;
}
[[nodiscard]]
bool
hasCoverRateLiquidation() const
{
return this->sle_.isFieldPresent(sfCoverRateLiquidation);
}
};
/**
* Builder for LoanBroker ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class LoanBrokerBuilder : public LedgerEntryBuilderBase<LoanBrokerBuilder>
{
public:
LoanBrokerBuilder(std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq,std::decay_t<typename SF_UINT32::type::value_type> const& sequence,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT64::type::value_type> const& vaultNode,std::decay_t<typename SF_UINT256::type::value_type> const& vaultID,std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_ACCOUNT::type::value_type> const& owner,std::decay_t<typename SF_UINT32::type::value_type> const& loanSequence)
: LedgerEntryBuilderBase<LoanBrokerBuilder>(ltLOAN_BROKER)
{
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
setSequence(sequence);
setOwnerNode(ownerNode);
setVaultNode(vaultNode);
setVaultID(vaultID);
setAccount(account);
setOwner(owner);
setLoanSequence(loanSequence);
}
LoanBrokerBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltLOAN_BROKER)
{
throw std::runtime_error("Invalid ledger entry type for LoanBroker");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfVaultNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setVaultNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfVaultNode] = value;
return *this;
}
/**
* Set sfVaultID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setVaultID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfVaultID] = value;
return *this;
}
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfOwner (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfLoanSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setLoanSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLoanSequence] = value;
return *this;
}
/**
* Set sfData (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setData(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfData] = value;
return *this;
}
/**
* Set sfManagementFeeRate (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setManagementFeeRate(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfManagementFeeRate] = value;
return *this;
}
/**
* Set sfOwnerCount (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setOwnerCount(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOwnerCount] = value;
return *this;
}
/**
* Set sfDebtTotal (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setDebtTotal(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfDebtTotal] = value;
return *this;
}
/**
* Set sfDebtMaximum (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setDebtMaximum(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfDebtMaximum] = value;
return *this;
}
/**
* Set sfCoverAvailable (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setCoverAvailable(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfCoverAvailable] = value;
return *this;
}
/**
* Set sfCoverRateMinimum (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setCoverRateMinimum(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCoverRateMinimum] = value;
return *this;
}
/**
* Set sfCoverRateLiquidation (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
LoanBrokerBuilder&
setCoverRateLiquidation(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCoverRateLiquidation] = value;
return *this;
}
/**
* Build and return the completed LoanBroker wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
LoanBroker
build(uint256 const& index)
{
return LoanBroker{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,255 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class MPTokenBuilder;
/**
* Ledger Entry: MPToken
* Type: ltMPTOKEN (0x007f)
* RPC Name: mptoken
*
* Immutable wrapper around SLE providing type-safe field access.
* Use MPTokenBuilder to construct new ledger entries.
*/
class MPToken : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltMPTOKEN;
/**
* Construct a MPToken ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit MPToken(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for MPToken");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfMPTokenIssuanceID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT192::type::value_type
getMPTokenIssuanceID() const
{
return this->sle_.at(sfMPTokenIssuanceID);
}
/**
* Get sfMPTAmount (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getMPTAmount() const
{
if (hasMPTAmount())
return this->sle_.at(sfMPTAmount);
return std::nullopt;
}
[[nodiscard]]
bool
hasMPTAmount() const
{
return this->sle_.isFieldPresent(sfMPTAmount);
}
/**
* Get sfLockedAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getLockedAmount() const
{
if (hasLockedAmount())
return this->sle_.at(sfLockedAmount);
return std::nullopt;
}
[[nodiscard]]
bool
hasLockedAmount() const
{
return this->sle_.isFieldPresent(sfLockedAmount);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for MPToken ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class MPTokenBuilder : public LedgerEntryBuilderBase<MPTokenBuilder>
{
public:
MPTokenBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_UINT192::type::value_type> const& mPTokenIssuanceID,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<MPTokenBuilder>(ltMPTOKEN)
{
setAccount(account);
setMPTokenIssuanceID(mPTokenIssuanceID);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
MPTokenBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltMPTOKEN)
{
throw std::runtime_error("Invalid ledger entry type for MPToken");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfMPTokenIssuanceID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenBuilder&
setMPTokenIssuanceID(std::decay_t<typename SF_UINT192::type::value_type> const& value)
{
object_[sfMPTokenIssuanceID] = value;
return *this;
}
/**
* Set sfMPTAmount (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
MPTokenBuilder&
setMPTAmount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfMPTAmount] = value;
return *this;
}
/**
* Set sfLockedAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenBuilder&
setLockedAmount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfLockedAmount] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed MPToken wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
MPToken
build(uint256 const& index)
{
return MPToken{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,427 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class MPTokenIssuanceBuilder;
/**
* Ledger Entry: MPTokenIssuance
* Type: ltMPTOKEN_ISSUANCE (0x007e)
* RPC Name: mpt_issuance
*
* Immutable wrapper around SLE providing type-safe field access.
* Use MPTokenIssuanceBuilder to construct new ledger entries.
*/
class MPTokenIssuance : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltMPTOKEN_ISSUANCE;
/**
* Construct a MPTokenIssuance ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit MPTokenIssuance(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for MPTokenIssuance");
}
}
// Ledger entry-specific field getters
/**
* Get sfIssuer (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getIssuer() const
{
return this->sle_.at(sfIssuer);
}
/**
* Get sfSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSequence() const
{
return this->sle_.at(sfSequence);
}
/**
* Get sfTransferFee (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getTransferFee() const
{
if (hasTransferFee())
return this->sle_.at(sfTransferFee);
return std::nullopt;
}
[[nodiscard]]
bool
hasTransferFee() const
{
return this->sle_.isFieldPresent(sfTransferFee);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfAssetScale (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT8::type::value_type>
getAssetScale() const
{
if (hasAssetScale())
return this->sle_.at(sfAssetScale);
return std::nullopt;
}
[[nodiscard]]
bool
hasAssetScale() const
{
return this->sle_.isFieldPresent(sfAssetScale);
}
/**
* Get sfMaximumAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getMaximumAmount() const
{
if (hasMaximumAmount())
return this->sle_.at(sfMaximumAmount);
return std::nullopt;
}
[[nodiscard]]
bool
hasMaximumAmount() const
{
return this->sle_.isFieldPresent(sfMaximumAmount);
}
/**
* Get sfOutstandingAmount (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOutstandingAmount() const
{
return this->sle_.at(sfOutstandingAmount);
}
/**
* Get sfLockedAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getLockedAmount() const
{
if (hasLockedAmount())
return this->sle_.at(sfLockedAmount);
return std::nullopt;
}
[[nodiscard]]
bool
hasLockedAmount() const
{
return this->sle_.isFieldPresent(sfLockedAmount);
}
/**
* Get sfMPTokenMetadata (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getMPTokenMetadata() const
{
if (hasMPTokenMetadata())
return this->sle_.at(sfMPTokenMetadata);
return std::nullopt;
}
[[nodiscard]]
bool
hasMPTokenMetadata() const
{
return this->sle_.isFieldPresent(sfMPTokenMetadata);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfDomainID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getDomainID() const
{
if (hasDomainID())
return this->sle_.at(sfDomainID);
return std::nullopt;
}
[[nodiscard]]
bool
hasDomainID() const
{
return this->sle_.isFieldPresent(sfDomainID);
}
/**
* Get sfMutableFlags (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getMutableFlags() const
{
if (hasMutableFlags())
return this->sle_.at(sfMutableFlags);
return std::nullopt;
}
[[nodiscard]]
bool
hasMutableFlags() const
{
return this->sle_.isFieldPresent(sfMutableFlags);
}
};
/**
* Builder for MPTokenIssuance ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class MPTokenIssuanceBuilder : public LedgerEntryBuilderBase<MPTokenIssuanceBuilder>
{
public:
MPTokenIssuanceBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& issuer,std::decay_t<typename SF_UINT32::type::value_type> const& sequence,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT64::type::value_type> const& outstandingAmount,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<MPTokenIssuanceBuilder>(ltMPTOKEN_ISSUANCE)
{
setIssuer(issuer);
setSequence(sequence);
setOwnerNode(ownerNode);
setOutstandingAmount(outstandingAmount);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
MPTokenIssuanceBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltMPTOKEN_ISSUANCE)
{
throw std::runtime_error("Invalid ledger entry type for MPTokenIssuance");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfIssuer (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setIssuer(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfIssuer] = value;
return *this;
}
/**
* Set sfSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfTransferFee (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setTransferFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTransferFee] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfAssetScale (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setAssetScale(std::decay_t<typename SF_UINT8::type::value_type> const& value)
{
object_[sfAssetScale] = value;
return *this;
}
/**
* Set sfMaximumAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setMaximumAmount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfMaximumAmount] = value;
return *this;
}
/**
* Set sfOutstandingAmount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setOutstandingAmount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOutstandingAmount] = value;
return *this;
}
/**
* Set sfLockedAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setLockedAmount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfLockedAmount] = value;
return *this;
}
/**
* Set sfMPTokenMetadata (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setMPTokenMetadata(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfMPTokenMetadata] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfDomainID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setDomainID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfDomainID] = value;
return *this;
}
/**
* Set sfMutableFlags (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceBuilder&
setMutableFlags(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfMutableFlags] = value;
return *this;
}
/**
* Build and return the completed MPTokenIssuance wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
MPTokenIssuance
build(uint256 const& index)
{
return MPTokenIssuance{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,299 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class NFTokenOfferBuilder;
/**
* Ledger Entry: NFTokenOffer
* Type: ltNFTOKEN_OFFER (0x0037)
* RPC Name: nft_offer
*
* Immutable wrapper around SLE providing type-safe field access.
* Use NFTokenOfferBuilder to construct new ledger entries.
*/
class NFTokenOffer : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltNFTOKEN_OFFER;
/**
* Construct a NFTokenOffer ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit NFTokenOffer(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for NFTokenOffer");
}
}
// Ledger entry-specific field getters
/**
* Get sfOwner (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOwner() const
{
return this->sle_.at(sfOwner);
}
/**
* Get sfNFTokenID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getNFTokenID() const
{
return this->sle_.at(sfNFTokenID);
}
/**
* Get sfAmount (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->sle_.at(sfAmount);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfNFTokenOfferNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getNFTokenOfferNode() const
{
return this->sle_.at(sfNFTokenOfferNode);
}
/**
* Get sfDestination (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getDestination() const
{
if (hasDestination())
return this->sle_.at(sfDestination);
return std::nullopt;
}
[[nodiscard]]
bool
hasDestination() const
{
return this->sle_.isFieldPresent(sfDestination);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
return this->sle_.at(sfExpiration);
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->sle_.isFieldPresent(sfExpiration);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for NFTokenOffer ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class NFTokenOfferBuilder : public LedgerEntryBuilderBase<NFTokenOfferBuilder>
{
public:
NFTokenOfferBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& owner,std::decay_t<typename SF_UINT256::type::value_type> const& nFTokenID,std::decay_t<typename SF_AMOUNT::type::value_type> const& amount,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT64::type::value_type> const& nFTokenOfferNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<NFTokenOfferBuilder>(ltNFTOKEN_OFFER)
{
setOwner(owner);
setNFTokenID(nFTokenID);
setAmount(amount);
setOwnerNode(ownerNode);
setNFTokenOfferNode(nFTokenOfferNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
NFTokenOfferBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltNFTOKEN_OFFER)
{
throw std::runtime_error("Invalid ledger entry type for NFTokenOffer");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfOwner (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfNFTokenID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setNFTokenID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfNFTokenID] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfNFTokenOfferNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setNFTokenOfferNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfNFTokenOfferNode] = value;
return *this;
}
/**
* Set sfDestination (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenOfferBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed NFTokenOffer wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
NFTokenOffer
build(uint256 const& index)
{
return NFTokenOffer{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,212 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class NFTokenPageBuilder;
/**
* Ledger Entry: NFTokenPage
* Type: ltNFTOKEN_PAGE (0x0050)
* RPC Name: nft_page
*
* Immutable wrapper around SLE providing type-safe field access.
* Use NFTokenPageBuilder to construct new ledger entries.
*/
class NFTokenPage : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltNFTOKEN_PAGE;
/**
* Construct a NFTokenPage ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit NFTokenPage(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for NFTokenPage");
}
}
// Ledger entry-specific field getters
/**
* Get sfPreviousPageMin (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getPreviousPageMin() const
{
if (hasPreviousPageMin())
return this->sle_.at(sfPreviousPageMin);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousPageMin() const
{
return this->sle_.isFieldPresent(sfPreviousPageMin);
}
/**
* Get sfNextPageMin (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getNextPageMin() const
{
if (hasNextPageMin())
return this->sle_.at(sfNextPageMin);
return std::nullopt;
}
[[nodiscard]]
bool
hasNextPageMin() const
{
return this->sle_.isFieldPresent(sfNextPageMin);
}
/**
* Get sfNFTokens (soeREQUIRED)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
STArray const&
getNFTokens() const
{
return this->sle_.getFieldArray(sfNFTokens);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for NFTokenPage ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class NFTokenPageBuilder : public LedgerEntryBuilderBase<NFTokenPageBuilder>
{
public:
NFTokenPageBuilder(STArray const& nFTokens,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<NFTokenPageBuilder>(ltNFTOKEN_PAGE)
{
setNFTokens(nFTokens);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
NFTokenPageBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltNFTOKEN_PAGE)
{
throw std::runtime_error("Invalid ledger entry type for NFTokenPage");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfPreviousPageMin (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenPageBuilder&
setPreviousPageMin(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousPageMin] = value;
return *this;
}
/**
* Set sfNextPageMin (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenPageBuilder&
setNextPageMin(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfNextPageMin] = value;
return *this;
}
/**
* Set sfNFTokens (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenPageBuilder&
setNFTokens(STArray const& value)
{
object_.setFieldArray(sfNFTokens, value);
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenPageBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenPageBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed NFTokenPage wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
NFTokenPage
build(uint256 const& index)
{
return NFTokenPage{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,236 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class NegativeUNLBuilder;
/**
* Ledger Entry: NegativeUNL
* Type: ltNEGATIVE_UNL (0x004e)
* RPC Name: nunl
*
* Immutable wrapper around SLE providing type-safe field access.
* Use NegativeUNLBuilder to construct new ledger entries.
*/
class NegativeUNL : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltNEGATIVE_UNL;
/**
* Construct a NegativeUNL ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit NegativeUNL(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for NegativeUNL");
}
}
// Ledger entry-specific field getters
/**
* Get sfDisabledValidators (soeOPTIONAL)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getDisabledValidators() const
{
if (this->sle_.isFieldPresent(sfDisabledValidators))
return this->sle_.getFieldArray(sfDisabledValidators);
return std::nullopt;
}
[[nodiscard]]
bool
hasDisabledValidators() const
{
return this->sle_.isFieldPresent(sfDisabledValidators);
}
/**
* Get sfValidatorToDisable (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getValidatorToDisable() const
{
if (hasValidatorToDisable())
return this->sle_.at(sfValidatorToDisable);
return std::nullopt;
}
[[nodiscard]]
bool
hasValidatorToDisable() const
{
return this->sle_.isFieldPresent(sfValidatorToDisable);
}
/**
* Get sfValidatorToReEnable (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getValidatorToReEnable() const
{
if (hasValidatorToReEnable())
return this->sle_.at(sfValidatorToReEnable);
return std::nullopt;
}
[[nodiscard]]
bool
hasValidatorToReEnable() const
{
return this->sle_.isFieldPresent(sfValidatorToReEnable);
}
/**
* Get sfPreviousTxnID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getPreviousTxnID() const
{
if (hasPreviousTxnID())
return this->sle_.at(sfPreviousTxnID);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnID() const
{
return this->sle_.isFieldPresent(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPreviousTxnLgrSeq() const
{
if (hasPreviousTxnLgrSeq())
return this->sle_.at(sfPreviousTxnLgrSeq);
return std::nullopt;
}
[[nodiscard]]
bool
hasPreviousTxnLgrSeq() const
{
return this->sle_.isFieldPresent(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for NegativeUNL ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class NegativeUNLBuilder : public LedgerEntryBuilderBase<NegativeUNLBuilder>
{
public:
NegativeUNLBuilder()
: LedgerEntryBuilderBase<NegativeUNLBuilder>(ltNEGATIVE_UNL)
{
}
NegativeUNLBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltNEGATIVE_UNL)
{
throw std::runtime_error("Invalid ledger entry type for NegativeUNL");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfDisabledValidators (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NegativeUNLBuilder&
setDisabledValidators(STArray const& value)
{
object_.setFieldArray(sfDisabledValidators, value);
return *this;
}
/**
* Set sfValidatorToDisable (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NegativeUNLBuilder&
setValidatorToDisable(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfValidatorToDisable] = value;
return *this;
}
/**
* Set sfValidatorToReEnable (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NegativeUNLBuilder&
setValidatorToReEnable(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfValidatorToReEnable] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NegativeUNLBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NegativeUNLBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed NegativeUNL wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
NegativeUNL
build(uint256 const& index)
{
return NegativeUNL{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,374 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class OfferBuilder;
/**
* Ledger Entry: Offer
* Type: ltOFFER (0x006f)
* RPC Name: offer
*
* Immutable wrapper around SLE providing type-safe field access.
* Use OfferBuilder to construct new ledger entries.
*/
class Offer : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltOFFER;
/**
* Construct a Offer ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Offer(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Offer");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSequence() const
{
return this->sle_.at(sfSequence);
}
/**
* Get sfTakerPays (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getTakerPays() const
{
return this->sle_.at(sfTakerPays);
}
/**
* Get sfTakerGets (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getTakerGets() const
{
return this->sle_.at(sfTakerGets);
}
/**
* Get sfBookDirectory (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getBookDirectory() const
{
return this->sle_.at(sfBookDirectory);
}
/**
* Get sfBookNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getBookNode() const
{
return this->sle_.at(sfBookNode);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
return this->sle_.at(sfExpiration);
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->sle_.isFieldPresent(sfExpiration);
}
/**
* Get sfDomainID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getDomainID() const
{
if (hasDomainID())
return this->sle_.at(sfDomainID);
return std::nullopt;
}
[[nodiscard]]
bool
hasDomainID() const
{
return this->sle_.isFieldPresent(sfDomainID);
}
/**
* Get sfAdditionalBooks (soeOPTIONAL)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getAdditionalBooks() const
{
if (this->sle_.isFieldPresent(sfAdditionalBooks))
return this->sle_.getFieldArray(sfAdditionalBooks);
return std::nullopt;
}
[[nodiscard]]
bool
hasAdditionalBooks() const
{
return this->sle_.isFieldPresent(sfAdditionalBooks);
}
};
/**
* Builder for Offer ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class OfferBuilder : public LedgerEntryBuilderBase<OfferBuilder>
{
public:
OfferBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_UINT32::type::value_type> const& sequence,std::decay_t<typename SF_AMOUNT::type::value_type> const& takerPays,std::decay_t<typename SF_AMOUNT::type::value_type> const& takerGets,std::decay_t<typename SF_UINT256::type::value_type> const& bookDirectory,std::decay_t<typename SF_UINT64::type::value_type> const& bookNode,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<OfferBuilder>(ltOFFER)
{
setAccount(account);
setSequence(sequence);
setTakerPays(takerPays);
setTakerGets(takerGets);
setBookDirectory(bookDirectory);
setBookNode(bookNode);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
OfferBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltOFFER)
{
throw std::runtime_error("Invalid ledger entry type for Offer");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfTakerPays (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setTakerPays(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfTakerPays] = value;
return *this;
}
/**
* Set sfTakerGets (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setTakerGets(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfTakerGets] = value;
return *this;
}
/**
* Set sfBookDirectory (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setBookDirectory(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfBookDirectory] = value;
return *this;
}
/**
* Set sfBookNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setBookNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfBookNode] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Set sfDomainID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setDomainID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfDomainID] = value;
return *this;
}
/**
* Set sfAdditionalBooks (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
OfferBuilder&
setAdditionalBooks(STArray const& value)
{
object_.setFieldArray(sfAdditionalBooks, value);
return *this;
}
/**
* Build and return the completed Offer wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Offer
build(uint256 const& index)
{
return Offer{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,322 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class OracleBuilder;
/**
* Ledger Entry: Oracle
* Type: ltORACLE (0x0080)
* RPC Name: oracle
*
* Immutable wrapper around SLE providing type-safe field access.
* Use OracleBuilder to construct new ledger entries.
*/
class Oracle : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltORACLE;
/**
* Construct a Oracle ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Oracle(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Oracle");
}
}
// Ledger entry-specific field getters
/**
* Get sfOwner (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOwner() const
{
return this->sle_.at(sfOwner);
}
/**
* Get sfOracleDocumentID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getOracleDocumentID() const
{
if (hasOracleDocumentID())
return this->sle_.at(sfOracleDocumentID);
return std::nullopt;
}
[[nodiscard]]
bool
hasOracleDocumentID() const
{
return this->sle_.isFieldPresent(sfOracleDocumentID);
}
/**
* Get sfProvider (soeREQUIRED)
*/
[[nodiscard]]
SF_VL::type::value_type
getProvider() const
{
return this->sle_.at(sfProvider);
}
/**
* Get sfPriceDataSeries (soeREQUIRED)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
STArray const&
getPriceDataSeries() const
{
return this->sle_.getFieldArray(sfPriceDataSeries);
}
/**
* Get sfAssetClass (soeREQUIRED)
*/
[[nodiscard]]
SF_VL::type::value_type
getAssetClass() const
{
return this->sle_.at(sfAssetClass);
}
/**
* Get sfLastUpdateTime (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getLastUpdateTime() const
{
return this->sle_.at(sfLastUpdateTime);
}
/**
* Get sfURI (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getURI() const
{
if (hasURI())
return this->sle_.at(sfURI);
return std::nullopt;
}
[[nodiscard]]
bool
hasURI() const
{
return this->sle_.isFieldPresent(sfURI);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for Oracle ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class OracleBuilder : public LedgerEntryBuilderBase<OracleBuilder>
{
public:
OracleBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& owner,std::decay_t<typename SF_VL::type::value_type> const& provider,STArray const& priceDataSeries,std::decay_t<typename SF_VL::type::value_type> const& assetClass,std::decay_t<typename SF_UINT32::type::value_type> const& lastUpdateTime,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<OracleBuilder>(ltORACLE)
{
setOwner(owner);
setProvider(provider);
setPriceDataSeries(priceDataSeries);
setAssetClass(assetClass);
setLastUpdateTime(lastUpdateTime);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
OracleBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltORACLE)
{
throw std::runtime_error("Invalid ledger entry type for Oracle");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfOwner (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfOracleDocumentID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setOracleDocumentID(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOracleDocumentID] = value;
return *this;
}
/**
* Set sfProvider (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setProvider(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfProvider] = value;
return *this;
}
/**
* Set sfPriceDataSeries (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setPriceDataSeries(STArray const& value)
{
object_.setFieldArray(sfPriceDataSeries, value);
return *this;
}
/**
* Set sfAssetClass (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setAssetClass(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfAssetClass] = value;
return *this;
}
/**
* Set sfLastUpdateTime (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setLastUpdateTime(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLastUpdateTime] = value;
return *this;
}
/**
* Set sfURI (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setURI(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfURI] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
OracleBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed Oracle wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Oracle
build(uint256 const& index)
{
return Oracle{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,463 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class PayChannelBuilder;
/**
* Ledger Entry: PayChannel
* Type: ltPAYCHAN (0x0078)
* RPC Name: payment_channel
*
* Immutable wrapper around SLE providing type-safe field access.
* Use PayChannelBuilder to construct new ledger entries.
*/
class PayChannel : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltPAYCHAN;
/**
* Construct a PayChannel ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit PayChannel(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for PayChannel");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfDestination (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getDestination() const
{
return this->sle_.at(sfDestination);
}
/**
* Get sfSequence (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getSequence() const
{
if (hasSequence())
return this->sle_.at(sfSequence);
return std::nullopt;
}
[[nodiscard]]
bool
hasSequence() const
{
return this->sle_.isFieldPresent(sfSequence);
}
/**
* Get sfAmount (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->sle_.at(sfAmount);
}
/**
* Get sfBalance (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getBalance() const
{
return this->sle_.at(sfBalance);
}
/**
* Get sfPublicKey (soeREQUIRED)
*/
[[nodiscard]]
SF_VL::type::value_type
getPublicKey() const
{
return this->sle_.at(sfPublicKey);
}
/**
* Get sfSettleDelay (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSettleDelay() const
{
return this->sle_.at(sfSettleDelay);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
return this->sle_.at(sfExpiration);
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->sle_.isFieldPresent(sfExpiration);
}
/**
* Get sfCancelAfter (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCancelAfter() const
{
if (hasCancelAfter())
return this->sle_.at(sfCancelAfter);
return std::nullopt;
}
[[nodiscard]]
bool
hasCancelAfter() const
{
return this->sle_.isFieldPresent(sfCancelAfter);
}
/**
* Get sfSourceTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getSourceTag() const
{
if (hasSourceTag())
return this->sle_.at(sfSourceTag);
return std::nullopt;
}
[[nodiscard]]
bool
hasSourceTag() const
{
return this->sle_.isFieldPresent(sfSourceTag);
}
/**
* Get sfDestinationTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getDestinationTag() const
{
if (hasDestinationTag())
return this->sle_.at(sfDestinationTag);
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationTag() const
{
return this->sle_.isFieldPresent(sfDestinationTag);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfDestinationNode (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getDestinationNode() const
{
if (hasDestinationNode())
return this->sle_.at(sfDestinationNode);
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationNode() const
{
return this->sle_.isFieldPresent(sfDestinationNode);
}
};
/**
* Builder for PayChannel ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class PayChannelBuilder : public LedgerEntryBuilderBase<PayChannelBuilder>
{
public:
PayChannelBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_ACCOUNT::type::value_type> const& destination,std::decay_t<typename SF_AMOUNT::type::value_type> const& amount,std::decay_t<typename SF_AMOUNT::type::value_type> const& balance,std::decay_t<typename SF_VL::type::value_type> const& publicKey,std::decay_t<typename SF_UINT32::type::value_type> const& settleDelay,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<PayChannelBuilder>(ltPAYCHAN)
{
setAccount(account);
setDestination(destination);
setAmount(amount);
setBalance(balance);
setPublicKey(publicKey);
setSettleDelay(settleDelay);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
PayChannelBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltPAYCHAN)
{
throw std::runtime_error("Invalid ledger entry type for PayChannel");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfDestination (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfSequence (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfBalance (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setBalance(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfBalance] = value;
return *this;
}
/**
* Set sfPublicKey (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setPublicKey(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfPublicKey] = value;
return *this;
}
/**
* Set sfSettleDelay (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setSettleDelay(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSettleDelay] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Set sfCancelAfter (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setCancelAfter(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCancelAfter] = value;
return *this;
}
/**
* Set sfSourceTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setSourceTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSourceTag] = value;
return *this;
}
/**
* Set sfDestinationTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setDestinationTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfDestinationTag] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfDestinationNode (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
PayChannelBuilder&
setDestinationNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfDestinationNode] = value;
return *this;
}
/**
* Build and return the completed PayChannel wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
PayChannel
build(uint256 const& index)
{
return PayChannel{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,218 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class PermissionedDomainBuilder;
/**
* Ledger Entry: PermissionedDomain
* Type: ltPERMISSIONED_DOMAIN (0x0082)
* RPC Name: permissioned_domain
*
* Immutable wrapper around SLE providing type-safe field access.
* Use PermissionedDomainBuilder to construct new ledger entries.
*/
class PermissionedDomain : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltPERMISSIONED_DOMAIN;
/**
* Construct a PermissionedDomain ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit PermissionedDomain(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for PermissionedDomain");
}
}
// Ledger entry-specific field getters
/**
* Get sfOwner (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOwner() const
{
return this->sle_.at(sfOwner);
}
/**
* Get sfSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSequence() const
{
return this->sle_.at(sfSequence);
}
/**
* Get sfAcceptedCredentials (soeREQUIRED)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
STArray const&
getAcceptedCredentials() const
{
return this->sle_.getFieldArray(sfAcceptedCredentials);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for PermissionedDomain ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class PermissionedDomainBuilder : public LedgerEntryBuilderBase<PermissionedDomainBuilder>
{
public:
PermissionedDomainBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& owner,std::decay_t<typename SF_UINT32::type::value_type> const& sequence,STArray const& acceptedCredentials,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<PermissionedDomainBuilder>(ltPERMISSIONED_DOMAIN)
{
setOwner(owner);
setSequence(sequence);
setAcceptedCredentials(acceptedCredentials);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
PermissionedDomainBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltPERMISSIONED_DOMAIN)
{
throw std::runtime_error("Invalid ledger entry type for PermissionedDomain");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfOwner (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PermissionedDomainBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PermissionedDomainBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfAcceptedCredentials (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PermissionedDomainBuilder&
setAcceptedCredentials(STArray const& value)
{
object_.setFieldArray(sfAcceptedCredentials, value);
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PermissionedDomainBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PermissionedDomainBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
PermissionedDomainBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed PermissionedDomain wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
PermissionedDomain
build(uint256 const& index)
{
return PermissionedDomain{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,375 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class RippleStateBuilder;
/**
* Ledger Entry: RippleState
* Type: ltRIPPLE_STATE (0x0072)
* RPC Name: state
*
* Immutable wrapper around SLE providing type-safe field access.
* Use RippleStateBuilder to construct new ledger entries.
*/
class RippleState : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltRIPPLE_STATE;
/**
* Construct a RippleState ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit RippleState(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for RippleState");
}
}
// Ledger entry-specific field getters
/**
* Get sfBalance (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getBalance() const
{
return this->sle_.at(sfBalance);
}
/**
* Get sfLowLimit (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getLowLimit() const
{
return this->sle_.at(sfLowLimit);
}
/**
* Get sfHighLimit (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getHighLimit() const
{
return this->sle_.at(sfHighLimit);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfLowNode (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getLowNode() const
{
if (hasLowNode())
return this->sle_.at(sfLowNode);
return std::nullopt;
}
[[nodiscard]]
bool
hasLowNode() const
{
return this->sle_.isFieldPresent(sfLowNode);
}
/**
* Get sfLowQualityIn (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getLowQualityIn() const
{
if (hasLowQualityIn())
return this->sle_.at(sfLowQualityIn);
return std::nullopt;
}
[[nodiscard]]
bool
hasLowQualityIn() const
{
return this->sle_.isFieldPresent(sfLowQualityIn);
}
/**
* Get sfLowQualityOut (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getLowQualityOut() const
{
if (hasLowQualityOut())
return this->sle_.at(sfLowQualityOut);
return std::nullopt;
}
[[nodiscard]]
bool
hasLowQualityOut() const
{
return this->sle_.isFieldPresent(sfLowQualityOut);
}
/**
* Get sfHighNode (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getHighNode() const
{
if (hasHighNode())
return this->sle_.at(sfHighNode);
return std::nullopt;
}
[[nodiscard]]
bool
hasHighNode() const
{
return this->sle_.isFieldPresent(sfHighNode);
}
/**
* Get sfHighQualityIn (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getHighQualityIn() const
{
if (hasHighQualityIn())
return this->sle_.at(sfHighQualityIn);
return std::nullopt;
}
[[nodiscard]]
bool
hasHighQualityIn() const
{
return this->sle_.isFieldPresent(sfHighQualityIn);
}
/**
* Get sfHighQualityOut (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getHighQualityOut() const
{
if (hasHighQualityOut())
return this->sle_.at(sfHighQualityOut);
return std::nullopt;
}
[[nodiscard]]
bool
hasHighQualityOut() const
{
return this->sle_.isFieldPresent(sfHighQualityOut);
}
};
/**
* Builder for RippleState ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class RippleStateBuilder : public LedgerEntryBuilderBase<RippleStateBuilder>
{
public:
RippleStateBuilder(std::decay_t<typename SF_AMOUNT::type::value_type> const& balance,std::decay_t<typename SF_AMOUNT::type::value_type> const& lowLimit,std::decay_t<typename SF_AMOUNT::type::value_type> const& highLimit,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<RippleStateBuilder>(ltRIPPLE_STATE)
{
setBalance(balance);
setLowLimit(lowLimit);
setHighLimit(highLimit);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
RippleStateBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltRIPPLE_STATE)
{
throw std::runtime_error("Invalid ledger entry type for RippleState");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfBalance (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setBalance(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfBalance] = value;
return *this;
}
/**
* Set sfLowLimit (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setLowLimit(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfLowLimit] = value;
return *this;
}
/**
* Set sfHighLimit (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setHighLimit(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfHighLimit] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfLowNode (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setLowNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfLowNode] = value;
return *this;
}
/**
* Set sfLowQualityIn (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setLowQualityIn(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLowQualityIn] = value;
return *this;
}
/**
* Set sfLowQualityOut (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setLowQualityOut(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLowQualityOut] = value;
return *this;
}
/**
* Set sfHighNode (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setHighNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfHighNode] = value;
return *this;
}
/**
* Set sfHighQualityIn (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setHighQualityIn(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfHighQualityIn] = value;
return *this;
}
/**
* Set sfHighQualityOut (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
RippleStateBuilder&
setHighQualityOut(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfHighQualityOut] = value;
return *this;
}
/**
* Build and return the completed RippleState wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
RippleState
build(uint256 const& index)
{
return RippleState{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,248 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class SignerListBuilder;
/**
* Ledger Entry: SignerList
* Type: ltSIGNER_LIST (0x0053)
* RPC Name: signer_list
*
* Immutable wrapper around SLE providing type-safe field access.
* Use SignerListBuilder to construct new ledger entries.
*/
class SignerList : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltSIGNER_LIST;
/**
* Construct a SignerList ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit SignerList(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for SignerList");
}
}
// Ledger entry-specific field getters
/**
* Get sfOwner (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getOwner() const
{
if (hasOwner())
return this->sle_.at(sfOwner);
return std::nullopt;
}
[[nodiscard]]
bool
hasOwner() const
{
return this->sle_.isFieldPresent(sfOwner);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfSignerQuorum (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSignerQuorum() const
{
return this->sle_.at(sfSignerQuorum);
}
/**
* Get sfSignerEntries (soeREQUIRED)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
STArray const&
getSignerEntries() const
{
return this->sle_.getFieldArray(sfSignerEntries);
}
/**
* Get sfSignerListID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSignerListID() const
{
return this->sle_.at(sfSignerListID);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for SignerList ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class SignerListBuilder : public LedgerEntryBuilderBase<SignerListBuilder>
{
public:
SignerListBuilder(std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT32::type::value_type> const& signerQuorum,STArray const& signerEntries,std::decay_t<typename SF_UINT32::type::value_type> const& signerListID,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<SignerListBuilder>(ltSIGNER_LIST)
{
setOwnerNode(ownerNode);
setSignerQuorum(signerQuorum);
setSignerEntries(signerEntries);
setSignerListID(signerListID);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
SignerListBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltSIGNER_LIST)
{
throw std::runtime_error("Invalid ledger entry type for SignerList");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfOwner (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
SignerListBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
SignerListBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfSignerQuorum (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
SignerListBuilder&
setSignerQuorum(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSignerQuorum] = value;
return *this;
}
/**
* Set sfSignerEntries (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
SignerListBuilder&
setSignerEntries(STArray const& value)
{
object_.setFieldArray(sfSignerEntries, value);
return *this;
}
/**
* Set sfSignerListID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
SignerListBuilder&
setSignerListID(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSignerListID] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
SignerListBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
SignerListBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed SignerList wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
SignerList
build(uint256 const& index)
{
return SignerList{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,195 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class TicketBuilder;
/**
* Ledger Entry: Ticket
* Type: ltTICKET (0x0054)
* RPC Name: ticket
*
* Immutable wrapper around SLE providing type-safe field access.
* Use TicketBuilder to construct new ledger entries.
*/
class Ticket : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltTICKET;
/**
* Construct a Ticket ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Ticket(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Ticket");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfTicketSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getTicketSequence() const
{
return this->sle_.at(sfTicketSequence);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for Ticket ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class TicketBuilder : public LedgerEntryBuilderBase<TicketBuilder>
{
public:
TicketBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT32::type::value_type> const& ticketSequence,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<TicketBuilder>(ltTICKET)
{
setAccount(account);
setOwnerNode(ownerNode);
setTicketSequence(ticketSequence);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
TicketBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltTICKET)
{
throw std::runtime_error("Invalid ledger entry type for Ticket");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
TicketBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
TicketBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfTicketSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
TicketBuilder&
setTicketSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfTicketSequence] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
TicketBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
TicketBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed Ticket wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Ticket
build(uint256 const& index)
{
return Ticket{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,463 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class VaultBuilder;
/**
* Ledger Entry: Vault
* Type: ltVAULT (0x0084)
* RPC Name: vault
*
* Immutable wrapper around SLE providing type-safe field access.
* Use VaultBuilder to construct new ledger entries.
*/
class Vault : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltVAULT;
/**
* Construct a Vault ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit Vault(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for Vault");
}
}
// Ledger entry-specific field getters
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
/**
* Get sfSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getSequence() const
{
return this->sle_.at(sfSequence);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfOwner (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOwner() const
{
return this->sle_.at(sfOwner);
}
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfData (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getData() const
{
if (hasData())
return this->sle_.at(sfData);
return std::nullopt;
}
[[nodiscard]]
bool
hasData() const
{
return this->sle_.isFieldPresent(sfData);
}
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->sle_.at(sfAsset);
}
/**
* Get sfAssetsTotal (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getAssetsTotal() const
{
if (hasAssetsTotal())
return this->sle_.at(sfAssetsTotal);
return std::nullopt;
}
[[nodiscard]]
bool
hasAssetsTotal() const
{
return this->sle_.isFieldPresent(sfAssetsTotal);
}
/**
* Get sfAssetsAvailable (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getAssetsAvailable() const
{
if (hasAssetsAvailable())
return this->sle_.at(sfAssetsAvailable);
return std::nullopt;
}
[[nodiscard]]
bool
hasAssetsAvailable() const
{
return this->sle_.isFieldPresent(sfAssetsAvailable);
}
/**
* Get sfAssetsMaximum (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getAssetsMaximum() const
{
if (hasAssetsMaximum())
return this->sle_.at(sfAssetsMaximum);
return std::nullopt;
}
[[nodiscard]]
bool
hasAssetsMaximum() const
{
return this->sle_.isFieldPresent(sfAssetsMaximum);
}
/**
* Get sfLossUnrealized (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getLossUnrealized() const
{
if (hasLossUnrealized())
return this->sle_.at(sfLossUnrealized);
return std::nullopt;
}
[[nodiscard]]
bool
hasLossUnrealized() const
{
return this->sle_.isFieldPresent(sfLossUnrealized);
}
/**
* Get sfShareMPTID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT192::type::value_type
getShareMPTID() const
{
return this->sle_.at(sfShareMPTID);
}
/**
* Get sfWithdrawalPolicy (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT8::type::value_type
getWithdrawalPolicy() const
{
return this->sle_.at(sfWithdrawalPolicy);
}
/**
* Get sfScale (soeDEFAULT)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT8::type::value_type>
getScale() const
{
if (hasScale())
return this->sle_.at(sfScale);
return std::nullopt;
}
[[nodiscard]]
bool
hasScale() const
{
return this->sle_.isFieldPresent(sfScale);
}
};
/**
* Builder for Vault ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class VaultBuilder : public LedgerEntryBuilderBase<VaultBuilder>
{
public:
VaultBuilder(std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq,std::decay_t<typename SF_UINT32::type::value_type> const& sequence,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_ACCOUNT::type::value_type> const& owner,std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_ISSUE::type::value_type> const& asset,std::decay_t<typename SF_UINT192::type::value_type> const& shareMPTID,std::decay_t<typename SF_UINT8::type::value_type> const& withdrawalPolicy)
: LedgerEntryBuilderBase<VaultBuilder>(ltVAULT)
{
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
setSequence(sequence);
setOwnerNode(ownerNode);
setOwner(owner);
setAccount(account);
setAsset(asset);
setShareMPTID(shareMPTID);
setWithdrawalPolicy(withdrawalPolicy);
}
VaultBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltVAULT)
{
throw std::runtime_error("Invalid ledger entry type for Vault");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Set sfSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSequence] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfOwner (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfData (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setData(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfData] = value;
return *this;
}
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAssetsTotal (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setAssetsTotal(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfAssetsTotal] = value;
return *this;
}
/**
* Set sfAssetsAvailable (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setAssetsAvailable(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfAssetsAvailable] = value;
return *this;
}
/**
* Set sfAssetsMaximum (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setAssetsMaximum(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfAssetsMaximum] = value;
return *this;
}
/**
* Set sfLossUnrealized (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setLossUnrealized(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfLossUnrealized] = value;
return *this;
}
/**
* Set sfShareMPTID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setShareMPTID(std::decay_t<typename SF_UINT192::type::value_type> const& value)
{
object_[sfShareMPTID] = value;
return *this;
}
/**
* Set sfWithdrawalPolicy (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setWithdrawalPolicy(std::decay_t<typename SF_UINT8::type::value_type> const& value)
{
object_[sfWithdrawalPolicy] = value;
return *this;
}
/**
* Set sfScale (soeDEFAULT)
* @return Reference to this builder for method chaining.
*/
VaultBuilder&
setScale(std::decay_t<typename SF_UINT8::type::value_type> const& value)
{
object_[sfScale] = value;
return *this;
}
/**
* Build and return the completed Vault wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
Vault
build(uint256 const& index)
{
return Vault{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,284 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class XChainOwnedClaimIDBuilder;
/**
* Ledger Entry: XChainOwnedClaimID
* Type: ltXCHAIN_OWNED_CLAIM_ID (0x0071)
* RPC Name: xchain_owned_claim_id
*
* Immutable wrapper around SLE providing type-safe field access.
* Use XChainOwnedClaimIDBuilder to construct new ledger entries.
*/
class XChainOwnedClaimID : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltXCHAIN_OWNED_CLAIM_ID;
/**
* Construct a XChainOwnedClaimID ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit XChainOwnedClaimID(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for XChainOwnedClaimID");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfXChainBridge (soeREQUIRED)
*/
[[nodiscard]]
SF_XCHAIN_BRIDGE::type::value_type
getXChainBridge() const
{
return this->sle_.at(sfXChainBridge);
}
/**
* Get sfXChainClaimID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getXChainClaimID() const
{
return this->sle_.at(sfXChainClaimID);
}
/**
* Get sfOtherChainSource (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOtherChainSource() const
{
return this->sle_.at(sfOtherChainSource);
}
/**
* Get sfXChainClaimAttestations (soeREQUIRED)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
STArray const&
getXChainClaimAttestations() const
{
return this->sle_.getFieldArray(sfXChainClaimAttestations);
}
/**
* Get sfSignatureReward (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getSignatureReward() const
{
return this->sle_.at(sfSignatureReward);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for XChainOwnedClaimID ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class XChainOwnedClaimIDBuilder : public LedgerEntryBuilderBase<XChainOwnedClaimIDBuilder>
{
public:
XChainOwnedClaimIDBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type> const& xChainBridge,std::decay_t<typename SF_UINT64::type::value_type> const& xChainClaimID,std::decay_t<typename SF_ACCOUNT::type::value_type> const& otherChainSource,STArray const& xChainClaimAttestations,std::decay_t<typename SF_AMOUNT::type::value_type> const& signatureReward,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<XChainOwnedClaimIDBuilder>(ltXCHAIN_OWNED_CLAIM_ID)
{
setAccount(account);
setXChainBridge(xChainBridge);
setXChainClaimID(xChainClaimID);
setOtherChainSource(otherChainSource);
setXChainClaimAttestations(xChainClaimAttestations);
setSignatureReward(signatureReward);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
XChainOwnedClaimIDBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltXCHAIN_OWNED_CLAIM_ID)
{
throw std::runtime_error("Invalid ledger entry type for XChainOwnedClaimID");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfXChainBridge (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setXChainBridge(std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type> const& value)
{
object_[sfXChainBridge] = value;
return *this;
}
/**
* Set sfXChainClaimID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setXChainClaimID(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfXChainClaimID] = value;
return *this;
}
/**
* Set sfOtherChainSource (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setOtherChainSource(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOtherChainSource] = value;
return *this;
}
/**
* Set sfXChainClaimAttestations (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setXChainClaimAttestations(STArray const& value)
{
object_.setFieldArray(sfXChainClaimAttestations, value);
return *this;
}
/**
* Set sfSignatureReward (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setSignatureReward(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfSignatureReward] = value;
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedClaimIDBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed XChainOwnedClaimID wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
XChainOwnedClaimID
build(uint256 const& index)
{
return XChainOwnedClaimID{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,240 +0,0 @@
#pragma once
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/LedgerEntryBase.h>
#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::ledger_entries {
// Forward declaration
class XChainOwnedCreateAccountClaimIDBuilder;
/**
* Ledger Entry: XChainOwnedCreateAccountClaimID
* Type: ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID (0x0074)
* RPC Name: xchain_owned_create_account_claim_id
*
* Immutable wrapper around SLE providing type-safe field access.
* Use XChainOwnedCreateAccountClaimIDBuilder to construct new ledger entries.
*/
class XChainOwnedCreateAccountClaimID : public LedgerEntryBase
{
public:
static constexpr LedgerEntryType entryType = ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID;
/**
* Construct a XChainOwnedCreateAccountClaimID ledger entry wrapper from an existing SLE object.
* @throws std::runtime_error if the ledger entry type doesn't match.
*/
explicit XChainOwnedCreateAccountClaimID(SLE const& sle)
: LedgerEntryBase(sle)
{
// Verify ledger entry type
if (sle.getType() != entryType)
{
throw std::runtime_error("Invalid ledger entry type for XChainOwnedCreateAccountClaimID");
}
}
// Ledger entry-specific field getters
/**
* Get sfAccount (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAccount() const
{
return this->sle_.at(sfAccount);
}
/**
* Get sfXChainBridge (soeREQUIRED)
*/
[[nodiscard]]
SF_XCHAIN_BRIDGE::type::value_type
getXChainBridge() const
{
return this->sle_.at(sfXChainBridge);
}
/**
* Get sfXChainAccountCreateCount (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getXChainAccountCreateCount() const
{
return this->sle_.at(sfXChainAccountCreateCount);
}
/**
* Get sfXChainCreateAccountAttestations (soeREQUIRED)
* Note: This is an untyped field (unknown).
*/
[[nodiscard]]
STArray const&
getXChainCreateAccountAttestations() const
{
return this->sle_.getFieldArray(sfXChainCreateAccountAttestations);
}
/**
* Get sfOwnerNode (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT64::type::value_type
getOwnerNode() const
{
return this->sle_.at(sfOwnerNode);
}
/**
* Get sfPreviousTxnID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getPreviousTxnID() const
{
return this->sle_.at(sfPreviousTxnID);
}
/**
* Get sfPreviousTxnLgrSeq (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getPreviousTxnLgrSeq() const
{
return this->sle_.at(sfPreviousTxnLgrSeq);
}
};
/**
* Builder for XChainOwnedCreateAccountClaimID ledger entries.
* Provides a fluent interface for constructing ledger entries with method chaining.
* Uses Json::Value internally for flexible ledger entry construction.
* Inherits common field setters from LedgerEntryBuilderBase.
*/
class XChainOwnedCreateAccountClaimIDBuilder : public LedgerEntryBuilderBase<XChainOwnedCreateAccountClaimIDBuilder>
{
public:
XChainOwnedCreateAccountClaimIDBuilder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& account,std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type> const& xChainBridge,std::decay_t<typename SF_UINT64::type::value_type> const& xChainAccountCreateCount,STArray const& xChainCreateAccountAttestations,std::decay_t<typename SF_UINT64::type::value_type> const& ownerNode,std::decay_t<typename SF_UINT256::type::value_type> const& previousTxnID,std::decay_t<typename SF_UINT32::type::value_type> const& previousTxnLgrSeq)
: LedgerEntryBuilderBase<XChainOwnedCreateAccountClaimIDBuilder>(ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID)
{
setAccount(account);
setXChainBridge(xChainBridge);
setXChainAccountCreateCount(xChainAccountCreateCount);
setXChainCreateAccountAttestations(xChainCreateAccountAttestations);
setOwnerNode(ownerNode);
setPreviousTxnID(previousTxnID);
setPreviousTxnLgrSeq(previousTxnLgrSeq);
}
XChainOwnedCreateAccountClaimIDBuilder(SLE const& sle)
{
if (sle[sfLedgerEntryType] != ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID)
{
throw std::runtime_error("Invalid ledger entry type for XChainOwnedCreateAccountClaimID");
}
object_ = sle;
}
// Ledger entry-specific field setters
/**
* Set sfAccount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedCreateAccountClaimIDBuilder&
setAccount(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAccount] = value;
return *this;
}
/**
* Set sfXChainBridge (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedCreateAccountClaimIDBuilder&
setXChainBridge(std::decay_t<typename SF_XCHAIN_BRIDGE::type::value_type> const& value)
{
object_[sfXChainBridge] = value;
return *this;
}
/**
* Set sfXChainAccountCreateCount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedCreateAccountClaimIDBuilder&
setXChainAccountCreateCount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfXChainAccountCreateCount] = value;
return *this;
}
/**
* Set sfXChainCreateAccountAttestations (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedCreateAccountClaimIDBuilder&
setXChainCreateAccountAttestations(STArray const& value)
{
object_.setFieldArray(sfXChainCreateAccountAttestations, value);
return *this;
}
/**
* Set sfOwnerNode (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedCreateAccountClaimIDBuilder&
setOwnerNode(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfOwnerNode] = value;
return *this;
}
/**
* Set sfPreviousTxnID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedCreateAccountClaimIDBuilder&
setPreviousTxnID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfPreviousTxnID] = value;
return *this;
}
/**
* Set sfPreviousTxnLgrSeq (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
XChainOwnedCreateAccountClaimIDBuilder&
setPreviousTxnLgrSeq(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPreviousTxnLgrSeq] = value;
return *this;
}
/**
* Build and return the completed XChainOwnedCreateAccountClaimID wrapper.
* @return The constructed ledger entry wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid ledger entry.
*/
XChainOwnedCreateAccountClaimID
build(uint256 const& index)
{
return XChainOwnedCreateAccountClaimID{SLE(object_, index)};
}
};
} // namespace xrpl::ledger_entries

View File

@@ -1,228 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AMMBidBuilder;
/**
* Transaction: AMMBid
* Type: ttAMM_BID (39)
* Delegable: Delegation::delegable
* Amendment: featureAMM
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AMMBidBuilder to construct new transactions.
*/
class AMMBid : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMM_BID;
/**
* Construct a AMMBid transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AMMBid(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AMMBid");
}
}
// Transaction-specific field getters
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->tx_.at(sfAsset);
}
/**
* Get sfAsset2 (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset2() const
{
return this->tx_.at(sfAsset2);
}
/**
* Get sfBidMin (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getBidMin() const
{
if (hasBidMin())
{
return this->tx_.at(sfBidMin);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasBidMin() const
{
return this->tx_.isFieldPresent(sfBidMin);
}
/**
* Get sfBidMax (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getBidMax() const
{
if (hasBidMax())
{
return this->tx_.at(sfBidMax);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasBidMax() const
{
return this->tx_.isFieldPresent(sfBidMax);
}
/**
* Get sfAuthAccounts (soeOPTIONAL)
* Note: This is an untyped field
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getAuthAccounts() const
{
if (this->tx_.isFieldPresent(sfAuthAccounts))
return this->tx_.getFieldArray(sfAuthAccounts);
return std::nullopt;
}
[[nodiscard]]
bool
hasAuthAccounts() const
{
return this->tx_.isFieldPresent(sfAuthAccounts);
}
};
/**
* Builder for AMMBid transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AMMBidBuilder : public TransactionBuilderBase<AMMBidBuilder>
{
public:
AMMBidBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ISSUE::type::value_type> const& asset, std::decay_t<typename SF_ISSUE::type::value_type> const& asset2, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AMMBidBuilder>(ttAMM_BID, account, sequence, fee)
{
setAsset(asset);
setAsset2(asset2);
}
AMMBidBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMM_BID)
{
throw std::runtime_error("Invalid transaction type for AMMBidBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMBidBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAsset2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMBidBuilder&
setAsset2(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset2] = STIssue(sfAsset2, value);
return *this;
}
/**
* Set sfBidMin (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMBidBuilder&
setBidMin(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfBidMin] = value;
return *this;
}
/**
* Set sfBidMax (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMBidBuilder&
setBidMax(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfBidMax] = value;
return *this;
}
/**
* Set sfAuthAccounts (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMBidBuilder&
setAuthAccounts(STArray const& value)
{
object_.setFieldArray(sfAuthAccounts, value);
return *this;
}
/**
* Build and return the completed AMMBid wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AMMBid
build()
{
return AMMBid(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,188 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AMMClawbackBuilder;
/**
* Transaction: AMMClawback
* Type: ttAMM_CLAWBACK (31)
* Delegable: Delegation::delegable
* Amendment: featureAMMClawback
* Privileges: mayDeleteAcct | overrideFreeze
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AMMClawbackBuilder to construct new transactions.
*/
class AMMClawback : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMM_CLAWBACK;
/**
* Construct a AMMClawback transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AMMClawback(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AMMClawback");
}
}
// Transaction-specific field getters
/**
* Get sfHolder (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getHolder() const
{
return this->tx_.at(sfHolder);
}
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->tx_.at(sfAsset);
}
/**
* Get sfAsset2 (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset2() const
{
return this->tx_.at(sfAsset2);
}
/**
* Get sfAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount() const
{
if (hasAmount())
{
return this->tx_.at(sfAmount);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount() const
{
return this->tx_.isFieldPresent(sfAmount);
}
};
/**
* Builder for AMMClawback transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AMMClawbackBuilder : public TransactionBuilderBase<AMMClawbackBuilder>
{
public:
AMMClawbackBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& holder, std::decay_t<typename SF_ISSUE::type::value_type> const& asset, std::decay_t<typename SF_ISSUE::type::value_type> const& asset2, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AMMClawbackBuilder>(ttAMM_CLAWBACK, account, sequence, fee)
{
setHolder(holder);
setAsset(asset);
setAsset2(asset2);
}
AMMClawbackBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMM_CLAWBACK)
{
throw std::runtime_error("Invalid transaction type for AMMClawbackBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfHolder (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMClawbackBuilder&
setHolder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfHolder] = value;
return *this;
}
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMClawbackBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAsset2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMClawbackBuilder&
setAsset2(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset2] = STIssue(sfAsset2, value);
return *this;
}
/**
* Set sfAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMClawbackBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Build and return the completed AMMClawback wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AMMClawback
build()
{
return AMMClawback(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,156 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AMMCreateBuilder;
/**
* Transaction: AMMCreate
* Type: ttAMM_CREATE (35)
* Delegable: Delegation::delegable
* Amendment: featureAMM
* Privileges: createPseudoAcct
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AMMCreateBuilder to construct new transactions.
*/
class AMMCreate : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMM_CREATE;
/**
* Construct a AMMCreate transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AMMCreate(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AMMCreate");
}
}
// Transaction-specific field getters
/**
* Get sfAmount (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->tx_.at(sfAmount);
}
/**
* Get sfAmount2 (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount2() const
{
return this->tx_.at(sfAmount2);
}
/**
* Get sfTradingFee (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT16::type::value_type
getTradingFee() const
{
return this->tx_.at(sfTradingFee);
}
};
/**
* Builder for AMMCreate transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AMMCreateBuilder : public TransactionBuilderBase<AMMCreateBuilder>
{
public:
AMMCreateBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_AMOUNT::type::value_type> const& amount, std::decay_t<typename SF_AMOUNT::type::value_type> const& amount2, std::decay_t<typename SF_UINT16::type::value_type> const& tradingFee, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AMMCreateBuilder>(ttAMM_CREATE, account, sequence, fee)
{
setAmount(amount);
setAmount2(amount2);
setTradingFee(tradingFee);
}
AMMCreateBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMM_CREATE)
{
throw std::runtime_error("Invalid transaction type for AMMCreateBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAmount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMCreateBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfAmount2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMCreateBuilder&
setAmount2(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount2] = value;
return *this;
}
/**
* Set sfTradingFee (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMCreateBuilder&
setTradingFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTradingFee] = value;
return *this;
}
/**
* Build and return the completed AMMCreate wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AMMCreate
build()
{
return AMMCreate(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,134 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AMMDeleteBuilder;
/**
* Transaction: AMMDelete
* Type: ttAMM_DELETE (40)
* Delegable: Delegation::delegable
* Amendment: featureAMM
* Privileges: mustDeleteAcct
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AMMDeleteBuilder to construct new transactions.
*/
class AMMDelete : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMM_DELETE;
/**
* Construct a AMMDelete transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AMMDelete(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AMMDelete");
}
}
// Transaction-specific field getters
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->tx_.at(sfAsset);
}
/**
* Get sfAsset2 (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset2() const
{
return this->tx_.at(sfAsset2);
}
};
/**
* Builder for AMMDelete transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AMMDeleteBuilder : public TransactionBuilderBase<AMMDeleteBuilder>
{
public:
AMMDeleteBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ISSUE::type::value_type> const& asset, std::decay_t<typename SF_ISSUE::type::value_type> const& asset2, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AMMDeleteBuilder>(ttAMM_DELETE, account, sequence, fee)
{
setAsset(asset);
setAsset2(asset2);
}
AMMDeleteBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMM_DELETE)
{
throw std::runtime_error("Invalid transaction type for AMMDeleteBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMDeleteBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAsset2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMDeleteBuilder&
setAsset2(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset2] = STIssue(sfAsset2, value);
return *this;
}
/**
* Build and return the completed AMMDelete wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AMMDelete
build()
{
return AMMDelete(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,294 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AMMDepositBuilder;
/**
* Transaction: AMMDeposit
* Type: ttAMM_DEPOSIT (36)
* Delegable: Delegation::delegable
* Amendment: featureAMM
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AMMDepositBuilder to construct new transactions.
*/
class AMMDeposit : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMM_DEPOSIT;
/**
* Construct a AMMDeposit transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AMMDeposit(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AMMDeposit");
}
}
// Transaction-specific field getters
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->tx_.at(sfAsset);
}
/**
* Get sfAsset2 (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset2() const
{
return this->tx_.at(sfAsset2);
}
/**
* Get sfAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount() const
{
if (hasAmount())
{
return this->tx_.at(sfAmount);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount() const
{
return this->tx_.isFieldPresent(sfAmount);
}
/**
* Get sfAmount2 (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount2() const
{
if (hasAmount2())
{
return this->tx_.at(sfAmount2);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount2() const
{
return this->tx_.isFieldPresent(sfAmount2);
}
/**
* Get sfEPrice (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getEPrice() const
{
if (hasEPrice())
{
return this->tx_.at(sfEPrice);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasEPrice() const
{
return this->tx_.isFieldPresent(sfEPrice);
}
/**
* Get sfLPTokenOut (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getLPTokenOut() const
{
if (hasLPTokenOut())
{
return this->tx_.at(sfLPTokenOut);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLPTokenOut() const
{
return this->tx_.isFieldPresent(sfLPTokenOut);
}
/**
* Get sfTradingFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getTradingFee() const
{
if (hasTradingFee())
{
return this->tx_.at(sfTradingFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasTradingFee() const
{
return this->tx_.isFieldPresent(sfTradingFee);
}
};
/**
* Builder for AMMDeposit transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AMMDepositBuilder : public TransactionBuilderBase<AMMDepositBuilder>
{
public:
AMMDepositBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ISSUE::type::value_type> const& asset, std::decay_t<typename SF_ISSUE::type::value_type> const& asset2, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AMMDepositBuilder>(ttAMM_DEPOSIT, account, sequence, fee)
{
setAsset(asset);
setAsset2(asset2);
}
AMMDepositBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMM_DEPOSIT)
{
throw std::runtime_error("Invalid transaction type for AMMDepositBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMDepositBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAsset2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMDepositBuilder&
setAsset2(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset2] = STIssue(sfAsset2, value);
return *this;
}
/**
* Set sfAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMDepositBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfAmount2 (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMDepositBuilder&
setAmount2(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount2] = value;
return *this;
}
/**
* Set sfEPrice (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMDepositBuilder&
setEPrice(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfEPrice] = value;
return *this;
}
/**
* Set sfLPTokenOut (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMDepositBuilder&
setLPTokenOut(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfLPTokenOut] = value;
return *this;
}
/**
* Set sfTradingFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMDepositBuilder&
setTradingFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTradingFee] = value;
return *this;
}
/**
* Build and return the completed AMMDeposit wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AMMDeposit
build()
{
return AMMDeposit(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,156 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AMMVoteBuilder;
/**
* Transaction: AMMVote
* Type: ttAMM_VOTE (38)
* Delegable: Delegation::delegable
* Amendment: featureAMM
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AMMVoteBuilder to construct new transactions.
*/
class AMMVote : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMM_VOTE;
/**
* Construct a AMMVote transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AMMVote(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AMMVote");
}
}
// Transaction-specific field getters
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->tx_.at(sfAsset);
}
/**
* Get sfAsset2 (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset2() const
{
return this->tx_.at(sfAsset2);
}
/**
* Get sfTradingFee (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT16::type::value_type
getTradingFee() const
{
return this->tx_.at(sfTradingFee);
}
};
/**
* Builder for AMMVote transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AMMVoteBuilder : public TransactionBuilderBase<AMMVoteBuilder>
{
public:
AMMVoteBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ISSUE::type::value_type> const& asset, std::decay_t<typename SF_ISSUE::type::value_type> const& asset2, std::decay_t<typename SF_UINT16::type::value_type> const& tradingFee, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AMMVoteBuilder>(ttAMM_VOTE, account, sequence, fee)
{
setAsset(asset);
setAsset2(asset2);
setTradingFee(tradingFee);
}
AMMVoteBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMM_VOTE)
{
throw std::runtime_error("Invalid transaction type for AMMVoteBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMVoteBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAsset2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMVoteBuilder&
setAsset2(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset2] = STIssue(sfAsset2, value);
return *this;
}
/**
* Set sfTradingFee (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMVoteBuilder&
setTradingFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTradingFee] = value;
return *this;
}
/**
* Build and return the completed AMMVote wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AMMVote
build()
{
return AMMVote(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,262 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AMMWithdrawBuilder;
/**
* Transaction: AMMWithdraw
* Type: ttAMM_WITHDRAW (37)
* Delegable: Delegation::delegable
* Amendment: featureAMM
* Privileges: mayDeleteAcct
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AMMWithdrawBuilder to construct new transactions.
*/
class AMMWithdraw : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMM_WITHDRAW;
/**
* Construct a AMMWithdraw transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AMMWithdraw(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AMMWithdraw");
}
}
// Transaction-specific field getters
/**
* Get sfAsset (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset() const
{
return this->tx_.at(sfAsset);
}
/**
* Get sfAsset2 (soeREQUIRED)
*/
[[nodiscard]]
SF_ISSUE::type::value_type
getAsset2() const
{
return this->tx_.at(sfAsset2);
}
/**
* Get sfAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount() const
{
if (hasAmount())
{
return this->tx_.at(sfAmount);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount() const
{
return this->tx_.isFieldPresent(sfAmount);
}
/**
* Get sfAmount2 (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount2() const
{
if (hasAmount2())
{
return this->tx_.at(sfAmount2);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount2() const
{
return this->tx_.isFieldPresent(sfAmount2);
}
/**
* Get sfEPrice (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getEPrice() const
{
if (hasEPrice())
{
return this->tx_.at(sfEPrice);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasEPrice() const
{
return this->tx_.isFieldPresent(sfEPrice);
}
/**
* Get sfLPTokenIn (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getLPTokenIn() const
{
if (hasLPTokenIn())
{
return this->tx_.at(sfLPTokenIn);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLPTokenIn() const
{
return this->tx_.isFieldPresent(sfLPTokenIn);
}
};
/**
* Builder for AMMWithdraw transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AMMWithdrawBuilder : public TransactionBuilderBase<AMMWithdrawBuilder>
{
public:
AMMWithdrawBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ISSUE::type::value_type> const& asset, std::decay_t<typename SF_ISSUE::type::value_type> const& asset2, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AMMWithdrawBuilder>(ttAMM_WITHDRAW, account, sequence, fee)
{
setAsset(asset);
setAsset2(asset2);
}
AMMWithdrawBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMM_WITHDRAW)
{
throw std::runtime_error("Invalid transaction type for AMMWithdrawBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAsset (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMWithdrawBuilder&
setAsset(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset] = STIssue(sfAsset, value);
return *this;
}
/**
* Set sfAsset2 (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AMMWithdrawBuilder&
setAsset2(std::decay_t<typename SF_ISSUE::type::value_type> const& value)
{
object_[sfAsset2] = STIssue(sfAsset2, value);
return *this;
}
/**
* Set sfAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMWithdrawBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfAmount2 (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMWithdrawBuilder&
setAmount2(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount2] = value;
return *this;
}
/**
* Set sfEPrice (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMWithdrawBuilder&
setEPrice(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfEPrice] = value;
return *this;
}
/**
* Set sfLPTokenIn (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AMMWithdrawBuilder&
setLPTokenIn(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfLPTokenIn] = value;
return *this;
}
/**
* Build and return the completed AMMWithdraw wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AMMWithdraw
build()
{
return AMMWithdraw(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,176 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AccountDeleteBuilder;
/**
* Transaction: AccountDelete
* Type: ttACCOUNT_DELETE (21)
* Delegable: Delegation::notDelegable
* Amendment: uint256{}
* Privileges: mustDeleteAcct
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AccountDeleteBuilder to construct new transactions.
*/
class AccountDelete : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttACCOUNT_DELETE;
/**
* Construct a AccountDelete transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AccountDelete(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AccountDelete");
}
}
// Transaction-specific field getters
/**
* Get sfDestination (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getDestination() const
{
return this->tx_.at(sfDestination);
}
/**
* Get sfDestinationTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getDestinationTag() const
{
if (hasDestinationTag())
{
return this->tx_.at(sfDestinationTag);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationTag() const
{
return this->tx_.isFieldPresent(sfDestinationTag);
}
/**
* Get sfCredentialIDs (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VECTOR256::type::value_type>
getCredentialIDs() const
{
if (hasCredentialIDs())
{
return this->tx_.at(sfCredentialIDs);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCredentialIDs() const
{
return this->tx_.isFieldPresent(sfCredentialIDs);
}
};
/**
* Builder for AccountDelete transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AccountDeleteBuilder : public TransactionBuilderBase<AccountDeleteBuilder>
{
public:
AccountDeleteBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& destination, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AccountDeleteBuilder>(ttACCOUNT_DELETE, account, sequence, fee)
{
setDestination(destination);
}
AccountDeleteBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttACCOUNT_DELETE)
{
throw std::runtime_error("Invalid transaction type for AccountDeleteBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfDestination (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
AccountDeleteBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfDestinationTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountDeleteBuilder&
setDestinationTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfDestinationTag] = value;
return *this;
}
/**
* Set sfCredentialIDs (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountDeleteBuilder&
setCredentialIDs(std::decay_t<typename SF_VECTOR256::type::value_type> const& value)
{
object_[sfCredentialIDs] = value;
return *this;
}
/**
* Build and return the completed AccountDelete wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AccountDelete
build()
{
return AccountDelete(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,410 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class AccountSetBuilder;
/**
* Transaction: AccountSet
* Type: ttACCOUNT_SET (3)
* Delegable: Delegation::notDelegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use AccountSetBuilder to construct new transactions.
*/
class AccountSet : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttACCOUNT_SET;
/**
* Construct a AccountSet transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit AccountSet(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for AccountSet");
}
}
// Transaction-specific field getters
/**
* Get sfEmailHash (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT128::type::value_type>
getEmailHash() const
{
if (hasEmailHash())
{
return this->tx_.at(sfEmailHash);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasEmailHash() const
{
return this->tx_.isFieldPresent(sfEmailHash);
}
/**
* Get sfWalletLocator (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getWalletLocator() const
{
if (hasWalletLocator())
{
return this->tx_.at(sfWalletLocator);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasWalletLocator() const
{
return this->tx_.isFieldPresent(sfWalletLocator);
}
/**
* Get sfWalletSize (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getWalletSize() const
{
if (hasWalletSize())
{
return this->tx_.at(sfWalletSize);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasWalletSize() const
{
return this->tx_.isFieldPresent(sfWalletSize);
}
/**
* Get sfMessageKey (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getMessageKey() const
{
if (hasMessageKey())
{
return this->tx_.at(sfMessageKey);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasMessageKey() const
{
return this->tx_.isFieldPresent(sfMessageKey);
}
/**
* Get sfDomain (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getDomain() const
{
if (hasDomain())
{
return this->tx_.at(sfDomain);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDomain() const
{
return this->tx_.isFieldPresent(sfDomain);
}
/**
* Get sfTransferRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getTransferRate() const
{
if (hasTransferRate())
{
return this->tx_.at(sfTransferRate);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasTransferRate() const
{
return this->tx_.isFieldPresent(sfTransferRate);
}
/**
* Get sfSetFlag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getSetFlag() const
{
if (hasSetFlag())
{
return this->tx_.at(sfSetFlag);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasSetFlag() const
{
return this->tx_.isFieldPresent(sfSetFlag);
}
/**
* Get sfClearFlag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getClearFlag() const
{
if (hasClearFlag())
{
return this->tx_.at(sfClearFlag);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasClearFlag() const
{
return this->tx_.isFieldPresent(sfClearFlag);
}
/**
* Get sfTickSize (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT8::type::value_type>
getTickSize() const
{
if (hasTickSize())
{
return this->tx_.at(sfTickSize);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasTickSize() const
{
return this->tx_.isFieldPresent(sfTickSize);
}
/**
* Get sfNFTokenMinter (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getNFTokenMinter() const
{
if (hasNFTokenMinter())
{
return this->tx_.at(sfNFTokenMinter);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasNFTokenMinter() const
{
return this->tx_.isFieldPresent(sfNFTokenMinter);
}
};
/**
* Builder for AccountSet transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class AccountSetBuilder : public TransactionBuilderBase<AccountSetBuilder>
{
public:
AccountSetBuilder(SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<AccountSetBuilder>(ttACCOUNT_SET, account, sequence, fee)
{
}
AccountSetBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttACCOUNT_SET)
{
throw std::runtime_error("Invalid transaction type for AccountSetBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfEmailHash (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setEmailHash(std::decay_t<typename SF_UINT128::type::value_type> const& value)
{
object_[sfEmailHash] = value;
return *this;
}
/**
* Set sfWalletLocator (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setWalletLocator(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfWalletLocator] = value;
return *this;
}
/**
* Set sfWalletSize (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setWalletSize(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfWalletSize] = value;
return *this;
}
/**
* Set sfMessageKey (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setMessageKey(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfMessageKey] = value;
return *this;
}
/**
* Set sfDomain (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setDomain(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfDomain] = value;
return *this;
}
/**
* Set sfTransferRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setTransferRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfTransferRate] = value;
return *this;
}
/**
* Set sfSetFlag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setSetFlag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfSetFlag] = value;
return *this;
}
/**
* Set sfClearFlag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setClearFlag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfClearFlag] = value;
return *this;
}
/**
* Set sfTickSize (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setTickSize(std::decay_t<typename SF_UINT8::type::value_type> const& value)
{
object_[sfTickSize] = value;
return *this;
}
/**
* Set sfNFTokenMinter (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
AccountSetBuilder&
setNFTokenMinter(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfNFTokenMinter] = value;
return *this;
}
/**
* Build and return the completed AccountSet wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
AccountSet
build()
{
return AccountSet(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,142 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class BatchBuilder;
/**
* Transaction: Batch
* Type: ttBATCH (71)
* Delegable: Delegation::notDelegable
* Amendment: featureBatch
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use BatchBuilder to construct new transactions.
*/
class Batch : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttBATCH;
/**
* Construct a Batch transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit Batch(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for Batch");
}
}
// Transaction-specific field getters
/**
* Get sfRawTransactions (soeREQUIRED)
* Note: This is an untyped field
*/
[[nodiscard]]
STArray const&
getRawTransactions() const
{
return this->tx_.getFieldArray(sfRawTransactions);
}
/**
* Get sfBatchSigners (soeOPTIONAL)
* Note: This is an untyped field
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getBatchSigners() const
{
if (this->tx_.isFieldPresent(sfBatchSigners))
return this->tx_.getFieldArray(sfBatchSigners);
return std::nullopt;
}
[[nodiscard]]
bool
hasBatchSigners() const
{
return this->tx_.isFieldPresent(sfBatchSigners);
}
};
/**
* Builder for Batch transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class BatchBuilder : public TransactionBuilderBase<BatchBuilder>
{
public:
BatchBuilder(SF_ACCOUNT::type::value_type account,
STArray const& rawTransactions, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<BatchBuilder>(ttBATCH, account, sequence, fee)
{
setRawTransactions(rawTransactions);
}
BatchBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttBATCH)
{
throw std::runtime_error("Invalid transaction type for BatchBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfRawTransactions (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
BatchBuilder&
setRawTransactions(STArray const& value)
{
object_.setFieldArray(sfRawTransactions, value);
return *this;
}
/**
* Set sfBatchSigners (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
BatchBuilder&
setBatchSigners(STArray const& value)
{
object_.setFieldArray(sfBatchSigners, value);
return *this;
}
/**
* Build and return the completed Batch wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
Batch
build()
{
return Batch(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,112 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class CheckCancelBuilder;
/**
* Transaction: CheckCancel
* Type: ttCHECK_CANCEL (18)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use CheckCancelBuilder to construct new transactions.
*/
class CheckCancel : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttCHECK_CANCEL;
/**
* Construct a CheckCancel transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit CheckCancel(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for CheckCancel");
}
}
// Transaction-specific field getters
/**
* Get sfCheckID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getCheckID() const
{
return this->tx_.at(sfCheckID);
}
};
/**
* Builder for CheckCancel transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class CheckCancelBuilder : public TransactionBuilderBase<CheckCancelBuilder>
{
public:
CheckCancelBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& checkID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<CheckCancelBuilder>(ttCHECK_CANCEL, account, sequence, fee)
{
setCheckID(checkID);
}
CheckCancelBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttCHECK_CANCEL)
{
throw std::runtime_error("Invalid transaction type for CheckCancelBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfCheckID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckCancelBuilder&
setCheckID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfCheckID] = value;
return *this;
}
/**
* Build and return the completed CheckCancel wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
CheckCancel
build()
{
return CheckCancel(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,176 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class CheckCashBuilder;
/**
* Transaction: CheckCash
* Type: ttCHECK_CASH (17)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use CheckCashBuilder to construct new transactions.
*/
class CheckCash : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttCHECK_CASH;
/**
* Construct a CheckCash transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit CheckCash(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for CheckCash");
}
}
// Transaction-specific field getters
/**
* Get sfCheckID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getCheckID() const
{
return this->tx_.at(sfCheckID);
}
/**
* Get sfAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount() const
{
if (hasAmount())
{
return this->tx_.at(sfAmount);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount() const
{
return this->tx_.isFieldPresent(sfAmount);
}
/**
* Get sfDeliverMin (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getDeliverMin() const
{
if (hasDeliverMin())
{
return this->tx_.at(sfDeliverMin);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDeliverMin() const
{
return this->tx_.isFieldPresent(sfDeliverMin);
}
};
/**
* Builder for CheckCash transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class CheckCashBuilder : public TransactionBuilderBase<CheckCashBuilder>
{
public:
CheckCashBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& checkID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<CheckCashBuilder>(ttCHECK_CASH, account, sequence, fee)
{
setCheckID(checkID);
}
CheckCashBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttCHECK_CASH)
{
throw std::runtime_error("Invalid transaction type for CheckCashBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfCheckID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckCashBuilder&
setCheckID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfCheckID] = value;
return *this;
}
/**
* Set sfAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckCashBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfDeliverMin (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckCashBuilder&
setDeliverMin(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfDeliverMin] = value;
return *this;
}
/**
* Build and return the completed CheckCash wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
CheckCash
build()
{
return CheckCash(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,230 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class CheckCreateBuilder;
/**
* Transaction: CheckCreate
* Type: ttCHECK_CREATE (16)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use CheckCreateBuilder to construct new transactions.
*/
class CheckCreate : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttCHECK_CREATE;
/**
* Construct a CheckCreate transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit CheckCreate(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for CheckCreate");
}
}
// Transaction-specific field getters
/**
* Get sfDestination (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getDestination() const
{
return this->tx_.at(sfDestination);
}
/**
* Get sfSendMax (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getSendMax() const
{
return this->tx_.at(sfSendMax);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
{
return this->tx_.at(sfExpiration);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->tx_.isFieldPresent(sfExpiration);
}
/**
* Get sfDestinationTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getDestinationTag() const
{
if (hasDestinationTag())
{
return this->tx_.at(sfDestinationTag);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationTag() const
{
return this->tx_.isFieldPresent(sfDestinationTag);
}
/**
* Get sfInvoiceID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getInvoiceID() const
{
if (hasInvoiceID())
{
return this->tx_.at(sfInvoiceID);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasInvoiceID() const
{
return this->tx_.isFieldPresent(sfInvoiceID);
}
};
/**
* Builder for CheckCreate transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class CheckCreateBuilder : public TransactionBuilderBase<CheckCreateBuilder>
{
public:
CheckCreateBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& destination, std::decay_t<typename SF_AMOUNT::type::value_type> const& sendMax, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<CheckCreateBuilder>(ttCHECK_CREATE, account, sequence, fee)
{
setDestination(destination);
setSendMax(sendMax);
}
CheckCreateBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttCHECK_CREATE)
{
throw std::runtime_error("Invalid transaction type for CheckCreateBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfDestination (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckCreateBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfSendMax (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CheckCreateBuilder&
setSendMax(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfSendMax] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckCreateBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Set sfDestinationTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckCreateBuilder&
setDestinationTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfDestinationTag] = value;
return *this;
}
/**
* Set sfInvoiceID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CheckCreateBuilder&
setInvoiceID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfInvoiceID] = value;
return *this;
}
/**
* Build and return the completed CheckCreate wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
CheckCreate
build()
{
return CheckCreate(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,146 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class ClawbackBuilder;
/**
* Transaction: Clawback
* Type: ttCLAWBACK (30)
* Delegable: Delegation::delegable
* Amendment: featureClawback
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use ClawbackBuilder to construct new transactions.
*/
class Clawback : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttCLAWBACK;
/**
* Construct a Clawback transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit Clawback(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for Clawback");
}
}
// Transaction-specific field getters
/**
* Get sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->tx_.at(sfAmount);
}
/**
* Get sfHolder (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getHolder() const
{
if (hasHolder())
{
return this->tx_.at(sfHolder);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasHolder() const
{
return this->tx_.isFieldPresent(sfHolder);
}
};
/**
* Builder for Clawback transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class ClawbackBuilder : public TransactionBuilderBase<ClawbackBuilder>
{
public:
ClawbackBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_AMOUNT::type::value_type> const& amount, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<ClawbackBuilder>(ttCLAWBACK, account, sequence, fee)
{
setAmount(amount);
}
ClawbackBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttCLAWBACK)
{
throw std::runtime_error("Invalid transaction type for ClawbackBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
* @return Reference to this builder for method chaining.
*/
ClawbackBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfHolder (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
ClawbackBuilder&
setHolder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfHolder] = value;
return *this;
}
/**
* Build and return the completed Clawback wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
Clawback
build()
{
return Clawback(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,134 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class CredentialAcceptBuilder;
/**
* Transaction: CredentialAccept
* Type: ttCREDENTIAL_ACCEPT (59)
* Delegable: Delegation::delegable
* Amendment: featureCredentials
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use CredentialAcceptBuilder to construct new transactions.
*/
class CredentialAccept : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttCREDENTIAL_ACCEPT;
/**
* Construct a CredentialAccept transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit CredentialAccept(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for CredentialAccept");
}
}
// Transaction-specific field getters
/**
* Get sfIssuer (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getIssuer() const
{
return this->tx_.at(sfIssuer);
}
/**
* Get sfCredentialType (soeREQUIRED)
*/
[[nodiscard]]
SF_VL::type::value_type
getCredentialType() const
{
return this->tx_.at(sfCredentialType);
}
};
/**
* Builder for CredentialAccept transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class CredentialAcceptBuilder : public TransactionBuilderBase<CredentialAcceptBuilder>
{
public:
CredentialAcceptBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& issuer, std::decay_t<typename SF_VL::type::value_type> const& credentialType, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<CredentialAcceptBuilder>(ttCREDENTIAL_ACCEPT, account, sequence, fee)
{
setIssuer(issuer);
setCredentialType(credentialType);
}
CredentialAcceptBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttCREDENTIAL_ACCEPT)
{
throw std::runtime_error("Invalid transaction type for CredentialAcceptBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfIssuer (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialAcceptBuilder&
setIssuer(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfIssuer] = value;
return *this;
}
/**
* Set sfCredentialType (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialAcceptBuilder&
setCredentialType(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfCredentialType] = value;
return *this;
}
/**
* Build and return the completed CredentialAccept wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
CredentialAccept
build()
{
return CredentialAccept(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,198 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class CredentialCreateBuilder;
/**
* Transaction: CredentialCreate
* Type: ttCREDENTIAL_CREATE (58)
* Delegable: Delegation::delegable
* Amendment: featureCredentials
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use CredentialCreateBuilder to construct new transactions.
*/
class CredentialCreate : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttCREDENTIAL_CREATE;
/**
* Construct a CredentialCreate transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit CredentialCreate(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for CredentialCreate");
}
}
// Transaction-specific field getters
/**
* Get sfSubject (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getSubject() const
{
return this->tx_.at(sfSubject);
}
/**
* Get sfCredentialType (soeREQUIRED)
*/
[[nodiscard]]
SF_VL::type::value_type
getCredentialType() const
{
return this->tx_.at(sfCredentialType);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
{
return this->tx_.at(sfExpiration);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->tx_.isFieldPresent(sfExpiration);
}
/**
* Get sfURI (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getURI() const
{
if (hasURI())
{
return this->tx_.at(sfURI);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasURI() const
{
return this->tx_.isFieldPresent(sfURI);
}
};
/**
* Builder for CredentialCreate transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class CredentialCreateBuilder : public TransactionBuilderBase<CredentialCreateBuilder>
{
public:
CredentialCreateBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& subject, std::decay_t<typename SF_VL::type::value_type> const& credentialType, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<CredentialCreateBuilder>(ttCREDENTIAL_CREATE, account, sequence, fee)
{
setSubject(subject);
setCredentialType(credentialType);
}
CredentialCreateBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttCREDENTIAL_CREATE)
{
throw std::runtime_error("Invalid transaction type for CredentialCreateBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfSubject (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialCreateBuilder&
setSubject(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfSubject] = value;
return *this;
}
/**
* Set sfCredentialType (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialCreateBuilder&
setCredentialType(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfCredentialType] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CredentialCreateBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Set sfURI (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CredentialCreateBuilder&
setURI(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfURI] = value;
return *this;
}
/**
* Build and return the completed CredentialCreate wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
CredentialCreate
build()
{
return CredentialCreate(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,176 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class CredentialDeleteBuilder;
/**
* Transaction: CredentialDelete
* Type: ttCREDENTIAL_DELETE (60)
* Delegable: Delegation::delegable
* Amendment: featureCredentials
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use CredentialDeleteBuilder to construct new transactions.
*/
class CredentialDelete : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttCREDENTIAL_DELETE;
/**
* Construct a CredentialDelete transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit CredentialDelete(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for CredentialDelete");
}
}
// Transaction-specific field getters
/**
* Get sfSubject (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getSubject() const
{
if (hasSubject())
{
return this->tx_.at(sfSubject);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasSubject() const
{
return this->tx_.isFieldPresent(sfSubject);
}
/**
* Get sfIssuer (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getIssuer() const
{
if (hasIssuer())
{
return this->tx_.at(sfIssuer);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasIssuer() const
{
return this->tx_.isFieldPresent(sfIssuer);
}
/**
* Get sfCredentialType (soeREQUIRED)
*/
[[nodiscard]]
SF_VL::type::value_type
getCredentialType() const
{
return this->tx_.at(sfCredentialType);
}
};
/**
* Builder for CredentialDelete transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class CredentialDeleteBuilder : public TransactionBuilderBase<CredentialDeleteBuilder>
{
public:
CredentialDeleteBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_VL::type::value_type> const& credentialType, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<CredentialDeleteBuilder>(ttCREDENTIAL_DELETE, account, sequence, fee)
{
setCredentialType(credentialType);
}
CredentialDeleteBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttCREDENTIAL_DELETE)
{
throw std::runtime_error("Invalid transaction type for CredentialDeleteBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfSubject (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CredentialDeleteBuilder&
setSubject(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfSubject] = value;
return *this;
}
/**
* Set sfIssuer (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
CredentialDeleteBuilder&
setIssuer(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfIssuer] = value;
return *this;
}
/**
* Set sfCredentialType (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
CredentialDeleteBuilder&
setCredentialType(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfCredentialType] = value;
return *this;
}
/**
* Build and return the completed CredentialDelete wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
CredentialDelete
build()
{
return CredentialDelete(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,90 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class DIDDeleteBuilder;
/**
* Transaction: DIDDelete
* Type: ttDID_DELETE (50)
* Delegable: Delegation::delegable
* Amendment: featureDID
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use DIDDeleteBuilder to construct new transactions.
*/
class DIDDelete : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttDID_DELETE;
/**
* Construct a DIDDelete transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit DIDDelete(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for DIDDelete");
}
}
// Transaction-specific field getters
};
/**
* Builder for DIDDelete transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class DIDDeleteBuilder : public TransactionBuilderBase<DIDDeleteBuilder>
{
public:
DIDDeleteBuilder(SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<DIDDeleteBuilder>(ttDID_DELETE, account, sequence, fee)
{
}
DIDDeleteBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttDID_DELETE)
{
throw std::runtime_error("Invalid transaction type for DIDDeleteBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Build and return the completed DIDDelete wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
DIDDelete
build()
{
return DIDDelete(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,186 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class DIDSetBuilder;
/**
* Transaction: DIDSet
* Type: ttDID_SET (49)
* Delegable: Delegation::delegable
* Amendment: featureDID
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use DIDSetBuilder to construct new transactions.
*/
class DIDSet : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttDID_SET;
/**
* Construct a DIDSet transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit DIDSet(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for DIDSet");
}
}
// Transaction-specific field getters
/**
* Get sfDIDDocument (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getDIDDocument() const
{
if (hasDIDDocument())
{
return this->tx_.at(sfDIDDocument);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDIDDocument() const
{
return this->tx_.isFieldPresent(sfDIDDocument);
}
/**
* Get sfURI (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getURI() const
{
if (hasURI())
{
return this->tx_.at(sfURI);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasURI() const
{
return this->tx_.isFieldPresent(sfURI);
}
/**
* Get sfData (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getData() const
{
if (hasData())
{
return this->tx_.at(sfData);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasData() const
{
return this->tx_.isFieldPresent(sfData);
}
};
/**
* Builder for DIDSet transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class DIDSetBuilder : public TransactionBuilderBase<DIDSetBuilder>
{
public:
DIDSetBuilder(SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<DIDSetBuilder>(ttDID_SET, account, sequence, fee)
{
}
DIDSetBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttDID_SET)
{
throw std::runtime_error("Invalid transaction type for DIDSetBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfDIDDocument (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DIDSetBuilder&
setDIDDocument(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfDIDDocument] = value;
return *this;
}
/**
* Set sfURI (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DIDSetBuilder&
setURI(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfURI] = value;
return *this;
}
/**
* Set sfData (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DIDSetBuilder&
setData(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfData] = value;
return *this;
}
/**
* Build and return the completed DIDSet wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
DIDSet
build()
{
return DIDSet(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,134 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class DelegateSetBuilder;
/**
* Transaction: DelegateSet
* Type: ttDELEGATE_SET (64)
* Delegable: Delegation::notDelegable
* Amendment: featurePermissionDelegationV1_1
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use DelegateSetBuilder to construct new transactions.
*/
class DelegateSet : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttDELEGATE_SET;
/**
* Construct a DelegateSet transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit DelegateSet(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for DelegateSet");
}
}
// Transaction-specific field getters
/**
* Get sfAuthorize (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getAuthorize() const
{
return this->tx_.at(sfAuthorize);
}
/**
* Get sfPermissions (soeREQUIRED)
* Note: This is an untyped field
*/
[[nodiscard]]
STArray const&
getPermissions() const
{
return this->tx_.getFieldArray(sfPermissions);
}
};
/**
* Builder for DelegateSet transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class DelegateSetBuilder : public TransactionBuilderBase<DelegateSetBuilder>
{
public:
DelegateSetBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& authorize, STArray const& permissions, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<DelegateSetBuilder>(ttDELEGATE_SET, account, sequence, fee)
{
setAuthorize(authorize);
setPermissions(permissions);
}
DelegateSetBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttDELEGATE_SET)
{
throw std::runtime_error("Invalid transaction type for DelegateSetBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAuthorize (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateSetBuilder&
setAuthorize(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAuthorize] = value;
return *this;
}
/**
* Set sfPermissions (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
DelegateSetBuilder&
setPermissions(STArray const& value)
{
object_.setFieldArray(sfPermissions, value);
return *this;
}
/**
* Build and return the completed DelegateSet wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
DelegateSet
build()
{
return DelegateSet(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,214 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class DepositPreauthBuilder;
/**
* Transaction: DepositPreauth
* Type: ttDEPOSIT_PREAUTH (19)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use DepositPreauthBuilder to construct new transactions.
*/
class DepositPreauth : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttDEPOSIT_PREAUTH;
/**
* Construct a DepositPreauth transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit DepositPreauth(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for DepositPreauth");
}
}
// Transaction-specific field getters
/**
* Get sfAuthorize (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getAuthorize() const
{
if (hasAuthorize())
{
return this->tx_.at(sfAuthorize);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAuthorize() const
{
return this->tx_.isFieldPresent(sfAuthorize);
}
/**
* Get sfUnauthorize (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getUnauthorize() const
{
if (hasUnauthorize())
{
return this->tx_.at(sfUnauthorize);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasUnauthorize() const
{
return this->tx_.isFieldPresent(sfUnauthorize);
}
/**
* Get sfAuthorizeCredentials (soeOPTIONAL)
* Note: This is an untyped field
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getAuthorizeCredentials() const
{
if (this->tx_.isFieldPresent(sfAuthorizeCredentials))
return this->tx_.getFieldArray(sfAuthorizeCredentials);
return std::nullopt;
}
[[nodiscard]]
bool
hasAuthorizeCredentials() const
{
return this->tx_.isFieldPresent(sfAuthorizeCredentials);
}
/**
* Get sfUnauthorizeCredentials (soeOPTIONAL)
* Note: This is an untyped field
*/
[[nodiscard]]
std::optional<std::reference_wrapper<STArray const>>
getUnauthorizeCredentials() const
{
if (this->tx_.isFieldPresent(sfUnauthorizeCredentials))
return this->tx_.getFieldArray(sfUnauthorizeCredentials);
return std::nullopt;
}
[[nodiscard]]
bool
hasUnauthorizeCredentials() const
{
return this->tx_.isFieldPresent(sfUnauthorizeCredentials);
}
};
/**
* Builder for DepositPreauth transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class DepositPreauthBuilder : public TransactionBuilderBase<DepositPreauthBuilder>
{
public:
DepositPreauthBuilder(SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<DepositPreauthBuilder>(ttDEPOSIT_PREAUTH, account, sequence, fee)
{
}
DepositPreauthBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttDEPOSIT_PREAUTH)
{
throw std::runtime_error("Invalid transaction type for DepositPreauthBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAuthorize (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setAuthorize(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfAuthorize] = value;
return *this;
}
/**
* Set sfUnauthorize (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setUnauthorize(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfUnauthorize] = value;
return *this;
}
/**
* Set sfAuthorizeCredentials (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setAuthorizeCredentials(STArray const& value)
{
object_.setFieldArray(sfAuthorizeCredentials, value);
return *this;
}
/**
* Set sfUnauthorizeCredentials (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
DepositPreauthBuilder&
setUnauthorizeCredentials(STArray const& value)
{
object_.setFieldArray(sfUnauthorizeCredentials, value);
return *this;
}
/**
* Build and return the completed DepositPreauth wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
DepositPreauth
build()
{
return DepositPreauth(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,134 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class EnableAmendmentBuilder;
/**
* Transaction: EnableAmendment
* Type: ttAMENDMENT (100)
* Delegable: Delegation::notDelegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use EnableAmendmentBuilder to construct new transactions.
*/
class EnableAmendment : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttAMENDMENT;
/**
* Construct a EnableAmendment transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit EnableAmendment(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for EnableAmendment");
}
}
// Transaction-specific field getters
/**
* Get sfLedgerSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getLedgerSequence() const
{
return this->tx_.at(sfLedgerSequence);
}
/**
* Get sfAmendment (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getAmendment() const
{
return this->tx_.at(sfAmendment);
}
};
/**
* Builder for EnableAmendment transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class EnableAmendmentBuilder : public TransactionBuilderBase<EnableAmendmentBuilder>
{
public:
EnableAmendmentBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT32::type::value_type> const& ledgerSequence, std::decay_t<typename SF_UINT256::type::value_type> const& amendment, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<EnableAmendmentBuilder>(ttAMENDMENT, account, sequence, fee)
{
setLedgerSequence(ledgerSequence);
setAmendment(amendment);
}
EnableAmendmentBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttAMENDMENT)
{
throw std::runtime_error("Invalid transaction type for EnableAmendmentBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLedgerSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EnableAmendmentBuilder&
setLedgerSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLedgerSequence] = value;
return *this;
}
/**
* Set sfAmendment (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EnableAmendmentBuilder&
setAmendment(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfAmendment] = value;
return *this;
}
/**
* Build and return the completed EnableAmendment wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
EnableAmendment
build()
{
return EnableAmendment(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,134 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class EscrowCancelBuilder;
/**
* Transaction: EscrowCancel
* Type: ttESCROW_CANCEL (4)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use EscrowCancelBuilder to construct new transactions.
*/
class EscrowCancel : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttESCROW_CANCEL;
/**
* Construct a EscrowCancel transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit EscrowCancel(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for EscrowCancel");
}
}
// Transaction-specific field getters
/**
* Get sfOwner (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOwner() const
{
return this->tx_.at(sfOwner);
}
/**
* Get sfOfferSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getOfferSequence() const
{
return this->tx_.at(sfOfferSequence);
}
};
/**
* Builder for EscrowCancel transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class EscrowCancelBuilder : public TransactionBuilderBase<EscrowCancelBuilder>
{
public:
EscrowCancelBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& owner, std::decay_t<typename SF_UINT32::type::value_type> const& offerSequence, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<EscrowCancelBuilder>(ttESCROW_CANCEL, account, sequence, fee)
{
setOwner(owner);
setOfferSequence(offerSequence);
}
EscrowCancelBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttESCROW_CANCEL)
{
throw std::runtime_error("Invalid transaction type for EscrowCancelBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfOwner (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowCancelBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfOfferSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowCancelBuilder&
setOfferSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOfferSequence] = value;
return *this;
}
/**
* Build and return the completed EscrowCancel wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
EscrowCancel
build()
{
return EscrowCancel(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,264 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class EscrowCreateBuilder;
/**
* Transaction: EscrowCreate
* Type: ttESCROW_CREATE (1)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use EscrowCreateBuilder to construct new transactions.
*/
class EscrowCreate : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttESCROW_CREATE;
/**
* Construct a EscrowCreate transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit EscrowCreate(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for EscrowCreate");
}
}
// Transaction-specific field getters
/**
* Get sfDestination (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getDestination() const
{
return this->tx_.at(sfDestination);
}
/**
* Get sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->tx_.at(sfAmount);
}
/**
* Get sfCondition (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getCondition() const
{
if (hasCondition())
{
return this->tx_.at(sfCondition);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCondition() const
{
return this->tx_.isFieldPresent(sfCondition);
}
/**
* Get sfCancelAfter (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCancelAfter() const
{
if (hasCancelAfter())
{
return this->tx_.at(sfCancelAfter);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCancelAfter() const
{
return this->tx_.isFieldPresent(sfCancelAfter);
}
/**
* Get sfFinishAfter (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getFinishAfter() const
{
if (hasFinishAfter())
{
return this->tx_.at(sfFinishAfter);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasFinishAfter() const
{
return this->tx_.isFieldPresent(sfFinishAfter);
}
/**
* Get sfDestinationTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getDestinationTag() const
{
if (hasDestinationTag())
{
return this->tx_.at(sfDestinationTag);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationTag() const
{
return this->tx_.isFieldPresent(sfDestinationTag);
}
};
/**
* Builder for EscrowCreate transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class EscrowCreateBuilder : public TransactionBuilderBase<EscrowCreateBuilder>
{
public:
EscrowCreateBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& destination, std::decay_t<typename SF_AMOUNT::type::value_type> const& amount, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<EscrowCreateBuilder>(ttESCROW_CREATE, account, sequence, fee)
{
setDestination(destination);
setAmount(amount);
}
EscrowCreateBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttESCROW_CREATE)
{
throw std::runtime_error("Invalid transaction type for EscrowCreateBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfDestination (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowCreateBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
* @return Reference to this builder for method chaining.
*/
EscrowCreateBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfCondition (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowCreateBuilder&
setCondition(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfCondition] = value;
return *this;
}
/**
* Set sfCancelAfter (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowCreateBuilder&
setCancelAfter(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCancelAfter] = value;
return *this;
}
/**
* Set sfFinishAfter (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowCreateBuilder&
setFinishAfter(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfFinishAfter] = value;
return *this;
}
/**
* Set sfDestinationTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowCreateBuilder&
setDestinationTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfDestinationTag] = value;
return *this;
}
/**
* Build and return the completed EscrowCreate wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
EscrowCreate
build()
{
return EscrowCreate(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,230 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class EscrowFinishBuilder;
/**
* Transaction: EscrowFinish
* Type: ttESCROW_FINISH (2)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use EscrowFinishBuilder to construct new transactions.
*/
class EscrowFinish : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttESCROW_FINISH;
/**
* Construct a EscrowFinish transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit EscrowFinish(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for EscrowFinish");
}
}
// Transaction-specific field getters
/**
* Get sfOwner (soeREQUIRED)
*/
[[nodiscard]]
SF_ACCOUNT::type::value_type
getOwner() const
{
return this->tx_.at(sfOwner);
}
/**
* Get sfOfferSequence (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getOfferSequence() const
{
return this->tx_.at(sfOfferSequence);
}
/**
* Get sfFulfillment (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getFulfillment() const
{
if (hasFulfillment())
{
return this->tx_.at(sfFulfillment);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasFulfillment() const
{
return this->tx_.isFieldPresent(sfFulfillment);
}
/**
* Get sfCondition (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getCondition() const
{
if (hasCondition())
{
return this->tx_.at(sfCondition);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCondition() const
{
return this->tx_.isFieldPresent(sfCondition);
}
/**
* Get sfCredentialIDs (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VECTOR256::type::value_type>
getCredentialIDs() const
{
if (hasCredentialIDs())
{
return this->tx_.at(sfCredentialIDs);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCredentialIDs() const
{
return this->tx_.isFieldPresent(sfCredentialIDs);
}
};
/**
* Builder for EscrowFinish transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class EscrowFinishBuilder : public TransactionBuilderBase<EscrowFinishBuilder>
{
public:
EscrowFinishBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_ACCOUNT::type::value_type> const& owner, std::decay_t<typename SF_UINT32::type::value_type> const& offerSequence, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<EscrowFinishBuilder>(ttESCROW_FINISH, account, sequence, fee)
{
setOwner(owner);
setOfferSequence(offerSequence);
}
EscrowFinishBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttESCROW_FINISH)
{
throw std::runtime_error("Invalid transaction type for EscrowFinishBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfOwner (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowFinishBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfOfferSequence (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
EscrowFinishBuilder&
setOfferSequence(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOfferSequence] = value;
return *this;
}
/**
* Set sfFulfillment (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowFinishBuilder&
setFulfillment(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfFulfillment] = value;
return *this;
}
/**
* Set sfCondition (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowFinishBuilder&
setCondition(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfCondition] = value;
return *this;
}
/**
* Set sfCredentialIDs (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
EscrowFinishBuilder&
setCredentialIDs(std::decay_t<typename SF_VECTOR256::type::value_type> const& value)
{
object_[sfCredentialIDs] = value;
return *this;
}
/**
* Build and return the completed EscrowFinish wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
EscrowFinish
build()
{
return EscrowFinish(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,144 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LedgerStateFixBuilder;
/**
* Transaction: LedgerStateFix
* Type: ttLEDGER_STATE_FIX (53)
* Delegable: Delegation::delegable
* Amendment: fixNFTokenPageLinks
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LedgerStateFixBuilder to construct new transactions.
*/
class LedgerStateFix : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLEDGER_STATE_FIX;
/**
* Construct a LedgerStateFix transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LedgerStateFix(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LedgerStateFix");
}
}
// Transaction-specific field getters
/**
* Get sfLedgerFixType (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT16::type::value_type
getLedgerFixType() const
{
return this->tx_.at(sfLedgerFixType);
}
/**
* Get sfOwner (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getOwner() const
{
if (hasOwner())
{
return this->tx_.at(sfOwner);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasOwner() const
{
return this->tx_.isFieldPresent(sfOwner);
}
};
/**
* Builder for LedgerStateFix transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LedgerStateFixBuilder : public TransactionBuilderBase<LedgerStateFixBuilder>
{
public:
LedgerStateFixBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT16::type::value_type> const& ledgerFixType, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LedgerStateFixBuilder>(ttLEDGER_STATE_FIX, account, sequence, fee)
{
setLedgerFixType(ledgerFixType);
}
LedgerStateFixBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLEDGER_STATE_FIX)
{
throw std::runtime_error("Invalid transaction type for LedgerStateFixBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLedgerFixType (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LedgerStateFixBuilder&
setLedgerFixType(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfLedgerFixType] = value;
return *this;
}
/**
* Set sfOwner (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LedgerStateFixBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Build and return the completed LedgerStateFix wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LedgerStateFix
build()
{
return LedgerStateFix(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,156 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanBrokerCoverClawbackBuilder;
/**
* Transaction: LoanBrokerCoverClawback
* Type: ttLOAN_BROKER_COVER_CLAWBACK (78)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanBrokerCoverClawbackBuilder to construct new transactions.
*/
class LoanBrokerCoverClawback : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_BROKER_COVER_CLAWBACK;
/**
* Construct a LoanBrokerCoverClawback transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanBrokerCoverClawback(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerCoverClawback");
}
}
// Transaction-specific field getters
/**
* Get sfLoanBrokerID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getLoanBrokerID() const
{
if (hasLoanBrokerID())
{
return this->tx_.at(sfLoanBrokerID);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanBrokerID() const
{
return this->tx_.isFieldPresent(sfLoanBrokerID);
}
/**
* Get sfAmount (soeOPTIONAL)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount() const
{
if (hasAmount())
{
return this->tx_.at(sfAmount);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount() const
{
return this->tx_.isFieldPresent(sfAmount);
}
};
/**
* Builder for LoanBrokerCoverClawback transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanBrokerCoverClawbackBuilder : public TransactionBuilderBase<LoanBrokerCoverClawbackBuilder>
{
public:
LoanBrokerCoverClawbackBuilder(SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanBrokerCoverClawbackBuilder>(ttLOAN_BROKER_COVER_CLAWBACK, account, sequence, fee)
{
}
LoanBrokerCoverClawbackBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_BROKER_COVER_CLAWBACK)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerCoverClawbackBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanBrokerID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverClawbackBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Set sfAmount (soeOPTIONAL)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverClawbackBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Build and return the completed LoanBrokerCoverClawback wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanBrokerCoverClawback
build()
{
return LoanBrokerCoverClawback(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,136 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanBrokerCoverDepositBuilder;
/**
* Transaction: LoanBrokerCoverDeposit
* Type: ttLOAN_BROKER_COVER_DEPOSIT (76)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanBrokerCoverDepositBuilder to construct new transactions.
*/
class LoanBrokerCoverDeposit : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_BROKER_COVER_DEPOSIT;
/**
* Construct a LoanBrokerCoverDeposit transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanBrokerCoverDeposit(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerCoverDeposit");
}
}
// Transaction-specific field getters
/**
* Get sfLoanBrokerID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanBrokerID() const
{
return this->tx_.at(sfLoanBrokerID);
}
/**
* Get sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->tx_.at(sfAmount);
}
};
/**
* Builder for LoanBrokerCoverDeposit transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanBrokerCoverDepositBuilder : public TransactionBuilderBase<LoanBrokerCoverDepositBuilder>
{
public:
LoanBrokerCoverDepositBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& loanBrokerID, std::decay_t<typename SF_AMOUNT::type::value_type> const& amount, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanBrokerCoverDepositBuilder>(ttLOAN_BROKER_COVER_DEPOSIT, account, sequence, fee)
{
setLoanBrokerID(loanBrokerID);
setAmount(amount);
}
LoanBrokerCoverDepositBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_BROKER_COVER_DEPOSIT)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerCoverDepositBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanBrokerID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverDepositBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverDepositBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Build and return the completed LoanBrokerCoverDeposit wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanBrokerCoverDeposit
build()
{
return LoanBrokerCoverDeposit(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,200 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanBrokerCoverWithdrawBuilder;
/**
* Transaction: LoanBrokerCoverWithdraw
* Type: ttLOAN_BROKER_COVER_WITHDRAW (77)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: mayAuthorizeMPT
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanBrokerCoverWithdrawBuilder to construct new transactions.
*/
class LoanBrokerCoverWithdraw : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_BROKER_COVER_WITHDRAW;
/**
* Construct a LoanBrokerCoverWithdraw transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanBrokerCoverWithdraw(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerCoverWithdraw");
}
}
// Transaction-specific field getters
/**
* Get sfLoanBrokerID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanBrokerID() const
{
return this->tx_.at(sfLoanBrokerID);
}
/**
* Get sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->tx_.at(sfAmount);
}
/**
* Get sfDestination (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getDestination() const
{
if (hasDestination())
{
return this->tx_.at(sfDestination);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDestination() const
{
return this->tx_.isFieldPresent(sfDestination);
}
/**
* Get sfDestinationTag (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getDestinationTag() const
{
if (hasDestinationTag())
{
return this->tx_.at(sfDestinationTag);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDestinationTag() const
{
return this->tx_.isFieldPresent(sfDestinationTag);
}
};
/**
* Builder for LoanBrokerCoverWithdraw transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanBrokerCoverWithdrawBuilder : public TransactionBuilderBase<LoanBrokerCoverWithdrawBuilder>
{
public:
LoanBrokerCoverWithdrawBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& loanBrokerID, std::decay_t<typename SF_AMOUNT::type::value_type> const& amount, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanBrokerCoverWithdrawBuilder>(ttLOAN_BROKER_COVER_WITHDRAW, account, sequence, fee)
{
setLoanBrokerID(loanBrokerID);
setAmount(amount);
}
LoanBrokerCoverWithdrawBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_BROKER_COVER_WITHDRAW)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerCoverWithdrawBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanBrokerID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverWithdrawBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverWithdrawBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfDestination (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverWithdrawBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfDestinationTag (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerCoverWithdrawBuilder&
setDestinationTag(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfDestinationTag] = value;
return *this;
}
/**
* Build and return the completed LoanBrokerCoverWithdraw wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanBrokerCoverWithdraw
build()
{
return LoanBrokerCoverWithdraw(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,112 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanBrokerDeleteBuilder;
/**
* Transaction: LoanBrokerDelete
* Type: ttLOAN_BROKER_DELETE (75)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: mustDeleteAcct | mayAuthorizeMPT
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanBrokerDeleteBuilder to construct new transactions.
*/
class LoanBrokerDelete : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_BROKER_DELETE;
/**
* Construct a LoanBrokerDelete transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanBrokerDelete(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerDelete");
}
}
// Transaction-specific field getters
/**
* Get sfLoanBrokerID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanBrokerID() const
{
return this->tx_.at(sfLoanBrokerID);
}
};
/**
* Builder for LoanBrokerDelete transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanBrokerDeleteBuilder : public TransactionBuilderBase<LoanBrokerDeleteBuilder>
{
public:
LoanBrokerDeleteBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& loanBrokerID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanBrokerDeleteBuilder>(ttLOAN_BROKER_DELETE, account, sequence, fee)
{
setLoanBrokerID(loanBrokerID);
}
LoanBrokerDeleteBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_BROKER_DELETE)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerDeleteBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanBrokerID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerDeleteBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Build and return the completed LoanBrokerDelete wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanBrokerDelete
build()
{
return LoanBrokerDelete(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,304 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanBrokerSetBuilder;
/**
* Transaction: LoanBrokerSet
* Type: ttLOAN_BROKER_SET (74)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: createPseudoAcct | mayAuthorizeMPT
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanBrokerSetBuilder to construct new transactions.
*/
class LoanBrokerSet : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_BROKER_SET;
/**
* Construct a LoanBrokerSet transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanBrokerSet(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerSet");
}
}
// Transaction-specific field getters
/**
* Get sfVaultID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getVaultID() const
{
return this->tx_.at(sfVaultID);
}
/**
* Get sfLoanBrokerID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getLoanBrokerID() const
{
if (hasLoanBrokerID())
{
return this->tx_.at(sfLoanBrokerID);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanBrokerID() const
{
return this->tx_.isFieldPresent(sfLoanBrokerID);
}
/**
* Get sfData (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getData() const
{
if (hasData())
{
return this->tx_.at(sfData);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasData() const
{
return this->tx_.isFieldPresent(sfData);
}
/**
* Get sfManagementFeeRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getManagementFeeRate() const
{
if (hasManagementFeeRate())
{
return this->tx_.at(sfManagementFeeRate);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasManagementFeeRate() const
{
return this->tx_.isFieldPresent(sfManagementFeeRate);
}
/**
* Get sfDebtMaximum (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getDebtMaximum() const
{
if (hasDebtMaximum())
{
return this->tx_.at(sfDebtMaximum);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDebtMaximum() const
{
return this->tx_.isFieldPresent(sfDebtMaximum);
}
/**
* Get sfCoverRateMinimum (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCoverRateMinimum() const
{
if (hasCoverRateMinimum())
{
return this->tx_.at(sfCoverRateMinimum);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCoverRateMinimum() const
{
return this->tx_.isFieldPresent(sfCoverRateMinimum);
}
/**
* Get sfCoverRateLiquidation (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCoverRateLiquidation() const
{
if (hasCoverRateLiquidation())
{
return this->tx_.at(sfCoverRateLiquidation);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCoverRateLiquidation() const
{
return this->tx_.isFieldPresent(sfCoverRateLiquidation);
}
};
/**
* Builder for LoanBrokerSet transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanBrokerSetBuilder : public TransactionBuilderBase<LoanBrokerSetBuilder>
{
public:
LoanBrokerSetBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& vaultID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanBrokerSetBuilder>(ttLOAN_BROKER_SET, account, sequence, fee)
{
setVaultID(vaultID);
}
LoanBrokerSetBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_BROKER_SET)
{
throw std::runtime_error("Invalid transaction type for LoanBrokerSetBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfVaultID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanBrokerSetBuilder&
setVaultID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfVaultID] = value;
return *this;
}
/**
* Set sfLoanBrokerID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerSetBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Set sfData (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerSetBuilder&
setData(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfData] = value;
return *this;
}
/**
* Set sfManagementFeeRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerSetBuilder&
setManagementFeeRate(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfManagementFeeRate] = value;
return *this;
}
/**
* Set sfDebtMaximum (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerSetBuilder&
setDebtMaximum(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfDebtMaximum] = value;
return *this;
}
/**
* Set sfCoverRateMinimum (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerSetBuilder&
setCoverRateMinimum(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCoverRateMinimum] = value;
return *this;
}
/**
* Set sfCoverRateLiquidation (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanBrokerSetBuilder&
setCoverRateLiquidation(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCoverRateLiquidation] = value;
return *this;
}
/**
* Build and return the completed LoanBrokerSet wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanBrokerSet
build()
{
return LoanBrokerSet(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,112 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanDeleteBuilder;
/**
* Transaction: LoanDelete
* Type: ttLOAN_DELETE (81)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanDeleteBuilder to construct new transactions.
*/
class LoanDelete : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_DELETE;
/**
* Construct a LoanDelete transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanDelete(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanDelete");
}
}
// Transaction-specific field getters
/**
* Get sfLoanID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanID() const
{
return this->tx_.at(sfLoanID);
}
};
/**
* Builder for LoanDelete transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanDeleteBuilder : public TransactionBuilderBase<LoanDeleteBuilder>
{
public:
LoanDeleteBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& loanID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanDeleteBuilder>(ttLOAN_DELETE, account, sequence, fee)
{
setLoanID(loanID);
}
LoanDeleteBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_DELETE)
{
throw std::runtime_error("Invalid transaction type for LoanDeleteBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanDeleteBuilder&
setLoanID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanID] = value;
return *this;
}
/**
* Build and return the completed LoanDelete wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanDelete
build()
{
return LoanDelete(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,112 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanManageBuilder;
/**
* Transaction: LoanManage
* Type: ttLOAN_MANAGE (82)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: mayModifyVault
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanManageBuilder to construct new transactions.
*/
class LoanManage : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_MANAGE;
/**
* Construct a LoanManage transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanManage(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanManage");
}
}
// Transaction-specific field getters
/**
* Get sfLoanID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanID() const
{
return this->tx_.at(sfLoanID);
}
};
/**
* Builder for LoanManage transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanManageBuilder : public TransactionBuilderBase<LoanManageBuilder>
{
public:
LoanManageBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& loanID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanManageBuilder>(ttLOAN_MANAGE, account, sequence, fee)
{
setLoanID(loanID);
}
LoanManageBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_MANAGE)
{
throw std::runtime_error("Invalid transaction type for LoanManageBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanManageBuilder&
setLoanID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanID] = value;
return *this;
}
/**
* Build and return the completed LoanManage wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanManage
build()
{
return LoanManage(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,136 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanPayBuilder;
/**
* Transaction: LoanPay
* Type: ttLOAN_PAY (84)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: mayAuthorizeMPT | mustModifyVault
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanPayBuilder to construct new transactions.
*/
class LoanPay : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_PAY;
/**
* Construct a LoanPay transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanPay(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanPay");
}
}
// Transaction-specific field getters
/**
* Get sfLoanID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanID() const
{
return this->tx_.at(sfLoanID);
}
/**
* Get sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->tx_.at(sfAmount);
}
};
/**
* Builder for LoanPay transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanPayBuilder : public TransactionBuilderBase<LoanPayBuilder>
{
public:
LoanPayBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& loanID, std::decay_t<typename SF_AMOUNT::type::value_type> const& amount, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanPayBuilder>(ttLOAN_PAY, account, sequence, fee)
{
setLoanID(loanID);
setAmount(amount);
}
LoanPayBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_PAY)
{
throw std::runtime_error("Invalid transaction type for LoanPayBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanPayBuilder&
setLoanID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanID] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* Note: This field supports MPT (Multi-Purpose Token) amounts.
* @return Reference to this builder for method chaining.
*/
LoanPayBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Build and return the completed LoanPay wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanPay
build()
{
return LoanPay(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,612 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class LoanSetBuilder;
/**
* Transaction: LoanSet
* Type: ttLOAN_SET (80)
* Delegable: Delegation::delegable
* Amendment: featureLendingProtocol
* Privileges: mayAuthorizeMPT | mustModifyVault
*
* Immutable wrapper around STTx providing type-safe field access.
* Use LoanSetBuilder to construct new transactions.
*/
class LoanSet : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttLOAN_SET;
/**
* Construct a LoanSet transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit LoanSet(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for LoanSet");
}
}
// Transaction-specific field getters
/**
* Get sfLoanBrokerID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getLoanBrokerID() const
{
return this->tx_.at(sfLoanBrokerID);
}
/**
* Get sfData (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getData() const
{
if (hasData())
{
return this->tx_.at(sfData);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasData() const
{
return this->tx_.isFieldPresent(sfData);
}
/**
* Get sfCounterparty (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getCounterparty() const
{
if (hasCounterparty())
{
return this->tx_.at(sfCounterparty);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCounterparty() const
{
return this->tx_.isFieldPresent(sfCounterparty);
}
/**
* Get sfCounterpartySignature (soeOPTIONAL)
* Note: This is an untyped field
*/
[[nodiscard]]
std::optional<STObject>
getCounterpartySignature() const
{
if (this->tx_.isFieldPresent(sfCounterpartySignature))
return this->tx_.getFieldObject(sfCounterpartySignature);
return std::nullopt;
}
[[nodiscard]]
bool
hasCounterpartySignature() const
{
return this->tx_.isFieldPresent(sfCounterpartySignature);
}
/**
* Get sfLoanOriginationFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getLoanOriginationFee() const
{
if (hasLoanOriginationFee())
{
return this->tx_.at(sfLoanOriginationFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanOriginationFee() const
{
return this->tx_.isFieldPresent(sfLoanOriginationFee);
}
/**
* Get sfLoanServiceFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getLoanServiceFee() const
{
if (hasLoanServiceFee())
{
return this->tx_.at(sfLoanServiceFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLoanServiceFee() const
{
return this->tx_.isFieldPresent(sfLoanServiceFee);
}
/**
* Get sfLatePaymentFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getLatePaymentFee() const
{
if (hasLatePaymentFee())
{
return this->tx_.at(sfLatePaymentFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLatePaymentFee() const
{
return this->tx_.isFieldPresent(sfLatePaymentFee);
}
/**
* Get sfClosePaymentFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_NUMBER::type::value_type>
getClosePaymentFee() const
{
if (hasClosePaymentFee())
{
return this->tx_.at(sfClosePaymentFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasClosePaymentFee() const
{
return this->tx_.isFieldPresent(sfClosePaymentFee);
}
/**
* Get sfOverpaymentFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getOverpaymentFee() const
{
if (hasOverpaymentFee())
{
return this->tx_.at(sfOverpaymentFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasOverpaymentFee() const
{
return this->tx_.isFieldPresent(sfOverpaymentFee);
}
/**
* Get sfInterestRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getInterestRate() const
{
if (hasInterestRate())
{
return this->tx_.at(sfInterestRate);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasInterestRate() const
{
return this->tx_.isFieldPresent(sfInterestRate);
}
/**
* Get sfLateInterestRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getLateInterestRate() const
{
if (hasLateInterestRate())
{
return this->tx_.at(sfLateInterestRate);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasLateInterestRate() const
{
return this->tx_.isFieldPresent(sfLateInterestRate);
}
/**
* Get sfCloseInterestRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getCloseInterestRate() const
{
if (hasCloseInterestRate())
{
return this->tx_.at(sfCloseInterestRate);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasCloseInterestRate() const
{
return this->tx_.isFieldPresent(sfCloseInterestRate);
}
/**
* Get sfOverpaymentInterestRate (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getOverpaymentInterestRate() const
{
if (hasOverpaymentInterestRate())
{
return this->tx_.at(sfOverpaymentInterestRate);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasOverpaymentInterestRate() const
{
return this->tx_.isFieldPresent(sfOverpaymentInterestRate);
}
/**
* Get sfPrincipalRequested (soeREQUIRED)
*/
[[nodiscard]]
SF_NUMBER::type::value_type
getPrincipalRequested() const
{
return this->tx_.at(sfPrincipalRequested);
}
/**
* Get sfPaymentTotal (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPaymentTotal() const
{
if (hasPaymentTotal())
{
return this->tx_.at(sfPaymentTotal);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasPaymentTotal() const
{
return this->tx_.isFieldPresent(sfPaymentTotal);
}
/**
* Get sfPaymentInterval (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getPaymentInterval() const
{
if (hasPaymentInterval())
{
return this->tx_.at(sfPaymentInterval);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasPaymentInterval() const
{
return this->tx_.isFieldPresent(sfPaymentInterval);
}
/**
* Get sfGracePeriod (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getGracePeriod() const
{
if (hasGracePeriod())
{
return this->tx_.at(sfGracePeriod);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasGracePeriod() const
{
return this->tx_.isFieldPresent(sfGracePeriod);
}
};
/**
* Builder for LoanSet transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class LoanSetBuilder : public TransactionBuilderBase<LoanSetBuilder>
{
public:
LoanSetBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& loanBrokerID, std::decay_t<typename SF_NUMBER::type::value_type> const& principalRequested, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<LoanSetBuilder>(ttLOAN_SET, account, sequence, fee)
{
setLoanBrokerID(loanBrokerID);
setPrincipalRequested(principalRequested);
}
LoanSetBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttLOAN_SET)
{
throw std::runtime_error("Invalid transaction type for LoanSetBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfLoanBrokerID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setLoanBrokerID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfLoanBrokerID] = value;
return *this;
}
/**
* Set sfData (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setData(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfData] = value;
return *this;
}
/**
* Set sfCounterparty (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setCounterparty(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfCounterparty] = value;
return *this;
}
/**
* Set sfCounterpartySignature (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setCounterpartySignature(STObject const& value)
{
object_.setFieldObject(sfCounterpartySignature, value);
return *this;
}
/**
* Set sfLoanOriginationFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setLoanOriginationFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfLoanOriginationFee] = value;
return *this;
}
/**
* Set sfLoanServiceFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setLoanServiceFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfLoanServiceFee] = value;
return *this;
}
/**
* Set sfLatePaymentFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setLatePaymentFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfLatePaymentFee] = value;
return *this;
}
/**
* Set sfClosePaymentFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setClosePaymentFee(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfClosePaymentFee] = value;
return *this;
}
/**
* Set sfOverpaymentFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setOverpaymentFee(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOverpaymentFee] = value;
return *this;
}
/**
* Set sfInterestRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfInterestRate] = value;
return *this;
}
/**
* Set sfLateInterestRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setLateInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfLateInterestRate] = value;
return *this;
}
/**
* Set sfCloseInterestRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setCloseInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfCloseInterestRate] = value;
return *this;
}
/**
* Set sfOverpaymentInterestRate (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setOverpaymentInterestRate(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfOverpaymentInterestRate] = value;
return *this;
}
/**
* Set sfPrincipalRequested (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setPrincipalRequested(std::decay_t<typename SF_NUMBER::type::value_type> const& value)
{
object_[sfPrincipalRequested] = value;
return *this;
}
/**
* Set sfPaymentTotal (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setPaymentTotal(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPaymentTotal] = value;
return *this;
}
/**
* Set sfPaymentInterval (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setPaymentInterval(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfPaymentInterval] = value;
return *this;
}
/**
* Set sfGracePeriod (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
LoanSetBuilder&
setGracePeriod(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfGracePeriod] = value;
return *this;
}
/**
* Build and return the completed LoanSet wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
LoanSet
build()
{
return LoanSet(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,144 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class MPTokenAuthorizeBuilder;
/**
* Transaction: MPTokenAuthorize
* Type: ttMPTOKEN_AUTHORIZE (57)
* Delegable: Delegation::delegable
* Amendment: featureMPTokensV1
* Privileges: mustAuthorizeMPT
*
* Immutable wrapper around STTx providing type-safe field access.
* Use MPTokenAuthorizeBuilder to construct new transactions.
*/
class MPTokenAuthorize : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttMPTOKEN_AUTHORIZE;
/**
* Construct a MPTokenAuthorize transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit MPTokenAuthorize(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for MPTokenAuthorize");
}
}
// Transaction-specific field getters
/**
* Get sfMPTokenIssuanceID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT192::type::value_type
getMPTokenIssuanceID() const
{
return this->tx_.at(sfMPTokenIssuanceID);
}
/**
* Get sfHolder (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getHolder() const
{
if (hasHolder())
{
return this->tx_.at(sfHolder);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasHolder() const
{
return this->tx_.isFieldPresent(sfHolder);
}
};
/**
* Builder for MPTokenAuthorize transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class MPTokenAuthorizeBuilder : public TransactionBuilderBase<MPTokenAuthorizeBuilder>
{
public:
MPTokenAuthorizeBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT192::type::value_type> const& mPTokenIssuanceID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<MPTokenAuthorizeBuilder>(ttMPTOKEN_AUTHORIZE, account, sequence, fee)
{
setMPTokenIssuanceID(mPTokenIssuanceID);
}
MPTokenAuthorizeBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttMPTOKEN_AUTHORIZE)
{
throw std::runtime_error("Invalid transaction type for MPTokenAuthorizeBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfMPTokenIssuanceID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenAuthorizeBuilder&
setMPTokenIssuanceID(std::decay_t<typename SF_UINT192::type::value_type> const& value)
{
object_[sfMPTokenIssuanceID] = value;
return *this;
}
/**
* Set sfHolder (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenAuthorizeBuilder&
setHolder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfHolder] = value;
return *this;
}
/**
* Build and return the completed MPTokenAuthorize wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
MPTokenAuthorize
build()
{
return MPTokenAuthorize(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,282 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class MPTokenIssuanceCreateBuilder;
/**
* Transaction: MPTokenIssuanceCreate
* Type: ttMPTOKEN_ISSUANCE_CREATE (54)
* Delegable: Delegation::delegable
* Amendment: featureMPTokensV1
* Privileges: createMPTIssuance
*
* Immutable wrapper around STTx providing type-safe field access.
* Use MPTokenIssuanceCreateBuilder to construct new transactions.
*/
class MPTokenIssuanceCreate : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttMPTOKEN_ISSUANCE_CREATE;
/**
* Construct a MPTokenIssuanceCreate transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit MPTokenIssuanceCreate(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for MPTokenIssuanceCreate");
}
}
// Transaction-specific field getters
/**
* Get sfAssetScale (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT8::type::value_type>
getAssetScale() const
{
if (hasAssetScale())
{
return this->tx_.at(sfAssetScale);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAssetScale() const
{
return this->tx_.isFieldPresent(sfAssetScale);
}
/**
* Get sfTransferFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getTransferFee() const
{
if (hasTransferFee())
{
return this->tx_.at(sfTransferFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasTransferFee() const
{
return this->tx_.isFieldPresent(sfTransferFee);
}
/**
* Get sfMaximumAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT64::type::value_type>
getMaximumAmount() const
{
if (hasMaximumAmount())
{
return this->tx_.at(sfMaximumAmount);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasMaximumAmount() const
{
return this->tx_.isFieldPresent(sfMaximumAmount);
}
/**
* Get sfMPTokenMetadata (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getMPTokenMetadata() const
{
if (hasMPTokenMetadata())
{
return this->tx_.at(sfMPTokenMetadata);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasMPTokenMetadata() const
{
return this->tx_.isFieldPresent(sfMPTokenMetadata);
}
/**
* Get sfDomainID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getDomainID() const
{
if (hasDomainID())
{
return this->tx_.at(sfDomainID);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDomainID() const
{
return this->tx_.isFieldPresent(sfDomainID);
}
/**
* Get sfMutableFlags (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getMutableFlags() const
{
if (hasMutableFlags())
{
return this->tx_.at(sfMutableFlags);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasMutableFlags() const
{
return this->tx_.isFieldPresent(sfMutableFlags);
}
};
/**
* Builder for MPTokenIssuanceCreate transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class MPTokenIssuanceCreateBuilder : public TransactionBuilderBase<MPTokenIssuanceCreateBuilder>
{
public:
MPTokenIssuanceCreateBuilder(SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<MPTokenIssuanceCreateBuilder>(ttMPTOKEN_ISSUANCE_CREATE, account, sequence, fee)
{
}
MPTokenIssuanceCreateBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttMPTOKEN_ISSUANCE_CREATE)
{
throw std::runtime_error("Invalid transaction type for MPTokenIssuanceCreateBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfAssetScale (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceCreateBuilder&
setAssetScale(std::decay_t<typename SF_UINT8::type::value_type> const& value)
{
object_[sfAssetScale] = value;
return *this;
}
/**
* Set sfTransferFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceCreateBuilder&
setTransferFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTransferFee] = value;
return *this;
}
/**
* Set sfMaximumAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceCreateBuilder&
setMaximumAmount(std::decay_t<typename SF_UINT64::type::value_type> const& value)
{
object_[sfMaximumAmount] = value;
return *this;
}
/**
* Set sfMPTokenMetadata (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceCreateBuilder&
setMPTokenMetadata(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfMPTokenMetadata] = value;
return *this;
}
/**
* Set sfDomainID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceCreateBuilder&
setDomainID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfDomainID] = value;
return *this;
}
/**
* Set sfMutableFlags (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceCreateBuilder&
setMutableFlags(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfMutableFlags] = value;
return *this;
}
/**
* Build and return the completed MPTokenIssuanceCreate wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
MPTokenIssuanceCreate
build()
{
return MPTokenIssuanceCreate(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,112 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class MPTokenIssuanceDestroyBuilder;
/**
* Transaction: MPTokenIssuanceDestroy
* Type: ttMPTOKEN_ISSUANCE_DESTROY (55)
* Delegable: Delegation::delegable
* Amendment: featureMPTokensV1
* Privileges: destroyMPTIssuance
*
* Immutable wrapper around STTx providing type-safe field access.
* Use MPTokenIssuanceDestroyBuilder to construct new transactions.
*/
class MPTokenIssuanceDestroy : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttMPTOKEN_ISSUANCE_DESTROY;
/**
* Construct a MPTokenIssuanceDestroy transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit MPTokenIssuanceDestroy(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for MPTokenIssuanceDestroy");
}
}
// Transaction-specific field getters
/**
* Get sfMPTokenIssuanceID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT192::type::value_type
getMPTokenIssuanceID() const
{
return this->tx_.at(sfMPTokenIssuanceID);
}
};
/**
* Builder for MPTokenIssuanceDestroy transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class MPTokenIssuanceDestroyBuilder : public TransactionBuilderBase<MPTokenIssuanceDestroyBuilder>
{
public:
MPTokenIssuanceDestroyBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT192::type::value_type> const& mPTokenIssuanceID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<MPTokenIssuanceDestroyBuilder>(ttMPTOKEN_ISSUANCE_DESTROY, account, sequence, fee)
{
setMPTokenIssuanceID(mPTokenIssuanceID);
}
MPTokenIssuanceDestroyBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttMPTOKEN_ISSUANCE_DESTROY)
{
throw std::runtime_error("Invalid transaction type for MPTokenIssuanceDestroyBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfMPTokenIssuanceID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceDestroyBuilder&
setMPTokenIssuanceID(std::decay_t<typename SF_UINT192::type::value_type> const& value)
{
object_[sfMPTokenIssuanceID] = value;
return *this;
}
/**
* Build and return the completed MPTokenIssuanceDestroy wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
MPTokenIssuanceDestroy
build()
{
return MPTokenIssuanceDestroy(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,272 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class MPTokenIssuanceSetBuilder;
/**
* Transaction: MPTokenIssuanceSet
* Type: ttMPTOKEN_ISSUANCE_SET (56)
* Delegable: Delegation::delegable
* Amendment: featureMPTokensV1
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use MPTokenIssuanceSetBuilder to construct new transactions.
*/
class MPTokenIssuanceSet : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttMPTOKEN_ISSUANCE_SET;
/**
* Construct a MPTokenIssuanceSet transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit MPTokenIssuanceSet(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for MPTokenIssuanceSet");
}
}
// Transaction-specific field getters
/**
* Get sfMPTokenIssuanceID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT192::type::value_type
getMPTokenIssuanceID() const
{
return this->tx_.at(sfMPTokenIssuanceID);
}
/**
* Get sfHolder (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getHolder() const
{
if (hasHolder())
{
return this->tx_.at(sfHolder);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasHolder() const
{
return this->tx_.isFieldPresent(sfHolder);
}
/**
* Get sfDomainID (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getDomainID() const
{
if (hasDomainID())
{
return this->tx_.at(sfDomainID);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDomainID() const
{
return this->tx_.isFieldPresent(sfDomainID);
}
/**
* Get sfMPTokenMetadata (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getMPTokenMetadata() const
{
if (hasMPTokenMetadata())
{
return this->tx_.at(sfMPTokenMetadata);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasMPTokenMetadata() const
{
return this->tx_.isFieldPresent(sfMPTokenMetadata);
}
/**
* Get sfTransferFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getTransferFee() const
{
if (hasTransferFee())
{
return this->tx_.at(sfTransferFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasTransferFee() const
{
return this->tx_.isFieldPresent(sfTransferFee);
}
/**
* Get sfMutableFlags (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getMutableFlags() const
{
if (hasMutableFlags())
{
return this->tx_.at(sfMutableFlags);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasMutableFlags() const
{
return this->tx_.isFieldPresent(sfMutableFlags);
}
};
/**
* Builder for MPTokenIssuanceSet transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class MPTokenIssuanceSetBuilder : public TransactionBuilderBase<MPTokenIssuanceSetBuilder>
{
public:
MPTokenIssuanceSetBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT192::type::value_type> const& mPTokenIssuanceID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<MPTokenIssuanceSetBuilder>(ttMPTOKEN_ISSUANCE_SET, account, sequence, fee)
{
setMPTokenIssuanceID(mPTokenIssuanceID);
}
MPTokenIssuanceSetBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttMPTOKEN_ISSUANCE_SET)
{
throw std::runtime_error("Invalid transaction type for MPTokenIssuanceSetBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfMPTokenIssuanceID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceSetBuilder&
setMPTokenIssuanceID(std::decay_t<typename SF_UINT192::type::value_type> const& value)
{
object_[sfMPTokenIssuanceID] = value;
return *this;
}
/**
* Set sfHolder (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceSetBuilder&
setHolder(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfHolder] = value;
return *this;
}
/**
* Set sfDomainID (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceSetBuilder&
setDomainID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfDomainID] = value;
return *this;
}
/**
* Set sfMPTokenMetadata (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceSetBuilder&
setMPTokenMetadata(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfMPTokenMetadata] = value;
return *this;
}
/**
* Set sfTransferFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceSetBuilder&
setTransferFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTransferFee] = value;
return *this;
}
/**
* Set sfMutableFlags (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
MPTokenIssuanceSetBuilder&
setMutableFlags(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfMutableFlags] = value;
return *this;
}
/**
* Build and return the completed MPTokenIssuanceSet wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
MPTokenIssuanceSet
build()
{
return MPTokenIssuanceSet(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,186 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class NFTokenAcceptOfferBuilder;
/**
* Transaction: NFTokenAcceptOffer
* Type: ttNFTOKEN_ACCEPT_OFFER (29)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use NFTokenAcceptOfferBuilder to construct new transactions.
*/
class NFTokenAcceptOffer : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttNFTOKEN_ACCEPT_OFFER;
/**
* Construct a NFTokenAcceptOffer transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit NFTokenAcceptOffer(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for NFTokenAcceptOffer");
}
}
// Transaction-specific field getters
/**
* Get sfNFTokenBuyOffer (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getNFTokenBuyOffer() const
{
if (hasNFTokenBuyOffer())
{
return this->tx_.at(sfNFTokenBuyOffer);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasNFTokenBuyOffer() const
{
return this->tx_.isFieldPresent(sfNFTokenBuyOffer);
}
/**
* Get sfNFTokenSellOffer (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT256::type::value_type>
getNFTokenSellOffer() const
{
if (hasNFTokenSellOffer())
{
return this->tx_.at(sfNFTokenSellOffer);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasNFTokenSellOffer() const
{
return this->tx_.isFieldPresent(sfNFTokenSellOffer);
}
/**
* Get sfNFTokenBrokerFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getNFTokenBrokerFee() const
{
if (hasNFTokenBrokerFee())
{
return this->tx_.at(sfNFTokenBrokerFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasNFTokenBrokerFee() const
{
return this->tx_.isFieldPresent(sfNFTokenBrokerFee);
}
};
/**
* Builder for NFTokenAcceptOffer transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class NFTokenAcceptOfferBuilder : public TransactionBuilderBase<NFTokenAcceptOfferBuilder>
{
public:
NFTokenAcceptOfferBuilder(SF_ACCOUNT::type::value_type account,
std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<NFTokenAcceptOfferBuilder>(ttNFTOKEN_ACCEPT_OFFER, account, sequence, fee)
{
}
NFTokenAcceptOfferBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttNFTOKEN_ACCEPT_OFFER)
{
throw std::runtime_error("Invalid transaction type for NFTokenAcceptOfferBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfNFTokenBuyOffer (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenAcceptOfferBuilder&
setNFTokenBuyOffer(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfNFTokenBuyOffer] = value;
return *this;
}
/**
* Set sfNFTokenSellOffer (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenAcceptOfferBuilder&
setNFTokenSellOffer(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfNFTokenSellOffer] = value;
return *this;
}
/**
* Set sfNFTokenBrokerFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenAcceptOfferBuilder&
setNFTokenBrokerFee(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfNFTokenBrokerFee] = value;
return *this;
}
/**
* Build and return the completed NFTokenAcceptOffer wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
NFTokenAcceptOffer
build()
{
return NFTokenAcceptOffer(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,144 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class NFTokenBurnBuilder;
/**
* Transaction: NFTokenBurn
* Type: ttNFTOKEN_BURN (26)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: changeNFTCounts
*
* Immutable wrapper around STTx providing type-safe field access.
* Use NFTokenBurnBuilder to construct new transactions.
*/
class NFTokenBurn : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttNFTOKEN_BURN;
/**
* Construct a NFTokenBurn transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit NFTokenBurn(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for NFTokenBurn");
}
}
// Transaction-specific field getters
/**
* Get sfNFTokenID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getNFTokenID() const
{
return this->tx_.at(sfNFTokenID);
}
/**
* Get sfOwner (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getOwner() const
{
if (hasOwner())
{
return this->tx_.at(sfOwner);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasOwner() const
{
return this->tx_.isFieldPresent(sfOwner);
}
};
/**
* Builder for NFTokenBurn transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class NFTokenBurnBuilder : public TransactionBuilderBase<NFTokenBurnBuilder>
{
public:
NFTokenBurnBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& nFTokenID, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<NFTokenBurnBuilder>(ttNFTOKEN_BURN, account, sequence, fee)
{
setNFTokenID(nFTokenID);
}
NFTokenBurnBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttNFTOKEN_BURN)
{
throw std::runtime_error("Invalid transaction type for NFTokenBurnBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfNFTokenID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenBurnBuilder&
setNFTokenID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfNFTokenID] = value;
return *this;
}
/**
* Set sfOwner (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenBurnBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Build and return the completed NFTokenBurn wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
NFTokenBurn
build()
{
return NFTokenBurn(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,112 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class NFTokenCancelOfferBuilder;
/**
* Transaction: NFTokenCancelOffer
* Type: ttNFTOKEN_CANCEL_OFFER (28)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use NFTokenCancelOfferBuilder to construct new transactions.
*/
class NFTokenCancelOffer : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttNFTOKEN_CANCEL_OFFER;
/**
* Construct a NFTokenCancelOffer transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit NFTokenCancelOffer(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for NFTokenCancelOffer");
}
}
// Transaction-specific field getters
/**
* Get sfNFTokenOffers (soeREQUIRED)
*/
[[nodiscard]]
SF_VECTOR256::type::value_type
getNFTokenOffers() const
{
return this->tx_.at(sfNFTokenOffers);
}
};
/**
* Builder for NFTokenCancelOffer transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class NFTokenCancelOfferBuilder : public TransactionBuilderBase<NFTokenCancelOfferBuilder>
{
public:
NFTokenCancelOfferBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_VECTOR256::type::value_type> const& nFTokenOffers, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<NFTokenCancelOfferBuilder>(ttNFTOKEN_CANCEL_OFFER, account, sequence, fee)
{
setNFTokenOffers(nFTokenOffers);
}
NFTokenCancelOfferBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttNFTOKEN_CANCEL_OFFER)
{
throw std::runtime_error("Invalid transaction type for NFTokenCancelOfferBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfNFTokenOffers (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenCancelOfferBuilder&
setNFTokenOffers(std::decay_t<typename SF_VECTOR256::type::value_type> const& value)
{
object_[sfNFTokenOffers] = value;
return *this;
}
/**
* Build and return the completed NFTokenCancelOffer wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
NFTokenCancelOffer
build()
{
return NFTokenCancelOffer(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,230 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class NFTokenCreateOfferBuilder;
/**
* Transaction: NFTokenCreateOffer
* Type: ttNFTOKEN_CREATE_OFFER (27)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: noPriv
*
* Immutable wrapper around STTx providing type-safe field access.
* Use NFTokenCreateOfferBuilder to construct new transactions.
*/
class NFTokenCreateOffer : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttNFTOKEN_CREATE_OFFER;
/**
* Construct a NFTokenCreateOffer transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit NFTokenCreateOffer(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for NFTokenCreateOffer");
}
}
// Transaction-specific field getters
/**
* Get sfNFTokenID (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT256::type::value_type
getNFTokenID() const
{
return this->tx_.at(sfNFTokenID);
}
/**
* Get sfAmount (soeREQUIRED)
*/
[[nodiscard]]
SF_AMOUNT::type::value_type
getAmount() const
{
return this->tx_.at(sfAmount);
}
/**
* Get sfDestination (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getDestination() const
{
if (hasDestination())
{
return this->tx_.at(sfDestination);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDestination() const
{
return this->tx_.isFieldPresent(sfDestination);
}
/**
* Get sfOwner (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getOwner() const
{
if (hasOwner())
{
return this->tx_.at(sfOwner);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasOwner() const
{
return this->tx_.isFieldPresent(sfOwner);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
{
return this->tx_.at(sfExpiration);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->tx_.isFieldPresent(sfExpiration);
}
};
/**
* Builder for NFTokenCreateOffer transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class NFTokenCreateOfferBuilder : public TransactionBuilderBase<NFTokenCreateOfferBuilder>
{
public:
NFTokenCreateOfferBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT256::type::value_type> const& nFTokenID, std::decay_t<typename SF_AMOUNT::type::value_type> const& amount, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<NFTokenCreateOfferBuilder>(ttNFTOKEN_CREATE_OFFER, account, sequence, fee)
{
setNFTokenID(nFTokenID);
setAmount(amount);
}
NFTokenCreateOfferBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttNFTOKEN_CREATE_OFFER)
{
throw std::runtime_error("Invalid transaction type for NFTokenCreateOfferBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfNFTokenID (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenCreateOfferBuilder&
setNFTokenID(std::decay_t<typename SF_UINT256::type::value_type> const& value)
{
object_[sfNFTokenID] = value;
return *this;
}
/**
* Set sfAmount (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenCreateOfferBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfDestination (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenCreateOfferBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfOwner (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenCreateOfferBuilder&
setOwner(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfOwner] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenCreateOfferBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Build and return the completed NFTokenCreateOffer wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
NFTokenCreateOffer
build()
{
return NFTokenCreateOffer(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

View File

@@ -1,304 +0,0 @@
#pragma once
#include <xrpl/protocol/STTx.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/protocol_autogen/TransactionBase.h>
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
#include <xrpl/json/json_value.h>
#include <stdexcept>
#include <optional>
namespace xrpl::transactions {
// Forward declaration
class NFTokenMintBuilder;
/**
* Transaction: NFTokenMint
* Type: ttNFTOKEN_MINT (25)
* Delegable: Delegation::delegable
* Amendment: uint256{}
* Privileges: changeNFTCounts
*
* Immutable wrapper around STTx providing type-safe field access.
* Use NFTokenMintBuilder to construct new transactions.
*/
class NFTokenMint : public TransactionBase
{
public:
static constexpr xrpl::TxType txType = ttNFTOKEN_MINT;
/**
* Construct a NFTokenMint transaction wrapper from an existing STTx object.
* @throws std::runtime_error if the transaction type doesn't match.
*/
explicit NFTokenMint(STTx const& tx)
: TransactionBase(tx)
{
// Verify transaction type
if (tx.getTxnType() != txType)
{
throw std::runtime_error("Invalid transaction type for NFTokenMint");
}
}
// Transaction-specific field getters
/**
* Get sfNFTokenTaxon (soeREQUIRED)
*/
[[nodiscard]]
SF_UINT32::type::value_type
getNFTokenTaxon() const
{
return this->tx_.at(sfNFTokenTaxon);
}
/**
* Get sfTransferFee (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT16::type::value_type>
getTransferFee() const
{
if (hasTransferFee())
{
return this->tx_.at(sfTransferFee);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasTransferFee() const
{
return this->tx_.isFieldPresent(sfTransferFee);
}
/**
* Get sfIssuer (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getIssuer() const
{
if (hasIssuer())
{
return this->tx_.at(sfIssuer);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasIssuer() const
{
return this->tx_.isFieldPresent(sfIssuer);
}
/**
* Get sfURI (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_VL::type::value_type>
getURI() const
{
if (hasURI())
{
return this->tx_.at(sfURI);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasURI() const
{
return this->tx_.isFieldPresent(sfURI);
}
/**
* Get sfAmount (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_AMOUNT::type::value_type>
getAmount() const
{
if (hasAmount())
{
return this->tx_.at(sfAmount);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasAmount() const
{
return this->tx_.isFieldPresent(sfAmount);
}
/**
* Get sfDestination (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_ACCOUNT::type::value_type>
getDestination() const
{
if (hasDestination())
{
return this->tx_.at(sfDestination);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasDestination() const
{
return this->tx_.isFieldPresent(sfDestination);
}
/**
* Get sfExpiration (soeOPTIONAL)
*/
[[nodiscard]]
protocol_autogen::Optional<SF_UINT32::type::value_type>
getExpiration() const
{
if (hasExpiration())
{
return this->tx_.at(sfExpiration);
}
return std::nullopt;
}
[[nodiscard]]
bool
hasExpiration() const
{
return this->tx_.isFieldPresent(sfExpiration);
}
};
/**
* Builder for NFTokenMint transactions.
* Provides a fluent interface for constructing transactions with method chaining.
* Uses Json::Value internally for flexible transaction construction.
* Inherits common field setters from TransactionBuilderBase.
*/
class NFTokenMintBuilder : public TransactionBuilderBase<NFTokenMintBuilder>
{
public:
NFTokenMintBuilder(SF_ACCOUNT::type::value_type account,
std::decay_t<typename SF_UINT32::type::value_type> const& nFTokenTaxon, std::optional<SF_UINT32::type::value_type> sequence = std::nullopt,
std::optional<SF_AMOUNT::type::value_type> fee = std::nullopt
)
: TransactionBuilderBase<NFTokenMintBuilder>(ttNFTOKEN_MINT, account, sequence, fee)
{
setNFTokenTaxon(nFTokenTaxon);
}
NFTokenMintBuilder(STTx const& tx)
{
if (tx.getTxnType() != ttNFTOKEN_MINT)
{
throw std::runtime_error("Invalid transaction type for NFTokenMintBuilder");
}
object_ = tx;
}
// Transaction-specific field setters
/**
* Set sfNFTokenTaxon (soeREQUIRED)
* @return Reference to this builder for method chaining.
*/
NFTokenMintBuilder&
setNFTokenTaxon(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfNFTokenTaxon] = value;
return *this;
}
/**
* Set sfTransferFee (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenMintBuilder&
setTransferFee(std::decay_t<typename SF_UINT16::type::value_type> const& value)
{
object_[sfTransferFee] = value;
return *this;
}
/**
* Set sfIssuer (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenMintBuilder&
setIssuer(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfIssuer] = value;
return *this;
}
/**
* Set sfURI (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenMintBuilder&
setURI(std::decay_t<typename SF_VL::type::value_type> const& value)
{
object_[sfURI] = value;
return *this;
}
/**
* Set sfAmount (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenMintBuilder&
setAmount(std::decay_t<typename SF_AMOUNT::type::value_type> const& value)
{
object_[sfAmount] = value;
return *this;
}
/**
* Set sfDestination (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenMintBuilder&
setDestination(std::decay_t<typename SF_ACCOUNT::type::value_type> const& value)
{
object_[sfDestination] = value;
return *this;
}
/**
* Set sfExpiration (soeOPTIONAL)
* @return Reference to this builder for method chaining.
*/
NFTokenMintBuilder&
setExpiration(std::decay_t<typename SF_UINT32::type::value_type> const& value)
{
object_[sfExpiration] = value;
return *this;
}
/**
* Build and return the completed NFTokenMint wrapper.
* @return The constructed transaction wrapper.
* @throws std::runtime_error if the JSON cannot be parsed into a valid transaction.
*/
NFTokenMint
build()
{
return NFTokenMint(STTx(std::move(object_)));
}
};
} // namespace xrpl::transactions

Some files were not shown because too many files have changed in this diff Show More