Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
feat: core 0.8 tx rpc upgrade (#451)
Browse files Browse the repository at this point in the history
* feat: core 0.8 tx rpc changes

* chore: update version
  • Loading branch information
crisog authored Apr 27, 2022
1 parent 4ab757f commit f395814
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pokt-network/pocket-js",
"version": "0.7.2-rc",
"version": "0.8.0-rc",
"engine": {
"node": ">=12.16.0 <=16.13.0"
},
Expand Down
11 changes: 8 additions & 3 deletions src/rpc/models/output/query-account-txs-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export class QueryAccountTxsResponse {

return new QueryAccountTxsResponse(
transactions,
rawObjValue.total_count
rawObjValue.total_txs,
rawObjValue.page_count
)
} catch (error) {
throw error
Expand All @@ -37,6 +38,7 @@ export class QueryAccountTxsResponse {

public readonly transactions: Transaction[]
public readonly totalCount: number
public readonly pageCount: number

/**
* Query Account transaction list Response.
Expand All @@ -46,10 +48,12 @@ export class QueryAccountTxsResponse {
*/
constructor(
transactions: Transaction[],
totalCount: number
totalCount: number,
pageCount: number
) {
this.transactions = transactions
this.totalCount = totalCount
this.pageCount = pageCount

if (!this.isValid()) {
throw new TypeError("Invalid QueryAccountTxsResponse properties.")
Expand All @@ -70,7 +74,8 @@ export class QueryAccountTxsResponse {

return {
txs: transactions,
total_count: this.totalCount
total_count: this.totalCount,
page_count: this.pageCount
}
}
/**
Expand Down
11 changes: 8 additions & 3 deletions src/rpc/models/output/query-block-txs-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export class QueryBlockTxsResponse {

return new QueryBlockTxsResponse(
transactions,
rawObjValue.total_count
rawObjValue.total_txs,
rawObjValue.page_count
)
} catch (error) {
throw error
Expand All @@ -37,6 +38,7 @@ export class QueryBlockTxsResponse {

public readonly transactions: Transaction[]
public readonly totalCount: number
public readonly pageCount: number

/**
* Query block transactions Response.
Expand All @@ -46,10 +48,12 @@ export class QueryBlockTxsResponse {
*/
constructor(
transactions: Transaction[],
totalCount: number
totalCount: number,
pageCount: number
) {
this.transactions = transactions
this.totalCount = totalCount
this.pageCount = pageCount

if (!this.isValid()) {
throw new TypeError("Invalid QueryBlockTxsResponse properties.")
Expand All @@ -71,7 +75,8 @@ export class QueryBlockTxsResponse {

return {
txs: transactions,
total_count: this.totalCount
total_count: this.totalCount,
page_count: this.pageCount
}
}
/**
Expand Down

0 comments on commit f395814

Please sign in to comment.