@0dotxyz/p0-ts-sdk 2.8.4 → 2.9.0-alpha.1
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 +357 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +270 -17
- package/dist/index.d.ts +270 -17
- package/dist/index.js +341 -17
- 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-Bah-JjSM.d.cts → types-B5hbKbQJ.d.cts} +47 -2
- package/dist/{types-BsUi_Zrx.d.ts → types-C3ArshQA.d.ts} +47 -2
- 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;
|
|
@@ -20745,18 +20750,41 @@ interface MarginfiAccountType {
|
|
|
20745
20750
|
accountFlags: AccountFlags[];
|
|
20746
20751
|
emissionsDestinationAccount: PublicKey;
|
|
20747
20752
|
healthCache: HealthCacheType;
|
|
20753
|
+
/** Orders that point at this account, including orphaned ones. Transfer requires 0. */
|
|
20754
|
+
activeOrders: number;
|
|
20748
20755
|
}
|
|
20749
20756
|
declare enum AccountFlags {
|
|
20750
20757
|
ACCOUNT_DISABLED = 1,// 1
|
|
20751
20758
|
ACCOUNT_IN_FLASHLOAN = 2,// 2
|
|
20752
20759
|
ACCOUNT_FLAG_DEPRECATED = 4,// 4
|
|
20753
|
-
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8
|
|
20760
|
+
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8,// 8
|
|
20761
|
+
ACCOUNT_IN_RECEIVERSHIP = 16,// 16
|
|
20762
|
+
ACCOUNT_IN_DELEVERAGE = 32,// 32
|
|
20763
|
+
ACCOUNT_FROZEN = 64,// 64
|
|
20764
|
+
ACCOUNT_IN_ORDER_EXECUTION = 128
|
|
20754
20765
|
}
|
|
20755
20766
|
declare enum MarginRequirementType {
|
|
20756
20767
|
Initial = 0,
|
|
20757
20768
|
Maintenance = 1,
|
|
20758
20769
|
Equity = 2
|
|
20759
20770
|
}
|
|
20771
|
+
type OrderTriggerKind = "stopLoss" | "takeProfit" | "both";
|
|
20772
|
+
interface OrderType {
|
|
20773
|
+
address: PublicKey;
|
|
20774
|
+
marginfiAccount: PublicKey;
|
|
20775
|
+
/** Which trigger(s) this order fires on. */
|
|
20776
|
+
trigger: OrderTriggerKind;
|
|
20777
|
+
/** Pair net-equity stop-loss threshold in USD, null when the order has no stop-loss leg. */
|
|
20778
|
+
stopLoss: BigNumber$1 | null;
|
|
20779
|
+
/** Pair net-equity take-profit threshold in USD, null when the order has no take-profit leg. */
|
|
20780
|
+
takeProfit: BigNumber$1 | null;
|
|
20781
|
+
/** Tags linking this order to its two balances (see {@link BalanceType.tag}). */
|
|
20782
|
+
tags: [number, number];
|
|
20783
|
+
/** Unix timestamp (seconds) when the order was created. */
|
|
20784
|
+
createdAt: number;
|
|
20785
|
+
/** Max slippage the keeper may impose on execution, in percent. */
|
|
20786
|
+
maxSlippagePercent: number;
|
|
20787
|
+
}
|
|
20760
20788
|
|
|
20761
20789
|
interface PriceWithConfidence {
|
|
20762
20790
|
price: BigNumber$1;
|
|
@@ -21328,6 +21356,23 @@ type MintDataMap = Map<string, MintData>;
|
|
|
21328
21356
|
interface WrappedI80F48 {
|
|
21329
21357
|
value: number[];
|
|
21330
21358
|
}
|
|
21359
|
+
type OrderTrigger = {
|
|
21360
|
+
stopLoss: {
|
|
21361
|
+
threshold: WrappedI80F48;
|
|
21362
|
+
maxSlippage: number;
|
|
21363
|
+
};
|
|
21364
|
+
} | {
|
|
21365
|
+
takeProfit: {
|
|
21366
|
+
threshold: WrappedI80F48;
|
|
21367
|
+
maxSlippage: number;
|
|
21368
|
+
};
|
|
21369
|
+
} | {
|
|
21370
|
+
both: {
|
|
21371
|
+
stopLoss: WrappedI80F48;
|
|
21372
|
+
takeProfit: WrappedI80F48;
|
|
21373
|
+
maxSlippage: number;
|
|
21374
|
+
};
|
|
21375
|
+
};
|
|
21331
21376
|
type Amount = BigNumber | number | string;
|
|
21332
21377
|
type AmountType = "uiToken" | "cToken";
|
|
21333
21378
|
type TypedAmount = {
|
|
@@ -21339,4 +21384,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
21339
21384
|
type: AmountType;
|
|
21340
21385
|
};
|
|
21341
21386
|
|
|
21342
|
-
export { type
|
|
21387
|
+
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;
|
|
@@ -20745,18 +20750,41 @@ interface MarginfiAccountType {
|
|
|
20745
20750
|
accountFlags: AccountFlags[];
|
|
20746
20751
|
emissionsDestinationAccount: PublicKey;
|
|
20747
20752
|
healthCache: HealthCacheType;
|
|
20753
|
+
/** Orders that point at this account, including orphaned ones. Transfer requires 0. */
|
|
20754
|
+
activeOrders: number;
|
|
20748
20755
|
}
|
|
20749
20756
|
declare enum AccountFlags {
|
|
20750
20757
|
ACCOUNT_DISABLED = 1,// 1
|
|
20751
20758
|
ACCOUNT_IN_FLASHLOAN = 2,// 2
|
|
20752
20759
|
ACCOUNT_FLAG_DEPRECATED = 4,// 4
|
|
20753
|
-
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8
|
|
20760
|
+
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8,// 8
|
|
20761
|
+
ACCOUNT_IN_RECEIVERSHIP = 16,// 16
|
|
20762
|
+
ACCOUNT_IN_DELEVERAGE = 32,// 32
|
|
20763
|
+
ACCOUNT_FROZEN = 64,// 64
|
|
20764
|
+
ACCOUNT_IN_ORDER_EXECUTION = 128
|
|
20754
20765
|
}
|
|
20755
20766
|
declare enum MarginRequirementType {
|
|
20756
20767
|
Initial = 0,
|
|
20757
20768
|
Maintenance = 1,
|
|
20758
20769
|
Equity = 2
|
|
20759
20770
|
}
|
|
20771
|
+
type OrderTriggerKind = "stopLoss" | "takeProfit" | "both";
|
|
20772
|
+
interface OrderType {
|
|
20773
|
+
address: PublicKey;
|
|
20774
|
+
marginfiAccount: PublicKey;
|
|
20775
|
+
/** Which trigger(s) this order fires on. */
|
|
20776
|
+
trigger: OrderTriggerKind;
|
|
20777
|
+
/** Pair net-equity stop-loss threshold in USD, null when the order has no stop-loss leg. */
|
|
20778
|
+
stopLoss: BigNumber$1 | null;
|
|
20779
|
+
/** Pair net-equity take-profit threshold in USD, null when the order has no take-profit leg. */
|
|
20780
|
+
takeProfit: BigNumber$1 | null;
|
|
20781
|
+
/** Tags linking this order to its two balances (see {@link BalanceType.tag}). */
|
|
20782
|
+
tags: [number, number];
|
|
20783
|
+
/** Unix timestamp (seconds) when the order was created. */
|
|
20784
|
+
createdAt: number;
|
|
20785
|
+
/** Max slippage the keeper may impose on execution, in percent. */
|
|
20786
|
+
maxSlippagePercent: number;
|
|
20787
|
+
}
|
|
20760
20788
|
|
|
20761
20789
|
interface PriceWithConfidence {
|
|
20762
20790
|
price: BigNumber$1;
|
|
@@ -21328,6 +21356,23 @@ type MintDataMap = Map<string, MintData>;
|
|
|
21328
21356
|
interface WrappedI80F48 {
|
|
21329
21357
|
value: number[];
|
|
21330
21358
|
}
|
|
21359
|
+
type OrderTrigger = {
|
|
21360
|
+
stopLoss: {
|
|
21361
|
+
threshold: WrappedI80F48;
|
|
21362
|
+
maxSlippage: number;
|
|
21363
|
+
};
|
|
21364
|
+
} | {
|
|
21365
|
+
takeProfit: {
|
|
21366
|
+
threshold: WrappedI80F48;
|
|
21367
|
+
maxSlippage: number;
|
|
21368
|
+
};
|
|
21369
|
+
} | {
|
|
21370
|
+
both: {
|
|
21371
|
+
stopLoss: WrappedI80F48;
|
|
21372
|
+
takeProfit: WrappedI80F48;
|
|
21373
|
+
maxSlippage: number;
|
|
21374
|
+
};
|
|
21375
|
+
};
|
|
21331
21376
|
type Amount = BigNumber | number | string;
|
|
21332
21377
|
type AmountType = "uiToken" | "cToken";
|
|
21333
21378
|
type TypedAmount = {
|
|
@@ -21339,4 +21384,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
21339
21384
|
type: AmountType;
|
|
21340
21385
|
};
|
|
21341
21386
|
|
|
21342
|
-
export { type
|
|
21387
|
+
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.1",
|
|
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",
|