Skip to content

Commit 88bd407

Browse files
committed
Fix build issues for Provider
1 parent d1c8276 commit 88bd407

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

ambient.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module '@blockcore/coininfo';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockcore/provider",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "",
55
"type": "module",
66
"exports": "./lib/index.js",

src/Provider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class Provider implements EIP1193Provider {
2121
}
2222

2323
on(event: string, callback: any) {
24+
console.log(event, callback);
2425
// "accountsChanged"
2526
// "chainChanged"
2627
// "networkChanged"
@@ -88,16 +89,16 @@ export class Provider implements EIP1193Provider {
8889
},
8990
];
9091
case 'requestPermissions': //
91-
break;
92+
return null;
9293
case 'getTransactionByHash':
9394
return this.getBlockTransactionsByHash(param0.transactionHash);
9495
case 'getBlockByHash':
9596
return this.getBlockByHash(param0.blockHash); // TODO: Add support for "includeTransactions".
9697
case 'getBlockByNumber':
9798
return this.getBlockByIndex(param0.blockNumber); // TODO: Add support for "includeTransactions".
99+
default:
100+
return null;
98101
}
99-
100-
console.log('UNHANDLED METHOD!!');
101102
}
102103

103104
private async fetchText(url: string): Promise<string> {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"include": [
77
"src"
8-
],
8+
, "ambient.d.ts" ],
99
"ts-node": {
1010
"transpileOnly": true,
1111
"files": true,

0 commit comments

Comments
 (0)