Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ether v6 support #182

Merged
merged 24 commits into from
Nov 12, 2024
Merged

Feat/ether v6 support #182

merged 24 commits into from
Nov 12, 2024

Conversation

Velenir
Copy link
Member

@Velenir Velenir commented Nov 5, 2024

Add ethers@6 support, separate and alongside ethers@5

ethers@6 is installed as an alias to avoid conflicts with ethers@5. The other way round, ethers@5 as an alias because it's easier to import from @ethersproject/* when SDK is installed as a lib. Otherwise some types are not available (depending on which perrDependencies are used)
One drawback of such approach is that it won't always be deduplicated when SDK is installed as a library in a project. But that's alright, because we import types only, not the whole lib

Copy link

github-actions bot commented Nov 5, 2024

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 13.64 KB (+2.36% 🔺)
dist/sdk.esm.js 13.61 KB (+2.25% 🔺)

@@ -261,7 +262,33 @@ function constructSimpleContractCaller(
staticCall,
transactCall: _transactCall,
signTypedDataCall,
} = constructEthersContractCaller(providerOptions, providerOptions.account);
} = constructEthersV5ContractCaller(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make any sense if we rename providerOptions.ethersProviderOrSigner to ethersV5ProviderOrSigner to follow the convention?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it would be a breaking change. Don't wanna

const walletV6Stable = ethersV6.HDNodeWallet.fromPhrase(TEST_MNEMONIC);
const walletV6Stable2 = ethersV6.HDNodeWallet.fromPhrase(
TEST_MNEMONIC,
"m/44'/60'/0'/0/1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Derivation path must be third param if you want to specify it.
If not - ethers will use the one with index 0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good eye.
Fixed

@Velenir Velenir merged commit 2613e3b into feat/web3_upgrade Nov 12, 2024
2 checks passed
@Velenir Velenir deleted the feat/etherV6_support branch November 12, 2024 13:30
Velenir added a commit that referenced this pull request Nov 12, 2024
* update some deps

* hadrhat config/smaller default baseFee

* NFT tests/workaround edge case

* update web3 dep

* update Web3 types

* update web3/constructContractCaller

* legacy/update types

* hardhat config/fixed accounts

* LOrder tests/reenable sign with web3

* NFT Order tests/reenable sign with web3

* getBalance tests workaround

* cleanup

* update some deps

* update snapshots

* update perrDeps

* update required Node v

* NFT tests/account for dust

* hadrhat config/lower initialBaseFeePerGas

* Feat/ether v6 support (#182)

* install ethersV6 as alias

* providers/ethersV6

* distinct ethersV5 exports

* legacy/support ethersV6

* simple SDK/support ethersV6

* simpleSDK.tests/add ethersV6

* partialSDK.tests/add ethersV6

* LOrders.tests/add ethersV6

* NFT_Orders.tests/add ethersV6

* update snapshots

* examples/ add ethersV6

* perrDeps/update ethers versions

* update snapshots

* cleanup

* move ethers types to provider/ethers

* move web3 types to provider/web3

* untie FetchError type from AxiosError

* ethers -> ethersV5, ethersV6 -> ethers to fix types when used as lib

* cleanup

* README/update version

* less dependency on ethers types

* update README

* rremove temp tests

* tests/ethersV6/fix derivation path arg position
Velenir added a commit that referenced this pull request Nov 12, 2024
* update some deps

* replace ganache with hardhat

* remove ganache

* fix chainId in tests mismatch

* try with tevm

* tevm test

* add hardhat-switch-network plugin

* simplify hardhat helpers

* make tests work with hardhat

* fix method name

* disable web3 tests that break with hardhat

* fix NFT tests

* remove tevm

* hardhat config/explicit gasPrice

* NFT tests/adjust amounts

* cleanup

* remove temp tests

* update some deps

* NFT tests/workaround some errors

* update ethers dep

* update web3 dep(slightly)

* update deps

* override some deps

* Feat/web3 upgrade (#181)

* update some deps

* hadrhat config/smaller default baseFee

* NFT tests/workaround edge case

* update web3 dep

* update Web3 types

* update web3/constructContractCaller

* legacy/update types

* hardhat config/fixed accounts

* LOrder tests/reenable sign with web3

* NFT Order tests/reenable sign with web3

* getBalance tests workaround

* cleanup

* update some deps

* update snapshots

* update perrDeps

* update required Node v

* NFT tests/account for dust

* hadrhat config/lower initialBaseFeePerGas

* Feat/ether v6 support (#182)

* install ethersV6 as alias

* providers/ethersV6

* distinct ethersV5 exports

* legacy/support ethersV6

* simple SDK/support ethersV6

* simpleSDK.tests/add ethersV6

* partialSDK.tests/add ethersV6

* LOrders.tests/add ethersV6

* NFT_Orders.tests/add ethersV6

* update snapshots

* examples/ add ethersV6

* perrDeps/update ethers versions

* update snapshots

* cleanup

* move ethers types to provider/ethers

* move web3 types to provider/web3

* untie FetchError type from AxiosError

* ethers -> ethersV5, ethersV6 -> ethers to fix types when used as lib

* cleanup

* README/update version

* less dependency on ethers types

* update README

* rremove temp tests

* tests/ethersV6/fix derivation path arg position
Velenir added a commit that referenced this pull request Nov 12, 2024
* abstract away providers/findPrimaryType

* add TransactionParams.maxFeeGas params

* providers/viem

* export from providers/viem

* DEFAULT_VERSION better type

* add wagmi & viem deps

* SimpleSDK/viem for contractCaller

* examples/viem

* cleanup

* examples/wagmi

* tests/fix types

* examples/fix types

* tests/fix types

* viem/fix account usage

* examples/viem/fix account usage

* types/TxHash=Hex

* add hardhat

* legacy/fix types

* ignore cache files

* some tests

* tsconfig/allow BigInt short notation

* providers/viem/reuse account

* viem/fix tests

* tests/viem/remove extra

* tests/viem/Order signing

* rename stuff

* cleanup

* reenable tests

* tests/viem/const acc

* tests/viem/update snapshots

* reexport txParamsToViemTxParams

* tests/viem/update snapshots

* more comments

* cleanup

* remove extra deps

* moved bignumber.js to devDeps

* cleanup

* update tests jpeg

* update README

* update snapshots

* FetcherError/fix types

* viem test/market swap

* fix deps

* update deps

* update snapshots

* remove dummy test

* change default version

* Feat/deps update/tests migration (#180)

* update some deps

* replace ganache with hardhat

* remove ganache

* fix chainId in tests mismatch

* try with tevm

* tevm test

* add hardhat-switch-network plugin

* simplify hardhat helpers

* make tests work with hardhat

* fix method name

* disable web3 tests that break with hardhat

* fix NFT tests

* remove tevm

* hardhat config/explicit gasPrice

* NFT tests/adjust amounts

* cleanup

* remove temp tests

* update some deps

* NFT tests/workaround some errors

* update ethers dep

* update web3 dep(slightly)

* update deps

* override some deps

* Feat/web3 upgrade (#181)

* update some deps

* hadrhat config/smaller default baseFee

* NFT tests/workaround edge case

* update web3 dep

* update Web3 types

* update web3/constructContractCaller

* legacy/update types

* hardhat config/fixed accounts

* LOrder tests/reenable sign with web3

* NFT Order tests/reenable sign with web3

* getBalance tests workaround

* cleanup

* update some deps

* update snapshots

* update perrDeps

* update required Node v

* NFT tests/account for dust

* hadrhat config/lower initialBaseFeePerGas

* Feat/ether v6 support (#182)

* install ethersV6 as alias

* providers/ethersV6

* distinct ethersV5 exports

* legacy/support ethersV6

* simple SDK/support ethersV6

* simpleSDK.tests/add ethersV6

* partialSDK.tests/add ethersV6

* LOrders.tests/add ethersV6

* NFT_Orders.tests/add ethersV6

* update snapshots

* examples/ add ethersV6

* perrDeps/update ethers versions

* update snapshots

* cleanup

* move ethers types to provider/ethers

* move web3 types to provider/web3

* untie FetchError type from AxiosError

* ethers -> ethersV5, ethersV6 -> ethers to fix types when used as lib

* cleanup

* README/update version

* less dependency on ethers types

* update README

* rremove temp tests

* tests/ethersV6/fix derivation path arg position
Velenir added a commit that referenced this pull request Nov 12, 2024
* update build dependencies

* update tsconfig

* actions/remove Node18

* fix types

* extra gitignore

* update typedoc deps

* update snapshots

* fix dependencies

* Feat/viem support (#174)

* abstract away providers/findPrimaryType

* add TransactionParams.maxFeeGas params

* providers/viem

* export from providers/viem

* DEFAULT_VERSION better type

* add wagmi & viem deps

* SimpleSDK/viem for contractCaller

* examples/viem

* cleanup

* examples/wagmi

* tests/fix types

* examples/fix types

* tests/fix types

* viem/fix account usage

* examples/viem/fix account usage

* types/TxHash=Hex

* add hardhat

* legacy/fix types

* ignore cache files

* some tests

* tsconfig/allow BigInt short notation

* providers/viem/reuse account

* viem/fix tests

* tests/viem/remove extra

* tests/viem/Order signing

* rename stuff

* cleanup

* reenable tests

* tests/viem/const acc

* tests/viem/update snapshots

* reexport txParamsToViemTxParams

* tests/viem/update snapshots

* more comments

* cleanup

* remove extra deps

* moved bignumber.js to devDeps

* cleanup

* update tests jpeg

* update README

* update snapshots

* FetcherError/fix types

* viem test/market swap

* fix deps

* update deps

* update snapshots

* remove dummy test

* change default version

* Feat/deps update/tests migration (#180)

* update some deps

* replace ganache with hardhat

* remove ganache

* fix chainId in tests mismatch

* try with tevm

* tevm test

* add hardhat-switch-network plugin

* simplify hardhat helpers

* make tests work with hardhat

* fix method name

* disable web3 tests that break with hardhat

* fix NFT tests

* remove tevm

* hardhat config/explicit gasPrice

* NFT tests/adjust amounts

* cleanup

* remove temp tests

* update some deps

* NFT tests/workaround some errors

* update ethers dep

* update web3 dep(slightly)

* update deps

* override some deps

* Feat/web3 upgrade (#181)

* update some deps

* hadrhat config/smaller default baseFee

* NFT tests/workaround edge case

* update web3 dep

* update Web3 types

* update web3/constructContractCaller

* legacy/update types

* hardhat config/fixed accounts

* LOrder tests/reenable sign with web3

* NFT Order tests/reenable sign with web3

* getBalance tests workaround

* cleanup

* update some deps

* update snapshots

* update perrDeps

* update required Node v

* NFT tests/account for dust

* hadrhat config/lower initialBaseFeePerGas

* Feat/ether v6 support (#182)

* install ethersV6 as alias

* providers/ethersV6

* distinct ethersV5 exports

* legacy/support ethersV6

* simple SDK/support ethersV6

* simpleSDK.tests/add ethersV6

* partialSDK.tests/add ethersV6

* LOrders.tests/add ethersV6

* NFT_Orders.tests/add ethersV6

* update snapshots

* examples/ add ethersV6

* perrDeps/update ethers versions

* update snapshots

* cleanup

* move ethers types to provider/ethers

* move web3 types to provider/web3

* untie FetchError type from AxiosError

* ethers -> ethersV5, ethersV6 -> ethers to fix types when used as lib

* cleanup

* README/update version

* less dependency on ethers types

* update README

* rremove temp tests

* tests/ethersV6/fix derivation path arg position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants