Skip to content

Commit e7990d0

Browse files
committed
Revert "use ethers narive typing instead of @ethersproject/abstract-provider"
This reverts commit 92eb604.
1 parent d8c673b commit e7990d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+67
-65
lines changed

lib/agent/common/approveIfNeeded.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/* eslint-disable functional/functional-parameters */
22
import { UndefinedOr, whenDefined, whenDefinedAll } from '@devprotocol/util-ts'
3-
import type { TransactionResponse, TransactionReceipt } from 'ethers'
3+
import {
4+
TransactionResponse,
5+
TransactionReceipt,
6+
} from '@ethersproject/abstract-provider'
47
import { createErc20Contract } from '../../common/erc20'
58
import { FallbackableOverrides } from '../../common/utils/execute'
69
import { clientsDev } from './clients/clientsDev'

lib/agent/fixtures/swap-arbitrary-tokens/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ContractRunner, ethers } from 'ethers'
22
import { swapArbitraryTokensAbi } from './abi'
33
import { FallbackableOverrides } from '../../../common/utils/execute'
4-
import type { TransactionResponse } from 'ethers'
4+
import { TransactionResponse } from '@ethersproject/abstract-provider'
55
import { createGetEstimatedDevForTokensCaller } from './getEstimatedDevForTokens'
66
import { createGetEstimatedTokensForDevCaller } from './getEstimatedTokensForDev'
77
import { createSwapTokensAndStakeDevCaller } from './swapTokensAndStakeDev'

lib/agent/fixtures/swap-arbitrary-tokens/swapTokensAndStakeDev.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FallbackableOverrides,
66
MutationOption,
77
} from '../../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99
import { pathOf } from './path-of'
1010

1111
export type CreateSwapTokensAndStakeDevCaller = (

lib/agent/fixtures/swap/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createGetEstimatedDevForEthCaller } from './getEstimatedDevForEth'
55
import { createGetEstimatedEthForDevCaller } from './getEstimatedEthForDev'
66
import { createSwapEthAndStakeDevCaller } from './swapEthAndStakeDev'
77
import { FallbackableOverrides } from '../../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99
import { always } from 'ramda'
1010
import { createSwapEthAndStakeDevPolygonCaller } from './swapEthAndStakeDevPolygon'
1111
import { swapAbiV3Polygon } from './abi-v3-polygon'

lib/agent/fixtures/swap/swapEthAndStakeDev.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FallbackableOverrides,
66
MutationOption,
77
} from '../../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99

1010
export type CreateSwapEthAndStakeDevCaller = (
1111
contract: ethers.Contract,

lib/agent/fixtures/swap/swapEthAndStakeDevPolygon.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FallbackableOverrides,
66
MutationOption,
77
} from '../../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99

1010
export type CreateSwapEthAndStakeDevPolygonCaller = (
1111
contract: ethers.Contract,

lib/agent/positionsClaim.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TransactionResponse } from 'ethers'
1+
import { TransactionResponse } from '@ethersproject/abstract-provider'
22
import { FallbackableOverrides } from '../common/utils/execute'
33
import type { BaseProvider } from '@ethersproject/providers'
44
import { UndefinedOr } from '@devprotocol/util-ts'

lib/agent/positionsCreateWithEth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable functional/functional-parameters */
22
import { FallbackableOverrides } from '../common/utils/execute'
33
import { clientsUtilsSwapForStake } from './common/clients/clientsUtilsSwapForStake'
4-
import type { TransactionResponse } from 'ethers'
4+
import { TransactionResponse } from '@ethersproject/abstract-provider'
55
import { ContractRunner, ZeroHash } from 'ethers'
66

