@centrifuge/sdk 0.0.0-alpha.3 → 0.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/IndexerQueries/assetSnapshots.d.ts +69 -0
  2. package/dist/IndexerQueries/assetSnapshots.d.ts.map +1 -0
  3. package/dist/IndexerQueries/assetSnapshots.js +91 -0
  4. package/dist/IndexerQueries/assetSnapshots.js.map +1 -0
  5. package/dist/IndexerQueries/assetTransactions.d.ts +90 -0
  6. package/dist/IndexerQueries/assetTransactions.d.ts.map +1 -0
  7. package/dist/IndexerQueries/assetTransactions.js +74 -0
  8. package/dist/IndexerQueries/assetTransactions.js.map +1 -0
  9. package/dist/IndexerQueries/index.d.ts +38 -0
  10. package/dist/IndexerQueries/index.d.ts.map +1 -0
  11. package/dist/IndexerQueries/index.js +41 -0
  12. package/dist/IndexerQueries/index.js.map +1 -0
  13. package/dist/IndexerQueries/investorTransactions.d.ts +50 -0
  14. package/dist/IndexerQueries/investorTransactions.d.ts.map +1 -0
  15. package/dist/IndexerQueries/investorTransactions.js +55 -0
  16. package/dist/IndexerQueries/investorTransactions.js.map +1 -0
  17. package/dist/IndexerQueries/poolFeeSnapshots.d.ts.map +1 -0
  18. package/dist/IndexerQueries/poolFeeSnapshots.js.map +1 -0
  19. package/dist/IndexerQueries/poolFeeTransactions.d.ts +34 -0
  20. package/dist/IndexerQueries/poolFeeTransactions.d.ts.map +1 -0
  21. package/dist/IndexerQueries/poolFeeTransactions.js +37 -0
  22. package/dist/IndexerQueries/poolFeeTransactions.js.map +1 -0
  23. package/dist/IndexerQueries/poolSnapshots.d.ts.map +1 -0
  24. package/dist/IndexerQueries/poolSnapshots.js.map +1 -0
  25. package/dist/IndexerQueries/trancheCurrencyBalance.d.ts +78 -0
  26. package/dist/IndexerQueries/trancheCurrencyBalance.d.ts.map +1 -0
  27. package/dist/IndexerQueries/trancheCurrencyBalance.js +103 -0
  28. package/dist/IndexerQueries/trancheCurrencyBalance.js.map +1 -0
  29. package/dist/{queries → IndexerQueries}/trancheSnapshots.d.ts +1 -1
  30. package/dist/IndexerQueries/trancheSnapshots.d.ts.map +1 -0
  31. package/dist/{queries → IndexerQueries}/trancheSnapshots.js +1 -1
  32. package/dist/IndexerQueries/trancheSnapshots.js.map +1 -0
  33. package/dist/Reports/Processor.d.ts +11 -5
  34. package/dist/Reports/Processor.d.ts.map +1 -1
  35. package/dist/Reports/Processor.js +229 -3
  36. package/dist/Reports/Processor.js.map +1 -1
  37. package/dist/Reports/index.d.ts +15 -12
  38. package/dist/Reports/index.d.ts.map +1 -1
  39. package/dist/Reports/index.js +79 -21
  40. package/dist/Reports/index.js.map +1 -1
  41. package/dist/tests/mocks/mockAssetSnapshots.d.ts +3 -0
  42. package/dist/tests/mocks/mockAssetSnapshots.d.ts.map +1 -0
  43. package/dist/tests/mocks/mockAssetSnapshots.js +56 -0
  44. package/dist/tests/mocks/mockAssetSnapshots.js.map +1 -0
  45. package/dist/tests/mocks/mockAssetTransactions.d.ts +3 -0
  46. package/dist/tests/mocks/mockAssetTransactions.d.ts.map +1 -0
  47. package/dist/tests/mocks/mockAssetTransactions.js +81 -0
  48. package/dist/tests/mocks/mockAssetTransactions.js.map +1 -0
  49. package/dist/tests/mocks/mockInvestorCurrencyBalance.d.ts +3 -0
  50. package/dist/tests/mocks/mockInvestorCurrencyBalance.d.ts.map +1 -0
  51. package/dist/tests/mocks/mockInvestorCurrencyBalance.js +29 -0
  52. package/dist/tests/mocks/mockInvestorCurrencyBalance.js.map +1 -0
  53. package/dist/tests/mocks/mockInvestorTransactions.d.ts +3 -0
  54. package/dist/tests/mocks/mockInvestorTransactions.d.ts.map +1 -0
  55. package/dist/tests/mocks/mockInvestorTransactions.js +35 -0
  56. package/dist/tests/mocks/mockInvestorTransactions.js.map +1 -0
  57. package/dist/tests/mocks/mockPoolFeeSnapshot.d.ts +1 -1
  58. package/dist/tests/mocks/mockPoolFeeSnapshot.d.ts.map +1 -1
  59. package/dist/tests/mocks/mockPoolFeeTransactions.d.ts +11 -0
  60. package/dist/tests/mocks/mockPoolFeeTransactions.d.ts.map +1 -0
  61. package/dist/tests/mocks/mockPoolFeeTransactions.js +20 -0
  62. package/dist/tests/mocks/mockPoolFeeTransactions.js.map +1 -0
  63. package/dist/tests/mocks/mockPoolSnapshots.d.ts +1 -1
  64. package/dist/tests/mocks/mockPoolSnapshots.d.ts.map +1 -1
  65. package/dist/tests/mocks/mockTrancheSnapshots.d.ts +1 -1
  66. package/dist/tests/mocks/mockTrancheSnapshots.d.ts.map +1 -1
  67. package/dist/types/reports.d.ts +275 -0
  68. package/dist/types/reports.d.ts.map +1 -0
  69. package/dist/types/reports.js +2 -0
  70. package/dist/types/reports.js.map +1 -0
  71. package/dist/utils/BigInt.d.ts +1 -1
  72. package/dist/utils/BigInt.d.ts.map +1 -1
  73. package/dist/utils/BigInt.js +2 -2
  74. package/dist/utils/BigInt.js.map +1 -1
  75. package/dist/utils/date.d.ts.map +1 -1
  76. package/dist/utils/date.js +5 -4
  77. package/dist/utils/date.js.map +1 -1
  78. package/package.json +1 -1
  79. package/dist/Reports/types.d.ts +0 -102
  80. package/dist/Reports/types.d.ts.map +0 -1
  81. package/dist/Reports/types.js +0 -2
  82. package/dist/Reports/types.js.map +0 -1
  83. package/dist/queries/poolFeeSnapshots.d.ts.map +0 -1
  84. package/dist/queries/poolFeeSnapshots.js.map +0 -1
  85. package/dist/queries/poolSnapshots.d.ts.map +0 -1
  86. package/dist/queries/poolSnapshots.js.map +0 -1
  87. package/dist/queries/trancheSnapshots.d.ts.map +0 -1
  88. package/dist/queries/trancheSnapshots.js.map +0 -1
  89. /package/dist/{queries → IndexerQueries}/poolFeeSnapshots.d.ts +0 -0
  90. /package/dist/{queries → IndexerQueries}/poolFeeSnapshots.js +0 -0
  91. /package/dist/{queries → IndexerQueries}/poolSnapshots.d.ts +0 -0
  92. /package/dist/{queries → IndexerQueries}/poolSnapshots.js +0 -0
