Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marielbamar21 committed Feb 20, 2024
1 parent 5311649 commit af61f2f
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 173 deletions.
1 change: 1 addition & 0 deletions src/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type Query {
getEstimatedAmount(amount: String! = "", from: String! = "", to: String! = ""): EstimatedAmount!
getPairTokensFromNativeCurrency(nativeCurrencies: [String!]! = []): GetPairTokens!
getTokens: Tokens!
getTokensToSwap: Tokens!
status: String!
version: String!
}
Expand Down
290 changes: 145 additions & 145 deletions src/stealthex/dtos/array-stealth-assets.ts
Original file line number Diff line number Diff line change
@@ -1,146 +1,146 @@
export const StealthAssets = [
{
name: 'DOT',
symbol: 'dot',
network: 'MAINNET',
image: 'https://icons.stealthex.io/coins-color/63513bce12b1be0018c984c5-dot_c.svg'
},
{
name: 'ASTR',
symbol: 'astr',
network: 'astr',
image: 'https://icons.stealthex.io/coins-color/6241a287f758390017e5d9fe-astr_c.png'
},
{
name: 'GLMR',
symbol: 'glmr',
network: 'glmr',
image: 'https://icons.stealthex.io/coins-color/6259ebc0422d1c0017b7626c-glmr_c.svg'
},
{
name: 'ACA',
symbol: 'aca',
network: 'aca',
image: 'https://icons.stealthex.io/coins-color/6231ca81f758390017e5d9d1-aca_c.svg'
},
{
name: 'KSM',
symbol: 'ksm',
network: 'POLKADOT',
image: 'https://icons.stealthex.io/coins-color/6299eafcde5ae50018e778ea-ksm_c.svg'
},
{
name: 'ETH',
symbol: 'eth',
network: 'eth',
image: 'https://icons.stealthex.io/coins-color/6255bcb6422d1c0017b74f5a-eth_c.svg'
},
{
name: 'DAI (ETH)',
symbol: 'dai',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/628bcef6de5ae50018e75e88-dai_c.svg'
},
{
name: 'USDC (ETH)',
symbol: 'usdc',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/6255cedb422d1c0017b75097-usdc_c.svg'
},
{
name: 'USDT (ETH)',
symbol: 'usdterc20',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/2bMdJS_-WIIf975c.svg'
},
{
name : 'WBTC (ETH)',
symbol: 'wbtc',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/62be0b9e64616f00188f26c6-wbtc_c.svg'
},
{
name: 'MATIC',
symbol: 'matic',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/62ff70ff613408001803f36d-matic color.svg'
},
{
name: 'DAI (Polygon)',
symbol: 'daimatic',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/62ed09c0266d52001847f7d5-daimatic_c.svg'
},
{
name: 'USDT (Polygon)',
symbol: 'usdtpoly',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/6287a9a9de5ae50018e7562a-usdtpoly_c.svg'
},
{
name: 'WBTC (POLYGON)',
symbol: 'wbtcmatic',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/632d8b7512b1be0018c96857-wbtcmatic_c.svg'
},
{
name: 'BNB',
symbol: 'bnb',
network: 'BEP2',
image: 'https://icons.stealthex.io/coins-color/625ea3c7422d1c0017b76ba4-bnb_c.svg'
},
{
name: 'BUSD',
symbol: 'bnbbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62596f5a422d1c0017b76175-bnb_c.svg'
},
{
name: 'DAI (BNB)',
symbol: 'daibsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/6319caaa4edfd60018c52512-daibsc_c.svg'
},
{
name: 'DOT (BNB)',
symbol: 'dotbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62505de09ea1790017f8f7e9-dotbsc_c.svg'
},
{
name: 'ETH (BNB)',
symbol: 'ethbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62505f509ea1790017f8f80a-ethbsc.svg'
},
{
name: 'MATIC (BNB)',
symbol: 'maticbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62e11cced4352d0018b117c4-maticbsc_c.svg'
},
{
name: 'USDT (BNB)',
symbol: 'usdtbep20',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/64db5279eca12500188d15a9-1BTIKzipAlV7RQDt.svg'
},
{
name: 'USDC (BNB)',
symbol: 'usdcbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62d99cad64616f00188f393b-usdcbsc_c.svg'
},
{
name: 'MOVR',
symbol: 'movr',
network: 'movr',
image: 'https://icons.stealthex.io/coins-color/629e2ddede5ae50018e77d88-movr_c.svg'
},
{
name: 'SDN',
symbol: 'sdn',
network: 'sdn',
image: 'https://icons.stealthex.io/coins-color/62a87c39de5ae50018e789e4-sdn_c.svg'
}
]
{
name: 'DOT',
symbol: 'dot',
network: 'MAINNET',
image: 'https://icons.stealthex.io/coins-color/63513bce12b1be0018c984c5-dot_c.svg',
},
{
name: 'ASTR',
symbol: 'astr',
network: 'astr',
image: 'https://icons.stealthex.io/coins-color/6241a287f758390017e5d9fe-astr_c.png',
},
{
name: 'GLMR',
symbol: 'glmr',
network: 'glmr',
image: 'https://icons.stealthex.io/coins-color/6259ebc0422d1c0017b7626c-glmr_c.svg',
},
{
name: 'ACA',
symbol: 'aca',
network: 'aca',
image: 'https://icons.stealthex.io/coins-color/6231ca81f758390017e5d9d1-aca_c.svg',
},
{
name: 'KSM',
symbol: 'ksm',
network: 'POLKADOT',
image: 'https://icons.stealthex.io/coins-color/6299eafcde5ae50018e778ea-ksm_c.svg',
},
{
name: 'ETH',
symbol: 'eth',
network: 'eth',
image: 'https://icons.stealthex.io/coins-color/6255bcb6422d1c0017b74f5a-eth_c.svg',
},
{
name: 'DAI (ETH)',
symbol: 'dai',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/628bcef6de5ae50018e75e88-dai_c.svg',
},
{
name: 'USDC (ETH)',
symbol: 'usdc',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/6255cedb422d1c0017b75097-usdc_c.svg',
},
{
name: 'USDT (ETH)',
symbol: 'usdterc20',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/2bMdJS_-WIIf975c.svg',
},
{
name: 'WBTC (ETH)',
symbol: 'wbtc',
network: 'ETH',
image: 'https://icons.stealthex.io/coins-color/62be0b9e64616f00188f26c6-wbtc_c.svg',
},
{
name: 'MATIC',
symbol: 'matic',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/62ff70ff613408001803f36d-matic color.svg',
},
{
name: 'DAI (Polygon)',
symbol: 'daimatic',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/62ed09c0266d52001847f7d5-daimatic_c.svg',
},
{
name: 'USDT (Polygon)',
symbol: 'usdtpoly',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/6287a9a9de5ae50018e7562a-usdtpoly_c.svg',
},
{
name: 'WBTC (POLYGON)',
symbol: 'wbtcmatic',
network: 'POLYGON',
image: 'https://icons.stealthex.io/coins-color/632d8b7512b1be0018c96857-wbtcmatic_c.svg',
},
{
name: 'BNB',
symbol: 'bnb',
network: 'BEP2',
image: 'https://icons.stealthex.io/coins-color/625ea3c7422d1c0017b76ba4-bnb_c.svg',
},
{
name: 'BUSD',
symbol: 'bnbbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62596f5a422d1c0017b76175-bnb_c.svg',
},
{
name: 'DAI (BNB)',
symbol: 'daibsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/6319caaa4edfd60018c52512-daibsc_c.svg',
},
{
name: 'DOT (BNB)',
symbol: 'dotbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62505de09ea1790017f8f7e9-dotbsc_c.svg',
},
{
name: 'ETH (BNB)',
symbol: 'ethbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62505f509ea1790017f8f80a-ethbsc.svg',
},
{
name: 'MATIC (BNB)',
symbol: 'maticbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62e11cced4352d0018b117c4-maticbsc_c.svg',
},
{
name: 'USDT (BNB)',
symbol: 'usdtbep20',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/64db5279eca12500188d15a9-1BTIKzipAlV7RQDt.svg',
},
{
name: 'USDC (BNB)',
symbol: 'usdcbsc',
network: 'BSC',
image: 'https://icons.stealthex.io/coins-color/62d99cad64616f00188f393b-usdcbsc_c.svg',
},
{
name: 'MOVR',
symbol: 'movr',
network: 'movr',
image: 'https://icons.stealthex.io/coins-color/629e2ddede5ae50018e77d88-movr_c.svg',
},
{
name: 'SDN',
symbol: 'sdn',
network: 'sdn',
image: 'https://icons.stealthex.io/coins-color/62a87c39de5ae50018e789e4-sdn_c.svg',
},
]
1 change: 0 additions & 1 deletion src/stealthex/dtos/get-pairs-tokens.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ export class GetPairTokens {
@Field(() => [Pairs])
pairs = []
}

