@reef-chain/react-lib 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +32 -0
  2. package/dist/api/index.d.ts +2 -0
  3. package/dist/api/prices.d.ts +8 -0
  4. package/dist/api/tokens.d.ts +2 -0
  5. package/dist/appState/accountState.d.ts +15 -0
  6. package/dist/appState/accountStateUtil.d.ts +6 -0
  7. package/dist/appState/appState.d.ts +3 -0
  8. package/dist/appState/index.d.ts +1 -0
  9. package/dist/appState/nftTokenState.d.ts +12 -0
  10. package/dist/appState/providerState.d.ts +4 -0
  11. package/dist/appState/tokenState.d.ts +13 -0
  12. package/dist/appState/updateStateModel.d.ts +14 -0
  13. package/dist/appState/util.d.ts +22 -0
  14. package/dist/assets/abi/ERC1155Uri.d.ts +2 -0
  15. package/dist/assets/abi/ERC20.d.ts +2 -0
  16. package/dist/assets/abi/ERC721Uri.d.ts +2 -0
  17. package/dist/assets/abi/ReefswapFactory.d.ts +2 -0
  18. package/dist/assets/abi/ReefswapPair.d.ts +2 -0
  19. package/dist/assets/abi/ReefswapRouter.d.ts +2 -0
  20. package/dist/components/AccountSelector/AccountInlineInfo.d.ts +10 -0
  21. package/dist/components/AccountSelector/AccountListModal.d.ts +11 -0
  22. package/dist/components/AccountSelector/AccountSelector.d.ts +17 -0
  23. package/dist/components/AddLiquidity/index.d.ts +10 -0
  24. package/dist/components/EvmBind/EvmBindComponent.d.ts +15 -0
  25. package/dist/components/OverlayAction/index.d.ts +12 -0
  26. package/dist/components/PoolActions/ConfirmPopups/Address.d.ts +7 -0
  27. package/dist/components/PoolActions/ConfirmPopups/Bond.d.ts +11 -0
  28. package/dist/components/PoolActions/ConfirmPopups/Provide.d.ts +14 -0
  29. package/dist/components/PoolActions/ConfirmPopups/Send.d.ts +11 -0
  30. package/dist/components/PoolActions/ConfirmPopups/SummaryItem.d.ts +7 -0
  31. package/dist/components/PoolActions/ConfirmPopups/Token.d.ts +11 -0
  32. package/dist/components/PoolActions/ConfirmPopups/Trade.d.ts +14 -0
  33. package/dist/components/PoolActions/ConfirmPopups/Withdraw.d.ts +15 -0
  34. package/dist/components/PoolActions/Finalizing.d.ts +2 -0
  35. package/dist/components/PoolActions/Provide.d.ts +19 -0
  36. package/dist/components/PoolActions/TokenDropdown.d.ts +9 -0
  37. package/dist/components/PoolActions/TokenField.d.ts +11 -0
  38. package/dist/components/PoolActions/Trade.d.ts +23 -0
  39. package/dist/components/PoolActions/Withdraw.d.ts +12 -0
  40. package/dist/components/PoolActions/index.d.ts +6 -0
  41. package/dist/components/RemoveLiquidity/RemoveConfirmationModal.d.ts +10 -0
  42. package/dist/components/RemoveLiquidity/index.d.ts +7 -0
  43. package/dist/components/SelectToken/index.d.ts +14 -0
  44. package/dist/components/SwapComponent/SwapConfirmationModal.d.ts +10 -0
  45. package/dist/components/SwapComponent/index.d.ts +11 -0
  46. package/dist/components/TokenFields/TokenAmountField.d.ts +24 -0
  47. package/dist/components/TokenFields/TokenAmountView.d.ts +8 -0
  48. package/dist/components/TokenFields/index.d.ts +2 -0
  49. package/dist/components/TransactionSettings/index.d.ts +10 -0
  50. package/dist/components/Transfer/Send.d.ts +14 -0
  51. package/dist/components/Transfer/SendConfirmationModal.d.ts +9 -0
  52. package/dist/components/Transfer/TransferComponent.d.ts +14 -0
  53. package/dist/components/Transfer/index.d.ts +2 -0
  54. package/dist/components/common/Alert/index.d.ts +2 -0
  55. package/dist/components/common/Button/index.d.ts +27 -0
  56. package/dist/components/common/Card/index.d.ts +19 -0
  57. package/dist/components/common/Display/index.d.ts +35 -0
  58. package/dist/components/common/Dropdown/index.d.ts +11 -0
  59. package/dist/components/common/Icons/index.d.ts +33 -0
  60. package/dist/components/common/Input/index.d.ts +52 -0
  61. package/dist/components/common/Label/index.d.ts +12 -0
  62. package/dist/components/common/List/index.d.ts +10 -0
  63. package/dist/components/common/Loading/index.d.ts +9 -0
  64. package/dist/components/common/Modal/index.d.ts +27 -0
  65. package/dist/components/common/Text/index.d.ts +18 -0
  66. package/dist/components/common/Tooltip/index.d.ts +6 -0
  67. package/dist/components/common/index.d.ts +13 -0
  68. package/dist/components/index.d.ts +12 -0
  69. package/dist/graphql/apollo.d.ts +15 -0
  70. package/dist/graphql/evmEvents.d.ts +6 -0
  71. package/dist/graphql/gql.d.ts +3 -0
  72. package/dist/graphql/index.d.ts +1 -0
  73. package/dist/graphql/pools.d.ts +323 -0
  74. package/dist/graphql/utils.d.ts +5 -0
  75. package/dist/hooks/index.d.ts +16 -0
  76. package/dist/hooks/poolHooks.d.ts +25 -0
  77. package/dist/hooks/useAddLiquidity.d.ts +29 -0
  78. package/dist/hooks/useAllNfts.d.ts +4 -0
  79. package/dist/hooks/useAllPools.d.ts +7 -0
  80. package/dist/hooks/useAsyncEffect.d.ts +2 -0
  81. package/dist/hooks/useFromTime.d.ts +7 -0
  82. package/dist/hooks/useInitReefState.d.ts +2 -0
  83. package/dist/hooks/useKeepTokenUpdated.d.ts +3 -0
  84. package/dist/hooks/useLoadPool.d.ts +14 -0
  85. package/dist/hooks/useLoadPools.d.ts +4 -0
  86. package/dist/hooks/useLoadSignerTokens.d.ts +3 -0
  87. package/dist/hooks/useLoadSigners.d.ts +11 -0
  88. package/dist/hooks/useLoader.d.ts +9 -0
  89. package/dist/hooks/useObservableState.d.ts +2 -0
  90. package/dist/hooks/usePoolData.d.ts +34 -0
  91. package/dist/hooks/usePoolLists.d.ts +25 -0
  92. package/dist/hooks/usePoolStats.d.ts +29 -0
  93. package/dist/hooks/usePriceEstimator.d.ts +2 -0
  94. package/dist/hooks/useProvider.d.ts +3 -0
  95. package/dist/hooks/useReefPriceInterval.d.ts +2 -0
  96. package/dist/hooks/useRemoveLiquidity.d.ts +28 -0
  97. package/dist/hooks/useSwapState.d.ts +31 -0
  98. package/dist/hooks/useUpdateAccountBalance.d.ts +2 -0
  99. package/dist/hooks/useUpdateAmount.d.ts +11 -0
  100. package/dist/hooks/userInterval.d.ts +2 -0
  101. package/dist/index.css +2 -0
  102. package/dist/index.css.map +1 -0
  103. package/dist/index.d.ts +10 -0
  104. package/dist/index.js +5 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/index.modern.js +5 -0
  107. package/dist/index.modern.js.map +1 -0
  108. package/dist/rpc/accounts.d.ts +16 -0
  109. package/dist/rpc/index.d.ts +3 -0
  110. package/dist/rpc/rpc.d.ts +20 -0
  111. package/dist/rpc/tokens.d.ts +7 -0
  112. package/dist/state/index.d.ts +6 -0
  113. package/dist/state/network.d.ts +26 -0
  114. package/dist/state/nft.d.ts +14 -0
  115. package/dist/state/pool.d.ts +33 -0
  116. package/dist/state/settings.d.ts +15 -0
  117. package/dist/state/token.d.ts +71 -0
  118. package/dist/state/types.d.ts +76 -0
  119. package/dist/store/actionTypes.d.ts +16 -0
  120. package/dist/store/actions/addLiquidity.d.ts +21 -0
  121. package/dist/store/actions/defaultActions.d.ts +70 -0
  122. package/dist/store/actions/index.d.ts +4 -0
  123. package/dist/store/actions/removeLiquidity.d.ts +9 -0
  124. package/dist/store/actions/swap.d.ts +22 -0
  125. package/dist/store/index.d.ts +2 -0
  126. package/dist/store/reducers/addLiquidity.d.ts +15 -0
  127. package/dist/store/reducers/index.d.ts +3 -0
  128. package/dist/store/reducers/removeLiquidity.d.ts +14 -0
  129. package/dist/store/reducers/swap.d.ts +15 -0
  130. package/dist/utils/bindUtil.d.ts +10 -0
  131. package/dist/utils/dataWithProgress.d.ts +8 -0
  132. package/dist/utils/index.d.ts +11 -0
  133. package/dist/utils/math.d.ts +55 -0
  134. package/dist/utils/modalUtil.d.ts +2 -0
  135. package/dist/utils/nftUtil.d.ts +7 -0
  136. package/dist/utils/providerUtil.d.ts +3 -0
  137. package/dist/utils/rpcErrorMessageHandler.d.ts +4 -0
  138. package/dist/utils/tokenUtil.d.ts +12 -0
  139. package/dist/utils/transactionUtil.d.ts +37 -0
  140. package/dist/utils/utils.d.ts +32 -0
  141. package/package.json +97 -0
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ interface ButtonProps {
3
+ onClick?: () => void;
4
+ disabled?: boolean;
5
+ className?: string;
6
+ }
7
+ export declare const Button: React.FC<ButtonProps>;
8
+ export declare const EmptyButton: React.FC<ButtonProps>;
9
+ export declare const BackButton: ({ onClick }: ButtonProps) => JSX.Element;
10
+ interface SwitchTokenButton {
11
+ addIcon?: boolean;
12
+ disabled?: boolean;
13
+ onClick?: () => void;
14
+ }
15
+ interface IconButton {
16
+ onClick?: () => void;
17
+ }
18
+ export declare const SwitchTokenButton: ({ addIcon, disabled, onClick, }: SwitchTokenButton) => JSX.Element;
19
+ export declare const IconButton: React.FC<IconButton>;
20
+ export declare const ButtonGroup: React.FC<unknown>;
21
+ interface PercentageButton {
22
+ percentage?: number;
23
+ onClick?: () => void;
24
+ }
25
+ export declare const PercentageButton: React.FC<PercentageButton>;
26
+ export declare const DangerButton: React.FC<ButtonProps>;
27
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export declare const Card: React.FC;
3
+ export declare const CardHeader: React.FC<unknown>;
4
+ export declare const CardHeaderBlank: () => JSX.Element;
5
+ interface Title {
6
+ title: string;
7
+ }
8
+ export declare const CardTitle: React.FC<Title>;
9
+ interface CardBack {
10
+ onBack: () => void;
11
+ }
12
+ export declare const CardBack: ({ onBack }: CardBack) => JSX.Element;
13
+ interface ErrorCardProps {
14
+ title: string;
15
+ message: string;
16
+ }
17
+ export declare const ErrorCard: ({ title, message }: ErrorCardProps) => JSX.Element;
18
+ export declare const SubCard: React.FC<unknown>;
19
+ export {};
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ interface FlexRow {
3
+ className?: string;
4
+ children?: any;
5
+ }
6
+ export declare const FlexRow: React.FC<FlexRow>;
7
+ export declare const FullRow: React.FC<unknown>;
8
+ export declare const FlexColumn: React.FC<unknown>;
9
+ export declare const FullColumn: React.FC<unknown>;
10
+ export declare const CenterRow: React.FC<unknown>;
11
+ export declare const CenterColumn: React.FC<unknown>;
12
+ export declare const ContentCenter: React.FC<unknown>;
13
+ export declare const ContentBetween: React.FC<unknown>;
14
+ export declare const ContentEnd: React.FC<unknown>;
15
+ interface Width {
16
+ size: number;
17
+ }
18
+ export declare const Width: React.FC<Width>;
19
+ interface Size {
20
+ size?: '1' | '2' | '3' | '4' | '5' | '6' | 'auto';
21
+ }
22
+ export declare const Margin: React.FC<Size>;
23
+ export declare const MT: React.FC<Size>;
24
+ export declare const ME: React.FC<Size>;
25
+ export declare const MB: React.FC<Size>;
26
+ export declare const MS: React.FC<Size>;
27
+ export declare const MX: React.FC<Size>;
28
+ export declare const PY: React.FC<Size>;
29
+ export declare const PT: React.FC<Size>;
30
+ export declare const PE: React.FC<Size>;
31
+ export declare const PB: React.FC<Size>;
32
+ export declare const PS: React.FC<Size>;
33
+ export declare const Border: React.FC<Size>;
34
+ export declare const ComponentCenter: React.FC<unknown>;
35
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface Dropdown {
3
+ id?: string;
4
+ }
5
+ export declare const Dropdown: React.FC<unknown>;
6
+ export declare const DropdownButton: React.FC<Dropdown>;
7
+ interface DropdownMenu extends Dropdown {
8
+ size?: string;
9
+ }
10
+ export declare const DropdownMenu: React.FC<DropdownMenu>;
11
+ export {};
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ export declare const DEFAULT_TOKEN_ICONS: string[];
3
+ interface BaseIcon {
4
+ small?: boolean;
5
+ }
6
+ interface Icon extends BaseIcon {
7
+ className?: string;
8
+ }
9
+ declare const Icon: React.FC<Icon>;
10
+ export default Icon;
11
+ export declare const WalletIcon: () => JSX.Element;
12
+ export declare const GearIcon: ({ small }: BaseIcon) => JSX.Element;
13
+ export declare const BackIcon: ({ small }: BaseIcon) => JSX.Element;
14
+ export declare const DownIcon: ({ small }: BaseIcon) => JSX.Element;
15
+ export declare const UpIcon: ({ small }: BaseIcon) => JSX.Element;
16
+ export declare const DownArrowIcon: ({ small }: BaseIcon) => JSX.Element;
17
+ export declare const ChatIcon: ({ small }: BaseIcon) => JSX.Element;
18
+ export declare const InfoIcon: ({ small }: BaseIcon) => JSX.Element;
19
+ export declare const BookIcon: ({ small }: BaseIcon) => JSX.Element;
20
+ export declare const CodeIcon: ({ small }: BaseIcon) => JSX.Element;
21
+ export declare const CloseIcon: ({ small }: BaseIcon) => JSX.Element;
22
+ export declare const ExploreIcon: ({ small }: BaseIcon) => JSX.Element;
23
+ export declare const CopyIcon: ({ small }: BaseIcon) => JSX.Element;
24
+ export declare const PlusIcon: ({ small }: BaseIcon) => JSX.Element;
25
+ interface TokenIcon extends BaseIcon {
26
+ src: string;
27
+ address?: string;
28
+ }
29
+ export declare const TokenIcon: ({ src, address }: TokenIcon) => JSX.Element;
30
+ interface ReefAddressIcon {
31
+ address: string;
32
+ }
33
+ export declare const ReefAddressIcon: ({ address }: ReefAddressIcon) => JSX.Element;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ interface Input {
3
+ value?: string;
4
+ disabled?: boolean;
5
+ maxLength?: number;
6
+ placeholder?: string;
7
+ className?: string;
8
+ onChange?: (value: string) => void;
9
+ }
10
+ export declare const Input: ({ value, disabled, maxLength, placeholder, className, onChange, }: Input) => JSX.Element;
11
+ interface InputAmount {
12
+ amount: string;
13
+ disabled?: boolean;
14
+ min?: number;
15
+ max?: number;
16
+ placeholder?: string;
17
+ onAmountChange: (value: string) => void;
18
+ onValidityChange?: (error: InputAmountValidity) => void;
19
+ }
20
+ export interface InputAmountValidity {
21
+ valid: boolean;
22
+ errorMessage?: string;
23
+ }
24
+ export declare const InputAmount: ({ amount, onAmountChange, min, max, placeholder, disabled, onValidityChange, }: InputAmount) => JSX.Element;
25
+ export declare const InputGroup: React.FC<unknown>;
26
+ export declare const InputTextGroup: React.FC<unknown>;
27
+ interface NumberInput {
28
+ min?: number;
29
+ max?: number;
30
+ step?: number;
31
+ value: string;
32
+ className?: string;
33
+ placeholder?: string;
34
+ onChange: (value: string) => void;
35
+ disableDecimals?: boolean;
36
+ }
37
+ export declare const NumberInput: ({ value, min, max, step, placeholder, onChange, disableDecimals, className, }: NumberInput) => JSX.Element;
38
+ interface PercentageRangeAmount {
39
+ value: number;
40
+ disabled?: boolean;
41
+ onChange: (value: number) => void;
42
+ }
43
+ export declare const PercentageRangeAmount: ({ value, disabled, onChange, }: PercentageRangeAmount) => JSX.Element;
44
+ interface CheckboxInput {
45
+ checked: boolean;
46
+ disabled?: boolean;
47
+ onChange: (value: any) => void;
48
+ id: string;
49
+ labelText?: string;
50
+ }
51
+ export declare const CheckboxInput: ({ checked, disabled, onChange, id, labelText, }: CheckboxInput) => JSX.Element;
52
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export declare const Label: React.FC<unknown>;
3
+ interface ConfirmLabel {
4
+ title: string;
5
+ value: string;
6
+ titleSize?: string;
7
+ valueSize?: string;
8
+ }
9
+ export declare const ConfirmLabel: ({ title, value, titleSize, valueSize, }: ConfirmLabel) => JSX.Element;
10
+ export declare const FormLabel: React.FC<unknown>;
11
+ export declare const TransactionWarningLabel: React.FC<unknown>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface ListItem {
3
+ onClick?: () => void;
4
+ }
5
+ export declare const List: React.FC<unknown>;
6
+ export declare const ListItem: React.FC<ListItem>;
7
+ export declare const ListItemDismissModal: React.FC<ListItem>;
8
+ export declare const ListItemActionModal: React.FC<ListItem>;
9
+ export declare const ListEmptyItem: () => JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const Loading: () => JSX.Element;
2
+ export declare const LoadingButtonIcon: () => JSX.Element;
3
+ interface LoadingWithText {
4
+ text: string;
5
+ }
6
+ export declare const LoadingWithText: ({ text }: LoadingWithText) => JSX.Element;
7
+ export declare const LoadingComponent: ({ text }: LoadingWithText) => JSX.Element;
8
+ export declare const LoadingButtonIconWithText: ({ text, }: LoadingWithText) => JSX.Element;
9
+ export {};
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ interface Modal {
3
+ id?: string;
4
+ }
5
+ export declare const Modal: React.FC<Modal>;
6
+ export declare const ModalHeader: React.FC<unknown>;
7
+ export declare const ModalBody: React.FC<unknown>;
8
+ export declare const ModalFooter: React.FC<unknown>;
9
+ interface ModalClose {
10
+ onClick?: () => void;
11
+ className?: string;
12
+ }
13
+ export declare const ModalClose: React.FC<ModalClose>;
14
+ interface OpenModalButton {
15
+ id?: string;
16
+ disabled?: boolean;
17
+ className?: string;
18
+ }
19
+ export declare const OpenModalButton: React.FC<OpenModalButton>;
20
+ interface ConfirmationModal {
21
+ id?: string;
22
+ title: string;
23
+ confirmFun: () => void;
24
+ confirmBtnLabel?: string;
25
+ }
26
+ declare const ConfirmationModal: React.FC<ConfirmationModal>;
27
+ export default ConfirmationModal;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Color } from '../../../state/types';
3
+ export declare const LargeTitle: React.FC<unknown>;
4
+ export declare const Title: React.FC<unknown>;
5
+ export declare const LeadText: React.FC<unknown>;
6
+ interface Text {
7
+ size?: number;
8
+ className?: string;
9
+ }
10
+ export declare const Text: React.FC<Text>;
11
+ export declare const BoldText: React.FC<Text>;
12
+ interface ColorText extends Text {
13
+ color?: Color;
14
+ }
15
+ export declare const ColorText: React.FC<ColorText>;
16
+ export declare const MiniText: React.FC<unknown>;
17
+ export declare const MutedText: React.FC<unknown>;
18
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface Tooltip {
3
+ id?: string;
4
+ }
5
+ export declare const QuestionTooltip: React.FC<Tooltip>;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ export * as Card from './Card';
2
+ export * as Text from './Text';
3
+ export * as List from './List';
4
+ export * as Alert from './Alert';
5
+ export * as Icons from './Icons';
6
+ export * as Input from './Input';
7
+ export * as Label from './Label';
8
+ export * as Modal from './Modal';
9
+ export * as Button from './Button';
10
+ export * as Display from './Display';
11
+ export * as Loading from './Loading';
12
+ export * as Tooltip from './Tooltip';
13
+ export * as Dropdown from './Dropdown';
@@ -0,0 +1,12 @@
1
+ export * from './common';
2
+ export * from './PoolActions/index';
3
+ export * from './SelectToken';
4
+ export * from './TokenFields';
5
+ export * from './AddLiquidity';
6
+ export * from './SwapComponent';
7
+ export * from './AccountSelector/AccountSelector';
8
+ export * from './AccountSelector/AccountListModal';
9
+ export * from './RemoveLiquidity';
10
+ export * from './Transfer';
11
+ export * from './EvmBind/EvmBindComponent';
12
+ export * from './OverlayAction';
@@ -0,0 +1,15 @@
1
+ /// <reference types="zen-observable" />
2
+ import { ApolloClient } from '@apollo/client';
3
+ import { Observable, ReplaySubject } from 'rxjs';
4
+ import { Observable as ZenObservable } from 'zen-observable-ts';
5
+ export interface GQLUrl {
6
+ http: string;
7
+ ws: string;
8
+ }
9
+ export declare const apolloExplorerClientSubj: ReplaySubject<ApolloClient<any>>;
10
+ export declare const setApolloExplorerUrls: (urls: GQLUrl) => void;
11
+ export declare const apolloExplorerClientInstance$: Observable<ApolloClient<any>>;
12
+ export declare const apolloDexClientSubj: ReplaySubject<ApolloClient<any>>;
13
+ export declare const setApolloDexUrls: (urls: GQLUrl) => void;
14
+ export declare const apolloDexClientInstance$: Observable<ApolloClient<any>>;
15
+ export declare const zenToRx: <T>(zenObservable: ZenObservable<T>) => Observable<T>;
@@ -0,0 +1,6 @@
1
+ import { Observable } from 'rxjs';
2
+ export declare function getEvmEvents$(contractAddress: string, methodSignature?: string, fromBlockId?: number, toBlockId?: number): Observable<{
3
+ fromBlockId: number;
4
+ toBlockId: number;
5
+ evmEvents: any[];
6
+ } | null>;
@@ -0,0 +1,3 @@
1
+ export declare const CONTRACT_EVENTS_GQL = "\n subscription events(\n $blockNumber: bigint\n $perPage: Int!\n $offset: Int!\n $contractAddressFilter: String!\n ) {\n event(\n limit: $perPage\n offset: $offset\n where: {block_number: { _eq: $blockNumber }, section: { _eq: \"evm\" }, method: { _eq: \"Log\" }, data: {_like: $contractAddressFilter}}\n order_by: { block_number: desc, event_index: desc }\n ) {\n block_number\n event_index\n data\n method\n phase\n section\n timestamp\n }\n }\n ";
2
+ export declare const REEF_TRANSFERS_GQL = "\n subscription reefTransfers(\n $blockNumber: bigint\n $perPage: Int!\n $offset: Int!\n $address: String!\n ) {\n transfer(\n limit: $perPage\n offset: $offset\n where: {block_number: { _eq: $blockNumber }, source: { _eq: $address } }\n order_by: { block_number: desc, extrinsic_index: desc }\n ) {\n block_number\n section\n method\n hash\n source\n destination\n amount\n denom\n fee_amount\n success\n error_message\n timestamp\n }\n }\n ";
3
+ export declare const TOKEN_BALANCES_GQL = "\n subscription tokenHolders(\n $contractId: String!\n $accountAddress: String!\n $perPage: Int!\n $offset: Int!\n ) {\n token_holder(\n limit: $perPage\n offset: $offset\n where: {contract_id: { _eq: $contractId }, holder_evm_address: { _like: $accountAddress } }\n order_by: { block_height: desc }\n ) {\n contract_id\n holder_account_id\n holder_evm_address\n balance\n block_height\n timestamp\n }\n }\n ";
@@ -0,0 +1 @@
1
+ export * from './gql';
@@ -0,0 +1,323 @@
1
+ import { BaseFeeData, BaseReservedData, BaseVolumeData, FeeData, PriceData, ReservedData, VolumeData } from '../state';
2
+ export type BasePoolTransactionTypes = 'Swap' | 'Mint' | 'Burn';
3
+ export type TransactionTypes = BasePoolTransactionTypes | 'All';
4
+ interface Timeframe {
5
+ timeframe: string;
6
+ }
7
+ interface Supply {
8
+ totalSupply: number;
9
+ supply: number;
10
+ }
11
+ export interface Amounts {
12
+ amount1: number;
13
+ amount2: number;
14
+ }
15
+ interface TimeframedVolume extends Amounts, Timeframe {
16
+ }
17
+ interface Fee {
18
+ fee1: number;
19
+ fee2: number;
20
+ }
21
+ interface TimeframedFee extends Fee, Timeframe {
22
+ }
23
+ interface Reserves {
24
+ reserved1: string;
25
+ reserved2: string;
26
+ }
27
+ export interface PoolReserves extends Reserves {
28
+ token1: string;
29
+ token2: string;
30
+ }
31
+ interface AllPool extends BasicPoolData, Reserves {
32
+ }
33
+ interface ContractData {
34
+ symbol: string;
35
+ name: string;
36
+ decimals: number;
37
+ }
38
+ interface BasicPoolData {
39
+ address: string;
40
+ token1: string;
41
+ token2: string;
42
+ decimals1: number;
43
+ decimals2: number;
44
+ name1: string;
45
+ name2: string;
46
+ symbol1: string;
47
+ symbol2: string;
48
+ iconUrl1: string;
49
+ iconUrl2: string;
50
+ }
51
+ interface Token {
52
+ id: string;
53
+ decimals: number;
54
+ name: string;
55
+ symbol: string;
56
+ iconUrl: string;
57
+ }
58
+ interface PoolData {
59
+ id: string;
60
+ token1: Token;
61
+ token2: Token;
62
+ decimals: number;
63
+ }
64
+ interface PoolTokensData {
65
+ token1: Token;
66
+ token2: Token;
67
+ }
68
+ interface ContractData {
69
+ contractData: ContractData;
70
+ }
71
+ interface PoolInfo {
72
+ reserves: BaseReservedData;
73
+ fee: BaseFeeData;
74
+ currentDayVolume: BaseVolumeData;
75
+ previousDayVolume: BaseVolumeData;
76
+ totalSupply: string;
77
+ userSupply: string;
78
+ }
79
+ interface PoolTransaction {
80
+ id: string;
81
+ amount1: number;
82
+ amount2: number;
83
+ amountIn1: number;
84
+ amountIn2: number;
85
+ senderAddress: string;
86
+ toAddress: string | null;
87
+ blockHeight: number;
88
+ indexInBlock: number;
89
+ timestamp: string;
90
+ type: BasePoolTransactionTypes;
91
+ pool: {
92
+ token1: {
93
+ decimals: number;
94
+ symbol: string;
95
+ };
96
+ token2: {
97
+ decimals: number;
98
+ symbol: string;
99
+ };
100
+ };
101
+ signerAddress: string;
102
+ }
103
+ interface TVLData extends Timeframe {
104
+ totalSupply: number;
105
+ }
106
+ export interface PoolListItem {
107
+ id: string;
108
+ token1: string;
109
+ token2: string;
110
+ reserved1: string;
111
+ reserved2: string;
112
+ decimals1: number;
113
+ decimals2: number;
114
+ symbol1: string;
115
+ symbol2: string;
116
+ name1: string;
117
+ name2: string;
118
+ iconUrl1: string;
119
+ iconUrl2: string;
120
+ dayVolume1: string | null;
121
+ dayVolume2: string | null;
122
+ prevDayVolume1: string | null;
123
+ prevDayVolume2: string | null;
124
+ userLockedAmount1: string | null;
125
+ userLockedAmount2: string | null;
126
+ }
127
+ export type PoolQuery = {
128
+ pool: PoolData[];
129
+ };
130
+ export type PoolTokensDataQuery = {
131
+ poolById: PoolTokensData;
132
+ };
133
+ export type ContractDataQuery = {
134
+ verifiedContractById: ContractData;
135
+ };
136
+ export type PoolInfoQuery = {
137
+ poolInfo: PoolInfo;
138
+ };
139
+ export type PoolDataQuery = {
140
+ poolData: PoolDataFull;
141
+ };
142
+ export type PoolDayFeeQuery = {
143
+ poolTimeFees: TimeframedFee[];
144
+ };
145
+ export type PoolDayTvlQuery = {
146
+ poolTimeSupply: TVLData[];
147
+ };
148
+ export type PoolReservesQuery = {
149
+ poolEvents: Reserves[];
150
+ };
151
+ export type PoolsWithReservesQuery = {
152
+ poolsReserves: PoolReserves[];
153
+ };
154
+ export type AllPoolsQuery = {
155
+ allPools: AllPool[];
156
+ };
157
+ export type PoolSupplyQuery = {
158
+ poolMinuteSupplies: Supply[];
159
+ };
160
+ export type PoolDayVolumeQuery = {
161
+ poolDayVolumes: TimeframedVolume[];
162
+ };
163
+ export type PoolTransactionQuery = {
164
+ poolEvents: PoolTransaction[];
165
+ };
166
+ export type PoolVolumeAggregateQuery = {
167
+ poolVolume: Amounts;
168
+ };
169
+ export type AllPoolsListQuery = {
170
+ allPoolsList: PoolListItem[];
171
+ };
172
+ export type AllPoolsListCountQuery = {
173
+ allPoolsListCount: number;
174
+ };
175
+ export type UserPoolsListQuery = {
176
+ userPoolsList: PoolListItem[];
177
+ };
178
+ export type UserPoolsListCountQuery = {
179
+ userPoolsListCount: number;
180
+ };
181
+ export type UserPoolSupplyQuery = {
182
+ userPoolSupply: UserPoolSupply;
183
+ };
184
+ export type PoolFeeQuery = {
185
+ poolFee: Fee;
186
+ };
187
+ export type PoolTransactionCountQuery = {
188
+ poolEventsConnection: {
189
+ totalCount: number;
190
+ };
191
+ };
192
+ export type Pool24HVolume = {
193
+ volume: {
194
+ pool: {
195
+ address: string;
196
+ token1: string;
197
+ token2: string;
198
+ };
199
+ amount1: number;
200
+ amount2: number;
201
+ }[];
202
+ };
203
+ export interface PoolDataFull {
204
+ fee: FeeData[];
205
+ volume: VolumeData[];
206
+ price: PriceData[];
207
+ previousReserves: ReservedData;
208
+ allReserves: ReservedData[];
209
+ }
210
+ export type PoolsTotalSupply = {
211
+ totalSupply: {
212
+ pool: {
213
+ address: string;
214
+ token1: string;
215
+ token2: string;
216
+ };
217
+ reserved1: string;
218
+ reserved2: string;
219
+ }[];
220
+ };
221
+ export interface UserPoolSupply extends Reserves {
222
+ address: string;
223
+ decimals: number;
224
+ totalSupply: string;
225
+ userSupply: string;
226
+ }
227
+ interface FromVar {
228
+ fromTime: string;
229
+ }
230
+ interface AddressVar {
231
+ address: string;
232
+ }
233
+ interface SignerAddressVar {
234
+ signerAddress: string;
235
+ }
236
+ interface ToVar {
237
+ toTime: string;
238
+ }
239
+ interface OptionalSearchVar {
240
+ search: string;
241
+ }
242
+ interface OffsetVar {
243
+ offset: number;
244
+ }
245
+ interface LimitVar {
246
+ limit: number;
247
+ }
248
+ interface TransactionTypeVar {
249
+ type: BasePoolTransactionTypes[];
250
+ }
251
+ interface PaginationVar {
252
+ limit: number;
253
+ offset: number;
254
+ }
255
+ interface PoolSearchVar {
256
+ search: string;
257
+ signerAddress: string;
258
+ }
259
+ export interface UserPoolSupplyVar {
260
+ signerAddress: string;
261
+ token1: string;
262
+ token2: string;
263
+ }
264
+ export type PoolVar = AddressVar;
265
+ export type PoolSupplyVar = AddressVar;
266
+ export type PoolVolume24HVar = FromVar;
267
+ export type PoolReservesVar = AddressVar;
268
+ export type PoolsTotalValueLockedVar = ToVar;
269
+ export type PoolTokensVar = AddressVar;
270
+ export type ContractDataVar = AddressVar;
271
+ export interface PoolFeeVar extends AddressVar, FromVar {
272
+ }
273
+ export interface PoolDayTvlVar extends AddressVar, FromVar {
274
+ }
275
+ export interface PoolDataVar extends AddressVar, FromVar {
276
+ }
277
+ export interface PoolVolumeVar extends AddressVar, FromVar {
278
+ }
279
+ export interface PoolDayFeeVar extends AddressVar, FromVar {
280
+ }
281
+ export interface PoolVolumeAggregateVar extends PoolFeeVar, ToVar {
282
+ }
283
+ export interface PoolInfoVar extends AddressVar, FromVar, ToVar, SignerAddressVar {
284
+ }
285
+ export interface PoolBasicTransactionVar extends OptionalSearchVar, TransactionTypeVar {
286
+ }
287
+ export interface PoolTransactionCountVar extends OptionalSearchVar, TransactionTypeVar {
288
+ }
289
+ export interface PoolTransactionVar extends PoolBasicTransactionVar, OffsetVar, LimitVar {
290
+ }
291
+ export interface PoolsListVar extends PoolSearchVar, PaginationVar {
292
+ }
293
+ export type PoolsListCountVar = PoolSearchVar;
294
+ export declare const POOLS_TOTAL_VALUE_LOCKED = "\n query totalSupply($toTime: String!) {\n totalSupply(toTime: $toTime) {\n pool {\n address\n token1\n token2\n }\n reserved1\n reserved2\n }\n }\n";
295
+ export declare const POOL_24H_VOLUME = "\n query volume($fromTime: String!) {\n volume(fromTime: $fromTime) {\n pool {\n address\n token1\n token2\n }\n amount1\n amount2\n }\n }\n";
296
+ export declare const POOL_SUPPLY_GQL = "\n query poolSupply($address: String!) {\n poolMinuteSupplies(\n where: { poolId_eq: $address }\n orderBy: timeframe_DESC\n limit: 1\n ) {\n totalSupply\n supply\n }\n }\n";
297
+ export declare const POOL_VOLUME_AGGREGATE_GQL = "\n query poolVolume(\n $address: String!\n $fromTime: String!\n $toTime: String!\n ) {\n poolVolume(\n address: $address\n fromTime: $fromTime\n toTime: $toTime\n ) {\n amount1\n amount2\n }\n }\n";
298
+ export declare const POOL_DAY_VOLUME_GQL: string;
299
+ export declare const POOL_HOUR_VOLUME_GQL: string;
300
+ export declare const POOL_MINUTE_VOLUME_GQL: string;
301
+ export declare const POOL_FEES_GQL = "\n query poolFee(\n $address: String!\n $fromTime: String!\n ) {\n poolFee(\n address: $address\n fromTime: $fromTime\n ) {\n fee1\n fee2\n }\n }\n";
302
+ export declare const POOL_GQL = "\n query pool($address: String!) {\n poolById(id: $address) {\n id\n token1 {\n id\n decimals\n name\n symbol\n iconUrl\n }\n token2 {\n id\n decimals\n name\n symbol\n iconUrl\n }\n decimals\n }\n }\n";
303
+ export declare const POOL_CURRENT_RESERVES_GQL = "\n query poolEvent($address: String!) {\n poolEvents(\n where: { pool: { id_eq: $address }, type_eq: Sync }\n orderBy: timestamp_DESC\n limit: 1\n ) {\n reserved1\n reserved2\n }\n }\n";
304
+ export declare const POOLS_RESERVES_GQL = "\n query poolsReserves($tokens: [String!]!) {\n poolsReserves(tokens: $tokens) {\n token1\n token2\n reserved1\n reserved2\n }\n }\n";
305
+ export declare const POOL_TRANSACTIONS_GQL = "\n subscription transactions(\n $search: String!\n $type: [PoolType!]\n $offset: Int!\n $limit: Int!\n ) {\n poolEvents(\n limit: $limit, \n offset: $offset, \n orderBy: timestamp_DESC, \n where: {\n pool: {\n id_containsInsensitive: $search, \n AND: { verified_eq: true }\n }, \n AND: {type_in: $type}\n }\n ) {\n id\n amount1\n amount2\n amountIn1\n amountIn2\n senderAddress\n toAddress\n blockHeight\n indexInBlock\n timestamp\n type\n pool {\n token1 {\n decimals\n symbol\n }\n token2 {\n decimals\n symbol\n }\n }\n signerAddress\n }\n }\n";
306
+ export declare const POOL_TRANSACTION_COUNT_GQL = "\n query transactionCount(\n $search: String!\n $type: [PoolType!]\n ) {\n poolEventsConnection(\n orderBy: timestamp_DESC, \n where: {\n pool: {\n id_containsInsensitive: $search, \n AND: { verified_eq: true }\n }, \n AND: {type_in: $type}\n }\n ) {\n totalCount\n }\n }\n";
307
+ type Time = 'Day' | 'Hour' | 'Minute';
308
+ export declare const POOL_DAY_TVL_GQL: string;
309
+ export declare const POOL_HOUR_TVL_GQL: string;
310
+ export declare const POOL_MINUTE_TVL_GQL: string;
311
+ export declare const POOL_DAY_FEE_QUERY_GQL: string;
312
+ export declare const POOL_HOUR_FEE_QUERY_GQL: string;
313
+ export declare const POOL_MINUTE_FEE_QUERY_GQL: string;
314
+ export declare const POOL_TOKENS_DATA_GQL = "\n query poolTokens($address: String!) {\n poolById(id: $address) {\n token1 {\n id\n decimals\n name\n symbol\n iconUrl\n }\n token2 {\n id\n decimals\n name\n symbol\n iconUrl\n }\n }\n }\n";
315
+ export declare const POOL_INFO_GQL = "\n query poolInfo(\n $address: String!\n $signerAddress: String!\n $fromTime: String!\n $toTime: String!\n ) {\n poolInfo(\n address: $address\n signerAddress: $signerAddress\n fromTime: $fromTime\n toTime: $toTime\n ) {\n fee {\n fee1\n fee2\n }\n currentDayVolume {\n amount1\n amount2\n }\n previousDayVolume {\n amount1\n amount2\n }\n reserves {\n reserved1\n reserved2\n }\n totalSupply\n userSupply\n }\n }\n";
316
+ export declare const poolDataQuery: (time: Time) => string;
317
+ export declare const ALL_POOLS = "\n query allPools {\n allPools {\n address\n decimals1\n decimals2\n reserved1\n reserved2\n symbol1\n symbol2\n token1\n token2\n name1\n name2\n iconUrl1\n iconUrl2\n }\n }\n";
318
+ export declare const ALL_POOLS_LIST = "\n query allPoolsList($signerAddress: String!, $limit: Float!, $offset: Float!, $search: String!) {\n allPoolsList(signerAddress: $signerAddress, limit: $limit, offset: $offset, search: $search) {\n id\n name1\n name2\n prevDayVolume1\n prevDayVolume2\n reserved1\n reserved2\n symbol1\n symbol2\n token1\n token2\n iconUrl1\n iconUrl2\n userLockedAmount1\n userLockedAmount2\n dayVolume2\n dayVolume1\n decimals1\n decimals2\n }\n }\n";
319
+ export declare const ALL_POOLS_LIST_COUNT = "\n query allPoolsListCount($signerAddress: String!, $search: String!) {\n allPoolsListCount(signerAddress: $signerAddress, search: $search)\n }\n";
320
+ export declare const USER_POOLS_LIST = "\n query userPoolsList($signerAddress: String!, $limit: Float!, $offset: Float!, $search: String!) {\n userPoolsList(signerAddress: $signerAddress, limit: $limit, offset: $offset, search: $search) {\n id\n name1\n name2\n prevDayVolume1\n prevDayVolume2\n reserved1\n reserved2\n symbol1\n symbol2\n token1\n token2\n userLockedAmount1\n userLockedAmount2\n dayVolume2\n dayVolume1\n decimals1\n decimals2\n }\n }\n";
321
+ export declare const USER_POOLS_LIST_COUNT = "\n query userPoolsListCount($signerAddress: String!, $search: String!) {\n userPoolsListCount(signerAddress: $signerAddress, search: $search)\n }\n";
322
+ export declare const USER_POOL_SUPPLY = "\n query userPoolSupply($token1: String!, $token2: String!, $signerAddress: String!) {\n userPoolSupply(token1: $token1, token2: $token2, signerAddress: $signerAddress) {\n address\n decimals\n reserved1\n reserved2\n totalSupply\n userSupply\n }\n }\n";
323
+ export {};
@@ -0,0 +1,5 @@
1
+ import { AxiosInstance } from "axios";
2
+ export declare const graphqlRequest: (httpClient: AxiosInstance, queryObj: {
3
+ query: string;
4
+ variables: any;
5
+ }, isExplorer?: boolean) => Promise<import("axios").AxiosResponse<any>>;