diff --git a/src/contract/types.ts b/src/contract/types.ts index 82887690..e736b72b 100644 --- a/src/contract/types.ts +++ b/src/contract/types.ts @@ -8,7 +8,7 @@ import type { TransactionResponse, TransactionRequest, } from '../providers/index.js'; -import { AccessList } from '../transaction'; +import { AccessList } from '../transaction/index.js'; /** * The name for an event used for subscribing to Contract events. diff --git a/src/hash/typed-data.ts b/src/hash/typed-data.ts index 7986e5ff..530dbf8a 100644 --- a/src/hash/typed-data.ts +++ b/src/hash/typed-data.ts @@ -1,4 +1,3 @@ -//import { TypedDataDomain, TypedDataField } from "@quaisproject/providerabstract-signer"; import { getAddress } from '../address/index.js'; import { keccak256 } from '../crypto/index.js'; import { recoverAddress } from '../address/index.js'; diff --git a/src/providers/abstract-provider.ts b/src/providers/abstract-provider.ts index da94e3c9..b06a9080 100644 --- a/src/providers/abstract-provider.ts +++ b/src/providers/abstract-provider.ts @@ -81,7 +81,7 @@ import { } from './subscriber-polling.js'; import { getNodeLocationFromZone, getZoneFromNodeLocation } from '../utils/shards.js'; import { fromShard } from '../constants/shards.js'; -import { AccessList } from '../transaction'; +import { AccessList } from '../transaction/index.js'; type Timer = ReturnType; diff --git a/src/providers/provider.ts b/src/providers/provider.ts index 5e1b3450..efe737c9 100644 --- a/src/providers/provider.ts +++ b/src/providers/provider.ts @@ -197,14 +197,12 @@ export interface QuaiTransactionRequest { gasLimit?: null | BigNumberish; /** - * The gas price to use for legacy transactions or transactions on legacy networks. - * - * Most of the time the `max*FeePerGas` is preferred. + * The gas price to use for the transaction. */ gasPrice?: null | BigNumberish; /** - * The [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) maximum priority fee to pay per gas. + * The tip to paid directly to the miner of the transaction. */ minerTip?: null | BigNumberish; @@ -310,14 +308,12 @@ export interface QuaiPreparedTransactionRequest { gasLimit?: bigint; /** - * The gas price to use for legacy transactions or transactions on legacy networks. - * - * Most of the time the `max*FeePerGas` is preferred. + * The gas price to use for the transaction. */ gasPrice?: bigint; /** - * The [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) maximum priority fee to pay per gas. + * The fee paid directly to the miner of the transaction. */ minerTip?: bigint; diff --git a/src/signers/abstract-signer.ts b/src/signers/abstract-signer.ts index 515f5e64..6383ad0d 100644 --- a/src/signers/abstract-signer.ts +++ b/src/signers/abstract-signer.ts @@ -14,7 +14,7 @@ import type { Signer } from './signer.js'; import { getTxType } from '../utils/index.js'; import { QuaiTransaction, QuaiTransactionLike } from '../transaction/index.js'; import { toZone, Zone } from '../constants/index.js'; -import { AccessList } from '../transaction'; +import { AccessList } from '../transaction/index.js'; function checkProvider(signer: AbstractSigner, operation: string): Provider { if (signer.provider) { diff --git a/src/signers/signer.ts b/src/signers/signer.ts index f891ded6..ff88ab6c 100644 --- a/src/signers/signer.ts +++ b/src/signers/signer.ts @@ -4,7 +4,7 @@ import type { TransactionLike } from '../transaction/index.js'; import type { ContractRunner } from '../contract/index.js'; import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from '../providers/provider.js'; -import { AccessList } from '../transaction'; +import { AccessList } from '../transaction/index.js'; /** * A Signer represents an account on the Ethereum Blockchain, and is most often backed by a private key represented by a @@ -72,8 +72,7 @@ export interface Signer extends Addressable, ContractRunner { * - Populates `nonce` via `signer.getNonce("pending")` * - Populates `gasLimit` via `signer.estimateGas(tx)` * - Populates `chainId` via `signer.provider.getNetwork()` - * - Populates `type` and relevant fee data for that type (`gasPrice` for legacy transactions, `maxFeePerGas` for - * EIP-1559, etc) + * - Populates `type` and relevant fee data for that type (`gasPrice`, `minerTip`, etc) * * @param {TransactionRequest} tx - The transaction to prepare. * @returns {Promise} A promise resolving to the prepared transaction. diff --git a/src/wallet/qi-hdwallet.ts b/src/wallet/qi-hdwallet.ts index 966137c0..e0aca94f 100644 --- a/src/wallet/qi-hdwallet.ts +++ b/src/wallet/qi-hdwallet.ts @@ -451,7 +451,7 @@ export class QiHDWallet extends AbstractHDWallet { const gasLimit = await this.provider.estimateGas(tx); const feeData = await this.provider.getFeeData(originZone, false); - // Calculate total fee for the transaction + // 5.6 Calculate total fee for the transaction using the gasLimit, gasPrice, and minerTip const totalFee = gasLimit * (feeData.gasPrice ?? 1n) + gasLimit * (feeData.minerTip ?? 0n); // Get new selection with fee