@0dotxyz/p0-ts-sdk 2.2.0-alpha.4 → 2.2.0-alpha.6
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/index.cjs +2245 -911
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +374 -176
- package/dist/index.d.ts +374 -176
- package/dist/index.js +2231 -913
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +365 -0
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +288 -3
- package/dist/vendor.d.ts +288 -3
- package/dist/vendor.js +356 -2
- package/dist/vendor.js.map +1 -1
- package/package.json +4 -4
package/dist/vendor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PublicKey, TransactionInstruction, SYSVAR_RENT_PUBKEY, SystemProgram, STAKE_CONFIG_ID, Transaction, LAMPORTS_PER_SOL, StakeProgram, SYSVAR_CLOCK_PUBKEY } from '@solana/web3.js';
|
|
1
|
+
import { PublicKey, TransactionInstruction, SYSVAR_RENT_PUBKEY, SystemProgram, STAKE_CONFIG_ID, Transaction, LAMPORTS_PER_SOL, StakeProgram, SYSVAR_CLOCK_PUBKEY, AddressLookupTableAccount } from '@solana/web3.js';
|
|
2
2
|
import 'bignumber.js';
|
|
3
3
|
import { deserialize } from 'borsh';
|
|
4
4
|
import BN2, { BN } from 'bn.js';
|
|
@@ -9,6 +9,8 @@ import { BorshCoder, BorshAccountsCoder, Program } from '@coral-xyz/anchor';
|
|
|
9
9
|
import * as borsh from '@coral-xyz/borsh';
|
|
10
10
|
import { struct as struct$1, bool as bool$1, publicKey as publicKey$1, array, u64 as u64$1, u8 as u8$1, u32 as u32$1, u128 } from '@coral-xyz/borsh';
|
|
11
11
|
import Decimal3 from 'decimal.js';
|
|
12
|
+
import WebSocket from 'ws';
|
|
13
|
+
import { Encoder, Decoder } from '@msgpack/msgpack';
|
|
12
14
|
|
|
13
15
|
// src/vendor/pyth_legacy/readBig.ts
|
|
14
16
|
var ERR_BUFFER_OUT_OF_BOUNDS = () => new Error("Attempt to access memory outside buffer bounds");
|
|
@@ -29165,7 +29167,359 @@ function makeUpdateJupLendRate({ lendingState }) {
|
|
|
29165
29167
|
lendingState.rewardsRateModel
|
|
29166
29168
|
);
|
|
29167
29169
|
}
|
|
29170
|
+
var SUBPROTOCOL = "v1.api.titan.ag";
|
|
29171
|
+
var UINT64_MAX = (1n << 64n) - 1n;
|
|
29172
|
+
function toBigInt(value) {
|
|
29173
|
+
if (typeof value === "bigint") {
|
|
29174
|
+
if (value < 0n || value > UINT64_MAX) {
|
|
29175
|
+
throw new RangeError(`Amount out of uint64 range: ${value}`);
|
|
29176
|
+
}
|
|
29177
|
+
return value;
|
|
29178
|
+
}
|
|
29179
|
+
if (!Number.isInteger(value)) {
|
|
29180
|
+
throw new TypeError(`Amount must be a whole number, got ${value}`);
|
|
29181
|
+
}
|
|
29182
|
+
if (value < 0) {
|
|
29183
|
+
throw new RangeError(`Amount must be non-negative, got ${value}`);
|
|
29184
|
+
}
|
|
29185
|
+
return BigInt(value);
|
|
29186
|
+
}
|
|
29187
|
+
var ConnectionClosed = class _ConnectionClosed extends Error {
|
|
29188
|
+
code;
|
|
29189
|
+
reason;
|
|
29190
|
+
constructor(code, reason) {
|
|
29191
|
+
super(`Client WebSocket closed with code ${code}: ${reason}`);
|
|
29192
|
+
this.name = "ConnectionClosed";
|
|
29193
|
+
Object.setPrototypeOf(this, _ConnectionClosed.prototype);
|
|
29194
|
+
this.code = code;
|
|
29195
|
+
this.reason = reason;
|
|
29196
|
+
}
|
|
29197
|
+
};
|
|
29198
|
+
var ErrorResponse = class _ErrorResponse extends Error {
|
|
29199
|
+
response;
|
|
29200
|
+
constructor(response) {
|
|
29201
|
+
super(`Request ${response.requestId} failed with code ${response.code}: ${response.message}`);
|
|
29202
|
+
this.name = "ErrorResponse";
|
|
29203
|
+
Object.setPrototypeOf(this, _ErrorResponse.prototype);
|
|
29204
|
+
this.response = response;
|
|
29205
|
+
}
|
|
29206
|
+
};
|
|
29207
|
+
var StreamError = class _StreamError extends Error {
|
|
29208
|
+
streamId;
|
|
29209
|
+
errorCode;
|
|
29210
|
+
errorMessage;
|
|
29211
|
+
constructor(packet) {
|
|
29212
|
+
const code = packet.errorCode ?? 0;
|
|
29213
|
+
const message = packet.errorMessage ?? "";
|
|
29214
|
+
super(`Stream ${packet.id} ended with error code ${code}: ${message}`);
|
|
29215
|
+
this.name = "StreamError";
|
|
29216
|
+
Object.setPrototypeOf(this, _StreamError.prototype);
|
|
29217
|
+
this.streamId = packet.id;
|
|
29218
|
+
this.errorCode = code;
|
|
29219
|
+
this.errorMessage = message;
|
|
29220
|
+
}
|
|
29221
|
+
};
|
|
29222
|
+
var encoder = new Encoder({ useBigInt64: true });
|
|
29223
|
+
var decoder = new Decoder({ useBigInt64: true });
|
|
29224
|
+
var V1Client = class _V1Client {
|
|
29225
|
+
socket;
|
|
29226
|
+
nextId = 0;
|
|
29227
|
+
_closed = false;
|
|
29228
|
+
_closing = false;
|
|
29229
|
+
pending = /* @__PURE__ */ new Map();
|
|
29230
|
+
streams = /* @__PURE__ */ new Map();
|
|
29231
|
+
streamStopping = /* @__PURE__ */ new Map();
|
|
29232
|
+
closeListeners = [];
|
|
29233
|
+
// --- Static connect ---
|
|
29234
|
+
static connect(url) {
|
|
29235
|
+
return new Promise((resolve, reject) => {
|
|
29236
|
+
const ws = new WebSocket(url, [SUBPROTOCOL]);
|
|
29237
|
+
ws.binaryType = "arraybuffer";
|
|
29238
|
+
const onOpen = () => {
|
|
29239
|
+
ws.off("error", onError);
|
|
29240
|
+
ws.off("close", onClose);
|
|
29241
|
+
resolve(new _V1Client(ws));
|
|
29242
|
+
};
|
|
29243
|
+
const onError = (err) => {
|
|
29244
|
+
ws.off("open", onOpen);
|
|
29245
|
+
ws.off("close", onClose);
|
|
29246
|
+
reject(err);
|
|
29247
|
+
};
|
|
29248
|
+
const onClose = (code, reason) => {
|
|
29249
|
+
ws.off("open", onOpen);
|
|
29250
|
+
ws.off("error", onError);
|
|
29251
|
+
reject(
|
|
29252
|
+
new Error(
|
|
29253
|
+
`WebSocket closed before open (code=${code}${reason.length ? `, reason=${reason.toString()}` : ""})`
|
|
29254
|
+
)
|
|
29255
|
+
);
|
|
29256
|
+
};
|
|
29257
|
+
ws.once("open", onOpen);
|
|
29258
|
+
ws.once("error", onError);
|
|
29259
|
+
ws.once("close", onClose);
|
|
29260
|
+
});
|
|
29261
|
+
}
|
|
29262
|
+
// --- Constructor ---
|
|
29263
|
+
constructor(socket) {
|
|
29264
|
+
this.socket = socket;
|
|
29265
|
+
this.socket.on("message", (data) => {
|
|
29266
|
+
this.handleMessage(data);
|
|
29267
|
+
});
|
|
29268
|
+
this.socket.on("close", (code, reason) => {
|
|
29269
|
+
this.handleClose(code, reason.toString());
|
|
29270
|
+
});
|
|
29271
|
+
this.socket.on("error", (err) => {
|
|
29272
|
+
this.handleError(err);
|
|
29273
|
+
});
|
|
29274
|
+
}
|
|
29275
|
+
nextRequestId() {
|
|
29276
|
+
return this.nextId++;
|
|
29277
|
+
}
|
|
29278
|
+
// --- Public API ---
|
|
29279
|
+
get closed() {
|
|
29280
|
+
return this._closed;
|
|
29281
|
+
}
|
|
29282
|
+
close() {
|
|
29283
|
+
if (this._closed) return Promise.resolve();
|
|
29284
|
+
return new Promise((resolve, reject) => {
|
|
29285
|
+
this.closeListeners.push({ resolve, reject });
|
|
29286
|
+
if (!this._closing) {
|
|
29287
|
+
this._closing = true;
|
|
29288
|
+
this.socket.close();
|
|
29289
|
+
}
|
|
29290
|
+
});
|
|
29291
|
+
}
|
|
29292
|
+
newSwapQuoteStream(params) {
|
|
29293
|
+
const requestId = this.nextRequestId();
|
|
29294
|
+
const promise = new Promise(
|
|
29295
|
+
(resolve, reject) => {
|
|
29296
|
+
this.pending.set(requestId, {
|
|
29297
|
+
resolve,
|
|
29298
|
+
reject,
|
|
29299
|
+
kind: "NewSwapQuoteStream"
|
|
29300
|
+
});
|
|
29301
|
+
}
|
|
29302
|
+
);
|
|
29303
|
+
const normalized = {
|
|
29304
|
+
...params,
|
|
29305
|
+
swap: { ...params.swap, amount: toBigInt(params.swap.amount) }
|
|
29306
|
+
};
|
|
29307
|
+
const message = {
|
|
29308
|
+
id: requestId,
|
|
29309
|
+
data: { NewSwapQuoteStream: normalized }
|
|
29310
|
+
};
|
|
29311
|
+
this.send(message);
|
|
29312
|
+
return promise;
|
|
29313
|
+
}
|
|
29314
|
+
stopStream(streamId) {
|
|
29315
|
+
const requestId = this.nextRequestId();
|
|
29316
|
+
const promise = new Promise((resolve, reject) => {
|
|
29317
|
+
this.pending.set(requestId, {
|
|
29318
|
+
resolve,
|
|
29319
|
+
reject,
|
|
29320
|
+
kind: "StopStream"
|
|
29321
|
+
});
|
|
29322
|
+
});
|
|
29323
|
+
const message = {
|
|
29324
|
+
id: requestId,
|
|
29325
|
+
data: { StopStream: { id: streamId } }
|
|
29326
|
+
};
|
|
29327
|
+
this.send(message);
|
|
29328
|
+
return promise;
|
|
29329
|
+
}
|
|
29330
|
+
// --- Send ---
|
|
29331
|
+
send(message) {
|
|
29332
|
+
try {
|
|
29333
|
+
const encoded = encoder.encode(message);
|
|
29334
|
+
this.socket.send(encoded);
|
|
29335
|
+
} catch (err) {
|
|
29336
|
+
const req = this.pending.get(message.id);
|
|
29337
|
+
if (req) {
|
|
29338
|
+
this.pending.delete(message.id);
|
|
29339
|
+
req.reject(err);
|
|
29340
|
+
}
|
|
29341
|
+
}
|
|
29342
|
+
}
|
|
29343
|
+
// --- Message handling ---
|
|
29344
|
+
handleMessage(raw) {
|
|
29345
|
+
let buf;
|
|
29346
|
+
if (raw instanceof ArrayBuffer) {
|
|
29347
|
+
buf = new Uint8Array(raw);
|
|
29348
|
+
} else if (Buffer.isBuffer(raw)) {
|
|
29349
|
+
buf = new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength);
|
|
29350
|
+
} else if (Array.isArray(raw)) {
|
|
29351
|
+
buf = new Uint8Array(Buffer.concat(raw));
|
|
29352
|
+
} else {
|
|
29353
|
+
return;
|
|
29354
|
+
}
|
|
29355
|
+
let message;
|
|
29356
|
+
try {
|
|
29357
|
+
message = decoder.decode(buf);
|
|
29358
|
+
} catch {
|
|
29359
|
+
this.socket.close(3002, "failed to decode message");
|
|
29360
|
+
return;
|
|
29361
|
+
}
|
|
29362
|
+
if ("Response" in message) {
|
|
29363
|
+
this.handleResponse(message.Response);
|
|
29364
|
+
} else if ("Error" in message) {
|
|
29365
|
+
this.handleResponseError(message.Error);
|
|
29366
|
+
} else if ("StreamData" in message) {
|
|
29367
|
+
this.handleStreamData(message.StreamData);
|
|
29368
|
+
} else if ("StreamEnd" in message) {
|
|
29369
|
+
this.handleStreamEnd(message.StreamEnd);
|
|
29370
|
+
}
|
|
29371
|
+
}
|
|
29372
|
+
handleResponse(msg) {
|
|
29373
|
+
const req = this.pending.get(msg.requestId);
|
|
29374
|
+
if (!req) return;
|
|
29375
|
+
this.pending.delete(msg.requestId);
|
|
29376
|
+
if ("NewSwapQuoteStream" in msg.data && req.kind === "NewSwapQuoteStream") {
|
|
29377
|
+
const streamInfo = msg.stream;
|
|
29378
|
+
if (!streamInfo) {
|
|
29379
|
+
req.reject(new Error("No stream associated with NewSwapQuoteStream response"));
|
|
29380
|
+
return;
|
|
29381
|
+
}
|
|
29382
|
+
const stream = new ReadableStream({
|
|
29383
|
+
start: (controller) => {
|
|
29384
|
+
this.streams.set(streamInfo.id, controller);
|
|
29385
|
+
},
|
|
29386
|
+
cancel: () => {
|
|
29387
|
+
return this.cancelStream(streamInfo.id);
|
|
29388
|
+
}
|
|
29389
|
+
});
|
|
29390
|
+
const result = {
|
|
29391
|
+
response: msg.data.NewSwapQuoteStream,
|
|
29392
|
+
stream,
|
|
29393
|
+
streamId: streamInfo.id
|
|
29394
|
+
};
|
|
29395
|
+
req.resolve(result);
|
|
29396
|
+
} else if ("StreamStopped" in msg.data && req.kind === "StopStream") {
|
|
29397
|
+
req.resolve(msg.data.StreamStopped);
|
|
29398
|
+
} else {
|
|
29399
|
+
req.reject(new Error(`Unexpected response type for ${req.kind}`));
|
|
29400
|
+
}
|
|
29401
|
+
}
|
|
29402
|
+
handleResponseError(error) {
|
|
29403
|
+
const req = this.pending.get(error.requestId);
|
|
29404
|
+
if (!req) return;
|
|
29405
|
+
this.pending.delete(error.requestId);
|
|
29406
|
+
req.reject(new ErrorResponse(error));
|
|
29407
|
+
}
|
|
29408
|
+
handleStreamData(packet) {
|
|
29409
|
+
const controller = this.streams.get(packet.id);
|
|
29410
|
+
if (!controller) return;
|
|
29411
|
+
if (packet.payload.SwapQuotes !== void 0) {
|
|
29412
|
+
controller.enqueue(packet.payload.SwapQuotes);
|
|
29413
|
+
}
|
|
29414
|
+
}
|
|
29415
|
+
handleStreamEnd(packet) {
|
|
29416
|
+
const controller = this.streams.get(packet.id);
|
|
29417
|
+
if (!controller) return;
|
|
29418
|
+
this.streams.delete(packet.id);
|
|
29419
|
+
this.streamStopping.delete(packet.id);
|
|
29420
|
+
if (packet.errorCode !== void 0) {
|
|
29421
|
+
controller.error(new StreamError(packet));
|
|
29422
|
+
} else {
|
|
29423
|
+
controller.close();
|
|
29424
|
+
}
|
|
29425
|
+
}
|
|
29426
|
+
async cancelStream(streamId) {
|
|
29427
|
+
if (this.streamStopping.get(streamId) || !this.streams.has(streamId)) return;
|
|
29428
|
+
this.streamStopping.set(streamId, true);
|
|
29429
|
+
await this.stopStream(streamId);
|
|
29430
|
+
}
|
|
29431
|
+
// --- Connection lifecycle ---
|
|
29432
|
+
rejectAll(error) {
|
|
29433
|
+
for (const req of this.pending.values()) {
|
|
29434
|
+
req.reject(error);
|
|
29435
|
+
}
|
|
29436
|
+
this.pending.clear();
|
|
29437
|
+
for (const controller of this.streams.values()) {
|
|
29438
|
+
controller.error(error);
|
|
29439
|
+
}
|
|
29440
|
+
this.streams.clear();
|
|
29441
|
+
this.streamStopping.clear();
|
|
29442
|
+
}
|
|
29443
|
+
handleClose(code, reason) {
|
|
29444
|
+
this._closed = true;
|
|
29445
|
+
this.rejectAll(new ConnectionClosed(code, reason));
|
|
29446
|
+
for (const listener of this.closeListeners) {
|
|
29447
|
+
listener.resolve();
|
|
29448
|
+
}
|
|
29449
|
+
this.closeListeners = [];
|
|
29450
|
+
}
|
|
29451
|
+
handleError(err) {
|
|
29452
|
+
this.rejectAll(err);
|
|
29453
|
+
this.socket.close(3002);
|
|
29454
|
+
}
|
|
29455
|
+
};
|
|
29456
|
+
|
|
29457
|
+
// src/vendor/titan/types.ts
|
|
29458
|
+
var SwapMode = /* @__PURE__ */ ((SwapMode2) => {
|
|
29459
|
+
SwapMode2["ExactIn"] = "ExactIn";
|
|
29460
|
+
SwapMode2["ExactOut"] = "ExactOut";
|
|
29461
|
+
return SwapMode2;
|
|
29462
|
+
})(SwapMode || {});
|
|
29463
|
+
var SwapVersion = /* @__PURE__ */ ((SwapVersion2) => {
|
|
29464
|
+
SwapVersion2[SwapVersion2["V2"] = 2] = "V2";
|
|
29465
|
+
SwapVersion2[SwapVersion2["V3"] = 3] = "V3";
|
|
29466
|
+
return SwapVersion2;
|
|
29467
|
+
})(SwapVersion || {});
|
|
29468
|
+
function deserializeSerializedInstruction(ix) {
|
|
29469
|
+
return new TransactionInstruction({
|
|
29470
|
+
programId: new PublicKey(Buffer.from(ix.p, "base64")),
|
|
29471
|
+
keys: ix.a.map((account) => ({
|
|
29472
|
+
pubkey: new PublicKey(Buffer.from(account.p, "base64")),
|
|
29473
|
+
isSigner: account.s,
|
|
29474
|
+
isWritable: account.w
|
|
29475
|
+
})),
|
|
29476
|
+
data: Buffer.from(ix.d, "base64")
|
|
29477
|
+
});
|
|
29478
|
+
}
|
|
29479
|
+
function selectBestRoute(quotes, swapMode) {
|
|
29480
|
+
const routes = Object.values(quotes);
|
|
29481
|
+
if (routes.length === 0) return null;
|
|
29482
|
+
return routes.reduce((best, route) => {
|
|
29483
|
+
if (swapMode === "ExactIn") {
|
|
29484
|
+
return route.outAmount > best.outAmount ? route : best;
|
|
29485
|
+
} else {
|
|
29486
|
+
return route.inAmount < best.inAmount ? route : best;
|
|
29487
|
+
}
|
|
29488
|
+
});
|
|
29489
|
+
}
|
|
29490
|
+
function buildSwapQuoteResult(route, swapMode) {
|
|
29491
|
+
const slippageBps = route.slippageBps;
|
|
29492
|
+
let otherAmountThreshold;
|
|
29493
|
+
if (swapMode === "ExactIn") {
|
|
29494
|
+
otherAmountThreshold = String(Math.floor(route.outAmount * (1 - slippageBps / 1e4)));
|
|
29495
|
+
} else {
|
|
29496
|
+
otherAmountThreshold = String(Math.ceil(route.inAmount * (1 + slippageBps / 1e4)));
|
|
29497
|
+
}
|
|
29498
|
+
return {
|
|
29499
|
+
inAmount: String(route.inAmount),
|
|
29500
|
+
outAmount: String(route.outAmount),
|
|
29501
|
+
otherAmountThreshold,
|
|
29502
|
+
slippageBps,
|
|
29503
|
+
platformFee: route.platformFee ? {
|
|
29504
|
+
amount: String(route.platformFee.amount),
|
|
29505
|
+
feeBps: route.platformFee.fee_bps
|
|
29506
|
+
} : void 0,
|
|
29507
|
+
contextSlot: route.contextSlot,
|
|
29508
|
+
timeTaken: route.timeTaken
|
|
29509
|
+
};
|
|
29510
|
+
}
|
|
29511
|
+
async function resolveLookupTables(connection, lutPubkeys) {
|
|
29512
|
+
if (lutPubkeys.length === 0) return [];
|
|
29513
|
+
const lutAccountsRaw = await connection.getMultipleAccountsInfo(lutPubkeys);
|
|
29514
|
+
return lutAccountsRaw.map((accountInfo, index) => {
|
|
29515
|
+
if (!accountInfo) return null;
|
|
29516
|
+
return new AddressLookupTableAccount({
|
|
29517
|
+
key: lutPubkeys[index],
|
|
29518
|
+
state: AddressLookupTableAccount.deserialize(accountInfo.data)
|
|
29519
|
+
});
|
|
29520
|
+
}).filter((account) => account !== null);
|
|
29521
|
+
}
|
|
29168
29522
|
|
|
29169
|
-
export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, ExtensionType, FARMS_PROGRAM_ID, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, ZERO, addSigners, approveInstructionData, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createApproveInstruction, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, decodeSwitchboardPullFeedData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToObligationRaw, dtoToReserveRaw, farmRawToDto, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, getSwitchboardProgram, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, interpolateLinear, isSpotBalanceTypeVariant, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo2 as parsePriceInfo, replenishPoolIx, reserveRawToDto, scaledSupplies, slotAdjustmentFactor, switchboardAccountCoder, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
|
|
29523
|
+
export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, ConnectionClosed, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, ErrorResponse, ExtensionType, FARMS_PROGRAM_ID, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, StreamError, SwapMode, SwapVersion, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, V1Client, ZERO, addSigners, approveInstructionData, buildSwapQuoteResult, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createApproveInstruction, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, decodeSwitchboardPullFeedData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, deserializeSerializedInstruction, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToObligationRaw, dtoToReserveRaw, farmRawToDto, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, getSwitchboardProgram, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, interpolateLinear, isSpotBalanceTypeVariant, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo2 as parsePriceInfo, replenishPoolIx, reserveRawToDto, resolveLookupTables, scaledSupplies, selectBestRoute, slotAdjustmentFactor, switchboardAccountCoder, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
|
|
29170
29524
|
//# sourceMappingURL=vendor.js.map
|
|
29171
29525
|
//# sourceMappingURL=vendor.js.map
|