flash-sdk 10.8.1 → 10.9.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/OraclePrice.d.ts +0 -1
- package/dist/OrderAccount.d.ts +0 -1
- package/dist/PerpetualsClient.d.ts +1 -2
- package/dist/PerpetualsClient.js +15 -11
- package/dist/PoolAccount.d.ts +0 -1
- package/dist/PoolConfig.d.ts +2 -1
- package/dist/PoolConfig.js +10 -2
- package/dist/PoolConfig.json +368 -731
- package/dist/PoolDataClient.d.ts +0 -1
- package/dist/PositionAccount.d.ts +0 -1
- package/dist/TokenStakeAccount.d.ts +0 -1
- package/dist/TokenVaultAccount.d.ts +0 -1
- package/dist/TradingAccount.d.ts +0 -1
- package/dist/ViewHelper.js +2 -2
- package/dist/backupOracle.js +4 -4
- package/dist/constants/index.d.ts +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +3 -3
- package/dist/utils/IdlCoder.js +17 -7
- package/dist/utils/alt.js +5 -6
- package/dist/utils/anchorCpiEvents.d.ts +0 -1
- package/dist/utils/anchorCpiEvents.js +4 -4
- package/dist/utils/index.js +6 -6
- package/dist/utils/rpc.js +9 -9
- package/package.json +1 -1
package/dist/OraclePrice.d.ts
CHANGED
package/dist/OrderAccount.d.ts
CHANGED
|
@@ -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";
|
|
@@ -43,6 +41,7 @@ export declare class PerpetualsClient {
|
|
|
43
41
|
bump: number;
|
|
44
42
|
};
|
|
45
43
|
addressLookupTables: AddressLookupTableAccount[];
|
|
44
|
+
pusherAddressLookupTables: AddressLookupTableAccount;
|
|
46
45
|
eventAuthority: {
|
|
47
46
|
publicKey: PublicKey;
|
|
48
47
|
bump: number;
|
package/dist/PerpetualsClient.js
CHANGED
|
@@ -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 =
|
|
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.");
|
|
@@ -91,31 +91,35 @@ var PerpetualsClient = (function () {
|
|
|
91
91
|
_this.prioritizationFee = fee;
|
|
92
92
|
};
|
|
93
93
|
this.loadAddressLookupTable = function (poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
94
|
-
var addresses, _i, _a, address, addressLookupTable, accCreationLamports;
|
|
95
|
-
return __generator(this, function (
|
|
96
|
-
switch (
|
|
94
|
+
var addresses, _i, _a, address, addressLookupTable, _b, accCreationLamports;
|
|
95
|
+
return __generator(this, function (_c) {
|
|
96
|
+
switch (_c.label) {
|
|
97
97
|
case 0:
|
|
98
98
|
addresses = [];
|
|
99
99
|
_i = 0, _a = poolConfig.addressLookupTableAddresses;
|
|
100
|
-
|
|
100
|
+
_c.label = 1;
|
|
101
101
|
case 1:
|
|
102
102
|
if (!(_i < _a.length)) return [3, 4];
|
|
103
103
|
address = _a[_i];
|
|
104
104
|
return [4, this.provider.connection.getAddressLookupTable(address)];
|
|
105
105
|
case 2:
|
|
106
|
-
addressLookupTable = (
|
|
106
|
+
addressLookupTable = (_c.sent()).value;
|
|
107
107
|
if (addressLookupTable) {
|
|
108
108
|
addresses.push(addressLookupTable);
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
_c.label = 3;
|
|
111
111
|
case 3:
|
|
112
112
|
_i++;
|
|
113
113
|
return [3, 1];
|
|
114
114
|
case 4:
|
|
115
115
|
this.addressLookupTables = addresses;
|
|
116
|
-
|
|
116
|
+
_b = this;
|
|
117
|
+
return [4, this.provider.connection.getAddressLookupTable(poolConfig.pusherAddressLookupTableAddress)];
|
|
117
118
|
case 5:
|
|
118
|
-
|
|
119
|
+
_b.pusherAddressLookupTables = (_c.sent()).value;
|
|
120
|
+
return [4, (0, spl_token_1.getMinimumBalanceForRentExemptAccount)(this.provider.connection)];
|
|
121
|
+
case 6:
|
|
122
|
+
accCreationLamports = (_c.sent());
|
|
119
123
|
if (accCreationLamports) {
|
|
120
124
|
this.minimumBalanceForRentExemptAccountLamports = accCreationLamports;
|
|
121
125
|
}
|
|
@@ -6678,7 +6682,7 @@ var PerpetualsClient = (function () {
|
|
|
6678
6682
|
_g.label = 16;
|
|
6679
6683
|
case 16:
|
|
6680
6684
|
if (_d) {
|
|
6681
|
-
preInstructions.push((0, spl_token_1.createAssociatedTokenAccountInstruction)(publicKey, userOutputTokenAccount, publicKey, poolConfig.getTokenFromSymbol(userOutputTokenSymbol).mintKey));
|
|
6685
|
+
preInstructions.push((0, spl_token_1.createAssociatedTokenAccountInstruction)(publicKey, userOutputTokenAccount, publicKey, poolConfig.getTokenFromSymbol(userOutputTokenSymbol).mintKey, poolConfig.getTokenFromSymbol(userOutputTokenSymbol).isToken2022 ? spl_token_1.TOKEN_2022_PROGRAM_ID : spl_token_1.TOKEN_PROGRAM_ID));
|
|
6682
6686
|
}
|
|
6683
6687
|
_g.label = 17;
|
|
6684
6688
|
case 17:
|
package/dist/PoolAccount.d.ts
CHANGED
package/dist/PoolConfig.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ export declare class PoolConfig {
|
|
|
72
72
|
protocolTokenAccount: PublicKey;
|
|
73
73
|
multisig: PublicKey;
|
|
74
74
|
addressLookupTableAddresses: PublicKey[];
|
|
75
|
+
pusherAddressLookupTableAddress: PublicKey;
|
|
75
76
|
backupOracle: PublicKey;
|
|
76
77
|
nftCollectionAddress: PublicKey;
|
|
77
78
|
rewardDistributionProgram: {
|
|
@@ -84,7 +85,7 @@ export declare class PoolConfig {
|
|
|
84
85
|
tokens: Token[];
|
|
85
86
|
custodies: CustodyConfig[];
|
|
86
87
|
markets: MarketConfig[];
|
|
87
|
-
constructor(programId: PublicKey, perpComposibilityProgramId: PublicKey, fbNftRewardProgramId: PublicKey, cluster: Cluster, poolName: string, 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, revenueTokenAccount: PublicKey, protocolVault: PublicKey, protocolTokenAccount: PublicKey, multisig: PublicKey, addressLookupTableAddresses: PublicKey[], backupOracle: PublicKey, nftCollectionAddress: PublicKey, rewardDistributionProgram: {
|
|
88
|
+
constructor(programId: PublicKey, perpComposibilityProgramId: PublicKey, fbNftRewardProgramId: PublicKey, cluster: Cluster, poolName: string, 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, revenueTokenAccount: PublicKey, protocolVault: PublicKey, protocolTokenAccount: PublicKey, multisig: PublicKey, addressLookupTableAddresses: PublicKey[], pusherAddressLookupTableAddress: PublicKey, backupOracle: PublicKey, nftCollectionAddress: PublicKey, rewardDistributionProgram: {
|
|
88
89
|
programId: PublicKey;
|
|
89
90
|
transferAuthority: PublicKey;
|
|
90
91
|
rewardVault: PublicKey;
|
package/dist/PoolConfig.js
CHANGED
|
@@ -19,7 +19,7 @@ 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, poolAddress, stakedLpTokenMint, compoundingTokenMint, stakedLpVault, compoundingLpVault, lpDecimals, compoundingLpTokenSymbol, stakedLpTokenSymbol, perpetuals, transferAuthority, tokenMint, tokenVault, tokenVaultTokenAccount, revenueTokenAccount, protocolVault, protocolTokenAccount, multisig, addressLookupTableAddresses, backupOracle, nftCollectionAddress, rewardDistributionProgram, tokens, custodies, markets) {
|
|
22
|
+
function PoolConfig(programId, perpComposibilityProgramId, fbNftRewardProgramId, cluster, poolName, poolAddress, stakedLpTokenMint, compoundingTokenMint, stakedLpVault, compoundingLpVault, lpDecimals, compoundingLpTokenSymbol, stakedLpTokenSymbol, perpetuals, transferAuthority, tokenMint, tokenVault, tokenVaultTokenAccount, revenueTokenAccount, protocolVault, protocolTokenAccount, multisig, addressLookupTableAddresses, pusherAddressLookupTableAddress, backupOracle, nftCollectionAddress, rewardDistributionProgram, tokens, custodies, markets) {
|
|
23
23
|
var _this = this;
|
|
24
24
|
this.programId = programId;
|
|
25
25
|
this.perpComposibilityProgramId = perpComposibilityProgramId;
|
|
@@ -44,6 +44,7 @@ var PoolConfig = (function () {
|
|
|
44
44
|
this.protocolTokenAccount = protocolTokenAccount;
|
|
45
45
|
this.multisig = multisig;
|
|
46
46
|
this.addressLookupTableAddresses = addressLookupTableAddresses;
|
|
47
|
+
this.pusherAddressLookupTableAddress = pusherAddressLookupTableAddress;
|
|
47
48
|
this.backupOracle = backupOracle;
|
|
48
49
|
this.nftCollectionAddress = nftCollectionAddress;
|
|
49
50
|
this.rewardDistributionProgram = rewardDistributionProgram;
|
|
@@ -170,6 +171,13 @@ var PoolConfig = (function () {
|
|
|
170
171
|
catch (error) {
|
|
171
172
|
console.log("ERROR: buildPoolconfigFromJson unable to load addressLookupTableAddresses ");
|
|
172
173
|
}
|
|
174
|
+
var pusherAddressLookupTableAddress;
|
|
175
|
+
try {
|
|
176
|
+
pusherAddressLookupTableAddress = new web3_js_1.PublicKey(poolConfig['pusherAddressLookupTableAddress']);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.log("ERROR: buildPoolconfigFromJson unable to load pusherAddressLookupTableAddress ");
|
|
180
|
+
}
|
|
173
181
|
var markets;
|
|
174
182
|
try {
|
|
175
183
|
markets = poolConfig['markets'].map(function (i) {
|
|
@@ -179,7 +187,7 @@ var PoolConfig = (function () {
|
|
|
179
187
|
catch (error) {
|
|
180
188
|
console.log("ERROR: buildPoolconfigFromJson unable to load markets ");
|
|
181
189
|
}
|
|
182
|
-
return new PoolConfig(new web3_js_1.PublicKey(poolConfig.programId), new web3_js_1.PublicKey(poolConfig.perpComposibilityProgramId), new web3_js_1.PublicKey(poolConfig.fbNftRewardProgramId), poolConfig.cluster, poolConfig.poolName, new web3_js_1.PublicKey(poolConfig.poolAddress), new web3_js_1.PublicKey(poolConfig.stakedLpTokenMint), new web3_js_1.PublicKey(poolConfig.compoundingTokenMint), new web3_js_1.PublicKey(poolConfig.stakedLpVault), new web3_js_1.PublicKey(poolConfig.compoundingLpVault), poolConfig.lpDecimals, poolConfig.compoundingLpTokenSymbol, poolConfig.stakedLpTokenSymbol, new web3_js_1.PublicKey(poolConfig.perpetuals), new web3_js_1.PublicKey(poolConfig.transferAuthority), new web3_js_1.PublicKey(poolConfig.tokenMint), new web3_js_1.PublicKey(poolConfig.tokenVault), new web3_js_1.PublicKey(poolConfig.tokenVaultTokenAccount), new web3_js_1.PublicKey(poolConfig.revenueTokenAccount), new web3_js_1.PublicKey(poolConfig.protocolVault), new web3_js_1.PublicKey(poolConfig.protocolTokenAccount), new web3_js_1.PublicKey(poolConfig.multisig), addressLookupTableAddresses, new web3_js_1.PublicKey(poolConfig.backupOracle), new web3_js_1.PublicKey(poolConfig.nftCollectionAddress), {
|
|
190
|
+
return new PoolConfig(new web3_js_1.PublicKey(poolConfig.programId), new web3_js_1.PublicKey(poolConfig.perpComposibilityProgramId), new web3_js_1.PublicKey(poolConfig.fbNftRewardProgramId), poolConfig.cluster, poolConfig.poolName, new web3_js_1.PublicKey(poolConfig.poolAddress), new web3_js_1.PublicKey(poolConfig.stakedLpTokenMint), new web3_js_1.PublicKey(poolConfig.compoundingTokenMint), new web3_js_1.PublicKey(poolConfig.stakedLpVault), new web3_js_1.PublicKey(poolConfig.compoundingLpVault), poolConfig.lpDecimals, poolConfig.compoundingLpTokenSymbol, poolConfig.stakedLpTokenSymbol, new web3_js_1.PublicKey(poolConfig.perpetuals), new web3_js_1.PublicKey(poolConfig.transferAuthority), new web3_js_1.PublicKey(poolConfig.tokenMint), new web3_js_1.PublicKey(poolConfig.tokenVault), new web3_js_1.PublicKey(poolConfig.tokenVaultTokenAccount), new web3_js_1.PublicKey(poolConfig.revenueTokenAccount), new web3_js_1.PublicKey(poolConfig.protocolVault), new web3_js_1.PublicKey(poolConfig.protocolTokenAccount), new web3_js_1.PublicKey(poolConfig.multisig), addressLookupTableAddresses, pusherAddressLookupTableAddress, new web3_js_1.PublicKey(poolConfig.backupOracle), new web3_js_1.PublicKey(poolConfig.nftCollectionAddress), {
|
|
183
191
|
programId: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.programId),
|
|
184
192
|
rewardMint: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.rewardMint),
|
|
185
193
|
rewardTokenAccount: new web3_js_1.PublicKey(poolConfig.rewardDistributionProgram.rewardTokenAccount),
|