-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add token with ASA price COR-22
- Loading branch information
tiendn
committed
Aug 14, 2023
1 parent
2b35226
commit 0ba4bd3
Showing
14 changed files
with
128 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,5 @@ jobs: | |
NEXT_PUBLIC_TITLE=Astra Explorer Testnet | ||
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-VXSKSRXRLJ | ||
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/2 | ||
NEXT_PUBLIC_ENV=testnet | ||
NEXT_PUBLIC_ENV=testnet | ||
NEXT_PUBLIC_WASA_ADDRESS=0xA625BF1c3565775B1859B579DF980Fef324E7315 |
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 |
---|---|---|
|
@@ -26,3 +26,4 @@ jobs: | |
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-1KW22EJBY5 | ||
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/2 | ||
NEXT_PUBLIC_ENV=mainnet | ||
NEXT_PUBLIC_WASA_ADDRESS=0x6637D8275DC58983Cb3A2fa64b705EC11f6EC670 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { createApi } from '@reduxjs/toolkit/query/react' | ||
import { getBaseQuery } from 'utils/basequery' | ||
|
||
export interface TokenPriceResponse { | ||
result: { | ||
price: string | ||
blockTimestampLast: string | ||
} | ||
} | ||
|
||
export const tokenApi = createApi({ | ||
reducerPath: 'token', | ||
baseQuery: getBaseQuery(), | ||
endpoints: builder => ({ | ||
// update | ||
getTokenPrice: builder.query<TokenPriceResponse, { pair: string }>({ | ||
query: ({ pair }) => ({ | ||
url: `/token-price/${pair}`, | ||
method: 'GET' | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
export const { useGetTokenPriceQuery } = tokenApi |
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,8 @@ | ||
/* eslint-disable import/no-cycle */ | ||
import { fetchBaseQuery } from '@reduxjs/toolkit/dist/query' | ||
|
||
export const getBaseQuery = (baseUrl?: string): ReturnType<typeof fetchBaseQuery> => { | ||
return fetchBaseQuery({ | ||
baseUrl: baseUrl || `${process.env.NEXT_PUBLIC_COSMOS_API}/api/v1` | ||
}) | ||
} |
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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { Token } from '@solarswap/sdk' | ||
|
||
export const CONFIG = { | ||
APPROXIMATE_ZERO: 10 ** -6, | ||
TXS_MOBILE_SPLIT_LENGTH: 12, | ||
TXS_DESKTOP_SPLIT_LENGTH: 16 | ||
} | ||
export const LIMIT_PER_PAGE = 10 | ||
|
||
export const CHAIN_ID = parseInt(process.env.NEXT_PUBLIC_CHAIN_ID) || 11115 | ||
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' | ||
export const LIMIT_PER_PAGE = 10 | ||
export const WASA_ADDRESS = process.env.NEXT_PUBLIC_WASA_ADDRESS | ||
export const WASA_TOKEN = new Token(CHAIN_ID, WASA_ADDRESS, 18, 'WASA', 'WASA') |
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 |
---|---|---|
|
@@ -2876,6 +2876,18 @@ | |
dependencies: | ||
"@sinonjs/commons" "^2.0.0" | ||
|
||
"@solarswap/sdk@^1.0.12": | ||
version "1.0.12" | ||
resolved "https://registry.yarnpkg.com/@solarswap/sdk/-/sdk-1.0.12.tgz#3b84dbd6b9e938b363d8c7f4198b7a23f5e29517" | ||
integrity sha512-lyf+rG5tztBWnwJFkwCLwT/wqSL5Fb0MbvqyHRvYiJ+xQHlkzfuiyn9ButyVaGJE+iQr0yamRyLX7/DQ2Y5teg== | ||
dependencies: | ||
big.js "^5.2.2" | ||
decimal.js-light "^2.5.0" | ||
jsbi "^3.1.4" | ||
tiny-invariant "^1.1.0" | ||
tiny-warning "^1.0.3" | ||
toformat "^2.0.0" | ||
|
||
"@svgr/babel-plugin-add-jsx-attribute@^6.5.1": | ||
version "6.5.1" | ||
resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-6.5.1.tgz#74a5d648bd0347bda99d82409d87b8ca80b9a1ba" | ||
|
@@ -3983,6 +3995,11 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.36.tgz#78631076265d4ae3555c04f85e7d9d2f3a071a36" | ||
integrity sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg== | ||
|
||
big.js@^5.2.2: | ||
version "5.2.2" | ||
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" | ||
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== | ||
|
||
bignumber.js@^9.0.0, bignumber.js@^9.1.0: | ||
version "9.1.1" | ||
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" | ||
|
@@ -5057,6 +5074,11 @@ decamelize@^1.1.0: | |
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" | ||
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== | ||
|
||
decimal.js-light@^2.5.0: | ||
version "2.5.1" | ||
resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" | ||
integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== | ||
|
||
decimal.js@^10.4.2: | ||
version "10.4.3" | ||
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" | ||
|
@@ -7894,6 +7916,11 @@ js-yaml@^4.1.0: | |
dependencies: | ||
argparse "^2.0.1" | ||
|
||
jsbi@^3.1.4: | ||
version "3.2.5" | ||
resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" | ||
integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== | ||
|
||
jsbn@~0.1.0: | ||
version "0.1.1" | ||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" | ||
|
@@ -11694,11 +11721,21 @@ timed-out@^4.0.1: | |
resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" | ||
integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== | ||
|
||
tiny-invariant@^1.1.0: | ||
version "1.3.1" | ||
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.1.tgz#8560808c916ef02ecfd55e66090df23a4b7aa642" | ||
integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw== | ||
|
||
tiny-relative-date@^1.3.0: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" | ||
integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== | ||
|
||
tiny-warning@^1.0.3: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" | ||
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== | ||
|
||
tmp@~0.2.1: | ||
version "0.2.1" | ||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" | ||
|
@@ -11723,6 +11760,11 @@ to-regex-range@^5.0.1: | |
dependencies: | ||
is-number "^7.0.0" | ||
|
||
toformat@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/toformat/-/toformat-2.0.0.tgz#7a043fd2dfbe9021a4e36e508835ba32056739d8" | ||
integrity sha512-03SWBVop6nU8bpyZCx7SodpYznbZF5R4ljwNLBcTQzKOD9xuihRo/psX58llS1BMFhhAI08H3luot5GoXJz2pQ== | ||
|
||
toggle-selection@^1.0.6: | ||
version "1.0.6" | ||
resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" | ||
|