-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Showing
31 changed files
with
975 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import axios from 'axios'; | ||
import { ethers } from 'ethers'; | ||
import { | ||
constructPartialSDK, | ||
constructFullSDK, | ||
constructGetAdapters, | ||
constructEthersV6ContractCaller, | ||
constructAxiosFetcher, | ||
} from '..'; | ||
|
||
const fetcher = constructAxiosFetcher(axios); | ||
|
||
const provider = ethers.getDefaultProvider(1); | ||
const contractCaller = constructEthersV6ContractCaller({ | ||
ethersV6ProviderOrSigner: provider, | ||
EthersV6Contract: ethers.Contract, | ||
}); | ||
|
||
const paraswap = constructFullSDK({ | ||
chainId: 1, | ||
fetcher, | ||
contractCaller, | ||
}); | ||
|
||
const res = paraswap.swap.getAdapters(); | ||
|
||
// type Promise<ContractTransaction> | ||
const txResponse = paraswap.swap.approveToken('1', '0x...'); | ||
// type Promise<ContractTransaction[]> | ||
const txResponses = paraswap.swap.approveTokenBulk('1', ['0x...']); | ||
|
||
const partial = constructPartialSDK( | ||
{ apiURL: '', chainId: 1, fetcher }, | ||
constructGetAdapters | ||
); | ||
|
||
const res1 = partial.getAdapters(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.