@drift-labs/sdk 0.2.0-master.26 → 0.2.0-master.27
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/lib/accounts/pollingClearingHouseAccountSubscriber.d.ts +1 -0
- package/lib/accounts/pollingClearingHouseAccountSubscriber.js +3 -0
- package/lib/accounts/types.d.ts +1 -0
- package/lib/accounts/webSocketClearingHouseAccountSubscriber.d.ts +1 -0
- package/lib/accounts/webSocketClearingHouseAccountSubscriber.js +3 -0
- package/lib/admin.d.ts +5 -2
- package/lib/admin.js +30 -4
- package/lib/clearingHouse.d.ts +2 -0
- package/lib/clearingHouse.js +14 -1
- package/lib/clearingHouseUser.d.ts +11 -9
- package/lib/clearingHouseUser.js +182 -106
- package/lib/config.js +1 -1
- package/lib/dlob/DLOB.d.ts +73 -0
- package/lib/dlob/DLOB.js +557 -0
- package/lib/dlob/DLOBNode.d.ts +52 -0
- package/lib/dlob/DLOBNode.js +82 -0
- package/lib/dlob/NodeList.d.ts +26 -0
- package/lib/dlob/NodeList.js +138 -0
- package/lib/idl/clearing_house.json +122 -202
- package/lib/index.d.ts +5 -0
- package/lib/index.js +5 -0
- package/lib/math/market.d.ts +1 -1
- package/lib/math/market.js +1 -1
- package/lib/math/orders.d.ts +3 -3
- package/lib/math/orders.js +31 -16
- package/lib/math/spotBalance.d.ts +3 -0
- package/lib/math/spotBalance.js +18 -1
- package/lib/math/spotPosition.d.ts +5 -1
- package/lib/math/spotPosition.js +16 -1
- package/lib/types.d.ts +24 -23
- package/lib/types.js +9 -3
- package/lib/userMap/userMap.d.ts +25 -0
- package/lib/userMap/userMap.js +73 -0
- package/lib/userMap/userStatsMap.d.ts +19 -0
- package/lib/userMap/userStatsMap.js +68 -0
- package/package.json +6 -3
- package/src/accounts/pollingClearingHouseAccountSubscriber.ts +4 -0
- package/src/accounts/types.ts +1 -0
- package/src/accounts/webSocketClearingHouseAccountSubscriber.ts +6 -0
- package/src/addresses/marketAddresses.js +26 -0
- package/src/admin.ts +50 -8
- package/src/assert/assert.js +1 -1
- package/src/clearingHouse.ts +23 -1
- package/src/clearingHouseUser.ts +364 -165
- package/src/config.ts +1 -1
- package/src/constants/banks.js +42 -0
- package/src/constants/{perpMarkets.js → markets.js} +11 -11
- package/src/dlob/DLOB.ts +884 -0
- package/src/dlob/DLOBNode.ts +163 -0
- package/src/dlob/NodeList.ts +185 -0
- package/src/events/eventList.js +23 -66
- package/src/events/txEventCache.js +19 -22
- package/src/examples/makeTradeExample.js +157 -0
- package/src/factory/bigNum.js +180 -183
- package/src/factory/oracleClient.js +9 -9
- package/src/idl/clearing_house.json +122 -202
- package/src/index.ts +5 -0
- package/src/math/auction.js +10 -10
- package/src/math/conversion.js +3 -4
- package/src/math/funding.js +175 -223
- package/src/math/market.ts +1 -1
- package/src/math/orders.ts +29 -21
- package/src/math/repeg.js +40 -40
- package/src/math/spotBalance.ts +26 -0
- package/src/math/spotPosition.ts +42 -1
- package/src/math/trade.js +74 -81
- package/src/math/utils.js +7 -8
- package/src/math/utils.js.map +1 -0
- package/src/oracles/oracleClientCache.js +9 -10
- package/src/oracles/pythClient.js +17 -52
- package/src/oracles/quoteAssetOracleClient.js +13 -44
- package/src/oracles/switchboardClient.js +37 -69
- package/src/oracles/types.js +1 -1
- package/src/token/index.js +4 -4
- package/src/tx/types.js +1 -1
- package/src/tx/utils.js +6 -7
- package/src/types.ts +25 -23
- package/src/userMap/userMap.ts +100 -0
- package/src/userMap/userStatsMap.ts +110 -0
- package/src/userName.js +5 -5
- package/src/util/computeUnits.js +11 -46
- package/src/util/getTokenAddress.js +9 -0
- package/src/util/promiseTimeout.js +5 -5
- package/src/util/tps.js +12 -46
- package/src/wallet.js +18 -55
- package/tests/bn/test.ts +2 -3
- package/tests/dlob/helpers.ts +322 -0
- package/tests/dlob/test.ts +2865 -0
- package/my-script/.env +0 -7
- package/my-script/getUserStats.ts +0 -106
- package/my-script/multiConnections.ts +0 -119
- package/my-script/test-regex.ts +0 -11
- package/my-script/utils.ts +0 -52
- package/src/accounts/bulkAccountLoader.js +0 -249
- package/src/accounts/bulkUserStatsSubscription.js +0 -75
- package/src/accounts/bulkUserSubscription.js +0 -75
- package/src/accounts/fetch.js +0 -92
- package/src/accounts/pollingClearingHouseAccountSubscriber.js +0 -465
- package/src/accounts/pollingOracleSubscriber.js +0 -156
- package/src/accounts/pollingTokenAccountSubscriber.js +0 -141
- package/src/accounts/pollingUserAccountSubscriber.js +0 -208
- package/src/accounts/pollingUserStatsAccountSubscriber.js +0 -208
- package/src/accounts/types.js +0 -28
- package/src/accounts/utils.js +0 -7
- package/src/accounts/webSocketAccountSubscriber.js +0 -138
- package/src/accounts/webSocketClearingHouseAccountSubscriber.js +0 -433
- package/src/accounts/webSocketUserAccountSubscriber.js +0 -113
- package/src/accounts/webSocketUserStatsAccountSubsriber.js +0 -113
- package/src/addresses/pda.js +0 -186
- package/src/admin.js +0 -1284
- package/src/clearingHouse.js +0 -3433
- package/src/clearingHouseConfig.js +0 -2
- package/src/clearingHouseUser.js +0 -874
- package/src/clearingHouseUserConfig.js +0 -2
- package/src/clearingHouseUserStats.js +0 -115
- package/src/clearingHouseUserStatsConfig.js +0 -2
- package/src/config.js +0 -80
- package/src/constants/numericConstants.js +0 -48
- package/src/constants/spotMarkets.js +0 -51
- package/src/events/eventSubscriber.js +0 -202
- package/src/events/fetchLogs.js +0 -117
- package/src/events/pollingLogProvider.js +0 -113
- package/src/events/sort.js +0 -41
- package/src/events/types.js +0 -25
- package/src/events/webSocketLogProvider.js +0 -76
- package/src/index.js +0 -75
- package/src/math/amm.js +0 -422
- package/src/math/insurance.js +0 -27
- package/src/math/margin.js +0 -77
- package/src/math/market.js +0 -105
- package/src/math/oracles.js +0 -56
- package/src/math/orders.js +0 -153
- package/src/math/position.js +0 -172
- package/src/math/spotBalance.js +0 -176
- package/src/math/spotMarket.js +0 -8
- package/src/math/spotPosition.js +0 -8
- package/src/orderParams.js +0 -28
- package/src/serum/serumSubscriber.js +0 -102
- package/src/serum/types.js +0 -2
- package/src/slot/SlotSubscriber.js +0 -86
- package/src/tokenFaucet.js +0 -323
- package/src/tx/retryTxSender.js +0 -280
- package/src/types.js +0 -216
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
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 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.__esModule = true;
|
|
39
|
-
exports.PollingLogProvider = void 0;
|
|
40
|
-
var fetchLogs_1 = require("./fetchLogs");
|
|
41
|
-
var PollingLogProvider = /** @class */ (function () {
|
|
42
|
-
function PollingLogProvider(connection, programId, commitment, frequency) {
|
|
43
|
-
if (frequency === void 0) { frequency = 15 * 1000; }
|
|
44
|
-
this.connection = connection;
|
|
45
|
-
this.programId = programId;
|
|
46
|
-
this.frequency = frequency;
|
|
47
|
-
this.firstFetch = true;
|
|
48
|
-
this.finality = commitment === 'finalized' ? 'finalized' : 'confirmed';
|
|
49
|
-
}
|
|
50
|
-
PollingLogProvider.prototype.subscribe = function (callback, skipHistory) {
|
|
51
|
-
var _this = this;
|
|
52
|
-
if (this.intervalId) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
this.intervalId = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
56
|
-
var response, mostRecentTx, transactionLogs, _i, transactionLogs_1, _a, txSig, slot, logs, e_1;
|
|
57
|
-
return __generator(this, function (_b) {
|
|
58
|
-
switch (_b.label) {
|
|
59
|
-
case 0:
|
|
60
|
-
if (this.mutex === 1) {
|
|
61
|
-
return [2 /*return*/];
|
|
62
|
-
}
|
|
63
|
-
this.mutex = 1;
|
|
64
|
-
_b.label = 1;
|
|
65
|
-
case 1:
|
|
66
|
-
_b.trys.push([1, 3, 4, 5]);
|
|
67
|
-
return [4 /*yield*/, (0, fetchLogs_1.fetchLogs)(this.connection, this.programId, this.finality, undefined, this.mostRecentSeenTx,
|
|
68
|
-
// If skipping history, only fetch one log back, not the maximum amount available
|
|
69
|
-
skipHistory && this.firstFetch ? 1 : undefined)];
|
|
70
|
-
case 2:
|
|
71
|
-
response = _b.sent();
|
|
72
|
-
this.firstFetch = false;
|
|
73
|
-
if (response === undefined) {
|
|
74
|
-
return [2 /*return*/];
|
|
75
|
-
}
|
|
76
|
-
mostRecentTx = response.mostRecentTx, transactionLogs = response.transactionLogs;
|
|
77
|
-
for (_i = 0, transactionLogs_1 = transactionLogs; _i < transactionLogs_1.length; _i++) {
|
|
78
|
-
_a = transactionLogs_1[_i], txSig = _a.txSig, slot = _a.slot, logs = _a.logs;
|
|
79
|
-
callback(txSig, slot, logs);
|
|
80
|
-
}
|
|
81
|
-
this.mostRecentSeenTx = mostRecentTx;
|
|
82
|
-
return [3 /*break*/, 5];
|
|
83
|
-
case 3:
|
|
84
|
-
e_1 = _b.sent();
|
|
85
|
-
console.error('PollingLogProvider threw an Error');
|
|
86
|
-
console.error(e_1);
|
|
87
|
-
return [3 /*break*/, 5];
|
|
88
|
-
case 4:
|
|
89
|
-
this.mutex = 0;
|
|
90
|
-
return [7 /*endfinally*/];
|
|
91
|
-
case 5: return [2 /*return*/];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}); }, this.frequency);
|
|
95
|
-
return true;
|
|
96
|
-
};
|
|
97
|
-
PollingLogProvider.prototype.isSubscribed = function () {
|
|
98
|
-
return this.intervalId !== undefined;
|
|
99
|
-
};
|
|
100
|
-
PollingLogProvider.prototype.unsubscribe = function () {
|
|
101
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
-
return __generator(this, function (_a) {
|
|
103
|
-
if (this.intervalId !== undefined) {
|
|
104
|
-
clearInterval(this.intervalId);
|
|
105
|
-
this.intervalId = undefined;
|
|
106
|
-
}
|
|
107
|
-
return [2 /*return*/, true];
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
return PollingLogProvider;
|
|
112
|
-
}());
|
|
113
|
-
exports.PollingLogProvider = PollingLogProvider;
|
package/src/events/sort.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.getSortFn = void 0;
|
|
4
|
-
var index_1 = require("../index");
|
|
5
|
-
function clientSortAscFn() {
|
|
6
|
-
return 'less than';
|
|
7
|
-
}
|
|
8
|
-
function clientSortDescFn() {
|
|
9
|
-
return 'greater than';
|
|
10
|
-
}
|
|
11
|
-
function defaultBlockchainSortFn(currentEvent, newEvent) {
|
|
12
|
-
return currentEvent.slot <= newEvent.slot ? 'less than' : 'greater than';
|
|
13
|
-
}
|
|
14
|
-
function orderActionRecordSortFn(currentEvent, newEvent) {
|
|
15
|
-
var _a, _b;
|
|
16
|
-
var currentEventMarketIndex = currentEvent.marketIndex;
|
|
17
|
-
var newEventMarketIndex = newEvent.marketIndex;
|
|
18
|
-
if (!currentEventMarketIndex.eq(newEventMarketIndex)) {
|
|
19
|
-
return currentEvent.ts.lte(newEvent.ts) ? 'less than' : 'greater than';
|
|
20
|
-
}
|
|
21
|
-
if (((_a = currentEvent.fillRecordId) === null || _a === void 0 ? void 0 : _a.gt(index_1.ZERO)) && ((_b = newEvent.fillRecordId) === null || _b === void 0 ? void 0 : _b.gt(index_1.ZERO))) {
|
|
22
|
-
return currentEvent.fillRecordId.lte(newEvent.fillRecordId)
|
|
23
|
-
? 'less than'
|
|
24
|
-
: 'greater than';
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return currentEvent.ts.lte(newEvent.ts) ? 'less than' : 'greater than';
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function getSortFn(orderBy, orderDir, eventType) {
|
|
31
|
-
if (orderBy === 'client') {
|
|
32
|
-
return orderDir === 'asc' ? clientSortAscFn : clientSortDescFn;
|
|
33
|
-
}
|
|
34
|
-
switch (eventType) {
|
|
35
|
-
case 'OrderActionRecord':
|
|
36
|
-
return orderActionRecordSortFn;
|
|
37
|
-
default:
|
|
38
|
-
return defaultBlockchainSortFn;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.getSortFn = getSortFn;
|
package/src/events/types.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.DefaultEventSubscriptionOptions = void 0;
|
|
4
|
-
exports.DefaultEventSubscriptionOptions = {
|
|
5
|
-
eventTypes: [
|
|
6
|
-
'DepositRecord',
|
|
7
|
-
'FundingPaymentRecord',
|
|
8
|
-
'LiquidationRecord',
|
|
9
|
-
'OrderRecord',
|
|
10
|
-
'OrderActionRecord',
|
|
11
|
-
'FundingRateRecord',
|
|
12
|
-
'NewUserRecord',
|
|
13
|
-
'SettlePnlRecord',
|
|
14
|
-
'LPRecord',
|
|
15
|
-
'InsuranceFundRecord',
|
|
16
|
-
],
|
|
17
|
-
maxEventsPerType: 4096,
|
|
18
|
-
orderBy: 'blockchain',
|
|
19
|
-
orderDir: 'asc',
|
|
20
|
-
commitment: 'confirmed',
|
|
21
|
-
maxTx: 4096,
|
|
22
|
-
logProviderConfig: {
|
|
23
|
-
type: 'websocket'
|
|
24
|
-
}
|
|
25
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
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 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.__esModule = true;
|
|
39
|
-
exports.WebSocketLogProvider = void 0;
|
|
40
|
-
var WebSocketLogProvider = /** @class */ (function () {
|
|
41
|
-
function WebSocketLogProvider(connection, programId, commitment) {
|
|
42
|
-
this.connection = connection;
|
|
43
|
-
this.programId = programId;
|
|
44
|
-
this.commitment = commitment;
|
|
45
|
-
}
|
|
46
|
-
WebSocketLogProvider.prototype.subscribe = function (callback) {
|
|
47
|
-
if (this.subscriptionId) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
this.subscriptionId = this.connection.onLogs(this.programId, function (logs, ctx) {
|
|
51
|
-
callback(logs.signature, ctx.slot, logs.logs);
|
|
52
|
-
}, this.commitment);
|
|
53
|
-
return true;
|
|
54
|
-
};
|
|
55
|
-
WebSocketLogProvider.prototype.isSubscribed = function () {
|
|
56
|
-
return this.subscriptionId !== undefined;
|
|
57
|
-
};
|
|
58
|
-
WebSocketLogProvider.prototype.unsubscribe = function () {
|
|
59
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
-
return __generator(this, function (_a) {
|
|
61
|
-
switch (_a.label) {
|
|
62
|
-
case 0:
|
|
63
|
-
if (!(this.subscriptionId !== undefined)) return [3 /*break*/, 2];
|
|
64
|
-
return [4 /*yield*/, this.connection.removeOnLogsListener(this.subscriptionId)];
|
|
65
|
-
case 1:
|
|
66
|
-
_a.sent();
|
|
67
|
-
this.subscriptionId = undefined;
|
|
68
|
-
_a.label = 2;
|
|
69
|
-
case 2: return [2 /*return*/, true];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
return WebSocketLogProvider;
|
|
75
|
-
}());
|
|
76
|
-
exports.WebSocketLogProvider = WebSocketLogProvider;
|
package/src/index.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
exports.__esModule = true;
|
|
13
|
-
exports.pyth = exports.PublicKey = exports.BN = void 0;
|
|
14
|
-
var anchor_1 = require("@project-serum/anchor");
|
|
15
|
-
exports.BN = anchor_1.BN;
|
|
16
|
-
var web3_js_1 = require("@solana/web3.js");
|
|
17
|
-
exports.PublicKey = web3_js_1.PublicKey;
|
|
18
|
-
var client_1 = require("@pythnetwork/client");
|
|
19
|
-
exports.pyth = client_1["default"];
|
|
20
|
-
__exportStar(require("./tokenFaucet"), exports);
|
|
21
|
-
__exportStar(require("./oracles/types"), exports);
|
|
22
|
-
__exportStar(require("./oracles/pythClient"), exports);
|
|
23
|
-
__exportStar(require("./oracles/switchboardClient"), exports);
|
|
24
|
-
__exportStar(require("./types"), exports);
|
|
25
|
-
__exportStar(require("./constants/perpMarkets"), exports);
|
|
26
|
-
__exportStar(require("./accounts/fetch"), exports);
|
|
27
|
-
__exportStar(require("./accounts/webSocketClearingHouseAccountSubscriber"), exports);
|
|
28
|
-
__exportStar(require("./accounts/bulkAccountLoader"), exports);
|
|
29
|
-
__exportStar(require("./accounts/bulkUserSubscription"), exports);
|
|
30
|
-
__exportStar(require("./accounts/bulkUserStatsSubscription"), exports);
|
|
31
|
-
__exportStar(require("./accounts/pollingClearingHouseAccountSubscriber"), exports);
|
|
32
|
-
__exportStar(require("./accounts/pollingOracleSubscriber"), exports);
|
|
33
|
-
__exportStar(require("./accounts/pollingTokenAccountSubscriber"), exports);
|
|
34
|
-
__exportStar(require("./accounts/pollingUserAccountSubscriber"), exports);
|
|
35
|
-
__exportStar(require("./accounts/pollingUserStatsAccountSubscriber"), exports);
|
|
36
|
-
__exportStar(require("./accounts/types"), exports);
|
|
37
|
-
__exportStar(require("./addresses/pda"), exports);
|
|
38
|
-
__exportStar(require("./admin"), exports);
|
|
39
|
-
__exportStar(require("./clearingHouseUser"), exports);
|
|
40
|
-
__exportStar(require("./clearingHouseUserConfig"), exports);
|
|
41
|
-
__exportStar(require("./clearingHouseUserStats"), exports);
|
|
42
|
-
__exportStar(require("./clearingHouseUserStatsConfig"), exports);
|
|
43
|
-
__exportStar(require("./clearingHouse"), exports);
|
|
44
|
-
__exportStar(require("./factory/oracleClient"), exports);
|
|
45
|
-
__exportStar(require("./factory/bigNum"), exports);
|
|
46
|
-
__exportStar(require("./events/types"), exports);
|
|
47
|
-
__exportStar(require("./events/eventSubscriber"), exports);
|
|
48
|
-
__exportStar(require("./events/fetchLogs"), exports);
|
|
49
|
-
__exportStar(require("./math/auction"), exports);
|
|
50
|
-
__exportStar(require("./math/spotMarket"), exports);
|
|
51
|
-
__exportStar(require("./math/conversion"), exports);
|
|
52
|
-
__exportStar(require("./math/funding"), exports);
|
|
53
|
-
__exportStar(require("./math/market"), exports);
|
|
54
|
-
__exportStar(require("./math/position"), exports);
|
|
55
|
-
__exportStar(require("./math/oracles"), exports);
|
|
56
|
-
__exportStar(require("./math/amm"), exports);
|
|
57
|
-
__exportStar(require("./math/trade"), exports);
|
|
58
|
-
__exportStar(require("./math/orders"), exports);
|
|
59
|
-
__exportStar(require("./math/repeg"), exports);
|
|
60
|
-
__exportStar(require("./math/margin"), exports);
|
|
61
|
-
__exportStar(require("./math/insurance"), exports);
|
|
62
|
-
__exportStar(require("./orderParams"), exports);
|
|
63
|
-
__exportStar(require("./slot/SlotSubscriber"), exports);
|
|
64
|
-
__exportStar(require("./wallet"), exports);
|
|
65
|
-
__exportStar(require("./types"), exports);
|
|
66
|
-
__exportStar(require("./math/utils"), exports);
|
|
67
|
-
__exportStar(require("./config"), exports);
|
|
68
|
-
__exportStar(require("./constants/numericConstants"), exports);
|
|
69
|
-
__exportStar(require("./serum/serumSubscriber"), exports);
|
|
70
|
-
__exportStar(require("./tx/retryTxSender"), exports);
|
|
71
|
-
__exportStar(require("./util/computeUnits"), exports);
|
|
72
|
-
__exportStar(require("./util/tps"), exports);
|
|
73
|
-
__exportStar(require("./math/spotBalance"), exports);
|
|
74
|
-
__exportStar(require("./constants/spotMarkets"), exports);
|
|
75
|
-
__exportStar(require("./clearingHouseConfig"), exports);
|