@omnipair/dusk-sdk 2.0.2 → 2.16.0-next.20261102
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 +1011 -16
- package/dist/amounts.d.ts +9 -0
- package/dist/amounts.d.ts.map +1 -0
- package/dist/amounts.js +10 -0
- package/dist/amounts.js.map +1 -0
- package/dist/constants.d.ts +71 -14
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +155 -28
- package/dist/constants.js.map +1 -1
- package/dist/delegate.d.ts +94 -0
- package/dist/delegate.d.ts.map +1 -0
- package/dist/delegate.js +131 -0
- package/dist/delegate.js.map +1 -0
- package/dist/dusk.d.ts +14 -0
- package/dist/dusk.d.ts.map +1 -1
- package/dist/dusk.js +22 -0
- package/dist/dusk.js.map +1 -1
- package/dist/get.d.ts +3253 -378
- package/dist/get.d.ts.map +1 -1
- package/dist/get.js +130 -70
- package/dist/get.js.map +1 -1
- package/dist/governance-client.d.ts +169 -0
- package/dist/governance-client.d.ts.map +1 -0
- package/dist/governance-client.js +146 -0
- package/dist/governance-client.js.map +1 -0
- package/dist/governance.d.ts +313 -0
- package/dist/governance.d.ts.map +1 -0
- package/dist/governance.js +902 -0
- package/dist/governance.js.map +1 -0
- package/dist/hash.d.ts +9 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +16 -0
- package/dist/hash.js.map +1 -0
- package/dist/hlp-liquidation-client.d.ts +106 -0
- package/dist/hlp-liquidation-client.d.ts.map +1 -0
- package/dist/hlp-liquidation-client.js +150 -0
- package/dist/hlp-liquidation-client.js.map +1 -0
- package/dist/idl_delegate.d.ts +3 -0
- package/dist/idl_delegate.d.ts.map +1 -0
- package/dist/idl_delegate.js +3 -0
- package/dist/idl_delegate.js.map +1 -0
- package/dist/idl_delegate.json +6119 -0
- package/dist/idl_v2.json +17175 -5862
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/interest-accounting.d.ts +49 -0
- package/dist/interest-accounting.d.ts.map +1 -0
- package/dist/interest-accounting.js +72 -0
- package/dist/interest-accounting.js.map +1 -0
- package/dist/leverage-actions.d.ts +122 -0
- package/dist/leverage-actions.d.ts.map +1 -0
- package/dist/leverage-actions.js +228 -0
- package/dist/leverage-actions.js.map +1 -0
- package/dist/leverage-margins.d.ts +12 -0
- package/dist/leverage-margins.d.ts.map +1 -0
- package/dist/leverage-margins.js +45 -0
- package/dist/leverage-margins.js.map +1 -0
- package/dist/leverage-preview.d.ts +587 -0
- package/dist/leverage-preview.d.ts.map +1 -0
- package/dist/leverage-preview.js +89 -0
- package/dist/leverage-preview.js.map +1 -0
- package/dist/liquidation-client.d.ts +230 -0
- package/dist/liquidation-client.d.ts.map +1 -0
- package/dist/liquidation-client.js +239 -0
- package/dist/liquidation-client.js.map +1 -0
- package/dist/liquidation.d.ts +78 -0
- package/dist/liquidation.d.ts.map +1 -0
- package/dist/liquidation.js +122 -0
- package/dist/liquidation.js.map +1 -0
- package/dist/lp-naming.d.ts +43 -0
- package/dist/lp-naming.d.ts.map +1 -0
- package/dist/lp-naming.js +81 -0
- package/dist/lp-naming.js.map +1 -0
- package/dist/lp-vanity.d.ts +33 -0
- package/dist/lp-vanity.d.ts.map +1 -0
- package/dist/lp-vanity.js +94 -0
- package/dist/lp-vanity.js.map +1 -0
- package/dist/market-bootstrap.d.ts +109 -0
- package/dist/market-bootstrap.d.ts.map +1 -0
- package/dist/market-bootstrap.js +158 -0
- package/dist/market-bootstrap.js.map +1 -0
- package/dist/market-launch.d.ts +45 -0
- package/dist/market-launch.d.ts.map +1 -0
- package/dist/market-launch.js +76 -0
- package/dist/market-launch.js.map +1 -0
- package/dist/oracle.d.ts +46 -0
- package/dist/oracle.d.ts.map +1 -0
- package/dist/oracle.js +103 -0
- package/dist/oracle.js.map +1 -0
- package/dist/preview.d.ts +39 -1
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +12 -0
- package/dist/preview.js.map +1 -1
- package/dist/protection.d.ts +48 -0
- package/dist/protection.d.ts.map +1 -0
- package/dist/protection.js +88 -0
- package/dist/protection.js.map +1 -0
- package/dist/risk-pricing.d.ts +14 -0
- package/dist/risk-pricing.d.ts.map +1 -0
- package/dist/risk-pricing.js +25 -0
- package/dist/risk-pricing.js.map +1 -0
- package/dist/simulation.d.ts +45 -0
- package/dist/simulation.d.ts.map +1 -0
- package/dist/simulation.js +106 -0
- package/dist/simulation.js.map +1 -0
- package/dist/tranche-client.d.ts +121 -0
- package/dist/tranche-client.d.ts.map +1 -0
- package/dist/tranche-client.js +185 -0
- package/dist/tranche-client.js.map +1 -0
- package/dist/transfer-fees.d.ts +46 -0
- package/dist/transfer-fees.d.ts.map +1 -0
- package/dist/transfer-fees.js +76 -0
- package/dist/transfer-fees.js.map +1 -0
- package/dist/type-aliases.d.ts +271 -31
- package/dist/type-aliases.d.ts.map +1 -1
- package/dist/types_delegate.d.ts +6126 -0
- package/dist/types_delegate.d.ts.map +1 -0
- package/dist/types_delegate.js +2 -0
- package/dist/types_delegate.js.map +1 -0
- package/dist/types_v2.d.ts +17235 -5922
- package/dist/types_v2.d.ts.map +1 -1
- package/dist/virtual-book/index.d.ts +4 -0
- package/dist/virtual-book/index.d.ts.map +1 -0
- package/dist/virtual-book/index.js +4 -0
- package/dist/virtual-book/index.js.map +1 -0
- package/dist/virtual-book/market.d.ts +608 -0
- package/dist/virtual-book/market.d.ts.map +1 -0
- package/dist/virtual-book/market.js +59 -0
- package/dist/virtual-book/market.js.map +1 -0
- package/dist/virtual-book/projection.d.ts +44 -0
- package/dist/virtual-book/projection.d.ts.map +1 -0
- package/dist/virtual-book/projection.js +229 -0
- package/dist/virtual-book/projection.js.map +1 -0
- package/dist/virtual-book/quotes.d.ts +1241 -0
- package/dist/virtual-book/quotes.d.ts.map +1 -0
- package/dist/virtual-book/quotes.js +233 -0
- package/dist/virtual-book/quotes.js.map +1 -0
- package/dist/write.d.ts +517 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +1172 -23
- package/dist/write.js.map +1 -1
- package/dist/yield-client.d.ts +51 -0
- package/dist/yield-client.d.ts.map +1 -0
- package/dist/yield-client.js +98 -0
- package/dist/yield-client.js.map +1 -0
- package/package.json +9 -2
- package/src/amounts.ts +13 -0
- package/src/constants.ts +236 -26
- package/src/delegate.ts +238 -0
- package/src/dusk.ts +28 -0
- package/src/get.ts +247 -82
- package/src/governance-client.ts +234 -0
- package/src/governance.ts +1422 -0
- package/src/hash.ts +15 -0
- package/src/hlp-liquidation-client.ts +195 -0
- package/src/idl_delegate.json +6119 -0
- package/src/idl_delegate.ts +3 -0
- package/src/idl_v2.json +17175 -5862
- package/src/index.ts +31 -0
- package/src/interest-accounting.ts +85 -0
- package/src/leverage-actions.ts +216 -0
- package/src/leverage-margins.ts +48 -0
- package/src/leverage-preview.ts +86 -0
- package/src/liquidation-client.ts +297 -0
- package/src/liquidation.ts +137 -0
- package/src/lp-naming.ts +127 -0
- package/src/lp-vanity.ts +135 -0
- package/src/market-bootstrap.ts +273 -0
- package/src/market-launch.ts +103 -0
- package/src/oracle.ts +120 -0
- package/src/preview.ts +53 -1
- package/src/protection.ts +112 -0
- package/src/risk-pricing.ts +28 -0
- package/src/simulation.ts +169 -0
- package/src/tranche-client.ts +187 -0
- package/src/transfer-fees.ts +99 -0
- package/src/type-aliases.ts +280 -31
- package/src/types_delegate.ts +6125 -0
- package/src/types_v2.ts +17174 -5861
- package/src/virtual-book/index.ts +3 -0
- package/src/virtual-book/market.ts +76 -0
- package/src/virtual-book/projection.ts +265 -0
- package/src/virtual-book/quotes.ts +308 -0
- package/src/write.ts +2073 -34
- package/src/yield-client.ts +117 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { calculateFee, getTransferFeeConfig, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, unpackMint, type TransferFee } from "@solana/spl-token";
|
|
2
|
+
import { SYSVAR_CLOCK_PUBKEY, type Commitment, type Connection } from "@solana/web3.js";
|
|
3
|
+
import { address, type AddressLike } from "./address.js";
|
|
4
|
+
|
|
5
|
+
export interface TransferFeeSchedules {
|
|
6
|
+
olderTransferFee: TransferFee;
|
|
7
|
+
newerTransferFee: TransferFee;
|
|
8
|
+
}
|
|
9
|
+
export type TransferFeeValuation = "effective" | "admission" | "liquidation";
|
|
10
|
+
export interface TransferFeeNotice {
|
|
11
|
+
epoch: bigint;
|
|
12
|
+
effective: TransferFee | null;
|
|
13
|
+
pending: TransferFee | null;
|
|
14
|
+
phase: "none" | "notice" | "finalNotice";
|
|
15
|
+
/** Re-evaluate at this epoch even if no mint account update arrives. */
|
|
16
|
+
nextRecheckEpoch: bigint | null;
|
|
17
|
+
}
|
|
18
|
+
const U64_MAX = (1n << 64n) - 1n;
|
|
19
|
+
function u64(value: bigint): void {
|
|
20
|
+
if (value < 0n || value > U64_MAX) throw new Error("Expected a u64 amount or epoch");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Schedule selection only; this does not establish position eligibility.
|
|
24
|
+
* Pending schedules are never charged on actual transfers before activation.
|
|
25
|
+
*/
|
|
26
|
+
export function transferFeeNotice(schedules: TransferFeeSchedules | null, epoch: bigint): TransferFeeNotice {
|
|
27
|
+
u64(epoch);
|
|
28
|
+
if (!schedules) return { epoch, effective: null, pending: null, phase: "none", nextRecheckEpoch: null };
|
|
29
|
+
for (const fee of [schedules.olderTransferFee, schedules.newerTransferFee]) {
|
|
30
|
+
u64(fee.epoch); u64(fee.maximumFee);
|
|
31
|
+
if (!Number.isInteger(fee.transferFeeBasisPoints) || fee.transferFeeBasisPoints < 0 || fee.transferFeeBasisPoints > 10_000) throw new Error("Invalid transfer fee rate");
|
|
32
|
+
}
|
|
33
|
+
const pending = schedules.newerTransferFee.epoch > epoch ? { ...schedules.newerTransferFee } : null;
|
|
34
|
+
const finalNotice = pending !== null && pending.epoch - epoch === 1n;
|
|
35
|
+
return {
|
|
36
|
+
epoch, effective: { ...(pending ? schedules.olderTransferFee : schedules.newerTransferFee) }, pending,
|
|
37
|
+
phase: pending ? (finalNotice ? "finalNotice" : "notice") : "none",
|
|
38
|
+
nextRecheckEpoch: pending ? (finalNotice ? pending.epoch : pending.epoch - 1n) : null,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Exact post-fee credit with SPL ceiling rounding and each schedule's own cap.
|
|
43
|
+
* Admission considers all announced changes; liquidation considers only a
|
|
44
|
+
* change activating next epoch. Never combine one schedule's rate with another's cap.
|
|
45
|
+
*/
|
|
46
|
+
export function transferFeeCredit(gross: bigint, notice: TransferFeeNotice, valuation: TransferFeeValuation = "effective"): bigint {
|
|
47
|
+
u64(gross);
|
|
48
|
+
if (!["effective", "admission", "liquidation"].includes(valuation)) throw new Error("Invalid fee valuation");
|
|
49
|
+
let credit = notice.effective ? gross - calculateFee(notice.effective, gross) : gross;
|
|
50
|
+
if (notice.pending && (valuation === "admission" || (valuation === "liquidation" && notice.phase === "finalNotice"))) {
|
|
51
|
+
const pendingCredit = gross - calculateFee(notice.pending, gross);
|
|
52
|
+
if (pendingCredit < credit) credit = pendingCredit;
|
|
53
|
+
}
|
|
54
|
+
return credit;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface MintTransferFeeNotice extends TransferFeeNotice {
|
|
58
|
+
mint: string;
|
|
59
|
+
tokenProgram: string;
|
|
60
|
+
feeAuthority: string | null;
|
|
61
|
+
/** Changes on epoch rollover, scheduling, cancellation or authority changes. */
|
|
62
|
+
refreshKey: string;
|
|
63
|
+
}
|
|
64
|
+
export interface TransferFeeNoticeSnapshot {
|
|
65
|
+
slot: number;
|
|
66
|
+
epoch: bigint;
|
|
67
|
+
mints: MintTransferFeeNotice[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Read up to 99 mints and Clock from one confirmed RPC bank. This is a
|
|
71
|
+
* monitoring snapshot, not a locked execution quote. Re-read before simulation
|
|
72
|
+
* and signing; obtain liquidation eligibility/payment from the on-chain preview.
|
|
73
|
+
*/
|
|
74
|
+
export async function fetchTransferFeeNotices(
|
|
75
|
+
connection: Pick<Connection, "getMultipleAccountsInfoAndContext">,
|
|
76
|
+
mints: readonly AddressLike[],
|
|
77
|
+
options: { commitment?: Commitment; minContextSlot?: number } = {},
|
|
78
|
+
): Promise<TransferFeeNoticeSnapshot> {
|
|
79
|
+
if (mints.length === 0 || mints.length > 99) throw new Error("Expected 1 to 99 mints");
|
|
80
|
+
const keys = mints.map(address);
|
|
81
|
+
const result = await connection.getMultipleAccountsInfoAndContext([...keys, SYSVAR_CLOCK_PUBKEY], { commitment: "confirmed", ...options });
|
|
82
|
+
const slot = result.context.slot;
|
|
83
|
+
const clock = result.value[keys.length];
|
|
84
|
+
if (!Number.isSafeInteger(slot) || slot < (options.minContextSlot ?? 0) || result.value.length !== keys.length + 1 || !clock || clock.executable || clock.owner.toBase58() !== "Sysvar1111111111111111111111111111111111111" || clock.data.length !== 40 || clock.data.readBigUInt64LE(0) !== BigInt(slot)) throw new Error("Invalid transfer-fee snapshot or Clock");
|
|
85
|
+
const epoch = clock.data.readBigUInt64LE(16);
|
|
86
|
+
return { slot, epoch, mints: keys.map((key, index) => {
|
|
87
|
+
const info = result.value[index];
|
|
88
|
+
if (!info || info.executable || (!info.owner.equals(TOKEN_PROGRAM_ID) && !info.owner.equals(TOKEN_2022_PROGRAM_ID))) throw new Error("Invalid mint owner");
|
|
89
|
+
const mint = unpackMint(key, info, info.owner);
|
|
90
|
+
if (!mint.isInitialized) throw new Error("Uninitialized mint");
|
|
91
|
+
const config = getTransferFeeConfig(mint);
|
|
92
|
+
const notice = transferFeeNotice(config, epoch);
|
|
93
|
+
const authority = config?.transferFeeConfigAuthority?.toBase58();
|
|
94
|
+
const feeAuthority = authority && authority !== "11111111111111111111111111111111" ? authority : null;
|
|
95
|
+
const fees = config ? [config.olderTransferFee, config.newerTransferFee].map(f => `${f.epoch}:${f.transferFeeBasisPoints}:${f.maximumFee}`).join("/") : "none";
|
|
96
|
+
return { ...notice, mint: key.toBase58(), tokenProgram: info.owner.toBase58(), feeAuthority,
|
|
97
|
+
refreshKey: `${key.toBase58()}/${info.owner.toBase58()}/${epoch}/${feeAuthority}/${fees}` };
|
|
98
|
+
}) };
|
|
99
|
+
}
|
package/src/type-aliases.ts
CHANGED
|
@@ -1,34 +1,283 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IdlTypes } from "@coral-xyz/anchor";
|
|
2
2
|
import type { Dusk } from "./types_v2.js";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
// Restrict Anchor's recursive type decoding to the definitions reachable from
|
|
5
|
+
// account and event roots. The full IDL includes instruction-only types and
|
|
6
|
+
// exceeds TypeScript's instantiation depth after the protocol layout grows.
|
|
7
|
+
type TypeNamed<N extends Dusk["types"][number]["name"]> = Extract<
|
|
8
|
+
Dusk["types"][number],
|
|
9
|
+
{ name: N }
|
|
10
|
+
>;
|
|
11
|
+
type DuskAccountTypes = [
|
|
12
|
+
TypeNamed<"oraclePolicy">,
|
|
13
|
+
TypeNamed<"oracleObservation">,
|
|
14
|
+
TypeNamed<"oracleState">,
|
|
15
|
+
TypeNamed<"runtimePricing">,
|
|
16
|
+
TypeNamed<"hlpFlashQuote">,
|
|
17
|
+
TypeNamed<"hlpFlashSession">,
|
|
18
|
+
TypeNamed<"governanceBalance">,
|
|
19
|
+
TypeNamed<"governanceSupport">,
|
|
20
|
+
TypeNamed<"liquidationSession">,
|
|
21
|
+
TypeNamed<"liquidationHealth">,
|
|
22
|
+
TypeNamed<"liquidationRates">,
|
|
23
|
+
TypeNamed<"liquidationFeeAllocation">,
|
|
24
|
+
TypeNamed<"flashLiquidationQuote">,
|
|
25
|
+
TypeNamed<"ammConfig">,
|
|
26
|
+
TypeNamed<"ammState">,
|
|
27
|
+
TypeNamed<"borrowPosition">,
|
|
28
|
+
TypeNamed<"closeApprovalQuote">,
|
|
29
|
+
TypeNamed<"concentratedCurveCache">,
|
|
30
|
+
TypeNamed<"dailyBorrowBucket">,
|
|
31
|
+
TypeNamed<"debt">,
|
|
32
|
+
TypeNamed<"deferredControllerTarget">,
|
|
33
|
+
TypeNamed<"feeProfile">,
|
|
34
|
+
TypeNamed<"fees">,
|
|
35
|
+
TypeNamed<"publicInterestAdvance">,
|
|
36
|
+
TypeNamed<"futarchyAuthority">,
|
|
37
|
+
TypeNamed<"hlpCohort">,
|
|
38
|
+
TypeNamed<"hlpVault">,
|
|
39
|
+
TypeNamed<"insurance">,
|
|
40
|
+
TypeNamed<"insuranceDrawWindow">,
|
|
41
|
+
TypeNamed<"riskRateConfig">,
|
|
42
|
+
TypeNamed<"trancheCapital">,
|
|
43
|
+
TypeNamed<"trancheIncome">,
|
|
44
|
+
TypeNamed<"tranchePolicy">,
|
|
45
|
+
TypeNamed<"trancheRevenueCarry">,
|
|
46
|
+
TypeNamed<"juniorExitConfig">,
|
|
47
|
+
TypeNamed<"marketIncomeBooks">,
|
|
48
|
+
TypeNamed<"incomeReceivableBook">,
|
|
49
|
+
TypeNamed<"incomeReceivableClaim">,
|
|
50
|
+
TypeNamed<"incomeExposureEnd">,
|
|
51
|
+
TypeNamed<"incomeEpoch">,
|
|
52
|
+
TypeNamed<"juniorCohort">,
|
|
53
|
+
TypeNamed<"juniorExitAccount">,
|
|
54
|
+
TypeNamed<"juniorExitTicket">,
|
|
55
|
+
TypeNamed<"receivableGrowth">,
|
|
56
|
+
TypeNamed<"leverageDelegation">,
|
|
57
|
+
TypeNamed<"leverageMarginTerms">,
|
|
58
|
+
TypeNamed<"leveragePosition">,
|
|
59
|
+
TypeNamed<"market">,
|
|
60
|
+
TypeNamed<"marketConfig">,
|
|
61
|
+
TypeNamed<"marketParameterUpdate">,
|
|
62
|
+
TypeNamed<"marketSide">,
|
|
63
|
+
TypeNamed<"parameterProposal">,
|
|
64
|
+
TypeNamed<"parameterProposalStatus">,
|
|
65
|
+
TypeNamed<"proposalMetadataV1">,
|
|
66
|
+
TypeNamed<"proposalSupport">,
|
|
67
|
+
TypeNamed<"protocolAuctionConfig">,
|
|
68
|
+
TypeNamed<"protocolAuctionEpoch">,
|
|
69
|
+
TypeNamed<"protocolAuctionParams">,
|
|
70
|
+
TypeNamed<"protocolAuctionRecipients">,
|
|
71
|
+
TypeNamed<"protocolAuctionSplit">,
|
|
72
|
+
TypeNamed<"referralAccrual">,
|
|
73
|
+
TypeNamed<"referralPartner">,
|
|
74
|
+
TypeNamed<"reserveShares">,
|
|
75
|
+
TypeNamed<"reserves">,
|
|
76
|
+
TypeNamed<"revenueDistribution">,
|
|
77
|
+
TypeNamed<"revenueRecipients">,
|
|
78
|
+
TypeNamed<"revenueShare">,
|
|
79
|
+
TypeNamed<"risk">,
|
|
80
|
+
TypeNamed<"virtualYieldLedger">,
|
|
81
|
+
TypeNamed<"yieldAccount">,
|
|
82
|
+
];
|
|
83
|
+
type DuskEventTypes = [
|
|
84
|
+
TypeNamed<"juniorCohortInitialized">,
|
|
85
|
+
TypeNamed<"juniorSeedCompounded">,
|
|
86
|
+
TypeNamed<"juniorSeedFunded">,
|
|
87
|
+
TypeNamed<"retiredJuniorBurned">,
|
|
88
|
+
TypeNamed<"trancheConverted">,
|
|
89
|
+
TypeNamed<"oraclePolicy">,
|
|
90
|
+
TypeNamed<"governanceBalanceUpdated">,
|
|
91
|
+
TypeNamed<"governanceSupportChanged">,
|
|
92
|
+
TypeNamed<"liquidationHealth">,
|
|
93
|
+
TypeNamed<"liquidationRates">,
|
|
94
|
+
TypeNamed<"liquidationFeeAllocation">,
|
|
95
|
+
TypeNamed<"liquidationLossAllocation">,
|
|
96
|
+
TypeNamed<"flashLiquidationQuote">,
|
|
97
|
+
TypeNamed<"liquidationPositionState">,
|
|
98
|
+
TypeNamed<"emergencyLiquidationQuote">,
|
|
99
|
+
TypeNamed<"flashLiquidationBegun">,
|
|
100
|
+
TypeNamed<"flashLiquidationSettled">,
|
|
101
|
+
TypeNamed<"emergencyLiquidationSettled">,
|
|
102
|
+
TypeNamed<"ammConfig">,
|
|
103
|
+
TypeNamed<"fundInterestReceipt">,
|
|
104
|
+
TypeNamed<"publicInterestFunded">,
|
|
105
|
+
TypeNamed<"hlpInterestAllocated">,
|
|
106
|
+
TypeNamed<"hlpFlashQuote">,
|
|
107
|
+
TypeNamed<"hlpFlashStarted">,
|
|
108
|
+
TypeNamed<"hlpFlashSettled">,
|
|
109
|
+
TypeNamed<"borrowInterestAccrued">,
|
|
110
|
+
TypeNamed<"borrowInterestPaid">,
|
|
111
|
+
TypeNamed<"borrowPositionLiquidated">,
|
|
112
|
+
TypeNamed<"debtFreePositionClosed">,
|
|
113
|
+
TypeNamed<"debtSource">,
|
|
114
|
+
TypeNamed<"feeProfile">,
|
|
115
|
+
TypeNamed<"harvestAuthorityUpdated">,
|
|
116
|
+
TypeNamed<"hlpClosed">,
|
|
117
|
+
TypeNamed<"hlpCohortRotated">,
|
|
118
|
+
TypeNamed<"hlpOpened">,
|
|
119
|
+
TypeNamed<"hlpRebalanced">,
|
|
120
|
+
TypeNamed<"hlpRetiredReceiptBurned">,
|
|
121
|
+
TypeNamed<"hlpTerminalLiquidated">,
|
|
122
|
+
TypeNamed<"insuranceDonated">,
|
|
123
|
+
TypeNamed<"riskRateConfig">,
|
|
124
|
+
TypeNamed<"leverageDelegationUpdated">,
|
|
125
|
+
TypeNamed<"leverageMarginTerms">,
|
|
126
|
+
TypeNamed<"leveragePositionClosed">,
|
|
127
|
+
TypeNamed<"leveragePositionLiquidated">,
|
|
128
|
+
TypeNamed<"leveragePositionOpened">,
|
|
129
|
+
TypeNamed<"leveragePositionUpdated">,
|
|
130
|
+
TypeNamed<"leverageSwapReceipt">,
|
|
131
|
+
TypeNamed<"liquidationAuctionCancelled">,
|
|
132
|
+
TypeNamed<"liquidationAuctionStarted">,
|
|
133
|
+
TypeNamed<"liquidityAdded">,
|
|
134
|
+
TypeNamed<"liquidityRemoved">,
|
|
135
|
+
TypeNamed<"lpTransferred">,
|
|
136
|
+
TypeNamed<"marketCollateralDeposited">,
|
|
137
|
+
TypeNamed<"marketCollateralWithdrawn">,
|
|
138
|
+
TypeNamed<"marketConfig">,
|
|
139
|
+
TypeNamed<"marketCreated">,
|
|
140
|
+
TypeNamed<"marketDebtUpdated">,
|
|
141
|
+
TypeNamed<"marketEventMetadata">,
|
|
142
|
+
TypeNamed<"marketHealthUpdated">,
|
|
143
|
+
TypeNamed<"marketParameterUpdate">,
|
|
144
|
+
TypeNamed<"marketReduceOnlyUpdated">,
|
|
145
|
+
TypeNamed<"marketSideSnapshot">,
|
|
146
|
+
TypeNamed<"parameterProposalCreated">,
|
|
147
|
+
TypeNamed<"parameterProposalExecuted">,
|
|
148
|
+
TypeNamed<"parameterProposalQueued">,
|
|
149
|
+
TypeNamed<"parameterProposalSupportWithdrawn">,
|
|
150
|
+
TypeNamed<"parameterProposalSupported">,
|
|
151
|
+
TypeNamed<"proposalMetadataV1">,
|
|
152
|
+
TypeNamed<"protocolAuctionConfigUpdated">,
|
|
153
|
+
TypeNamed<"protocolAuctionRecipientsUpdated">,
|
|
154
|
+
TypeNamed<"protocolAuctionRouteUpdated">,
|
|
155
|
+
TypeNamed<"protocolAuctionSettled">,
|
|
156
|
+
TypeNamed<"protocolAuctionSplitUpdated">,
|
|
157
|
+
TypeNamed<"referralBound">,
|
|
158
|
+
TypeNamed<"referralInterestAccrued">,
|
|
159
|
+
TypeNamed<"referralInterestClaimed">,
|
|
160
|
+
TypeNamed<"referralInterestShareCapUpdated">,
|
|
161
|
+
TypeNamed<"referralPartnerConfigured">,
|
|
162
|
+
TypeNamed<"referralRecipientUpdated">,
|
|
163
|
+
TypeNamed<"swapExecuted">,
|
|
164
|
+
TypeNamed<"swapOrigin">,
|
|
165
|
+
TypeNamed<"yieldClaimed">,
|
|
166
|
+
TypeNamed<"yieldRecipientUpdated">,
|
|
167
|
+
];
|
|
168
|
+
type DuskAccountIdl = {
|
|
169
|
+
address: Dusk["address"];
|
|
170
|
+
metadata: Dusk["metadata"];
|
|
171
|
+
instructions: [];
|
|
172
|
+
accounts: Dusk["accounts"];
|
|
173
|
+
events: [];
|
|
174
|
+
types: DuskAccountTypes;
|
|
175
|
+
};
|
|
176
|
+
type DuskEventIdl = {
|
|
177
|
+
address: Dusk["address"];
|
|
178
|
+
metadata: Dusk["metadata"];
|
|
179
|
+
instructions: [];
|
|
180
|
+
accounts: [];
|
|
181
|
+
events: Dusk["events"];
|
|
182
|
+
types: DuskEventTypes;
|
|
183
|
+
};
|
|
184
|
+
type DuskFlashAmmIdl = {
|
|
185
|
+
address: Dusk["address"];
|
|
186
|
+
metadata: Dusk["metadata"];
|
|
187
|
+
instructions: [];
|
|
188
|
+
accounts: [];
|
|
189
|
+
events: [];
|
|
190
|
+
types: [
|
|
191
|
+
TypeNamed<"flashAmmLiquidationQuote">,
|
|
192
|
+
TypeNamed<"flashLiquidationQuote">,
|
|
193
|
+
TypeNamed<"liquidationFeeAllocation">,
|
|
194
|
+
TypeNamed<"liquidationHealth">,
|
|
195
|
+
TypeNamed<"liquidationRates">,
|
|
196
|
+
];
|
|
197
|
+
};
|
|
12
198
|
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export type
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
34
|
-
export type
|
|
199
|
+
export type Market = IdlTypes<DuskAccountIdl>["market"];
|
|
200
|
+
export type HlpFlashQuote = IdlTypes<DuskAccountIdl>["hlpFlashQuote"];
|
|
201
|
+
export type FundInterestReceipt = IdlTypes<DuskEventIdl>["fundInterestReceipt"];
|
|
202
|
+
export type FlashLiquidationQuote = IdlTypes<DuskEventIdl>["flashLiquidationQuote"];
|
|
203
|
+
export type FlashAmmLiquidationQuote = IdlTypes<DuskFlashAmmIdl>["flashAmmLiquidationQuote"];
|
|
204
|
+
export type EmergencyLiquidationQuote = IdlTypes<DuskEventIdl>["emergencyLiquidationQuote"];
|
|
205
|
+
export type BorrowPosition = IdlTypes<DuskAccountIdl>["borrowPosition"];
|
|
206
|
+
export type LeveragePosition = IdlTypes<DuskAccountIdl>["leveragePosition"];
|
|
207
|
+
export type LeverageDelegation = IdlTypes<DuskAccountIdl>["leverageDelegation"];
|
|
208
|
+
export type YieldAccount = IdlTypes<DuskAccountIdl>["yieldAccount"];
|
|
209
|
+
export type JuniorCohort = IdlTypes<DuskAccountIdl>["juniorCohort"];
|
|
210
|
+
export type JuniorExitAccount = IdlTypes<DuskAccountIdl>["juniorExitAccount"];
|
|
211
|
+
export type IncomeEpoch = IdlTypes<DuskAccountIdl>["incomeEpoch"];
|
|
212
|
+
export type FutarchyAuthority = IdlTypes<DuskAccountIdl>["futarchyAuthority"];
|
|
213
|
+
export type ReferralPartner = IdlTypes<DuskAccountIdl>["referralPartner"];
|
|
214
|
+
export type ReferralAccrual = IdlTypes<DuskAccountIdl>["referralAccrual"];
|
|
215
|
+
export type ParameterProposal = IdlTypes<DuskAccountIdl>["parameterProposal"];
|
|
216
|
+
export type ProposalSupport = IdlTypes<DuskAccountIdl>["proposalSupport"];
|
|
217
|
+
|
|
218
|
+
export type HlpClosed = IdlTypes<DuskEventIdl>["hlpClosed"];
|
|
219
|
+
export type HlpCohort = IdlTypes<DuskAccountIdl>["hlpCohort"];
|
|
220
|
+
export type HlpCohortRotated = IdlTypes<DuskEventIdl>["hlpCohortRotated"];
|
|
221
|
+
export type HlpOpened = IdlTypes<DuskEventIdl>["hlpOpened"];
|
|
222
|
+
export type HlpRebalanced = IdlTypes<DuskEventIdl>["hlpRebalanced"];
|
|
223
|
+
export type HlpRetiredReceiptBurned = IdlTypes<DuskEventIdl>["hlpRetiredReceiptBurned"];
|
|
224
|
+
export type LiquidationAuctionCancelled = IdlTypes<DuskEventIdl>["liquidationAuctionCancelled"];
|
|
225
|
+
export type LiquidationAuctionStarted = IdlTypes<DuskEventIdl>["liquidationAuctionStarted"];
|
|
226
|
+
export type LiquidityAdded = IdlTypes<DuskEventIdl>["liquidityAdded"];
|
|
227
|
+
export type LiquidityRemoved = IdlTypes<DuskEventIdl>["liquidityRemoved"];
|
|
228
|
+
export type LpTransferred = IdlTypes<DuskEventIdl>["lpTransferred"];
|
|
229
|
+
export type MarketCollateralDeposited = IdlTypes<DuskEventIdl>["marketCollateralDeposited"];
|
|
230
|
+
export type MarketCollateralWithdrawn = IdlTypes<DuskEventIdl>["marketCollateralWithdrawn"];
|
|
231
|
+
export type MarketCreated = IdlTypes<DuskEventIdl>["marketCreated"];
|
|
232
|
+
export type MarketDebtUpdated = IdlTypes<DuskEventIdl>["marketDebtUpdated"];
|
|
233
|
+
export type MarketHealthUpdated = IdlTypes<DuskEventIdl>["marketHealthUpdated"];
|
|
234
|
+
export type MarketReduceOnlyUpdated = IdlTypes<DuskEventIdl>["marketReduceOnlyUpdated"];
|
|
235
|
+
export type ParameterProposalCreated = IdlTypes<DuskEventIdl>["parameterProposalCreated"];
|
|
236
|
+
export type ParameterProposalExecuted = IdlTypes<DuskEventIdl>["parameterProposalExecuted"];
|
|
237
|
+
export type ParameterProposalQueued = IdlTypes<DuskEventIdl>["parameterProposalQueued"];
|
|
238
|
+
export type ParameterProposalSupported = IdlTypes<DuskEventIdl>["parameterProposalSupported"];
|
|
239
|
+
export type ParameterProposalSupportWithdrawn =
|
|
240
|
+
IdlTypes<DuskEventIdl>["parameterProposalSupportWithdrawn"];
|
|
241
|
+
export type BorrowPositionLiquidated = IdlTypes<DuskEventIdl>["borrowPositionLiquidated"];
|
|
242
|
+
export type BorrowInterestAccrued = IdlTypes<DuskEventIdl>["borrowInterestAccrued"];
|
|
243
|
+
export type BorrowInterestPaid = IdlTypes<DuskEventIdl>["borrowInterestPaid"];
|
|
244
|
+
export type DebtSource = BorrowInterestPaid["source"];
|
|
245
|
+
export type LeveragePositionOpened = IdlTypes<DuskEventIdl>["leveragePositionOpened"];
|
|
246
|
+
export type LeveragePositionUpdated = IdlTypes<DuskEventIdl>["leveragePositionUpdated"];
|
|
247
|
+
export type LeveragePositionClosed = IdlTypes<DuskEventIdl>["leveragePositionClosed"];
|
|
248
|
+
export type LeveragePositionLiquidated = IdlTypes<DuskEventIdl>["leveragePositionLiquidated"];
|
|
249
|
+
export type ProtocolAuctionSettled = IdlTypes<DuskEventIdl>["protocolAuctionSettled"];
|
|
250
|
+
export type ReferralBound = IdlTypes<DuskEventIdl>["referralBound"];
|
|
251
|
+
export type ReferralPartnerConfigured = IdlTypes<DuskEventIdl>["referralPartnerConfigured"];
|
|
252
|
+
export type ReferralInterestAccrued = IdlTypes<DuskEventIdl>["referralInterestAccrued"];
|
|
253
|
+
export type ReferralInterestClaimed = IdlTypes<DuskEventIdl>["referralInterestClaimed"];
|
|
254
|
+
export type ReferralInterestShareCapUpdated = IdlTypes<DuskEventIdl>["referralInterestShareCapUpdated"];
|
|
255
|
+
export type ReferralRecipientUpdated = IdlTypes<DuskEventIdl>["referralRecipientUpdated"];
|
|
256
|
+
export type SwapExecuted = IdlTypes<DuskEventIdl>["swapExecuted"];
|
|
257
|
+
export type SwapOrigin = SwapExecuted["origin"];
|
|
258
|
+
export type MarketSideSnapshot = SwapExecuted["base"];
|
|
259
|
+
export type YieldClaimed = IdlTypes<DuskEventIdl>["yieldClaimed"];
|
|
260
|
+
export type YieldRecipientUpdated = IdlTypes<DuskEventIdl>["yieldRecipientUpdated"];
|
|
261
|
+
|
|
262
|
+
export type LiquidationHealth = IdlTypes<DuskAccountIdl>["liquidationHealth"];
|
|
263
|
+
export type LiquidationSession = IdlTypes<DuskAccountIdl>["liquidationSession"];
|
|
264
|
+
export type FlashLiquidationBegun = IdlTypes<DuskEventIdl>["flashLiquidationBegun"];
|
|
265
|
+
export type FlashLiquidationSettled = IdlTypes<DuskEventIdl>["flashLiquidationSettled"];
|
|
266
|
+
export type EmergencyLiquidationSettled = IdlTypes<DuskEventIdl>["emergencyLiquidationSettled"];
|
|
267
|
+
|
|
268
|
+
export type GovernanceBalance = IdlTypes<DuskAccountIdl>["governanceBalance"];
|
|
269
|
+
export type GovernanceSupport = IdlTypes<DuskAccountIdl>["governanceSupport"];
|
|
270
|
+
export type GovernanceBalanceUpdated = IdlTypes<DuskEventIdl>["governanceBalanceUpdated"];
|
|
271
|
+
export type GovernanceSupportChanged = IdlTypes<DuskEventIdl>["governanceSupportChanged"];
|
|
272
|
+
|
|
273
|
+
export type HlpFlashSession = IdlTypes<DuskAccountIdl>["hlpFlashSession"];
|
|
274
|
+
export type HlpFlashStarted = IdlTypes<DuskEventIdl>["hlpFlashStarted"];
|
|
275
|
+
export type HlpFlashSettled = IdlTypes<DuskEventIdl>["hlpFlashSettled"];
|
|
276
|
+
export type HlpInterestAllocated = IdlTypes<DuskEventIdl>["hlpInterestAllocated"];
|
|
277
|
+
export type PublicInterestFunded = IdlTypes<DuskEventIdl>["publicInterestFunded"];
|
|
278
|
+
|
|
279
|
+
export type JuniorSeedCompounded = IdlTypes<DuskEventIdl>["juniorSeedCompounded"];
|
|
280
|
+
export type JuniorCohortInitialized = IdlTypes<DuskEventIdl>["juniorCohortInitialized"];
|
|
281
|
+
export type JuniorSeedFunded = IdlTypes<DuskEventIdl>["juniorSeedFunded"];
|
|
282
|
+
export type RetiredJuniorBurned = IdlTypes<DuskEventIdl>["retiredJuniorBurned"];
|
|
283
|
+
export type TrancheConverted = IdlTypes<DuskEventIdl>["trancheConverted"];
|