Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #319

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/contract/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/hash/typed-data.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/providers/abstract-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof setTimeout>;

Expand Down
12 changes: 4 additions & 8 deletions src/providers/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/signers/abstract-signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions src/signers/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<TransactionLike>} A promise resolving to the prepared transaction.
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/qi-hdwallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading