-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { BlockId, HexUInt, Units, VTHO } from '@vechain/sdk-core'; | ||
import { UInt } from '../../../../core'; | ||
|
||
class SubscriptionBeat2Response { | ||
gasLimit: VTHO; | ||
obsolete: boolean; | ||
number: UInt; | ||
id: BlockId; | ||
parentID: BlockId; | ||
timestamp: UInt; | ||
txsFeatures: UInt; | ||
bloom: HexUInt; | ||
k: UInt; | ||
|
||
constructor(json: SubscriptionBeat2ResponseJSON) { | ||
this.gasLimit = VTHO.of(json.gasLimit, Units.wei); | ||
this.obsolete = json.obsolete; | ||
this.number = UInt.of(json.number); | ||
Check failure on line 18 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts GitHub Actions / install-build / Build & Lint
Check failure on line 18 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts GitHub Actions / install-build / Build & Lint
|
||
this.id = BlockId.of(json.id); | ||
this.parentID = BlockId.of(json.parentID); | ||
this.timestamp = UInt.of(json.timestamp); | ||
Check failure on line 21 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts GitHub Actions / install-build / Build & Lint
Check failure on line 21 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts GitHub Actions / install-build / Build & Lint
|
||
this.txsFeatures = UInt.of(json.txsFeatures); | ||
Check failure on line 22 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts GitHub Actions / install-build / Build & Lint
Check failure on line 22 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts GitHub Actions / install-build / Build & Lint
|
||
this.bloom = HexUInt.of(json.bloom); | ||
this.k = UInt.of(json.k); | ||
} | ||
} | ||
|
||
interface SubscriptionBeat2ResponseJSON { | ||
gasLimit: number; | ||
obsolete: boolean; | ||
number: number; | ||
id: string; | ||
parentID: string; | ||
timestamp: number; | ||
txsFeatures: number; | ||
bloom: string; | ||
k: number; | ||
} | ||
|
||
export { SubscriptionBeat2Response, type SubscriptionBeat2ResponseJSON }; |