flash-sdk 10.10.6 → 10.100.1-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/CustodyAccount.d.ts +2 -2
- package/dist/MarketAccount.d.ts +2 -2
- package/dist/MarketAccount.js +1 -1
- package/dist/OraclePrice.d.ts +4 -2
- package/dist/OraclePrice.js +23 -4
- package/dist/OrderAccount.d.ts +1 -1
- package/dist/PerpetualsClient.d.ts +385 -4332
- package/dist/PerpetualsClient.js +6254 -4927
- package/dist/PoolAccount.d.ts +3 -0
- package/dist/PoolConfig.d.ts +9 -2
- package/dist/PoolConfig.js +67 -4
- package/dist/PoolConfig.json +88 -4035
- package/dist/PoolDataClient.js +12 -11
- package/dist/PositionAccount.d.ts +6 -3
- package/dist/TokenStakeAccount.d.ts +24 -4
- package/dist/TokenStakeAccount.js +44 -2
- package/dist/TokenVaultAccount.d.ts +1 -0
- package/dist/ViewHelper.d.ts +2 -1
- package/dist/ViewHelper.js +17 -20
- package/dist/backupOracle.d.ts +0 -1
- package/dist/backupOracle.js +26 -5
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +2 -1
- package/dist/idl/perpetuals.d.ts +29203 -11085
- package/dist/idl/perpetuals.js +0 -16293
- package/dist/idl/perpetuals.json +34411 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +7 -3
- package/dist/remoraTokensWithPriceIds.d.ts +13 -0
- package/dist/remoraTokensWithPriceIds.js +265 -0
- package/dist/testPublkey.d.ts +0 -0
- package/dist/testPublkey.js +0 -0
- package/dist/testSize.d.ts +0 -0
- package/dist/testSize.js +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/generated.d.ts +2556 -0
- package/dist/types/generated.js +2 -0
- package/dist/types/index.d.ts +52 -144
- package/dist/types/index.js +22 -4
- package/dist/utils/IdlCoder.d.ts +3 -2
- package/dist/utils/IdlCoder.js +4 -2
- package/dist/utils/anchorCpiEvents.d.ts +1 -2
- package/dist/utils/anchorCpiEvents.js +10 -6
- package/dist/utils/getReferralAccounts.d.ts +1 -1
- package/dist/utils/getReferralAccounts.js +3 -8
- package/dist/xstocksTokensWithPriceIds.d.ts +13 -0
- package/dist/xstocksTokensWithPriceIds.js +369 -0
- package/package.json +9 -5
- package/readme.md +37 -3
- package/dist/TradingAccount.d.ts +0 -24
- package/dist/TradingAccount.js +0 -17
- package/dist/idl/fbnft_rewards.d.ts +0 -290
- package/dist/idl/fbnft_rewards.js +0 -292
- package/dist/idl/perp_composability.d.ts +0 -760
- package/dist/idl/perp_composability.js +0 -762
- package/dist/idl/reward_distribution.d.ts +0 -347
- package/dist/idl/reward_distribution.js +0 -349
package/dist/CustodyAccount.d.ts
CHANGED
|
@@ -10,13 +10,13 @@ export declare class CustodyAccount implements Custody {
|
|
|
10
10
|
isStable: boolean;
|
|
11
11
|
depegAdjustment: boolean;
|
|
12
12
|
isVirtual: boolean;
|
|
13
|
-
|
|
13
|
+
inversePrice: boolean;
|
|
14
14
|
oracle: OracleParams;
|
|
15
15
|
pricing: PricingParams;
|
|
16
16
|
permissions: Permissions;
|
|
17
17
|
fees: Fees;
|
|
18
18
|
borrowRate: BorrowRateParams;
|
|
19
|
-
|
|
19
|
+
tokenAmountMultiplier: BN;
|
|
20
20
|
assets: Assets;
|
|
21
21
|
feesStats: FeesStats;
|
|
22
22
|
borrowRateState: BorrowRateState;
|
package/dist/MarketAccount.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
|
-
import { Market, MarketPermissions, PositionStats
|
|
2
|
+
import { Market, MarketPermissions, PositionStats } from "./types";
|
|
3
3
|
import BN from "bn.js";
|
|
4
4
|
import { PositionAccount } from "./PositionAccount";
|
|
5
5
|
export declare class MarketAccount implements Market {
|
|
@@ -7,7 +7,7 @@ export declare class MarketAccount implements Market {
|
|
|
7
7
|
pool: PublicKey;
|
|
8
8
|
targetCustody: PublicKey;
|
|
9
9
|
collateralCustody: PublicKey;
|
|
10
|
-
side:
|
|
10
|
+
side: Market["side"];
|
|
11
11
|
correlation: boolean;
|
|
12
12
|
maxPayoffBps: BN;
|
|
13
13
|
permissions: MarketPermissions;
|
package/dist/MarketAccount.js
CHANGED
|
@@ -29,7 +29,7 @@ var MarketAccount = (function () {
|
|
|
29
29
|
};
|
|
30
30
|
MarketAccount.prototype.getCollectivePosition = function () {
|
|
31
31
|
if (this.collectivePosition.openPositions.gt(constants_1.BN_ZERO)) {
|
|
32
|
-
var obj = __assign({ entryPrice: this.collectivePosition.averageEntryPrice, sizeAmount: this.collectivePosition.sizeAmount, sizeUsd: this.collectivePosition.sizeUsd, collateralAmount: this.collectivePosition.collateralAmount, collateralUsd: this.collectivePosition.
|
|
32
|
+
var obj = __assign({ entryPrice: this.collectivePosition.averageEntryPrice, sizeAmount: this.collectivePosition.sizeAmount, sizeUsd: this.collectivePosition.sizeUsd, collateralAmount: this.collectivePosition.collateralAmount, collateralUsd: this.collectivePosition.collateralLiabilityUsd, lockedAmount: this.collectivePosition.lockedAmount, lockedUsd: this.collectivePosition.lockedUsd, unsettledFeesUsd: this.collectivePosition.unsettledFeeUsd, cumulativeLockFeeSnapshot: this.collectivePosition.cumulativeLockFeeSnapshot }, types_1.DEFAULT_POSITION);
|
|
33
33
|
return new PositionAccount_1.PositionAccount(web3_js_1.PublicKey.default, obj);
|
|
34
34
|
}
|
|
35
35
|
else {
|
package/dist/OraclePrice.d.ts
CHANGED
|
@@ -22,7 +22,9 @@ export declare class OraclePrice {
|
|
|
22
22
|
cmp(other: OraclePrice): -1 | 0 | 1;
|
|
23
23
|
getDivergenceFactor(other: OraclePrice): BN;
|
|
24
24
|
scale_to_exponent(target_exponent: BN): OraclePrice;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
private applyRateMultiplier;
|
|
26
|
+
withMultiplier(multiplier: BN): OraclePrice;
|
|
27
|
+
getTokenAmount(asset_amount_usd: BN, token_decimals: number, multiplier?: BN): BN;
|
|
28
|
+
getAssetAmountUsd(token_amount: BN, token_decimals: number, multiplier?: BN): BN;
|
|
27
29
|
toUiPrice(precision: number): string;
|
|
28
30
|
}
|
package/dist/OraclePrice.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.OraclePrice = void 0;
|
|
|
4
4
|
var anchor_1 = require("@coral-xyz/anchor");
|
|
5
5
|
var constants_1 = require("./constants");
|
|
6
6
|
var utils_1 = require("./utils");
|
|
7
|
+
var NEG_RATE_EXPONENT = new anchor_1.BN(-1 * constants_1.RATE_DECIMALS);
|
|
7
8
|
var OraclePrice = (function () {
|
|
8
9
|
function OraclePrice(parseData) {
|
|
9
10
|
Object.assign(this, parseData);
|
|
@@ -86,17 +87,35 @@ var OraclePrice = (function () {
|
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
OraclePrice.prototype.
|
|
90
|
+
OraclePrice.prototype.applyRateMultiplier = function (multiplier) {
|
|
91
|
+
if (multiplier.isZero()) {
|
|
92
|
+
return this.price;
|
|
93
|
+
}
|
|
94
|
+
return (0, utils_1.checkedDecimalMul)(this.price, this.exponent, multiplier, NEG_RATE_EXPONENT, this.exponent);
|
|
95
|
+
};
|
|
96
|
+
OraclePrice.prototype.withMultiplier = function (multiplier) {
|
|
97
|
+
return new OraclePrice({
|
|
98
|
+
price: this.applyRateMultiplier(multiplier),
|
|
99
|
+
exponent: this.exponent,
|
|
100
|
+
confidence: this.confidence,
|
|
101
|
+
timestamp: this.timestamp,
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
OraclePrice.prototype.getTokenAmount = function (asset_amount_usd, token_decimals, multiplier) {
|
|
105
|
+
if (multiplier === void 0) { multiplier = constants_1.BN_ZERO; }
|
|
90
106
|
if (asset_amount_usd.isZero() || this.price.isZero()) {
|
|
91
107
|
return constants_1.BN_ZERO;
|
|
92
108
|
}
|
|
93
|
-
|
|
109
|
+
var effectivePrice = this.applyRateMultiplier(multiplier);
|
|
110
|
+
return (0, utils_1.checkedDecimalDiv)(asset_amount_usd, new anchor_1.BN(-1 * constants_1.USD_DECIMALS), effectivePrice, this.exponent, new anchor_1.BN(-1 * token_decimals));
|
|
94
111
|
};
|
|
95
|
-
OraclePrice.prototype.getAssetAmountUsd = function (token_amount, token_decimals) {
|
|
112
|
+
OraclePrice.prototype.getAssetAmountUsd = function (token_amount, token_decimals, multiplier) {
|
|
113
|
+
if (multiplier === void 0) { multiplier = constants_1.BN_ZERO; }
|
|
96
114
|
if (token_amount.isZero() || this.price.isZero()) {
|
|
97
115
|
return constants_1.BN_ZERO;
|
|
98
116
|
}
|
|
99
|
-
|
|
117
|
+
var effectivePrice = this.applyRateMultiplier(multiplier);
|
|
118
|
+
return (0, utils_1.checkedDecimalMul)(token_amount, new anchor_1.BN(-1 * token_decimals), effectivePrice, this.exponent, new anchor_1.BN(-1 * constants_1.USD_DECIMALS));
|
|
100
119
|
};
|
|
101
120
|
OraclePrice.prototype.toUiPrice = function (precision) {
|
|
102
121
|
return (0, utils_1.nativeToUiDecimals)(this.price, this.exponent.toNumber() * -1, precision);
|
package/dist/OrderAccount.d.ts
CHANGED