Skip to content

Commit

Permalink
Add BlocksInfoResponseContents
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-ptera committed May 21, 2021
1 parent edb77fc commit 2d46d9c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v1.1.1

### Added

- Added `BlocksInfoResponseContents` type to help differentiate between `blocks_info` return type.

## v1.1.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dev-ptera/nano-node-rpc",
"version": "1.1.0",
"version": "1.1.1",
"description": "A typescript nanocurrency client used to make node RPC calls.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
25 changes: 12 additions & 13 deletions src/types/rpc-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ export type BlocksResponse = {
};
};
};
export type BlocksInfoResponseContents = {
type: string;
account: string;
previous: string;
representative: string;
balance: string;
link: string;
link_as_account: string;
signature: string;
work: string;
}
export type BlocksInfoResponse = {
blocks: {
[hash: string]: {
Expand All @@ -133,19 +144,7 @@ export type BlocksInfoResponse = {
height: number;
local_timestamp: number;
confirmed: boolean;
contents:
| string
| {
type: string;
account: string;
previous: string;
representative: string;
balance: string;
link: string;
link_as_account: string;
signature: string;
work: string;
};
contents: string | BlocksInfoResponseContents
subtype: Subtype;
pending?: string;
source_account?: string;
Expand Down

0 comments on commit 2d46d9c

Please sign in to comment.