Skip to content

Commit 8e8012c

Browse files
committed
Add a few more methods to the request function
1 parent fbdcb06 commit 8e8012c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Provider.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export class Provider {
2020
}
2121

2222
public async request(request: ProviderRequest) {
23+
const param0 = request.params?.at(0);
24+
2325
switch (request.method) {
2426
case 'wallet_requestPermissions': // eip-2255 - https://eips.ethereum.org/EIPS/eip-2255
2527
return [
@@ -49,6 +51,12 @@ export class Provider {
4951
];
5052
case 'requestPermissions': //
5153
break;
54+
case 'getTransactionByHash':
55+
return this.getBlockTransactionsByHash(param0.transactionHash);
56+
case 'getBlockByHash':
57+
return this.getBlockByHash(param0.blockHash); // TODO: Add support for "includeTransactions".
58+
case 'getBlockByNumber':
59+
return this.getBlockByIndex(param0.blockNumber); // TODO: Add support for "includeTransactions".
5260
}
5361

5462
console.log('UNHANDLED METHOD!!');

0 commit comments

Comments
 (0)