From 6b972f1aa6ffc877d8cd423b6d11b29785fe07a6 Mon Sep 17 00:00:00 2001 From: godtaehee Date: Thu, 20 Oct 2022 22:31:44 +0900 Subject: [PATCH 1/4] Add CurrentProvider Type Definition in index.d.ts --- types/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/index.d.ts b/types/index.d.ts index 2ab91ddf..ad7e0d6c 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -68,6 +68,7 @@ export class AbstractCaver { constructor(provider?: RequestProvider, net?: net.Socket) version: string + currentProvider: RequestProvider utils: Utils abi: ABI formatters: Formatters From 319d26b9d6a8903ccae5dec5eae54919eaeaadca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=83=9C=ED=9D=AC?= Date: Fri, 21 Oct 2022 09:30:43 +0900 Subject: [PATCH 2/4] Modified currentProvider type as provider, not RequestProvider --- types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index ad7e0d6c..b510e1ca 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -19,7 +19,7 @@ import { Account } from './packages/caver-account/src' import { Contract as BaseContract } from './packages/caver-contract/src' import { CoreHelpers, Formatters } from './packages/caver-core-helpers/src' import { Method } from './packages/caver-core-method/src' -import { HttpProvider, IpcProvider, WebsocketProvider } from './packages/caver-core-requestmanager/src' +import { provider, HttpProvider, IpcProvider, WebsocketProvider} from './packages/caver-core-requestmanager/src' import { IPFS } from './packages/caver-ipfs/src' import { KCT } from './packages/caver-kct/src' import { DeprecatedKlayRPC } from './packages/caver-klay/src' @@ -68,7 +68,7 @@ export class AbstractCaver { constructor(provider?: RequestProvider, net?: net.Socket) version: string - currentProvider: RequestProvider + currentProvider: provider utils: Utils abi: ABI formatters: Formatters From e45a9d165808d80e769be84ad009272cd629d176 Mon Sep 17 00:00:00 2001 From: godtaehee Date: Fri, 21 Oct 2022 14:02:49 +0900 Subject: [PATCH 3/4] Add currentProvider type in caver-test.ts file --- types/test/caver-test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/test/caver-test.ts b/types/test/caver-test.ts index 378d31b6..d2e2fe87 100644 --- a/types/test/caver-test.ts +++ b/types/test/caver-test.ts @@ -34,6 +34,9 @@ let caver = new Caver('http://localhost:8551') // $ExpectType string caver.version +// $ExpectType provider +caver.currentProvider + // $ExpectType Utils caver.utils From fd3729ab0199e0dfb39ac75e9444604137268184 Mon Sep 17 00:00:00 2001 From: godtaehee Date: Fri, 21 Oct 2022 14:08:41 +0900 Subject: [PATCH 4/4] Add whitespace --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index b510e1ca..f346014f 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -19,7 +19,7 @@ import { Account } from './packages/caver-account/src' import { Contract as BaseContract } from './packages/caver-contract/src' import { CoreHelpers, Formatters } from './packages/caver-core-helpers/src' import { Method } from './packages/caver-core-method/src' -import { provider, HttpProvider, IpcProvider, WebsocketProvider} from './packages/caver-core-requestmanager/src' +import { provider, HttpProvider, IpcProvider, WebsocketProvider } from './packages/caver-core-requestmanager/src' import { IPFS } from './packages/caver-ipfs/src' import { KCT } from './packages/caver-kct/src' import { DeprecatedKlayRPC } from './packages/caver-klay/src'