77
type PositionsCreateWithEth = (options: {

lib/agent/propertiesAuthenticate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FallbackableOverrides } from '../common/utils/execute'
22
import type { BaseProvider } from '@ethersproject/providers'
3-
import type { TransactionResponse } from 'ethers'
3+
import type { TransactionResponse } from '@ethersproject/abstract-provider'
44
import { UndefinedOr } from '@devprotocol/util-ts'
55

66
type PropertiesAuthenticate = (options: {

lib/agent/propertiesCreate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TransactionResponse } from 'ethers'
1+
import { TransactionResponse } from '@ethersproject/abstract-provider'
22
import { FallbackableOverrides } from '../common/utils/execute'
33
import type { BaseProvider } from '@ethersproject/providers'
44
import { UndefinedOr } from '@devprotocol/util-ts'

lib/agent/propertiesCreateToAuthenticate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FallbackableOverrides } from '../common/utils/execute'
22
import type { BaseProvider } from '@ethersproject/providers'
3-
import type { TransactionResponse } from 'ethers'
3+
import type { TransactionResponse } from '@ethersproject/abstract-provider'
44
import { UndefinedOr } from '@devprotocol/util-ts'
55

66
type PropertiesCreateToAuthenticate = (options: {

lib/agent/propertiesDeauthenticate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FallbackableOverrides } from '../common/utils/execute'
22
import type { BaseProvider } from '@ethersproject/providers'
3-
import type { TransactionResponse } from 'ethers'
3+
import type { TransactionResponse } from '@ethersproject/abstract-provider'
44
import { UndefinedOr } from '@devprotocol/util-ts'
55

66
type PropertiesDeauthenticate = (options: {

lib/common/erc20/approve.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateApproveCaller = (
1010
contract: ethers.Contract,

lib/common/erc20/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { createSymbolCaller } from './symbol'
1010
import { createDecimalsCaller } from './decimals'
1111
import { createAllowanceCaller } from './allowance'
1212
import { FallbackableOverrides } from '../utils/execute'
13-
import type { TransactionResponse } from 'ethers'
13+
import { TransactionResponse } from '@ethersproject/abstract-provider'
1414

1515
export type Erc20Contract = {
1616
readonly totalSupply: () => Promise<string>

lib/common/erc20/transfer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateTransferCaller = (
1010
contract: ethers.Contract,

lib/common/erc20/transferFrom.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateTransferFromCaller = (
1010
contract: ethers.Contract,

lib/common/utils/execute.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import {
2-
ethers,
3-
type BrowserProvider,
4-
type TransactionResponse,
5-
keccak256,
6-
} from 'ethers'
1+
import { ethers, type BrowserProvider, keccak256 } from 'ethers'
2+
import { TransactionResponse } from '@ethersproject/abstract-provider'
73
import { always, mergeAll } from 'ramda'
84

95
import { Positions } from '../../ethereum/s-tokens'

lib/common/utils/for-test.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
/* eslint-disable @typescript-eslint/promise-function-async */
1010
/* eslint-disable @typescript-eslint/explicit-function-return-type */
1111
/* eslint-disable no-extend-native */
12-
import type { TransactionResponse, TransactionReceipt } from 'ethers'
13-
import type { BigNumberish } from 'ethers'
12+
import {
13+
TransactionResponse,
14+
TransactionReceipt,
15+
} from '@ethersproject/abstract-provider'
16+
import type { BigNumber } from '@ethersproject/bignumber'
1417

1518
export type StubTransactionResposeFactory = (p: {
1619
readonly hash?: string
@@ -34,15 +37,15 @@ export const stubTransactionResposeFactory: StubTransactionResposeFactory = ({
3437
from: 'from',
3538
contractAddress: 'contractAddress',
3639
transactionIndex: 10,
37-
gasUsed: 10n,
40+
gasUsed: 10n as unknown as BigNumber,
3841
logsBloom: 'logsBloom',
3942
blockHash: 'blockHash',
4043
transactionHash: 'transactionHash',
4144
logs: [],
4245
blockNumber: 100,
43-
confirmations: () => Promise.resolve(102),
44-
cumulativeGasUsed: 10n,
45-
effectiveGasPrice: 10n,
46+
confirmations: 102,
47+
cumulativeGasUsed: 10n as unknown as BigNumber,
48+
effectiveGasPrice: 10n as unknown as BigNumber,
4649
byzantium: true,
4750
type: 10,
4851
}),

lib/ethereum/dev/deposit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
MutationOption,
55
FallbackableOverrides,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateDepositCaller = (
1010
contract: ethers.Contract,

lib/ethereum/dev/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createDecimalsCaller } from '../../common/erc20/decimals'
1111
import { createAllowanceCaller } from '../../common/erc20/allowance'
1212
import { createDepositCaller } from './deposit'
1313
import { FallbackableOverrides } from '../../common/utils/execute'
14-
import type { TransactionResponse } from 'ethers'
14+
import { TransactionResponse } from '@ethersproject/abstract-provider'
1515

1616
export type DevContract = {
1717
readonly totalSupply: () => Promise<string>

lib/ethereum/lockup/depositToPosition.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FallbackableOverrides,
66
MutationOption,
77
} from '../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99

1010
export type CreateDepositToPositionCaller = (
1111
contract: ethers.Contract,

lib/ethereum/lockup/depositToProperty.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FallbackableOverrides,
66
MutationOption,
77
} from '../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99

1010
export type CreateDepositToPropertyCaller = (
1111
contract: ethers.Contract,

lib/ethereum/lockup/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { createDepositToPropertyCaller } from './depositToProperty'
1616
import { createDepositToPositionCaller } from './depositToPosition'
1717
import { createMigrateToSTokensCaller } from './migrateToSTokens'
1818
import { FallbackableOverrides } from '../../common/utils/execute'
19-
import type { TransactionResponse } from 'ethers'
19+
import { TransactionResponse } from '@ethersproject/abstract-provider'
2020

2121
export type LockupContract = {
2222
readonly getValue: (

lib/ethereum/lockup/migrateToSTokens.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FallbackableOverrides,
66
MutationOption,
77
} from '../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99

1010
export type CreateMigrateToSTokensCaller = (
1111
contract: ethers.Contract,

lib/ethereum/lockup/withdraw.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateWithdrawCaller = (
1010
contract: ethers.Contract,

lib/ethereum/lockup/withdrawByPosition.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FallbackableOverrides,
66
MutationOption,
77
} from '../../common/utils/execute'
8-
import type { TransactionResponse } from 'ethers'
8+
import { TransactionResponse } from '@ethersproject/abstract-provider'
99

1010
export type CreateWithdrawByPositionCaller = (
1111
contract: ethers.Contract,

lib/ethereum/market-factory/create.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateCreateCaller = (
1010
contract: ethers.Contract,

lib/ethereum/market-factory/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ContractRunner, ethers } from 'ethers'
22
import { marketFactoryAbi } from './abi'
33
import { createCreateCaller } from './create'
44
import { FallbackableOverrides } from '../../common/utils/execute'
5-
import type { TransactionResponse } from 'ethers'
5+
import { TransactionResponse } from '@ethersproject/abstract-provider'
66

77
export type MarketFactoryContract = {
88
readonly create: (

lib/ethereum/market/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ContractRunner, ethers } from 'ethers'
2-
import type { TransactionResponse } from 'ethers'
2+
import { TransactionResponse } from '@ethersproject/abstract-provider'
33
import { marketAbi } from './abi'
44
import { createSchemaCaller } from './schema'
55
import { createVoteCaller } from './vote'

lib/ethereum/market/vote.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ethers } from 'ethers'
2-
import type { TransactionResponse } from 'ethers'
2+
import { TransactionResponse } from '@ethersproject/abstract-provider'
33
import {
44
execute,
55
FallbackableOverrides,

lib/ethereum/policy-factory/create.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateCreateCaller = (
1010
contract: ethers.Contract,

lib/ethereum/policy-factory/forceAttach.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateForceAttachCaller = (
1010
contract: ethers.Contract,

lib/ethereum/policy-factory/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { policyFactoryAbi } from './abi'
33
import { createCreateCaller } from './create'
44
import { createForceAttachCaller } from './forceAttach'
55
import { FallbackableOverrides } from '../../common/utils/execute'
6-
import type { TransactionResponse } from 'ethers'
6+
import { TransactionResponse } from '@ethersproject/abstract-provider'
77

88
export type PolicyFactoryContract = {
99
readonly create: (

lib/ethereum/property-factory/createAndAuthenticate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable functional/no-expression-statement */
33
/* eslint-disable functional/no-conditional-statement */
44
/* eslint-disable functional/functional-parameters */
5-
import type { TransactionResponse } from 'ethers'
5+
import { TransactionResponse } from '@ethersproject/abstract-provider'
66
import { execute, FallbackableOverrides } from '../../common/utils/execute'
77
import { ContractRunner, ethers } from 'ethers'
88
import { getMetricsProperty, WaitForEventOptions } from '../market/authenticate'

lib/ethereum/property-factory/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ContractRunner, ethers } from 'ethers'
2-
import type { TransactionResponse } from 'ethers'
2+
import type { TransactionResponse } from '@ethersproject/abstract-provider'
33
import { propertyFactoryAbi } from './abi'
44
import { createCreatePropertyCaller } from './create'
55
import { WaitForEventOptions } from '../market/authenticate'

lib/ethereum/property/changeAuthor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateChangeAuthorCaller = (
1010
contract: ethers.Contract,

lib/ethereum/property/changeName.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateChangeNameCaller = (
1010
contract: ethers.Contract,

lib/ethereum/property/changeSymbol.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateChangeSymbolCaller = (
1010
contract: ethers.Contract,

lib/ethereum/property/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { createBalanceOfCaller } from '../../common/erc20/balanceOf'
1414
import { createApproveCaller } from '../../common/erc20/approve'
1515
import { createAllowanceCaller } from '../../common/erc20/allowance'
1616
import { FallbackableOverrides } from '../../common/utils/execute'
17-
import type { TransactionResponse } from 'ethers'
17+
import { TransactionResponse } from '@ethersproject/abstract-provider'
1818

1919
export type PropertyContract = {
2020
readonly totalSupply: () => Promise<string>

lib/ethereum/s-tokens/freezeTokenURI.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
FallbackableOverrides,
55
MutationOption,
66
} from '../../common/utils/execute'
7-
import type { TransactionResponse } from 'ethers'
7+
import { TransactionResponse } from '@ethersproject/abstract-provider'
88

99
export type CreateFreezeTokenURICaller = (
1010
contract: ethers.Contract,

lib/ethereum/s-tokens/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { createPositionsOfOwnerCaller } from './positionsOfOwner'
1313
import { createSetSTokenRoyaltyForPropertyCaller } from './setSTokenRoyaltyForProperty'
1414
import { createRoyaltyOfCaller } from './royaltyOf'
1515
import { createSetTokenURIDescriptorCaller } from './setTokenURIDescriptor'
16-
import type { TransactionResponse } from 'ethers'
16+
import { TransactionResponse } from '@ethersproject/abstract-provider'
1717
import { createTokenURISimCaller, TokenURISimProps } from './tokenURISim'
1818
import { FallbackableOverrides } from '../../common/utils/execute'
1919
import { createDescriptorOfCaller } from './descriptorOf'

lib/ethereum/s-tokens/setSTokenRoyaltyForProperty.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ethers } from 'ethers'
22
import { execute, MutationOption } from '../../common/utils/execute'
3-
import type { TransactionResponse } from 'ethers'
3+
import { TransactionResponse } from '@ethersproject/abstract-provider'
44

55
export type CreateSetSTokenRoyaltyForPropertyCaller = (
66
contract: ethers.Contract,

0 commit comments

Comments
 (0)