Skip to content

Commit

Permalink
Merge pull request #277 from alleslabs/feat/pool-nav-wireup
Browse files Browse the repository at this point in the history
Feat/pool nav wireup
  • Loading branch information
evilpeach committed Apr 26, 2023
2 parents 029e6e7 + 57d823a commit 3618076
Show file tree
Hide file tree
Showing 48 changed files with 1,647 additions and 1,323 deletions.
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

0 comments on commit 3618076

Please sign in to comment.