]> git.codecow.com Git - libnemo.git/commitdiff
Move RPC response schema into dedicated directory.
authorChris Duncan <chris@codecow.com>
Mon, 3 Aug 2026 17:21:39 +0000 (10:21 -0700)
committerChris Duncan <chris@codecow.com>
Mon, 3 Aug 2026 17:21:39 +0000 (10:21 -0700)
src/lib/constants.ts
src/lib/rpc/schema.ts [new file with mode: 0644]

index 3729d89b0e1ceb50822f98b6df24fa24fc83daf8..366ce6ba89e92169fe04729e31fd886fae9e759a 100644 (file)
@@ -35,46 +35,3 @@ export const UNITS = Object.freeze({
        KNANO: 33,
        MNANO: 36,
 })
-
-export const SCHEMA = Object.freeze({
-       account_info: {
-               fields: [
-                       'frontier',
-                       'open_block',
-                       'representative_block',
-                       'balance',
-                       'modified_timestamp',
-                       'block_count',
-                       'account_version',
-                       'confirmation_height',
-                       'confirmation_height_frontier',
-                       'representative',
-                       'weight',
-                       'receivable',
-                       'confirmed_balance',
-                       'confirmed_height',
-                       'confirmed_frontier',
-                       'confirmed_representative',
-                       'confirmed_receivable'
-               ],
-       },
-       block_info: {
-               contents: {
-                       fields: [
-                               'type',
-                               'account',
-                               'previous',
-                               'representative',
-                               'balance',
-                               'link',
-                               'link_as_account',
-                               'signature',
-                               'work'
-                       ],
-               },
-               fields: [
-                       'contents',
-                       'subtype',
-               ],
-       },
-})
diff --git a/src/lib/rpc/schema.ts b/src/lib/rpc/schema.ts
new file mode 100644 (file)
index 0000000..9fecf59
--- /dev/null
@@ -0,0 +1,45 @@
+//! SPDX-FileCopyrightText: 2026 Chris Duncan <chris@codecow.com>
+//! SPDX-License-Identifier: GPL-3.0-or-later
+
+export const SCHEMA = Object.freeze({
+       account_info: {
+               fields: [
+                       'frontier',
+                       'open_block',
+                       'representative_block',
+                       'balance',
+                       'modified_timestamp',
+                       'block_count',
+                       'account_version',
+                       'confirmation_height',
+                       'confirmation_height_frontier',
+                       'representative',
+                       'weight',
+                       'receivable',
+                       'confirmed_balance',
+                       'confirmed_height',
+                       'confirmed_frontier',
+                       'confirmed_representative',
+                       'confirmed_receivable'
+               ],
+       },
+       block_info: {
+               contents: {
+                       fields: [
+                               'type',
+                               'account',
+                               'previous',
+                               'representative',
+                               'balance',
+                               'link',
+                               'link_as_account',
+                               'signature',
+                               'work'
+                       ],
+               },
+               fields: [
+                       'contents',
+                       'subtype',
+               ],
+       },
+})