flash-sdk 15.12.1 → 15.12.3-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.
@@ -34,6 +34,7 @@ export interface MarketConfig {
34
34
  collateralCustodyId: number;
35
35
  targetMint: PublicKey;
36
36
  collateralMint: PublicKey;
37
+ marketNameUi?: string;
37
38
  }
38
39
  export type Token = {
39
40
  symbol: string;
@@ -91,13 +92,14 @@ export declare class PoolConfig {
91
92
  custodiesDeprecated: CustodyConfig[];
92
93
  markets: MarketConfig[];
93
94
  marketsDeprecated: MarketConfig[];
95
+ isMagicBlock: boolean;
94
96
  constructor(programId: PublicKey, perpComposibilityProgramId: PublicKey, fbNftRewardProgramId: PublicKey, cluster: Cluster, poolName: string, isDeprecated: boolean, poolAddress: PublicKey, stakedLpTokenMint: PublicKey, compoundingTokenMint: PublicKey, stakedLpVault: PublicKey, compoundingLpVault: PublicKey, lpDecimals: number, compoundingLpTokenSymbol: string, stakedLpTokenSymbol: string, perpetuals: PublicKey, transferAuthority: PublicKey, tokenMint: PublicKey, tokenVault: PublicKey, tokenVaultTokenAccount: PublicKey, rebateVault: PublicKey, rebateTokenAccount: PublicKey, revenueTokenAccount: PublicKey, protocolVault: PublicKey, protocolTokenAccount: PublicKey, multisig: PublicKey, addressLookupTableAddresses: PublicKey[], pusherAddressLookupTableAddress: PublicKey, backupOracle: PublicKey, nftCollectionAddress: PublicKey, rewardDistributionProgram: {
95
97
  programId: PublicKey;
96
98
  transferAuthority: PublicKey;
97
99
  rewardVault: PublicKey;
98
100
  rewardMint: PublicKey;
99
101
  rewardTokenAccount: PublicKey;
100
- }, tokens: Token[], tokensDeprecated: Token[], custodies: CustodyConfig[], custodiesDeprecated: CustodyConfig[], markets: MarketConfig[], marketsDeprecated: MarketConfig[]);
102
+ }, tokens: Token[], tokensDeprecated: Token[], custodies: CustodyConfig[], custodiesDeprecated: CustodyConfig[], markets: MarketConfig[], marketsDeprecated: MarketConfig[], isMagicBlock?: boolean);
101
103
  getAllTokenMints(): PublicKey[];
102
104
  getMarketConfigByPk(marketAccountPk: PublicKey): MarketConfig;
103
105
  getMarketConfig(targetCustody: PublicKey, collateralCustody: PublicKey, side: Side): MarketConfig | null;
@@ -19,7 +19,8 @@ var web3_js_1 = require("@solana/web3.js");
19
19
  var PoolConfig_json_1 = __importDefault(require("./PoolConfig.json"));
20
20
  var types_1 = require("./types");
