From 970a6def488f7897aea954769fcbd369f209d9ee Mon Sep 17 00:00:00 2001 From: MichaelKostroma Date: Tue, 10 Sep 2024 12:22:46 +0300 Subject: [PATCH] refactor: upgrades quais sdk to 1.0.0-alfa.9 --- background/package.json | 2 +- .../services/chain/types/quai-transaction-types.ts | 8 ++++++-- .../services/chain/utils/quai-transactions.ts | 4 ++++ yarn.lock | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/background/package.json b/background/package.json index fbcb23e2..3f6bf769 100644 --- a/background/package.json +++ b/background/package.json @@ -32,7 +32,7 @@ "dexie": "^3.0.3", "emittery": "^0.9.2", "lodash": "^4.17.21", - "quais": "^1.0.0-alpha.8", + "quais": "^1.0.0-alpha.9", "sinon": "^14.0.0", "siwe": "^1.1.0", "util": "^0.12.4", diff --git a/background/services/chain/types/quai-transaction-types.ts b/background/services/chain/types/quai-transaction-types.ts index 4eaf6200..a9b5bb3a 100644 --- a/background/services/chain/types/quai-transaction-types.ts +++ b/background/services/chain/types/quai-transaction-types.ts @@ -7,7 +7,10 @@ import { } from "quais" import { QuaiTransactionRequest } from "quais/lib/commonjs/providers" import { QuaiTransactionLike } from "quais/lib/commonjs/transaction/quai-transaction" -import { QuaiTransactionResponseParams } from "quais/lib/commonjs/providers/formatting" +import { + EtxParams, + QuaiTransactionResponseParams, +} from "quais/lib/commonjs/providers/formatting" import { TransactionAnnotation } from "../../enrichment" import { NetworkInterface } from "../../../constants/networks/networkTypes" @@ -75,8 +78,9 @@ export type SerializedTransactionForHistory = { value: BigNumberish | null | undefined index: bigint blockNumber: number | null - etxs: ReadonlyArray + etxs: readonly EtxParams[] gasPrice: BigNumberish | null | undefined logs: ReadonlyArray gasUsed?: bigint | null + etxType: string | null } diff --git a/background/services/chain/utils/quai-transactions.ts b/background/services/chain/utils/quai-transactions.ts index 1355ac47..2a7f68b4 100644 --- a/background/services/chain/utils/quai-transactions.ts +++ b/background/services/chain/utils/quai-transactions.ts @@ -110,6 +110,7 @@ export const createSerializedQuaiTransaction = ( gasPrice, logs: [], gasUsed: undefined, + etxType: null, } case QuaiTransactionStatus.PENDING: @@ -139,6 +140,7 @@ export const createSerializedQuaiTransaction = ( gasPrice, logs: [], gasUsed: undefined, + etxType: transaction?.etxType ?? null, } case QuaiTransactionStatus.CONFIRMED: @@ -164,6 +166,7 @@ export const createSerializedQuaiTransaction = ( gasPrice, logs: transaction?.logs, gasUsed: transaction?.gasPrice, + etxType: null, } default: @@ -189,6 +192,7 @@ export const createSerializedQuaiTransaction = ( gasPrice: undefined, logs: [], gasUsed: undefined, + etxType: null, } } } diff --git a/yarn.lock b/yarn.lock index 5dac6b6a..f21d1759 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7315,6 +7315,20 @@ quais@^1.0.0-alpha.8: tslib "^2.6.2" ws "^8.17.1" +quais@^1.0.0-alpha.9: + version "1.0.0-alpha.9" + resolved "https://registry.yarnpkg.com/quais/-/quais-1.0.0-alpha.9.tgz#8a20d7e77b9a37603aa06374af3e6e69ca992cbc" + integrity sha512-Vlho+KVnKTlTkHmqS+u2IKCVjwBZk+FAL2FYMVcH+MqEwh1VrQq1NHDLCiv/GfyeBZhNKkojXGyNxw6J0lAyaw== + dependencies: + "@brandonblack/musig" "^0.0.1-alpha.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + aes-js "4.0.0-beta.5" + dotenv "^16.4.1" + google-protobuf "^3.21.4" + tslib "^2.6.2" + ws "^8.17.1" + querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"