Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ If you are using Linux and macOS it works out of the box following these steps:
5. Build Packages:

```sh
yarn build
yarn build:packages
```

6. Run `yarn env dev` to generate a `.env` file.
Expand Down
1 change: 1 addition & 0 deletions __mocks__/ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const ethers = {
...jest.requireActual('ethers').ethers,
providers: {
JsonRpcProvider: jest.fn(),
JsonRpcBatchProvider: jest.fn(),
},
Contract: jest.fn().mockImplementation(address => ({
decimals: () => {
Expand Down
20 changes: 0 additions & 20 deletions jest.config.js

This file was deleted.

35 changes: 32 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"embla-carousel-react": "^7.0.5",
"envalid": "^7.3.1",
"eth-url-parser": "^1.0.4",
"ethers": "^5.5.3",
"ethers": "^5.7.2",
"framer-motion": "^6.3.11",
"friendly-challenge": "0.9.2",
"grapheme-splitter": "^1.0.4",
Expand Down Expand Up @@ -272,6 +272,35 @@
"react-dom@^18.2.0": "patch:react-dom@npm%3A18.2.0#./.yarn/patches/react-dom-npm-18.2.0-dd675bca1c.patch"
},
"jest": {
"resetMocks": false
"preset": "ts-jest",
"testEnvironment": "node",
"testPathIgnorePatterns": [
"/node_modules/",
".d.ts",
".js",
"__mocks__",
"mockData"
],
"clearMocks": true,
"resetMocks": false,
"roots": [
"<rootDir>"
],
"collectCoverage": false,
"setupFiles": [
"<rootDir>/.jest/setup.js"
],
"moduleNameMapper": {
"^@shapeshiftoss\\/([^/ ]+)": [
"@shapeshiftoss/$1",
"@shapeshiftoss/$1/src"
]
},
"globals": {
"ts-jest": {
"sourceMap": true,
"isolatedModules": true
}
}
}
}
}
1 change: 0 additions & 1 deletion packages/asset-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"js-pixel-fonts": "^1.5.0"
},
"devDependencies": {
"@ethersproject/providers": "^5.5.3",
"@yfi/sdk": "^1.2.0",
"colorthief": "^2.3.2"
}
Expand Down
26 changes: 13 additions & 13 deletions packages/asset-service/src/generateAssetData/ethereum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { ethereum } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getIdleTokens } from './idleVaults'
import { getUniswapV2Pools } from './uniswapV2Pools'
import { getUnderlyingVaultTokens, getYearnVaults, getZapperTokens } from './yearnVaults'
// Yearn SDK is currently rugged upstream
// import { getUnderlyingVaultTokens, getYearnVaults, getZapperTokens } from './yearnVaults'

