Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/pool nav wireup #277

Merged
merged 30 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ab47ef3
feat: wireup lists
songwongtp Apr 13, 2023
e4511d7
Merge branch 'pages/pool-list' into feat/pool-nav-wireup
songwongtp Apr 18, 2023
814f7ba
feat: wireup for pool navigation
songwongtp Apr 18, 2023
f99f2ef
fix: change pools route
songwongtp Apr 18, 2023
cbf8929
fix: network pool route
songwongtp Apr 18, 2023
0e82b45
fix: navigate to pool page
songwongtp Apr 18, 2023
681ea26
fix: link to osmosis from cards
songwongtp Apr 18, 2023
b04efed
fix: add https
songwongtp Apr 18, 2023
45dd79c
fix: default landing pool tab
songwongtp Apr 19, 2023
684d88f
Merge branch 'pages/pool-list' into feat/pool-nav-wireup
songwongtp Apr 19, 2023
fd9a32b
fix: supported asset pool card
songwongtp Apr 20, 2023
af8b63f
fix: condition logic
songwongtp Apr 20, 2023
478c098
fix: acceptance test
songwongtp Apr 20, 2023
073444d
fix: unsupported card
songwongtp Apr 20, 2023
52be761
fix: change unsupported token copier behavior
songwongtp Apr 20, 2023
416da1a
fix: incorrect pool amount
songwongtp Apr 20, 2023
c573000
fix: amount precision
songwongtp Apr 20, 2023
d6d66df
Merge branch 'pages/pool-list' into feat/pool-nav-wireup
songwongtp Apr 20, 2023
ef185cc
fix: pool header
songwongtp Apr 21, 2023
32b7f93
fix: change OTHERS formatted amount
songwongtp Apr 21, 2023
4c9a1e0
Merge branch 'pages/pool-list' into feat/pool-nav-wireup
songwongtp Apr 23, 2023
fa1aecd
feat: add expand all
songwongtp Apr 24, 2023
7ca56f8
fix: handle page change with expand
songwongtp Apr 24, 2023
1401d23
fix: remove h2
bkioshn Apr 25, 2023
cc04e8b
fix: comments
songwongtp Apr 25, 2023
9d78deb
fix: comment
songwongtp Apr 25, 2023
5946e8e
chore: fix typos
evilpeach Apr 25, 2023
8e207b9
Merge branch 'feat/pool-nav-wireup' into feat/expand-all
evilpeach Apr 25, 2023
697c355
Merge pull request #295 from alleslabs/feat/expand-all
evilpeach Apr 25, 2023
57d823a
chore: fix nullish, query keys
evilpeach Apr 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#295](https://github.com/alleslabs/celatone-frontend/pull/295) Add expand/collapse all for unsupported pool list
- [#277](https://github.com/alleslabs/celatone-frontend/pull/277) Wire up data for pool navigation page
- [#275](https://github.com/alleslabs/celatone-frontend/pull/275) Add Pool navigation and pool detail data
- [#270](https://github.com/alleslabs/celatone-frontend/pull/270) Add Pool navigation and detail page
- [#268](https://github.com/alleslabs/celatone-frontend/pull/268) Wireup create proposal to whitelisting
Expand Down
11 changes: 11 additions & 0 deletions src/lib/app-fns/explorer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,14 @@ export const getExplorerValidatorUrl = (chainName: string) => {
}
return `${explorerMap[chainName]}/${pathSuffix}`;
};

export const getPoolUrl = (chainName: string) => {
switch (chainName) {
case "osmosis":
return "https://app.osmosis.zone/pool";
case "osmosistestnet":
return "https://testnet.osmosis.zone/pool";
default:
return "";
}
};
1 change: 1 addition & 0 deletions src/lib/components/ToggleWithName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const ToggleWithName = ({
<Flex p="1" borderRadius={4} border="1px" borderColor="pebble.700">
{options.map((item) => (
<Button
key={item.value}
borderRadius={4}
size="sm"
height="22px"
Expand Down
10 changes: 10 additions & 0 deletions src/lib/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const documents = {
types.GetPoolListDocument,
"\n query getPoolListCount($expression: pools_bool_exp) {\n pools_aggregate(where: $expression) {\n aggregate {\n count\n }\n }\n }\n":
types.GetPoolListCountDocument,
"\n query getPoolListByDenoms(\n $denoms: _varchar\n $expression: pools_bool_exp\n $order: order_by\n $offset: Int!\n $pageSize: Int!\n ) {\n pools: search_pools_with_denoms(\n args: { denoms: $denoms }\n where: $expression\n order_by: { id: $order }\n offset: $offset\n limit: $pageSize\n ) {\n id\n type\n is_superfluid\n liquidity\n }\n }\n":
types.GetPoolListByDenomsDocument,
"\n query getPoolListByDenomsCount(\n $denoms: _varchar\n $expression: pools_bool_exp\n ) {\n pools_aggregate: search_pools_with_denoms_aggregate(\n args: { denoms: $denoms }\n where: $expression\n ) {\n aggregate {\n count\n }\n }\n }\n":
types.GetPoolListByDenomsCountDocument,
"\n query getPoolByPoolId($poolId: Int!) {\n pools_by_pk(id: $poolId) {\n id\n type\n is_superfluid\n is_supported\n liquidity\n transaction {\n block_height\n }\n account {\n address\n }\n address\n swap_fee\n exit_fee\n future_pool_governor\n weight\n smooth_weight_change_params\n scaling_factors\n scaling_factor_controller\n }\n }\n":
types.GetPoolByPoolIdDocument,
"\n query getRelatedProposalsByContractAddressPagination(\n $contractAddress: String!\n $offset: Int!\n $pageSize: Int!\n ) {\n contract_proposals(\n where: { contract: { address: { _eq: $contractAddress } } }\n order_by: { proposal_id: desc }\n offset: $offset\n limit: $pageSize\n ) {\n proposal {\n title\n status\n voting_end_time\n deposit_end_time\n type\n account {\n address\n }\n is_expedited\n }\n proposal_id\n resolved_height\n }\n }\n":
Expand Down Expand Up @@ -157,6 +161,12 @@ export function graphql(
export function graphql(
source: "\n query getPoolListCount($expression: pools_bool_exp) {\n pools_aggregate(where: $expression) {\n aggregate {\n count\n }\n }\n }\n"
): typeof documents["\n query getPoolListCount($expression: pools_bool_exp) {\n pools_aggregate(where: $expression) {\n aggregate {\n count\n }\n }\n }\n"];
export function graphql(
source: "\n query getPoolListByDenoms(\n $denoms: _varchar\n $expression: pools_bool_exp\n $order: order_by\n $offset: Int!\n $pageSize: Int!\n ) {\n pools: search_pools_with_denoms(\n args: { denoms: $denoms }\n where: $expression\n order_by: { id: $order }\n offset: $offset\n limit: $pageSize\n ) {\n id\n type\n is_superfluid\n liquidity\n }\n }\n"
): typeof documents["\n query getPoolListByDenoms(\n $denoms: _varchar\n $expression: pools_bool_exp\n $order: order_by\n $offset: Int!\n $pageSize: Int!\n ) {\n pools: search_pools_with_denoms(\n args: { denoms: $denoms }\n where: $expression\n order_by: { id: $order }\n offset: $offset\n limit: $pageSize\n ) {\n id\n type\n is_superfluid\n liquidity\n }\n }\n"];
export function graphql(
source: "\n query getPoolListByDenomsCount(\n $denoms: _varchar\n $expression: pools_bool_exp\n ) {\n pools_aggregate: search_pools_with_denoms_aggregate(\n args: { denoms: $denoms }\n where: $expression\n ) {\n aggregate {\n count\n }\n }\n }\n"
): typeof documents["\n query getPoolListByDenomsCount(\n $denoms: _varchar\n $expression: pools_bool_exp\n ) {\n pools_aggregate: search_pools_with_denoms_aggregate(\n args: { denoms: $denoms }\n where: $expression\n ) {\n aggregate {\n count\n }\n }\n }\n"];
export function graphql(
source: "\n query getPoolByPoolId($poolId: Int!) {\n pools_by_pk(id: $poolId) {\n id\n type\n is_superfluid\n is_supported\n liquidity\n transaction {\n block_height\n }\n account {\n address\n }\n address\n swap_fee\n exit_fee\n future_pool_governor\n weight\n smooth_weight_change_params\n scaling_factors\n scaling_factor_controller\n }\n }\n"
): typeof documents["\n query getPoolByPoolId($poolId: Int!) {\n pools_by_pk(id: $poolId) {\n id\n type\n is_superfluid\n is_supported\n liquidity\n transaction {\n block_height\n }\n account {\n address\n }\n address\n swap_fee\n exit_fee\n future_pool_governor\n weight\n smooth_weight_change_params\n scaling_factors\n scaling_factor_controller\n }\n }\n"];
Expand Down
273 changes: 273 additions & 0 deletions src/lib/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12555,6 +12555,38 @@ export type GetPoolListCountQuery = {
};
};

export type GetPoolListByDenomsQueryVariables = Exact<{
denoms?: InputMaybe<Scalars["_varchar"]>;
expression?: InputMaybe<Pools_Bool_Exp>;
order?: InputMaybe<Order_By>;
offset: Scalars["Int"];
pageSize: Scalars["Int"];
}>;

export type GetPoolListByDenomsQuery = {
__typename?: "query_root";
pools: Array<{
__typename?: "pools";
id: number;
type: any;
is_superfluid: boolean;
liquidity: any;
}>;
};

export type GetPoolListByDenomsCountQueryVariables = Exact<{
denoms?: InputMaybe<Scalars["_varchar"]>;
expression?: InputMaybe<Pools_Bool_Exp>;
}>;

export type GetPoolListByDenomsCountQuery = {
__typename?: "query_root";
pools_aggregate: {
__typename?: "pools_aggregate";
aggregate?: { __typename?: "pools_aggregate_fields"; count: number } | null;
};
};

export type GetPoolByPoolIdQueryVariables = Exact<{
poolId: Scalars["Int"];
}>;
Expand Down Expand Up @@ -16121,6 +16153,247 @@ export const GetPoolListCountDocument = {
GetPoolListCountQuery,
GetPoolListCountQueryVariables
>;
export const GetPoolListByDenomsDocument = {
kind: "Document",
definitions: [
{
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "getPoolListByDenoms" },
variableDefinitions: [
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "denoms" },
},
type: {
kind: "NamedType",
name: { kind: "Name", value: "_varchar" },
},
},
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "expression" },
},
type: {
kind: "NamedType",
name: { kind: "Name", value: "pools_bool_exp" },
},
},
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "order" },
},
type: {
kind: "NamedType",
name: { kind: "Name", value: "order_by" },
},
},
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "offset" },
},
type: {
kind: "NonNullType",
type: { kind: "NamedType", name: { kind: "Name", value: "Int" } },
},
},
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "pageSize" },
},
type: {
kind: "NonNullType",
type: { kind: "NamedType", name: { kind: "Name", value: "Int" } },
},
},
],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
alias: { kind: "Name", value: "pools" },
name: { kind: "Name", value: "search_pools_with_denoms" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "args" },
value: {
kind: "ObjectValue",
fields: [
{
kind: "ObjectField",
name: { kind: "Name", value: "denoms" },
value: {
kind: "Variable",
name: { kind: "Name", value: "denoms" },
},
},
],
},
},
{
kind: "Argument",
name: { kind: "Name", value: "where" },
value: {
kind: "Variable",
name: { kind: "Name", value: "expression" },
},
},
{
kind: "Argument",
name: { kind: "Name", value: "order_by" },
value: {
kind: "ObjectValue",
fields: [
{
kind: "ObjectField",
name: { kind: "Name", value: "id" },
value: {
kind: "Variable",
name: { kind: "Name", value: "order" },
},
},
],
},
},
{
kind: "Argument",
name: { kind: "Name", value: "offset" },
value: {
kind: "Variable",
name: { kind: "Name", value: "offset" },
},
},
{
kind: "Argument",
name: { kind: "Name", value: "limit" },
value: {
kind: "Variable",
name: { kind: "Name", value: "pageSize" },
},
},
],
selectionSet: {
kind: "SelectionSet",
selections: [
{ kind: "Field", name: { kind: "Name", value: "id" } },
{ kind: "Field", name: { kind: "Name", value: "type" } },
{
kind: "Field",
name: { kind: "Name", value: "is_superfluid" },
},
{ kind: "Field", name: { kind: "Name", value: "liquidity" } },
],
},
},
],
},
},
],
} as unknown as DocumentNode<
GetPoolListByDenomsQuery,
GetPoolListByDenomsQueryVariables
>;
export const GetPoolListByDenomsCountDocument = {
kind: "Document",
definitions: [
{
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "getPoolListByDenomsCount" },
variableDefinitions: [
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "denoms" },
},
type: {
kind: "NamedType",
name: { kind: "Name", value: "_varchar" },
},
},
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "expression" },
},
type: {
kind: "NamedType",
name: { kind: "Name", value: "pools_bool_exp" },
},
},
],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
alias: { kind: "Name", value: "pools_aggregate" },
name: { kind: "Name", value: "search_pools_with_denoms_aggregate" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "args" },
value: {
kind: "ObjectValue",
fields: [
{
kind: "ObjectField",
name: { kind: "Name", value: "denoms" },
value: {
kind: "Variable",
name: { kind: "Name", value: "denoms" },
},
},
],
},
},
{
kind: "Argument",
name: { kind: "Name", value: "where" },
value: {
kind: "Variable",
name: { kind: "Name", value: "expression" },
},
},
],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "aggregate" },
selectionSet: {
kind: "SelectionSet",
selections: [
{ kind: "Field", name: { kind: "Name", value: "count" } },
],
},
},
],
},
},
],
},
},
],
} as unknown as DocumentNode<
GetPoolListByDenomsCountQuery,
GetPoolListByDenomsCountQueryVariables
>;
export const GetPoolByPoolIdDocument = {
kind: "Document",
definitions: [
Expand Down
Loading