@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.
@@ -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 MintData as $, AssetTag as A, type BankConfigCompactRaw as B, type BalanceType as C, type HealthCacheType as D, EmodeTag as E, type EmodePair as F, type ActiveEmodePair as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, type ActionEmodeImpact as J, MarginRequirementType as K, EmodeImpactStatus as L, type MarginfiProgram as M, type Amount as N, OperationalState as O, type PriceWithConfidence as P, BankVaultType as Q, RiskTier as R, type RateLimitWindowType as S, type TypedAmount as T, type BankIntegrationMetadataMapDto as U, type BankIntegrationMetadataDto as V, type WrappedI80F48 as W, type BankIntegrationMetadata as X, Bank as Y, type Environment as Z, type Project0Config as _, type BankConfigOptRaw as a, BankConfig as a0, EmodeSettings as a1, type RateLimitWindowRaw as a2, type BankMetadataRaw as a3, type RatePointRaw as a4, type InterestRateConfigCompactRaw as a5, type InterestRateConfigOptRaw as a6, type OracleConfigOptRaw as a7, type EmodeConfigRaw as a8, type RatePoint as a9, type OraclePriceMap as aA, type MintDataMap as aB, type AmountType as aC, resolveAmount as aD, type InterestRateConfigOpt as aa, type EmodeEntry as ab, type OracleConfigOpt as ac, type EmodeImpact as ad, isWeightedPrice as ae, type GetAssetWeightParams as af, getAssetWeight as ag, getLiabilityWeight as ah, computeMaxLeverage as ai, computeLoopingParams as aj, type ComputeUsdValueParams as ak, computeUsdValue as al, type ComputeLiabilityUsdValueParams as am, computeLiabilityUsdValue as an, type ComputeAssetUsdValueParams as ao, computeAssetUsdValue as ap, computeTvl as aq, type PriceWithConfidenceDto as ar, MARGINFI_IDL as as, type Program as at, type Wallet as au, type BankMetadata as av, type BankAddress as aw, AccountType as ax, type KaminoStates as ay, type BankMap as az, type BankType as b, BankConfigFlag as c, OracleSetup as d, EmodeEntryFlags as e, EmodeFlags as f, type OperationalStateRaw as g, type OracleSetupRaw as h, type RiskTierRaw as i, type BankConfigOpt as j, type InterestRateConfig as k, type BankConfigType as l, type BankConfigRaw as m, type EmodeSettingsType as n, type BankRateLimiterType as o, type BankRaw as p, type BankRateLimiterRaw as q, type EmodeSettingsRaw as r, type MarginfiIdlType as s, HealthCacheStatus as t, AccountFlags as u, type MarginfiAccountType as v, type OraclePrice as w, PriceBias as x, type OraclePriceDto as y, type BankIntegrationMetadataMap as z };
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 MintData as $, AssetTag as A, type BankConfigCompactRaw as B, type BalanceType as C, type HealthCacheType as D, EmodeTag as E, type EmodePair as F, type ActiveEmodePair as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, type ActionEmodeImpact as J, MarginRequirementType as K, EmodeImpactStatus as L, type MarginfiProgram as M, type Amount as N, OperationalState as O, type PriceWithConfidence as P, BankVaultType as Q, RiskTier as R, type RateLimitWindowType as S, type TypedAmount as T, type BankIntegrationMetadataMapDto as U, type BankIntegrationMetadataDto as V, type WrappedI80F48 as W, type BankIntegrationMetadata as X, Bank as Y, type Environment as Z, type Project0Config as _, type BankConfigOptRaw as a, BankConfig as a0, EmodeSettings as a1, type RateLimitWindowRaw as a2, type BankMetadataRaw as a3, type RatePointRaw as a4, type InterestRateConfigCompactRaw as a5, type InterestRateConfigOptRaw as a6, type OracleConfigOptRaw as a7, type EmodeConfigRaw as a8, type RatePoint as a9, type OraclePriceMap as aA, type MintDataMap as aB, type AmountType as aC, resolveAmount as aD, type InterestRateConfigOpt as aa, type EmodeEntry as ab, type OracleConfigOpt as ac, type EmodeImpact as ad, isWeightedPrice as ae, type GetAssetWeightParams as af, getAssetWeight as ag, getLiabilityWeight as ah, computeMaxLeverage as ai, computeLoopingParams as aj, type ComputeUsdValueParams as ak, computeUsdValue as al, type ComputeLiabilityUsdValueParams as am, computeLiabilityUsdValue as an, type ComputeAssetUsdValueParams as ao, computeAssetUsdValue as ap, computeTvl as aq, type PriceWithConfidenceDto as ar, MARGINFI_IDL as as, type Program as at, type Wallet as au, type BankMetadata as av, type BankAddress as aw, AccountType as ax, type KaminoStates as ay, type BankMap as az, type BankType as b, BankConfigFlag as c, OracleSetup as d, EmodeEntryFlags as e, EmodeFlags as f, type OperationalStateRaw as g, type OracleSetupRaw as h, type RiskTierRaw as i, type BankConfigOpt as j, type InterestRateConfig as k, type BankConfigType as l, type BankConfigRaw as m, type EmodeSettingsType as n, type BankRateLimiterType as o, type BankRaw as p, type BankRateLimiterRaw as q, type EmodeSettingsRaw as r, type MarginfiIdlType as s, HealthCacheStatus as t, AccountFlags as u, type MarginfiAccountType as v, type OraclePrice as w, PriceBias as x, type OraclePriceDto as y, type BankIntegrationMetadataMap as z };
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.8.4",
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",