@centrifuge/sdk 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Centrifuge.d.ts.map +1 -1
- package/dist/Centrifuge.js +9 -7
- package/dist/Centrifuge.js.map +1 -1
- package/dist/abi/MerkleProofManagerFactory.abi.d.ts +3 -0
- package/dist/abi/MerkleProofManagerFactory.abi.d.ts.map +1 -0
- package/dist/abi/MerkleProofManagerFactory.abi.js +2 -0
- package/dist/abi/MerkleProofManagerFactory.abi.js.map +1 -0
- package/dist/abi/index.d.ts +12 -0
- package/dist/abi/index.d.ts.map +1 -1
- package/dist/abi/index.js +2 -0
- package/dist/abi/index.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.d.ts +2 -0
- package/dist/entities/PoolNetwork.d.ts.map +1 -1
- package/dist/entities/PoolNetwork.js +32 -8
- package/dist/entities/PoolNetwork.js.map +1 -1
- package/dist/entities/PoolNetwork.test.js +38 -0
- package/dist/entities/PoolNetwork.test.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/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.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,91 +0,0 @@
|
|
|
1
|
-
import { Balance, Price, 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 ? new Balance(tx.asset?.collateralValue, currencyDecimals) : undefined,
|
|
13
|
-
currentPrice: tx.currentPrice
|
|
14
|
-
? new Balance(tx.currentPrice, currencyDecimals)
|
|
15
|
-
: new Balance(0n, currencyDecimals),
|
|
16
|
-
discountRate: tx.asset.discountRate ? new Rate(tx.asset.discountRate) : undefined,
|
|
17
|
-
faceValue: tx.asset.notional && tx.outstandingQuantity
|
|
18
|
-
? new Balance(tx.asset.notional, currencyDecimals).mul(new Price(tx.outstandingQuantity).toDecimal())
|
|
19
|
-
: undefined,
|
|
20
|
-
lossGivenDefault: tx.asset.lossGivenDefault ? new Rate(tx.asset.lossGivenDefault) : undefined,
|
|
21
|
-
name: tx.asset.name,
|
|
22
|
-
outstandingDebt: tx.outstandingDebt ? new Balance(tx.outstandingDebt, currencyDecimals) : undefined,
|
|
23
|
-
outstandingInterest: tx.outstandingInterest ? new Balance(tx.outstandingInterest, currencyDecimals) : undefined,
|
|
24
|
-
outstandingPrincipal: tx.outstandingPrincipal
|
|
25
|
-
? new Balance(tx.outstandingPrincipal, currencyDecimals)
|
|
26
|
-
: undefined,
|
|
27
|
-
outstandingQuantity: tx.outstandingQuantity ? new Balance(tx.outstandingQuantity, 18) : undefined,
|
|
28
|
-
presentValue: tx.presentValue ? new Balance(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 Balance(tx.asset.sumRealizedProfitFifo, currencyDecimals)
|
|
33
|
-
: undefined,
|
|
34
|
-
totalRepaidInterest: tx.totalRepaidInterest ? new Balance(tx.totalRepaidInterest, currencyDecimals) : undefined,
|
|
35
|
-
totalRepaidPrincipal: tx.totalRepaidPrincipal
|
|
36
|
-
? new Balance(tx.totalRepaidPrincipal, currencyDecimals)
|
|
37
|
-
: undefined,
|
|
38
|
-
totalRepaidUnscheduled: tx.totalRepaidUnscheduled
|
|
39
|
-
? new Balance(tx.totalRepaidUnscheduled, currencyDecimals)
|
|
40
|
-
: undefined,
|
|
41
|
-
unrealizedProfitAtMarketPrice: tx.asset.unrealizedProfitAtMarketPrice
|
|
42
|
-
? new Balance(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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assetSnapshots.js","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/assetSnapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAsE5D,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,EAAE,EAAE,CAAC,S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AC3C,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,CAAC;gBACxD,CAAC,CAAC,SAAS;YACb,sBAAsB,EAAE,EAAE,CAAC,sBAAsB;gBAC/C,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;gBAC1D,CAAC,CAAC,SAAS;YACb,6BAA6B,EAAE,EAAE,CAAC,KAAK,CAAC,6BAA6B;gBACnE,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,EAAE,gBAAgB,CAAC;gBACvE,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"}
|
|
@@ -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;IA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I,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,MAA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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
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
//# sourceMappingURL=epochs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"epochs.js","sourceRoot":"","sources":["../../../src/entities/IndexerQueries/epochs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AA6CtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAoB,EAAW,EAAE;IACjE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACtC,MAAM,KAAK,G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ifuge } 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,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,mBAAmB,EAAkD,MAAM,qBAAqB,CAAA;AACzG,OAAO,EAAE,sBAAsB,EAAwD,MAAM,wBAAwB,CAAA;AACrH,OAAO,EAAE,WAAW,EAAkC,MAAM,aAAa,CAAA;AACzE,OAAO,EACL,yBAAyB,EAG1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,qBAAqB,EAAqD,MAAM,uBAAuB,CAAA;AAChH,OAAO,EACL,wBAAwB,EAGzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAgD,MAAM,oBAAoB,CAAA;AACrG,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EAGrB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAsD,MAAM,uBAAuB,CAAA;AAEjH,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,eAAe,CAAC,MAAM,CAAC,EAAE,WAAW;IAIpC,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"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
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,CAAA;AACrG,OAAO,EAGL,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAyB,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAEjH,MAAM,OAAO,cAAe,SAAQ,MAAM;IAG/B;IAFT,YACE,UAAsB,EACf,IAAU;QAEjB,KAAK,CAAC,UAAU,EAAE,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;QAFlD,SAAI,GAAJ,IAAI,CAAM;IAGnB,CAAC;IAED,qBAAqB,CAAC,MAA8B;QACl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2B,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,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,OAAO,CAAA;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,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,EA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