Skip to content

Commit

Permalink
chore: deprecate sdk-ui-ts & token-metadata package
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRalee committed Jun 13, 2024
1 parent 0cbf5f7 commit ad07526
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 172 deletions.
18 changes: 0 additions & 18 deletions layer/Service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { TokenPrice, TokenService } from '@injectivelabs/sdk-ui-ts'
import {
DenomClient,
ChainGrpcGovApi,
Expand Down Expand Up @@ -29,18 +28,15 @@ import {
IndexerRestDerivativesChronosApi
} from '@injectivelabs/sdk-ts'
import { Alchemy, Network as AlchemyNetwork } from 'alchemy-sdk'
import { TokenMetaUtilsFactory } from '@injectivelabs/token-metadata'
import {
NETWORK,
CHAIN_ID,
ENDPOINTS,
IS_MAINNET,
ALCHEMY_KEY,
COINGECKO_KEY,
MITO_API_ENDPOINT,
ALCHEMY_SEPOLIA_KEY
} from './utils/constant'
import { alchemyRpcEndpoint } from './wallet/alchemy'
import { InjNameService } from './services/nameService'
import { InjBonfidaNameService } from './services/bonfida'
import { SpotCacheApi } from './providers/cacheApi/spot'
Expand Down Expand Up @@ -107,18 +103,6 @@ export const denomClient = new DenomClient(NETWORK)

export const pythService = new PythService()

export const tokenService = new TokenService({
chainId: CHAIN_ID,
network: NETWORK,
alchemyRpcUrl: alchemyRpcEndpoint
})
export const tokenPrice = new TokenPrice(NETWORK, {
apiKey: COINGECKO_KEY as string,
baseUrl: COINGECKO_KEY
? 'https://pro-api.coingecko.com/api/v3'
: 'https://api.coingecko.com/api/v3'
})

export const tokenPriceService = new TokenPriceService(NETWORK, {
apiKey: COINGECKO_KEY as string,
baseUrl: COINGECKO_KEY
Expand All @@ -139,8 +123,6 @@ export const injBonfidaNameService = new InjBonfidaNameService(NETWORK)

export const sharedTokenClient = new SharedTokenClient()

export const tokenMetaUtils = TokenMetaUtilsFactory.make(NETWORK)

export const alchemyClient = IS_MAINNET
? new Alchemy({
apiKey: ALCHEMY_KEY,
Expand Down
2 changes: 1 addition & 1 deletion layer/data/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
TokenType,
TokenStatic,
TokenVerification
} from '@injectivelabs/token-metadata'
} from '@injectivelabs/sdk-ts'
import {
INJ_DENOM,
INJ_LOGO_URL,
Expand Down
2 changes: 0 additions & 2 deletions layer/providers/cacheApi/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import axios, { AxiosInstance } from 'axios'
import { Pagination, TotalSupply } from '@injectivelabs/sdk-ts'
import { bankApi } from '../../Service'

export class BaseCacheApi {
client: AxiosInstance
Expand Down
2 changes: 1 addition & 1 deletion layer/providers/cacheApi/spot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SpotMarket, AllChronosSpotMarketSummary } from '@injectivelabs/sdk-ts'
import { BaseCacheApi } from './base'
import { indexerRestSpotChronosApi, indexerSpotApi } from '../../Service'
import { IS_MAINNET } from './../../utils/constant'
import { indexerRestSpotChronosApi, indexerSpotApi } from '../../Service'

export class SpotCacheApi extends BaseCacheApi {
async fetchMarkets() {
Expand Down
6 changes: 2 additions & 4 deletions layer/services/tokenClient.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import {
Metadata,
TokenType,
TokenStatic,
TokenVerification
} from '@injectivelabs/token-metadata'
import {
Metadata,
ContractInfo,
InsuranceFund,
TokenVerification,
isCw20ContractAddress,
ContractStateWithPagination
} from '@injectivelabs/sdk-ts'
Expand Down
7 changes: 5 additions & 2 deletions layer/transformer/explorer/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { CW20BalanceExplorerApiResponse } from '@injectivelabs/sdk-ts'
import { TokenType, TokenVerification } from '@injectivelabs/token-metadata'
import {
TokenType,
TokenVerification,
CW20BalanceExplorerApiResponse
} from '@injectivelabs/sdk-ts'
import { unknownToken } from '../../data/token'
import { SharedBalanceWithToken } from '../../types'

Expand Down
3 changes: 2 additions & 1 deletion layer/transformer/market/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {
TokenType,
SpotMarket,
TokenStatic,
PerpetualMarket,
BinaryOptionsMarket,
ExpiryFuturesMarket
} from '@injectivelabs/sdk-ts'
import { TokenType, TokenStatic } from '@injectivelabs/token-metadata'
import {
sharedToBalanceInWei,
sharedGetTensMultiplier,
Expand Down
2 changes: 1 addition & 1 deletion layer/types/market.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
SpotMarket,
TokenStatic,
PerpetualMarket,
ExpiryFuturesMarket,
BinaryOptionsMarket,
AllChronosDerivativeMarketSummary
} from '@injectivelabs/sdk-ts'
import { TokenStatic } from '@injectivelabs/token-metadata'
import { SharedMarketType, SharedMarketChange } from './enum'

export interface SharedUiSpotMarket
Expand Down
2 changes: 1 addition & 1 deletion layer/types/token.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TokenStatic } from '@injectivelabs/token-metadata'
import { TokenStatic } from '@injectivelabs/sdk-ts'

export interface SharedDropdownOptionWithToken {
value: string
Expand Down
2 changes: 1 addition & 1 deletion layer/utils/ibc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TokenStatic, TokenType } from '@injectivelabs/token-metadata'
import { TokenStatic, TokenType } from '@injectivelabs/sdk-ts'
import {
canonicalChannelIds,
canonicalChannelsToChainList
Expand Down
3 changes: 3 additions & 0 deletions shared-packages/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dependencies
node_modules

41 changes: 28 additions & 13 deletions shared-packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,40 @@
"version": "1.0.0",
"description": "A repo that abstract a list of dependencies shared amount different products",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@injectivelabs/token-utils": "1.14.11-beta.11",
"@injectivelabs/utils": "1.14.11-beta.10",
"@injectivelabs/networks": "1.14.11-beta.13",
"@injectivelabs/sdk-ts": "1.14.11-beta.87",
"@injectivelabs/sdk-ui-ts": "1.14.11-beta.112",
"@injectivelabs/token-metadata": "1.14.11-beta.62",
"@injectivelabs/wallet-ts": "1.14.11-beta.101",
"@vuepic/vue-datepicker": "^5.4.0",
"@bangjelkoski/ens-validation": "^0.1.1",
"@injectivelabs/networks": "1.14.12-beta.0",
"@injectivelabs/nuxt-bugsnag": "0.0.3",
"@injectivelabs/sdk-ts": "1.14.12-beta.2",
"@injectivelabs/sdk-ui-ts": "1.14.12-beta.2",
"@injectivelabs/token-metadata": "1.14.12-beta.0",
"@injectivelabs/token-utils": "1.14.12-beta.0",
"@injectivelabs/ts-types": "1.14.12-beta.0",
"@injectivelabs/utils": "1.14.12-beta.0",
"@injectivelabs/wallet-ts": "1.14.12-beta.2",
"@types/canvas-confetti": "^1.6.4",
"@vuepic/vue-datepicker": "^5.4.0",
"@vueuse/integrations": "^10.7.1",
"nuxt-lcp-speedup": "^0.5.2",
"canvas-confetti": "^1.6.0",
"floating-vue": "2.0.0-beta.24",
"js-confetti": "^0.12.0",
"nuxt-lcp-speedup": "^0.5.2",
"vee-validate": "4.11.7",
"vue-gtag": "^2.0.1",
"vue-hotjar": "^1.4.0",
"vue-imask": "^7.5.0",
"vee-validate": "4.11.7"
"vue-imask": "^7.5.0"
},
"resolutions": {
"@ledgerhq/devices": "6.27.1",
"@ledgerhq/errors": "6.16.3",
"@ledgerhq/hw-transport": "6.27.1",
"@ledgerhq/hw-transport-webhid": "6.27.1"
},
"author": "",
"license": "MIT"
"overrides": {
"@ledgerhq/devices": "6.27.1",
"@ledgerhq/errors": "6.16.3",
"@ledgerhq/hw-transport": "6.27.1",
"@ledgerhq/hw-transport-webhid": "6.27.1"
}
}
Loading

0 comments on commit ad07526

Please sign in to comment.