flash-sdk 10.0.0-alpha.0 → 10.0.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,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { BN } from "@coral-xyz/anchor";
2
3
  import { ContractOraclePrice } from "./types";
3
4
  export declare class OraclePrice {
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { BN } from "@coral-xyz/anchor";
2
3
  import { PublicKey } from "@solana/web3.js";
3
4
  import { LimitOrder, Order, TriggerOrder } from "./types";
@@ -1,3 +1,5 @@
1
+ /// <reference types="bn.js" />
2
+ /// <reference types="node" />
1
3
  import { Program, AnchorProvider, BN } from "@coral-xyz/anchor";
2
4
  import { PublicKey, TransactionInstruction, Commitment, Signer, AddressLookupTableAccount, VersionedTransaction } from "@solana/web3.js";
3
5
  import { PoolAccount } from "./PoolAccount";
@@ -259,7 +261,6 @@ export declare class PerpetualsClient {
259
261
  conf: BN;
260
262
  ema: BN;
261
263
  publishTime: BN;
262
- extOracleAccount: PublicKey;
263
264
  market: PublicKey;
264
265
  limitOrders: unknown;
265
266
  takeProfitOrders: unknown;
@@ -601,7 +602,6 @@ export declare class PerpetualsClient {
601
602
  conf: BN;
602
603
  ema: BN;
603
604
  publishTime: BN;
604
- extOracleAccount: PublicKey;
605
605
  market: PublicKey;
606
606
  limitOrders: unknown;
607
607
  takeProfitOrders: unknown;
@@ -942,7 +942,6 @@ export declare class PerpetualsClient {
942
942
  conf: BN;
943
943
  ema: BN;
944
944
  publishTime: BN;
945
- extOracleAccount: PublicKey;
946
945
  market: PublicKey;
947
946
  limitOrders: unknown;
948
947
  takeProfitOrders: unknown;
@@ -1287,7 +1286,6 @@ export declare class PerpetualsClient {
1287
1286
  conf: BN;
1288
1287
  ema: BN;
1289
1288
  publishTime: BN;
1290
- extOracleAccount: PublicKey;
1291
1289
  market: PublicKey;
1292
1290
  limitOrders: unknown;
1293
1291
  takeProfitOrders: unknown;
@@ -1631,7 +1629,6 @@ export declare class PerpetualsClient {
1631
1629
  conf: BN;
1632
1630
  ema: BN;
1633
1631
  publishTime: BN;
1634
- extOracleAccount: PublicKey;
1635
1632
  market: PublicKey;
1636
1633
  limitOrders: unknown;
1637
1634
  takeProfitOrders: unknown;
@@ -1973,7 +1970,6 @@ export declare class PerpetualsClient {
1973
1970
  conf: BN;
1974
1971
  ema: BN;
1975
1972
  publishTime: BN;
1976
- extOracleAccount: PublicKey;
1977
1973
  market: PublicKey;
1978
1974
  limitOrders: unknown;
1979
1975
  takeProfitOrders: unknown;
@@ -2314,7 +2310,6 @@ export declare class PerpetualsClient {
2314
2310
  conf: BN;
2315
2311
  ema: BN;
2316
2312
  publishTime: BN;
2317
- extOracleAccount: PublicKey;
2318
2313
  market: PublicKey;
2319
2314
  limitOrders: unknown;
2320
2315
  takeProfitOrders: unknown;
@@ -2655,7 +2650,6 @@ export declare class PerpetualsClient {
2655
2650
  conf: BN;
2656
2651
  ema: BN;
2657
2652
  publishTime: BN;
2658
- extOracleAccount: PublicKey;
2659
2653
  market: PublicKey;
2660
2654
  limitOrders: unknown;
2661
2655
  takeProfitOrders: unknown;
@@ -3043,7 +3037,6 @@ export declare class PerpetualsClient {
3043
3037
  conf: BN;
3044
3038
  ema: BN;
3045
3039
  publishTime: BN;
3046
- extOracleAccount: PublicKey;
3047
3040
  market: PublicKey;
3048
3041
  limitOrders: unknown;
3049
3042
  takeProfitOrders: unknown;
@@ -3384,7 +3377,6 @@ export declare class PerpetualsClient {
3384
3377
  conf: BN;
3385
3378
  ema: BN;
3386
3379
  publishTime: BN;
3387
- extOracleAccount: PublicKey;
3388
3380
  market: PublicKey;
3389
3381
  limitOrders: unknown;
3390
3382
  takeProfitOrders: unknown;
@@ -3725,7 +3717,6 @@ export declare class PerpetualsClient {
3725
3717
  conf: BN;
3726
3718
  ema: BN;
3727
3719
  publishTime: BN;
3728
- extOracleAccount: PublicKey;
3729
3720
  market: PublicKey;
3730
3721
  limitOrders: unknown;
3731
3722
  takeProfitOrders: unknown;
@@ -4066,7 +4057,6 @@ export declare class PerpetualsClient {
4066
4057
  conf: BN;
4067
4058
  ema: BN;
4068
4059
  publishTime: BN;
4069
- extOracleAccount: PublicKey;
4070
4060
  market: PublicKey;
4071
4061
  limitOrders: unknown;
4072
4062
  takeProfitOrders: unknown;
@@ -4407,7 +4397,6 @@ export declare class PerpetualsClient {
4407
4397
  conf: BN;
4408
4398
  ema: BN;
4409
4399
  publishTime: BN;
4410
- extOracleAccount: PublicKey;
4411
4400
  market: PublicKey;
4412
4401
  limitOrders: unknown;
4413
4402
  takeProfitOrders: unknown;
@@ -4957,8 +4946,4 @@ export declare class PerpetualsClient {
4957
4946
  instructions: TransactionInstruction[];
4958
4947
  additionalSigners: Signer[];
4959
4948
  }>;
4960
- resizeInternalOracle: (extOracle: PublicKey, tokenMint: PublicKey, intOracleAccount: PublicKey) => Promise<{
4961
- instructions: TransactionInstruction[];
4962
- additionalSigners: Signer[];
4963
- }>;
4964
4949
  }
@@ -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 = 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;
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;
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.");
@@ -7659,6 +7659,11 @@ var PerpetualsClient = (function () {
7659
7659
  accountMetas = [];
7660
7660
  _loop_1 = function (tokenMint) {
7661
7661
  var custody = ALL_CUSTODY_CONFIGS.find(function (i) { return i.mintKey.equals(tokenMint); });
7662
+ accountMetas.push({
7663
+ pubkey: custody.custodyAccount,
7664
+ isSigner: false,
7665
+ isWritable: false,
7666
+ });
7662
7667
  accountMetas.push({
7663
7668
  pubkey: custody.intOracleAccount,
7664
7669
  isSigner: false,
@@ -7715,6 +7720,11 @@ var PerpetualsClient = (function () {
7715
7720
  accountMetas = [];
7716
7721
  _loop_2 = function (tokenMint) {
7717
7722
  var custody = ALL_CUSTODY_CONFIGS.find(function (i) { return i.mintKey.equals(tokenMint); });
7723
+ accountMetas.push({
7724
+ pubkey: custody.custodyAccount,
7725
+ isSigner: false,
7726
+ isWritable: false,
7727
+ });
7718
7728
  accountMetas.push({
7719
7729
  pubkey: custody.intOracleAccount,
7720
7730
  isSigner: false,
@@ -8237,46 +8247,6 @@ var PerpetualsClient = (function () {
8237
8247
  }
8238
8248
  });
8239
8249
  }); };
8240
- this.resizeInternalOracle = function (extOracle, tokenMint, intOracleAccount) { return __awaiter(_this, void 0, void 0, function () {
8241
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, resizeInternalOracleInstruction, err_68;
8242
- return __generator(this, function (_a) {
8243
- switch (_a.label) {
8244
- case 0:
8245
- publicKey = this.provider.wallet.publicKey;
8246
- preInstructions = [];
8247
- instructions = [];
8248
- postInstructions = [];
8249
- additionalSigners = [];
8250
- _a.label = 1;
8251
- case 1:
8252
- _a.trys.push([1, 3, , 4]);
8253
- return [4, this.program.methods
8254
- .resizeInternalOracle({
8255
- extOracle: extOracle
8256
- })
8257
- .accounts({
8258
- admin: publicKey,
8259
- multisig: this.multisig.publicKey,
8260
- custodyTokenMint: tokenMint,
8261
- intOracleAccount: intOracleAccount,
8262
- systemProgram: web3_js_1.SystemProgram.programId,
8263
- })
8264
- .instruction()];
8265
- case 2:
8266
- resizeInternalOracleInstruction = _a.sent();
8267
- instructions.push(resizeInternalOracleInstruction);
8268
- return [3, 4];
8269
- case 3:
8270
- err_68 = _a.sent();
8271
- console.log("perpClient resizeInternalOracleInstruction error:: ", err_68);
8272
- throw err_68;
8273
- case 4: return [2, {
8274
- instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8275
- additionalSigners: additionalSigners
8276
- }];
8277
- }
8278
- });
8279
- }); };
8280
8250
  this.provider = provider;
8281
8251
  (0, anchor_1.setProvider)(provider);
8282
8252
  this.program = new anchor_1.Program(perpetuals_1.IDL, programId);
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { BN } from "@coral-xyz/anchor";
2
3
  import { Pool, TokenRatios, StakeStats, CompoundingStats, Permissions } from "./types";
3
4
  import { PublicKey } from "@solana/web3.js";
@@ -435,8 +435,8 @@
435
435
  "isStable": false,
436
436
  "isVirtual": true,
437
437
  "lazerId": 1788,
438
- "pythTicker": "Commodities.WTIV5/USD",
439
- "pythPriceId": "0x1fd93efedb8b2db34465b5dbad8beca7288ad8bbcd47213ab1fdfe57ac86a240",
438
+ "pythTicker": "Commodities.WTIX5/USD",
439
+ "pythPriceId": "0x2e8c6b85cf4a79b6d8bce10be470eefb369810b642782cb6aa150f82362e65d1",
440
440
  "isToken2022": false
441
441
  }
442
442
  ],
@@ -538,10 +538,10 @@
538
538
  "isStable": false,
539
539
  "isVirtual": true,
540
540
  "intOracleAddress": "5qLQ3BT7JCf4fUxoAH1xZwHCca9fZuuTWTgTsNxLNcoZ",
541
- "extOracleAddress": "79Qk7eiaFDTPdny4ha6vG3SYtRSdJ9tCqSpYPvxmq3WW",
541
+ "extOracleAddress": "2SxsutiRd7TBmURrWW2tPR3xeHpJFuGVGAd4Wjddkk7D",
542
542
  "lazerId": 1788,
543
- "pythTicker": "Commodities.WTIV5/USD",
544
- "pythPriceId": "0x1fd93efedb8b2db34465b5dbad8beca7288ad8bbcd47213ab1fdfe57ac86a240"
543
+ "pythTicker": "Commodities.WTIX5/USD",
544
+ "pythPriceId": "0x2e8c6b85cf4a79b6d8bce10be470eefb369810b642782cb6aa150f82362e65d1"
545
545
  }
546
546
  ],
547
547
  "markets": [
@@ -2183,7 +2183,7 @@
2183
2183
  "isStable": false,
2184
2184
  "isVirtual": true,
2185
2185
  "lazerId": 1788,
2186
- "pythTicker": "Commodities.WTIV5/USD",
2186
+ "pythTicker": "Commodities.WTIX5/USD",
2187
2187
  "pythPriceId": "0x1fd93efedb8b2db34465b5dbad8beca7288ad8bbcd47213ab1fdfe57ac86a240",
2188
2188
  "isToken2022": false
2189
2189
  }
@@ -2286,10 +2286,10 @@
2286
2286
  "isStable": false,
2287
2287
  "isVirtual": true,
2288
2288
  "intOracleAddress": "J7XXRCMCrNHFSn6WgSEJREEX74XmGtmvnq3JZusHQ5Kg",
2289
- "extOracleAddress": "79Qk7eiaFDTPdny4ha6vG3SYtRSdJ9tCqSpYPvxmq3WW",
2289
+ "extOracleAddress": "2SxsutiRd7TBmURrWW2tPR3xeHpJFuGVGAd4Wjddkk7D",
2290
2290
  "lazerId": 1788,
2291
- "pythTicker": "Commodities.WTIV5/USD",
2292
- "pythPriceId": "0x1fd93efedb8b2db34465b5dbad8beca7288ad8bbcd47213ab1fdfe57ac86a240"
2291
+ "pythTicker": "Commodities.WTIX5/USD",
2292
+ "pythPriceId": "0x2e8c6b85cf4a79b6d8bce10be470eefb369810b642782cb6aa150f82362e65d1"
2293
2293
  }
2294
2294
  ],
2295
2295
  "markets": [
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { BN } from "@coral-xyz/anchor";
2
3
  import { Mint } from "@solana/spl-token";
3
4
  import { CustodyAccount } from "./CustodyAccount";
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { BN } from "@coral-xyz/anchor";
2
3
  import { PublicKey } from "@solana/web3.js";
3
4
  import { ContractOraclePrice, Position } from "./types";
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { TokenStake, WithdrawStakeLog } from "./types";
2
3
  import { BN } from "@coral-xyz/anchor";
3
4
  import { PublicKey } from "@solana/web3.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { BN } from "@coral-xyz/anchor";
2
3
  import { PublicKey } from "@solana/web3.js";
3
4
  import { TokenVault } from "./types";
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { BN } from "@coral-xyz/anchor";
2
3
  import { Trading, VoltageStats } from "./types";
3
4
  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 = 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;
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;
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 = 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;
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;
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,8 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  var _a;
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.getBackupOracleInstruction = exports.getPythnetOraclePrices = exports.pythPriceServiceConnection = exports.API_ENDPOINT = void 0;
44
- exports.createBackupOracleInstruction = createBackupOracleInstruction;
43
+ exports.createBackupOracleInstruction = exports.getBackupOracleInstruction = exports.getPythnetOraclePrices = exports.pythPriceServiceConnection = exports.API_ENDPOINT = void 0;
45
44
  var price_service_client_1 = require("@pythnetwork/price-service-client");
46
45
  var web3_js_1 = require("@solana/web3.js");
47
46
  var bn_js_1 = __importDefault(require("bn.js"));
@@ -157,3 +156,4 @@ function createBackupOracleInstruction(poolAddress_1) {
157
156
  });
158
157
  });
159
158
  }
159
+ exports.createBackupOracleInstruction = createBackupOracleInstruction;
@@ -1,3 +1,4 @@
1
+ /// <reference types="bn.js" />
1
2
  import { PublicKey } from '@solana/web3.js';
2
3
  export declare const PERCENTAGE_DECIMALS = 4;
3
4
  export declare const USD_DECIMALS = 6;
@@ -673,45 +673,6 @@ export type Perpetuals = {
673
673
  ];
674
674
  "returns": "u8";
675
675
  },
676
- {
677
- "name": "resizeInternalOracle";
678
- "accounts": [
679
- {
680
- "name": "admin";
681
- "isMut": true;
682
- "isSigner": true;
683
- },
684
- {
685
- "name": "multisig";
686
- "isMut": true;
687
- "isSigner": false;
688
- },
689
- {
690
- "name": "custodyTokenMint";
691
- "isMut": false;
692
- "isSigner": false;
693
- },
694
- {
695
- "name": "intOracleAccount";
696
- "isMut": true;
697
- "isSigner": false;
698
- },
699
- {
700
- "name": "systemProgram";
701
- "isMut": false;
702
- "isSigner": false;
703
- }
704
- ];
705
- "args": [
706
- {
707
- "name": "params";
708
- "type": {
709
- "defined": "ResizeInternalOracleParams";
710
- };
711
- }
712
- ];
713
- "returns": "u8";
714
- },
715
676
  {
716
677
  "name": "setAdminSigners";
717
678
  "accounts": [
@@ -7662,10 +7623,6 @@ export type Perpetuals = {
7662
7623
  {
7663
7624
  "name": "publishTime";
7664
7625
  "type": "i64";
7665
- },
7666
- {
7667
- "name": "extOracleAccount";
7668
- "type": "publicKey";
7669
7626
  }
7670
7627
  ];
7671
7628
  };
@@ -8595,10 +8552,6 @@ export type Perpetuals = {
8595
8552
  {
8596
8553
  "name": "expo";
8597
8554
  "type": "i32";
8598
- },
8599
- {
8600
- "name": "extOracle";
8601
- "type": "publicKey";
8602
8555
  }
8603
8556
  ];
8604
8557
  };
@@ -9818,18 +9771,6 @@ export type Perpetuals = {
9818
9771
  ];
9819
9772
  };
9820
9773
  },
9821
- {
9822
- "name": "ResizeInternalOracleParams";
9823
- "type": {
9824
- "kind": "struct";
9825
- "fields": [
9826
- {
9827
- "name": "extOracle";
9828
- "type": "publicKey";
9829
- }
9830
- ];
9831
- };
9832
- },
9833
9774
  {
9834
9775
  "name": "SetAdminSignersParams";
9835
9776
  "type": {
@@ -11649,9 +11590,6 @@ export type Perpetuals = {
11649
11590
  },
11650
11591
  {
11651
11592
  "name": "InitRevenueTokenAccount";
11652
- },
11653
- {
11654
- "name": "ResizeInternalOracle";
11655
11593
  }
11656
11594
  ];
11657
11595
  };
@@ -676,45 +676,6 @@ exports.IDL = {
676
676
  ],
677
677
  "returns": "u8"
678
678
  },
679
- {
680
- "name": "resizeInternalOracle",
681
- "accounts": [
682
- {
683
- "name": "admin",
684
- "isMut": true,
685
- "isSigner": true
686
- },
687
- {
688
- "name": "multisig",
689
- "isMut": true,
690
- "isSigner": false
691
- },
692
- {
693
- "name": "custodyTokenMint",
694
- "isMut": false,
695
- "isSigner": false
696
- },
697
- {
698
- "name": "intOracleAccount",
699
- "isMut": true,
700
- "isSigner": false
701
- },
702
- {
703
- "name": "systemProgram",
704
- "isMut": false,
705
- "isSigner": false
706
- }
707
- ],
708
- "args": [
709
- {
710
- "name": "params",
711
- "type": {
712
- "defined": "ResizeInternalOracleParams"
713
- }
714
- }
715
- ],
716
- "returns": "u8"
717
- },
718
679
  {
719
680
  "name": "setAdminSigners",
720
681
  "accounts": [
@@ -7665,10 +7626,6 @@ exports.IDL = {
7665
7626
  {
7666
7627
  "name": "publishTime",
7667
7628
  "type": "i64"
7668
- },
7669
- {
7670
- "name": "extOracleAccount",
7671
- "type": "publicKey"
7672
7629
  }
7673
7630
  ]
7674
7631
  }
@@ -8598,10 +8555,6 @@ exports.IDL = {
8598
8555
  {
8599
8556
  "name": "expo",
8600
8557
  "type": "i32"
8601
- },
8602
- {
8603
- "name": "extOracle",
8604
- "type": "publicKey"
8605
8558
  }
8606
8559
  ]
8607
8560
  }
@@ -9821,18 +9774,6 @@ exports.IDL = {
9821
9774
  ]
9822
9775
  }
9823
9776
  },
9824
- {
9825
- "name": "ResizeInternalOracleParams",
9826
- "type": {
9827
- "kind": "struct",
9828
- "fields": [
9829
- {
9830
- "name": "extOracle",
9831
- "type": "publicKey"
9832
- }
9833
- ]
9834
- }
9835
- },
9836
9777
  {
9837
9778
  "name": "SetAdminSignersParams",
9838
9779
  "type": {
@@ -11652,9 +11593,6 @@ exports.IDL = {
11652
11593
  },
11653
11594
  {
11654
11595
  "name": "InitRevenueTokenAccount"
11655
- },
11656
- {
11657
- "name": "ResizeInternalOracle"
11658
11596
  }
11659
11597
  ]
11660
11598
  }