Skip to content

Commit

Permalink
Merge pull request #193 from ergoplatform/feature/add-oracle-pool-v2
Browse files Browse the repository at this point in the history
Add oracle pool v2 testnet
  • Loading branch information
deadit authored Sep 26, 2023
2 parents 47ca371 + c52fb83 commit 290868d
Show file tree
Hide file tree
Showing 10 changed files with 757 additions and 91 deletions.
28 changes: 28 additions & 0 deletions src/actions/oraclePoolStatev2.actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { ActionCreatorsMapObject } from 'redux';
import { OraclePoolStateV2Service } from 'src/services/oraclePoolStateV2.service';

interface OraclePoolStateV2Actions extends ActionCreatorsMapObject {
getPoolInfo: (key: string) => any;
getPoolStatus: (key: string) => any;
getOracleInfo: (key: string) => any;
getOracleStatus: (key: string) => any;
}

export const OraclePoolStateV2Actions: OraclePoolStateV2Actions = {
getPoolInfo(key: string) {
return (dispatch: any) =>
OraclePoolStateV2Service.getPoolInfo(dispatch, key);
},
getPoolStatus(key: string) {
return (dispatch: any) =>
OraclePoolStateV2Service.getPoolStatus(dispatch, key);
},
getOracleInfo(key: string) {
return (dispatch: any) =>
OraclePoolStateV2Service.getOracleInfo(dispatch, key);
},
getOracleStatus(key: string) {
return (dispatch: any) =>
OraclePoolStateV2Service.getOracleStatus(dispatch, key);
},
};
254 changes: 254 additions & 0 deletions src/config/pools.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
import React from 'react';