21
21
  var PoolConfig = (function () {
22
- function PoolConfig(programId, perpComposibilityProgramId, fbNftRewardProgramId, cluster, poolName, isDeprecated, poolAddress, stakedLpTokenMint, compoundingTokenMint, stakedLpVault, compoundingLpVault, lpDecimals, compoundingLpTokenSymbol, stakedLpTokenSymbol, perpetuals, transferAuthority, tokenMint, tokenVault, tokenVaultTokenAccount, rebateVault, rebateTokenAccount, revenueTokenAccount, protocolVault, protocolTokenAccount, multisig, addressLookupTableAddresses, pusherAddressLookupTableAddress, backupOracle, nftCollectionAddress, rewardDistributionProgram, tokens, tokensDeprecated, custodies, custodiesDeprecated, markets, marketsDeprecated) {
22
+ function PoolConfig(programId, perpComposibilityProgramId, fbNftRewardProgramId, cluster, poolName, isDeprecated, poolAddress, stakedLpTokenMint, compoundingTokenMint, stakedLpVault, compoundingLpVault, lpDecimals, compoundingLpTokenSymbol, stakedLpTokenSymbol, perpetuals, transferAuthority, tokenMint, tokenVault, tokenVaultTokenAccount, rebateVault, rebateTokenAccount, revenueTokenAccount, protocolVault, protocolTokenAccount, multisig, addressLookupTableAddresses, pusherAddressLookupTableAddress, backupOracle, nftCollectionAddress, rewardDistributionProgram, tokens, tokensDeprecated, custodies, custodiesDeprecated, markets, marketsDeprecated, isMagicBlock) {
23
+ if (isMagicBlock === void 0) { isMagicBlock = false; }
23
24
  var _this = this;
24
25
  this.programId = programId;
25
26
  this.perpComposibilityProgramId = perpComposibilityProgramId;
@@ -57,6 +58,7 @@ var PoolConfig = (function () {
57
58
  this.custodiesDeprecated = custodiesDeprecated;
58
59
  this.markets = markets;
59
60
  this.marketsDeprecated = marketsDeprecated;
61
+ this.isMagicBlock = isMagicBlock;
60
62
  this.getTokenFromSymbol = function (symbol) {
61
63
  return _this.tokens.find(function (f) { return f.symbol.toUpperCase() === symbol.toUpperCase(); });
62
64
  };
@@ -230,7 +232,7 @@ var PoolConfig = (function () {
230
232
  var markets;
231
233
  try {
232
234
  markets = poolConfig['markets'].map(function (i) {
233
- return __assign(__assign({}, i), { marketAccount: new web3_js_1.PublicKey(i.marketAccount), marketCorrelation: i.marketCorrelation, pool: new web3_js_1.PublicKey(i.pool), targetCustody: new web3_js_1.PublicKey(i.targetCustody), collateralCustody: new web3_js_1.PublicKey(i.collateralCustody), side: i.side === 'long' ? types_1.Side.Long : types_1.Side.Short, maxLev: i.maxLev, degenMinLev: i.degenMinLev, degenMaxLev: i.degenMaxLev, targetMint: new web3_js_1.PublicKey(i.targetMint), collateralMint: new web3_js_1.PublicKey(i.collateralMint) });
235
+ return __assign(__assign({}, i), { marketAccount: new web3_js_1.PublicKey(i.marketAccount), marketCorrelation: i.marketCorrelation, pool: new web3_js_1.PublicKey(i.pool), targetCustody: new web3_js_1.PublicKey(i.targetCustody), collateralCustody: new web3_js_1.PublicKey(i.collateralCustody), side: i.side === 'long' ? types_1.Side.Long : types_1.Side.Short, maxLev: i.maxLev, degenMinLev: i.degenMinLev, degenMaxLev: i.degenMaxLev, targetMint: new web3_js_1.PublicKey(i.targetMint), collateralMint: new web3_js_1.PublicKey(i.collateralMint), marketNameUi: i.marketNameUi });
234
236
  });
235
237
  }
236
238
  catch (error) {
@@ -243,7 +245,7 @@ var PoolConfig = (function () {
243
245
  }
244
246
  else {
245
247
  marketsDeprecated = poolConfig['marketsDeprecated'].map(function (i) {
246
- return __assign(__assign({}, i), { marketAccount: new web3_js_1.PublicKey(i.marketAccount), marketCorrelation: i.marketCorrelation, pool: new web3_js_1.PublicKey(i.pool), targetCustody: new web3_js_1.PublicKey(i.targetCustody), collateralCustody: new web3_js_1.PublicKey(i.collateralCustody), side: i.side === 'long' ? types_1.Side.Long : types_1.Side.Short, maxLev: i.maxLev, degenMinLev: i.degenMinLev, degenMaxLev: i.degenMaxLev, targetMint: new web3_js_1.PublicKey(i.targetMint), collateralMint: new web3_js_1.PublicKey(i.collateralMint) });
248
+ return __assign(__assign({}, i), { marketAccount: new web3_js_1.PublicKey(i.marketAccount), marketCorrelation: i.marketCorrelation, pool: new web3_js_1.PublicKey(i.pool), targetCustody: new web3_js_1.PublicKey(i.targetCustody), collateralCustody: new web3_js_1.PublicKey(i.collateralCustody), side: i.side === 'long' ? types_1.Side.Long : types_1.Side.Short, maxLev: i.maxLev, degenMinLev: i.degenMinLev, degenMaxLev: i.degenMaxLev, targetMint: new web3_js_1.PublicKey(i.targetMint), collateralMint: new web3_js_1.PublicKey(i.collateralMint), marketNameUi: i.marketNameUi });
247
249
  });
248
250
  }
249
251
  }
@@ -256,7 +258,7 @@ var PoolConfig = (function () {
256
258
  rewardTokenAccount: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.rewardTokenAccount),
257
259
  rewardVault: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.rewardVault),
258
260
  transferAuthority: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.transferAuthority),
259
- }, tokens, tokensDeprecated, custodies, custodiesDeprecated, markets, marketsDeprecated);
261
+ }, tokens, tokensDeprecated, custodies, custodiesDeprecated, markets, marketsDeprecated, !!poolConfig.isMagicBlock);
260
262
  };
261
263
  PoolConfig.fromIdsByName = function (name, cluster) {
262
264
  var poolConfig = PoolConfig_json_1.default.pools.find(function (pool) { return pool['poolName'] === name && cluster === pool['cluster']; });