@@ -0,0 +1,69 @@
1
+ import { Currency, Rate } from '../utils/BigInt.js';
2
+ export type AssetSnapshotFilter = Partial<Record<keyof SubqueryAssetSnapshots['assetSnapshots']['nodes'][0], any>>;
3
+ export type AssetSnapshot = {
4
+ actualMaturityDate: string | undefined;
5
+ actualOriginationDate: number | undefined;
6
+ advanceRate: Rate | undefined;
7
+ assetId: string;
8
+ collateralValue: Currency | undefined;
9
+ currentPrice: Currency | undefined;
10
+ discountRate: Rate | undefined;
11
+ faceValue: Currency | undefined;
12
+ lossGivenDefault: Rate | undefined;
13
+ name: string;
14
+ outstandingDebt: Currency | undefined;
15
+ outstandingInterest: Currency | undefined;
16
+ outstandingPrincipal: Currency | undefined;
17
+ outstandingQuantity: Currency | undefined;
18
+ presentValue: Currency | undefined;
19
+ probabilityOfDefault: Rate | undefined;
20
+ status: string;
21
+ sumRealizedProfitFifo: Currency | undefined;
22
+ timestamp: string;
23
+ totalRepaidInterest: Currency | undefined;
24
+ totalRepaidPrincipal: Currency | undefined;
25
+ totalRepaidUnscheduled: Currency | undefined;
26
+ unrealizedProfitAtMarketPrice: Currency | undefined;
27
+ valuationMethod: string | undefined;
28
+ };
29
+ export type SubqueryAssetSnapshots = {
30
+ assetSnapshots: {
31
+ nodes: {
32
+ asset: {
33
+ pool: {
34
+ currency: {
35
+ decimals: number;
36
+ };
37
+ };
38
+ actualOriginationDate: number;
39
+ advanceRate: string | undefined;
40
+ collateralValue: string | undefined;
41
+ discountRate: string | undefined;
42
+ id: string;
43
+ lossGivenDefault: string | undefined;
44
+ actualMaturityDate: string | undefined;
45
+ name: string;
46
+ probabilityOfDefault: string | undefined;
47
+ status: string;
48
+ sumRealizedProfitFifo: string | undefined;
49
+ unrealizedProfitAtMarketPrice: string | undefined;
50
+ valuationMethod: string;
51
+ notional: string | undefined;
52
+ };
53
+ timestamp: string;
54
+ assetId: string;
55
+ presentValue: string | undefined;
56
+ currentPrice: string | undefined;
57
+ outstandingPrincipal: string | undefined;
58
+ outstandingInterest: string | undefined;
59
+ outstandingDebt: string | undefined;
60
+ outstandingQuantity: string | undefined;
61
+ totalRepaidPrincipal: string | undefined;
62
+ totalRepaidInterest: string | undefined;
63
+ totalRepaidUnscheduled: string | undefined;
64
+ }[];
65
+ };
66
+ };
67
+ export declare const assetSnapshotsPostProcess: (data: SubqueryAssetSnapshots) => AssetSnapshot[];
68
+ export declare const assetSnapshotsQuery = "\nquery($filter: AssetSnapshotFilter) {\n assetSnapshots(\n first: 1000,\n orderBy: TIMESTAMP_ASC,\n filter: $filter\n ) {\n nodes {\n assetId\n timestamp\n totalRepaidUnscheduled\n outstandingInterest\n totalRepaidInterest\n currentPrice\n outstandingPrincipal\n totalRepaidPrincipal\n outstandingQuantity\n presentValue\n outstandingDebt\n asset {\n pool {\n currency {\n decimals\n }\n }\n actualMaturityDate\n actualOriginationDate\n advanceRate\n collateralValue\n discountRate\n lossGivenDefault\n name\n notional\n probabilityOfDefault\n status\n sumRealizedProfitFifo\n unrealizedProfitAtMarketPrice\n valuationMethod\n }\n }\n }\n }\n";
69
+ //# sourceMappingURL=assetSnapshots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetSnapshots.d.ts","sourceRoot":"","sources":["../../src/IndexerQueries/assetSnapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,sBAAsB,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;AAElH,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,WAAW,EAAE,IAAI,GAAG,SAAS,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,QAA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AAE,MAAM,GAAG,SAAS,CAAA;gBACpC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;gBACtC,IAAI,EAAE,MAAM,CAAA;gBACZ,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;gBACxC,MAAM,EAAE,MAAM,CAAA;gBACd,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAA;gBACzC,6BAA6B,EAAE,MAAM,GAAG,SAAS,CAAA;gBACjD,eAAe,EAAE,MAAM,CAAA;gBACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;aAC7B,CAAA;YACD,SAAS,EAAE,MAAM,CAAA;YACjB,OAAO,EAAE,MAAM,CAAA;YACf,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;YAChC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;YAChC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;YACxC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;YACvC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;YACnC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;YACvC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;YACxC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;YACvC,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAA;SAC3C,EAAE,CAAA;KACJ,CAAA;CACF,CAAA;AAED,eAAO,MAAM,yBAAyB,SAAU,sBAAsB,KAAG,aAAa,EA8CrF,CAAA;AAED,eAAO,MAAM,mBAAmB,ilCA0C/B,CAAA"}
@@ -0,0 +1,91 @@
1
+ import { Currency, Rate } from '../utils/BigInt.js';
2
+ export const assetSnapshotsPostProcess = (data) => {
3
+ return data.assetSnapshots.nodes.map((tx) => {
4
+ const currencyDecimals = tx.asset.pool.currency.decimals;
5
+ return {
6
+ ...tx,
7
+ timestamp: tx.timestamp,
8
+ assetId: tx.assetId,
9
+ actualMaturityDate: tx.asset.actualMaturityDate || undefined,
10
+ actualOriginationDate: tx.asset.actualOriginationDate || undefined,
11
+ advanceRate: new Rate(tx.asset.advanceRate || '0'),
12
+ collateralValue: tx.asset?.collateralValue
13
+ ? new Currency(tx.asset?.collateralValue, currencyDecimals)
14
+ : undefined,
15
+ currentPrice: tx.currentPrice ? new Currency(tx.currentPrice, currencyDecimals).mul(10n ** 18n) : undefined,
16
+ discountRate: tx.asset.discountRate ? new Rate(tx.asset.discountRate) : undefined,
17
+ faceValue: tx.asset.notional && tx.outstandingQuantity
18
+ ? new Currency(tx.asset.notional, currencyDecimals).mul(BigInt(tx.outstandingQuantity))
19
+ : undefined,
20
+ lossGivenDefault: tx.asset.lossGivenDefault ? new Rate(tx.asset.lossGivenDefault) : undefined,
21
+ name: tx.asset.name,
22
+ outstandingDebt: tx.outstandingDebt ? new Currency(tx.outstandingDebt, currencyDecimals) : undefined,
23
+ outstandingInterest: tx.outstandingInterest ? new Currency(tx.outstandingInterest, currencyDecimals) : undefined,
24
+ outstandingPrincipal: tx.outstandingPrincipal
25
+ ? new Currency(tx.outstandingPrincipal, currencyDecimals)
26
+ : undefined,
27
+ outstandingQuantity: tx.outstandingQuantity ? new Currency(tx.outstandingQuantity, 18) : undefined,
28
+ presentValue: tx.presentValue ? new Currency(tx.presentValue, currencyDecimals) : undefined,
29
+ probabilityOfDefault: tx.asset.probabilityOfDefault ? new Rate(tx.asset.probabilityOfDefault) : undefined,
30
+ status: tx.asset.status,
31
+ sumRealizedProfitFifo: tx.asset.sumRealizedProfitFifo
32
+ ? new Currency(tx.asset.sumRealizedProfitFifo, currencyDecimals)
33
+ : undefined,
34
+ totalRepaidInterest: tx.totalRepaidInterest ? new Currency(tx.totalRepaidInterest, currencyDecimals) : undefined,
35
+ totalRepaidPrincipal: tx.totalRepaidPrincipal
36
+ ? new Currency(tx.totalRepaidPrincipal, currencyDecimals)
37
+ : undefined,
38
+ totalRepaidUnscheduled: tx.totalRepaidUnscheduled
39
+ ? new Currency(tx.totalRepaidUnscheduled, currencyDecimals)
40
+ : undefined,
41
+ unrealizedProfitAtMarketPrice: tx.asset.unrealizedProfitAtMarketPrice
42
+ ? new Currency(tx.asset.unrealizedProfitAtMarketPrice, currencyDecimals)
43
+ : undefined,
44
+ valuationMethod: tx.asset.valuationMethod,
45
+ };
46
+ });
47
+ };
48
+ export const assetSnapshotsQuery = `
49
+ query($filter: AssetSnapshotFilter) {
50
+ assetSnapshots(
51
+ first: 1000,
52
+ orderBy: TIMESTAMP_ASC,
53
+ filter: $filter
54
+ ) {
55
+ nodes {
56
+ assetId
57
+ timestamp
58
+ totalRepaidUnscheduled
59
+ outstandingInterest
60
+ totalRepaidInterest
61
+ currentPrice
62
+ outstandingPrincipal
63
+ totalRepaidPrincipal
64
+ outstandingQuantity
65
+ presentValue
66
+ outstandingDebt
67
+ asset {
68
+ pool {
69
+ currency {
70
+ decimals
71
+ }
72
+ }
73
+ actualMaturityDate
74
+ actualOriginationDate
75
+ advanceRate
76
+ collateralValue
77
+ discountRate
78
+ lossGivenDefault
79
+ name
80
+ notional
81
+ probabilityOfDefault
82
+ status
83
+ sumRealizedProfitFifo
84
+ unrealizedProfitAtMarketPrice
85
+ valuationMethod
86
+ }
87
+ }
88
+ }
89
+ }
90
+ `;
91
+ //# sourceMappingURL=assetSnapshots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetSnapshots.js","sourceRoot":"","sources":["../../src/IndexerQueries/assetSnapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAsEnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,IAA4B,EAAmB,EAAE;IACzF,OAAO,IAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAC3C,MAAM,gBAAgB,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAA;QACxD,OAAO;YACL,GAAG,EAAE;YACL,SAAS,E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oB;gBAC3C,CAAC,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,CAAC;gBACzD,CAAC,CAAC,SAAS;YACb,sBAAsB,EAAE,EAAE,CAAC,sBAAsB;gBAC/C,CAAC,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;gBAC3D,CAAC,CAAC,SAAS;YACb,6BAA6B,EAAE,EAAE,CAAC,KAAK,CAAC,6BAA6B;gBACnE,CAAC,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,EAAE,gBAAgB,CAAC;gBACxE,CAAC,CAAC,SAAS;YACb,eAAe,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe;SAC1C,CAAA;IACH,CAAC,CAA2B,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ClC,CAAA"}
@@ -0,0 +1,90 @@
1
+ import { Currency, 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: Currency;
11
+ settlementPrice: Price | null;
12
+ quantity: string | null;
13
+ principalAmount: Currency | undefined;
14
+ interestAmount: Currency | undefined;
15
+ hash: string;
16
+ realizedProfitFifo: Currency | undefined;
17
+ unrealizedProfitAtMarketPrice: Currency | undefined;
18
+ asset: {
19
+ id: string;
20
+ metadata: string;
21
+ type: AssetType;
22
+ currentPrice: string | null;
23
+ };
24
+ fromAsset?: {
25
+ id: string;
26
+ metadata: string;
27
+ type: AssetType;
28
+ };
29
+ toAsset?: {
30
+ id: string;
31
+ metadata: string;
32
+ type: AssetType;
33
+ };
34
+ };
35
+ export declare enum AssetType {
36
+ OnchainCash = "OnchainCash",
37
+ OffchainCash = "OffchainCash",
38
+ Other = "Other"
39
+ }
40
+ export type AssetTransactionType = 'CREATED' | 'PRICED' | 'BORROWED' | 'REPAID' | 'CLOSED' | 'CASH_TRANSFER' | 'DEPOSIT_FROM_INVESTMENTS' | 'WITHDRAWAL_FOR_REDEMPTIONS' | 'WITHDRAWAL_FOR_FEES' | 'INCREASE_DEBT' | 'DECREASE_DEBT';
41
+ type SubqueryAssetTransactions = {
42
+ assetTransactions: {
43
+ nodes: {
44
+ __typename?: 'AssetTransaction';
45
+ id: string;
46
+ timestamp: string;
47
+ poolId: string;
48
+ accountId: string;
49
+ hash: string;
50
+ epochId: string;
51
+ type: AssetTransactionType;
52
+ amount: string | undefined;
53
+ principalAmount: string | undefined;
54
+ interestAmount: string | undefined;
55
+ settlementPrice: string | null;
56
+ quantity: string | null;
57
+ realizedProfitFifo: string | undefined;
58
+ pool: {
59
+ currency: {
60
+ decimals: number;
61
+ };
62
+ };
63
+ asset: {
64
+ id: string;
65
+ metadata: string;
66
+ name: string;
67
+ type: AssetType;
68
+ sumRealizedProfitFifo: string;
69
+ unrealizedProfitAtMarketPrice: string;
70
+ currentPrice: string;
71
+ };
72
+ fromAsset?: {
73
+ id: string;
74
+ metadata: string;
75
+ name: string;
76
+ type: AssetType;
77
+ };
78
+ toAsset?: {
79
+ id: string;
80
+ metadata: string;
81
+ name: string;
82
+ type: AssetType;
83
+ };
84
+ }[];
85
+ };
86
+ };
87
+ export declare const assetTransactionsPostProcess: (data: SubqueryAssetTransactions) => AssetTransaction[];
88
+ 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";
89
+ export {};
90
+ //# sourceMappingURL=assetTransactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetTransactions.d.ts","sourceRoot":"","sources":["../../src/IndexerQueries/assetTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEpD,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,QAAQ,CAAA;IAChB,eAAe,EAAE,KAAK,GAAG,IAAI,CAAA;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,eAAe,EAAE,QAAQ,GAAG,SAAS,CAAA;IACrC,cAAc,EAAE,QAAQ,GAAG,SAAS,CAAA;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,EAAE,QAAQ,GAAG,SAAS,CAAA;IACxC,6BAA6B,EAAE,QAAQ,GAAG,SAAS,CAAA;IACnD,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAA;QACV,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,SAAS,CAAA;QACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAC5B,CAAA;IACD,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAA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AM,CAAA;gBACZ,IAAI,EAAE,SAAS,CAAA;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,EAqB9F,CAAA;AAED,eAAO,MAAM,sBAAsB,4tBA6ClC,CAAA"}
@@ -0,0 +1,74 @@
1
+ import { Currency, 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
+ settlementPrice: tx.settlementPrice ? new Price(tx.settlementPrice) : null,
14
+ amount: new Currency(tx?.amount ?? 0n, decimals),
15
+ principalAmount: tx.principalAmount ? new Currency(tx.principalAmount, decimals) : undefined,
16
+ interestAmount: tx.interestAmount ? new Currency(tx.interestAmount, decimals) : undefined,
17
+ realizedProfitFifo: tx.realizedProfitFifo ? new Currency(tx.realizedProfitFifo, decimals) : undefined,
18
+ sumRealizedProfitFifo: tx.asset.sumRealizedProfitFifo
19
+ ? new Currency(tx.asset.sumRealizedProfitFifo, decimals)
20
+ : undefined,
21
+ unrealizedProfitAtMarketPrice: tx.asset.unrealizedProfitAtMarketPrice
22
+ ? new Currency(tx.asset.unrealizedProfitAtMarketPrice, decimals)
23
+ : undefined,
24
+ timestamp: new Date(`${tx.timestamp}+00:00`),
25
+ };
26
+ }) || []);
27
+ };
28
+ export const assetTransactionsQuery = `
29
+ query($filter: AssetTransactionFilter) {
30
+ assetTransactions(
31
+ orderBy: TIMESTAMP_ASC,
32
+ filter: $filter
33
+ ) {
34
+ nodes {
35
+ principalAmount
36
+ interestAmount
37
+ epochId
38
+ type
39
+ timestamp
40
+ amount
41
+ settlementPrice
42
+ quantity
43
+ hash
44
+ realizedProfitFifo
45
+ pool {
46
+ currency {
47
+ decimals
48
+ }
49
+ }
50
+ asset {
51
+ id
52
+ metadata
53
+ name
54
+ type
55
+ sumRealizedProfitFifo
56
+ unrealizedProfitAtMarketPrice
57
+ }
58
+ fromAsset {
59
+ id
60
+ metadata
61
+ name
62
+ type
63
+ }
64
+ toAsset {
65
+ id
66
+ metadata
67
+ name
68
+ type
69
+ }
70
+ }
71
+ }
72
+ }
73
+ `;
74
+ //# sourceMappingURL=assetTransactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetTransactions.js","sourceRoot":"","sources":["../../src/IndexerQueries/assetTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAuCpD,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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AM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CrC,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { Entity } from '../Entity.js';
2
+ import { Centrifuge } from '../Centrifuge.js';
3
+ import { PoolFeeTransactionFilter } from './poolFeeTransactions.js';
4
+ import { PoolSnapshotFilter } from './poolSnapshots.js';
5
+ import { PoolFeeSnapshotFilter } from './poolFeeSnapshots.js';
6
+ import { Pool } from '../Pool.js';
7
+ import { TrancheSnapshotFilter } from './trancheSnapshots.js';
8
+ import { AssetTransactionFilter } from './assetTransactions.js';
9
+ import { InvestorTransactionFilter } from './investorTransactions.js';
10
+ import { AssetSnapshotFilter } from './assetSnapshots.js';
11
+ import { TrancheBalanceFilter, CurrencyBalanceFilter } from './trancheCurrencyBalance.js';
12
+ export declare class IndexerQueries extends Entity {
13
+ pool: Pool;
14
+ constructor(centrifuge: Centrifuge, pool: Pool);
15
+ poolFeeSnapshotsQuery(filter?: PoolFeeSnapshotFilter): import("../index.js").Query<import("./poolFeeSnapshots.js").PoolFeeSnapshotsByDate>;
16
+ poolSnapshotsQuery(filter?: PoolSnapshotFilter): import("../index.js").Query<import("./poolSnapshots.js").PoolSnapshot[]>;
17
+ trancheSnapshotsQuery(filter?: TrancheSnapshotFilter): import("../index.js").Query<{
18
+ [date: string]: import("./trancheSnapshots.js").TrancheSnapshot[];
19
+ }>;
20
+ investorTransactionsQuery(filter?: InvestorTransactionFilter): import("../index.js").Query<import("./investorTransactions.js").InvestorTransaction[]>;
21
+ assetTransactionsQuery(filter?: AssetTransactionFilter): import("../index.js").Query<import("./assetTransactions.js").AssetTransaction[]>;
22
+ poolFeeTransactionsQuery(filter?: PoolFeeTransactionFilter): import("../index.js").Query<import("./poolFeeTransactions.js").PoolFeeTransaction[]>;
23
+ assetSnapshotsQuery(filter?: AssetSnapshotFilter): import("../index.js").Query<import("./assetSnapshots.js").AssetSnapshot[]>;
24
+ trancheCurrencyBalanceQuery(filterTranches?: TrancheBalanceFilter, filterCurrencies?: CurrencyBalanceFilter): import("../index.js").Query<{
25
+ accountId: string;
26
+ chainId: number | "centrifuge";
27
+ trancheId: string;
28
+ evmAddress: string | undefined;
29
+ balance: import("../utils/BigInt.js").Currency;
30
+ pendingInvestCurrency: import("../utils/BigInt.js").Currency;
31
+ claimableTrancheTokens: import("../utils/BigInt.js").Currency;
32
+ sumClaimedTrancheTokens: import("../utils/BigInt.js").Currency;
33
+ pendingRedeemTrancheTokens: import("../utils/BigInt.js").Currency;
34
+ claimableCurrency: import("../utils/BigInt.js").Currency;
35
+ sumClaimedCurrency: import("../utils/BigInt.js").Currency;
36
+ }[]>;
37
+ }
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/IndexerQueries/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAGL,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAgD,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACrG,OAAO,EAA+B,qBAAqB,EAAwB,MAAM,uBAAuB,CAAA;AAChH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAsD,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AACjH,OAAO,EAAwD,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACrH,OAAO,EAGL,yBAAyB,EAC1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAkD,MAAM,qBAAqB,CAAA;AACzG,OAAO,EAIL,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AAEpC,qBAAa,cAAe,SAAQ,MAAM;IAG/B,IAAI,EAAE,IAAI;gBADjB,UAAU,EAAE,UAAU,EACf,IAAI,EAAE,IAAI;IAKnB,qBAAqB,CAAC,MAAM,CAAC,EAAE,qBAAqB;IAIpD,kBAAkB,CAAC,MAAM,CAAC,EAAE,kBAAkB;IAI9C,qBAAqB,CAAC,MAAM,CAAC,EAAE,qBAAqB;;;IAIpD,yBAAyB,CAAC,MAAM,CAAC,EAAE,yBAAyB;IAI5D,sBAAsB,CAAC,MAAM,CAAC,EAAE,sBAAsB;IAItD,wBAAwB,CAAC,MAAM,CAAC,EAAE,wBAAwB;IAI1D,mBAAmB,CAAC,MAAM,CAAC,EAAE,mBAAmB;IAIhD,2BAA2B,CAAC,cAAc,CAAC,EAAE,oBAAoB,EAAE,gBAAgB,CAAC,EAAE,qBAAqB;;;;;;;;;;;;;CAO5G"}
@@ -0,0 +1,41 @@
1
+ import { Entity } from '../Entity.js';
2
+ import { poolFeeTransactionPostProcess, poolFeeTransactionQuery, } from './poolFeeTransactions.js';
3
+ import { poolSnapshotsPostProcess, poolSnapshotsQuery } from './poolSnapshots.js';
4
+ import { poolFeeSnapshotsPostProcess, poolFeeSnapshotQuery } from './poolFeeSnapshots.js';
5
+ import { trancheSnapshotsPostProcess, trancheSnapshotsQuery } from './trancheSnapshots.js';
6
+ import { assetTransactionsPostProcess, assetTransactionsQuery } from './assetTransactions.js';
7
+ import { investorTransactionsPostProcess, investorTransactionsQuery, } from './investorTransactions.js';
8
+ import { assetSnapshotsPostProcess, assetSnapshotsQuery } from './assetSnapshots.js';
9
+ import { trancheCurrencyBalancePostProcessor, trancheCurrencyBalanceQuery, } from './trancheCurrencyBalance.js';
10
+ export class IndexerQueries extends Entity {
11
+ pool;
12
+ constructor(centrifuge, pool) {
13
+ super(centrifuge, ['indexerQueries ', pool.id]);
14
+ this.pool = pool;
15
+ }
16
+ poolFeeSnapshotsQuery(filter) {
17
+ return this._root._queryIndexer(poolFeeSnapshotQuery, { filter }, poolFeeSnapshotsPostProcess);
18
+ }
19
+ poolSnapshotsQuery(filter) {
20
+ return this._root._queryIndexer(poolSnapshotsQuery, { filter }, poolSnapshotsPostProcess);
21
+ }
22
+ trancheSnapshotsQuery(filter) {
23
+ return this._root._queryIndexer(trancheSnapshotsQuery, { filter }, trancheSnapshotsPostProcess);
24
+ }
25
+ investorTransactionsQuery(filter) {
26
+ return this._root._queryIndexer(investorTransactionsQuery, { filter }, investorTransactionsPostProcess);
27
+ }
28
+ assetTransactionsQuery(filter) {
29
+ return this._root._queryIndexer(assetTransactionsQuery, { filter }, assetTransactionsPostProcess);
30
+ }
31
+ poolFeeTransactionsQuery(filter) {
32
+ return this._root._queryIndexer(poolFeeTransactionQuery, { filter }, poolFeeTransactionPostProcess);
33
+ }
34
+ assetSnapshotsQuery(filter) {
35
+ return this._root._queryIndexer(assetSnapshotsQuery, { filter }, assetSnapshotsPostProcess);
36
+ }
37
+ trancheCurrencyBalanceQuery(filterTranches, filterCurrencies) {
38
+ return this._root._queryIndexer(trancheCurrencyBalanceQuery, { filterTranches, filterCurrencies }, trancheCurrencyBalancePostProcessor);
39
+ }
40
+ }
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/IndexerQueries/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,GAExB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAsB,MAAM,oBAAoB,CAAA;AACrG,OAAO,EAAE,2BAA2B,EAAyB,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEhH,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAyB,MAAM,uBAAuB,CAAA;AACjH,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAA0B,MAAM,wBAAwB,CAAA;AACrH,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,GAE1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAuB,yBAAy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AO,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"}
@@ -0,0 +1,50 @@
1
+ import { Currency, 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: Currency;
12
+ tokenAmount: Currency;
13
+ tokenPrice: Price;
14
+ transactionFee: Currency;
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investorTransactions.d.ts","sourceRoot":"","sources":["../../src/IndexerQueries/investorTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEpD,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CAAC,MAAM,4BAA4B,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CACpF,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,+BAA+B,CAAA;IACrC,cAAc,EAAE,QAAQ,CAAA;IACxB,WAAW,EAAE,QAAQ,CAAA;IACrB,UAAU,EAAE,KAAK,CAAA;IACjB,cAAc,EAAE,QAAQ,CAAA;IACxB,OAAO,EAAE,MAAM,GAAG,YAAY,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,+BAA+B,GACvC,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,kBAAkB,GAClB,kBAAkB,GAClB,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,mBAAmB,CAAA;AAEvB,KAAK,4BAA4B,GAAG;IAClC,oBAAoB,EAAE;QACpB,KAAK,EAAE;YACL,EAAE,EAAE,MAAM,CAAA;YACV,MAAM,EAAE,MAAM,CAAA;YACd,SAAS,EAAE,MAAM,CAAA;YACjB,SAAS,EAAE,MAAM,CAAA;YACjB,OAAO,EAAE;gBACP,OAAO,EAAE,MAAM,CAAA;gBACf,UAAU,CAAC,EAAE,MAAM,CAAA;aACpB,CAAA;YACD,SAAS,EAAE,MAAM,CAAA;YACjB,IAAI,EAAE;gBACJ,QAAQ,EAAE;oBACR,QAAQ,EAAE,MAAM,CAAA;iBACjB,CAAA;aACF,CAAA;YACD,WAAW,EAAE,MAAM,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"}
@@ -0,0 +1,55 @@
1
+ import { Currency, 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 Currency(tx?.currencyAmount || 0n, currencyDecimals),
16
+ tokenAmount: new Currency(tx?.tokenAmount || 0n, currencyDecimals),
17
+ tokenPrice: new Price(tx?.tokenPrice ?? 0n),
18
+ transactionFee: new Currency(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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investorTransactions.js","sourceRoot":"","sources":["../../src/IndexerQueries/investorTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAiEpD,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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AAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;YAC/E,aAAa,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;YACzE,wBAAwB,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,wBAAwB,EAAE,oBAAoB,CAAC;YAC/F,wBAAwB,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,wBAAwB,EAAE,oBAAoB,CAAC;YAC/F,qBAAqB,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,qBAAqB,EAAE,oBAAoB,CAAC;SAC1F,CAAA;QAED,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QAC/B,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAA4B,CAAC,CAAA;IAChC,OAAO,qBAAqB,CAAA;AAC9B,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BnC,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { Currency } from '../utils/BigInt.js';
2
+ export type PoolFeeTransactionFilter = Partial<Record<keyof SubqueryPoolFeeTransaction['poolFeeTransactions']['nodes'][0], any>>;
3
+ export type PoolFeeTransaction = {
4
+ feeId: string;
5
+ type: SubqueryPoolFeeTransactionType;
6
+ timestamp: string;
7
+ blockNumber: string;
8
+ epochNumber: number;
9
+ amount: Currency;
10
+ };
11
+ export type SubqueryPoolFeeTransactionType = 'PROPOSED' | 'ADDED' | 'REMOVED' | 'CHARGED' | 'UNCHARGED' | 'ACCRUED' | 'PAID';
12
+ export type SubqueryPoolFeeTransaction = {
13
+ poolFeeTransactions: {
14
+ nodes: {
15
+ id: string;
16
+ type: SubqueryPoolFeeTransactionType;
17
+ timestamp: string;
18
+ blockNumber: string;
19
+ epochNumber: number;
20
+ amount: string;
21
+ poolFee: {
22
+ feeId: string;
23
+ pool: {
24
+ currency: {
25
+ decimals: number;
26
+ };
27
+ };
28
+ };
29
+ }[];
30
+ };
31
+ };
32
+ export declare function poolFeeTransactionPostProcess(data: SubqueryPoolFeeTransaction): PoolFeeTransaction[];
33
+ export declare const poolFeeTransactionQuery = "\nquery($filter: PoolFeeTransactionFilter) {\n poolFeeTransactions(\n orderBy: TIMESTAMP_ASC,\n filter: $filter\n ) {\n nodes {\n id\n type\n timestamp\n blockNumber\n epochNumber\n amount\n poolFee {\n feeId\n pool {\n currency {\n decimals\n }\n }\n }\n }\n }\n}\n";
34
+ //# sourceMappingURL=poolFeeTransactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poolFeeTransactions.d.ts","sourceRoot":"","sources":["../../src/IndexerQueries/poolFeeTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,MAAM,CAAC,MAAM,0BAA0B,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CACjF,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,8BAA8B,CAAA;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,8BAA8B,GACtC,UAAU,GACV,OAAO,GACP,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,CAAA;AAEV,MAAM,MAAM,0BAA0B,GAAG;IACvC,mBAAmB,EAAE;QACnB,KAAK,EAAE;YACL,EAAE,EAAE,MAAM,CAAA;YACV,IAAI,EAAE,8BAA8B,CAAA;YACpC,SAAS,EAAE,MAAM,CAAA;YACjB,WAAW,EAAE,MAAM,CAAA;YACnB,WAAW,EAAE,MAAM,CAAA;YACnB,MAAM,EAAE,MAAM,CAAA;YACd,OAAO,EAAE;gBACP,KAAK,EAAE,MAAM,CAAA;gBACb,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,6BAA6B,CAAC,IAAI,EAAE,0BAA0B,GAAG,kBAAkB,EAAE,CASpG;AAED,eAAO,MAAM,uBAAuB,0XAwBnC,CAAA"}