Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5422 from NavneethJayendran/defira-connector
feat/Add Defira connector
- Loading branch information
Showing
30 changed files
with
2,536 additions
and
17 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
10 changes: 10 additions & 0 deletions
10
gateway/manual-tests/requests/harmony_testnet_defira_trade.json
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,10 @@ | ||
{ | ||
"address": "$ETH_ADDRESS", | ||
"quote": "1ETH", | ||
"base": "WONE74", | ||
"amount": "0.01", | ||
"side": "SELL", | ||
"chain": "harmony", | ||
"network": "testnet", | ||
"connector": "defira" | ||
} |
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,9 @@ | ||
{ | ||
"connector": "defira", | ||
"chain": "harmony", | ||
"network": "mainnet", | ||
"quote": "USDC", | ||
"base": "FIRA", | ||
"amount": "0.1", | ||
"side": "SELL" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"name": "Defira Token List", | ||
"logoURI": "https://sushi.com/static/media/logo.dec926df.png", | ||
"version": { | ||
"major": 0, | ||
"minor": 1, | ||
"patch": 1 | ||
}, | ||
"keywords": [], | ||
"timestamp": "2022-01-30T00:00:00+00:00", | ||
"tokens": [ | ||
{ | ||
"chainId": 1666600000, | ||
"name": "Staked One", | ||
"address": "0x22D62b19b7039333ad773b7185BB61294F3AdC19", | ||
"symbol": "stONE", | ||
"decimals": 18, | ||
"logoURI": "https://raw.githubusercontent.com/sushiswap/assets/master/blockchains/harmony/assets/0x22D62b19b7039333ad773b7185BB61294F3AdC19/logo.png" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"name": "Wrapped ONE", | ||
"address": "0xcF664087a5bB0237a0BAd6742852ec6c8d69A27a", | ||
"symbol": "WONE", | ||
"decimals": 18, | ||
"logoURI": "https://raw.githubusercontent.com/sushiswap/icons/master/token/one.jpg" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"name": "Dai Stablecoin", | ||
"address": "0xEf977d2f931C1978Db5F6747666fa1eACB0d0339", | ||
"symbol": "1DAI", | ||
"decimals": 18, | ||
"logoURI": "https://raw.githubusercontent.com/sushiswap/icons/master/token/dai.jpg" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"name": "Tether USDT", | ||
"address": "0x3C2B8Be99c50593081EAA2A724F0B8285F5aba8f", | ||
"symbol": "1USDT", | ||
"decimals": 6, | ||
"logoURI": "https://raw.githubusercontent.com/sushiswap/icons/master/token/usdt.jpg" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"name": "1ETH", | ||
"address": "0x6983D1E6DEf3690C4d616b13597A09e6193EA013", | ||
"symbol": "1ETH", | ||
"decimals": 18, | ||
"logoURI": "https://raw.githubusercontent.com/sushiswap/icons/master/token/eth.jpg" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"name": "Wrapped BTC", | ||
"address": "0x3095c7557bCb296ccc6e363DE01b760bA031F2d9", | ||
"symbol": "1WBTC", | ||
"decimals": 18, | ||
"logoURI": "" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"address": "0xdc54046c0451f9269FEe1840aeC808D36015697d", | ||
"symbol": "1BTC", | ||
"name": "1BTC", | ||
"decimals": 8, | ||
"logoURI": "https://raw.githubusercontent.com/sushiswap/assets/master/blockchains/harmony/assets/0xdc54046c0451f9269FEe1840aeC808D36015697d/logo.png" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"address": "0xE176EBE47d621b984a73036B9DA5d834411ef734", | ||
"symbol": "BUSD", | ||
"name": "Binance USD", | ||
"decimals": 18, | ||
"logoURI": "https://raw.githubusercontent.com/sushiswap/icons/master/token/busd.jpg" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"address": "0x2A719aF848bf365489E548BE5edbEC1D65858e59", | ||
"symbol": "FIRA", | ||
"name": "Fira", | ||
"decimals": 18, | ||
"logoURI": "https://d2w69usg89gc0q.cloudfront.net/tokens/FIRA.png" | ||
}, | ||
{ | ||
"chainId": 1666600000, | ||
"address": "0xCf1709Ad76A79d5a60210F23e81cE2460542A836", | ||
"symbol": "TRANQ", | ||
"name": "Tranquil", | ||
"decimals": 18, | ||
"logoURI": "https://d2w69usg89gc0q.cloudfront.net/tokens/TRANQ.png" | ||
} | ||
] | ||
} |
29 changes: 29 additions & 0 deletions
29
gateway/src/chains/harmony/harmony_tokens_defira_testnet.json
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,29 @@ | ||
{ | ||
"name": "Defira Token List", | ||
"logoURI": "https://sushi.com/static/media/logo.dec926df.png", | ||
"version": { | ||
"major": 0, | ||
"minor": 1, | ||
"patch": 1 | ||
}, | ||
"keywords": [], | ||
"timestamp": "2022-01-30T00:00:00+00:00", | ||
"tokens": [ | ||
{ | ||
"chainId": 1666700000, | ||
"name": "OneETH", | ||
"address": "0x1E120B3b4aF96e7F394ECAF84375b1C661830013", | ||
"symbol": "1ETH", | ||
"decimals": 18, | ||
"logoURI": "https://assets.coingecko.com/coins/images/279/small/ethereum.png" | ||
}, | ||
{ | ||
"chainId": 1666700000, | ||
"name": "Wrapped ONE", | ||
"address": "0x7466d7d0C21Fa05F32F5a0Fa27e12bdC06348Ce2", | ||
"symbol": "WONE74", | ||
"decimals": 18, | ||
"logoURI": "https://assets.coingecko.com/coins/images/4344/small/Y88JAze.png" | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { ConfigManagerV2 } from '../../services/config-manager-v2'; | ||
import { AvailableNetworks } from '../../services/config-manager-types'; | ||
export namespace DefiraConfig { | ||
export interface NetworkConfig { | ||
allowedSlippage: () => string; | ||
gasLimitEstimate: () => number; | ||
ttl: () => number; | ||
routerAddress: (network: string) => string; | ||
initCodeHash: (network: string) => string; | ||
tradingTypes: Array<string>; | ||
availableNetworks: Array<AvailableNetworks>; | ||
} | ||
|
||
export const config: NetworkConfig = { | ||
allowedSlippage: () => | ||
ConfigManagerV2.getInstance().get(`defira.allowedSlippage`), | ||
gasLimitEstimate: () => | ||
ConfigManagerV2.getInstance().get(`defira.gasLimitEstimate`), | ||
ttl: () => ConfigManagerV2.getInstance().get(`defira.ttl`), | ||
routerAddress: (network: string) => | ||
ConfigManagerV2.getInstance().get( | ||
`defira.contractAddresses.${network}.routerAddress` | ||
), | ||
initCodeHash: (network: string) => | ||
ConfigManagerV2.getInstance().get( | ||
`defira.contractAddresses.${network}.initCodeHash` | ||
), | ||
tradingTypes: ['EVM_AMM'], | ||
availableNetworks: [ | ||
{ | ||
chain: 'harmony', | ||
networks: ['mainnet', 'testnet'], | ||
}, | ||
], | ||
}; | ||
} |
Oops, something went wrong.