@ethersproject/providers#TransactionRequest TypeScript Examples

The following examples show how to use @ethersproject/providers#TransactionRequest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: rpcCall.ts    From defillama-sdk with GNU Affero General Public License v3.0 6 votes vote down vote up
export async function call(provider: BaseProvider, data: Deferrable<TransactionRequest>, block: BlockTag, chain?: string) {
  if (!chain) chain = 'noChain'
  const counter: Counter = getChainCounter(chain)
  const currentId = counter.requestCount++
  const eventId = `${chain}-${currentId}`

  if (counter.activeWorkers > maxParallelCalls) {
    counter.queue.push(eventId)
    await once(emitter, eventId)
  }

  counter.activeWorkers++

  if (DEBUG_MODE_ENABLED) {
    const showEveryX = counter.queue.length > 100 ? 50 : 10 // show log fewer times if lot more are queued up
    if (currentId % showEveryX === 0) console.log(`chain: ${chain} request #: ${currentId} queue: ${counter.queue.length} active requests: ${counter.activeWorkers}`)
  }

  let response
  try {
    response = await provider.call(data, block)
    onComplete()
  } catch (e) {
    onComplete()
    throw e
  }

  return response

  function onComplete() {
    counter.activeWorkers--
    if (counter.queue.length) {
      const nextRequestId = counter.pickFromTop ? counter.queue.shift() : counter.queue.pop()
      counter.pickFromTop = !counter.pickFromTop
      emitter.emit(<string> nextRequestId)
    }
  }
}
Example #2
Source File: L1NovaExecutionManager__factory.ts    From nova with GNU Affero General Public License v3.0 6 votes vote down vote up
getDeployTransaction(
    _L2_NOVA_REGISTRY_ADDRESS: string,
    _CROSS_DOMAIN_MESSENGER: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(
      _L2_NOVA_REGISTRY_ADDRESS,
      _CROSS_DOMAIN_MESSENGER,
      overrides || {}
    );
  }
Example #3
Source File: Hypervisor__factory.ts    From hypervisor with The Unlicense 6 votes vote down vote up
getDeployTransaction(
    _pool: string,
    _owner: string,
    name: string,
    symbol: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(
      _pool,
      _owner,
      name,
      symbol,
      overrides || {}
    );
  }
Example #4
Source File: AaveGovernanceV2__factory.ts    From commonwealth with GNU General Public License v3.0 6 votes vote down vote up
getDeployTransaction(
    governanceStrategy: string,
    votingDelay: BigNumberish,
    guardian: string,
    executors: string[],
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(
      governanceStrategy,
      votingDelay,
      guardian,
      executors,
      overrides || {}
    );
  }
Example #5
Source File: Cat__factory.ts    From kitty-contracts with MIT License 6 votes vote down vote up
getDeployTransaction(
    _startTime: BigNumberish,
    _communityFund: string,
    _devFund: string,
    _team1Fund: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(
      _startTime,
      _communityFund,
      _devFund,
      _team1Fund,
      overrides || {}
    );
  }
Example #6
Source File: index.ts    From ccip-read with MIT License 6 votes vote down vote up
async sendTransaction(request: Deferrable<TransactionRequest>): Promise<TransactionResponse> {
    let transaction = await resolveProperties(request);

    // gasLimit, if set, applies to the final transaction; unset it for the preflight
    const gasLimit = transaction.gasLimit;
    delete transaction.gasLimit;

    ({ transaction } = await handleCall(this.provider, { transaction, blockTag: 'latest' }));

    // Restore the original gasLimit, if any
    transaction.gasLimit = gasLimit;

    return this.parent.sendTransaction(transaction);
  }
Example #7
Source File: TokenFactory__factory.ts    From shoyu with MIT License 6 votes vote down vote up
getDeployTransaction(
    protocolFeeRecipient: string,
    protocolFee: BigNumberish,
    operationalFeeRecipient: string,
    operationalFee: BigNumberish,
    _baseURI721: string,
    _baseURI1155: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(
      protocolFeeRecipient,
      protocolFee,
      operationalFeeRecipient,
      operationalFee,
      _baseURI721,
      _baseURI1155,
      overrides || {}
    );
  }
Example #8
Source File: CrossAnchorBridgeV2__factory.ts    From anchor-web-app with Apache License 2.0 5 votes vote down vote up
getDeployTransaction(
    overrides?: Overrides & { from?: string | Promise<string> },
  ): TransactionRequest {
    return super.getDeployTransaction(overrides || {});
  }
Example #9
Source File: symbiosis.service.ts    From rubic-app with GNU General Public License v3.0 5 votes vote down vote up
private transactionRequest: TransactionRequest;
Example #10
Source File: BadReturnValueERC20__factory.ts    From nova with GNU Affero General Public License v3.0 5 votes vote down vote up
getDeployTransaction(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(overrides || {});
  }
Example #11
Source File: Admin__factory.ts    From hypervisor with The Unlicense 5 votes vote down vote up
getDeployTransaction(
    _admin: string,
    _advisor: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(_admin, _advisor, overrides || {});
  }
Example #12
Source File: AaveTokenV1Mock__factory.ts    From commonwealth with GNU General Public License v3.0 5 votes vote down vote up
getDeployTransaction(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(overrides || {});
  }
Example #13
Source File: CatRewardPool__factory.ts    From kitty-contracts with MIT License 5 votes vote down vote up
getDeployTransaction(
    _bshare: string,
    _poolStartTime: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(_bshare, _poolStartTime, overrides || {});
  }
Example #14
Source File: index.ts    From ccip-read with MIT License 5 votes vote down vote up
signTransaction(_transaction: Deferrable<TransactionRequest>): Promise<string> {
    return logger.throwError('CCIPReadSigner does not support signTransaction', Logger.errors.NOT_IMPLEMENTED);
  }
Example #15
Source File: DutchAuction__factory.ts    From shoyu with MIT License 5 votes vote down vote up
getDeployTransaction(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): TransactionRequest {
    return super.getDeployTransaction(overrides || {});
  }