manifoldfinance / manifoldfinance/wallet_switchNetworkRpcProvider

Feature: request specific 'web3_clientVersion' response on switch over

Open
#7 0 comments 0 reactions 1 assignee View on GitHub

@sambacha is already working on this.

Since May 9, 2022.

enhancement good first issue help wanted
Dominant language
Go
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## request specific 'web3_clientVersion' response on switch over

when requesting switch, DApps may want to specify a specific `backing node` (i.e. the specific client node to connect to).

1. provide definition of a `backing node`
2. add optional parameter that can be defined requesting a specific `web3_clientVersion` response to successfully connect

example source: https://github.com/0xProject/tools/blob/7e7e6dc16c7ba5a8c13c3c5fbd418f3d77f251f0/web3-wrapper/src/web3_wrapper.ts#L249

```typescript
/**
* Retrieves the transaction receipt for a given transaction hash if found
* @param txHash Transaction hash
* @returns The transaction receipt, including it's status (0: failed, 1: succeeded). Returns undefined if transaction not found.
*/
public async getTransactionReceiptIfExistsAsync(txHash: string): Promise {
assert.isHexString('txHash', txHash);
const transactionReceiptRpc = await this.sendRawPayloadAsync({
method: 'eth_getTransactionReceipt',
params: [txHash],
});
// HACK Parity can return a pending transaction receipt. We check for a non null
// block number before continuing with returning a fully realised receipt.
// ref: https://github.com/paritytech/parity-ethereum/issues/1180
if (transactionReceiptRpc !== null && transactionReceiptRpc.blockNumber !== null) {
transactionReceiptRpc.status = Web3Wrapper._normalizeTxReceiptStatus(transactionReceiptRpc.status);
const transactionReceipt = marshaller.unmarshalTransactionReceipt(transactionReceiptRpc);
return transactionReceipt;
} else {
return undefined;
}
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.