1+ import {
2+ JsonRpcProvider ,
3+ JsonRpcSigner ,
4+ Listener ,
5+ Provider ,
6+ Web3Provider ,
7+ } from '@ethersproject/providers'
18import axios from 'axios'
29import { EthereumRpcError } from 'eth-rpc-errors'
310import {
4- ethers ,
5- Contract ,
611 BigNumber ,
7- ContractTransaction ,
12+ Contract ,
813 ContractReceipt ,
14+ ContractTransaction ,
15+ ethers ,
916 Signer ,
1017} from 'ethers'
18+ import Web3Modal , { IProviderOptions } from 'web3modal'
1119import { API_ENDPOINT , API_ENDPOINT_DEV } from './config/endpoint'
20+ import { NETWORKS , ZERO_ADDRESS } from './config/networks'
21+ import { PROVIDER_OPTIONS } from './config/providers'
1222import DropKitCollectionABI from './contracts/DropKitCollection.json'
1323import DropKitCollectionV2ABI from './contracts/DropKitCollectionV2.json'
1424import DropKitCollectionV3ABI from './contracts/DropKitCollectionV3.json'
@@ -18,15 +28,6 @@ import {
1828 ErrorApiResponse ,
1929 ProofApiResponse ,
2030} from './types/api-responses'
21- import Web3Modal , { IProviderOptions } from 'web3modal'
22- import { PROVIDER_OPTIONS } from './config/providers'
23- import {
24- JsonRpcProvider ,
25- JsonRpcSigner ,
26- Provider ,
27- Web3Provider ,
28- } from '@ethersproject/providers'
29- import { NETWORKS } from './config/networks'
3031
3132const abis : Record < number , any > = {
3233 2 : DropKitCollectionABI . abi ,
@@ -325,6 +326,36 @@ export default class DropKit {
325326 }
326327 }
327328
329+ onMinted ( listener : Listener ) : Contract {
330+ const filter = this . contract . filters . Transfer ( ZERO_ADDRESS )
331+ return this . contract . on ( filter , listener )
332+ }
333+
334+ onMintedToWallet ( listener : Listener ) : Contract {
335+ const filter = this . contract . filters . Transfer (
336+ ZERO_ADDRESS ,
337+ this . walletAddress
338+ )
339+ return this . contract . on ( filter , listener )
340+ }
341+
342+ mintedToWalletListeners ( ) : Listener [ ] {
343+ const filter = this . contract . filters . Transfer (
344+ ZERO_ADDRESS ,
345+ this . walletAddress
346+ )
347+ return this . contract . listeners ( filter )
348+ }
349+
350+ mintedListeners ( ) : Listener [ ] {
351+ const filter = this . contract . filters . Transfer ( ZERO_ADDRESS )
352+ return this . contract . listeners ( filter )
353+ }
354+
355+ removeAllListeners ( ) : Contract {
356+ return this . contract . removeAllListeners ( )
357+ }
358+
328359 private async _mint (
329360 quantity : number ,
330361 amount : BigNumber
0 commit comments