Skip to content

Commit

Permalink
Merge pull request #453 from pangolindex/dev - Production v7.3.0
Browse files Browse the repository at this point in the history
Production v7.3.0
  • Loading branch information
SarjuHansaliya authored Jun 29, 2023
2 parents 64acf22 + 78a103f commit c32fe30
Show file tree
Hide file tree
Showing 67 changed files with 927 additions and 119 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# we actually need "github.event.pull_request.commits + 1" commit
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
Expand All @@ -22,9 +22,10 @@ jobs:
run: |
git config --global user.name 'Pangolin'
git config --global user.email '[email protected]'
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
# Checkout project repository
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3

- uses: actions/[email protected]
with:
Expand All @@ -18,10 +18,11 @@ jobs:

# Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/
node-version: '16.x'
node-version: '18.x'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'

- run: yarn --frozen-lockfile
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.18.1
v18.16.1
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@ethersproject/providers": "^5.7.2",
"@pangolindex/sdk": "5.2.0",
"@pangolindex/sdk": "5.3.0",
"@types/react-router-dom": "^5.3.3",
"@web3-react/core": "6.0.9",
"@web3-react/injected-connector": "6.0.7",
Expand Down
6 changes: 5 additions & 1 deletion example/src/pages/Airdrop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ChainId, SONGBIRD_CANARY, FLARE_MAINNET } from '@pangolindex/sdk';
import { PNG } from '@components/constants/tokens';
import { getTokenLogoURL } from '@components/utils/getTokenLogoURL';
import { Frame } from './styleds';
import { Airdrop, ComingSoon } from '@components/components';
import { Airdrop, ClosedRegistration, ComingSoon } from '@components/components';

const activeAirdrops = [
{
Expand Down Expand Up @@ -49,6 +49,10 @@ export default function AirdropUI() {
{ComingSoonAirdrops.map((airdrop, index) => (
<ComingSoon {...airdrop} key={`${index}-${airdrop.token.address}`} />
))}
<ClosedRegistration
token={PNG[ChainId.HEDERA_TESTNET]}
logo={getTokenLogoURL(PNG[ChainId.HEDERA_TESTNET].address, ChainId.HEDERA_TESTNET, 48)}
/>
</Frame>
);
}
8 changes: 4 additions & 4 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,10 @@
"@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14"

"@pangolindex/sdk@5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@pangolindex/sdk/-/sdk-5.2.0.tgz#9ecbe8e946dd3303fb7be55abb7acf8c1ea5ba8b"
integrity sha512-1Lden6wDCoQ5sbnZZPSnAw/ESOYODbnWFhMzyNSkrfUTbYlRLiwifVtPUPpVM9DIN7m2DKSBijAuWS/0LKagSw==
"@pangolindex/sdk@5.3.0":
version "5.3.0"
resolved "https://registry.yarnpkg.com/@pangolindex/sdk/-/sdk-5.3.0.tgz#7d90494dcaa389efccc55781d6b9cb3794909732"
integrity sha512-NoQasfyrPNZhEPeTFF6nMc5/b2okjrmeT66Hk/6oMzcjwqdkBIpcyREFT22zNChIl5CWYnYo0IKKanottYmhFg==
dependencies:
big.js "^5.2.2"
decimal.js-light "^2.5.0"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@pangolindex/components",
"version": "7.2.4",
"version": "7.3.0-rc.3",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"engines": {
"node": ">=14.x.x <=16.x.x"
"node": ">=18.x.x <=20.x.x"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down Expand Up @@ -128,7 +128,7 @@
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@pangolindex/governance": "1.2.0",
"@pangolindex/sdk": "5.2.0",
"@pangolindex/sdk": "5.3.0",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.5",
Expand Down Expand Up @@ -186,7 +186,7 @@
"rollup-plugin-node-externals": "^4.1.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-typescript2": "^0.34.1",
"ttypescript": "^1.5.15",
"typescript": "^4.4.4",
"yalc": "^1.0.0-pre.53"
Expand Down
18 changes: 12 additions & 6 deletions src/apollo/elixirPools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export type ElixirPoolType = {
};

export const GET_ELIXIR_POOLS = gql`
query pools($poolAddresses: [String]) {
pools(where: { id_in: $poolAddresses }) {
query pools($where: Pool_filter, $first: Int) {
pools(first: $first, orderBy: liquidity, orderDirection: desc, where: $where) {
id
token0 {
id
Expand Down Expand Up @@ -67,19 +67,25 @@ export const GET_ELIXIR_POOLS = gql`
* @param poolAddresses array of pool address
* @returns list of elixir pools
*/
export const useElixirPools = (poolAddresses: (string | undefined)[]) => {
export const useElixirPools = (poolAddresses?: (string | undefined)[]) => {
let poolsToFind: string[] | undefined = undefined;
// we need to convert addresses to lowercase as subgraph has lowercase addresses
const poolsToFind = poolAddresses?.map((item) => item?.toLowerCase())?.filter((item) => !!item) as string[];
poolsToFind =
poolAddresses && (poolAddresses?.map((item) => item?.toLowerCase())?.filter((item) => !!item) as string[]);

const chainId = useChainId();
const gqlClient = useSubgraphClient(SubgraphEnum.Elixir);
const validateAddress = validateAddressMapping[chainId];

// get pairs from subgraph
return useQuery<ElixirPoolType[] | null>(['get-subgraph-elixir-pools', chainId, ...poolsToFind], async () => {
return useQuery<ElixirPoolType[] | null>(['get-subgraph-elixir-pools', chainId], async () => {
if (!gqlClient) {
return null;
}
const data = await gqlClient.request(GET_ELIXIR_POOLS, { poolAddresses: poolsToFind });
const data = await gqlClient.request(GET_ELIXIR_POOLS, {
where: poolsToFind ? { id_in: poolsToFind } : {},
first: poolsToFind ? undefined : 10,
});

return (
(data?.pools as ElixirPoolType[])
Expand Down
34 changes: 34 additions & 0 deletions src/components/Airdrop/HederaAirdrop/ClosedRegistration/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Token } from '@pangolindex/sdk';
import React from 'react';
import { Box, Text } from 'src/components';
import Title from '../../Title';
import { Wrapper } from '../../styleds';

interface Props {
token: Token;
logo: string;
}

export default function ClosedRegistration({ token, logo }: Props) {
return (
<Wrapper>
<Title title={`${token?.symbol} Airdrop`} logo={logo} />
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
flexGrow={1}
minWidth="150px"
style={{ gap: '5px' }}
>
<Text fontSize={16} fontWeight={500} color="text10">
Registraton window has been closed.
</Text>
<Text fontSize={16} fontWeight={500} color="text10">
Claim widget will be live in few hours.
</Text>
</Box>
</Wrapper>
);
}
1 change: 1 addition & 0 deletions src/components/Airdrop/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as Airdrop } from './Airdrop';
export { default as ComingSoon } from './ComingSoon';
export { default as HederaAirdrop } from './HederaAirdrop';
export { default as ClosedRegistration } from './HederaAirdrop/ClosedRegistration';
Loading

0 comments on commit c32fe30

Please sign in to comment.