28 changes: 14 additions & 14 deletions src/stealthex/stealhtex.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ export interface StealthExApiError {
message: string
}

// export interface StealthExToken {
// symbol: string
// has_extra_id: boolean
// extra_id: string
// name: string
// warnings_from: string[]
// warnings_to: string[]
// validation_address: string
// validation_extra: string
// address_explorer: string
// tx_explorer: string
// image: string
// network: string
// }
export interface StealthExToken {
symbol: string
has_extra_id: boolean
extra_id: string
name: string
warnings_from: string[]
warnings_to: string[]
validation_address: string
validation_extra: string
address_explorer: string
tx_explorer: string
image: string
network: string
}

export interface StealthExPairTokens {
asset: string
Expand Down
20 changes: 11 additions & 9 deletions src/stealthex/stealhtex.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { AxiosError, AxiosRequestConfig, AxiosResponse, Method } from 'axios'
import { InjectPinoLogger, PinoLogger } from 'nestjs-pino'
import { catchError, firstValueFrom } from 'rxjs'
import {
StealthExToken,
StealthExPairTokens,
StealthExEstimatedAmount,
StealthExMinimalAmount,
Expand Down Expand Up @@ -51,17 +52,18 @@ export class StealthExService {
),
)
}
// public async getTokens(): Promise<StealthExToken[]> {
// try {
// const { data } = await this.sendPetition<StealthExToken[]>('currency', 'get')

// return data
// } catch (err) {
// this.logger.error({ err }, 'Error getting tokens.')
public async getTokens(): Promise<StealthExToken[]> {
try {
const { data } = await this.sendPetition<StealthExToken[]>('currency', 'get')

return data
} catch (err) {
this.logger.error({ err }, 'Error getting tokens.')

// return []
// }
// }
return []
}
}

public async getPairTokensFromNativeCurrency(nativeCurrencies: string[]): Promise<StealthExPairTokens[]> {
try {
Expand Down
Loading

0 comments on commit af61f2f

Please sign in to comment.