@centrifuge/sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Centrifuge.d.ts.map +1 -1
- package/dist/Centrifuge.js +7 -7
- package/dist/Centrifuge.js.map +1 -1
- package/dist/entities/Investor.d.ts.map +1 -1
- package/dist/entities/Investor.js +4 -4
- package/dist/entities/Investor.js.map +1 -1
- package/dist/entities/MerkleProofManager.d.ts.map +1 -1
- package/dist/entities/MerkleProofManager.js +1 -1
- package/dist/entities/MerkleProofManager.js.map +1 -1
- package/dist/entities/OnOffRampManager.js +4 -4
- package/dist/entities/OnOffRampManager.js.map +1 -1
- package/dist/entities/OnOffRampManager.test.js +2 -2
- package/dist/entities/OnOffRampManager.test.js.map +1 -1
- package/dist/entities/Pool.d.ts.map +1 -1
- package/dist/entities/Pool.js +13 -13
- package/dist/entities/Pool.js.map +1 -1
- package/dist/entities/PoolNetwork.js +7 -7
- package/dist/entities/PoolNetwork.js.map +1 -1
- package/dist/entities/Reports/PoolSharePricesReport.js +1 -1
- package/dist/entities/Reports/PoolSharePricesReport.js.map +1 -1
- package/dist/entities/ShareClass.d.ts.map +1 -1
- package/dist/entities/ShareClass.js +13 -13
- package/dist/entities/ShareClass.js.map +1 -1
- package/dist/entities/Vault.js +2 -2
- package/dist/entities/Vault.js.map +1 -1
- package/package.json +1 -1
- package/dist/config/protocol.d.ts +0 -3
- package/dist/config/protocol.d.ts.map +0 -1
- package/dist/config/protocol.js +0 -7
- package/dist/config/protocol.js.map +0 -1
- package/dist/entities/IndexerQueries/assetSnapshots.d.ts +0 -69
- package/dist/entities/IndexerQueries/assetSnapshots.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/assetSnapshots.js +0 -91
- package/dist/entities/IndexerQueries/assetSnapshots.js.map +0 -1
- package/dist/entities/IndexerQueries/assetTransactions.d.ts +0 -93
- package/dist/entities/IndexerQueries/assetTransactions.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/assetTransactions.js +0 -75
- package/dist/entities/IndexerQueries/assetTransactions.js.map +0 -1
- package/dist/entities/IndexerQueries/epochs.d.ts +0 -45
- package/dist/entities/IndexerQueries/epochs.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/epochs.js +0 -51
- package/dist/entities/IndexerQueries/epochs.js.map +0 -1
- package/dist/entities/IndexerQueries/index.d.ts +0 -40
- package/dist/entities/IndexerQueries/index.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/index.js +0 -45
- package/dist/entities/IndexerQueries/index.js.map +0 -1
- package/dist/entities/IndexerQueries/investorTransactions.d.ts +0 -50
- package/dist/entities/IndexerQueries/investorTransactions.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/investorTransactions.js +0 -55
- package/dist/entities/IndexerQueries/investorTransactions.js.map +0 -1
- package/dist/entities/IndexerQueries/poolFeeSnapshots.d.ts +0 -48
- package/dist/entities/IndexerQueries/poolFeeSnapshots.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/poolFeeSnapshots.js +0 -62
- package/dist/entities/IndexerQueries/poolFeeSnapshots.js.map +0 -1
- package/dist/entities/IndexerQueries/poolFeeTransactions.d.ts +0 -34
- package/dist/entities/IndexerQueries/poolFeeTransactions.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/poolFeeTransactions.js +0 -37
- package/dist/entities/IndexerQueries/poolFeeTransactions.js.map +0 -1
- package/dist/entities/IndexerQueries/poolSnapshots.d.ts +0 -79
- package/dist/entities/IndexerQueries/poolSnapshots.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/poolSnapshots.js +0 -112
- package/dist/entities/IndexerQueries/poolSnapshots.js.map +0 -1
- package/dist/entities/IndexerQueries/trancheCurrencyBalance.d.ts +0 -76
- package/dist/entities/IndexerQueries/trancheCurrencyBalance.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/trancheCurrencyBalance.js +0 -63
- package/dist/entities/IndexerQueries/trancheCurrencyBalance.js.map +0 -1
- package/dist/entities/IndexerQueries/trancheSnapshots.d.ts +0 -70
- package/dist/entities/IndexerQueries/trancheSnapshots.d.ts.map +0 -1
- package/dist/entities/IndexerQueries/trancheSnapshots.js +0 -76
- package/dist/entities/IndexerQueries/trancheSnapshots.js.map +0 -1
- package/dist/entities/Reports/Processor.d.ts +0 -46
- package/dist/entities/Reports/Processor.d.ts.map +0 -1
- package/dist/entities/Reports/Processor.js +0 -471
- package/dist/entities/Reports/Processor.js.map +0 -1
- package/dist/entities/Reports/Processor.test.d.ts +0 -2
- package/dist/entities/Reports/Processor.test.d.ts.map +0 -1
- package/dist/entities/Reports/Processor.test.js +0 -767
- package/dist/entities/Reports/Processor.test.js.map +0 -1
- package/dist/entities/Reports/Reports.test.d.ts +0 -2
- package/dist/entities/Reports/Reports.test.d.ts.map +0 -1
- package/dist/entities/Reports/Reports.test.js +0 -559
- package/dist/entities/Reports/Reports.test.js.map +0 -1
- package/dist/entities/Reports/index.d.ts +0 -21
- package/dist/entities/Reports/index.d.ts.map +0 -1
- package/dist/entities/Reports/index.js +0 -144
- package/dist/entities/Reports/index.js.map +0 -1
- package/dist/tests/mocks/mockAssetSnapshots.d.ts +0 -3
- package/dist/tests/mocks/mockAssetSnapshots.d.ts.map +0 -1
- package/dist/tests/mocks/mockAssetSnapshots.js +0 -56
- package/dist/tests/mocks/mockAssetSnapshots.js.map +0 -1
- package/dist/tests/mocks/mockAssetTransactions.d.ts +0 -3
- package/dist/tests/mocks/mockAssetTransactions.d.ts.map +0 -1
- package/dist/tests/mocks/mockAssetTransactions.js +0 -86
- package/dist/tests/mocks/mockAssetTransactions.js.map +0 -1
- package/dist/tests/mocks/mockEpochs.d.ts +0 -3
- package/dist/tests/mocks/mockEpochs.d.ts.map +0 -1
- package/dist/tests/mocks/mockEpochs.js +0 -26
- package/dist/tests/mocks/mockEpochs.js.map +0 -1
- package/dist/tests/mocks/mockInvestorCurrencyBalance.d.ts +0 -3
- package/dist/tests/mocks/mockInvestorCurrencyBalance.d.ts.map +0 -1
- package/dist/tests/mocks/mockInvestorCurrencyBalance.js +0 -29
- package/dist/tests/mocks/mockInvestorCurrencyBalance.js.map +0 -1
- package/dist/tests/mocks/mockInvestorTransactions.d.ts +0 -3
- package/dist/tests/mocks/mockInvestorTransactions.d.ts.map +0 -1
- package/dist/tests/mocks/mockInvestorTransactions.js +0 -35
- package/dist/tests/mocks/mockInvestorTransactions.js.map +0 -1
- package/dist/tests/mocks/mockPoolFeeSnapshot.d.ts +0 -3
- package/dist/tests/mocks/mockPoolFeeSnapshot.d.ts.map +0 -1
- package/dist/tests/mocks/mockPoolFeeSnapshot.js +0 -68
- package/dist/tests/mocks/mockPoolFeeSnapshot.js.map +0 -1
- package/dist/tests/mocks/mockPoolFeeTransactions.d.ts +0 -11
- package/dist/tests/mocks/mockPoolFeeTransactions.d.ts.map +0 -1
- package/dist/tests/mocks/mockPoolFeeTransactions.js +0 -20
- package/dist/tests/mocks/mockPoolFeeTransactions.js.map +0 -1
- package/dist/tests/mocks/mockPoolSnapshots.d.ts +0 -3
- package/dist/tests/mocks/mockPoolSnapshots.d.ts.map +0 -1
- package/dist/tests/mocks/mockPoolSnapshots.js +0 -66
- package/dist/tests/mocks/mockPoolSnapshots.js.map +0 -1
- package/dist/tests/mocks/mockTrancheSnapshots.d.ts +0 -3
- package/dist/tests/mocks/mockTrancheSnapshots.d.ts.map +0 -1
- package/dist/tests/mocks/mockTrancheSnapshots.js +0 -112
- package/dist/tests/mocks/mockTrancheSnapshots.js.map +0 -1
- package/dist/types/reports.d.ts +0 -336
- package/dist/types/reports.d.ts.map +0 -1
- package/dist/types/reports.js +0 -2
- package/dist/types/reports.js.map +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Balance, Price } from '../../utils/BigInt.js';
|
|
2
|
-
export type AssetTransactionFilter = Partial<Record<keyof SubqueryAssetTransactions['assetTransactions']['nodes'][0], any>>;
|
|
3
|
-
export type AssetTransaction = {
|
|
4
|
-
id: string;
|
|
5
|
-
timestamp: Date;
|
|
6
|
-
poolId: string;
|
|
7
|
-
accountId: string;
|
|
8
|
-
epochId: string;
|
|
9
|
-
type: AssetTransactionType;
|
|
10
|
-
amount: Balance;
|
|
11
|
-
settlementPrice: Price | null;
|
|
12
|
-
quantity: string | null;
|
|
13
|
-
principalAmount: Balance | null;
|
|
14
|
-
interestAmount: Balance | null;
|
|
15
|
-
hash: string;
|
|
16
|
-
realizedProfitFifo: Balance | undefined;
|
|
17
|
-
unrealizedProfitAtMarketPrice: Balance | undefined;
|
|
18
|
-
asset: {
|
|
19
|
-
id: string;
|
|
20
|
-
metadata: string;
|
|
21
|
-
type: AssetType;
|
|
22
|
-
currentPrice: string | null;
|
|
23
|
-
name: string;
|
|
24
|
-
};
|
|
25
|
-
fromAsset?: {
|
|
26
|
-
id: string;
|
|
27
|
-
metadata: string;
|
|
28
|
-
type: AssetType;
|
|
29
|
-
name: string;
|
|
30
|
-
};
|
|
31
|
-
toAsset?: {
|
|
32
|
-
id: string;
|
|
33
|
-
metadata: string;
|
|
34
|
-
type: AssetType;
|
|
35
|
-
name: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export declare enum AssetType {
|
|
39
|
-
OnchainCash = "OnchainCash",
|
|
40
|
-
OffchainCash = "OffchainCash",
|
|
41
|
-
Other = "Other"
|
|
42
|
-
}
|
|
43
|
-
export type AssetTransactionType = 'CREATED' | 'PRICED' | 'BORROWED' | 'REPAID' | 'CLOSED' | 'CASH_TRANSFER' | 'DEPOSIT_FROM_INVESTMENTS' | 'WITHDRAWAL_FOR_REDEMPTIONS' | 'WITHDRAWAL_FOR_FEES' | 'INCREASE_DEBT' | 'DECREASE_DEBT';
|
|
44
|
-
type SubqueryAssetTransactions = {
|
|
45
|
-
assetTransactions: {
|
|
46
|
-
nodes: {
|
|
47
|
-
__typename?: 'AssetTransaction';
|
|
48
|
-
id: string;
|
|
49
|
-
timestamp: string;
|
|
50
|
-
poolId: string;
|
|
51
|
-
accountId: string;
|
|
52
|
-
hash: string;
|
|
53
|
-
epochId: string;
|
|
54
|
-
type: AssetTransactionType;
|
|
55
|
-
amount: string | undefined;
|
|
56
|
-
principalAmount: string | undefined;
|
|
57
|
-
interestAmount: string | undefined;
|
|
58
|
-
settlementPrice: string | null;
|
|
59
|
-
quantity: string | null;
|
|
60
|
-
realizedProfitFifo: string | undefined;
|
|
61
|
-
pool: {
|
|
62
|
-
currency: {
|
|
63
|
-
decimals: number;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
asset: {
|
|
67
|
-
id: string;
|
|
68
|
-
metadata: string;
|
|
69
|
-
name: string;
|
|
70
|
-
type: AssetType;
|
|
71
|
-
sumRealizedProfitFifo: string;
|
|
72
|
-
unrealizedProfitAtMarketPrice: string;
|
|
73
|
-
currentPrice: string;
|
|
74
|
-
};
|
|
75
|
-
fromAsset?: {
|
|
76
|
-
id: string;
|
|
77
|
-
metadata: string;
|
|
78
|
-
name: string;
|
|
79
|
-
type: AssetType;
|
|
80
|
-
};
|
|
81
|
-
toAsset?: {
|
|
82
|
-
id: string;
|
|
83
|
-
metadata: string;
|
|
84
|
-
name: string;
|
|
85
|
-
type: AssetType;
|
|
86
|
-
};
|
|
87
|
-
}[];
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
export declare const assetTransactionsPostProcess: (data: SubqueryAssetTransactions) => AssetTransaction[];
|
|
91
|
-
export declare const assetTransactionsQuery = "\nquery($filter: AssetTransactionFilter) {\n assetTransactions(\n orderBy: TIMESTAMP_ASC,\n filter: $filter\n ) {\n nodes {\n principalAmount\n interestAmount\n epochId\n type\n timestamp\n amount\n settlementPrice\n quantity\n hash\n realizedProfitFifo\n pool {\n currency {\n decimals\n }\n }\n asset {\n id\n metadata\n name\n type\n sumRealizedProfitFifo\n unrealizedProfitAtMarketPrice\n }\n fromAsset {\n id\n metadata\n name\n type\n }\n toAsset {\n id\n metadata\n name\n type\n }\n }\n }\n}\n";
|
|
92
|
-
export {};
|
|
93
|
-
//# sourceMappingURL=assetTransactions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assetTransactions.d.ts","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/assetTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,MAAM,CAAC,MAAM,yBAAyB,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAC9E,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,IAAI,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,oBAAoB,CAAA;IAC1B,MAAM,EAAE,OAAO,CAAA;IACf,eAAe,EAAE,KAAK,GAAG,IAAI,CAAA;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;IAC/B,cAAc,EAAE,OAAO,GAAG,IAAI,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,EAAE,OAAO,GAAG,SAAS,CAAA;IACvC,6BAA6B,EAAE,OAAO,GAAG,SAAS,CAAA;IAClD,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAA;QACV,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,SAAS,CAAA;QACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3B,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAA;QACV,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,SAAS,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;K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AAA;gBACf,qBAAqB,EAAE,MAAM,CAAA;gBAC7B,6BAA6B,EAAE,MAAM,CAAA;gBACrC,YAAY,EAAE,MAAM,CAAA;aACrB,CAAA;YACD,SAAS,CAAC,EAAE;gBACV,EAAE,EAAE,MAAM,CAAA;gBACV,QAAQ,EAAE,MAAM,CAAA;gBAChB,IAAI,EAAE,MAAM,CAAA;gBACZ,IAAI,EAAE,SAAS,CAAA;aAChB,CAAA;YACD,OAAO,CAAC,EAAE;gBACR,EAAE,EAAE,MAAM,CAAA;gBACV,QAAQ,EAAE,MAAM,CAAA;gBAChB,IAAI,EAAE,MAAM,CAAA;gBACZ,IAAI,EAAE,SAAS,CAAA;aAChB,CAAA;SACF,EAAE,CAAA;KACJ,CAAA;CACF,CAAA;AAED,eAAO,MAAM,4BAA4B,SAAU,yBAAyB,KAAG,gBAAgB,EAsB9F,CAAA;AAED,eAAO,MAAM,sBAAsB,4tBA6ClC,CAAA"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Balance, Price } from '../../utils/BigInt.js';
|
|
2
|
-
export var AssetType;
|
|
3
|
-
(function (AssetType) {
|
|
4
|
-
AssetType["OnchainCash"] = "OnchainCash";
|
|
5
|
-
AssetType["OffchainCash"] = "OffchainCash";
|
|
6
|
-
AssetType["Other"] = "Other";
|
|
7
|
-
})(AssetType || (AssetType = {}));
|
|
8
|
-
export const assetTransactionsPostProcess = (data) => {
|
|
9
|
-
return (data.assetTransactions.nodes.map((tx) => {
|
|
10
|
-
const decimals = tx.pool.currency.decimals;
|
|
11
|
-
return {
|
|
12
|
-
...tx,
|
|
13
|
-
name: tx.asset.name,
|
|
14
|
-
settlementPrice: tx.settlementPrice ? new Price(tx.settlementPrice) : null,
|
|
15
|
-
amount: new Balance(tx?.amount ?? 0n, decimals),
|
|
16
|
-
principalAmount: tx.principalAmount ? new Balance(tx.principalAmount, decimals) : null,
|
|
17
|
-
interestAmount: tx.interestAmount ? new Balance(tx.interestAmount, decimals) : null,
|
|
18
|
-
realizedProfitFifo: tx.realizedProfitFifo ? new Balance(tx.realizedProfitFifo, decimals) : undefined,
|
|
19
|
-
sumRealizedProfitFifo: tx.asset.sumRealizedProfitFifo
|
|
20
|
-
? new Balance(tx.asset.sumRealizedProfitFifo, decimals)
|
|
21
|
-
: undefined,
|
|
22
|
-
unrealizedProfitAtMarketPrice: tx.asset.unrealizedProfitAtMarketPrice
|
|
23
|
-
? new Balance(tx.asset.unrealizedProfitAtMarketPrice, decimals)
|
|
24
|
-
: undefined,
|
|
25
|
-
timestamp: new Date(`${tx.timestamp}+00:00`),
|
|
26
|
-
};
|
|
27
|
-
}) || []);
|
|
28
|
-
};
|
|
29
|
-
export const assetTransactionsQuery = `
|
|
30
|
-
query($filter: AssetTransactionFilter) {
|
|
31
|
-
assetTransactions(
|
|
32
|
-
orderBy: TIMESTAMP_ASC,
|
|
33
|
-
filter: $filter
|
|
34
|
-
) {
|
|
35
|
-
nodes {
|
|
36
|
-
principalAmount
|
|
37
|
-
interestAmount
|
|
38
|
-
epochId
|
|
39
|
-
type
|
|
40
|
-
timestamp
|
|
41
|
-
amount
|
|
42
|
-
settlementPrice
|
|
43
|
-
quantity
|
|
44
|
-
hash
|
|
45
|
-
realizedProfitFifo
|
|
46
|
-
pool {
|
|
47
|
-
currency {
|
|
48
|
-
decimals
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
asset {
|
|
52
|
-
id
|
|
53
|
-
metadata
|
|
54
|
-
name
|
|
55
|
-
type
|
|
56
|
-
sumRealizedProfitFifo
|
|
57
|
-
unrealizedProfitAtMarketPrice
|
|
58
|
-
}
|
|
59
|
-
fromAsset {
|
|
60
|
-
id
|
|
61
|
-
metadata
|
|
62
|
-
name
|
|
63
|
-
type
|
|
64
|
-
}
|
|
65
|
-
toAsset {
|
|
66
|
-
id
|
|
67
|
-
metadata
|
|
68
|
-
name
|
|
69
|
-
type
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
//# sourceMappingURL=assetTransactions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assetTransactions.js","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/assetTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AA0CtD,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,0CAA6B,CAAA;IAC7B,4BAAe,CAAA;AACjB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AA8DD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,IAA+B,EAAsB,EAAE;IAClG,OAAO,CACL,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QACtC,MAAM,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAA;QAC1C,OAAO;YACL,GAAG,EAAE;YACL,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI;YACnB,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;YAC1E,MAAM,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,QAAQ,CAAC;YAC/C,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;YACtF,cAAc,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;YACnF,kBAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;YACpG,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB;gBACnD,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,QAAQ,CAAC;gBACvD,CAAC,CAAC,SAAS;YACb,6BAA6B,EAAE,EAAE,CAAC,KAAK,CAAC,6BAA6B;gBACnE,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,EAAE,QAAQ,CAAC;gBAC/D,CAAC,CAAC,SAAS;YACb,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,QAAQ,CAAC;SAC7C,CAAA;IACH,CAAC,CAAC,IAAK,EAAgC,CACxC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CrC,CAAA"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Balance, Price } from '../../utils/BigInt.js';
|
|
2
|
-
export type EpochFilter = Partial<Record<keyof SubqueryEpochs['epoches']['nodes'][0], any>>;
|
|
3
|
-
export type Epoch = {
|
|
4
|
-
epochId: string;
|
|
5
|
-
closedAt: string;
|
|
6
|
-
paidFees: Balance;
|
|
7
|
-
tokenPrice: Price;
|
|
8
|
-
sumOutstandingInvestOrders: Balance;
|
|
9
|
-
sumFulfilledInvestOrders: Balance;
|
|
10
|
-
sumOutstandingRedeemOrders: Balance;
|
|
11
|
-
sumFulfilledRedeemOrders: Balance;
|
|
12
|
-
netAssetValue: Balance;
|
|
13
|
-
};
|
|
14
|
-
type SubqueryEpochs = {
|
|
15
|
-
epoches: {
|
|
16
|
-
nodes: {
|
|
17
|
-
id: string;
|
|
18
|
-
sumPoolFeesPaidAmount: string;
|
|
19
|
-
closedAt: string;
|
|
20
|
-
epochStates: {
|
|
21
|
-
nodes: {
|
|
22
|
-
tokenPrice: string;
|
|
23
|
-
sumOutstandingInvestOrders: string;
|
|
24
|
-
sumFulfilledInvestOrders: string;
|
|
25
|
-
sumOutstandingRedeemOrders: string;
|
|
26
|
-
sumFulfilledRedeemOrders: string;
|
|
27
|
-
}[];
|
|
28
|
-
};
|
|
29
|
-
pool: {
|
|
30
|
-
currency: {
|
|
31
|
-
decimals: number;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
poolSnapshots: {
|
|
35
|
-
nodes: {
|
|
36
|
-
netAssetValue: string;
|
|
37
|
-
}[];
|
|
38
|
-
};
|
|
39
|
-
}[];
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export declare const epochsPostProcess: (data: SubqueryEpochs) => Epoch[];
|
|
43
|
-
export declare const epochsQuery = "\nquery($filter: EpochFilter) {\n epoches(filter: $filter) {\n nodes {\n poolId\n id\n sumPoolFeesPaidAmount\n closedAt\n epochStates {\n nodes {\n tokenPrice\n sumOutstandingInvestOrders\n sumFulfilledInvestOrders\n sumOutstandingRedeemOrders\n sumFulfilledRedeemOrders\n }\n }\n pool {\n currency {\n decimals\n }\n }\n poolSnapshots {\n nodes {\n netAssetValue\n }\n }\n }\n }\n}\n";
|
|
44
|
-
export {};
|
|
45
|
-
//# sourceMappingURL=epochs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"epochs.d.ts","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/epochs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;AAE3F,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,KAAK,CAAA;IACjB,0BAA0B,EAAE,OAAO,CAAA;IACnC,wBAAwB,EAAE,OAAO,CAAA;IACjC,0BAA0B,EAAE,OAAO,CAAA;IACnC,wBAAwB,EAAE,OAAO,CAAA;IACjC,aAAa,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE;QACP,KAAK,EAAE;YACL,EAAE,EAAE,MAAM,CAAA;YACV,qBAAqB,EAAE,MAAM,CAAA;YAC7B,QAAQ,EAAE,MAAM,CAAA;YAChB,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,UAAU,EAAE,MAAM,CAAA;oBAClB,0BAA0B,EAAE,MAAM,CAAA;oBAClC,wBAAwB,EAAE,MAAM,CAAA;oBAChC,0BAA0B,EAAE,MAAM,CAAA;oBAClC,wBAAwB,EAAE,MAAM,CAAA;iBACjC,EAAE,CAAA;aACJ,CAAA;YACD,IAAI,EAAE;gBACJ,QAAQ,EAAE;oBACR,QAAQ,EAAE,MAAM,CAAA;iBACjB,CAAA;aACF,CAAA;YACD,aAAa,EAAE;gBACb,KAAK,EAAE;oBACL,aAAa,EAAE,MAAM,CAAA;iBACtB,EAAE,CAAA;aACJ,CAAA;SACF,EAAE,CAAA;KACJ,CAAA;CACF,CAAA;AAED,eAAO,MAAM,iBAAiB,SAAU,cAAc,KAAG,KAAK,EAiB7D,CAAA;AAED,eAAO,MAAM,WAAW,wiBA8BvB,CAAA"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Balance, Price } from '../../utils/BigInt.js';
|
|
2
|
-
export const epochsPostProcess = (data) => {
|
|
3
|
-
return data.epoches.nodes.map((order) => {
|
|
4
|
-
const index = order.epochStates.nodes.length > 1 ? order.epochStates.nodes.length - 1 : 0;
|
|
5
|
-
const epochStates = order.epochStates.nodes[index];
|
|
6
|
-
const currencyDecimals = order.pool.currency.decimals;
|
|
7
|
-
return {
|
|
8
|
-
epochId: order.id,
|
|
9
|
-
closedAt: order.closedAt,
|
|
10
|
-
paidFees: new Balance(order.sumPoolFeesPaidAmount, currencyDecimals),
|
|
11
|
-
tokenPrice: new Price(epochStates?.tokenPrice ?? '0'),
|
|
12
|
-
sumOutstandingInvestOrders: new Balance(epochStates?.sumOutstandingInvestOrders ?? '0', currencyDecimals),
|
|
13
|
-
sumFulfilledInvestOrders: new Balance(epochStates?.sumFulfilledInvestOrders ?? '0', currencyDecimals),
|
|
14
|
-
sumOutstandingRedeemOrders: new Balance(epochStates?.sumOutstandingRedeemOrders ?? '0', currencyDecimals),
|
|
15
|
-
sumFulfilledRedeemOrders: new Balance(epochStates?.sumFulfilledRedeemOrders ?? '0', currencyDecimals),
|
|
16
|
-
netAssetValue: new Balance(order.poolSnapshots.nodes[index]?.netAssetValue ?? '0', currencyDecimals),
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
export const epochsQuery = `
|
|
21
|
-
query($filter: EpochFilter) {
|
|
22
|
-
epoches(filter: $filter) {
|
|
23
|
-
nodes {
|
|
24
|
-
poolId
|
|
25
|
-
id
|
|
26
|
-
sumPoolFeesPaidAmount
|
|
27
|
-
closedAt
|
|
28
|
-
epochStates {
|
|
29
|
-
nodes {
|
|
30
|
-
tokenPrice
|
|
31
|
-
sumOutstandingInvestOrders
|
|
32
|
-
sumFulfilledInvestOrders
|
|
33
|
-
sumOutstandingRedeemOrders
|
|
34
|
-
sumFulfilledRedeemOrders
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
pool {
|
|
38
|
-
currency {
|
|
39
|
-
decimals
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
poolSnapshots {
|
|
43
|
-
nodes {
|
|
44
|
-
netAssetValue
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
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,wBAAwB,EAAE,IAAI,OAAO,CAAC,WAAW,EAAE,wBAAwB,IAAI,GAAG,EAAE,gBAAgB,CAAC;YACrG,aAAa,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,aAAa,IAAI,GAAG,EAAE,gBAAgB,CAAC;SACrF,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B1B,CAAA"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Centrifuge } from '../../Centrifuge.js';
|
|
2
|
-
import { Entity } from '../Entity.js';
|
|
3
|
-
import { Pool } from '../Pool.js';
|
|
4
|
-
import { AssetSnapshotFilter } from './assetSnapshots.js';
|
|
5
|
-
import { AssetTransactionFilter } from './assetTransactions.js';
|
|
6
|
-
import { EpochFilter } from './epochs.js';
|
|
7
|
-
import { InvestorTransactionFilter } from './investorTransactions.js';
|
|
8
|
-
import { PoolFeeSnapshotFilter } from './poolFeeSnapshots.js';
|
|
9
|
-
import { PoolFeeTransactionFilter } from './poolFeeTransactions.js';
|
|
10
|
-
import { PoolSnapshotFilter } from './poolSnapshots.js';
|
|
11
|
-
import { CurrencyBalanceFilter, TrancheBalanceFilter } from './trancheCurrencyBalance.js';
|
|
12
|
-
import { TrancheSnapshotFilter } from './trancheSnapshots.js';
|
|
13
|
-
export declare class IndexerQueries extends Entity {
|
|
14
|
-
pool: Pool;
|
|
15
|
-
constructor(centrifuge: Centrifuge, pool: Pool);
|
|
16
|
-
poolFeeSnapshotsQuery(filter?: PoolFeeSnapshotFilter): import("../../index.js").Query<import("./poolFeeSnapshots.js").PoolFeeSnapshotsByDate>;
|
|
17
|
-
poolSnapshotsQuery(filter?: PoolSnapshotFilter): import("../../index.js").Query<import("./poolSnapshots.js").PoolSnapshot[]>;
|
|
18
|
-
trancheSnapshotsQuery(filter?: TrancheSnapshotFilter): import("../../index.js").Query<{
|
|
19
|
-
[date: string]: import("./trancheSnapshots.js").TrancheSnapshot[];
|
|
20
|
-
}>;
|
|
21
|
-
poolEpochsQuery(filter?: EpochFilter): import("../../index.js").Query<import("./epochs.js").Epoch[]>;
|
|
22
|
-
investorTransactionsQuery(filter?: InvestorTransactionFilter): import("../../index.js").Query<import("./investorTransactions.js").InvestorTransaction[]>;
|
|
23
|
-
assetTransactionsQuery(filter?: AssetTransactionFilter): import("../../index.js").Query<import("./assetTransactions.js").AssetTransaction[]>;
|
|
24
|
-
poolFeeTransactionsQuery(filter?: PoolFeeTransactionFilter): import("../../index.js").Query<import("./poolFeeTransactions.js").PoolFeeTransaction[]>;
|
|
25
|
-
assetSnapshotsQuery(filter?: AssetSnapshotFilter): import("../../index.js").Query<import("./assetSnapshots.js").AssetSnapshot[]>;
|
|
26
|
-
trancheCurrencyBalanceQuery(filterTranches?: TrancheBalanceFilter, filterCurrencies?: CurrencyBalanceFilter): import("../../index.js").Query<{
|
|
27
|
-
accountId: string;
|
|
28
|
-
chainId: number | "centrifuge";
|
|
29
|
-
trancheId: string;
|
|
30
|
-
evmAddress: string | undefined;
|
|
31
|
-
balance: import("../../index.js").Balance;
|
|
32
|
-
pendingInvestCurrency: import("../../index.js").Balance;
|
|
33
|
-
claimableTrancheTokens: import("../../index.js").Balance;
|
|
34
|
-
sumClaimedTrancheTokens: import("../../index.js").Balance;
|
|
35
|
-
pendingRedeemTrancheTokens: import("../../index.js").Balance;
|
|
36
|
-
claimableCurrency: import("../../index.js").Balance;
|
|
37
|
-
sumClaimedCurrency: import("../../index.js").Balance;
|
|
38
|
-
}[]>;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qB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
-
import { Entity } from '../Entity.js';
|
|
2
|
-
import { assetSnapshotsPostProcess, assetSnapshotsQuery } from './assetSnapshots.js';
|
|
3
|
-
import { assetTransactionsPostProcess, assetTransactionsQuery } from './assetTransactions.js';
|
|
4
|
-
import { epochsPostProcess, epochsQuery } from './epochs.js';
|
|
5
|
-
import { investorTransactionsPostProcess, investorTransactionsQuery, } from './investorTransactions.js';
|
|
6
|
-
import { poolFeeSnapshotQuery, poolFeeSnapshotsPostProcess } from './poolFeeSnapshots.js';
|
|
7
|
-
import { poolFeeTransactionPostProcess, poolFeeTransactionQuery, } from './poolFeeTransactions.js';
|
|
8
|
-
import { poolSnapshotsPostProcess, poolSnapshotsQuery } from './poolSnapshots.js';
|
|
9
|
-
import { trancheCurrencyBalancePostProcessor, trancheCurrencyBalanceQuery, } from './trancheCurrencyBalance.js';
|
|
10
|
-
import { trancheSnapshotsPostProcess, trancheSnapshotsQuery } from './trancheSnapshots.js';
|
|
11
|
-
export class IndexerQueries extends Entity {
|
|
12
|
-
pool;
|
|
13
|
-
constructor(centrifuge, pool) {
|
|
14
|
-
super(centrifuge, ['indexerQueries', pool.id.toString()]);
|
|
15
|
-
this.pool = pool;
|
|
16
|
-
}
|
|
17
|
-
poolFeeSnapshotsQuery(filter) {
|
|
18
|
-
return this._root._queryIndexer(poolFeeSnapshotQuery, { filter }, poolFeeSnapshotsPostProcess);
|
|
19
|
-
}
|
|
20
|
-
poolSnapshotsQuery(filter) {
|
|
21
|
-
return this._root._queryIndexer(poolSnapshotsQuery, { filter }, poolSnapshotsPostProcess);
|
|
22
|
-
}
|
|
23
|
-
trancheSnapshotsQuery(filter) {
|
|
24
|
-
return this._root._queryIndexer(trancheSnapshotsQuery, { filter }, trancheSnapshotsPostProcess);
|
|
25
|
-
}
|
|
26
|
-
poolEpochsQuery(filter) {
|
|
27
|
-
return this._root._queryIndexer(epochsQuery, { filter }, epochsPostProcess);
|
|
28
|
-
}
|
|
29
|
-
investorTransactionsQuery(filter) {
|
|
30
|
-
return this._root._queryIndexer(investorTransactionsQuery, { filter }, investorTransactionsPostProcess);
|
|
31
|
-
}
|
|
32
|
-
assetTransactionsQuery(filter) {
|
|
33
|
-
return this._root._queryIndexer(assetTransactionsQuery, { filter }, assetTransactionsPostProcess);
|
|
34
|
-
}
|
|
35
|
-
poolFeeTransactionsQuery(filter) {
|
|
36
|
-
return this._root._queryIndexer(poolFeeTransactionQuery, { filter }, poolFeeTransactionPostProcess);
|
|
37
|
-
}
|
|
38
|
-
assetSnapshotsQuery(filter) {
|
|
39
|
-
return this._root._queryIndexer(assetSnapshotsQuery, { filter }, assetSnapshotsPostProcess);
|
|
40
|
-
}
|
|
41
|
-
trancheCurrencyBalanceQuery(filterTranches, filterCurrencies) {
|
|
42
|
-
return this._root._queryIndexer(trancheCurrencyBalanceQuery, { filterTranches, filterCurrencies }, trancheCurrencyBalancePostProcessor);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EAAuB,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzG,OAAO,EAA0B,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACrH,OAAO,EAAe,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzE,OAAO,EAEL,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAyB,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAChH,OAAO,EAEL,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAsB,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,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IACnG,CAAC;IAED,wBAAwB,CAAC,MAAiC;QACxD,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,EAAE,6BAA6B,CAAC,CAAA;IACrG,CAAC;IAED,mBAAmB,CAAC,MAA4B;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,EAAE,yBAAyB,CAAC,CAAA;IAC7F,CAAC;IAED,2BAA2B,CAAC,cAAqC,EAAE,gBAAwC;QACzG,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAC7B,2BAA2B,EAC3B,EAAE,cAAc,EAAE,gBAAgB,EAAE,EACpC,mCAAmC,CACpC,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Balance, Price } from '../../utils/BigInt.js';
|
|
2
|
-
export type InvestorTransactionFilter = Partial<Record<keyof SubqueryInvestorTransactions['investorTransactions']['nodes'][0], any>>;
|
|
3
|
-
export type InvestorTransaction = {
|
|
4
|
-
id: string;
|
|
5
|
-
poolId: string;
|
|
6
|
-
timestamp: Date;
|
|
7
|
-
accountId: string;
|
|
8
|
-
trancheId: string;
|
|
9
|
-
epochNumber: number;
|
|
10
|
-
type: SubqueryInvestorTransactionType;
|
|
11
|
-
currencyAmount: Balance;
|
|
12
|
-
tokenAmount: Balance;
|
|
13
|
-
tokenPrice: Price;
|
|
14
|
-
transactionFee: Balance;
|
|
15
|
-
chainId: number | 'centrifuge';
|
|
16
|
-
evmAddress?: string;
|
|
17
|
-
hash: string;
|
|
18
|
-
};
|
|
19
|
-
export type SubqueryInvestorTransactionType = 'INVEST_ORDER_UPDATE' | 'REDEEM_ORDER_UPDATE' | 'INVEST_ORDER_CANCEL' | 'REDEEM_ORDER_CANCEL' | 'INVEST_EXECUTION' | 'REDEEM_EXECUTION' | 'TRANSFER_IN' | 'TRANSFER_OUT' | 'INVEST_COLLECT' | 'REDEEM_COLLECT' | 'INVEST_LP_COLLECT' | 'REDEEM_LP_COLLECT';
|
|
20
|
-
type SubqueryInvestorTransactions = {
|
|
21
|
-
investorTransactions: {
|
|
22
|
-
nodes: {
|
|
23
|
-
id: string;
|
|
24
|
-
poolId: string;
|
|
25
|
-
timestamp: string;
|
|
26
|
-
accountId: string;
|
|
27
|
-
account: {
|
|
28
|
-
chainId: string;
|
|
29
|
-
evmAddress?: string;
|
|
30
|
-
};
|
|
31
|
-
trancheId: string;
|
|
32
|
-
pool: {
|
|
33
|
-
currency: {
|
|
34
|
-
decimals: number;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
epochNumber: number;
|
|
38
|
-
type: SubqueryInvestorTransactionType;
|
|
39
|
-
hash: string;
|
|
40
|
-
currencyAmount?: string | null;
|
|
41
|
-
tokenAmount?: string | null;
|
|
42
|
-
tokenPrice?: string | null;
|
|
43
|
-
transactionFee?: string | null;
|
|
44
|
-
}[];
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export declare const investorTransactionsPostProcess: (data: SubqueryInvestorTransactions) => InvestorTransaction[];
|
|
48
|
-
export declare const investorTransactionsQuery = "\nquery($filter: InvestorTransactionFilter) {\n investorTransactions(\n orderBy: TIMESTAMP_ASC,\n filter: $filter\n ) {\n nodes {\n id\n timestamp\n accountId\n account {\n chainId\n evmAddress\n }\n pool {\n currency {\n decimals\n }\n }\n hash\n poolId\n trancheId\n epochNumber\n type\n tokenAmount\n currencyAmount\n tokenPrice\n transactionFee\n }\n }\n}\n";
|
|
49
|
-
export {};
|
|
50
|
-
//# sourceMappingURL=investorTransactions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"investorTransactions.d.ts","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/investorTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,MAAM,yBAAyB,GA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,CAAA;YACnB,IAAI,EAAE,+BAA+B,CAAA;YACrC,IAAI,EAAE,MAAM,CAAA;YACZ,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;YAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;YAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;YAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAC/B,EAAE,CAAA;KACJ,CAAA;CACF,CAAA;AAED,eAAO,MAAM,+BAA+B,SAAU,4BAA4B,KAAG,mBAAmB,EAoBvG,CAAA;AAED,eAAO,MAAM,yBAAyB,kpBA+BrC,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Balance, Price } from '../../utils/BigInt.js';
|
|
2
|
-
export const investorTransactionsPostProcess = (data) => {
|
|
3
|
-
return data.investorTransactions.nodes.map((tx) => {
|
|
4
|
-
const currencyDecimals = tx.pool.currency.decimals;
|
|
5
|
-
return {
|
|
6
|
-
id: tx.id,
|
|
7
|
-
poolId: tx.poolId,
|
|
8
|
-
timestamp: new Date(tx.timestamp),
|
|
9
|
-
accountId: tx.accountId,
|
|
10
|
-
chainId: tx.account.chainId === '0' ? 'centrifuge' : Number(tx.account.chainId),
|
|
11
|
-
evmAddress: tx.account.evmAddress,
|
|
12
|
-
trancheId: tx.trancheId.split('-')[1] ?? '',
|
|
13
|
-
epochNumber: tx.epochNumber,
|
|
14
|
-
type: tx.type,
|
|
15
|
-
currencyAmount: new Balance(tx?.currencyAmount || 0n, currencyDecimals),
|
|
16
|
-
tokenAmount: new Balance(tx?.tokenAmount || 0n, currencyDecimals),
|
|
17
|
-
tokenPrice: new Price(tx?.tokenPrice ?? 0n),
|
|
18
|
-
transactionFee: new Balance(tx?.transactionFee ?? 0n, currencyDecimals),
|
|
19
|
-
hash: tx.hash,
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
export const investorTransactionsQuery = `
|
|
24
|
-
query($filter: InvestorTransactionFilter) {
|
|
25
|
-
investorTransactions(
|
|
26
|
-
orderBy: TIMESTAMP_ASC,
|
|
27
|
-
filter: $filter
|
|
28
|
-
) {
|
|
29
|
-
nodes {
|
|
30
|
-
id
|
|
31
|
-
timestamp
|
|
32
|
-
accountId
|
|
33
|
-
account {
|
|
34
|
-
chainId
|
|
35
|
-
evmAddress
|
|
36
|
-
}
|
|
37
|
-
pool {
|
|
38
|
-
currency {
|
|
39
|
-
decimals
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
hash
|
|
43
|
-
poolId
|
|
44
|
-
trancheId
|
|
45
|
-
epochNumber
|
|
46
|
-
type
|
|
47
|
-
tokenAmount
|
|
48
|
-
currencyAmount
|
|
49
|
-
tokenPrice
|
|
50
|
-
transactionFee
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
//# sourceMappingURL=investorTransactions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"investorTransactions.js","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/investorTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAiEtD,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,IAAkC,EAAyB,EAAE;IAC3G,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAChD,MAAM,gBAAgB,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAA;QAClD,OAAO;YACL,EAAE,EAAE,EAAE,CAAC,EAAE;YACT,MAAM,EAAE,EAAE,CAAC,MAAM;YACjB,SAAS,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,EAAE,CAAC,SAAS;YACvB,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;YAC/E,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU;YACjC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YAC3C,WAAW,EAAE,EAAE,CAAC,WAAW;YAC3B,IAAI,EAAE,EAAE,CAAC,IAAuC;YAChD,cAAc,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE,cAAc,IAAI,EAAE,EAAE,gBAAgB,CAAC;YACvE,WAAW,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE,WAAW,IAAI,EAAE,EAAE,gBAAgB,CAAC;YACjE,UAAU,EAAE,IAAI,KAAK,CAAC,EAAE,EAAE,UAAU,IAAI,EAAE,CAAC;YAC3C,cAAc,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE,cAAc,IAAI,EAAE,EAAE,gBAAgB,CAAC;YACvE,IAAI,EAAE,EAAE,CAAC,IAAI;SACgB,CAAA;IACjC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxC,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Balance } from '../../utils/BigInt.js';
|
|
2
|
-
export type PoolFeeSnapshotFilter = Partial<Record<keyof SubqueryPoolFeeSnapshot['poolFeeSnapshots']['nodes'][0], any>>;
|
|
3
|
-
export type PoolFeeSnapshot = {
|
|
4
|
-
pendingAmount: Balance;
|
|
5
|
-
poolFee: {
|
|
6
|
-
name: string;
|
|
7
|
-
};
|
|
8
|
-
poolFeeId: string;
|
|
9
|
-
sumAccruedAmount: Balance;
|
|
10
|
-
sumChargedAmount: Balance;
|
|
11
|
-
sumPaidAmount: Balance;
|
|
12
|
-
sumAccruedAmountByPeriod: Balance;
|
|
13
|
-
sumChargedAmountByPeriod: Balance;
|
|
14
|
-
sumPaidAmountByPeriod: Balance;
|
|
15
|
-
timestamp: string;
|
|
16
|
-
poolCurrency: {
|
|
17
|
-
decimals: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export type PoolFeeSnapshotsByDate = {
|
|
21
|
-
[timestamp: string]: PoolFeeSnapshot[];
|
|
22
|
-
};
|
|
23
|
-
export type SubqueryPoolFeeSnapshot = {
|
|
24
|
-
poolFeeSnapshots: {
|
|
25
|
-
nodes: {
|
|
26
|
-
poolFeeId: string;
|
|
27
|
-
timestamp: string;
|
|
28
|
-
sumPaidAmount: string;
|
|
29
|
-
sumChargedAmount: string;
|
|
30
|
-
sumAccruedAmount: string;
|
|
31
|
-
pendingAmount: string;
|
|
32
|
-
sumPaidAmountByPeriod: string;
|
|
33
|
-
sumChargedAmountByPeriod: string;
|
|
34
|
-
sumAccruedAmountByPeriod: string;
|
|
35
|
-
poolFee: {
|
|
36
|
-
name: string;
|
|
37
|
-
pool: {
|
|
38
|
-
currency: {
|
|
39
|
-
decimals: number;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
}[];
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export declare function poolFeeSnapshotsPostProcess(data: SubqueryPoolFeeSnapshot): PoolFeeSnapshotsByDate;
|
|
47
|
-
export declare const poolFeeSnapshotQuery = "\nquery($filter: PoolFeeSnapshotFilter) {\n poolFeeSnapshots(\n orderBy: BLOCK_NUMBER_ASC, \n filter: $filter\n ) {\n nodes {\n id\n poolFeeId\n timestamp\n sumPaidAmount\n sumChargedAmount\n sumAccruedAmount\n sumPaidAmount\n pendingAmount\n sumAccruedAmountByPeriod\n sumPaidAmountByPeriod\n sumChargedAmountByPeriod\n poolFee {\n name\n pool {\n currency {\n decimals\n }\n }\n }\n }\n }\n}\n";
|
|
48
|
-
//# sourceMappingURL=poolF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ChC,wBAAwB,EAAE,MAAM,CAAA;YAChC,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM,CAAA;gBACZ,IAAI,EAAE;oBACJ,QAAQ,EAAE;wBACR,QAAQ,EAAE,MAAM,CAAA;qBACjB,CAAA;iBACF,CAAA;aACF,CAAA;SACF,EAAE,CAAA;KACJ,CAAA;CACF,CAAA;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,uBAAuB,GAAG,sBAAsB,CA+BjG;AAED,eAAO,MAAM,oBAAoB,wjBA6BhC,CAAA"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Balance } from '../../utils/BigInt.js';
|
|
2
|
-
export function poolFeeSnapshotsPostProcess(data) {
|
|
3
|
-
const poolFeeSnapshots = data.poolFeeSnapshots;
|
|
4
|
-
const poolFeesGroupedByDate = poolFeeSnapshots?.nodes.reduce((acc, snapshot) => {
|
|
5
|
-
const date = snapshot.timestamp.slice(0, 10);
|
|
6
|
-
if (!acc[date]) {
|
|
7
|
-
acc[date] = [];
|
|
8
|
-
}
|
|
9
|
-
const poolCurrencyDecimals = snapshot.poolFee.pool.currency.decimals;
|
|
10
|
-
const poolFeeSnapshot = {
|
|
11
|
-
timestamp: snapshot.timestamp,
|
|
12
|
-
pendingAmount: new Balance(snapshot.pendingAmount, poolCurrencyDecimals),
|
|
13
|
-
poolFee: {
|
|
14
|
-
name: snapshot.poolFee.name,
|
|
15
|
-
},
|
|
16
|
-
poolFeeId: snapshot.poolFeeId,
|
|
17
|
-
poolCurrency: {
|
|
18
|
-
decimals: poolCurrencyDecimals,
|
|
19
|
-
},
|
|
20
|
-
sumAccruedAmount: new Balance(snapshot.sumAccruedAmount, poolCurrencyDecimals),
|
|
21
|
-
sumChargedAmount: new Balance(snapshot.sumChargedAmount, poolCurrencyDecimals),
|
|
22
|
-
sumPaidAmount: new Balance(snapshot.sumPaidAmount, poolCurrencyDecimals),
|
|
23
|
-
sumAccruedAmountByPeriod: new Balance(snapshot.sumAccruedAmountByPeriod, poolCurrencyDecimals),
|
|
24
|
-
sumChargedAmountByPeriod: new Balance(snapshot.sumChargedAmountByPeriod, poolCurrencyDecimals),
|
|
25
|
-
sumPaidAmountByPeriod: new Balance(snapshot.sumPaidAmountByPeriod, poolCurrencyDecimals),
|
|
26
|
-
};
|
|
27
|
-
acc[date].push(poolFeeSnapshot);
|
|
28
|
-
return acc;
|
|
29
|
-
}, {});
|
|
30
|
-
return poolFeesGroupedByDate;
|
|
31
|
-
}
|
|
32
|
-
export const poolFeeSnapshotQuery = `
|
|
33
|
-
query($filter: PoolFeeSnapshotFilter) {
|
|
34
|
-
poolFeeSnapshots(
|
|
35
|
-
orderBy: BLOCK_NUMBER_ASC,
|
|
36
|
-
filter: $filter
|
|
37
|
-
) {
|
|
38
|
-
nodes {
|
|
39
|
-
id
|
|
40
|
-
poolFeeId
|
|
41
|
-
timestamp
|
|
42
|
-
sumPaidAmount
|
|
43
|
-
sumChargedAmount
|
|
44
|
-
sumAccruedAmount
|
|
45
|
-
sumPaidAmount
|
|
46
|
-
pendingAmount
|
|
47
|
-
sumAccruedAmountByPeriod
|
|
48
|
-
sumPaidAmountByPeriod
|
|
49
|
-
sumChargedAmountByPeriod
|
|
50
|
-
poolFee {
|
|
51
|
-
name
|
|
52
|
-
pool {
|
|
53
|
-
currency {
|
|
54
|
-
decimals
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
//# sourceMappingURL=poolFeeSnapshots.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"poolFeeSnapshots.js","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/poolFeeSnapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AA8C/C,MAAM,UAAU,2BAA2B,CAAC,IAA6B;IACvE,MAAM,gBAAgB,GAAG,IAAI,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