flash-sdk 9.0.5-alpha.7 → 9.1.0-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.
- package/dist/MarketAccount.js +1 -1
- package/dist/PerpetualsClient.d.ts +129 -286
- package/dist/PerpetualsClient.js +745 -580
- package/dist/PoolAccount.d.ts +0 -3
- package/dist/PoolConfig.d.ts +2 -3
- package/dist/PoolConfig.js +10 -4
- package/dist/PoolConfig.json +4428 -167
- package/dist/PositionAccount.d.ts +2 -3
- package/dist/TokenStakeAccount.d.ts +2 -2
- package/dist/TokenStakeAccount.js +2 -2
- package/dist/TradingAccount.d.ts +23 -0
- package/dist/TradingAccount.js +17 -0
- package/dist/backupOracle.d.ts +1 -0
- package/dist/backupOracle.js +3 -3
- package/dist/idl/perpetuals.d.ts +1676 -3274
- package/dist/idl/perpetuals.js +1668 -3266
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +5 -22
- package/dist/types/index.js +2 -3
- package/dist/utils/getReferralAccounts.d.ts +1 -1
- package/dist/utils/getReferralAccounts.js +8 -3
- package/package.json +1 -1
- package/dist/testSize.d.ts +0 -0
- package/dist/testSize.js +0 -0
|
@@ -15,12 +15,11 @@ export declare class PositionAccount implements Position {
|
|
|
15
15
|
lockedUsd: BN;
|
|
16
16
|
collateralAmount: BN;
|
|
17
17
|
collateralUsd: BN;
|
|
18
|
-
|
|
18
|
+
unsettledAmount: BN;
|
|
19
19
|
unsettledFeesUsd: BN;
|
|
20
20
|
cumulativeLockFeeSnapshot: BN;
|
|
21
21
|
degenSizeUsd: BN;
|
|
22
|
-
|
|
23
|
-
buffer: number;
|
|
22
|
+
buffer: BN;
|
|
24
23
|
sizeDecimals: number;
|
|
25
24
|
lockedDecimals: number;
|
|
26
25
|
collateralDecimals: number;
|
|
@@ -16,7 +16,7 @@ export declare class TokenStakeAccount implements TokenStake {
|
|
|
16
16
|
rewardTokens: BN;
|
|
17
17
|
unclaimedRevenueAmount: BN;
|
|
18
18
|
revenueSnapshot: BN;
|
|
19
|
-
|
|
19
|
+
padding: BN[];
|
|
20
20
|
constructor(data: {
|
|
21
21
|
owner: PublicKey;
|
|
22
22
|
isInitialized: boolean;
|
|
@@ -32,7 +32,7 @@ export declare class TokenStakeAccount implements TokenStake {
|
|
|
32
32
|
rewardTokens: BN;
|
|
33
33
|
unclaimedRevenueAmount: BN;
|
|
34
34
|
revenueSnapshot: BN;
|
|
35
|
-
|
|
35
|
+
padding: BN[];
|
|
36
36
|
});
|
|
37
37
|
static from(decodedData: any): TokenStakeAccount;
|
|
38
38
|
updateData(newData: Partial<TokenStakeAccount>): void;
|
|
@@ -18,7 +18,7 @@ var TokenStakeAccount = (function () {
|
|
|
18
18
|
this.lastRewardEpochCount = data.lastRewardEpochCount;
|
|
19
19
|
this.unclaimedRevenueAmount = data.unclaimedRevenueAmount;
|
|
20
20
|
this.revenueSnapshot = data.revenueSnapshot;
|
|
21
|
-
this.
|
|
21
|
+
this.padding = data.padding;
|
|
22
22
|
}
|
|
23
23
|
TokenStakeAccount.from = function (decodedData) {
|
|
24
24
|
return new TokenStakeAccount({
|
|
@@ -36,7 +36,7 @@ var TokenStakeAccount = (function () {
|
|
|
36
36
|
lastRewardEpochCount: decodedData.lastRewardEpochCount,
|
|
37
37
|
unclaimedRevenueAmount: decodedData.unclaimedRevenueAmount,
|
|
38
38
|
revenueSnapshot: decodedData.revenueSnapshot,
|
|
39
|
-
|
|
39
|
+
padding: decodedData.padding.map(function (p) { return new anchor_1.BN(p); }),
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
TokenStakeAccount.prototype.updateData = function (newData) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BN } from "@coral-xyz/anchor";
|
|
2
|
+
import { Trading, VoltageStats } from "./types";
|
|
3
|
+
import { PublicKey } from "@solana/web3.js";
|
|
4
|
+
export declare class TradingAccount implements Trading {
|
|
5
|
+
publicKey: PublicKey;
|
|
6
|
+
nftMint: PublicKey;
|
|
7
|
+
owner: PublicKey;
|
|
8
|
+
delegate: PublicKey;
|
|
9
|
+
isInitialized: boolean;
|
|
10
|
+
level: number;
|
|
11
|
+
bump: number;
|
|
12
|
+
voltagePoints: BN;
|
|
13
|
+
stats: VoltageStats;
|
|
14
|
+
snapshot: VoltageStats;
|
|
15
|
+
timestamp: BN;
|
|
16
|
+
counter: BN;
|
|
17
|
+
tokenStakeAccount: PublicKey;
|
|
18
|
+
burnt: boolean;
|
|
19
|
+
padding: number[];
|
|
20
|
+
constructor(publicKey: PublicKey, parseData: Trading);
|
|
21
|
+
static from(publicKey: PublicKey, parseData: Trading): TradingAccount;
|
|
22
|
+
updatePoolData(parseData: Trading): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TradingAccount = void 0;
|
|
4
|
+
var TradingAccount = (function () {
|
|
5
|
+
function TradingAccount(publicKey, parseData) {
|
|
6
|
+
this.publicKey = publicKey;
|
|
7
|
+
Object.assign(this, parseData);
|
|
8
|
+
}
|
|
9
|
+
TradingAccount.from = function (publicKey, parseData) {
|
|
10
|
+
return new TradingAccount(publicKey, parseData);
|
|
11
|
+
};
|
|
12
|
+
TradingAccount.prototype.updatePoolData = function (parseData) {
|
|
13
|
+
Object.assign(this, parseData);
|
|
14
|
+
};
|
|
15
|
+
return TradingAccount;
|
|
16
|
+
}());
|
|
17
|
+
exports.TradingAccount = TradingAccount;
|
package/dist/backupOracle.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { PoolConfig } from "./PoolConfig";
|
|
|
4
4
|
import { BackupOracle } from "./types";
|
|
5
5
|
import { Program } from "@coral-xyz/anchor";
|
|
6
6
|
import { Perpetuals } from "./idl/perpetuals";
|
|
7
|
+
export declare const API_ENDPOINT: string;
|
|
7
8
|
export declare const pythPriceServiceConnection: PriceServiceConnection;
|
|
8
9
|
export declare const getPythnetOraclePrices: (program: Program<Perpetuals>, poolConfig: PoolConfig, backupOracleSecretKey: string) => Promise<TransactionInstruction>;
|
|
9
10
|
export declare const getBackupOracleInstruction: (program: Program<Perpetuals>, poolConfig: PoolConfig, backupOracleSecretKey: string, backupCaches: BackupOracle[]) => TransactionInstruction;
|
package/dist/backupOracle.js
CHANGED
|
@@ -40,14 +40,14 @@ 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 = void 0;
|
|
43
|
+
exports.getBackupOracleInstruction = exports.getPythnetOraclePrices = exports.pythPriceServiceConnection = exports.API_ENDPOINT = void 0;
|
|
44
44
|
exports.createBackupOracleInstruction = createBackupOracleInstruction;
|
|
45
45
|
var price_service_client_1 = require("@pythnetwork/price-service-client");
|
|
46
46
|
var web3_js_1 = require("@solana/web3.js");
|
|
47
47
|
var bn_js_1 = __importDefault(require("bn.js"));
|
|
48
48
|
var bs58_1 = __importDefault(require("bs58"));
|
|
49
49
|
var tweetnacl_1 = __importDefault(require("tweetnacl"));
|
|
50
|
-
|
|
50
|
+
exports.API_ENDPOINT = (_a = process.env.NEXT_PUBLIC_API_ENDPOINT) !== null && _a !== void 0 ? _a : 'https://api.prod.flash.trade';
|
|
51
51
|
exports.pythPriceServiceConnection = new price_service_client_1.PriceServiceConnection('https://hermes.pyth.network', {
|
|
52
52
|
priceFeedRequestConfig: {},
|
|
53
53
|
});
|
|
@@ -138,7 +138,7 @@ function createBackupOracleInstruction(poolAddress_1) {
|
|
|
138
138
|
switch (_a.label) {
|
|
139
139
|
case 0:
|
|
140
140
|
_a.trys.push([0, 3, , 4]);
|
|
141
|
-
return [4, fetch("".concat(API_ENDPOINT, "/backup-oracle/prices?poolAddress=").concat(poolAddress))];
|
|
141
|
+
return [4, fetch("".concat(exports.API_ENDPOINT, "/backup-oracle/prices?poolAddress=").concat(poolAddress))];
|
|
142
142
|
case 1: return [4, (_a.sent()).json()];
|
|
143
143
|
case 2:
|
|
144
144
|
backupOracleData = _a.sent();
|