Compare commits

...
44 changed files with 581 additions and 847 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ module.exports = defineConfig({
env: {
TRADING_TEST_VEGA_WALLET_NAME: 'UI_Trading_Test',
ETHEREUM_PROVIDER_URL:
'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
VEGA_PUBLIC_KEY:
'47836c253520d2661bf5bed6339c0de08fd02cf5d4db0efee3b4373f20c7d278',
VEGA_PUBLIC_KEY2:
@@ -33,7 +33,7 @@ module.exports = defineConfig({
TRUNCATED_VEGA_PUBLIC_KEY: '47836c…c7d278',
TRUNCATED_VEGA_PUBLIC_KEY2: '1a18cd…0cf2e4',
ETHEREUM_WALLET_ADDRESS: '0x265Cc6d39a1B53d0d92068443009eE7410807158',
ETHERSCAN_URL: 'https://ropsten.etherscan.io',
ETHERSCAN_URL: 'https://sepolia.etherscan.io',
tsConfig: 'tsconfig.json',
TAGS: 'not @todo and not @ignore and not @manual',
TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123',
+2 -2
View File
@@ -21,7 +21,7 @@ NX_VEGA_CONFIG_URL="https://static.vega.xyz/assets/testnet-network.json"
NX_VEGA_ENV = 'TESTNET'
NX_VEGA_URL="https://api.n11.testnet.vega.xyz/graphql"
NX_VEGA_WALLET_URL=http://localhost:1789
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_NETWORKS={"MAINNET":"https://alpha.console.vega.xyz"}
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
+2 -2
View File
@@ -3,6 +3,6 @@ NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_ENV=DEVNET
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"}
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz
+2 -2
View File
@@ -2,6 +2,6 @@
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_ENV=STAGNET3
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://staging2.explorer.vega.xyz
+2 -2
View File
@@ -3,6 +3,6 @@ NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n12.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
+1 -1
View File
@@ -25,7 +25,7 @@ module.exports = defineConfig({
env: {
environment: 'CUSTOM',
networkQueryUrl: 'http://localhost:3028/query',
ethUrl: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
ethUrl: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
commitHash: 'dev',
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true,
tsConfig: 'tsconfig.json',
+2 -2
View File
@@ -21,7 +21,7 @@ NX_VEGA_CONFIG_URL="https://static.vega.xyz/assets/testnet-network.json"
NX_VEGA_ENV = 'TESTNET'
NX_VEGA_URL="https://api.n11.testnet.vega.xyz/graphql"
NX_VEGA_WALLET_URL=http://localhost:1789
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_NETWORKS={"MAINNET":"https://alpha.console.vega.xyz"}
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
@@ -3,6 +3,6 @@ NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_ENV=DEVNET
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"}
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz
@@ -2,6 +2,6 @@
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_ENV=STAGNET3
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://staging2.explorer.vega.xyz
@@ -3,6 +3,6 @@ NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_ENV=TESTNET
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
@@ -0,0 +1,45 @@
/* tslint:disable */
/* eslint-disable */
// @generated
// This file was automatically generated and should not be edited.
// ====================================================
// GraphQL query operation: AddSignerBundle
// ====================================================
export interface AddSignerBundle_erc20MultiSigSignerAddedBundles_edges_node {
__typename: "ERC20MultiSigSignerAddedBundle";
/**
* The ethereum address of the signer to be added
*/
newSigner: string;
/**
* The nonce used in the signing operation
*/
nonce: string;
/**
* The bundle of signatures from current validators to sign in the new signer
*/
signatures: string;
}
export interface AddSignerBundle_erc20MultiSigSignerAddedBundles_edges {
__typename: "ERC20MultiSigSignerAddedBundleEdge";
node: AddSignerBundle_erc20MultiSigSignerAddedBundles_edges_node;
}
export interface AddSignerBundle_erc20MultiSigSignerAddedBundles {
__typename: "ERC20MultiSigSignerAddedConnection";
edges: (AddSignerBundle_erc20MultiSigSignerAddedBundles_edges | null)[] | null;
}
export interface AddSignerBundle {
/**
* Get the signature bundle to add a particular validator to the signer list of the multisig contract
*/
erc20MultiSigSignerAddedBundles: AddSignerBundle_erc20MultiSigSignerAddedBundles;
}
export interface AddSignerBundleVariables {
nodeId: string;
}
@@ -0,0 +1,48 @@
/* tslint:disable */
/* eslint-disable */
// @generated
// This file was automatically generated and should not be edited.
// ====================================================
// GraphQL query operation: RemoveSignerBundle
// ====================================================
export interface RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges_node {
__typename: "ERC20MultiSigSignerRemovedBundle";
/**
* The ethereum address of the signer to be removed
*/
oldSigner: string;
/**
* The nonce used in the signing operation
*/
nonce: string;
/**
* The bundle of signatures from current validators to sign in the new signer
*/
signatures: string;
}
export interface RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges {
__typename: "ERC20MultiSigSignerRemovedBundleEdge";
node: RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges_node;
}
export interface RemoveSignerBundle_erc20MultiSigSignerRemovedBundles {
__typename: "ERC20MultiSigSignerRemovedConnection";
/**
* The list of signer bundles for that validator
*/
edges: (RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges | null)[] | null;
}
export interface RemoveSignerBundle {
/**
* Get the signatures bundle to remove a particular validator from signer list of the multisig contract
*/
erc20MultiSigSignerRemovedBundles: RemoveSignerBundle_erc20MultiSigSignerRemovedBundles;
}
export interface RemoveSignerBundleVariables {
nodeId: string;
}
+1 -1
View File
@@ -1,7 +1,7 @@
# App configuration variables
NX_VEGA_ENV=TESTNET
NX_ETHEREUM_PROVIDER_URL=http://localhost:8545
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_FAIRGROUND=false
NX_VEGA_NETWORKS={}
+2 -2
View File
@@ -1,5 +1,5 @@
# App configuration variables
NX_VEGA_ENV=DEVNET
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
+2 -2
View File
@@ -1,5 +1,5 @@
# App configuration variables
NX_VEGA_ENV=STAGNET3
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
+2 -2
View File
@@ -1,5 +1,5 @@
# App configuration variables
NX_VEGA_ENV=TESTNET
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
+2 -2
View File
@@ -2,8 +2,8 @@
NX_VEGA_ENV=TESTNET
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_FAIRGROUND=false
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
+1 -1
View File
@@ -1,7 +1,7 @@
# App configuration variables
NX_VEGA_ENV=CUSTOM
NX_ETHEREUM_PROVIDER_URL=http://localhost:8545
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_FAIRGROUND=false
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
+2 -2
View File
@@ -3,8 +3,8 @@ NX_VEGA_ENV=DEVNET
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/testnet
+2 -2
View File
@@ -3,8 +3,8 @@ NX_VEGA_ENV=TESTNET
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/testnet
-1
View File
@@ -40,7 +40,6 @@ There are a few different configuration options offered for this app:
| **Flag** | **Purpose** |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NX_APP_SENTRY_DSN` | The sentry endpoint to report to. Should be off in dev but set in live. |
| `NX_APP_CHAIN` | The ETH chain for the app to work on. Should be mainnet for live, but ropsten for preview deploys. |
| `NX_APP_VEGA_URL` | The GraphQL query endpoint of a [Vega data node](https://github.com/vegaprotocol/networks#data-node) |
| `NX_APP_DEX_STAKING_DISABLED` | Disable the dex liquidity page an show a coming soon message |
| `NX_APP_FAIRGROUND` | Change styling to be themed as the fairground version of the website |
@@ -43,7 +43,7 @@ export interface AppState {
/** Array of tranche objects */
tranches: Tranche[] | null;
/** Number of decimal places of the VEGA token (18 on Mainnet, 5 on Ropsten) */
/** Number of decimal places of the VEGA token (18 on Mainnet, 5 on Testnet) */
decimals: number;
/** Total supply of VEGA tokens */
+2 -2
View File
@@ -39,7 +39,7 @@ module.exports = defineConfig({
env: {
TRADING_TEST_VEGA_WALLET_NAME: 'UI_Trading_Test',
ETHEREUM_PROVIDER_URL:
'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
VEGA_PUBLIC_KEY:
'47836c253520d2661bf5bed6339c0de08fd02cf5d4db0efee3b4373f20c7d278',
VEGA_PUBLIC_KEY2:
@@ -47,7 +47,7 @@ module.exports = defineConfig({
TRUNCATED_VEGA_PUBLIC_KEY: '47836c…c7d278',
TRUNCATED_VEGA_PUBLIC_KEY2: '1a18cd…0cf2e4',
ETHEREUM_WALLET_ADDRESS: '0x265Cc6d39a1B53d0d92068443009eE7410807158',
ETHERSCAN_URL: 'https://ropsten.etherscan.io',
ETHERSCAN_URL: 'https://sepolia.etherscan.io',
tsConfig: 'tsconfig.json',
TAGS: 'not @todo and not @ignore and not @manual',
TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123',
+2 -2
View File
@@ -1,8 +1,8 @@
# App configuration variables
NX_VEGA_ENV=TESTNET
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"}
NX_USE_ENV_OVERRIDES=1
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
+3 -3
View File
@@ -3,7 +3,7 @@ NX_VEGA_ENV=DEVNET
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
NX_VEGA_URL=https://api.n04.d.vega.xyz/graphql
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\"}
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
+3 -3
View File
@@ -3,7 +3,7 @@ NX_VEGA_ENV=STAGNET3
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://staging3.explorer.vega.xyz
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
+3 -3
View File
@@ -2,10 +2,10 @@
NX_VEGA_ENV=TESTNET
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
NX_VEGA_NETWORKS='{\"MAINNET\":\"https://alpha.console.vega.xyz\"}'
NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_USE_ENV_OVERRIDES=1
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
NX_VEGA_WALLET_URL=http://localhost:1789
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
@@ -1,6 +1,20 @@
import { LiquidityTable, useLiquidityProvision } from '@vegaprotocol/liquidity';
import { addDecimalsFormatNumber, t } from '@vegaprotocol/react-helpers';
import { LiquidityProvisionStatus } from '@vegaprotocol/types';
import type {
LiquidityProvisionFieldsFragment,
LiquidityProvisionsSubscription,
} from '@vegaprotocol/liquidity';
import { marketLiquidityDataProvider } from '@vegaprotocol/liquidity';
import {
liquidityProvisionsDataProvider,
LiquidityTable,
update,
} from '@vegaprotocol/liquidity';
import {
addDecimalsFormatNumber,
NetworkParams,
t,
useDataProvider,
useNetworkParam,
} from '@vegaprotocol/react-helpers';
import {
AsyncRenderer,
Tab,
@@ -14,6 +28,8 @@ import { useRouter } from 'next/router';
import { useRef, useMemo } from 'react';
import { tooltipMapping } from '@vegaprotocol/market-info';
import Link from 'next/link';
import { Schema } from '@vegaprotocol/types';
import BigNumber from 'bignumber.js';
const LiquidityPage = ({ id }: { id?: string }) => {
const { query } = useRouter();
@@ -24,34 +40,54 @@ const LiquidityPage = ({ id }: { id?: string }) => {
const marketId =
id || (Array.isArray(query.marketId) ? query.marketId[0] : query.marketId);
const { data: marketProvision } = useDataProvider({
dataProvider: marketLiquidityDataProvider,
noUpdate: true,
variables: { marketId },
});
const {
data: {
liquidityProviders,
suppliedStake,
targetStake,
name,
symbol,
assetDecimalPlaces,
},
data: liquidityProviders,
loading,
error,
} = useLiquidityProvision({ marketId });
} = useDataProvider<
LiquidityProvisionFieldsFragment[],
LiquidityProvisionsSubscription['liquidityProvisions']
>({
dataProvider: liquidityProvisionsDataProvider,
update,
variables: { marketId, pubKey },
});
const targetStake = marketProvision?.market?.data?.targetStake;
const suppliedStake = marketProvision?.market?.data?.suppliedStake;
const assetDecimalPlaces =
marketProvision?.market?.tradableInstrument.instrument.product
.settlementAsset.decimals || 0;
const symbol =
marketProvision?.market?.tradableInstrument.instrument.product
.settlementAsset.symbol;
const { param: stakeToCcySiskas } = useNetworkParam(
NetworkParams.market_liquidity_stakeToCcySiskas
);
const stakeToCcySiska = stakeToCcySiskas && stakeToCcySiskas[0];
const myLpEdges = useMemo(
() => liquidityProviders.filter((e) => e.party === pubKey),
() => liquidityProviders?.filter((e) => e.party.id === pubKey),
[liquidityProviders, pubKey]
);
const activeEdges = useMemo(
() =>
liquidityProviders.filter(
(e) => e.status === LiquidityProvisionStatus.STATUS_ACTIVE
liquidityProviders?.filter(
(e) => e.status === Schema.LiquidityProvisionStatus.STATUS_ACTIVE
),
[liquidityProviders]
);
const inactiveEdges = useMemo(
() =>
liquidityProviders.filter(
(e) => e.status !== LiquidityProvisionStatus.STATUS_ACTIVE
liquidityProviders?.filter(
(e) => e.status !== Schema.LiquidityProvisionStatus.STATUS_ACTIVE
),
[liquidityProviders]
);
@@ -63,9 +99,13 @@ const LiquidityPage = ({ id }: { id?: string }) => {
}
const getActiveDefaultId = () => {
if (myLpEdges?.length > 0) return LiquidityTabs.MyLiquidityProvision;
if (myLpEdges && myLpEdges.length > 0) {
return LiquidityTabs.MyLiquidityProvision;
}
if (activeEdges?.length) return LiquidityTabs.Active;
else if (inactiveEdges?.length > 0) return LiquidityTabs.Inactive;
else if (inactiveEdges && inactiveEdges.length > 0) {
return LiquidityTabs.Inactive;
}
return LiquidityTabs.Active;
};
@@ -76,7 +116,9 @@ const LiquidityPage = ({ id }: { id?: string }) => {
title={
<Link href={`/markets/${marketId}`} passHref={true}>
<UiToolkitLink>
{`${name} ${t('liquidity provision')}`}
{`${
marketProvision?.market?.tradableInstrument.instrument.name
} ${t('liquidity provision')}`}
</UiToolkitLink>
</Link>
}
@@ -117,29 +159,40 @@ const LiquidityPage = ({ id }: { id?: string }) => {
name={t('My liquidity provision')}
hidden={!pubKey}
>
<LiquidityTable
ref={gridRef}
data={myLpEdges}
symbol={symbol}
assetDecimalPlaces={assetDecimalPlaces}
/>
{myLpEdges && (
<LiquidityTable
ref={gridRef}
data={myLpEdges}
symbol={symbol}
stakeToCcySiskas={new BigNumber(stakeToCcySiska ?? 1)}
assetDecimalPlaces={assetDecimalPlaces}
/>
)}
</Tab>
<Tab id={LiquidityTabs.Active} name={t('Active')}>
<LiquidityTable
ref={gridRef}
data={activeEdges}
symbol={symbol}
assetDecimalPlaces={assetDecimalPlaces}
/>
</Tab>
<Tab id={LiquidityTabs.Inactive} name={t('Inactive')}>
<LiquidityTable
ref={gridRef}
data={inactiveEdges}
symbol={symbol}
assetDecimalPlaces={assetDecimalPlaces}
/>
{activeEdges && (
<LiquidityTable
ref={gridRef}
data={activeEdges}
symbol={symbol}
assetDecimalPlaces={assetDecimalPlaces}
stakeToCcySiskas={new BigNumber(stakeToCcySiska ?? 1)}
/>
)}
</Tab>
{
<Tab id={LiquidityTabs.Inactive} name={t('Inactive')}>
{inactiveEdges && (
<LiquidityTable
ref={gridRef}
data={inactiveEdges}
symbol={symbol}
assetDecimalPlaces={assetDecimalPlaces}
stakeToCcySiskas={new BigNumber(stakeToCcySiska ?? 1)}
/>
)}
</Tab>
}
</Tabs>
</div>
</AsyncRenderer>
-72
View File
@@ -1,72 +0,0 @@
/* tslint:disable */
/* eslint-disable */
// @generated
// This file was automatically generated and should not be edited.
import { AssetStatus } from "@vegaprotocol/types";
// ====================================================
// GraphQL query operation: DepositAsset
// ====================================================
export interface DepositAsset_assetsConnection_edges_node_source_BuiltinAsset {
__typename: "BuiltinAsset";
}
export interface DepositAsset_assetsConnection_edges_node_source_ERC20 {
__typename: "ERC20";
/**
* The address of the ERC20 contract
*/
contractAddress: string;
}
export type DepositAsset_assetsConnection_edges_node_source = DepositAsset_assetsConnection_edges_node_source_BuiltinAsset | DepositAsset_assetsConnection_edges_node_source_ERC20;
export interface DepositAsset_assetsConnection_edges_node {
__typename: "Asset";
/**
* The ID of the asset
*/
id: string;
/**
* The full name of the asset (e.g: Great British Pound)
*/
name: string;
/**
* The symbol of the asset (e.g: GBP)
*/
symbol: string;
/**
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
*/
decimals: number;
/**
* The status of the asset in the Vega network
*/
status: AssetStatus;
/**
* The origin source of the asset (e.g: an ERC20 asset)
*/
source: DepositAsset_assetsConnection_edges_node_source;
}
export interface DepositAsset_assetsConnection_edges {
__typename: "AssetEdge";
node: DepositAsset_assetsConnection_edges_node;
}
export interface DepositAsset_assetsConnection {
__typename: "AssetsConnection";
/**
* The assets
*/
edges: (DepositAsset_assetsConnection_edges | null)[] | null;
}
export interface DepositAsset {
/**
* The list of all assets in use in the Vega network or the specified asset if ID is provided
*/
assetsConnection: DepositAsset_assetsConnection;
}
-2
View File
@@ -1,2 +0,0 @@
export * from './Deposit';
export * from './DepositAsset';
@@ -1,112 +0,0 @@
import { Schema as Types } from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type DepositFieldsFragment = { __typename?: 'Deposit', id: string, status: Types.DepositStatus, amount: string, createdTimestamp: string, creditedTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } };
export type DepositsQueryVariables = Types.Exact<{
partyId: Types.Scalars['ID'];
}>;
export type DepositsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, depositsConnection?: { __typename?: 'DepositsConnection', edges?: Array<{ __typename?: 'DepositEdge', node: { __typename?: 'Deposit', id: string, status: Types.DepositStatus, amount: string, createdTimestamp: string, creditedTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } } } | null> | null } | null } | null };
export type DepositEventSubscriptionVariables = Types.Exact<{
partyId: Types.Scalars['ID'];
}>;
export type DepositEventSubscription = { __typename?: 'Subscription', busEvents?: Array<{ __typename?: 'BusEvent', event: { __typename?: 'Account' } | { __typename?: 'Asset' } | { __typename?: 'AuctionEvent' } | { __typename?: 'Deposit', id: string, status: Types.DepositStatus, amount: string, createdTimestamp: string, creditedTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } } | { __typename?: 'LiquidityProvision' } | { __typename?: 'LossSocialization' } | { __typename?: 'MarginLevels' } | { __typename?: 'Market' } | { __typename?: 'MarketData' } | { __typename?: 'MarketEvent' } | { __typename?: 'MarketTick' } | { __typename?: 'NodeSignature' } | { __typename?: 'OracleSpec' } | { __typename?: 'Order' } | { __typename?: 'Party' } | { __typename?: 'PositionResolution' } | { __typename?: 'Proposal' } | { __typename?: 'RiskFactor' } | { __typename?: 'SettleDistressed' } | { __typename?: 'SettlePosition' } | { __typename?: 'TimeUpdate' } | { __typename?: 'Trade' } | { __typename?: 'TransferResponses' } | { __typename?: 'Vote' } | { __typename?: 'Withdrawal' } }> | null };
export const DepositFieldsFragmentDoc = gql`
fragment DepositFields on Deposit {
id
status
amount
asset {
id
symbol
decimals
}
createdTimestamp
creditedTimestamp
txHash
}
`;
export const DepositsDocument = gql`
query Deposits($partyId: ID!) {
party(id: $partyId) {
id
depositsConnection {
edges {
node {
...DepositFields
}
}
}
}
}
${DepositFieldsFragmentDoc}`;
/**
* __useDepositsQuery__
*
* To run a query within a React component, call `useDepositsQuery` and pass it any options that fit your needs.
* When your component renders, `useDepositsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useDepositsQuery({
* variables: {
* partyId: // value for 'partyId'
* },
* });
*/
export function useDepositsQuery(baseOptions: Apollo.QueryHookOptions<DepositsQuery, DepositsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<DepositsQuery, DepositsQueryVariables>(DepositsDocument, options);
}
export function useDepositsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<DepositsQuery, DepositsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<DepositsQuery, DepositsQueryVariables>(DepositsDocument, options);
}
export type DepositsQueryHookResult = ReturnType<typeof useDepositsQuery>;
export type DepositsLazyQueryHookResult = ReturnType<typeof useDepositsLazyQuery>;
export type DepositsQueryResult = Apollo.QueryResult<DepositsQuery, DepositsQueryVariables>;
export const DepositEventDocument = gql`
subscription DepositEvent($partyId: ID!) {
busEvents(partyId: $partyId, batchSize: 0, types: [Deposit]) {
event {
... on Deposit {
...DepositFields
}
}
}
}
${DepositFieldsFragmentDoc}`;
/**
* __useDepositEventSubscription__
*
* To run a query within a React component, call `useDepositEventSubscription` and pass it any options that fit your needs.
* When your component renders, `useDepositEventSubscription` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useDepositEventSubscription({
* variables: {
* partyId: // value for 'partyId'
* },
* });
*/
export function useDepositEventSubscription(baseOptions: Apollo.SubscriptionHookOptions<DepositEventSubscription, DepositEventSubscriptionVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSubscription<DepositEventSubscription, DepositEventSubscriptionVariables>(DepositEventDocument, options);
}
export type DepositEventSubscriptionHookResult = ReturnType<typeof useDepositEventSubscription>;
export type DepositEventSubscriptionResult = Apollo.SubscriptionResult<DepositEventSubscription>;
@@ -189,9 +189,9 @@ it('when VEGA_NETWORKS is not a valid json, prints a warning and continues witho
it.each`
env | etherscanUrl | providerUrl
${Networks.DEVNET} | ${'https://ropsten.etherscan.io'} | ${'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'}
${Networks.TESTNET} | ${'https://ropsten.etherscan.io'} | ${'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'}
${Networks.STAGNET3} | ${'https://ropsten.etherscan.io'} | ${'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'}
${Networks.DEVNET} | ${'https://sepolia.etherscan.io'} | ${'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'}
${Networks.TESTNET} | ${'https://sepolia.etherscan.io'} | ${'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'}
${Networks.STAGNET3} | ${'https://sepolia.etherscan.io'} | ${'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'}
${Networks.MAINNET} | ${'https://etherscan.io'} | ${'https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'}
`(
'uses correct default ethereum connection variables in $env',
@@ -1,80 +0,0 @@
import { Schema as Types } from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type StatisticsQueryVariables = Types.Exact<{ [key: string]: never; }>;
export type StatisticsQuery = { __typename?: 'Query', statistics: { __typename?: 'Statistics', chainId: string, blockHeight: string } };
export type BlockTimeSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;
export type BlockTimeSubscription = { __typename?: 'Subscription', busEvents?: Array<{ __typename?: 'BusEvent', id: string }> | null };
export const StatisticsDocument = gql`
query Statistics {
statistics {
chainId
blockHeight
}
}
`;
/**
* __useStatisticsQuery__
*
* To run a query within a React component, call `useStatisticsQuery` and pass it any options that fit your needs.
* When your component renders, `useStatisticsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useStatisticsQuery({
* variables: {
* },
* });
*/
export function useStatisticsQuery(baseOptions?: Apollo.QueryHookOptions<StatisticsQuery, StatisticsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<StatisticsQuery, StatisticsQueryVariables>(StatisticsDocument, options);
}
export function useStatisticsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<StatisticsQuery, StatisticsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<StatisticsQuery, StatisticsQueryVariables>(StatisticsDocument, options);
}
export type StatisticsQueryHookResult = ReturnType<typeof useStatisticsQuery>;
export type StatisticsLazyQueryHookResult = ReturnType<typeof useStatisticsLazyQuery>;
export type StatisticsQueryResult = Apollo.QueryResult<StatisticsQuery, StatisticsQueryVariables>;
export const BlockTimeDocument = gql`
subscription BlockTime {
busEvents(types: TimeUpdate, batchSize: 1) {
id
}
}
`;
/**
* __useBlockTimeSubscription__
*
* To run a query within a React component, call `useBlockTimeSubscription` and pass it any options that fit your needs.
* When your component renders, `useBlockTimeSubscription` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useBlockTimeSubscription({
* variables: {
* },
* });
*/
export function useBlockTimeSubscription(baseOptions?: Apollo.SubscriptionHookOptions<BlockTimeSubscription, BlockTimeSubscriptionVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSubscription<BlockTimeSubscription, BlockTimeSubscriptionVariables>(BlockTimeDocument, options);
}
export type BlockTimeSubscriptionHookResult = ReturnType<typeof useBlockTimeSubscription>;
export type BlockTimeSubscriptionResult = Apollo.SubscriptionResult<BlockTimeSubscription>;
@@ -12,13 +12,13 @@ const isBrowser = typeof window !== 'undefined';
const getDefaultEtherumProviderUrl = (env: Networks) => {
return env === Networks.MAINNET
? 'https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8'
: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8';
: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8';
};
const getDefaultEtherscanUrl = (env: Networks) => {
return env === Networks.MAINNET
? 'https://etherscan.io'
: 'https://ropsten.etherscan.io';
: 'https://sepolia.etherscan.io';
};
const transformValue = (key: EnvKey, value?: string) => {
+55 -17
View File
@@ -1,3 +1,30 @@
fragment LiquidityProvisionFields on LiquidityProvision {
party {
id
accountsConnection(marketId: $marketId, type: ACCOUNT_TYPE_BOND) {
edges {
node {
type
balance
}
}
}
}
createdAt
updatedAt
commitmentAmount
fee
status
}
fragment LiquidityProviderFeeShareFields on LiquidityProviderFeeShare {
party {
id
}
equityLikeShare
averageEntryValuation
}
query MarketLiquidity($marketId: ID!) {
market(id: $marketId) {
id
@@ -6,23 +33,7 @@ query MarketLiquidity($marketId: ID!) {
liquidityProvisionsConnection {
edges {
node {
id
party {
id
accountsConnection(marketId: $marketId, type: ACCOUNT_TYPE_BOND) {
edges {
node {
type
balance
}
}
}
}
createdAt
updatedAt
commitmentAmount
fee
status
...LiquidityProvisionFields
}
}
}
@@ -49,6 +60,20 @@ query MarketLiquidity($marketId: ID!) {
openInterest
targetStake
marketValueProxy
liquidityProviderFeeShare {
...LiquidityProviderFeeShareFields
}
}
}
}
query LiquidityProviderFeeShare($marketId: ID!) {
market(id: $marketId) {
id
data {
market {
id
}
liquidityProviderFeeShare {
party {
id
@@ -59,3 +84,16 @@ query MarketLiquidity($marketId: ID!) {
}
}
}
subscription LiquidityProvisions($partyId: ID, $marketId: ID) {
liquidityProvisions(partyId: $partyId, marketId: $marketId) {
id
partyID
createdAt
updatedAt
marketID
commitmentAmount
fee
status
}
}
-255
View File
@@ -1,255 +0,0 @@
/* tslint:disable */
/* eslint-disable */
// @generated
// This file was automatically generated and should not be edited.
import { AccountType, LiquidityProvisionStatus } from "@vegaprotocol/types";
// ====================================================
// GraphQL query operation: MarketLiquidity
// ====================================================
export interface MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party_accountsConnection_edges_node {
__typename: "Account";
/**
* Account type (General, Margin, etc)
*/
type: AccountType;
/**
* Balance as string - current account balance (approx. as balances can be updated several times per second)
*/
balance: string;
}
export interface MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party_accountsConnection_edges {
__typename: "AccountEdge";
/**
* The account
*/
node: MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party_accountsConnection_edges_node;
}
export interface MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party_accountsConnection {
__typename: "AccountsConnection";
/**
* List of accounts available for the connection
*/
edges: (MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party_accountsConnection_edges | null)[] | null;
}
export interface MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party {
__typename: "Party";
/**
* Party identifier
*/
id: string;
/**
* Collateral accounts relating to a party
*/
accountsConnection: MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party_accountsConnection | null;
}
export interface MarketLiquidity_market_liquidityProvisionsConnection_edges_node {
__typename: "LiquidityProvision";
/**
* Unique identifier for the order (set by the system after consensus)
*/
id: string | null;
/**
* The party making this commitment
*/
party: MarketLiquidity_market_liquidityProvisionsConnection_edges_node_party;
/**
* When the liquidity provision was initially created (formatted RFC3339)
*/
createdAt: string;
/**
* RFC3339Nano time of when the liquidity provision was updated
*/
updatedAt: string | null;
/**
* Specified as a unit-less number that represents the amount of settlement asset of the market.
*/
commitmentAmount: string;
/**
* Nominated liquidity fee factor, which is an input to the calculation of liquidity fees on the market, as per setting fees and rewarding liquidity providers.
*/
fee: string;
/**
* The current status of this liquidity provision
*/
status: LiquidityProvisionStatus;
}
export interface MarketLiquidity_market_liquidityProvisionsConnection_edges {
__typename: "LiquidityProvisionsEdge";
node: MarketLiquidity_market_liquidityProvisionsConnection_edges_node;
}
export interface MarketLiquidity_market_liquidityProvisionsConnection {
__typename: "LiquidityProvisionsConnection";
edges: (MarketLiquidity_market_liquidityProvisionsConnection_edges | null)[] | null;
}
export interface MarketLiquidity_market_tradableInstrument_instrument_product_settlementAsset {
__typename: "Asset";
/**
* The ID of the asset
*/
id: string;
/**
* The symbol of the asset (e.g: GBP)
*/
symbol: string;
/**
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
*/
decimals: number;
}
export interface MarketLiquidity_market_tradableInstrument_instrument_product {
__typename: "Future";
/**
* The name of the asset (string)
*/
settlementAsset: MarketLiquidity_market_tradableInstrument_instrument_product_settlementAsset;
}
export interface MarketLiquidity_market_tradableInstrument_instrument {
__typename: "Instrument";
/**
* A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string)
*/
code: string;
/**
* Full and fairly descriptive name for the instrument
*/
name: string;
/**
* A reference to or instance of a fully specified product, including all required product parameters for that product (Product union)
*/
product: MarketLiquidity_market_tradableInstrument_instrument_product;
}
export interface MarketLiquidity_market_tradableInstrument {
__typename: "TradableInstrument";
/**
* An instance of, or reference to, a fully specified instrument.
*/
instrument: MarketLiquidity_market_tradableInstrument_instrument;
}
export interface MarketLiquidity_market_data_market {
__typename: "Market";
/**
* Market ID
*/
id: string;
}
export interface MarketLiquidity_market_data_liquidityProviderFeeShare_party {
__typename: "Party";
/**
* Party identifier
*/
id: string;
}
export interface MarketLiquidity_market_data_liquidityProviderFeeShare {
__typename: "LiquidityProviderFeeShare";
/**
* The liquidity provider party ID
*/
party: MarketLiquidity_market_data_liquidityProviderFeeShare_party;
/**
* The share owned by this liquidity provider (float)
*/
equityLikeShare: string;
/**
* The average entry valuation of the liquidity provider for the market
*/
averageEntryValuation: string;
}
export interface MarketLiquidity_market_data {
__typename: "MarketData";
/**
* Market of the associated mark price
*/
market: MarketLiquidity_market_data_market;
/**
* The supplied stake for the market
*/
suppliedStake: string | null;
/**
* The sum of the size of all positions greater than 0.
*/
openInterest: string;
/**
* The amount of stake targeted for this market
*/
targetStake: string | null;
/**
* The market value proxy
*/
marketValueProxy: string;
/**
* The equity like share of liquidity fee for each liquidity provider
*/
liquidityProviderFeeShare: MarketLiquidity_market_data_liquidityProviderFeeShare[] | null;
}
export interface MarketLiquidity_market {
__typename: "Market";
/**
* Market ID
*/
id: string;
/**
* The number of decimal places that an integer must be shifted by in order to get a correct
* number denominated in the currency of the market. (uint64)
*
* Examples:
* Currency Balance decimalPlaces Real Balance
* GBP 100 0 GBP 100
* GBP 100 2 GBP 1.00
* GBP 100 4 GBP 0.01
* GBP 1 4 GBP 0.0001 ( 0.01p )
*
* GBX (pence) 100 0 GBP 1.00 (100p )
* GBX (pence) 100 2 GBP 0.01 ( 1p )
* GBX (pence) 100 4 GBP 0.0001 ( 0.01p )
* GBX (pence) 1 4 GBP 0.000001 ( 0.0001p)
*/
decimalPlaces: number;
/**
* The number of decimal places that an integer must be shifted in order to get a correct size (uint64).
* i.e. 0 means there are no fractional orders for the market, and order sizes are always whole sizes.
* 2 means sizes given as 10^2 * desired size, e.g. a desired size of 1.23 is represented as 123 in this market.
* This sets how big the smallest order / position on the market can be.
*/
positionDecimalPlaces: number;
/**
* The list of the liquidity provision commitments for this market
*/
liquidityProvisionsConnection: MarketLiquidity_market_liquidityProvisionsConnection | null;
/**
* An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: MarketLiquidity_market_tradableInstrument;
/**
* marketData for the given market
*/
data: MarketLiquidity_market_data | null;
}
export interface MarketLiquidity {
/**
* An instrument that is trading on the Vega network
*/
market: MarketLiquidity_market | null;
}
export interface MarketLiquidityVariables {
marketId: string;
}
@@ -3,14 +3,61 @@ import { Schema as Types } from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type LiquidityProvisionFieldsFragment = { __typename?: 'LiquidityProvision', createdAt: string, updatedAt?: string | null, commitmentAmount: string, fee: string, status: Types.LiquidityProvisionStatus, party: { __typename?: 'Party', id: string, accountsConnection?: { __typename?: 'AccountsConnection', edges?: Array<{ __typename?: 'AccountEdge', node: { __typename?: 'Account', type: Types.AccountType, balance: string } } | null> | null } | null } };
export type LiquidityProviderFeeShareFieldsFragment = { __typename?: 'LiquidityProviderFeeShare', equityLikeShare: string, averageEntryValuation: string, party: { __typename?: 'Party', id: string } };
export type MarketLiquidityQueryVariables = Types.Exact<{
marketId: Types.Scalars['ID'];
}>;
export type MarketLiquidityQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, liquidityProvisionsConnection?: { __typename?: 'LiquidityProvisionsConnection', edges?: Array<{ __typename?: 'LiquidityProvisionsEdge', node: { __typename?: 'LiquidityProvision', id?: string | null, createdAt: string, updatedAt?: string | null, commitmentAmount: string, fee: string, status: Types.LiquidityProvisionStatus, party: { __typename?: 'Party', id: string, accountsConnection?: { __typename?: 'AccountsConnection', edges?: Array<{ __typename?: 'AccountEdge', node: { __typename?: 'Account', type: Types.AccountType, balance: string } } | null> | null } | null } } } | null> | null } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', code: string, name: string, product: { __typename?: 'Future', settlementAsset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } } } }, data?: { __typename?: 'MarketData', suppliedStake?: string | null, openInterest: string, targetStake?: string | null, marketValueProxy: string, market: { __typename?: 'Market', id: string }, liquidityProviderFeeShare?: Array<{ __typename?: 'LiquidityProviderFeeShare', equityLikeShare: string, averageEntryValuation: string, party: { __typename?: 'Party', id: string } }> | null } | null } | null };
export type MarketLiquidityQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, liquidityProvisionsConnection?: { __typename?: 'LiquidityProvisionsConnection', edges?: Array<{ __typename?: 'LiquidityProvisionsEdge', node: { __typename?: 'LiquidityProvision', createdAt: string, updatedAt?: string | null, commitmentAmount: string, fee: string, status: Types.LiquidityProvisionStatus, party: { __typename?: 'Party', id: string, accountsConnection?: { __typename?: 'AccountsConnection', edges?: Array<{ __typename?: 'AccountEdge', node: { __typename?: 'Account', type: Types.AccountType, balance: string } } | null> | null } | null } } } | null> | null } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', code: string, name: string, product: { __typename?: 'Future', settlementAsset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } } } }, data?: { __typename?: 'MarketData', suppliedStake?: string | null, openInterest: string, targetStake?: string | null, marketValueProxy: string, market: { __typename?: 'Market', id: string }, liquidityProviderFeeShare?: Array<{ __typename?: 'LiquidityProviderFeeShare', equityLikeShare: string, averageEntryValuation: string, party: { __typename?: 'Party', id: string } }> | null } | null } | null };
export type LiquidityProviderFeeShareQueryVariables = Types.Exact<{
marketId: Types.Scalars['ID'];
}>;
export type LiquidityProviderFeeShareQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, data?: { __typename?: 'MarketData', market: { __typename?: 'Market', id: string }, liquidityProviderFeeShare?: Array<{ __typename?: 'LiquidityProviderFeeShare', equityLikeShare: string, averageEntryValuation: string, party: { __typename?: 'Party', id: string } }> | null } | null } | null };
export type LiquidityProvisionsSubscriptionVariables = Types.Exact<{
partyId?: Types.InputMaybe<Types.Scalars['ID']>;
marketId?: Types.InputMaybe<Types.Scalars['ID']>;
}>;
export type LiquidityProvisionsSubscription = { __typename?: 'Subscription', liquidityProvisions?: Array<{ __typename?: 'LiquidityProvisionUpdate', id?: string | null, partyID: string, createdAt: string, updatedAt?: string | null, marketID: string, commitmentAmount: string, fee: string, status: Types.LiquidityProvisionStatus }> | null };
export const LiquidityProvisionFieldsFragmentDoc = gql`
fragment LiquidityProvisionFields on LiquidityProvision {
party {
id
accountsConnection(marketId: $marketId, type: ACCOUNT_TYPE_BOND) {
edges {
node {
type
balance
}
}
}
}
createdAt
updatedAt
commitmentAmount
fee
status
}
`;
export const LiquidityProviderFeeShareFieldsFragmentDoc = gql`
fragment LiquidityProviderFeeShareFields on LiquidityProviderFeeShare {
party {
id
}
equityLikeShare
averageEntryValuation
}
`;
export const MarketLiquidityDocument = gql`
query MarketLiquidity($marketId: ID!) {
market(id: $marketId) {
@@ -20,23 +67,7 @@ export const MarketLiquidityDocument = gql`
liquidityProvisionsConnection {
edges {
node {
id
party {
id
accountsConnection(marketId: $marketId, type: ACCOUNT_TYPE_BOND) {
edges {
node {
type
balance
}
}
}
}
createdAt
updatedAt
commitmentAmount
fee
status
...LiquidityProvisionFields
}
}
}
@@ -64,16 +95,13 @@ export const MarketLiquidityDocument = gql`
targetStake
marketValueProxy
liquidityProviderFeeShare {
party {
id
}
equityLikeShare
averageEntryValuation
...LiquidityProviderFeeShareFields
}
}
}
}
`;
${LiquidityProvisionFieldsFragmentDoc}
${LiquidityProviderFeeShareFieldsFragmentDoc}`;
/**
* __useMarketLiquidityQuery__
@@ -101,4 +129,89 @@ export function useMarketLiquidityLazyQuery(baseOptions?: Apollo.LazyQueryHookOp
}
export type MarketLiquidityQueryHookResult = ReturnType<typeof useMarketLiquidityQuery>;
export type MarketLiquidityLazyQueryHookResult = ReturnType<typeof useMarketLiquidityLazyQuery>;
export type MarketLiquidityQueryResult = Apollo.QueryResult<MarketLiquidityQuery, MarketLiquidityQueryVariables>;
export type MarketLiquidityQueryResult = Apollo.QueryResult<MarketLiquidityQuery, MarketLiquidityQueryVariables>;
export const LiquidityProviderFeeShareDocument = gql`
query LiquidityProviderFeeShare($marketId: ID!) {
market(id: $marketId) {
id
data {
market {
id
}
liquidityProviderFeeShare {
party {
id
}
equityLikeShare
averageEntryValuation
}
}
}
}
`;
/**
* __useLiquidityProviderFeeShareQuery__
*
* To run a query within a React component, call `useLiquidityProviderFeeShareQuery` and pass it any options that fit your needs.
* When your component renders, `useLiquidityProviderFeeShareQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useLiquidityProviderFeeShareQuery({
* variables: {
* marketId: // value for 'marketId'
* },
* });
*/
export function useLiquidityProviderFeeShareQuery(baseOptions: Apollo.QueryHookOptions<LiquidityProviderFeeShareQuery, LiquidityProviderFeeShareQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<LiquidityProviderFeeShareQuery, LiquidityProviderFeeShareQueryVariables>(LiquidityProviderFeeShareDocument, options);
}
export function useLiquidityProviderFeeShareLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<LiquidityProviderFeeShareQuery, LiquidityProviderFeeShareQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<LiquidityProviderFeeShareQuery, LiquidityProviderFeeShareQueryVariables>(LiquidityProviderFeeShareDocument, options);
}
export type LiquidityProviderFeeShareQueryHookResult = ReturnType<typeof useLiquidityProviderFeeShareQuery>;
export type LiquidityProviderFeeShareLazyQueryHookResult = ReturnType<typeof useLiquidityProviderFeeShareLazyQuery>;
export type LiquidityProviderFeeShareQueryResult = Apollo.QueryResult<LiquidityProviderFeeShareQuery, LiquidityProviderFeeShareQueryVariables>;
export const LiquidityProvisionsDocument = gql`
subscription LiquidityProvisions($partyId: ID, $marketId: ID) {
liquidityProvisions(partyId: $partyId, marketId: $marketId) {
id
partyID
createdAt
updatedAt
marketID
commitmentAmount
fee
status
}
}
`;
/**
* __useLiquidityProvisionsSubscription__
*
* To run a query within a React component, call `useLiquidityProvisionsSubscription` and pass it any options that fit your needs.
* When your component renders, `useLiquidityProvisionsSubscription` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useLiquidityProvisionsSubscription({
* variables: {
* partyId: // value for 'partyId'
* marketId: // value for 'marketId'
* },
* });
*/
export function useLiquidityProvisionsSubscription(baseOptions?: Apollo.SubscriptionHookOptions<LiquidityProvisionsSubscription, LiquidityProvisionsSubscriptionVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSubscription<LiquidityProvisionsSubscription, LiquidityProvisionsSubscriptionVariables>(LiquidityProvisionsDocument, options);
}
export type LiquidityProvisionsSubscriptionHookResult = ReturnType<typeof useLiquidityProvisionsSubscription>;
export type LiquidityProvisionsSubscriptionResult = Apollo.SubscriptionResult<LiquidityProvisionsSubscription>;
+1 -1
View File
@@ -1,3 +1,3 @@
export * from './__generated__';
export * from './__generated___/MarketLiquidity';
export * from './liquidity-data-provider';
export * from './liquidity-table';
+132 -167
View File
@@ -1,175 +1,140 @@
import { gql, useQuery } from '@apollo/client';
import type { LiquidityProvisionStatus } from '@vegaprotocol/types';
import { AccountType } from '@vegaprotocol/types';
import { useNetworkParam, NetworkParams } from '@vegaprotocol/react-helpers';
import BigNumber from 'bignumber.js';
import {
makeDataProvider,
makeDerivedDataProvider,
} from '@vegaprotocol/react-helpers';
import produce from 'immer';
import type { IterableElement } from 'type-fest';
import type {
MarketLiquidity,
MarketLiquidity_market_data_liquidityProviderFeeShare,
} from './__generated__';
LiquidityProviderFeeShareFieldsFragment,
LiquidityProvisionFieldsFragment,
LiquidityProvisionsSubscription,
MarketLiquidityQuery,
} from './__generated___/MarketLiquidity';
import { LiquidityProvisionsDocument } from './__generated___/MarketLiquidity';
import { MarketLiquidityDocument } from './__generated___/MarketLiquidity';
const MARKET_LIQUIDITY_QUERY = gql`
query MarketLiquidity($marketId: ID!) {
market(id: $marketId) {
id
decimalPlaces
positionDecimalPlaces
liquidityProvisionsConnection {
edges {
node {
id
party {
id
accountsConnection(marketId: $marketId, type: ACCOUNT_TYPE_BOND) {
edges {
node {
type
balance
}
}
}
}
createdAt
updatedAt
commitmentAmount
fee
status
}
}
}
tradableInstrument {
instrument {
code
name
product {
... on Future {
settlementAsset {
id
symbol
decimals
}
}
}
}
}
data {
market {
id
}
suppliedStake
openInterest
targetStake
marketValueProxy
liquidityProviderFeeShare {
party {
id
}
equityLikeShare
averageEntryValuation
}
}
}
}
`;
export interface LiquidityProvision {
party: string;
commitmentAmount: string | undefined;
fee: string | undefined;
equityLikeShare: string;
averageEntryValuation: string;
obligation: string | null;
supplied: string | null;
status?: LiquidityProvisionStatus;
createdAt: string | undefined;
updatedAt: string | null | undefined;
export function isLpFragment(
lp:
| LiquidityProvisionFieldsFragment
| IterableElement<LiquidityProvisionsSubscription['liquidityProvisions']>
): lp is LiquidityProvisionFieldsFragment {
return (lp as LiquidityProvisionFieldsFragment).party !== undefined;
}
export interface LiquidityData {
liquidityProviders: LiquidityProvision[];
suppliedStake?: string | null;
targetStake?: string | null;
code?: string;
symbol?: string;
decimalPlaces?: number;
positionDecimalPlaces?: number;
assetDecimalPlaces?: number;
name?: string;
}
export const getId = (
lp:
| LiquidityProvisionFieldsFragment
| IterableElement<LiquidityProvisionsSubscription['liquidityProvisions']>
) => (isLpFragment(lp) ? lp.party.id : lp.partyID);
export const useLiquidityProvision = ({
marketId,
partyId,
}: {
partyId?: string;
marketId?: string;
}) => {
const { param: stakeToCcySiskas } = useNetworkParam(
NetworkParams.market_liquidity_stakeToCcySiskas
);
const stakeToCcySiska = stakeToCcySiskas && stakeToCcySiskas[0];
const { data, loading, error } = useQuery<MarketLiquidity>(
MARKET_LIQUIDITY_QUERY,
{
variables: { marketId },
}
);
const liquidityProviders = (
data?.market?.data?.liquidityProviderFeeShare || []
)
?.filter(
(p: MarketLiquidity_market_data_liquidityProviderFeeShare) =>
!partyId || p.party.id === partyId
) // if partyId is provided, filter out other parties
.map((provider: MarketLiquidity_market_data_liquidityProviderFeeShare) => {
const liquidityProvisionConnection =
data?.market?.liquidityProvisionsConnection?.edges?.find(
(e) => e?.node.party.id === provider.party.id
);
const balance =
liquidityProvisionConnection?.node?.party.accountsConnection?.edges?.reduce(
(acc, e) => {
return e?.node.type === AccountType.ACCOUNT_TYPE_BOND // just an extra check to make sure we only use bond accounts
? acc.plus(new BigNumber(e?.node.balance ?? 0))
: acc;
export const update = (
data: LiquidityProvisionFieldsFragment[],
deltas: LiquidityProvisionsSubscription['liquidityProvisions']
) => {
return produce(data, (draft) => {
deltas?.forEach((delta) => {
const id = getId(delta);
const index = draft.findIndex((a) => getId(a) === id);
if (index !== -1) {
draft[index].commitmentAmount = delta.commitmentAmount;
draft[index].fee = delta.fee;
draft[index].updatedAt = delta.updatedAt;
draft[index].status = delta.status;
} else {
draft.unshift({
commitmentAmount: delta.commitmentAmount,
fee: delta.fee,
status: delta.status,
updatedAt: delta.updatedAt,
createdAt: delta.createdAt,
party: {
id: delta.partyID,
},
new BigNumber(0)
);
const obligation =
stakeToCcySiska &&
new BigNumber(stakeToCcySiska)
.times(liquidityProvisionConnection?.node?.commitmentAmount ?? 1)
.toString();
const supplied =
stakeToCcySiska &&
new BigNumber(stakeToCcySiska).times(balance ?? 1).toString();
return {
party: provider.party.id,
createdAt: liquidityProvisionConnection?.node?.createdAt,
updatedAt: liquidityProvisionConnection?.node?.updatedAt,
commitmentAmount: liquidityProvisionConnection?.node?.commitmentAmount,
fee: liquidityProvisionConnection?.node?.fee,
status: liquidityProvisionConnection?.node?.status,
equityLikeShare: provider.equityLikeShare,
averageEntryValuation: provider.averageEntryValuation,
obligation,
supplied,
};
// TODO add accounts connection to the subscription
});
}
});
const liquidityData: LiquidityData = {
liquidityProviders,
suppliedStake: data?.market?.data?.suppliedStake,
targetStake: data?.market?.data?.targetStake,
decimalPlaces: data?.market?.decimalPlaces,
positionDecimalPlaces: data?.market?.positionDecimalPlaces,
code: data?.market?.tradableInstrument.instrument.code,
name: data?.market?.tradableInstrument.instrument.name,
assetDecimalPlaces:
data?.market?.tradableInstrument.instrument.product.settlementAsset
.decimals,
symbol:
data?.market?.tradableInstrument.instrument.product.settlementAsset
.symbol,
};
return { data: liquidityData, loading, error };
});
};
const getData = (responseData: MarketLiquidityQuery) => {
return (
responseData.market?.liquidityProvisionsConnection?.edges?.map(
(e) => e?.node
) ?? []
).filter((e) => !!e) as LiquidityProvisionFieldsFragment[];
};
const getDelta = (
subscriptionData: LiquidityProvisionsSubscription
): LiquidityProvisionsSubscription['liquidityProvisions'] =>
subscriptionData.liquidityProvisions;
export const liquidityProvisionsDataProvider = makeDataProvider<
MarketLiquidityQuery,
LiquidityProvisionFieldsFragment[],
LiquidityProvisionsSubscription,
LiquidityProvisionsSubscription['liquidityProvisions']
>({
query: MarketLiquidityDocument,
subscriptionQuery: LiquidityProvisionsDocument,
update,
getData,
getDelta,
});
export const marketLiquidityDataProvider = makeDataProvider<
MarketLiquidityQuery,
MarketLiquidityQuery,
MarketLiquidityQuery,
MarketLiquidityQuery
>({
query: MarketLiquidityDocument,
subscriptionQuery: LiquidityProvisionsDocument,
update: (data, delta) => {
return delta;
},
getData: (data) => {
return data;
},
getDelta: (delta) => {
return delta;
},
});
export const liquidityFeeShareDataProvider = makeDataProvider<
MarketLiquidityQuery,
LiquidityProviderFeeShareFieldsFragment[],
LiquidityProviderFeeShareFieldsFragment,
LiquidityProviderFeeShareFieldsFragment[]
>({
query: MarketLiquidityDocument,
subscriptionQuery: LiquidityProvisionsDocument,
update: (data, delta) => {
return delta;
},
getData: (data) => {
return data.market?.data?.liquidityProviderFeeShare || [];
},
getDelta: (delta) => {
return [delta];
},
});
export const lpAggregatedDataProvider = makeDerivedDataProvider<
LiquidityProvisionFieldsFragment[],
never
>(
[
liquidityProvisionsDataProvider,
marketLiquidityDataProvider,
liquidityFeeShareDataProvider,
],
(parts) => {
// TODO add fee share and liquidity provision party merge
console.log('liquidityProvisionsDataProvider', parts[0]);
console.log('marketLiquidityDataProvider', parts[1]);
console.log('liquidityFeeShareDataProvider', parts[2]);
return [parts[0], parts[1], parts[2]];
}
);
+12 -6
View File
@@ -11,11 +11,11 @@ import {
} from '@vegaprotocol/ui-toolkit';
import type { AgGridReact } from 'ag-grid-react';
import { AgGridColumn } from 'ag-grid-react';
import type { LiquidityProvision } from './liquidity-data-provider';
import type { ValueFormatterParams } from 'ag-grid-community';
import BigNumber from 'bignumber.js';
import type { LiquidityProvisionStatus } from '@vegaprotocol/types';
import type { Schema } from '@vegaprotocol/types';
import { LiquidityProvisionStatusMapping } from '@vegaprotocol/types';
import type { LiquidityProvisionFieldsFragment } from './__generated___';
const percentageFormatter = ({ value }: ValueFormatterParams) => {
if (!value) return '-';
@@ -30,17 +30,19 @@ const dateValueFormatter = ({ value }: { value?: string | null }) => {
};
export interface LiquidityTableProps {
data: LiquidityProvision[];
data?: LiquidityProvisionFieldsFragment[];
symbol?: string;
assetDecimalPlaces?: number;
stakeToCcySiskas: BigNumber;
}
export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
({ data, symbol = '', assetDecimalPlaces }, ref) => {
({ data, symbol = '', assetDecimalPlaces, stakeToCcySiskas }, ref) => {
const assetDecimalsFormatter = ({ value }: ValueFormatterParams) => {
if (!value) return '-';
return `${addDecimalsFormatNumber(value, assetDecimalPlaces ?? 0, 5)}`;
};
if (!data) return null;
return (
<AgGrid
style={{ width: '100%', height: '100%' }}
@@ -60,7 +62,7 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
>
<AgGridColumn
headerName={t('Party')}
field="party"
field="party.id"
headerTooltip={t(
'The public key of the party making this commitment.'
)}
@@ -124,7 +126,11 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
headerName={t('Status')}
headerTooltip={t('The current status of this liquidity provision.')}
field="status"
valueFormatter={({ value }: { value: LiquidityProvisionStatus }) => {
valueFormatter={({
value,
}: {
value: Schema.LiquidityProvisionStatus;
}) => {
if (!value) return value;
return LiquidityProvisionStatusMapping[value];
}}
+2 -2
View File
@@ -9,11 +9,11 @@ export const SPENT_CODE = '0x0000000000000000000000000000000000000001';
* Example:
* ```
* const provider = new Web3.providers.HttpProvider(
* "https://ropsten.infura.io/v3/5aff9e61ad844bcf982d0d0c3f1d29f1"
* "https://sepolia.infura.io/v3/5aff9e61ad844bcf982d0d0c3f1d29f1"
* );
* const web3 = new Web3(provider)
* // Ropsten address
* // Sepolia address
* const contract = new VegaClaim(web3, "0xAf5dC1772714b2F4fae3b65eb83100f1Ea677b21")
* contract.isCountryBlocked("US").then(console.log)
* contract.isClaimValid({ claimCode: "0x...", expiry: 0, nonce: "0x00", account: "0x00" })
-12
View File
@@ -96,18 +96,6 @@ export enum Interval {
INTERVAL_I6H = "INTERVAL_I6H",
}
/**
* Status of a liquidity provision order
*/
export enum LiquidityProvisionStatus {
STATUS_ACTIVE = "STATUS_ACTIVE",
STATUS_CANCELLED = "STATUS_CANCELLED",
STATUS_PENDING = "STATUS_PENDING",
STATUS_REJECTED = "STATUS_REJECTED",
STATUS_STOPPED = "STATUS_STOPPED",
STATUS_UNDEPLOYED = "STATUS_UNDEPLOYED",
}
/**
* The current state of a market
*/
+3 -3
View File
@@ -15,19 +15,19 @@ const CONFIG = [
{
env: 'testnet',
contract: '0xe2deBB240b43EDfEBc9c38B67c0894B9A92Bf07c',
provider: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
provider: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
startBlock: 11340808,
},
{
env: 'stagnet3',
contract: '0x9F10cBeEf03A564Fb914c2010c0Cd55E9BB11406',
provider: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
provider: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
startBlock: 11790009,
},
{
env: 'devnet',
contract: '0xd1216AAb948f5FC706Df73df6d71c64CcaA8550a',
provider: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
provider: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
startBlock: 11790003,
},
];