@0dotxyz/p0-ts-sdk 2.8.4 → 2.9.0-alpha.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/dist/index.cjs +305 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +218 -16
- package/dist/index.d.ts +218 -16
- package/dist/index.js +292 -11
- package/dist/index.js.map +1 -1
- package/dist/instructions.cjs +19 -1
- package/dist/instructions.cjs.map +1 -1
- package/dist/instructions.d.cts +30 -1
- package/dist/instructions.d.ts +30 -1
- package/dist/instructions.js +19 -1
- package/dist/instructions.js.map +1 -1
- package/dist/{types-BsUi_Zrx.d.ts → types-Auh-s318.d.ts} +40 -1
- package/dist/{types-Bah-JjSM.d.cts → types-CvvHQs7G.d.cts} +40 -1
- package/package.json +2 -1
|
@@ -20693,6 +20693,11 @@ interface EmodeConfigRaw {
|
|
|
20693
20693
|
interface BalanceType {
|
|
20694
20694
|
active: boolean;
|
|
20695
20695
|
bankPk: PublicKey;
|
|
20696
|
+
/**
|
|
20697
|
+
* Tag used by orders to reference this balance (0 means unused/unassigned).
|
|
20698
|
+
* A tag may be non-zero even when no order currently references it.
|
|
20699
|
+
*/
|
|
20700
|
+
tag: number;
|
|
20696
20701
|
assetShares: BigNumber$1;
|
|
20697
20702
|
liabilityShares: BigNumber$1;
|
|
20698
20703
|
emissionsOutstanding: BigNumber$1;
|
|
@@ -20757,6 +20762,23 @@ declare enum MarginRequirementType {
|
|
|
20757
20762
|
Maintenance = 1,
|
|
20758
20763
|
Equity = 2
|
|
20759
20764
|
}
|
|
20765
|
+
type OrderTriggerKind = "stopLoss" | "takeProfit" | "both";
|
|
20766
|
+
interface OrderType {
|
|
20767
|
+
address: PublicKey;
|
|
20768
|
+
marginfiAccount: PublicKey;
|
|
20769
|
+
/** Which trigger(s) this order fires on. */
|
|
20770
|
+
trigger: OrderTriggerKind;
|
|
20771
|
+
/** Pair net-equity stop-loss threshold in USD, null when the order has no stop-loss leg. */
|
|
20772
|
+
stopLoss: BigNumber$1 | null;
|
|
20773
|
+
/** Pair net-equity take-profit threshold in USD, null when the order has no take-profit leg. */
|
|
20774
|
+
takeProfit: BigNumber$1 | null;
|
|
20775
|
+
/** Tags linking this order to its two balances (see {@link BalanceType.tag}). */
|
|
20776
|
+
tags: [number, number];
|
|
20777
|
+
/** Unix timestamp (seconds) when the order was created. */
|
|
20778
|
+
createdAt: number;
|
|
20779
|
+
/** Max slippage the keeper may impose on execution, in percent. */
|
|
20780
|
+
maxSlippagePercent: number;
|
|
20781
|
+
}
|
|
20760
20782
|
|
|
20761
20783
|
interface PriceWithConfidence {
|
|
20762
20784
|
price: BigNumber$1;
|
|
@@ -21328,6 +21350,23 @@ type MintDataMap = Map<string, MintData>;
|
|
|
21328
21350
|
interface WrappedI80F48 {
|
|
21329
21351
|
value: number[];
|
|
21330
21352
|
}
|
|
21353
|
+
type OrderTrigger = {
|
|
21354
|
+
stopLoss: {
|
|
21355
|
+
threshold: WrappedI80F48;
|
|
21356
|
+
maxSlippage: number;
|
|
21357
|
+
};
|
|
21358
|
+
} | {
|
|
21359
|
+
takeProfit: {
|
|
21360
|
+
threshold: WrappedI80F48;
|
|
21361
|
+
maxSlippage: number;
|
|
21362
|
+
};
|
|
21363
|
+
} | {
|
|
21364
|
+
both: {
|
|
21365
|
+
stopLoss: WrappedI80F48;
|
|
21366
|
+
takeProfit: WrappedI80F48;
|
|
21367
|
+
maxSlippage: number;
|
|
21368
|
+
};
|
|
21369
|
+
};
|
|
21331
21370
|
type Amount = BigNumber | number | string;
|
|
21332
21371
|
type AmountType = "uiToken" | "cToken";
|
|
21333
21372
|
type TypedAmount = {
|
|
@@ -21339,4 +21378,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
21339
21378
|
type: AmountType;
|
|
21340
21379
|
};
|
|
21341
21380
|
|
|
21342
|
-
export { type
|
|
21381
|
+
export { type Environment as $, AssetTag as A, type BankConfigCompactRaw as B, type BankIntegrationMetadataMap as C, type OrderType as D, EmodeTag as E, type BalanceType as F, type HealthCacheType as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, type EmodePair as J, type ActiveEmodePair as K, type ActionEmodeImpact as L, type MarginfiProgram as M, MarginRequirementType as N, type OrderTrigger as O, type PriceWithConfidence as P, EmodeImpactStatus as Q, RiskTier as R, type Amount as S, type TypedAmount as T, BankVaultType as U, type RateLimitWindowType as V, type WrappedI80F48 as W, type BankIntegrationMetadataMapDto as X, type BankIntegrationMetadataDto as Y, type BankIntegrationMetadata as Z, Bank as _, type BankConfigOptRaw as a, type Project0Config as a0, type MintData as a1, BankConfig as a2, EmodeSettings as a3, type RateLimitWindowRaw as a4, type BankMetadataRaw as a5, type RatePointRaw as a6, type InterestRateConfigCompactRaw as a7, type InterestRateConfigOptRaw as a8, type OracleConfigOptRaw as a9, AccountType as aA, type KaminoStates as aB, type BankMap as aC, type OraclePriceMap as aD, type MintDataMap as aE, type AmountType as aF, resolveAmount as aG, type EmodeConfigRaw as aa, type RatePoint as ab, type InterestRateConfigOpt as ac, type EmodeEntry as ad, type OracleConfigOpt as ae, type EmodeImpact as af, isWeightedPrice as ag, type GetAssetWeightParams as ah, getAssetWeight as ai, getLiabilityWeight as aj, computeMaxLeverage as ak, computeLoopingParams as al, type ComputeUsdValueParams as am, computeUsdValue as an, type ComputeLiabilityUsdValueParams as ao, computeLiabilityUsdValue as ap, type ComputeAssetUsdValueParams as aq, computeAssetUsdValue as ar, computeTvl as as, type OrderTriggerKind as at, type PriceWithConfidenceDto as au, MARGINFI_IDL as av, type Program as aw, type Wallet as ax, type BankMetadata as ay, type BankAddress as az, type BankType as b, BankConfigFlag as c, OperationalState as d, OracleSetup as e, EmodeEntryFlags as f, EmodeFlags as g, type OperationalStateRaw as h, type OracleSetupRaw as i, type RiskTierRaw as j, type BankConfigOpt as k, type InterestRateConfig as l, type BankConfigType as m, type BankConfigRaw as n, type EmodeSettingsType as o, type BankRateLimiterType as p, type BankRaw as q, type BankRateLimiterRaw as r, type EmodeSettingsRaw as s, type MarginfiIdlType as t, HealthCacheStatus as u, AccountFlags as v, type MarginfiAccountType as w, type OraclePrice as x, PriceBias as y, type OraclePriceDto as z };
|
|
@@ -20693,6 +20693,11 @@ interface EmodeConfigRaw {
|
|
|
20693
20693
|
interface BalanceType {
|
|
20694
20694
|
active: boolean;
|
|
20695
20695
|
bankPk: PublicKey;
|
|
20696
|
+
/**
|
|
20697
|
+
* Tag used by orders to reference this balance (0 means unused/unassigned).
|
|
20698
|
+
* A tag may be non-zero even when no order currently references it.
|
|
20699
|
+
*/
|
|
20700
|
+
tag: number;
|
|
20696
20701
|
assetShares: BigNumber$1;
|
|
20697
20702
|
liabilityShares: BigNumber$1;
|
|
20698
20703
|
emissionsOutstanding: BigNumber$1;
|
|
@@ -20757,6 +20762,23 @@ declare enum MarginRequirementType {
|
|
|
20757
20762
|
Maintenance = 1,
|
|
20758
20763
|
Equity = 2
|
|
20759
20764
|
}
|
|
20765
|
+
type OrderTriggerKind = "stopLoss" | "takeProfit" | "both";
|
|
20766
|
+
interface OrderType {
|
|
20767
|
+
address: PublicKey;
|
|
20768
|
+
marginfiAccount: PublicKey;
|
|
20769
|
+
/** Which trigger(s) this order fires on. */
|
|
20770
|
+
trigger: OrderTriggerKind;
|
|
20771
|
+
/** Pair net-equity stop-loss threshold in USD, null when the order has no stop-loss leg. */
|
|
20772
|
+
stopLoss: BigNumber$1 | null;
|
|
20773
|
+
/** Pair net-equity take-profit threshold in USD, null when the order has no take-profit leg. */
|
|
20774
|
+
takeProfit: BigNumber$1 | null;
|
|
20775
|
+
/** Tags linking this order to its two balances (see {@link BalanceType.tag}). */
|
|
20776
|
+
tags: [number, number];
|
|
20777
|
+
/** Unix timestamp (seconds) when the order was created. */
|
|
20778
|
+
createdAt: number;
|
|
20779
|
+
/** Max slippage the keeper may impose on execution, in percent. */
|
|
20780
|
+
maxSlippagePercent: number;
|
|
20781
|
+
}
|
|
20760
20782
|
|
|
20761
20783
|
interface PriceWithConfidence {
|
|
20762
20784
|
price: BigNumber$1;
|
|
@@ -21328,6 +21350,23 @@ type MintDataMap = Map<string, MintData>;
|
|
|
21328
21350
|
interface WrappedI80F48 {
|
|
21329
21351
|
value: number[];
|
|
21330
21352
|
}
|
|
21353
|
+
type OrderTrigger = {
|
|
21354
|
+
stopLoss: {
|
|
21355
|
+
threshold: WrappedI80F48;
|
|
21356
|
+
maxSlippage: number;
|
|
21357
|
+
};
|
|
21358
|
+
} | {
|
|
21359
|
+
takeProfit: {
|
|
21360
|
+
threshold: WrappedI80F48;
|
|
21361
|
+
maxSlippage: number;
|
|
21362
|
+
};
|
|
21363
|
+
} | {
|
|
21364
|
+
both: {
|
|
21365
|
+
stopLoss: WrappedI80F48;
|
|
21366
|
+
takeProfit: WrappedI80F48;
|
|
21367
|
+
maxSlippage: number;
|
|
21368
|
+
};
|
|
21369
|
+
};
|
|
21331
21370
|
type Amount = BigNumber | number | string;
|
|
21332
21371
|
type AmountType = "uiToken" | "cToken";
|
|
21333
21372
|
type TypedAmount = {
|
|
@@ -21339,4 +21378,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
21339
21378
|
type: AmountType;
|
|
21340
21379
|
};
|
|
21341
21380
|
|
|
21342
|
-
export { type
|
|
21381
|
+
export { type Environment as $, AssetTag as A, type BankConfigCompactRaw as B, type BankIntegrationMetadataMap as C, type OrderType as D, EmodeTag as E, type BalanceType as F, type HealthCacheType as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, type EmodePair as J, type ActiveEmodePair as K, type ActionEmodeImpact as L, type MarginfiProgram as M, MarginRequirementType as N, type OrderTrigger as O, type PriceWithConfidence as P, EmodeImpactStatus as Q, RiskTier as R, type Amount as S, type TypedAmount as T, BankVaultType as U, type RateLimitWindowType as V, type WrappedI80F48 as W, type BankIntegrationMetadataMapDto as X, type BankIntegrationMetadataDto as Y, type BankIntegrationMetadata as Z, Bank as _, type BankConfigOptRaw as a, type Project0Config as a0, type MintData as a1, BankConfig as a2, EmodeSettings as a3, type RateLimitWindowRaw as a4, type BankMetadataRaw as a5, type RatePointRaw as a6, type InterestRateConfigCompactRaw as a7, type InterestRateConfigOptRaw as a8, type OracleConfigOptRaw as a9, AccountType as aA, type KaminoStates as aB, type BankMap as aC, type OraclePriceMap as aD, type MintDataMap as aE, type AmountType as aF, resolveAmount as aG, type EmodeConfigRaw as aa, type RatePoint as ab, type InterestRateConfigOpt as ac, type EmodeEntry as ad, type OracleConfigOpt as ae, type EmodeImpact as af, isWeightedPrice as ag, type GetAssetWeightParams as ah, getAssetWeight as ai, getLiabilityWeight as aj, computeMaxLeverage as ak, computeLoopingParams as al, type ComputeUsdValueParams as am, computeUsdValue as an, type ComputeLiabilityUsdValueParams as ao, computeLiabilityUsdValue as ap, type ComputeAssetUsdValueParams as aq, computeAssetUsdValue as ar, computeTvl as as, type OrderTriggerKind as at, type PriceWithConfidenceDto as au, MARGINFI_IDL as av, type Program as aw, type Wallet as ax, type BankMetadata as ay, type BankAddress as az, type BankType as b, BankConfigFlag as c, OperationalState as d, OracleSetup as e, EmodeEntryFlags as f, EmodeFlags as g, type OperationalStateRaw as h, type OracleSetupRaw as i, type RiskTierRaw as j, type BankConfigOpt as k, type InterestRateConfig as l, type BankConfigType as m, type BankConfigRaw as n, type EmodeSettingsType as o, type BankRateLimiterType as p, type BankRaw as q, type BankRateLimiterRaw as r, type EmodeSettingsRaw as s, type MarginfiIdlType as t, HealthCacheStatus as u, AccountFlags as v, type MarginfiAccountType as w, type OraclePrice as x, PriceBias as y, type OraclePriceDto as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0dotxyz/p0-ts-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0-alpha.0",
|
|
4
4
|
"packageManager": "pnpm@10.32.1",
|
|
5
5
|
"description": "TypeScript SDK for P0 Protocol - A Solana DeFi lending protocol",
|
|
6
6
|
"type": "module",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"@coral-xyz/anchor": "0.30.1",
|
|
84
84
|
"@coral-xyz/borsh": "0.30.1",
|
|
85
85
|
"@msgpack/msgpack": "^3.1.3",
|
|
86
|
+
"@noble/hashes": "^1.8.0",
|
|
86
87
|
"@solana/buffer-layout": "^4.0.1",
|
|
87
88
|
"@solana/buffer-layout-utils": "^0.3.0",
|
|
88
89
|
"@solana/web3.js": "1.98.4",
|