flash-sdk 15.9.0 → 15.10.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.
@@ -16,7 +16,7 @@ export declare class CustodyAccount implements Custody {
16
16
  permissions: Permissions;
17
17
  fees: Fees;
18
18
  borrowRate: BorrowRateParams;
19
- rewardThreshold: BN;
19
+ tokenAmountMultiplier: BN;
20
20
  assets: Assets;
21
21
  feesStats: FeesStats;
22
22
  borrowRateState: BorrowRateState;
@@ -847,7 +847,7 @@ export declare class PerpetualsClient {
847
847
  instructions: TransactionInstruction[];
848
848
  additionalSigners: Signer[];
849
849
  }>;
850
- addCustody: (poolName: string, tokenMint: PublicKey, isToken22: boolean, isStable: boolean, isVirtual: boolean, oracle: OracleParams, pricing: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[], depegAdjustment: boolean, rewardThreshold: BN, minReserveUsd: BN, limitPriceBufferBps: BN, inversePrice: boolean) => Promise<{
850
+ addCustody: (poolName: string, tokenMint: PublicKey, isToken22: boolean, isStable: boolean, isVirtual: boolean, oracle: OracleParams, pricing: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[], depegAdjustment: boolean, tokenAmountMultiplier: BN, minReserveUsd: BN, limitPriceBufferBps: BN, inversePrice: boolean) => Promise<{
851
851
  instructions: TransactionInstruction[];
852
852
  additionalSigners: Signer[];
853
853
  }>;
@@ -968,7 +968,11 @@ export declare class PerpetualsClient {
968
968
  instructions: TransactionInstruction[];
969
969
  additionalSigners: Signer[];
970
970
  }>;
971
- setCustody: (poolName: string, tokenMint: PublicKey, isVirtual: boolean, depegAdjustment: boolean, inversePrice: boolean, oracle: OracleParams, pricingConfig: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[], rewardThreshold: BN, minReserveUsd: BN, limitPriceBufferBps: BN, token22: boolean) => Promise<{
971
+ setCustody: (poolName: string, tokenMint: PublicKey, isVirtual: boolean, depegAdjustment: boolean, inversePrice: boolean, oracle: OracleParams, pricingConfig: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[], tokenAmountMultiplier: BN, minReserveUsd: BN, limitPriceBufferBps: BN, token22: boolean) => Promise<{
972
+ instructions: TransactionInstruction[];
973
+ additionalSigners: Signer[];
974
+ }>;
975
+ setCustodyTokenMultiplier: (poolName: string, tokenMint: PublicKey) => Promise<{
972
976
  instructions: TransactionInstruction[];
973
977
  additionalSigners: Signer[];
974
978
  }>;
@@ -7371,7 +7371,7 @@ var PerpetualsClient = (function () {
7371
7371
  }
7372
7372
  });
7373
7373
  }); };
