From: Chris Duncan Date: Mon, 3 Aug 2026 17:21:39 +0000 (-0700) Subject: Move RPC response schema into dedicated directory. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=3e740de986dc9dcf89271001095a4d0fe7560651;p=libnemo.git Move RPC response schema into dedicated directory. --- diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 3729d89..366ce6b 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -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 index 0000000..9fecf59 --- /dev/null +++ b/src/lib/rpc/schema.ts @@ -0,0 +1,45 @@ +//! SPDX-FileCopyrightText: 2026 Chris Duncan +//! 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', + ], + }, +})