Co-authored-by: macqbat <maciek@vegaprotocol.io>
This commit is contained in:
parent
89d0723eb3
commit
fbdcd04096
@ -21,10 +21,12 @@ describe('Portfolio page', { tags: '@smoke' }, () => {
|
||||
'Receiver',
|
||||
'Account type',
|
||||
'Market',
|
||||
'Transfer Type',
|
||||
'Transfer type',
|
||||
'Quantity',
|
||||
'Asset',
|
||||
'Vega Time',
|
||||
'Sender account balance',
|
||||
'Receiver account balance',
|
||||
'Vega time',
|
||||
];
|
||||
cy.getByTestId('tab-ledger-entries').within(($headers) => {
|
||||
cy.wrap($headers)
|
||||
@ -41,9 +43,9 @@ describe('Portfolio page', { tags: '@smoke' }, () => {
|
||||
it('account filters should be callable', () => {
|
||||
cy.visit('/#/portfolio');
|
||||
cy.getByTestId('"Ledger entries"').click();
|
||||
cy.get('[role="columnheader"][col-id="senderAccountType"]').realHover();
|
||||
cy.get('[role="columnheader"][col-id="fromAccountType"]').realHover();
|
||||
cy.get(
|
||||
'[role="columnheader"][col-id="senderAccountType"] .ag-header-cell-menu-button'
|
||||
'[role="columnheader"][col-id="fromAccountType"] .ag-header-cell-menu-button'
|
||||
).click();
|
||||
cy.get('fieldset.ag-simple-filter-body-wrapper')
|
||||
.should('be.visible')
|
||||
|
@ -3,31 +3,30 @@ fragment LedgerEntry on AggregatedLedgerEntry {
|
||||
quantity
|
||||
assetId
|
||||
transferType
|
||||
receiverAccountType
|
||||
receiverMarketId
|
||||
receiverPartyId
|
||||
senderAccountType
|
||||
senderMarketId
|
||||
senderPartyId
|
||||
toAccountType
|
||||
toAccountMarketId
|
||||
toAccountPartyId
|
||||
toAccountBalance
|
||||
fromAccountType
|
||||
fromAccountMarketId
|
||||
fromAccountPartyId
|
||||
fromAccountBalance
|
||||
}
|
||||
|
||||
query LedgerEntries(
|
||||
$partyId: ID!
|
||||
$pagination: Pagination
|
||||
$dateRange: DateRange
|
||||
$senderAccountType: [AccountType!]
|
||||
$receiverAccountType: [AccountType!]
|
||||
$fromAccountType: [AccountType!]
|
||||
$toAccountType: [AccountType!]
|
||||
) {
|
||||
ledgerEntries(
|
||||
filter: {
|
||||
SenderAccountFilter: {
|
||||
FromAccountFilter: {
|
||||
partyIds: [$partyId]
|
||||
accountTypes: $senderAccountType
|
||||
}
|
||||
ReceiverAccountFilter: {
|
||||
partyIds: [$partyId]
|
||||
accountTypes: $receiverAccountType
|
||||
accountTypes: $fromAccountType
|
||||
}
|
||||
ToAccountFilter: { partyIds: [$partyId], accountTypes: $toAccountType }
|
||||
}
|
||||
pagination: $pagination
|
||||
dateRange: $dateRange
|
||||
|
30
libs/ledger/src/lib/__generated__/LedgerEntries.ts
generated
30
libs/ledger/src/lib/__generated__/LedgerEntries.ts
generated
@ -3,18 +3,18 @@ import * as Types from '@vegaprotocol/types';
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type LedgerEntryFragment = { __typename?: 'AggregatedLedgerEntry', vegaTime: any, quantity: string, assetId?: string | null, transferType?: Types.TransferType | null, receiverAccountType?: Types.AccountType | null, receiverMarketId?: string | null, receiverPartyId?: string | null, senderAccountType?: Types.AccountType | null, senderMarketId?: string | null, senderPartyId?: string | null };
|
||||
export type LedgerEntryFragment = { __typename?: 'AggregatedLedgerEntry', vegaTime: any, quantity: string, assetId?: string | null, transferType?: Types.TransferType | null, toAccountType?: Types.AccountType | null, toAccountMarketId?: string | null, toAccountPartyId?: string | null, toAccountBalance: string, fromAccountType?: Types.AccountType | null, fromAccountMarketId?: string | null, fromAccountPartyId?: string | null, fromAccountBalance: string };
|
||||
|
||||
export type LedgerEntriesQueryVariables = Types.Exact<{
|
||||
partyId: Types.Scalars['ID'];
|
||||
pagination?: Types.InputMaybe<Types.Pagination>;
|
||||
dateRange?: Types.InputMaybe<Types.DateRange>;
|
||||
senderAccountType?: Types.InputMaybe<Array<Types.AccountType> | Types.AccountType>;
|
||||
receiverAccountType?: Types.InputMaybe<Array<Types.AccountType> | Types.AccountType>;
|
||||
fromAccountType?: Types.InputMaybe<Array<Types.AccountType> | Types.AccountType>;
|
||||
toAccountType?: Types.InputMaybe<Array<Types.AccountType> | Types.AccountType>;
|
||||
}>;
|
||||
|
||||
|
||||
export type LedgerEntriesQuery = { __typename?: 'Query', ledgerEntries: { __typename?: 'AggregatedLedgerEntriesConnection', edges: Array<{ __typename?: 'AggregatedLedgerEntriesEdge', node: { __typename?: 'AggregatedLedgerEntry', vegaTime: any, quantity: string, assetId?: string | null, transferType?: Types.TransferType | null, receiverAccountType?: Types.AccountType | null, receiverMarketId?: string | null, receiverPartyId?: string | null, senderAccountType?: Types.AccountType | null, senderMarketId?: string | null, senderPartyId?: string | null } } | null>, pageInfo: { __typename?: 'PageInfo', startCursor: string, endCursor: string, hasNextPage: boolean, hasPreviousPage: boolean } } };
|
||||
export type LedgerEntriesQuery = { __typename?: 'Query', ledgerEntries: { __typename?: 'AggregatedLedgerEntriesConnection', edges: Array<{ __typename?: 'AggregatedLedgerEntriesEdge', node: { __typename?: 'AggregatedLedgerEntry', vegaTime: any, quantity: string, assetId?: string | null, transferType?: Types.TransferType | null, toAccountType?: Types.AccountType | null, toAccountMarketId?: string | null, toAccountPartyId?: string | null, toAccountBalance: string, fromAccountType?: Types.AccountType | null, fromAccountMarketId?: string | null, fromAccountPartyId?: string | null, fromAccountBalance: string } } | null>, pageInfo: { __typename?: 'PageInfo', startCursor: string, endCursor: string, hasNextPage: boolean, hasPreviousPage: boolean } } };
|
||||
|
||||
export const LedgerEntryFragmentDoc = gql`
|
||||
fragment LedgerEntry on AggregatedLedgerEntry {
|
||||
@ -22,18 +22,20 @@ export const LedgerEntryFragmentDoc = gql`
|
||||
quantity
|
||||
assetId
|
||||
transferType
|
||||
receiverAccountType
|
||||
receiverMarketId
|
||||
receiverPartyId
|
||||
senderAccountType
|
||||
senderMarketId
|
||||
senderPartyId
|
||||
toAccountType
|
||||
toAccountMarketId
|
||||
toAccountPartyId
|
||||
toAccountBalance
|
||||
fromAccountType
|
||||
fromAccountMarketId
|
||||
fromAccountPartyId
|
||||
fromAccountBalance
|
||||
}
|
||||
`;
|
||||
export const LedgerEntriesDocument = gql`
|
||||
query LedgerEntries($partyId: ID!, $pagination: Pagination, $dateRange: DateRange, $senderAccountType: [AccountType!], $receiverAccountType: [AccountType!]) {
|
||||
query LedgerEntries($partyId: ID!, $pagination: Pagination, $dateRange: DateRange, $fromAccountType: [AccountType!], $toAccountType: [AccountType!]) {
|
||||
ledgerEntries(
|
||||
filter: {SenderAccountFilter: {partyIds: [$partyId], accountTypes: $senderAccountType}, ReceiverAccountFilter: {partyIds: [$partyId], accountTypes: $receiverAccountType}}
|
||||
filter: {FromAccountFilter: {partyIds: [$partyId], accountTypes: $fromAccountType}, ToAccountFilter: {partyIds: [$partyId], accountTypes: $toAccountType}}
|
||||
pagination: $pagination
|
||||
dateRange: $dateRange
|
||||
) {
|
||||
@ -67,8 +69,8 @@ export const LedgerEntriesDocument = gql`
|
||||
* partyId: // value for 'partyId'
|
||||
* pagination: // value for 'pagination'
|
||||
* dateRange: // value for 'dateRange'
|
||||
* senderAccountType: // value for 'senderAccountType'
|
||||
* receiverAccountType: // value for 'receiverAccountType'
|
||||
* fromAccountType: // value for 'fromAccountType'
|
||||
* toAccountType: // value for 'toAccountType'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
|
@ -123,10 +123,10 @@ export const ledgerEntriesProvider = makeDerivedDataProvider<
|
||||
const entry = edge?.node;
|
||||
const asset = assets.find((asset: Asset) => asset.id === entry.assetId);
|
||||
const marketSender = markets.find(
|
||||
(market: Market) => market.id === entry.senderMarketId
|
||||
(market: Market) => market.id === entry.fromAccountMarketId
|
||||
);
|
||||
const marketReceiver = markets.find(
|
||||
(market: Market) => market.id === entry.receiverMarketId
|
||||
(market: Market) => market.id === entry.toAccountMarketId
|
||||
);
|
||||
return { node: { ...entry, asset, marketSender, marketReceiver } };
|
||||
});
|
||||
@ -151,8 +151,8 @@ export const useLedgerEntriesDataProvider = ({
|
||||
() => ({
|
||||
partyId,
|
||||
dateRange: filter?.vegaTime?.value,
|
||||
senderAccountType: filter?.senderAccountType?.value ?? null,
|
||||
receiverAccountType: filter?.receiverAccountType?.value ?? null,
|
||||
fromAccountType: filter?.fromAccountType?.value ?? null,
|
||||
toAccountType: filter?.toAccountType?.value ?? null,
|
||||
}),
|
||||
[partyId, filter]
|
||||
);
|
||||
|
@ -37,41 +37,47 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
quantity: '0',
|
||||
assetId: 'asset-id',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
receiverMarketId: 'market-1',
|
||||
receiverPartyId: 'network',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
senderMarketId: 'market-0',
|
||||
senderPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
toAccountMarketId: 'market-1',
|
||||
toAccountPartyId: 'network',
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
fromAccountMarketId: 'market-0',
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669221452175594000',
|
||||
quantity: '0',
|
||||
assetId: 'asset-id-2',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
receiverMarketId: 'market-0',
|
||||
receiverPartyId: 'network',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
senderMarketId: 'market-2',
|
||||
senderPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
toAccountMarketId: 'market-0',
|
||||
toAccountPartyId: 'network',
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
fromAccountMarketId: 'market-2',
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209347054198000',
|
||||
quantity: '0',
|
||||
assetId: 'asset-id',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
receiverMarketId: 'market-3',
|
||||
receiverPartyId: 'network',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
senderMarketId: 'market-2',
|
||||
senderPartyId: 'sender party id',
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
toAccountMarketId: 'market-3',
|
||||
toAccountPartyId: 'network',
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
fromAccountMarketId: 'market-2',
|
||||
fromAccountPartyId: 'sender party id',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209345512806000',
|
||||
@ -79,6 +85,8 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
assetId: 'asset-id',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209316163397000',
|
||||
@ -86,6 +94,8 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
assetId: 'asset-id-2',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209299051286000',
|
||||
@ -93,6 +103,8 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
assetId: 'asset-id-2',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MTM_WIN,
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209151328614000',
|
||||
@ -100,6 +112,8 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
assetId: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209117655380000',
|
||||
@ -107,6 +121,8 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
assetId: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209082788024000',
|
||||
@ -114,6 +130,8 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
assetId: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MTM_WIN,
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '1669209076546363000',
|
||||
@ -121,22 +139,26 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
assetId: 'cee709223217281d7893b650850ae8ee8a18b7539b5658f9b4cc24de95dd18ad',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_HIGH,
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '2022-11-24T13:36:42.13989Z',
|
||||
quantity: '9078407730948615',
|
||||
assetId: 'cee709223217281d7893b650850ae8ee8a18b7539b5658f9b4cc24de95dd18ad',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_LOW,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
receiverMarketId: null,
|
||||
receiverPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
toAccountMarketId: null,
|
||||
toAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_MARGIN,
|
||||
senderMarketId:
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_MARGIN,
|
||||
fromAccountMarketId:
|
||||
'0942d767cb2cb5a795e14216e8e53c2b6f75e46dc1732c5aeda8a5aba4ad193d',
|
||||
senderPartyId:
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
|
||||
{
|
||||
@ -144,16 +166,18 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
quantity: '263142253070974',
|
||||
assetId: 'cee709223217281d7893b650850ae8ee8a18b7539b5658f9b4cc24de95dd18ad',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_MARGIN_LOW,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
receiverMarketId: null,
|
||||
receiverPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
toAccountMarketId: null,
|
||||
toAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_MARGIN,
|
||||
senderMarketId:
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_MARGIN,
|
||||
fromAccountMarketId:
|
||||
'0942d767cb2cb5a795e14216e8e53c2b6f75e46dc1732c5aeda8a5aba4ad193d',
|
||||
senderPartyId:
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
|
||||
{
|
||||
@ -161,55 +185,63 @@ const ledgerEntries: LedgerEntryFragment[] = [
|
||||
quantity: '1000000000',
|
||||
assetId: '4e4e80abff30cab933b8c4ac6befc618372eb76b2cbddc337eff0b4a3a4d25b8',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_DEPOSIT,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
receiverMarketId: null,
|
||||
receiverPartyId: 'network',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
senderMarketId: null,
|
||||
senderPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
toAccountMarketId: null,
|
||||
toAccountPartyId: 'network',
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
fromAccountMarketId: null,
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '2022-11-24T12:39:11.516154Z',
|
||||
quantity: '1000000000000',
|
||||
assetId: 'c9fe6fc24fce121b2cc72680543a886055abb560043fda394ba5376203b7527d',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_DEPOSIT,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
receiverMarketId: null,
|
||||
receiverPartyId: 'network',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
senderMarketId: null,
|
||||
senderPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
toAccountMarketId: null,
|
||||
toAccountPartyId: 'network',
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
fromAccountMarketId: null,
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '2022-11-24T12:37:26.832226Z',
|
||||
quantity: '10000000000000000000000',
|
||||
assetId: 'c9fe6fc24fce121b2cc72680543a886055abb560043fda394ba5376203b7527d',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_DEPOSIT,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
receiverMarketId: null,
|
||||
receiverPartyId: 'network',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
senderMarketId: null,
|
||||
senderPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
toAccountMarketId: null,
|
||||
toAccountPartyId: 'network',
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
fromAccountMarketId: null,
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
{
|
||||
vegaTime: '2022-11-24T12:24:52.844901Z',
|
||||
quantity: '49390000000000000000000',
|
||||
assetId: 'c9fe6fc24fce121b2cc72680543a886055abb560043fda394ba5376203b7527d',
|
||||
transferType: Schema.TransferType.TRANSFER_TYPE_DEPOSIT,
|
||||
receiverAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
receiverMarketId: null,
|
||||
receiverPartyId: 'network',
|
||||
senderAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
senderMarketId: null,
|
||||
senderPartyId:
|
||||
toAccountType: Schema.AccountType.ACCOUNT_TYPE_EXTERNAL,
|
||||
toAccountMarketId: null,
|
||||
toAccountPartyId: 'network',
|
||||
fromAccountType: Schema.AccountType.ACCOUNT_TYPE_GENERAL,
|
||||
fromAccountMarketId: null,
|
||||
fromAccountPartyId:
|
||||
'2e1ef32e5804e14232406aebaad719087d326afa5c648b7824d0823d8a46c8d1',
|
||||
__typename: 'AggregatedLedgerEntry',
|
||||
toAccountBalance: '0',
|
||||
fromAccountBalance: '0',
|
||||
},
|
||||
];
|
||||
|
@ -12,8 +12,8 @@ export interface Filter {
|
||||
vegaTime?: {
|
||||
value: Schema.DateRange;
|
||||
};
|
||||
senderAccountType?: { value: Types.AccountType[] };
|
||||
receiverAccountType?: { value: Types.AccountType[] };
|
||||
fromAccountType?: { value: Types.AccountType[] };
|
||||
toAccountType?: { value: Types.AccountType[] };
|
||||
}
|
||||
|
||||
type LedgerManagerProps = { partyId: string };
|
||||
|
@ -57,10 +57,10 @@ export const LedgerTable = forwardRef<AgGridReact, LedgerEntryProps>(
|
||||
>
|
||||
<AgGridColumn
|
||||
headerName={t('Sender')}
|
||||
field="senderPartyId"
|
||||
field="fromAccountPartyId"
|
||||
cellRenderer={({
|
||||
value,
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'senderPartyId'>) =>
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'fromAccountPartyId'>) =>
|
||||
truncateByChars(value || '')
|
||||
}
|
||||
/>
|
||||
@ -70,10 +70,10 @@ export const LedgerTable = forwardRef<AgGridReact, LedgerEntryProps>(
|
||||
filterParams={{
|
||||
set: AccountTypeMapping,
|
||||
}}
|
||||
field="senderAccountType"
|
||||
field="fromAccountType"
|
||||
cellRenderer={({
|
||||
value,
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'senderAccountType'>) =>
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'fromAccountType'>) =>
|
||||
value ? AccountTypeMapping[value] : '-'
|
||||
}
|
||||
/>
|
||||
@ -89,10 +89,10 @@ export const LedgerTable = forwardRef<AgGridReact, LedgerEntryProps>(
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('Receiver')}
|
||||
field="receiverPartyId"
|
||||
field="toAccountPartyId"
|
||||
cellRenderer={({
|
||||
value,
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'receiverPartyId'>) =>
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'toAccountPartyId'>) =>
|
||||
truncateByChars(value || '')
|
||||
}
|
||||
/>
|
||||
@ -102,10 +102,10 @@ export const LedgerTable = forwardRef<AgGridReact, LedgerEntryProps>(
|
||||
filterParams={{
|
||||
set: AccountTypeMapping,
|
||||
}}
|
||||
field="receiverAccountType"
|
||||
field="toAccountType"
|
||||
cellRenderer={({
|
||||
value,
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'receiverAccountType'>) =>
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'toAccountType'>) =>
|
||||
value ? AccountTypeMapping[value] : '-'
|
||||
}
|
||||
/>
|
||||
@ -120,7 +120,7 @@ export const LedgerTable = forwardRef<AgGridReact, LedgerEntryProps>(
|
||||
>) => value || '-'}
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('Transfer Type')}
|
||||
headerName={t('Transfer type')}
|
||||
field="transferType"
|
||||
tooltipField="transferType"
|
||||
valueFormatter={({
|
||||
@ -158,7 +158,43 @@ export const LedgerTable = forwardRef<AgGridReact, LedgerEntryProps>(
|
||||
}
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('Vega Time')}
|
||||
headerName={t('Sender account balance')}
|
||||
field="fromAccountBalance"
|
||||
valueFormatter={({
|
||||
value,
|
||||
data,
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'fromAccountBalance'>) => {
|
||||
const marketDecimalPlaces = data?.marketSender?.decimalPlaces;
|
||||
const assetDecimalPlaces = data?.asset?.decimals || 0;
|
||||
return value
|
||||
? addDecimalsFormatNumber(
|
||||
value,
|
||||
assetDecimalPlaces,
|
||||
marketDecimalPlaces
|
||||
)
|
||||
: value;
|
||||
}}
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('Receiver account balance')}
|
||||
field="toAccountBalance"
|
||||
valueFormatter={({
|
||||
value,
|
||||
data,
|
||||
}: VegaValueFormatterParams<LedgerEntry, 'toAccountBalance'>) => {
|
||||
const marketDecimalPlaces = data?.marketReceiver?.decimalPlaces;
|
||||
const assetDecimalPlaces = data?.asset?.decimals || 0;
|
||||
return value
|
||||
? addDecimalsFormatNumber(
|
||||
value,
|
||||
assetDecimalPlaces,
|
||||
marketDecimalPlaces
|
||||
)
|
||||
: value;
|
||||
}}
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('Vega time')}
|
||||
field="vegaTime"
|
||||
valueFormatter={({
|
||||
value,
|
||||
|
81
libs/types/src/__generated__/types.ts
generated
81
libs/types/src/__generated__/types.ts
generated
@ -66,13 +66,6 @@ export type AccountEvent = {
|
||||
type: AccountType;
|
||||
};
|
||||
|
||||
export enum AccountField {
|
||||
AccountType = 'AccountType',
|
||||
AssetId = 'AssetId',
|
||||
MarketId = 'MarketId',
|
||||
PartyId = 'PartyId'
|
||||
}
|
||||
|
||||
/** Filter input for historical balance queries */
|
||||
export type AccountFilter = {
|
||||
accountTypes?: InputMaybe<Array<AccountType>>;
|
||||
@ -193,20 +186,24 @@ export type AggregatedLedgerEntry = {
|
||||
__typename?: 'AggregatedLedgerEntry';
|
||||
/** Asset identifier, if query was grouped by asset - else null */
|
||||
assetId?: Maybe<Scalars['ID']>;
|
||||
/** Sender account balance after the transfer */
|
||||
fromAccountBalance: Scalars['String'];
|
||||
/** Market identifier, if query was grouped by sender market - else null */
|
||||
fromAccountMarketId?: Maybe<Scalars['ID']>;
|
||||
/** Party identifier, if query was grouped by sender party - else null */
|
||||
fromAccountPartyId?: Maybe<Scalars['ID']>;
|
||||
/** Account type, if query was grouped by sender account type - else null */
|
||||
fromAccountType?: Maybe<AccountType>;
|
||||
/** Net amount of ledger entries for the accounts specified in the filter at this time */
|
||||
quantity: Scalars['String'];
|
||||
/** Account type, if query was grouped by receiver account type - else null */
|
||||
receiverAccountType?: Maybe<AccountType>;
|
||||
/** Receiver account balance after the transfer */
|
||||
toAccountBalance: Scalars['String'];
|
||||
/** Market identifier, if query was grouped by receiver market - else null */
|
||||
receiverMarketId?: Maybe<Scalars['ID']>;
|
||||
toAccountMarketId?: Maybe<Scalars['ID']>;
|
||||
/** Party identifier, if query was grouped by receiver party - else null */
|
||||
receiverPartyId?: Maybe<Scalars['ID']>;
|
||||
/** Account type, if query was grouped by sender account type - else null */
|
||||
senderAccountType?: Maybe<AccountType>;
|
||||
/** Market identifier, if query was grouped by sender market - else null */
|
||||
senderMarketId?: Maybe<Scalars['ID']>;
|
||||
/** Party identifier, if query was grouped by sender party - else null */
|
||||
senderPartyId?: Maybe<Scalars['ID']>;
|
||||
toAccountPartyId?: Maybe<Scalars['ID']>;
|
||||
/** Account type, if query was grouped by receiver account type - else null */
|
||||
toAccountType?: Maybe<AccountType>;
|
||||
/** Type of the transfer for this ledger entry */
|
||||
transferType?: Maybe<TransferType>;
|
||||
/** RFC3339Nano time from at which this ledger entries records were relevant */
|
||||
@ -256,6 +253,7 @@ export type AssetEdge = {
|
||||
/** One of the possible asset sources */
|
||||
export type AssetSource = BuiltinAsset | ERC20;
|
||||
|
||||
/** Status of an asset that has been proposed to be added to the network */
|
||||
export enum AssetStatus {
|
||||
/** Asset can be used on the Vega network */
|
||||
STATUS_ENABLED = 'STATUS_ENABLED',
|
||||
@ -311,6 +309,7 @@ export type AuctionEvent = {
|
||||
trigger: AuctionTrigger;
|
||||
};
|
||||
|
||||
/** Describes the trigger for an auction */
|
||||
export enum AuctionTrigger {
|
||||
/** Auction because market has a frequent batch auction trading mode */
|
||||
AUCTION_TRIGGER_BATCH = 'AUCTION_TRIGGER_BATCH',
|
||||
@ -343,6 +342,7 @@ export type BusEvent = {
|
||||
type: BusEventType;
|
||||
};
|
||||
|
||||
/** Event types */
|
||||
export enum BusEventType {
|
||||
/** An account has been updated */
|
||||
Account = 'Account',
|
||||
@ -594,13 +594,13 @@ export type DataSourceSpecConfigurationTime = {
|
||||
conditions: Array<Maybe<Condition>>;
|
||||
};
|
||||
|
||||
/** Status describe the status of the data spec */
|
||||
/** Describes the status of the data spec */
|
||||
export enum DataSourceSpecStatus {
|
||||
/** describes an active data spec. */
|
||||
/** Describes an active data spec */
|
||||
STATUS_ACTIVE = 'STATUS_ACTIVE',
|
||||
/**
|
||||
* describes a data spec that is not listening to data
|
||||
* anymore.
|
||||
* Describes a data spec that is not listening to data
|
||||
* anymore
|
||||
*/
|
||||
STATUS_DEACTIVATED = 'STATUS_DEACTIVATED'
|
||||
}
|
||||
@ -1097,7 +1097,7 @@ export type FutureProduct = {
|
||||
settlementAsset: Asset;
|
||||
};
|
||||
|
||||
/** A segment of datanode history */
|
||||
/** A segment of data node history */
|
||||
export type HistorySegment = {
|
||||
__typename?: 'HistorySegment';
|
||||
/** Chain ID of the history segment */
|
||||
@ -1115,7 +1115,7 @@ export type Instrument = {
|
||||
__typename?: 'Instrument';
|
||||
/** A short non necessarily unique code used to easily describe the instrument (e.g: FX:BTCUSD/DEC18) (string) */
|
||||
code: Scalars['String'];
|
||||
/** Uniquely identify an instrument across all instruments available on Vega (string) */
|
||||
/** Uniquely identifies an instrument across all instruments available on Vega (string) */
|
||||
id: Scalars['ID'];
|
||||
/** Metadata for this instrument */
|
||||
metadata: InstrumentMetadata;
|
||||
@ -1193,18 +1193,23 @@ export type KeyRotationEdge = {
|
||||
|
||||
export type LedgerEntry = {
|
||||
__typename?: 'LedgerEntry';
|
||||
/** Account from which the asset was taken */
|
||||
accountFromId: AccountDetails;
|
||||
/** Account to which the balance was transferred */
|
||||
accountToId: AccountDetails;
|
||||
/** The amount transferred */
|
||||
amount: Scalars['String'];
|
||||
/** Sender account balance after the transfer */
|
||||
fromAccountBalance: Scalars['String'];
|
||||
/** Account from which the asset was taken */
|
||||
fromAccountId: AccountDetails;
|
||||
/** RFC3339Nano time at which the transfer was made */
|
||||
timestamp: Scalars['Timestamp'];
|
||||
/** Receiver account balance after the transfer */
|
||||
toAccountBalance: Scalars['String'];
|
||||
/** Account to which the balance was transferred */
|
||||
toAccountId: AccountDetails;
|
||||
/** Type of ledger entry */
|
||||
type: TransferType;
|
||||
};
|
||||
|
||||
/** Type of transfer between accounts */
|
||||
export enum LedgerEntryField {
|
||||
TransferType = 'TransferType'
|
||||
}
|
||||
@ -1212,8 +1217,8 @@ export enum LedgerEntryField {
|
||||
/** Filter for historical entry ledger queries */
|
||||
export type LedgerEntryFilter = {
|
||||
CloseOnAccountFilters?: InputMaybe<Scalars['Boolean']>;
|
||||
ReceiverAccountFilter?: InputMaybe<AccountFilter>;
|
||||
SenderAccountFilter?: InputMaybe<AccountFilter>;
|
||||
FromAccountFilter?: InputMaybe<AccountFilter>;
|
||||
ToAccountFilter?: InputMaybe<AccountFilter>;
|
||||
TransferTypes?: InputMaybe<Array<InputMaybe<TransferType>>>;
|
||||
};
|
||||
|
||||
@ -1788,7 +1793,7 @@ export enum MarketTradingMode {
|
||||
TRADING_MODE_OPENING_AUCTION = 'TRADING_MODE_OPENING_AUCTION'
|
||||
}
|
||||
|
||||
/** Information about whether proposals are enabled, if the markets are still bootstrapping etc.. */
|
||||
/** Information about whether proposals are enabled, if the markets are still bootstrapping, etc.. */
|
||||
export type NetworkLimits = {
|
||||
__typename?: 'NetworkLimits';
|
||||
/** How many blocks before the chain comes out of bootstrap mode */
|
||||
@ -1984,7 +1989,7 @@ export type NodeSignatureEdge = {
|
||||
node: NodeSignature;
|
||||
};
|
||||
|
||||
/** Represents the type signature provided by a node */
|
||||
/** Represents the type of signature provided by a node */
|
||||
export enum NodeSignatureKind {
|
||||
/** A signature for proposing a new asset into the network */
|
||||
NODE_SIGNATURE_KIND_ASSET_NEW = 'NODE_SIGNATURE_KIND_ASSET_NEW',
|
||||
@ -2179,7 +2184,7 @@ export type OracleDataEdge = {
|
||||
|
||||
export type OracleSpec = {
|
||||
__typename?: 'OracleSpec';
|
||||
/** Data list all the oracle data broadcast to this spec */
|
||||
/** Data lists all the oracle data broadcast to this spec */
|
||||
dataConnection: OracleDataConnection;
|
||||
dataSourceSpec: ExternalDataSourceSpec;
|
||||
};
|
||||
@ -2423,6 +2428,7 @@ export enum OrderTimeInForce {
|
||||
TIME_IN_FORCE_IOC = 'TIME_IN_FORCE_IOC'
|
||||
}
|
||||
|
||||
/** Types of orders */
|
||||
export enum OrderType {
|
||||
/** Order that uses a pre-specified price to buy or sell */
|
||||
TYPE_LIMIT = 'TYPE_LIMIT',
|
||||
@ -2430,7 +2436,7 @@ export enum OrderType {
|
||||
TYPE_MARKET = 'TYPE_MARKET',
|
||||
/**
|
||||
* Used for distressed parties, an order placed by the network to close out distressed parties
|
||||
* similar to Market order, only no party is attached to the order.
|
||||
* similar to market order, only no party is attached to the order.
|
||||
*/
|
||||
TYPE_NETWORK = 'TYPE_NETWORK'
|
||||
}
|
||||
@ -4314,6 +4320,7 @@ export enum TransferStatus {
|
||||
STATUS_STOPPED = 'STATUS_STOPPED'
|
||||
}
|
||||
|
||||
/** Types that describe why a transfer has been made */
|
||||
export enum TransferType {
|
||||
/** Bond returned to general account after liquidity commitment was reduced */
|
||||
TRANSFER_TYPE_BOND_HIGH = 'TRANSFER_TYPE_BOND_HIGH',
|
||||
@ -4446,10 +4453,11 @@ export type UpdateNetworkParameter = {
|
||||
networkParameter: NetworkParameter;
|
||||
};
|
||||
|
||||
/** Status of a validator node */
|
||||
export enum ValidatorStatus {
|
||||
/** The node is a candidate to become a Tendermint validator if a slot is made available */
|
||||
VALIDATOR_NODE_STATUS_ERSATZ = 'VALIDATOR_NODE_STATUS_ERSATZ',
|
||||
/** The node is pending to be promoted to Ersatz */
|
||||
/** The node is pending promotion to ersatz (standby), if a slot is available and if the node fulfils the requirements */
|
||||
VALIDATOR_NODE_STATUS_PENDING = 'VALIDATOR_NODE_STATUS_PENDING',
|
||||
/** The node is taking part in Tendermint consensus */
|
||||
VALIDATOR_NODE_STATUS_TENDERMINT = 'VALIDATOR_NODE_STATUS_TENDERMINT'
|
||||
@ -4491,10 +4499,11 @@ export type VoteEdge = {
|
||||
node: Vote;
|
||||
};
|
||||
|
||||
/** Whether a governance vote is yes or no */
|
||||
export enum VoteValue {
|
||||
/** No reject a proposal */
|
||||
/** No votes against a proposal */
|
||||
VALUE_NO = 'VALUE_NO',
|
||||
/** Yes accept a proposal */
|
||||
/** Yes votes for a proposal */
|
||||
VALUE_YES = 'VALUE_YES'
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user