7374
- this.addCustody = function (poolName, tokenMint, isToken22, isStable, isVirtual, oracle, pricing, permissions, fees, borrowRate, ratios, depegAdjustment, rewardThreshold, minReserveUsd, limitPriceBufferBps, inversePrice) { return __awaiter(_this, void 0, void 0, function () {
7374
+ this.addCustody = function (poolName, tokenMint, isToken22, isStable, isVirtual, oracle, pricing, permissions, fees, borrowRate, ratios, depegAdjustment, tokenAmountMultiplier, minReserveUsd, limitPriceBufferBps, inversePrice) { return __awaiter(_this, void 0, void 0, function () {
7375
7375
  var preInstructions, instructions, postInstructions, additionalSigners, addCustodyInstruction, err_45;
7376
7376
  return __generator(this, function (_a) {
7377
7377
  switch (_a.label) {
@@ -7396,7 +7396,7 @@ var PerpetualsClient = (function () {
7396
7396
  fees: fees,
7397
7397
  borrowRate: borrowRate,
7398
7398
  ratios: ratios,
7399
- rewardThreshold: rewardThreshold,
7399
+ tokenAmountMultiplier: tokenAmountMultiplier,
7400
7400
  minReserveUsd: minReserveUsd,
7401
7401
  limitPriceBufferBps: limitPriceBufferBps
7402
7402
  })
@@ -8836,7 +8836,7 @@ var PerpetualsClient = (function () {
8836
8836
  }
8837
8837
  });
8838
8838
  }); };
8839
- this.setCustody = function (poolName, tokenMint, isVirtual, depegAdjustment, inversePrice, oracle, pricingConfig, permissions, fees, borrowRate, ratios, rewardThreshold, minReserveUsd, limitPriceBufferBps, token22) { return __awaiter(_this, void 0, void 0, function () {
8839
+ this.setCustody = function (poolName, tokenMint, isVirtual, depegAdjustment, inversePrice, oracle, pricingConfig, permissions, fees, borrowRate, ratios, tokenAmountMultiplier, minReserveUsd, limitPriceBufferBps, token22) { return __awaiter(_this, void 0, void 0, function () {
8840
8840
  var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setCustodyConfigInstruction, err_76;
8841
8841
  return __generator(this, function (_a) {
8842
8842
  switch (_a.label) {
@@ -8860,7 +8860,7 @@ var PerpetualsClient = (function () {
8860
8860
  fees: fees,
8861
8861
  borrowRate: borrowRate,
8862
8862
  ratios: ratios,
8863
- rewardThreshold: rewardThreshold,
8863
+ tokenAmountMultiplier: tokenAmountMultiplier,
8864
8864
  minReserveUsd: minReserveUsd,
8865
8865
  limitPriceBufferBps: limitPriceBufferBps,
8866
8866
  token22: token22
@@ -8890,8 +8890,47 @@ var PerpetualsClient = (function () {
8890
8890
  }
8891
8891
  });
8892
8892
  }); };
8893
+ this.setCustodyTokenMultiplier = function (poolName, tokenMint) { return __awaiter(_this, void 0, void 0, function () {
8894
+ var preInstructions, instructions, postInstructions, additionalSigners, ix, err_77;
8895
+ return __generator(this, function (_a) {
8896
+ switch (_a.label) {
8897
+ case 0:
8898
+ preInstructions = [];
8899
+ instructions = [];
8900
+ postInstructions = [];
8901
+ additionalSigners = [];
8902
+ _a.label = 1;
8903
+ case 1:
8904
+ _a.trys.push([1, 3, , 4]);
8905
+ return [4, this.program.methods
8906
+ .setCustodyTokenMultiplier({})
8907
+ .accountsPartial({
8908
+ admin: this.admin,
8909
+ multisig: this.multisig.publicKey,
8910
+ perpetuals: this.perpetuals.publicKey,
8911
+ pool: this.getPoolKey(poolName),
8912
+ custody: this.getCustodyKey(poolName, tokenMint),
8913
+ custodyTokenMint: tokenMint,
8914
+ systemProgram: web3_js_1.SystemProgram.programId,
8915
+ })
8916
+ .instruction()];
8917
+ case 2:
8918
+ ix = _a.sent();
8919
+ instructions.push(ix);
8920
+ return [3, 4];
8921
+ case 3:
8922
+ err_77 = _a.sent();
8923
+ console.log("perpClient setCustodyTokenMultiplier error:: ", err_77);
8924
+ throw err_77;
8925
+ case 4: return [2, {
8926
+ instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8927
+ additionalSigners: additionalSigners
8928
+ }];
8929
+ }
8930
+ });
8931
+ }); };
8893
8932
  this.addInternalOracle = function (exponent, lazerFeedId, tokenMint, intOracleAccount) { return __awaiter(_this, void 0, void 0, function () {
8894
- var preInstructions, instructions, postInstructions, additionalSigners, addInternalOracleInstruction, err_77;
8933
+ var preInstructions, instructions, postInstructions, additionalSigners, addInternalOracleInstruction, err_78;
8895
8934
  return __generator(this, function (_a) {
8896
8935
  switch (_a.label) {
8897
8936
  case 0:
@@ -8921,9 +8960,9 @@ var PerpetualsClient = (function () {
8921
8960
  instructions.push(addInternalOracleInstruction);
8922
8961
  return [3, 4];
8923
8962
  case 3:
8924
- err_77 = _a.sent();
8925
- console.log("perpClient setCustodyConfigInstruction error:: ", err_77);
8926
- throw err_77;
8963
+ err_78 = _a.sent();
8964
+ console.log("perpClient setCustodyConfigInstruction error:: ", err_78);
8965
+ throw err_78;
8927
8966
  case 4: return [2, {
8928
8967
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8929
8968
  additionalSigners: additionalSigners
@@ -8932,7 +8971,7 @@ var PerpetualsClient = (function () {
8932
8971
  });
8933
8972
  }); };
8934
8973
  this.setMarket = function (poolName, targetCustody, collateralCustody, marketAccount, maxPayoffBps, permissions, correlation) { return __awaiter(_this, void 0, void 0, function () {
8935
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setMarketConfigInstruction, err_78;
8974
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setMarketConfigInstruction, err_79;
8936
8975
  return __generator(this, function (_a) {
8937
8976
  switch (_a.label) {
8938
8977
  case 0:
@@ -8963,9 +9002,9 @@ var PerpetualsClient = (function () {
8963
9002
  instructions.push(setMarketConfigInstruction);
8964
9003
  return [3, 4];
8965
9004
  case 3:
8966
- err_78 = _a.sent();
8967
- console.log("perpClient setCustodyConfigInstruction error:: ", err_78);
8968
- throw err_78;
9005
+ err_79 = _a.sent();
9006
+ console.log("perpClient setCustodyConfigInstruction error:: ", err_79);
9007
+ throw err_79;
8969
9008
  case 4: return [2, {
8970
9009
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8971
9010
  additionalSigners: additionalSigners
@@ -8974,7 +9013,7 @@ var PerpetualsClient = (function () {
8974
9013
  });
8975
9014
  }); };
8976
9015
  this.removeMarket = function (poolName, market, targetMint, collateralMint) { return __awaiter(_this, void 0, void 0, function () {
8977
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, removeMarketInstruction, err_79;
9016
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, removeMarketInstruction, err_80;
8978
9017
  return __generator(this, function (_a) {
8979
9018
  switch (_a.label) {
8980
9019
  case 0:
@@ -9006,9 +9045,9 @@ var PerpetualsClient = (function () {
9006
9045
  instructions.push(removeMarketInstruction);
9007
9046
  return [3, 4];
9008
9047
  case 3:
9009
- err_79 = _a.sent();
9010
- console.log("perpClient setCustodyConfigInstruction error:: ", err_79);
9011
- throw err_79;
9048
+ err_80 = _a.sent();
9049
+ console.log("perpClient setCustodyConfigInstruction error:: ", err_80);
9050
+ throw err_80;
9012
9051
  case 4: return [2, {
9013
9052
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
9014
9053
  additionalSigners: additionalSigners
@@ -9017,7 +9056,7 @@ var PerpetualsClient = (function () {
9017
9056
  });
9018
9057
  }); };
9019
9058
  this.refreshPositionsStatus = function (positionAccounts) { return __awaiter(_this, void 0, void 0, function () {
9020
- var instructions, additionalSigners, remainingAccounts, refreshInstruction, err_80;
9059
+ var instructions, additionalSigners, remainingAccounts, refreshInstruction, err_81;
9021
9060
  return __generator(this, function (_a) {
9022
9061
  switch (_a.label) {
9023
9062
  case 0:
@@ -9044,9 +9083,9 @@ var PerpetualsClient = (function () {
9044
9083
  instructions.push(refreshInstruction);
9045
9084
  return [3, 4];
9046
9085
  case 3:
9047
- err_80 = _a.sent();
9048
- console.log("perpClient refreshPositionsStatus error:: ", err_80);
9049
- throw err_80;
9086
+ err_81 = _a.sent();
9087
+ console.log("perpClient refreshPositionsStatus error:: ", err_81);
9088
+ throw err_81;
9050
9089
  case 4: return [2, {
9051
9090
  instructions: __spreadArray([], instructions, true),
9052
9091
  additionalSigners: additionalSigners
@@ -9055,7 +9094,7 @@ var PerpetualsClient = (function () {
9055
9094
  });
9056
9095
  }); };
9057
9096
  this.refreshOrdersStatus = function (orderAccounts) { return __awaiter(_this, void 0, void 0, function () {
9058
- var instructions, additionalSigners, remainingAccounts, refreshInstruction, err_81;
9097
+ var instructions, additionalSigners, remainingAccounts, refreshInstruction, err_82;
9059
9098
  return __generator(this, function (_a) {
9060
9099
  switch (_a.label) {
9061
9100
  case 0:
@@ -9082,9 +9121,9 @@ var PerpetualsClient = (function () {
9082
9121
  instructions.push(refreshInstruction);
9083
9122
  return [3, 4];
9084
9123
  case 3:
9085
- err_81 = _a.sent();
9086
- console.log("perpClient refreshOrdersStatus error:: ", err_81);
9087
- throw err_81;
9124
+ err_82 = _a.sent();
9125
+ console.log("perpClient refreshOrdersStatus error:: ", err_82);
9126
+ throw err_82;
9088
9127
  case 4: return [2, {
9089
9128
  instructions: __spreadArray([], instructions, true),
9090
9129
  additionalSigners: additionalSigners
@@ -9093,7 +9132,7 @@ var PerpetualsClient = (function () {
9093
9132
  });
9094
9133
  }); };
9095
9134
  this.migrateMarketPosition = function (poolName, oldMarket, newMarket, oldCollateralCustody, newCollateralCustody, owner) { return __awaiter(_this, void 0, void 0, function () {
9096
- var preInstructions, instructions, postInstructions, additionalSigners, oldPosition, newPosition, oldCollateralCustodyAccount, newCollateralCustodyAccount, migrateMarketPositionInstruction, err_82;
9135
+ var preInstructions, instructions, postInstructions, additionalSigners, oldPosition, newPosition, oldCollateralCustodyAccount, newCollateralCustodyAccount, migrateMarketPositionInstruction, err_83;
9097
9136
  return __generator(this, function (_a) {
9098
9137
  switch (_a.label) {
9099
9138
  case 0:
@@ -9144,9 +9183,9 @@ var PerpetualsClient = (function () {
9144
9183
  instructions.push(migrateMarketPositionInstruction);
9145
9184
  return [3, 6];
9146
9185
  case 5:
9147
- err_82 = _a.sent();
9148
- console.log("perpClient migrateMarketPosition error:: ", err_82);
9149
- throw err_82;
9186
+ err_83 = _a.sent();
9187
+ console.log("perpClient migrateMarketPosition error:: ", err_83);
9188
+ throw err_83;
9150
9189
  case 6: return [2, {
9151
9190
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
9152
9191
  additionalSigners: additionalSigners
@@ -9160,7 +9199,7 @@ var PerpetualsClient = (function () {
9160
9199
  args_1[_i - 5] = arguments[_i];
9161
9200
  }
9162
9201
  return __awaiter(_this, __spreadArray([poolName_1, oldMarket_1, newMarket_1, oldCollateralCustody_1, newCollateralCustody_1], args_1, true), void 0, function (poolName, oldMarket, newMarket, oldCollateralCustody, newCollateralCustody, owner) {
9163
- var preInstructions, instructions, postInstructions, additionalSigners, oldOrder, newOrder, migrateMarketOrderInstruction, err_83;
9202
+ var preInstructions, instructions, postInstructions, additionalSigners, oldOrder, newOrder, migrateMarketOrderInstruction, err_84;
9164
9203
  if (owner === void 0) { owner = this.provider.wallet.publicKey; }
9165
9204
  return __generator(this, function (_a) {
9166
9205
  switch (_a.label) {
@@ -9202,9 +9241,9 @@ var PerpetualsClient = (function () {
9202
9241
  instructions.push(migrateMarketOrderInstruction);
9203
9242
  return [3, 4];
9204
9243
  case 3:
9205
- err_83 = _a.sent();
9206
- console.log("perpClient migrateMarketOrder error:: ", err_83);
9207
- throw err_83;
9244
+ err_84 = _a.sent();
9245
+ console.log("perpClient migrateMarketOrder error:: ", err_84);
9246
+ throw err_84;
9208
9247
  case 4: return [2, {
9209
9248
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
9210
9249
  additionalSigners: additionalSigners
@@ -9214,7 +9253,7 @@ var PerpetualsClient = (function () {
9214
9253
  });
9215
9254
  };
9216
9255
  this.forceSettlePosition = function (market, owner, receivingAccount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
9217
- var instructions, additionalSigners, marketAccount, targetCustody_1, collateralCustody_1, targetCustodyConfig, collateralCustodyConfig, positionAccount, orderAccount, remainingAccounts, orderAccountInfo, forceSettlePositionIx, err_84;
9256
+ var instructions, additionalSigners, marketAccount, targetCustody_1, collateralCustody_1, targetCustodyConfig, collateralCustodyConfig, positionAccount, orderAccount, remainingAccounts, orderAccountInfo, forceSettlePositionIx, err_85;
9218
9257
  return __generator(this, function (_a) {
9219
9258
  switch (_a.label) {
9220
9259
  case 0:
@@ -9278,9 +9317,9 @@ var PerpetualsClient = (function () {
9278
9317
  instructions.push(forceSettlePositionIx);
9279
9318
  return [3, 6];
9280
9319
  case 5:
9281
- err_84 = _a.sent();
9282
- console.log("perpClient forceSettlePosition error:: ", err_84);
9283
- throw err_84;
9320
+ err_85 = _a.sent();
9321
+ console.log("perpClient forceSettlePosition error:: ", err_85);
9322
+ throw err_85;
9284
9323
  case 6: return [2, {
9285
9324
  instructions: __spreadArray([], instructions, true),
9286
9325
  additionalSigners: additionalSigners
@@ -9289,7 +9328,7 @@ var PerpetualsClient = (function () {
9289
9328
  });
9290
9329
  }); };
9291
9330
  this.forceSettleOrder = function (market, owner, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
9292
- var instructions, additionalSigners, marketAccount, targetCustody, orderKey, orderAccount, uidToCustodyConfig, _i, _a, custodyConfig, custody, _b, activeLimitOrders, uniqueUids, _c, uniqueUids_1, uid, reserveCustodyConfig, isToken2022, receivingAccount, forceSettleOrderIx, reserveCustodyConfig, isToken2022, receivingAccount, forceSettleOrderIx, err_85;
9331
+ var instructions, additionalSigners, marketAccount, targetCustody, orderKey, orderAccount, uidToCustodyConfig, _i, _a, custodyConfig, custody, _b, activeLimitOrders, uniqueUids, _c, uniqueUids_1, uid, reserveCustodyConfig, isToken2022, receivingAccount, forceSettleOrderIx, reserveCustodyConfig, isToken2022, receivingAccount, forceSettleOrderIx, err_86;
9293
9332
  return __generator(this, function (_d) {
9294
9333
  switch (_d.label) {
9295
9334
  case 0:
@@ -9402,9 +9441,9 @@ var PerpetualsClient = (function () {
9402
9441
  _d.label = 15;
9403
9442
  case 15: return [3, 17];
9404
9443
  case 16:
9405
- err_85 = _d.sent();
9406
- console.log("perpClient forceSettleOrder error:: ", err_85);
9407
- throw err_85;
9444
+ err_86 = _d.sent();
9445
+ console.log("perpClient forceSettleOrder error:: ", err_86);
9446
+ throw err_86;
9408
9447
  case 17: return [2, {
9409
9448
  instructions: __spreadArray([], instructions, true),
9410
9449
  additionalSigners: additionalSigners