Skip to content

Commit

Permalink
feat: 1484 subscriptions in dev...
Browse files Browse the repository at this point in the history
  • Loading branch information
lucanicoladebiasi committed Dec 24, 2024
1 parent 7342e45 commit 88faf21
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Empty file.
40 changes: 40 additions & 0 deletions packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts
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

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe assignment of an error typed value

Check failure on line 18 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe call of an `error` type typed value

Check failure on line 18 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe member access .of on an `error` typed value
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

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe assignment of an error typed value

Check failure on line 21 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe call of an `error` type typed value

Check failure on line 21 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe member access .of on an `error` typed value
this.txsFeatures = UInt.of(json.txsFeatures);

Check failure on line 22 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe assignment of an error typed value

Check failure on line 22 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe call of an `error` type typed value

Check failure on line 22 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe member access .of on an `error` typed value
this.bloom = HexUInt.of(json.bloom);
this.k = UInt.of(json.k);

Check failure on line 24 in packages/net/src/thor/subscriptions/SubscriptionBeat2Response.ts

View workflow job for this annotation

GitHub Actions / install-build / Build & Lint

Unsafe assignment of an error typed value
}
}

interface SubscriptionBeat2ResponseJSON {
gasLimit: number;
obsolete: boolean;
number: number;
id: string;
parentID: string;
timestamp: number;
txsFeatures: number;
bloom: string;
k: number;
}

export { SubscriptionBeat2Response, type SubscriptionBeat2ResponseJSON };

0 comments on commit 88faf21

Please sign in to comment.