export const pools = [
{
key: 'ergusd',
name: 'Erg / USD',
icon: (
<svg
xmlns="http://www.w3.org/2000/svg"
width="59"
height="59"
viewBox="0 0 59 59"
fill="none"
>
<path
d="M29.8011 59C29.6868 59 29.5679 58.988 29.452 58.9654C29.3377 58.9443 29.2234 58.9097 29.115 58.8661L9.47084 50.981C9.24366 50.8892 9.03902 50.7554 8.8675 50.5869C8.69749 50.4199 8.55905 50.2182 8.46427 49.9926L0.148981 30.5258C0.100837 30.4145 0.0646582 30.2987 0.0390817 30.1798C0.0150097 30.064 0.00146924 29.9436 0.00146924 29.8218L0 29.7992C0.0015045 29.6804 0.012033 29.563 0.0346005 29.4501C0.057168 29.3358 0.0902552 29.2215 0.13539 29.1116L8.02049 9.47043C8.11076 9.24325 8.24618 9.03864 8.41468 8.86562C8.58168 8.69561 8.78324 8.55717 9.00892 8.46239L28.4741 0.148566C28.5869 0.100422 28.7028 0.0643173 28.8202 0.0387408C28.9375 0.0146689 29.0594 0.00112837 29.1812 0.00112837C29.1842 -0.000376124 29.2114 -0.000376124 29.2144 0.00112837C29.3302 0.00112837 29.4461 0.0131614 29.5559 0.0357289C29.6687 0.0567919 29.7786 0.0898761 29.8884 0.133507L49.5311 8.0186C49.7583 8.11038 49.9629 8.24422 50.1344 8.41273C50.3059 8.57973 50.4428 8.78136 50.5391 9.00703L58.853 28.4707C58.9493 28.6964 58.9989 28.9371 59.0019 29.1778C59.0034 29.417 58.9583 29.6578 58.8665 29.885L50.9814 49.5277C50.8911 49.7549 50.7558 49.9594 50.5873 50.131C50.4203 50.3025 50.2186 50.4409 49.9944 50.5357L30.5293 58.8496C30.4134 58.8992 30.2946 58.9368 30.1742 58.9608C30.0478 58.9864 29.923 59 29.8011 59V59ZM12.6559 46.7203L29.7635 53.5868L46.7177 46.3472L53.5857 29.2395L46.346 12.2868L29.2384 5.41732L12.2812 12.6599L5.41318 29.7676L12.6559 46.7203V46.7203Z"
fill="white"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M27.6272 37.0656H39.0463V42.372H19.9558V37.5485L27.4677 29.2332L19.9919 21.4429V16.606H39.0463V21.9108H27.871L34.7991 29.167L27.6272 37.0656Z"
fill="white"
/>
</svg>
),
},
{
key: 'ethusd',
name: 'Eth / USD',
icon: (
<svg
width="1535"
height="2500"
viewBox="0 0 256 417"
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMidYMid"
>
<path
fill="#343434"
d="M127.961 0l-2.795 9.5v275.668l2.795 2.79 127.962-75.638z"
/>
<path fill="#8C8C8C" d="M127.962 0L0 212.32l127.962 75.639V154.158z" />
<path
fill="#3C3C3B"
d="M127.961 312.187l-1.575 1.92v98.199l1.575 4.6L256 236.587z"
/>
<path fill="#8C8C8C" d="M127.962 416.905v-104.72L0 236.585z" />
<path
fill="#141414"
d="M127.961 287.958l127.96-75.637-127.96-58.162z"
/>
<path fill="#393939" d="M0 212.32l127.96 75.638v-133.8z" />
</svg>
),
},
{
key: 'dexyerg',
name: 'DexyGold / ERG',
icon: (
<svg
width="82"
height="79"
viewBox="0 0 82 79"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M47.4012 3.65515L59.2592 8.5669C64.3182 10.6624 68.3376 14.6818 70.4331 19.7408L75.3448 31.5988C77.4404 36.6579 77.4404 42.3421 75.3448 47.4012L70.4331 59.2592C68.3376 64.3182 64.3182 68.3376 59.2592 70.4331L47.4012 75.3448C42.3421 77.4404 36.6579 77.4404 31.5988 75.3448L19.7408 70.4331C14.6818 68.3376 10.6624 64.3182 8.5669 59.2592L3.65515 47.4012C1.55963 42.3421 1.55963 36.6579 3.65515 31.5988L8.5669 19.7408C10.6624 14.6818 14.6818 10.6624 19.7408 8.5669L31.5988 3.65515C36.6579 1.55963 42.3421 1.55963 47.4012 3.65515Z"
fill="black"
stroke="url(#paint0_linear_146_4583)"
strokeWidth="0.706554"
/>
<g filter="url(#filter0_d_146_4583)">
<path
opacity="0.3"
d="M22.3307 23.4825C22.3497 22.3788 23.0228 21.3907 24.0434 20.9682V20.9682C25.865 20.2141 27.8652 21.5492 27.8652 23.5192L27.8652 56.5787C27.8652 58.727 25.7048 60.2074 23.7032 59.4307V59.4307C22.5135 58.969 21.7385 57.815 21.7605 56.5382L22.3307 23.4825Z"
fill="url(#paint1_linear_146_4583)"
/>
<path
opacity="0.3"
d="M33.6943 20.9667C33.7533 19.0256 35.0353 17.3324 36.8884 16.7478V16.7478V16.7478C38.2233 16.2741 39.6194 17.2734 39.5999 18.6888L39.0205 60.9123C38.9882 63.2654 36.5551 64.8194 34.4092 63.8576V63.8576C33.2033 63.3171 32.4433 62.1029 32.4835 60.7811L33.6943 20.9667Z"
fill="url(#paint2_linear_146_4583)"
/>
<path
opacity="0.3"
d="M43.957 20.0851C43.957 17.8874 46.2027 16.4 48.2241 17.2588V17.2588C49.3528 17.7384 50.0851 18.8457 50.0851 20.0729L50.0851 61.1565C50.0851 62.4387 49.2865 63.5869 48.0838 64.0341V64.0341C46.0829 64.778 43.957 63.3019 43.957 61.1687L43.957 20.0851Z"
fill="url(#paint3_linear_146_4583)"
/>
<path
opacity="0.3"
d="M54.8271 24.4527C54.8271 22.49 56.8234 21.1546 58.6356 21.9048V21.9048C59.6617 22.3296 60.3303 23.3305 60.3303 24.4418L60.3303 57.1663C60.3303 58.6651 59.3195 59.9775 57.8697 60.361V60.361V60.361C56.3644 60.8441 54.8272 59.724 54.8272 58.1442L54.8271 24.4527Z"
fill="url(#paint4_linear_146_4583)"
/>
<g filter="url(#filter1_d_146_4583)">
<path
d="M21.6728 53.8047H15.0765L25.1273 24.6901H33.0599L43.0964 53.8047H36.5002L29.2073 31.3432H28.9799L21.6728 53.8047ZM21.2605 42.3607H36.8414V47.1658H21.2605V42.3607ZM58.288 44.5074V31.9688H64.3441V53.8047H58.5297V49.8384H58.3023C57.8094 51.1178 56.9896 52.1461 55.8429 52.9233C54.7056 53.7004 53.3172 54.089 51.6776 54.089C50.218 54.089 48.9339 53.7573 47.825 53.0939C46.7161 52.4305 45.849 51.4875 45.2235 50.2649C44.6074 49.0423 44.2947 47.578 44.2852 45.8721V31.9688H50.3412V44.7917C50.3507 46.0806 50.6967 47.0994 51.379 47.8481C52.0614 48.5969 52.976 48.9712 54.1227 48.9712C54.8525 48.9712 55.5349 48.8054 56.1699 48.4736C56.8048 48.1325 57.3166 47.6302 57.7052 46.9667C58.1032 46.3033 58.2975 45.4835 58.288 44.5074Z"
fill="white"
/>
</g>
</g>
<defs>
<filter
id="filter0_d_146_4583"
x="14.5109"
y="16.6289"
width="50.3981"
height="48.7306"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
/>
<feOffset dy="0.565244" />
<feGaussianBlur stdDeviation="0.282622" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
/>
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_146_4583"
/>
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_146_4583"
result="shape"
/>
</filter>
<filter
id="filter1_d_146_4583"
x="3.62999"
y="19.7441"
width="77.8124"
height="57.9437"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
/>
<feOffset dx="2.82622" dy="9.32652" />
<feGaussianBlur stdDeviation="7.1362" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
/>
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_146_4583"
/>
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_146_4583"
result="shape"
/>
</filter>
<linearGradient
id="paint0_linear_146_4583"
x1="39.5"
y1="0"
x2="39.5"
y2="79"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#308F7A" />
<stop offset="0.390625" stopColor="#24B796" />
<stop offset="0.744792" stopColor="#18463C" />
<stop
offset="0.953125"
stopColor="#125748"
stopOpacity="0.475806"
/>
</linearGradient>
<linearGradient
id="paint1_linear_146_4583"
x1="28.2879"
y1="40.2173"
x2="21.9848"
y2="40.0972"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#FF9A03" />
<stop offset="1" stopColor="#372D1E" />
</linearGradient>
<linearGradient
id="paint2_linear_146_4583"
x1="39.4568"
y1="40.8282"
x2="32.8138"
y2="40.7017"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#FF9A03" />
<stop offset="1" stopColor="#372D1E" />
</linearGradient>
<linearGradient
id="paint3_linear_146_4583"
x1="50.5462"
y1="40.6124"
x2="43.4508"
y2="40.4772"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#FF9A03" />
<stop offset="1" stopColor="#372D1E" />
</linearGradient>
<linearGradient
id="paint4_linear_146_4583"
x1="60.7139"
y1="40.9274"
x2="54.4109"
y2="40.8073"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#FF9A03" />
<stop offset="1" stopColor="#372D1E" />
</linearGradient>
</defs>
</svg>
),
},
// {
// key: 'adausd',
// name: 'ADA / USD',
// icon: (
// <svg
// xmlns="http://www.w3.org/2000/svg"
// width="100"
// height="100"
// viewBox="0 0 2000 1848"
// >
// <g fill="#fff">
// <path d="M975.46 5.46c43.59-22.73 96.8 30 73.64 73.55-13.45 35.5-64.45 44.94-90.5 17.88C931 70.92 940 19.59 975.46 5.46M506.61 56c26.48-10.9 60 13.36 57.3 42.22 2.81 31.33-35.5 54.39-62.49 39.5-35.76-13.85-31.67-71.9 5.19-81.72M1466.87 138.6c-41.38-5-47.93-70.06-8.09-83.16 30.9-15.07 59.25 13.19 63.77 42.48-6.48 25.01-27.42 47.91-55.68 40.68M613.29 255.55c44.27-28 107.44 13.7 100.63 65.12-2.3 51.92-71.26 82-110.17 46.9-37.62-27.57-31.92-90.82 9.54-112.02M1289.1 285.26c19.75-50.9 99.78-52.44 122.26-2.89 22.22 38.56-5.11 86.31-44.7 99.42-52.44 9.79-102.25-46.9-77.56-96.53M919 378.9c-.43-43.75 39.42-76.35 81-79.33 27.58 5.53 57.64 17.28 69.47 45.11 22.05 38.39 2.47 91.25-37.37 108.87-18.22 10.21-39.76 6.38-59.6 5.19-30.33-14.89-55.87-44.09-53.5-79.84M221.75 442.65c40.44-24.86 95 20.51 79.69 64.44-8.43 38-59.51 53.46-88.71 29.2-31.17-22.73-26.23-77.38 9.02-93.64M1719 442.57c34.31-26.64 90.93 3.92 86.84 47.24 2.3 39.5-46.65 69.29-80.71 48.95-37.51-16.86-41.34-74.57-6.13-96.19M1115.08 521.22c56.62-20.34 123.87 4 156.14 54.48 42.57 61.71 19.92 155.69-46.14 191.1-68.45 41.88-168.4 6.38-193.68-70.06-28.7-68.43 13.11-154.07 83.68-175.52M782.88 527.95c62.75-29.62 147.2-4.77 177.51 59.42 35.67 62.48 8.09 149.48-55.68 181.74-63.85 36.26-153.93 8.77-184.83-58.31-34.65-64.87-3.88-152.98 63-182.85M450.25 641.67c4.77-40.43 42.91-66.74 81.39-69.46 41.46 5 74.58 37.2 79.09 79.16-2.72 41.54-34.82 82.14-78.84 81.89-48.43 4.17-90.89-44.01-81.64-91.59M1432.73 581c49.72-28.94 118.76 13.19 116.55 70.31 3.41 60.52-73 103.17-122.51 67.67-51.43-29.56-47.42-112.81 5.96-137.98M647.69 794.3c58.15-16 124.64 11.41 153.16 64.86 31.24 53.8 18.47 128.54-30.05 168-62.23 57.88-177 34.64-210.12-44.35-38.06-72.41 8.17-169.45 87.01-188.51M1277.78 794c56.53-16.17 122.94 5.62 153.33 57.12 40.18 58.9 21 146.75-38.82 184.72-62.66 44.09-159.72 20.94-194.2-48-41.8-71.31.26-172.09 79.69-193.84M273.68 861.2c50.23-19 105.91 36.43 85.56 86.23-12.43 45.37-76.37 62.14-109.4 28.69-38.65-31.41-24.34-101.3 23.84-114.92M1635.18 933.47c-1.45-41.62 29-78.48 71.68-80.78 34.4 5.45 67.85 33.2 65.13 70.65 3.15 49.46-56.45 83.08-98.59 59.84-19.75-10.04-29.88-30.3-38.22-49.71M26.7 885.63c30.22-13.19 67.6 13 60.7 46.56-1.62 38-57.72 52.61-78.33 20.86C-9.14 931 1.76 897 26.7 885.63zM1932.13 884.87c21.28-15.15 55.42-4.26 63.85 20.6 14.3 27.15-11.92 64.35-42.48 59.76-42.9 3.91-56.78-61.47-21.37-80.36M811.83 1067.28c79.52-20.68 165 45.63 165.5 127.51 5.19 82.74-79 156.11-160.4 137-62.92-10.13-112.29-70.74-110.25-134.32-.17-60.81 45.72-117.33 105.15-130.19M1126.75 1067.11c80.71-22.56 168.74 44.94 167.46 128.71 4.26 81.21-77.3 152.11-157 136-75-9.7-130.34-92.1-109.4-164.88 10.57-48.5 51.09-87.94 98.94-99.83M519.56 1117.51c55.85-9.53 108.21 52.78 85.56 105.81-16.52 56.51-98.76 71.84-135.12 25.68-42.65-44.33-10.81-125.37 49.56-131.49M1443.11 1120c49.8-20.86 110.93 22.22 107.1 76.27 2 59.5-73.47 100.53-122.17 65.8-55.16-31.18-45.12-122.94 15.07-142.07M1701.25 1378.92c-19.5-36.35 15.92-84.53 56.28-77.8 20.09-.34 34.14 15.49 47 28.77 2.64 21.54 7.07 47.24-10.81 63.84-24.28 30.73-79.28 21.96-92.47-14.81M221.58 1311.24c37.72-25.11 92 12.34 83.52 56.44-4.51 39-53.64 61.29-86 39.16-34.73-20.09-33.45-77.29 2.48-95.6M966.78 1392.88c49.38-21.79 112.29 21.2 107.61 75.59 3.66 60.1-74.15 101.72-122.43 65.63-53.63-30.99-44.69-122.16 14.82-141.22M621.63 1473.4c42.06-22.13 98.5 16.09 94.67 63.16 1.28 38.65-36.44 71.59-74.58 65.88-31.59-.68-52.19-29-62.32-55.93.52-29.35 12.6-62.04 42.23-73.11M1320.77 1474.08c43.25-26.73 104.72 11.66 100.63 62 1.11 52.61-68.36 86.31-108.63 51.75-38.99-27.09-34.23-92.21 8-113.75M1442.35 1774.65c-19.24-29.11 3.41-64.18 34.65-70.82 25.12 5.11 51.68 24 46.4 53.12-3.66 39.41-61.3 51.5-81.05 17.7M477.24 1749.37c7.66-23.07 26.22-46 53.38-40 39.59 2.81 51.34 62.48 16.69 80.87-31.16 21.01-67.31-7.76-70.07-40.87M942.85 1775.84c7.58-34.13 51.76-50.73 80.88-32.6 19.24 8.26 24.86 29.79 29.8 48.09-2.64 9.53-5 19.07-7.32 28.6-11.92 14.13-27.24 28.26-47.08 27.75-36.87 4.32-70.13-37.36-56.28-71.84" />
// </g>
// </svg>
// ),
// },
];
8 changes: 8 additions & 0 deletions src/constants/struct.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ export const GET_TOKEN_STRUCT = '/tokens/:id';

