Skip to content

Commit 9c69b7c

Browse files
authored
v1.1.0-alpha.2
2 parents 5a282f2 + ec91924 commit 9c69b7c

File tree

9 files changed

+26
-19
lines changed

9 files changed

+26
-19
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.1.0-alpha.2](https://github.com/thenewboston-developers/thenewboston-js/compare/v1.1.0-alpha.1...v1.1.0-alpha.2) (2021-04-10)
6+
7+
8+
### Bug Fixes
9+
10+
* Replaced startCrawl and stopCrawl return types ([#136](https://github.com/thenewboston-developers/thenewboston-js/issues/136)) ([9f05092](https://github.com/thenewboston-developers/thenewboston-js/commit/9f05092d97e172eef5e1736a266795cfdc721632))
11+
512
## [1.1.0-alpha.1](https://github.com/thenewboston-developers/thenewboston-js/compare/v1.1.0-alpha.0...v1.1.0-alpha.1) (2021-04-09)
613

714
### Features

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thenewboston",
3-
"version": "1.1.0-alpha.1",
3+
"version": "1.1.0-alpha.2",
44
"description": "JavaScript library for thenewboston.",
55
"author": {
66
"name": "thenewboston-developers",

src/bank.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import type {
1212
PaginatedBlockEntry,
1313
PaginatedValidatorEntry,
1414
CleanResponse,
15+
CrawlResponse,
1516
CleanData,
1617
CrawlData,
1718
} from "./models";
1819
import type { Account } from "./account";
19-
import { CrawlResponse } from "./models/responses/generic/crawl";
2020

2121
/** Used for creating banks and sending requests easily to that specific bank server node. */
2222
export class Bank extends ServerNode {
@@ -119,7 +119,7 @@ export class Bank extends ServerNode {
119119
* @param account An Account created with the Network Id Signing key of the current Bank
120120
*/
121121
async startCrawl(account: Account) {
122-
return await super.postData<CleanResponse>(
122+
return await super.postData<CrawlResponse>(
123123
"/crawl",
124124
account.createSignedMessage<CrawlData>({ crawl: "start" })
125125
);
@@ -130,7 +130,7 @@ export class Bank extends ServerNode {
130130
* @param account An Account created with the Network Id Signing key of the current Bank
131131
*/
132132
async stopCrawl(account: Account) {
133-
return await super.postData<CleanResponse>(
133+
return await super.postData<CrawlResponse>(
134134
"/crawl",
135135
account.createSignedMessage<CrawlData>({ crawl: "stop" })
136136
);

src/confirmation-validator.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Validator } from "./validator";
22
import type { Account } from "./account";
3-
import type { ConfirmationValidatorConfigResponse, CrawlData, CrawlCommand, CleanResponse, CleanData } from "./models";
3+
import type { ConfirmationValidatorConfigResponse, CleanResponse, CrawlResponse, CleanData, CrawlData } from "./models";
44

55
/** Used for connecting with and using confirmation validator server nodes. */
66
export class ConfirmationValidator extends Validator {
@@ -11,17 +11,17 @@ export class ConfirmationValidator extends Validator {
1111

1212
/** Gets the current crawl status */
1313
async getCrawlStatus() {
14-
return await super.getData("/crawl");
14+
return await super.getData<CrawlResponse>("/crawl");
1515
}
1616

1717
/**
1818
* Sends a Post Request to the confirmation validator to start crawl process
1919
* @param account An Account created with the Network Id Signing key of the current Confirmation Validator
2020
*/
2121
async startCrawl(account: Account) {
22-
return await super.postData<CleanResponse>(
22+
return await super.postData<CrawlResponse>(
2323
"/crawl",
24-
account.createSignedMessage<CleanData>({ clean: "start" })
24+
account.createSignedMessage<CrawlData>({ crawl: "start" })
2525
);
2626
}
2727

@@ -30,9 +30,9 @@ export class ConfirmationValidator extends Validator {
3030
* @param account An Account created with the Network Id Signing key of the current Confirmation Validator
3131
*/
3232
async stopCrawl(account: Account) {
33-
return await super.postData<CleanResponse>(
33+
return await super.postData<CrawlResponse>(
3434
"/crawl",
35-
account.createSignedMessage<CleanData>({ clean: "stop" })
35+
account.createSignedMessage<CrawlData>({ crawl: "stop" })
3636
);
3737
}
3838

@@ -72,7 +72,7 @@ export class ConfirmationValidator extends Validator {
7272
* @param protocol the protocol of the primary validator
7373
* @param account the account that the current `ConfirmationValidator` is connected to
7474
*/
75-
async sendPrimaryValidatorUpdatedPing(ipAddress: string, port: string, protocol: string, account: Account) {
75+
async sendPrimaryValidatorUpdatedPing(ipAddress: string, port: number, protocol: string, account: Account) {
7676
return await super.postData(
7777
"/primary_validator_updated",
7878
account.createSignedMessage({ ip_address: ipAddress, port, protocol })
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export type { AccountBalanceLockResponse } from "./account-balance-lock";
22
export type { AccountBalanceResponse } from "./account-balance";
33
export type { CleanResponse } from "./clean";
4+
export type { CrawlResponse } from "./crawl";

src/models/responses/pagination/entries/bank.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { Protocol, Version } from "../../constants";
1+
import type { Port, Protocol, Version } from "../../constants";
22

33
export interface PaginatedBankEntry {
44
account_number: string;
55
ip_address: string;
66
node_identifier: string;
7-
port: number | null;
7+
port: Port | null;
88
protocol: Protocol;
99
version: Version;
1010
default_transaction_fee: number;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import type { Protocol, Version } from "../../constants";
1+
import type { Port, Protocol, Version } from "../../constants";
22

33
export interface PaginatedValidatorEntry {
44
account_number: string;
55
ip_address: string;
66
node_identifier: string;
7-
port: string | null;
7+
port: Port | null;
88
protocol: Protocol;
99
version: Version;
1010
default_transaction_fee: number;
1111
root_account_file: string;
1212
root_account_file_hash: string;
1313
seed_block_identifier: string;
14-
daily_confirmation_rate: number | null;
14+
daily_confirmation_rate: Port | null;
1515
trust: string;
1616
}

src/server-node.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import type {
1010
import type { Account } from "./account";
1111
import type { Protocol } from "./models/responses/constants";
1212
import { throwError } from "./utils";
13-
import { CrawlResponse } from "./models/responses/generic/crawl";
1413

1514
/**
1615
* Used internally for all server nodes.
@@ -95,7 +94,7 @@ export abstract class ServerNode {
9594
* @param protocol the new node's protocol
9695
* @param account the server account to validate the request
9796
*/
98-
async sendConnectionRequest(ipAddress: string, port: string, protocol: Protocol, account: Account) {
97+
async sendConnectionRequest(ipAddress: string, port: number, protocol: Protocol, account: Account) {
9998
return await this.postData(
10099
"/connection_requests",
101100
account.createSignedMessage({

0 commit comments

Comments
 (0)