flash-sdk 11.3.5 → 11.3.6-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 { ContractOraclePrice } from "./types";
4
3
  export declare class OraclePrice {
@@ -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 { LimitOrder, Order, TriggerOrder } from "./types";
@@ -1,5 +1,3 @@
1
- /// <reference types="bn.js" />
2
- /// <reference types="node" />
3
1
  import { Program, AnchorProvider, BN } from "@coral-xyz/anchor";
4
2
  import { PublicKey, TransactionInstruction, Commitment, Signer, AddressLookupTableAccount, VersionedTransaction } from "@solana/web3.js";
5
3
  import { PoolAccount } from "./PoolAccount";
@@ -8,9 +6,6 @@ import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAnd
8
6
  import { OraclePrice } from "./OraclePrice";
9
7
  import { CustodyAccount } from "./CustodyAccount";
10
8
  import { Perpetuals } from "./idl/perpetuals";
11
- import { PerpComposability } from "./idl/perp_composability";
12
- import { FbnftRewards } from "./idl/fbnft_rewards";
13
- import { RewardDistribution } from "./idl/reward_distribution";
14
9
  import { SendTransactionOpts } from "./utils/rpc";
15
10
  import { MarketConfig, PoolConfig, Token } from "./PoolConfig";
16
11
  import { MarketAccount } from "./MarketAccount";
@@ -24,12 +19,8 @@ export type PerpClientOptions = {
24
19
  export declare class PerpetualsClient {
25
20
  provider: AnchorProvider;
26
21
  program: Program<Perpetuals>;
27
- programPerpComposability: Program<PerpComposability>;
28
- programFbnftReward: Program<FbnftRewards>;
29
- programRewardDistribution: Program<RewardDistribution>;
30
22
  admin: PublicKey;
31
23
  programId: PublicKey;
32
- composabilityProgramId: PublicKey;
33
24
  multisig: {
34
25
  publicKey: PublicKey;
35
26
  bump: number;
@@ -50,10 +41,6 @@ export declare class PerpetualsClient {
50
41
  publicKey: PublicKey;
51
42
  bump: number;
52
43
  };
53
- eventAuthorityRewardDistribution: {
54
- publicKey: PublicKey;
55
- bump: number;
56
- };
57
44
  prioritizationFee: number;
58
45
  minimumBalanceForRentExemptAccountLamports: number;
59
46
  private postSendTxCallback?;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ 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);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -69,9 +69,6 @@ var PositionAccount_1 = require("./PositionAccount");
69
69
  var types_1 = require("./types");
70
70
  var OraclePrice_1 = require("./OraclePrice");
71
71
  var perpetuals_1 = require("./idl/perpetuals");
72
- var perp_composability_1 = require("./idl/perp_composability");
73
- var fbnft_rewards_1 = require("./idl/fbnft_rewards");
74
- var reward_distribution_1 = require("./idl/reward_distribution");
75
72
  var rpc_1 = require("./utils/rpc");
76
73
  var utils_1 = require("./utils");
77
74
  var constants_1 = require("./constants");
@@ -7143,8 +7140,6 @@ var PerpetualsClient = (function () {
7143
7140
  perpetuals: this.perpetuals.publicKey,
7144
7141
  tokenVault: poolConfig.tokenVault,
7145
7142
  pool: poolConfig.poolAddress,
7146
- custody: custodyConfig.custodyAccount,
7147
- custodyTokenAccount: custodyConfig.tokenAccount,
7148
7143
  revenueTokenAccount: poolConfig.revenueTokenAccount,
7149
7144
  protocolVault: poolConfig.protocolVault,
7150
7145
  protocolTokenAccount: poolConfig.protocolTokenAccount,
@@ -8164,17 +8159,12 @@ var PerpetualsClient = (function () {
8164
8159
  this.provider = provider;
8165
8160
  (0, anchor_1.setProvider)(provider);
8166
8161
  this.program = new anchor_1.Program(perpetuals_1.IDL, programId);
8167
- this.programPerpComposability = new anchor_1.Program(perp_composability_1.IDL, composabilityProgramId);
8168
- this.programFbnftReward = new anchor_1.Program(fbnft_rewards_1.IDL, fbNftRewardProgramId);
8169
- this.programRewardDistribution = new anchor_1.Program(reward_distribution_1.IDL, rewardDistributionProgramId);
8170
8162
  this.programId = programId;
8171
- this.composabilityProgramId = composabilityProgramId;
8172
8163
  this.admin = this.provider.wallet.publicKey;
8173
8164
  this.multisig = this.findProgramAddress("multisig");
8174
8165
  this.authority = this.findProgramAddress("transfer_authority");
8175
8166
  this.perpetuals = this.findProgramAddress("perpetuals");
8176
8167
  this.eventAuthority = this.findProgramAddress("__event_authority");
8177
- this.eventAuthorityRewardDistribution = this.findProgramAddressFromProgramId("__event_authority", null, this.programRewardDistribution.programId);
8178
8168
  this.minimumBalanceForRentExemptAccountLamports = 2039280;
8179
8169
  this.prioritizationFee = (opts === null || opts === void 0 ? void 0 : opts.prioritizationFee) || 0;
8180
8170
  this.useExtOracleAccount = useExtOracleAccount;
@@ -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";
@@ -2909,6 +2909,19 @@
2909
2909
  "pythTicker": "Commodities.WTIG6/USD",
2910
2910
  "pythPriceId": "0x7e91242dfd2cea64715b26edaa3e51bafc712a56ac4228a77bd53b51fd66db52",
2911
2911
  "isToken2022": false
2912
+ },
2913
+ {
2914
+ "symbol": "XAUt",
2915
+ "mintKey": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H",
2916
+ "decimals": 6,
2917
+ "usdPrecision": 4,
2918
+ "tokenPrecision": 4,
2919
+ "isStable": false,
2920
+ "isVirtual": false,
2921
+ "lazerId": 172,
2922
+ "pythTicker": "Crypto.XAUT/USD",
2923
+ "pythPriceId": "0x44465e17d2e9d390e70c999d5a11fda4f092847fcd2e3e5aa089d96c98a30e67",
2924
+ "isToken2022": false
2912
2925
  }
2913
2926
  ],
2914
2927
  "custodies": [
@@ -3013,25 +3026,26 @@
3013
3026
  "lazerId": 2691,
3014
3027
  "pythTicker": "Commodities.WTIG6/USD",
3015
3028
  "pythPriceId": "0x7e91242dfd2cea64715b26edaa3e51bafc712a56ac4228a77bd53b51fd66db52"
3029
+ },
3030
+ {
3031
+ "custodyId": 7,
3032
+ "custodyAccount": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
3033
+ "tokenAccount": "DpnfaMR5kJhVyy5SGk6yB1JHXYuqJhsm53wdewd8gNd1",
3034
+ "symbol": "XAUt",
3035
+ "mintKey": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H",
3036
+ "decimals": 6,
3037
+ "usdPrecision": 4,
3038
+ "tokenPrecision": 4,
3039
+ "isStable": false,
3040
+ "isVirtual": false,
3041
+ "intOracleAddress": "6fCDXgCYMnY29RENXKE2yGxvtMVUCMU59kkmS212MjMc",
3042
+ "extOracleAddress": "2uPQGpm8X4ZkxMHxrAW1QuhXcse1AHEgPih6Xp9NuEWW",
3043
+ "lazerId": 172,
3044
+ "pythTicker": "Crypto.XAUT/USD",
3045
+ "pythPriceId": "0x44465e17d2e9d390e70c999d5a11fda4f092847fcd2e3e5aa089d96c98a30e67"
3016
3046
  }
3017
3047
  ],
3018
3048
  "markets": [
3019
- {
3020
- "marketId": 0,
3021
- "marketAccount": "6VaKMhU9mtWUVXSj73VMj5RAXfLiE7mRn1myyWEwBC6S",
3022
- "marketCorrelation": false,
3023
- "pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
3024
- "targetCustody": "EXumu4qqjXYpv1RUzTGiVJAvjvL3BWzn592SSwxrtZwW",
3025
- "collateralCustody": "4nkiPSMJb4hpLhpaXbebkYF73Ub5vjeked8mWkPafMBm",
3026
- "side": "long",
3027
- "maxLev": 100,
3028
- "degenMinLev": 1,
3029
- "degenMaxLev": 100,
3030
- "targetCustodyId": 1,
3031
- "collateralCustodyId": 0,
3032
- "targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
3033
- "collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
3034
- },
3035
3049
  {
3036
3050
  "marketId": 1,
3037
3051
  "marketAccount": "HH56JHJojhexo4eAE6dCC8XAKKoHiUzEg5fkFRmVGh2S",
@@ -3175,6 +3189,22 @@
3175
3189
  "collateralCustodyId": 0,
3176
3190
  "targetMint": "oi1DkCGa5CVm379ZuznLMevqjg7KGWnDDFB96JXAi7a",
3177
3191
  "collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
3192
+ },
3193
+ {
3194
+ "marketId": 12,
3195
+ "marketAccount": "HCHwtnbLgZPPkYqrbXF1oF688dxHW6cbhfU7yFLgfCpY",
3196
+ "marketCorrelation": true,
3197
+ "pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
3198
+ "targetCustody": "EXumu4qqjXYpv1RUzTGiVJAvjvL3BWzn592SSwxrtZwW",
3199
+ "collateralCustody": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
3200
+ "side": "long",
3201
+ "maxLev": 50,
3202
+ "degenMinLev": 1,
3203
+ "degenMaxLev": 50,
3204
+ "targetCustodyId": 6,
3205
+ "collateralCustodyId": 0,
3206
+ "targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
3207
+ "collateralMint": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H"
3178
3208
  }
3179
3209
  ]
3180
3210
  },
@@ -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";
@@ -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";
@@ -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 = void 0;
43
+ exports.getBackupOracleInstruction = exports.getPythnetOraclePrices = exports.pythPriceServiceConnection = 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;