You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove jest in order to use tap
* update timeout
* remove deps
* update ts config
* migration
* add node lts 20.x
* merging changes from main
* update doc links and allow FetchRequest in custom RPCs
* BscscanProvider will use etherscan url only as etherscan v2 supports all chains in one URL
* fix tests with appropriate mocks
* update readme with migration to v3 section
* bump version to 3.0.0
* fix tests failing due to real RPC calls
* add missing test to improve coverage
---------
Co-authored-by: Jose Ramirez <jarcodallo@gmail.com>
Co-authored-by: Muhammad Mujtaba Roohani <mujtaba.roohani@blockapex.io>
Copy file name to clipboardExpand all lines: README.md
+24-32Lines changed: 24 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ import { EthersModule } from 'nestjs-ethers';
33
33
classMyModule {}
34
34
```
35
35
36
-
**NOTE:***By default `EthersModule` will try to connect using [getDefaultProvider](https://docs.ethers.io/v5/api/providers/#providers-getDefaultProvider). It's the safest, easiest way to begin developing on Ethereum. It creates a [FallbackProvider](https://docs.ethers.io/v5/api/providers/other/#FallbackProvider) connected to as many backend services as possible.*
36
+
**NOTE:***By default `EthersModule` will try to connect using [getDefaultProvider](https://docs.ethers.org/v6/api/providers/#getDefaultProvider). It's the safest, easiest way to begin developing on Ethereum. It creates a [FallbackProvider](https://docs.ethers.org/v6/api/providers/fallback-provider/) connected to as many backend services as possible.*
37
37
38
38
### Configuration params
39
39
@@ -47,9 +47,9 @@ interface EthersModuleOptions {
47
47
* If no network is provided, homestead (i.e. mainnet) is used.
48
48
* The network may also be a URL to connect to,
49
49
* such as http://localhost:8545 or wss://example.com.
* Optional parameter if this option is false, EthersModule will try to connect
130
122
* with the credentials provided in options. If you define more than one provider,
131
123
* EthersModule will use the FallbackProvider to send multiple requests simultaneously.
132
124
*/
133
125
useDefaultProvider?:boolean;
134
-
135
-
/**
136
-
* Optional parameter if this option is true, EthersModule will disable
137
-
* the console.log in the ethers.js library.
138
-
*/
139
-
disableEthersLogger?:boolean
140
126
141
127
/**
142
128
* Optional parameter to associate a token name to EthersProvider,
@@ -301,7 +287,7 @@ class TestModule {}
301
287
302
288
## BaseProvider
303
289
304
-
`BaseProvider` implements standard [Ether.js Provider](https://docs.ethers.io/v5/api/providers/provider/). So if you are familiar with it, you are ready to go.
290
+
`BaseProvider` implements standard [Ether.js Provider](https://docs.ethers.org/v6/api/providers/#Provider). So if you are familiar with it, you are ready to go.
if you are familiar with [StaticJsonRpcProvider](https://docs.ethers.io/v5/api/providers/jsonrpc-provider/#StaticJsonRpcProvider), you are ready to go. The custom provider is very helpful when you want to use a RPC that is not defined in [ethers](https://github.com/ethers-io/ethers.js/). This is the case for Binance Smart Chain public [RPCs](https://docs.binance.org/smart-chain/developer/rpc.html).
388
+
if you are familiar with [JsonRpcProvider](https://docs.ethers.org/v6/api/providers/jsonrpc/), you are ready to go. The custom provider is very helpful when you want to use a RPC that is not defined in [ethers](https://github.com/ethers-io/ethers.js/). This is the case for Binance Smart Chain public [RPCs](https://docs.binance.org/smart-chain/developer/rpc.html).
403
389
404
390
```ts
405
391
import {
@@ -479,7 +465,7 @@ class TestController {
479
465
480
466
## EthersSigner
481
467
482
-
`EthersSigner` implements methods to create a [Wallet](https://docs.ethers.io/v5/api/signer/#Wallet) or [VoidSigner](https://docs.ethers.io/v5/api/signer/#VoidSigner). A `Signer` in ethers is an abstraction of an Ethereum Account, which can be used to sign messages and transactions and send signed transactions to the Ethereum Network. This service will also inject the `BaseProvider` into the wallet.
468
+
`EthersSigner` implements methods to create a [Wallet](https://docs.ethers.org/v6/api/wallet/#Wallet) or [VoidSigner](https://docs.ethers.org/v6/api/providers/abstract-signer/#VoidSigner). A `Signer` in ethers is an abstraction of an Ethereum Account, which can be used to sign messages and transactions and send signed transactions to the Ethereum Network. This service will also inject the `BaseProvider` into the wallet.
483
469
484
470
Create a `Wallet` from a private key:
485
471
@@ -502,7 +488,7 @@ export class TestService {
502
488
}
503
489
```
504
490
505
-
Create a random [Wallet](https://docs.ethers.io/v5/api/signer/#Wallet-createRandom):
491
+
Create a random [Wallet](https://docs.ethers.org/v6/api/wallet/#Wallet_createRandom):
`EthersContract` implements a method for the creation of a [Contract](https://docs.ethers.io/v5/api/contract/) instance. This service will also inject the a `BaseProvider` into the contract.
602
+
`EthersContract` implements a method for the creation of a [Contract](https://docs.ethers.org/v6/api/contract/) instance. This service will also inject the a `BaseProvider` into the contract.
617
603
618
604
Create a `SmartContract` attached to an address:
619
605
@@ -638,7 +624,7 @@ class TestService {
638
624
}
639
625
```
640
626
641
-
Create a [Contract](https://docs.ethers.io/v5/api/contract/) with a Wallet:
627
+
Create a [Contract](https://docs.ethers.org/v6/api/contract/) with a Wallet:
642
628
643
629
```ts
644
630
import {
@@ -998,6 +984,12 @@ class TestService {
998
984
}
999
985
```
1000
986
987
+
### v3
988
+
989
+
- Migrated to ethers.js v6 from v5, introduced breaking changes, see the [migration guide](https://docs.ethers.org/v6/migrating/#migrating) for comprehensive list of changes
990
+
-`BigNumber` was replaced with the standard `bigint`
991
+
-`StaticJsonRpcProvider` was merged to `JsonRpcProvider` with `staticNetwork` option.
992
+
1001
993
## Change Log
1002
994
1003
995
See [Changelog](CHANGELOG.md) for more information.
0 commit comments