export const GET_ORACLE_POOL_DATA_STRUCT = 'oracle/frontendData';

export const GET_ORACLE_POOL_INFO_V2_STRUCT = 'oracle/v2/poolInfo';

export const GET_ORACLE_POOL_STATUS_V2_STRUCT = 'oracle/v2/poolStatus';

export const GET_ORACLE_INFO_V2_STRUCT = 'oracle/v2/oracleInfo';

export const GET_ORACLE_STATUS_V2_STRUCT = 'oracle/v2/oracleStatus';

export const GET_ADDRESSES_BALANCES_STRUCT = 'addresses/balances';
6 changes: 3 additions & 3 deletions src/containers/app/app.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const UnconfirmedTransactionsComponent = lazy(
'../../pages/unconfirmed-transactions/unconfirmed-transactions.component'
)
);
const OraclePoolStateComponent = lazy(
() => import('../../pages/oracle-pool-state/oracle-pool-state.component')
const OraclePoolStatePageComponent = lazy(
() => import('../../pages/oracle-pool-state/oracle-pool-state-page.component')
);
const OraclePoolListComponent = lazy(
() => import('src/pages/oracle-pool-list/oracle-pool-list')
Expand Down Expand Up @@ -166,7 +166,7 @@ class App extends React.PureComponent<RouteComponentProps<any>> {
<Route
exact
path="/oracle-pool-state/:id"
component={OraclePoolStateComponent}
component={OraclePoolStatePageComponent}
/>

<Redirect from="/oracle-pool-list" to="/oracle-pools-list" />
Expand Down
Loading

0 comments on commit 290868d

Please sign in to comment.