const foxyToken: Asset = {
assetId: toAssetId({
Expand All @@ -33,22 +34,21 @@ const foxyToken: Asset = {
}

export const getAssets = async (): Promise<Asset[]> => {
const [ethTokens, yearnVaults, zapperTokens, underlyingTokens, uniV2PoolTokens, idleTokens] =
await Promise.all([
coingecko.getAssets(ethChainId),
getYearnVaults(),
getZapperTokens(),
getUnderlyingVaultTokens(),
getUniswapV2Pools(),
getIdleTokens(),
])
const [ethTokens, uniV2PoolTokens, idleTokens] = await Promise.all([
coingecko.getAssets(ethChainId),
// getYearnVaults(),
// getZapperTokens(),
// getUnderlyingVaultTokens(),
getUniswapV2Pools(),
getIdleTokens(),
])

const ethAssets = [
foxyToken,
...ethTokens,
...yearnVaults,
...zapperTokens,
...underlyingTokens,
// ...yearnVaults,
// ...zapperTokens,
// ...underlyingTokens,
...uniV2PoolTokens,
...idleTokens,
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { JsonRpcProvider } from '@ethersproject/providers'
import { ethChainId as chainId, toAssetId } from '@shapeshiftoss/caip'
import type { Token, Vault } from '@yfi/sdk'
import { Yearn } from '@yfi/sdk'
import { ethers } from 'ethers'
import toLower from 'lodash/toLower'

import type { Asset } from '../../service/AssetService'
import { ethereum } from '../baseAssets'
import { colorMap } from '../colorMap'

const network = 1 // 1 for mainnet
const provider = new JsonRpcProvider(process.env.ETHEREUM_NODE_URL)
const provider = new ethers.providers.JsonRpcBatchProvider(process.env.ETHEREUM_NODE_URL)
export const yearnSdk = new Yearn(network, { provider })

const explorerData = {
Expand Down
4 changes: 2 additions & 2 deletions packages/caip/src/adapters/yearn/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @shapeshiftoss/logger/no-native-console */
import { JsonRpcProvider } from '@ethersproject/providers'
import type { Token, Vault } from '@yfi/sdk'
import { Yearn } from '@yfi/sdk'
import { ethers } from 'ethers'
import fs from 'fs'
import toLower from 'lodash/toLower'
import uniqBy from 'lodash/uniqBy'
Expand All @@ -11,7 +11,7 @@ import { toChainId } from '../../chainId/chainId'
import { CHAIN_NAMESPACE, CHAIN_REFERENCE } from '../../constants'

const network = 1 // 1 for mainnet
const provider = new JsonRpcProvider(process.env.REACT_APP_ETHEREUM_NODE_URL)
const provider = new ethers.providers.JsonRpcBatchProvider(process.env.REACT_APP_ETHEREUM_NODE_URL)
const yearnSdk = new Yearn(network, { provider })

export const writeFiles = async (data: Record<string, Record<string, string>>) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/chain-adapters/src/evm/EvmBaseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import type {
import { ValidAddressResultType } from '../types'
import {
chainIdToChainLabel,
convertNumberToHex,
getAssetNamespace,
toAddressNList,
toRootDerivationPath,
Expand Down Expand Up @@ -548,7 +547,7 @@ export abstract class EvmBaseAdapter<T extends EvmChainId> implements IChainAdap
const bip44Params = this.getBIP44Params({ accountNumber })
const txToSign = {
addressNList: toAddressNList(bip44Params),
value: convertNumberToHex(value),
value: numberToHex(value),
to,
chainId: Number(fromChainId(this.chainId).chainReference),
data,
Expand Down
5 changes: 1 addition & 4 deletions packages/investor-foxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
"cli": "yarn build && yarn node dist/foxycli.js"
},
"dependencies": {
"@ethersproject/providers": "^5.5.3",
"@shapeshiftoss/caip": "workspace:^",
"@shapeshiftoss/chain-adapters": "workspace:^",
"@shapeshiftoss/logger": "workspace:^",
"@shapeshiftoss/types": "workspace:^",
"readline-sync": "^1.4.10",
"web3-core": "1.7.4",
"web3-utils": "1.7.4"
"readline-sync": "^1.4.10"
},
"devDependencies": {
"@types/readline-sync": "^1.4.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/investor-foxy/src/abi/erc20-abi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AbiItem } from 'web3-utils'
import type { ContractInterface } from 'ethers'

export const erc20Abi: AbiItem[] = [
export const erc20Abi: ContractInterface = [
{
constant: true,
inputs: [],
Expand Down
4 changes: 2 additions & 2 deletions packages/investor-foxy/src/abi/foxy-abi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AbiItem } from 'web3-utils'
import type { ContractInterface } from 'ethers'

export const foxyAbi: AbiItem[] = [
export const foxyAbi: ContractInterface = [
{
inputs: [],
stateMutability: 'nonpayable',
Expand Down
4 changes: 2 additions & 2 deletions packages/investor-foxy/src/abi/foxy-staking-abi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AbiItem } from 'web3-utils'
import type { ContractInterface } from 'ethers'

export const foxyStakingAbi: AbiItem[] = [
export const foxyStakingAbi: ContractInterface = [
{
inputs: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/investor-foxy/src/abi/liquidity-reserve-abi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AbiItem } from 'web3-utils'
import type { ContractInterface } from 'ethers'

export const liquidityReserveAbi: AbiItem[] = [
export const liquidityReserveAbi: ContractInterface = [
{
inputs: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/investor-foxy/src/abi/toke-manager-abi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AbiItem } from 'web3-utils'
import type { ContractInterface } from 'ethers'

export const tokeManagerAbi: AbiItem[] = [
export const tokeManagerAbi: ContractInterface = [
{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
{
anonymous: false,
Expand Down
4 changes: 2 additions & 2 deletions packages/investor-foxy/src/abi/toke-pool-abi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AbiItem } from 'web3-utils'
import type { ContractInterface } from 'ethers'

export const tokePoolAbi: AbiItem[] = [
export const tokePoolAbi: ContractInterface = [
{
anonymous: false,
inputs: [
Expand Down
4 changes: 2 additions & 2 deletions packages/investor-foxy/src/abi/toke-reward-hash-abi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AbiItem } from 'web3-utils'
import type { ContractInterface } from 'ethers'

export const tokeRewardHashAbi: AbiItem[] = [
export const tokeRewardHashAbi: ContractInterface = [
{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
{
anonymous: false,
Expand Down
Loading