flash-sdk 2.54.9-alpha.0 → 2.54.11-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 +0 -2
- package/dist/PerpetualsClient.js +18 -21
- package/dist/PoolAccount.d.ts +0 -1
- 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/idl/perpetuals.d.ts +19 -34
- package/dist/idl/perpetuals.js +19 -34
- 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/utils/index.js
CHANGED
@@ -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;
|
13
|
-
return g =
|
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;
|
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.");
|
@@ -39,7 +39,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
40
40
|
};
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
42
|
-
exports.checkedDecimalDiv = exports.checkedDecimalMul = exports.checkedDecimalCeilMul = exports.checkedCeilDiv = exports.scaleToExponent = exports.
|
42
|
+
exports.checkedDecimalDiv = exports.checkedDecimalMul = exports.checkedDecimalCeilMul = exports.checkedCeilDiv = exports.scaleToExponent = exports.validateNumberString = exports.uiDecimalsToNative = exports.getUnixTs = void 0;
|
43
|
+
exports.toUiDecimalsOldSDK = toUiDecimalsOldSDK;
|
44
|
+
exports.nativeToUiDecimals = nativeToUiDecimals;
|
45
|
+
exports.checkIfAccountExists = checkIfAccountExists;
|
43
46
|
var bn_js_1 = __importDefault(require("bn.js"));
|
44
47
|
var constants_1 = require("../constants");
|
45
48
|
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
@@ -89,7 +92,6 @@ function toUiDecimalsOldSDK(nativeAmount, decimals, precision, commaSeperated) {
|
|
89
92
|
return r;
|
90
93
|
}
|
91
94
|
}
|
92
|
-
exports.toUiDecimalsOldSDK = toUiDecimalsOldSDK;
|
93
95
|
var uiDecimalsToNative = function (amountUi, decimals) {
|
94
96
|
var valueBigNumber = (new bignumber_js_1.default(amountUi)).multipliedBy(new bignumber_js_1.default(Math.pow(10, decimals)));
|
95
97
|
return new bn_js_1.default(valueBigNumber.toFixed(0, bignumber_js_1.default.ROUND_DOWN));
|
@@ -137,7 +139,6 @@ function nativeToUiDecimals(nativeAmount, decimals, precision, commaSeperated) {
|
|
137
139
|
return r;
|
138
140
|
}
|
139
141
|
}
|
140
|
-
exports.nativeToUiDecimals = nativeToUiDecimals;
|
141
142
|
function checkIfAccountExists(account, connection) {
|
142
143
|
return __awaiter(this, void 0, void 0, function () {
|
143
144
|
var bal;
|
@@ -157,7 +158,6 @@ function checkIfAccountExists(account, connection) {
|
|
157
158
|
});
|
158
159
|
});
|
159
160
|
}
|
160
|
-
exports.checkIfAccountExists = checkIfAccountExists;
|
161
161
|
var scaleToExponent = function (arg, exponent, target_exponent) {
|
162
162
|
if (target_exponent.eq(exponent)) {
|
163
163
|
return arg;
|
package/dist/utils/rpc.js
CHANGED
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
24
24
|
});
|
25
25
|
};
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
28
|
-
return g =
|
27
|
+
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);
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
30
30
|
function step(op) {
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
@@ -63,7 +63,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
63
63
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
64
64
|
};
|
65
65
|
Object.defineProperty(exports, "__esModule", { value: true });
|
66
|
-
exports.TransactionFailError = exports.createComputeBudgetIx =
|
66
|
+
exports.TransactionFailError = exports.createComputeBudgetIx = void 0;
|
67
|
+
exports.sendTransaction = sendTransaction;
|
68
|
+
exports.confirmTransaction = confirmTransaction;
|
69
|
+
exports.sendTransactionV2 = sendTransactionV2;
|
70
|
+
exports.confirmTransactionV2 = confirmTransactionV2;
|
71
|
+
exports.sendTransactionV3 = sendTransactionV3;
|
72
|
+
exports.confirmTransactionV3 = confirmTransactionV3;
|
67
73
|
var nodewallet_1 = __importDefault(require("@coral-xyz/anchor/dist/cjs/nodewallet"));
|
68
74
|
var bytes_1 = require("@coral-xyz/anchor/dist/cjs/utils/bytes");
|
69
75
|
var web3_js_1 = require("@solana/web3.js");
|
@@ -118,7 +124,6 @@ function sendTransaction(provider_1, ixs_1) {
|
|
118
124
|
});
|
119
125
|
});
|
120
126
|
}
|
121
|
-
exports.sendTransaction = sendTransaction;
|
122
127
|
function confirmTransaction(provider_1, signature_1) {
|
123
128
|
return __awaiter(this, arguments, void 0, function (provider, signature, opts) {
|
124
129
|
var connection, latestBlockhash, _a, txConfirmationCommitment, status;
|
@@ -165,7 +170,6 @@ function confirmTransaction(provider_1, signature_1) {
|
|
165
170
|
});
|
166
171
|
});
|
167
172
|
}
|
168
|
-
exports.confirmTransaction = confirmTransaction;
|
169
173
|
function sendTransactionV2(provider_1, ixs_1) {
|
170
174
|
return __awaiter(this, arguments, void 0, function (provider, ixs, opts) {
|
171
175
|
var connection, latestBlockhash, _a, payer, message, vtx, signature;
|
@@ -217,7 +221,6 @@ function sendTransactionV2(provider_1, ixs_1) {
|
|
217
221
|
});
|
218
222
|
});
|
219
223
|
}
|
220
|
-
exports.sendTransactionV2 = sendTransactionV2;
|
221
224
|
var sleep = function (ms) { return new Promise(function (r) { return setTimeout(r, ms); }); };
|
222
225
|
function confirmTransactionV2(provider_1, versionedTransaction_1, signature_1) {
|
223
226
|
return __awaiter(this, arguments, void 0, function (provider, versionedTransaction, signature, opts) {
|
@@ -279,7 +282,6 @@ function confirmTransactionV2(provider_1, versionedTransaction_1, signature_1) {
|
|
279
282
|
});
|
280
283
|
});
|
281
284
|
}
|
282
|
-
exports.confirmTransactionV2 = confirmTransactionV2;
|
283
285
|
function sendTransactionV3(provider_1, ixs_1) {
|
284
286
|
return __awaiter(this, arguments, void 0, function (provider, ixs, opts) {
|
285
287
|
var connection, latestBlockhash, _a, payer, message, vtx, tx, signature;
|
@@ -332,7 +334,6 @@ function sendTransactionV3(provider_1, ixs_1) {
|
|
332
334
|
});
|
333
335
|
});
|
334
336
|
}
|
335
|
-
exports.sendTransactionV3 = sendTransactionV3;
|
336
337
|
function confirmTransactionV3(provider_1, versionedTransaction_1, signature_1) {
|
337
338
|
return __awaiter(this, arguments, void 0, function (provider, versionedTransaction, signature, opts) {
|
338
339
|
var connection, status, blockhashResponse, lastValidBlockHeight, blockheight, signatureStatuses, result, x;
|
@@ -399,7 +400,6 @@ function confirmTransactionV3(provider_1, versionedTransaction_1, signature_1) {
|
|
399
400
|
});
|
400
401
|
});
|
401
402
|
}
|
402
|
-
exports.confirmTransactionV3 = confirmTransactionV3;
|
403
403
|
var createComputeBudgetIx = function (microLamports) {
|
404
404
|
var computeBudgetIx = web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
|
405
405
|
microLamports: microLamports,
|