Skip to content

Commit 54a0b97

Browse files
committed
Documentation
1 parent 172bcd4 commit 54a0b97

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

src/entities/Address.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Entity } from '../interfaces/Entity'
33
import { EntityBase } from './EntityBase'
44

5+
// a ethereum address
56
export class Address extends EntityBase implements Entity {
67
public errorMessage:string = 'invalid'
78
private address

src/entities/Apikey.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Entity } from '../interfaces/Entity'
33
import { EntityBase } from './EntityBase'
44

5+
// api key for etherscan.io
56
export class ApiKey extends EntityBase implements Entity {
67
public errorMessage:string = 'invalid'
78
private apiKey

src/entities/EntityBase.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
2+
// base class for entities
13
export abstract class EntityBase {
4+
// basic error message for exceptions on validations
25
public errorMessage: string
6+
// checks valid() and throws errorMessage
37
validate(): void {
48
if (!this.valid()) {
59
throw new Error(this.errorMessage)

src/entities/PositiveNumber.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11

22
import { Entity } from '../interfaces/Entity'
33
import { EntityBase } from './EntityBase'
4-
/*
5-
* @see https://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hexadecimal-in-javascript
6-
*/
4+
5+
// a positive number
76
export class PositiveNumber extends EntityBase implements Entity {
87
public errorMessage:string = 'invalid'
98
private positiveNumber:any

src/entities/Sort.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Entity } from '../interfaces/Entity'
33
import { EntityBase } from './EntityBase'
44
import { sort } from '../parameters/sort'
55

6+
// Sort Parameter asc or desc
67
export class Sort extends EntityBase implements Entity {
78
public errorMessage:string = 'invalid'
89
private sortParam:string

0 commit comments

Comments
 (0)