flash-sdk 3.1.10 → 3.2.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.
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from "@coral-xyz/anchor";
3
2
  import { Pool, TokenRatios, StakeStats, CompoundingStats, Permissions } from "./types";
4
3
  import { PublicKey } from "@solana/web3.js";
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from "@coral-xyz/anchor";
3
2
  import { Mint } from "@solana/spl-token";
4
3
  import { CustodyAccount } from "./CustodyAccount";
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from "@coral-xyz/anchor";
3
2
  import { PublicKey } from "@solana/web3.js";
4
3
  import { ContractOraclePrice, Position } from "./types";
@@ -19,8 +18,8 @@ export declare class PositionAccount implements Position {
19
18
  unsettledAmount: BN;
20
19
  unsettledFeesUsd: BN;
21
20
  cumulativeLockFeeSnapshot: BN;
22
- takeProfitPrice: ContractOraclePrice;
23
- stopLossPrice: ContractOraclePrice;
21
+ degenSizeUsd: BN;
22
+ buffer: BN;
24
23
  sizeDecimals: number;
25
24
  lockedDecimals: number;
26
25
  collateralDecimals: number;
@@ -29,4 +28,5 @@ export declare class PositionAccount implements Position {
29
28
  static from(publicKey: PublicKey, parseData: Position): PositionAccount;
30
29
  clone(): PositionAccount;
31
30
  updatePositionData(position: Position): void;
31
+ isDegenMode(): boolean;
32
32
  }
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.PositionAccount = void 0;
15
+ var anchor_1 = require("@coral-xyz/anchor");
15
16
  var PositionAccount = (function () {
16
17
  function PositionAccount(publicKey, parseData) {
17
18
  this.publicKey = publicKey;
@@ -26,6 +27,9 @@ var PositionAccount = (function () {
26
27
  PositionAccount.prototype.updatePositionData = function (position) {
27
28
  Object.assign(this, __assign({}, position));
28
29
  };
30
+ PositionAccount.prototype.isDegenMode = function () {
31
+ return this.degenSizeUsd.gt(new anchor_1.BN(0));
32
+ };
29
33
  return PositionAccount;
30
34
  }());
31
35
  exports.PositionAccount = PositionAccount;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { TokenStake, WithdrawStakeLog } from "./types";
3
2
  import { BN } from "@coral-xyz/anchor";
4
3
  import { PublicKey } from "@solana/web3.js";
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from "@coral-xyz/anchor";
3
2
  import { PublicKey } from "@solana/web3.js";
4
3
  import { TokenVault } from "./types";
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from "@coral-xyz/anchor";
3
2
  import { Trading, VoltageStats } from "./types";
4
3
  import { PublicKey } from "@solana/web3.js";
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -40,7 +40,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  var _a;
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.createBackupOracleInstruction = exports.getBackupOracleInstruction = exports.getPythnetOraclePrices = exports.pythPriceServiceConnection = exports.API_ENDPOINT = void 0;
43
+ exports.getBackupOracleInstruction = exports.getPythnetOraclePrices = exports.pythPriceServiceConnection = exports.API_ENDPOINT = void 0;
44
+ exports.createBackupOracleInstruction = createBackupOracleInstruction;
44
45
  var price_service_client_1 = require("@pythnetwork/price-service-client");
45
46
  var web3_js_1 = require("@solana/web3.js");
46
47
  var bn_js_1 = __importDefault(require("bn.js"));
@@ -156,4 +157,3 @@ function createBackupOracleInstruction(poolAddress_1) {
156
157
  });
157
158
  });
158
159
  }
159
- exports.createBackupOracleInstruction = createBackupOracleInstruction;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { PublicKey } from '@solana/web3.js';
3
2
  export declare const PERCENTAGE_DECIMALS = 4;
4
3
  export declare const USD_DECIMALS = 6;